Skip to content

Commit

Permalink
re-enabled User CSS editing
Browse files Browse the repository at this point in the history
  • Loading branch information
funkatron committed Dec 17, 2010
1 parent f523c58 commit 08e471e
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 51 deletions.
91 changes: 52 additions & 39 deletions html/css_edit.html
Expand Up @@ -8,20 +8,33 @@
<title>User CSS Editor</title>
<link rel="stylesheet" href="utilitywindow.css" type="text/css" media="screen" title="no title" charset="utf-8">



<style type="text/css" media="screen">
#css {
border:2px solid #AAA;
-khtml-border-radius:10px;
padding:5px;
border: none;
border-top: 1px solid #999;
border-bottom: 1px solid #999;
padding: 5px;
font-family: AnonymousPro, Anonymous, Inconsolata, Consolas, Monaco, "Courier New", monospaced;
line-height: 1.5em;
}
#content {
margin-top: 34px;
padding: 10px 0px;
}
#buttons {
text-align:right;
}
</style>

<script src="app:/vendors/air/AIRAliases.js" type="text/javascript" charset="utf-8"></script>
<script src="app:/vendors/jquery/jquery.js" type="text/javascript" charset="utf-8"></script>
<script src="app:/vendors/jquery.dimensions.js" type="text/javascript" charset="utf-8"></script>
<script src="app:/vendors/jquery/jquery.textarea.js"></script> <!-- $.tabby() -->
<script src="app:/app/spaz.js" type="text/javascript" charset="utf-8"></script>
<script src="app:/apps/libs/spaz.sys.js" type="text/javascript" charset="utf-8"></script>
<script src="app:/apps/libs/spaz.debug.js" type="text/javascript" charset="utf-8"></script>
<script src="app:/app/libs/spaz.sys.js" type="text/javascript" charset="utf-8"></script>
<script src="app:/app/libs/spaz.debug.js" type="text/javascript" charset="utf-8"></script>
<script src="app:/app/views/spaz.themes.js" type="text/javascript" charset="utf-8"></script>
<script src="app:/spazcore/spazcore-air.js" type="text/javascript" charset="utf-8"></script>

Expand All @@ -32,19 +45,19 @@
<script type="text/javascript" charset="utf-8">

function resizeTextarea() {
$('#css').height($(window).height()-$("#css").offset().top-35);
$('#css').width($('#content').width()-15);
$('#css').height($(window).height()-$("#css").offset().top-50);
$('#css').width($('#content').width()-5);
}


function getUserCSS() {
$('#css').val( $(window.opener.document.getElementById('UserCSSOverride')).text() )
// alert(window.opener.document.getElementById('UserCSSOverride').innerText)
$('#css').val( $(window.opener.document.getElementById('UserCSSOverride')).text() );
sch.debug(window.opener.document.getElementById('UserCSSOverride').innerText);
}

function setUserCSS() {
// alert($('#css')[0].outerHTML);
// alert('hi! '+$('#css').val())
sch.debug($('#css')[0].outerHTML);
sch.debug('hi! '+$('#css').val());


$(window.opener.document.getElementById('UserCSSOverride')).text( $('#css').val() );
Expand All @@ -54,32 +67,30 @@
Spaz.Sys.setFileContents(csspath, $('#css').val() );

// getUserCSS()
// alert(window.opener.document.getElementById('UserCSSOverride').innerText)
sch.debug(window.opener.document.getElementById('UserCSSOverride').innerText);
}

$(window).resize(
function() {
resizeTextarea()
}
)

$(document).ready(
function() {
resizeTextarea();
getUserCSS()
}


$(document).ready(function() {
$('#save').click(
function() {
$('#css').val();
}
);

)
$('#reset').click(getUserCSS);

// $('#save').click(
// function() {
// $('#css').val()
// }
// );
// $('#reset').click(getUserCSS);
// $('#css').change(setUserCSS);
$('#css').change(setUserCSS);

$(window).resize(function() {
resizeTextarea();
});

resizeTextarea();
getUserCSS();
$('#css').tabby();
});

</script>

Expand All @@ -90,14 +101,16 @@
<h1>User CSS Editor</h1>
<div id="content">
<form action="poop" method="get">
<div id="buttons">
<input type="button" name="save" value="Save" id="save" onclick="setUserCSS()" />
<input type="button" name="reset" value="Reset" id="reset" onclick="getUserCSS()" />
<a class="clickable" onClick="sc.helpers.openInBrowser('http://funkatron.com/spaziki/User-CSS-Hacks/')" title="Load the Spaziki CSS hacks page">Get &amp; share CSS hacks</a>
<!-- <span style="color:red">CSS Does Not Get Saved Yet</span> -->
</div>
<!-- <input type="text" name="csscode" value="" id="css" /> -->
<textarea name="csscode" id="css">hi</textarea>
<textarea name="csscode" id="css" cols="120" rows="30">
/* User CSS Overrides */

</textarea>
<div id="buttons">
<a class="clickable" onClick="sc.helpers.openInBrowser('http://getspaz.com/csshacks')" title="Load the Spaziki CSS hacks page">Get &amp; share CSS hacks</a>
<input type="button" name="reset" value="Reset" id="reset" onclick="getUserCSS()" />
<input type="button" name="save" value="Save" id="save" onclick="setUserCSS()" />
<!-- <span style="color:red">CSS Does Not Get Saved Yet</span> -->
</div>
</form>
</div>
</body>
Expand Down
13 changes: 3 additions & 10 deletions html/utilitywindow.css
Expand Up @@ -4,18 +4,12 @@
body {
padding:0px;
margin:0px;
font-family:Tahoma, Arial, Helvetica, sans-serif;
background-color: #FFFF9B;
background-image: url('img/body-bg.png');
background-repeat:repeat-x;
background-position: center bottom;
-webkit-background-size:100% 100%;
font-family:Myriad Pro, Tahoma, Arial, Helvetica, sans-serif;
font-size:.8em;
color:#444444;
height:100%;
bottom:0px;
top:0px;

background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#ccc));
overflow:auto;
}

Expand All @@ -39,7 +33,7 @@ h1 {
width:100%;
top:0px;
height:25px;
background-image: url('img/spaz-icon-alpha.png');
background-image: url('../images/spaz-icon-alpha.png');
background-repeat: no-repeat;
background-position: 90% 40%;
}
Expand All @@ -64,7 +58,6 @@ h2 {
bottom:0px;
top:0px;
overflow:auto;

}

div.formrow {
Expand Down
4 changes: 2 additions & 2 deletions index.html
Expand Up @@ -573,8 +573,8 @@ <h2 class="CollapsiblePanelTab" tabindex="0">
<fieldset>
<legend>Theme</legend>
<div class="formrow">
<label><strong>User CSS is currently disabled</strong></label>
<div style="display:none">
<label>User CSS Overrides</label>
<div>
<!-- <input disabled="disabled" type="text" name="user-stylesheet" value="" id="prefs-user-stylesheet" /> -->
<input type="button" name="user-stylesheet-button" value="Load from file" id="prefs-user-stylesheet-button" onclick="Spaz.Themes.browseForUserCss()" />
<input type="button" name="user-stylesheet-edit" value="Edit User CSS" id="prefs-user-stylesheet-edit" onclick="Spaz.UI.showCSSEdit()" />
Expand Down

0 comments on commit 08e471e

Please sign in to comment.