diff options
author | Tony Anderson <tony@traveler.(none)> | 2011-03-24 12:08:15 (GMT) |
---|---|---|
committer | Tony Anderson <tony@traveler.(none)> | 2011-03-24 12:08:15 (GMT) |
commit | e013e05986de4f9663fabbc98682dc3f64ae6ecd (patch) | |
tree | 38a05f0ba52cb5e99e166ac128ebfe34dd4b7271 | |
parent | e902434d4d649332fe80932159d7dd802e9b7be6 (diff) |
update contentedit.html
-rwxr-xr-x | contentedit.html | 82 |
1 files changed, 40 insertions, 42 deletions
diff --git a/contentedit.html b/contentedit.html index 4c69076..9e18f83 100755 --- a/contentedit.html +++ b/contentedit.html @@ -2,15 +2,21 @@ <html> <head> <title>Siyavula Content Editor</title> -<link rel="stylesheet" href="content/karma/css/screen.css" type="text/css" /> <link rel="stylesheet" href="content/karma/css/global.css" type="text/css"/> -<script type="text/javascript" src="content/karma/js/external/jquery-1.4.2"></script> -<script type="text/javascript" src="content/karma/js/external/jquery.ui.1.8.2.js"</script> -<script type="text/javascript" src="content/karma/js/global.js"</script> +<script type="text/javascript" src="tinymce/jquery.js"></script> +<script type="text/javascript" src="tinymce/jquery.tinymce.js"></script> <script type="text/javascript" src="tinymce/tiny_mce.js"></script> <script type="text/javascript"> - +host = 'http://localhost:8008/' +url = window.location+''; +parts = url.split('?'); +parts.shift(); +openfile = parts[0]; +items = openfile.split('/'); +items.pop(); +openfolder = items.join('/')+'/'; +openfile = openfolder + 'source.txt'; tinyMCE.init({ mode : "textareas", theme : "advanced", @@ -18,35 +24,29 @@ tinyMCE.init({ theme_advanced_toolbar_align : 'left', theme_advanced_resizing : 'true', editor_selector:"mceAdvanced", - relative_urls : true, - document_base_url : 'http://localhost:8008/imgs', - content_css: "http://localhost:8008/content/css/global.css", + relative_urls : 'true', + document_base_url : host + openfolder, + content_css: host + 'content/karma/css/global.css', width: "1200", height: "4000" }); -host = 'http://localhost:8008/' -url = window.location+""; -parts = url.split('?'); -parts.shift() -openfile = parts[0]; -items = openfile.split('/'); -items.pop(); -openfile = items.join('/') + '/source.txt'; - $(document).ready(function(){ var ed = tinyMCE.get('cntnt'); $('#editreturn') - .bind('click', function(){window.location = parts.join('?')+'X'}) - $('#cntnt').load('http://localhost:8008/cgi-bin/fetchFile.py', - {'openfile':openfile} - ); + .bind('click', function(){window.location = host + openfolder + 'index.html'}) + $('#cntnt').load(host + 'cgi-bin/fetchFile.py', + {'openfile':openfile}, + function(responseTxt, status, xhr){ + $('#cntnt').text(responseTxt); + alert($('#content').html()); + }); }); function ajaxSave() { var ed = tinyMCE.get('cntnt'); ed.setProgressState(1); // Show progress - $('#cntnt').load('http:host+'cgi-bin/saveFile.py', + $('#cntnt').load(host+'cgi-bin/saveFile.py', {'openfile':openfile, 'content':ed.getContent()}, function(responseText, status, xhr){ ed.setProgressState(0); @@ -54,41 +54,39 @@ function ajaxSave() { }; function toggleEditor(id) { - if (!tinyMCE.get(id)) + if (!tinyMCE.get(id)){ tinyMCE.execCommand('mceAddControl', false, id); - else + }else{ tinyMCE.execCommand('mceRemoveControl', false, id); -} + }; +}; </script> </head> <body style='height: 4000'> <div id="header"> <div class="topbtn_left"> - <div title="linkBack" id="editreturn" class="linkBack" /></div> - </div> - <div id="lesson_title"> - <img src="content/karma/image/title_block_lt.png" width="33" height="75" align = "absmiddle" /> - Content Editor - <img src="content/karma/image/title_block_rt.png" width="33" height="75" align="absmiddle" /> + <div title="Back" id="editreturn" class="linkBack"></div> </div> - <div id = 'editfs'> - <fieldset style = "border:none"> - <a href="javascript:ajaxSave();">save</a> - <a href="javascript:toggleEditor('cntnt');">web/html</a> - </fieldset> + <div class='lesson_title'> + <img src='content/karma/image/title_block_lt.png' class='title_img'> + Content Editor + <img src='content/karma/image/title_block_rt.png' class='title_img'> </div> <div class="topbtn_right"> - <div title="Quit" id="linkQuit" class="linkQuit"></div> + <div title="Quit" id = 'linkQuit' class='linkQuit'>Quit</div> + </div> + <div class='topbtn_right'> + <a href="javascript:ajaxSave();">save</a> + </div> + <div class='topbtn_right'> + <a href="javascript:toggleEditor('cntnt');">web/html</a> </div> </div> <div id='content'> -<textarea id="cntnt" - name='cntnt' - class='mceAdvanced' -</textarea> + <textarea id="cntnt" name='cntnt' class='mceAdvanced'> + </textarea> </div> -<div id='footer'/> </body> </html> |