Skip to content

Commit

Permalink
solve issue #26
Browse files Browse the repository at this point in the history
  • Loading branch information
misterpah committed Jun 2, 2014
1 parent 3ae4a7e commit 5b8e68b
Show file tree
Hide file tree
Showing 13 changed files with 101 additions and 44 deletions.
4 changes: 2 additions & 2 deletions bin/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ <h3><img src="haxe-studio.png" width=64 /><br/>Haxe Studio</h3>

<div style="z-index:9999" class='notifications bottom-right'></div>
<div class="row" id="content_position">
<div class='hidden-xs hidden-sm col-md-2 col-lg-2' ><div id='tree_position' class="col-lg-12"></div></div>
<div class='col-md-10 col-xs-12 col-lg-10' id='editor_position'></div>
<div class='hidden-xs col-sm-3 col-md-2 col-lg-2' ><div id='tree_position' class="col-lg-12"></div></div>
<div class='col-sm-9 col-md-10 col-xs-12 col-lg-10' id='editor_position'></div>
</div>
<div id='temp' style='display:none'></div>
</body>
Expand Down
1 change: 1 addition & 0 deletions bin/js/defaultMenu.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
var menubar = new gui.Menu({ type: 'menubar' });

var sub1 = new gui.Menu();

var FileMenu = new gui.Menu();
Expand Down
2 changes: 1 addition & 1 deletion bin/js/haxestudio.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bin/js/haxestudio.js.map

Large diffs are not rendered by default.

52 changes: 40 additions & 12 deletions bin/theme/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,16 @@ color:#ffffff !important;
.navbar-default .navbar-nav>li>a:hover
{
color:#F1C40F !important;
background:#ae440f;
background:#d35400;

}



/* menu dropdown */
.navbar-default .navbar-nav>.open>a, .navbar-default .navbar-nav>.open>a:hover, .navbar-default .navbar-nav>.open>a:focus
{
background:#ae440f;
background:#d35400;
color:#ffffff;
}

Expand All @@ -106,7 +107,7 @@ color:#ffffff;
border:1px solid #397ff6;
border:0px;
border-left:0px;
background:#ae440f;
background:#d35400;
text-shadow: 0px 2px 1px rgba(0, 0, 0, 0.4);
}
/* menu dropdown */
Expand Down Expand Up @@ -135,7 +136,7 @@ text-shadow: 0px 2px 1px rgba(0, 0, 0, 0.8);

#misterpah_editor_tabs_position ul
{
border-color:#ae440f;
border-color:#d35400;
}

#misterpah_editor_tabs_position ul li
Expand All @@ -146,24 +147,25 @@ height:30px;
#misterpah_editor_tabs_position ul li.active a
{
color:#ffffff;
background:#ae440f;
background:#d35400;
text-shadow: 0px 1px 1px rgba(0, 0, 0, 0.8);
border-color:#ae440f;
border-color:#d35400;
}

#misterpah_editor_tabs_position ul li a:hover
{
color:#ffffff;
background:#f5af8c;
text-shadow: 0px 1px 1px rgba(0, 0, 0, 0.8);
border-color:#ae440f;
border-color:#d35400;
height:37px;
}


#misterpah_editor_tabs_position ul li a
{
top:-7px;
color:#ae440f;
color:#d35400;
font-family:"Ubuntu";
font-size:15px;
text-shadow: 0px 1px 1px rgba(0, 0, 0, 0.8);
Expand Down Expand Up @@ -195,17 +197,17 @@ line-height:20px;
*/
}
::-webkit-scrollbar-thumb {
background-color: #ae440f;
background-color: #d35400;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
background-color: #ae440f;
background-color: #d35400;
}

textarea::selection {
background: #ae440f;
background: #d35400;
color:#ffffff;
}

Expand Down Expand Up @@ -235,12 +237,38 @@ color:#ffffff;
}




/* project Tree */


#tree_position a {
color: #ffffff;
text-shadow: 0px 1px 1px rgba(0, 0, 0, 0.8);
border-color: #ae440f;
border-color: #d35400;
}


#misterpah_editor_cm_position
{
border-left:1px solid #d35400;
}


#tree_position a.folder
{
color: #f39c12;
}

#tree_position a.file
{
/*color: #2980b9;*/
color:#e74c3c;
}

#tree_position a.xml,#tree_position a.hx,#tree_position a.hxml,#tree_position a.txt
{
color: #2980b9;
}


1 change: 1 addition & 0 deletions plugin/plugin.misterpah.Editor/bin/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ plugin.misterpah.Editor.show_tab = function(path,tabShow) {
$("#misterpah_editor_tabs_position a[data-path='" + path + "']").parent().addClass("active");
}
new $("#misterpah_editor_cm_position").css("display","block");
gui.Window.get().resizeBy(1,1);
plugin.misterpah.Editor.cm.focus();
plugin.misterpah.Editor.cm.refresh();
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@ import CodeMirror;
}

new JQuery("#misterpah_editor_cm_position").css("display","block");
untyped gui.Window.get().resizeBy(1,1);
cm.focus();
cm.refresh();

