Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/studio
diff options
context:
space:
mode:
Diffstat (limited to 'studio')
-rw-r--r--studio/static/doc/sugar-theme.html2
l---------studio/static/icons1
-rw-r--r--studio/static/init.html8
l---------studio/static/static1
-rw-r--r--studio/studio.py18
-rw-r--r--studio/templates/editor.html2
-rw-r--r--studio/templates/filer.html9
-rw-r--r--studio/templates/index.html128
-rw-r--r--studio/templates/split-view.html7
9 files changed, 28 insertions, 148 deletions
diff --git a/studio/static/doc/sugar-theme.html b/studio/static/doc/sugar-theme.html
index ac09754..b90d88e 100644
--- a/studio/static/doc/sugar-theme.html
+++ b/studio/static/doc/sugar-theme.html
@@ -75,7 +75,7 @@
<body>
<h1>Welcome to jQuery UI!</h1>
<p style="font-size: 1.3em; line-height: 1.5; margin: 1em 0; width: 50%;">
- <a href="/edit/websdk/static/doc/sugar-theme.html">View the source of this document.</a>
+ <a target="frame1" href="/edit/studio/static/doc/sugar-theme.html">View the source of this document.</a>
</p>
<p style="font-weight: bold; margin: 2em 0 1em; font-size: 1.3em;">YOUR COMPONENTS:</p>
diff --git a/studio/static/icons b/studio/static/icons
deleted file mode 120000
index 9a5906b..0000000
--- a/studio/static/icons
+++ /dev/null
@@ -1 +0,0 @@
-../../icons/ \ No newline at end of file
diff --git a/studio/static/init.html b/studio/static/init.html
index 069b021..651b886 100644
--- a/studio/static/init.html
+++ b/studio/static/init.html
@@ -3,10 +3,10 @@
<head>
<meta charset="UTF-8" />
<title></title>
- <link rel="stylesheet" href="static/css/main.css" type="text/css" />
- <link rel="stylesheet" href="static/css/sugar-theme/jquery-ui-1.8.15.custom.css" />
- <script src="static/js/jquery-1.6.2.js" type="text/javascript"></script>
- <script src="static/js/jquery-ui-1.8.15.custom.min.js" type="text/javascript"></script>
+ <link rel="stylesheet" href="css/main.css" type="text/css" />
+ <link rel="stylesheet" href="css/sugar-theme/jquery-ui-1.8.15.custom.css" />
+ <script src="js/jquery-1.6.2.js" type="text/javascript"></script>
+ <script src="js/jquery-ui-1.8.15.custom.min.js" type="text/javascript"></script>
<!--script src="js/websdk-1.js" type="text/javascript"></script-->
</head>
<body>
diff --git a/studio/static/static b/studio/static/static
deleted file mode 120000
index 945c9b4..0000000
--- a/studio/static/static
+++ /dev/null
@@ -1 +0,0 @@
-. \ No newline at end of file
diff --git a/studio/studio.py b/studio/studio.py
index 586bf2d..d3c9fe9 100644
--- a/studio/studio.py
+++ b/studio/studio.py
@@ -1,7 +1,7 @@
import os
import sys
-from flaskext.genshi import Genshi, render_response
from flask import Flask,request,url_for,redirect
+from flaskext.genshi import Genshi, render_response
studio = Flask(__name__)
studio.debug = True
@@ -39,15 +39,14 @@ def identify(filename):
if os.path.isdir(filename):
icon = 'folder.png'
href = '/files/%s' % filename
+ mode = 'dir'
if filename.endswith('.xo'):
href = '#'
return icon,mode,href
@studio.route('/')
def index():
- port = request.environ.get('SERVER_PORT')
- return render_response('index.html', dict(name="WebSDK Activity",
- port=port))
+ return vsplit()
@studio.route('/edit/')
@studio.route('/edit/<path:filename>')
@@ -69,7 +68,7 @@ def save():
print "saving content: %s" % filename
f.close()
directory = os.path.dirname(filename)
- return redirect(url_for('browse', directory=directory))
+ return redirect(url_for('help'))
@studio.route('/files/')
@studio.route('/files/<path:directory>')
@@ -79,6 +78,7 @@ def browse(directory="."):
if not os.path.abspath(directory)==os.path.abspath("."):
files.append( { 'name': '..',
'icon': 'folder.png',
+ 'mode': 'dir',
'href': '/files/%s' % os.path.join(directory,"..") })
for filename in sorted(filelist):
icon, mode, href = identify(directory + "/" + filename)
@@ -88,6 +88,7 @@ def browse(directory="."):
continue
files.append( { 'name': filename,
'icon': icon,
+ 'mode': mode,
'href': href } )
return render_response('filer.html', dict(files=files, absdir=os.path.normpath(directory)))
@@ -102,7 +103,12 @@ def shutdown():
shutdown_server()
return 'Goodbye'
-def vsplit(frame1='/files/studio', frame2='/files/studio/templates'):
+@studio.route('/help')
+def help():
+ port = request.environ.get('SERVER_PORT')
+ return render_response('help.html', dict(port=port))
+
+def vsplit(frame1='/help', frame2='/files/studio'):
return render_response('split-view.html', dict(frame1=frame1, frame2=frame2))
@studio.route('/split')
diff --git a/studio/templates/editor.html b/studio/templates/editor.html
index 88e45cb..721a2fb 100644
--- a/studio/templates/editor.html
+++ b/studio/templates/editor.html
@@ -30,7 +30,7 @@
<input type="hidden" name="filename" id="filename" value="$filename" />
<input type="hidden" name="directory" id="directory" value="$directory" />
<input type="hidden" name="content" id="content" value="ñññ" />
-<input type="button" class="btn" value="Browse" onclick='location.href="/files/$directory"' />
+<!--input type="button" class="btn" value="Browse" onclick='location.href="/files/$directory"' /-->
<br/>
<input type="submit" value="Save file" /><br/>
<input type="button" class="btn" value="Delete file" onclick='location.href="/delete/${filename}"' />
diff --git a/studio/templates/filer.html b/studio/templates/filer.html
index 5ca87e7..f03f3ac 100644
--- a/studio/templates/filer.html
+++ b/studio/templates/filer.html
@@ -39,10 +39,15 @@
<div id="filer" class="bling">
<ul>
<li py:for="file in files">
- <a href="${file.href}" class="file">
+ <a py:if="file.mode == 'dir'" href="${file.href}" class="file">
<img src="/static/icons/${file.icon}" style="border:none;"/>
<br/>${file.name}
- </a></li>
+ </a>
+ <a py:if="file.mode != 'dir'" target="frame1" href="${file.href}" class="file">
+ <img src="/static/icons/${file.icon}" style="border:none;"/>
+ <br/>${file.name}
+ </a>
+ </li>
</ul>
</div>
<script>
diff --git a/studio/templates/index.html b/studio/templates/index.html
deleted file mode 100644
index 1dd74e5..0000000
--- a/studio/templates/index.html
+++ /dev/null
@@ -1,128 +0,0 @@
-<!DOCTYPE HTML>
-<html lang="en-US">
-<head>
- <meta charset="UTF-8" />
- <title></title>
- <link rel="stylesheet" href="/static/css/main.css" type="text/css" />
- <link rel="stylesheet" href="/static/css/sugar-theme/jquery-ui-1.8.16.sugar.css" />
- <script src="/static/js/jquery-1.6.2.js" type="text/javascript"></script>
- <script src="/static/js/jquery-ui-1.8.16.sugar.min.js" type="text/javascript"></script>
- <script src="/static/js/jquery.corner.js" type="text/javascript"></script>
- <script src="/static/js/websdk-1.js" type="text/javascript"></script>
-</head>
-<body>
- <div id="content" class="bling">
- <header><h1>WebSDK Studio <span id="beta">Tech Preview 2</span><br /><em style="font-size: 10pt;"> "craftsmanship" </em></h1></header>
- <section>
- <div style="float:left; width:60%;">
- <div id="accordion">
- <div>
- <h3><a href="#">Start with your Logic</a></h3>
- <div style="text-align:right"><div style="float:left; padding-right: 15px;"><img src="/static/images/logo-flask-s.png" /></div>
- <p>You can build Sugar Activities using standard web technologies with WebSDK.
- The controller is where the logic of your Activity is expressed.
- At the core of WebSDK there is Flask: a microframework built with good intentions.</p>
- <p>The controller is implemented in the <a href="/edit/studio/studio.py">studio.py</a> file.
- </p>
- <input type="button"
- value="Quick Start" onclick='location.href="/static/doc/flask-docs/quickstart.html#quickstart"' />
- <input type="button"
- value="Documentation Index" onclick='location.href="/static/doc/flask-docs/index.html"' />
- <input type="button"
- value="API" onclick='location.href="/static/doc/flask-docs/api.html#api"' />
- </div>
- </div>
- <div>
- <h3><a href="#">Build your User Experience</a></h3>
- <div style="text-align:right"><div style="float:left; padding-right: 15px;"><img src="/static/images/logo-jqueryui.gif" /></div>
- <p>Animation, advanced effects and widgets, built using HTML, CSS and Javascript, that you can use to build highly interactive Sugar Activities.</p>
- <p>The initial screen for an activity is in <a href="/edit/studio/templates/index.html">index.html</a>. You can browse the <a href="/files/studio/templates">templates</a> directory for other views.</p>
- <input type="button"
- value="Sugar Web Widgets" onclick='location.href="/static/doc/sugar-theme.html"' />
- </div>
- <div>
- <h3><a href="#">Deeper in Sugar</a></h3>
- <div style="text-align:right"><div style="float:left; padding-right: 15px;"><img src="/static/images/logo-sugar-trans.png" /></div>
- <p>This is where you set up your toolbars. If you need further system interaction at a lower level you'll start here.</p>
- <p><a href="/edit/activity.py">activity.py</a> contains the browser loader for Sugar.</p>
- <input type="button"
- value="Make Your Own Sugar Activities" onclick='location.href="static/doc/myosa/ch000_table_of_contents.xhtml"' />
- </div>
- </div>
- </div>
- </div>
- </div>
- <div id="accordion2" style="width:38%; float:right">
- <div>
- <h3><a href="#">${name}</a></h3>
- <div>
- <div id="filer-header" style="padding-top: 5px; padding-bottom: 5px">
- Frequent actions
- </div>
- <div id="filer" style="display:inline;">
- <ul>
- <li>
- <a href="/edit/studio/studio.py" class="file">
- <img src="/static/icons/text-x-python.png" />
- <br />studio.py
- </a>
- </li>
- <li>
- <a href="/edit/studio/templates/index.html" class="file">
- <img src="/static/icons/text-uri-list.png" />
- <br />index.html
- </a>
- </li>
- <li>
- <a href="/files/studio/templates" class="file">
- <img src="/static/icons/folder.png" />
- <br />templates
- </a>
- </li>
- <li>
- <a href="/files/studio/static" class="file">
- <img src="/static/icons/folder.png" />
- <br />static
- </a>
- </li>
- <li>
- <a href="/edit/./activity.py" class="file">
- <img src="/static/icons/text-x-python.png" />
- <br />activity.py
- </a>
- </li>
- <li>
- <a href="/edit/studio/static/css/main.css" class="file">
- <img src="/static/icons/text-uri-list.png" />
- <br />main.css
- </a>
- </li>
- </ul>
- <div style="float:both; width:100%">
- <p style="font-size:8pt;">Running on port ${port}.</p>
- </div>
- </div>
- </div>
- <input type="button" value="Split view" onclick='location.href="/split"' />
- </div>
- </div>
- </section>
- </div>
- <script>
- window.onload = function() {
- $('#content').fadeIn(700);
- $('.file').corner("15px");
- $('#filer-header').corner("15px");
- $('.bling').show("slow");
- /* if ($.browser.mozilla) {
- $('#filer img').hide();
- $('#filer span').show();
- } This was SVG workaround but is broken in older
- gecko anyway*/
- $('#beta').delay(1500).fadeIn("slow");
- $("#accordion").accordion({ header: "h3" });
- $("#accordion2").accordion({ header: "h3" });
- }
- </script>
-</body>
-</html>
diff --git a/studio/templates/split-view.html b/studio/templates/split-view.html
index e23b696..444a460 100644
--- a/studio/templates/split-view.html
+++ b/studio/templates/split-view.html
@@ -2,9 +2,8 @@
<head>
<title>basic frameset</title>
</head>
-
-<frameset rows="50%, *">
- <frame src="${frame1}" />
- <frame src="${frame2}" />
+<frameset rows="*, 155px">
+ <frame name="frame1" src="${frame1}" />
+ <frame name="frame2" src="${frame2}" />
</frameset>
</html>