Skip to content

Commit

Permalink
sum stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich Jones committed Sep 5, 2011
1 parent 37c50b2 commit 7a864be
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 18 deletions.
8 changes: 7 additions & 1 deletion README.mkd
@@ -1,3 +1,9 @@
# LightWrite
# [http://gun.io/w/](LightWrite) - by Gun.io
## A web-based WriteRoom clone
### Rich Jones - rich@gun.io

LightWrite is a free and open source web-based clone of (http://www.hogbaysoftware.com/products/writeroom)[WriteRoom] by HogBaySoftware.

LightWrite is built on lots of open source componants, including Python, Django, jQuery, and Smoke.js.

Are there bugs or features you want for LightWrite? Get in touch!
16 changes: 16 additions & 0 deletions lightwrite/templates/about.html
@@ -0,0 +1,16 @@
<html>
<head>
<title>About LightWrite</title>
<body style="background: #ffffff; padding: 5px; text-shadow: 0 1px 1px #FFF6E1;">
<h3>About LightWrite</h3>
<p>LightWrite is a free and open source web-based clone of <a href="http://www.hogbaysoftware.com/products/writeroom" target="_blank">WriteRoom</a> by HogBaySoftware.
<p>The source code is available <a href="http://github.com/gunio/" target="_blank">on GitHub here</a>
<p>LightWrite is built on lots of open source componants, including Python, Django, jQuery, and Smoke.js.
<p>Are there bugs or features you want for LightWrite? <a href="http://gun.io/contact/" target="_blank">Get in touch!</a>

<h3>About Gun.io</h3>
<p>LightWrite is written in Django by Rich Jones for <a href="http://gun.io" target="_blank">Gun.io</a>, a place for independent and open source developers to hire assistance on their projects.
</div>
</body>
</html>

48 changes: 35 additions & 13 deletions lightwrite/templates/light.html
Expand Up @@ -13,12 +13,16 @@
$("#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(){
alert('sendo');
var writearea= $('textarea[name=writearea]');
var csrf= $('input[name=csrfmiddlewaretoken]');
var data = 'csrfmiddlewaretoken=' + csrf.val() + '&writearea=' + encodeURIComponent(writearea.val()) + '&save=Save+Online';
Expand All @@ -32,6 +36,11 @@
return false;
}
</script>
<script type="text/javascript">
function save(){
$('#bodytext').submit();
}
</script>
<script type="text/javascript">
function lights(){
if(!light){
Expand All @@ -56,6 +65,19 @@

}
</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>
<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>
Expand All @@ -64,23 +86,23 @@
<body>
<center>
<div id="main">
<form name="bodytext" onclick="$('#footer-items').slideUp('fast');" method="post" action="/{{wash}}" target="saver">
<div>{% csrf_token %}<textarea cols="50" rows="20" id="writearea" name="writearea"></textarea>
<form name="bodytext" method="post" action="/{{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: 720px">
<div id="logo" style="float:left; text-align: left;">
<img src="/static/gunio.png">
<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>
<div id="buttons" style="float: center; width: 350px; text-align: center;">
<button onClick="sendo()" class="clean-gray">Save Online</button>
<button onClick="" class="clean-gray">Export to File</button>
<button onClick="lights()" class="clean-gray">Lights</button>
</form>
</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="display:inline;float: right; text-align: right;">
<button onClick="lights()" class="clean-gray">About</button>
<div id="about" style="float: right;">
<button onClick="javascript:popup('/a/about', 'About');" type="button" class="clean-gray">About</button>
</div>
</div>
</div>
Expand Down
6 changes: 5 additions & 1 deletion lightwrite/texts/views.py
Expand Up @@ -41,8 +41,12 @@ def json_get_text(request, wash):
t = Text.objects.filter(wash=wash)
if (len(t)==0):
t = Text(wash=wash)
t.text = '\n\nWelcome to LightWrite!\nby Gun.io\n\nLightWrite is a web-based clone of WriteRoom - it\'s a place to write your thoughts without any distractions.\n\nTo use LightWrite, just start typing! You can move your mouse over the bottom of the page to save your text online or export to a file. \n\nTo enter fullscreen mode, just press F11.'
# TODO: Render Command as Unicode
t.text = '\n\nWelcome to LightWrite!\nby Gun.io\n\nLightWrite is a web-based clone of WriteRoom - it\'s a place to write your thoughts without any distractions.\n\nTo use LightWrite, just start typing! You can move your mouse over the bottom of the page to save your text online or export to a file. \n\nTo enter fullscreen mode, just press F11, or Command F if you\'re using OSX.\n\nEnjoy!\n\nLove,\nTeam Gun.io'
t.save()
t = Text.objects.filter(wash=wash)
data = serializers.serialize("json", t)
return HttpResponse(data, mimetype='application/json')

def about(request):
return render_to_response('about.html')
1 change: 1 addition & 0 deletions lightwrite/urls.py
Expand Up @@ -10,6 +10,7 @@
# url(r'^$', 'lightwrite.views.home', name='home'),
url(r'^(?P<wash>[a-zA-Z0-9_.-]+)$', 'lightwrite.texts.views.write'),
url(r'^t/(?P<wash>[a-zA-Z0-9_.-]+)/$', 'lightwrite.texts.views.json_get_text'),
url(r'^a/about/$', 'lightwrite.texts.views.about'),
url(r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root':settings.MEDIA_ROOT}),
url(r'^$', 'lightwrite.texts.views.root'),
# Uncomment the admin/doc line below to enable admin documentation:
Expand Down
Binary file added static/gunio2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 10 additions & 3 deletions static/light.css
Expand Up @@ -6,6 +6,9 @@ html{

}

a{border-width: 0px;}
img{border-width: 0px;}

body{
background: #ffffff;
padding: 0;
Expand All @@ -30,12 +33,13 @@ body{
margin: 0;
padding: 0;
text-shadow: 0 0 1px #666677;

resize: none;
}

#footer{
background: #ffffff;
height: 20%;
margin-top: 50px;
height: 5%;
}

#footer-items{
Expand Down Expand Up @@ -68,7 +72,10 @@ button.clean-gray {
padding: 8px 0;
text-align: center;
text-shadow: 0 1px 0 #eee;
width: 100px; }
width: 100px;
margin-left: 5px;
margin-right: 5px;
}
button.clean-gray:hover {
background-color: #dddddd;
background-image: -webkit-gradient(linear, left top, left bottom, from(#dddddd), to(#bbbbbb));
Expand Down

0 comments on commit 7a864be

Please sign in to comment.