Expand Down
1 change: 1 addition & 0 deletions plugin/plugin.misterpah.ProjectTree/bin/plugin.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion plugin/plugin.misterpah.ProjectTree/bin/plugin.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions plugin/plugin.misterpah.ProjectTree/bin/projectTree.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#tree_position ul
{
padding-left:10px;
list-style-type:none;
}

#tree_position>ul
{
padding:0px;
}

65 changes: 39 additions & 26 deletions plugin/plugin.misterpah.ProjectTree/bin/projectTree.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$("#tree_position").html("");
var folder_content = Utils.readDir(Main.session.project_folder);


function openMe(obj)
{
var path = $(obj).attr('data-path');
Expand All @@ -11,50 +11,63 @@ function openMe(obj)
function openFolder(obj)
{
var html = $(obj).html();
html[0] = "-";
var userwantsto = "";
if (html[0] == "+") // user want to open folder
{
html = html.replace("+","-");
userwantsto = "open";
}
else if (html[0] == "-") // user want to close folder
{
html = html.replace("-","+");
userwantsto = "close";

}
$(obj).html(html);

var path = $(obj).attr('data-path');
var level = parseInt($(obj).attr('data-level'));
level +=1 ;
console.dir(path);
var folder_content = Utils.readDir(path);
//console.dir(folder_content);

var spacer = "";
var limiter = level *4;
for (i = 0; i < limiter;i++)
if (userwantsto == "close")
{
spacer += "&nbsp;";
$("ul[data-path='"+path+"']").html("");
}
for (i = 0;i< folder_content.length;i++)

if (userwantsto == "open")
{
var isfile = Utils.isFile(path + Utils.path.sep + folder_content[i]);
if(isfile)
{
$(obj).after("<br/><a onclick='openMe($(this));' data-level='"+level+"' data-path='"+path + Utils.path.sep + folder_content[i]+"' href='#'>"+spacer+folder_content[i] +"</a>");
}
else
console.dir(path);
var folder_content = Utils.readDir(path);


for (i = 0;i< folder_content.length;i++)
{
$(obj).after("<br/><a onclick='openFolder($(this));' data-level='"+level+"' data-path='"+path + Utils.path.sep + folder_content[i]+"' href='#'>"+spacer+"+"+folder_content[i] +"</a>");
var isfile = Utils.isFile(path + Utils.path.sep + folder_content[i]);
if(isfile)
{
var _temp= folder_content[i];
var _ext = _temp.split(".").pop();
$("ul[data-path='"+path+"'").append("<li><a class='file "+_ext+"' onclick='openMe($(this));' data-path='"+path + Utils.path.sep + folder_content[i]+"' href='#'><span class='glyphicon glyphicon-file'></span> &nbsp;"+folder_content[i] +"</a></li>");
}
else
{
$("ul[data-path='"+path+"'").append("<li><a class='folder' onclick='openFolder($(this));' data-path='"+path + Utils.path.sep + folder_content[i]+"' href='#'>+ <span class='glyphicon glyphicon-folder-open'></span> &nbsp;"+folder_content[i] +"</a><ul data-path='"+path + Utils.path.sep + folder_content[i]+"'></ul></li>");
}
}


}

//Main.message.broadcast("plugin.misterpah.FileAccess:OpenFileDirectly","plugin.misterpah.ProjectTree",path);
}


$("#tree_position").html("<ul id='file_tree'></ul>");
for (i = 0;i< folder_content.length;i++)
{
var isfile = Utils.isFile(Main.session.project_folder + Utils.path.sep + folder_content[i]);
if (isfile)
{
$("#tree_position").append("<a onclick='openMe($(this));' data-level='0' data-path='"+Main.session.project_folder + Utils.path.sep + folder_content[i]+"' href='#'>"+folder_content[i] +"</a><br/>");
var _temp= folder_content[i];
var _ext = _temp.split(".").pop();
$("#file_tree").append("<li><a class='file "+_ext+"' onclick='openMe($(this));' data-path='"+Main.session.project_folder + Utils.path.sep + folder_content[i]+"' href='#'><span class='glyphicon glyphicon-file'></span> &nbsp;"+folder_content[i] +"</a></li>");
}
else
{
$("#tree_position").append("<a onClick='openFolder($(this))' data-level='0' data-path='"+Main.session.project_folder + Utils.path.sep + folder_content[i]+"'>+"+folder_content[i] +"</a><br/>");
$("#file_tree").append("<li><a class='folder' onClick='openFolder($(this))' data-path='"+Main.session.project_folder + Utils.path.sep + folder_content[i]+"'>+ <span class='glyphicon glyphicon-folder-open'></span> &nbsp;"+folder_content[i] +"</a><ul data-path='"+Main.session.project_folder + Utils.path.sep + folder_content[i]+"'></ul></li>");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import js.Browser;
static public function create_ui():Void
{
Utils.loadJS(plugin_path() + "/projectTree.js",function(){});
Utils.loadCSS(plugin_path() + "/projectTree.css");
}


Expand Down
2 changes: 1 addition & 1 deletion source/Main.hx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import jQuery.*;

static public function run_haxe_studio():Void
{
version = "0.3 alpha";
version = "0.3.2";
session = new Session();
file_stack = new FileObject();
message = new Message();
Expand Down

0 comments on commit 5b8e68b

Please sign in to comment.