Skip to content
Browse files

fixes #16

  • Loading branch information...
1 parent c70c671 commit 96eb68a25d2df08eeb4bc09ec6a77ba0a461b37b @pizzapanther committed Oct 19, 2011
View
3 neutron/NOTES
@@ -0,0 +1,3 @@
+Updating Version Change:
+ ide/static/ide/js/menu.js
+ ide/templates/ide/home.html
View
46 neutron/ide/static/ide/css/default.css
@@ -16,6 +16,26 @@ textarea {
float: right;
}
+img {
+ border: 0;
+}
+
+button img {
+ display: inline-block;
+}
+
+.ui-layout-north {
+
+}
+
+#main_menu {
+ border: solid 1px #bbb;
+ background-color: #DDD;
+ position: absolute;
+ z-index: 1000;
+ display: none;
+}
+
#current_edit {
font-size: 0.8em;
overflow: hidden;
@@ -104,9 +124,10 @@ ul.jqueryFileTree {
}
.ui-layout-north.ui-layout-pane {
- padding: 2px 5px 0 5px;
+ padding: 2px 5px;
background: #DDD;
border: 0;
+ overflow: hidden;
}
.ui-layout-resizer.ui-layout-resizer-north {
@@ -125,6 +146,15 @@ ul.jqueryFileTree {
padding-left: 40px;
}
+#saveall {
+ display: none;
+}
+
+#saveall p {
+ padding: 0;
+ margin: 2px 0;
+}
+
.right_menu {
border: solid 1px #bbb;
background-color: #DDD;
@@ -135,29 +165,29 @@ ul.jqueryFileTree {
z-index: 1000;
}
-.right_menu a {
+.right_menu a, #main_menu a {
color: #333;
font-size: 11px;
line-height: 18px;
text-decoration: none;
}
-.right_menu a:hover {
+.right_menu a:hover, #main_menu a:hover {
background-color: #BDF;
}
-.right_menu ul {
+.right_menu ul, #main_menu ul {
margin: 0;
padding: 0;
list-style-type: none;
}
-.right_menu ul li {
+.right_menu ul li, #main_menu ul li {
padding: 2px;
margin: 0;
}
-.right_menu ul li.btop {
+.right_menu ul li.btop, #main_menu ul li.btop {
border-top: solid 1px #bbb;
}
@@ -166,13 +196,13 @@ ul.jqueryFileTree {
text-align: center;
}
-.right_menu ul li a {
+.right_menu ul li a, #main_menu ul li a {
display: block;
width: 120px;
padding: 3px 0 0 23px;
}
-.right_menu ul li a {
+.right_menu ul li a, #main_menu ul li a {
background-repeat: no-repeat;
background-position: 0px 3px;
}
View
BIN neutron/ide/static/ide/img/menu.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
4 neutron/ide/static/ide/js/default.js
@@ -95,7 +95,7 @@ function create_tab (data) {
editor.resize();
editor.getSession().setValue(data.data);
- tab_paths[data.path] = {tab: tab_counter, editor: editor, filename: data.filename}
+ tab_paths[data.path] = {tab: tab_counter, editor: editor, filename: data.filename, uid: data.uid}
tab_counts[tab_counter] = data.path
tab_counter++;
@@ -127,7 +127,7 @@ function resize_editor () {
var cnt = split_href(href);
var h = $("#tabs").height();
- $("#editor_" + cnt).height(h - 29);
+ $("#editor_" + cnt).height(h - 27);
try {
tab_paths[dp].editor.resize();
}
View
37 neutron/ide/static/ide/js/menu.js
@@ -1,4 +1,39 @@
function about () {
- alert('Neutron IDE v11.10 by Paul M Bailey - paul.m.bailey@gmail.com\n\nneutronide.com\n\nLicense: GPLv3');
+ alert('Neutron IDE v11.11 by Paul M Bailey - paul.m.bailey@gmail.com\n\nneutronide.com\n\nLicense: GPLv3');
}
+
+function SaveAll () {
+ $( "#saveall" ).dialog({
+ title: 'Save All',
+ modal: true,
+ closeOnEscape: false,
+ open: function(event, ui) {
+ $(this).parent().children().children('.ui-dialog-titlebar-close').hide();
+ },
+ });
+
+ for (dp in tab_paths) {
+ var contents = tab_paths[dp].editor.getSession().getValue();
+
+ $("#saveall").empty();
+ $("#saveall").append('<p id="saveall_' + tab_paths[dp].uid + '">Saving ' + tab_paths[dp].filename + ' ...</p>');
+
+ $.ajax({
+ type: 'POST',
+ url: '/filesave/',
+ data: {'path': dp, 'contents': contents},
+ success: function (data, textStatus, jqXHR) {
+ $("#saveall_" + data.uid).remove();
+ if (data.result == 'bad') {
+ alert(data.error);
+ }
+
+ if ($('#saveall').children().size() == 0) {
+ $("#saveall").dialog('close');
+ }
+ },
+ error: function (jqXHR, textStatus, errorThrown) { alert('Error Saving: ' + dp); $("#status").html(''); },
+ });
+ }
+}
View
17 neutron/ide/templates/ide/home.html
@@ -14,10 +14,17 @@
{% endwith %}
{% endblock %}
{% block content %}
-<div class="ui-layout-north" onmouseover="myLayout.allowOverflow('north')" onmouseout="myLayout.resetOverflow(this)">
- <span id="logo" class="logo">Neutron IDE V11.10</span>
+<div class="ui-layout-north">
+ <span id="logo" class="logo">Neutron IDE V11.11</span>
<input type="button" value="Save" onclick="SaveCurrentTab()"/>
- <input type="button" value="About" onclick="about()"/>
+ <input type="button" value="Save All" onclick="SaveAll()"/>
+ <input type="button" value="Close All" onclick="alert('narf')"/>
+ <button id="menu_button" onclick="show_menu()"><img src="{{ STATIC_URL }}ide/img/menu.png" alt="Menu" title="Menu"/></button>
+ <div id="main_menu">
+ <ul>
+ <li><a href="javascript: void(0)" onclick="about()">About</a></li>
+ </ul>
+ </div>
<div id="current_edit">Welcome to Neutron IDE</div>
<div id="status"></div>
</div>
@@ -32,4 +39,6 @@
</div>
{% include "ide/right_menu_dir.html" %}
{% endblock %}
-{% block footer %}{% endblock %}
+{% block footer %}
+<div id="saveall"></div>
+{% endblock %}
View
5 neutron/ide/views.py
@@ -146,7 +146,7 @@ def filesave (request):
else:
error = 'File Access Denied'
- return http.HttpResponse(json.dumps({'result': ret, 'error': error}), mimetype=settings.JSON_MIME)
+ return http.HttpResponse(json.dumps({'result': ret, 'error': error, 'uid': hashstr(path)}), mimetype=settings.JSON_MIME)
@login_required
def fileget (request):
@@ -173,7 +173,8 @@ def fileget (request):
'data': fh.read(),
'path': f,
'filename': os.path.basename(f),
- 'mode': mode
+ 'mode': mode,
+ 'uid': hashstr(f)
}
else:

0 comments on commit 96eb68a

Please sign in to comment.
Something went wrong with that request. Please try again.