Commit c2c30940 authored by Nikhil Rane's avatar Nikhil Rane
Browse files

Added Save As functionality, About & Contact pages and fixed many UI issues.

parent 6414d0ba
......@@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="nikhilkrane">
<link rel="icon" href="../../favicon.ico">
<link rel="icon" href="./public/images/favicon.png">
<title>AutoStudio</title>
......@@ -46,8 +46,8 @@
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="#about">About</a></li>
<li><a href="#contact">Contact</a></li>
<li><a href="/about">About</a></li>
<li><a href="/contact">Contact</a></li>
</ul>
</div><!--/.nav-collapse -->
......@@ -56,7 +56,7 @@
<div class="container">
<h1 align="center" style="font-size:120px;">404</h1>
<h4 align="center" style="color: rgb(119, 119, 119);">Sorry, but either the page you are looking for could not be found or you are not logged in! Please <a href="/login">Login</a> or <a href="/signup">Signup</a> for a new account</h4>
<h4 align="center" style="color: rgb(119, 119, 119);">Sorry, but either the page you are looking for could not be found or you are not logged in! Please <b><a href="/login">Login</a></b> or <b><a href="/signup">Signup</a></b> for a new account</h4>
<br>
<div align="center"> <img src="./public/images/404.png"></img> </div>
</div><!-- container -->
......
......@@ -3,7 +3,9 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>AutoStudio</title>
<meta name="description" content="">
<meta name="description" content="A generic Web App to transform flow-designs into action">
<meta name="author" content="nikhilrane">
<link rel="icon" href="./public/images/favicon.png">
<meta name="viewport" content="width=device-width">
<!-- <link rel="stylesheet" href="./public/css/bootstrap-3.2.0-dist/css/bootstrap.min.css"> -->
......@@ -513,6 +515,7 @@
<script src="./public/js/string.min.js"></script>
<script src="./public/src/dialog/NewDialog.js"></script>
<script src="./public/src/dialog/SaveAsDialog.js"></script>
<script src="./public/src/shape/GenericShape.js"></script>
<script src="./public/src/shape/GenericContainer.js"></script>
......
......@@ -150,10 +150,13 @@ autostudio.Application = Class.extend(
// },this));
},
createDefinition: function(definitionId)
createDefinition: function(definitionId, toClear)
{
$("#loadedFileName").text("loading...");
this.view.clear();
if(toClear) {
this.view.clear();
}
this.loadedDefinitionId = definitionId;
$("#loadedFileName").html("<span class='muted'><u>Flow-Design:</u></span> "+definitionId);
},
......
......@@ -28,11 +28,14 @@ autostudio.Toolbar = Class.extend({
" </div>"+
" <div class='collapse navbar-collapse'>"+
" <ul class='nav navbar-nav'>"+
" <li><a href='#about'>About</a>"+
" <li><a href='/about'>About</a>"+
" </li>"+
" <li><a href='#contact'>Contact</a>"+
" <li><a href='/contact'>Contact</a>"+
" </li>"+
" </ul>"+
" <ul class='nav navbar-nav navbar-right'>"+
" <li><a href='/logout'>Logout</a></li>"+
" </ul>"+
" </div>"+
" </div>"+
" </div>"+
......@@ -109,7 +112,13 @@ autostudio.Toolbar = Class.extend({
this.saveButton.click($.proxy(function(){
if(!this.saveButton.parent().hasClass("disabled")) {
app.saveDefinition();
if((app.loadedDefinitionId !== undefined && app.loadedDefinitionId.length > 0)) {
app.saveDefinition();
} else {
(new autostudio.dialog.SaveAsDialog()).show();
}
}
},this));
......@@ -117,6 +126,22 @@ autostudio.Toolbar = Class.extend({
li.addClass("disabled");
li.append(this.saveButton);
mainUL.append(li);
li = $('<li></li>');
this.saveAsButton = $('<a href="#">Save As</a>');
buttonGroup.append(li);
this.saveAsButton.click($.proxy(function(){
if(!this.saveAsButton.parent().hasClass("disabled")) {
(new autostudio.dialog.SaveAsDialog()).show();
}
},this));
li.addClass("disabled");
li.append(this.saveAsButton);
mainUL.append(li);
mainUL.append('<li class="divider"></li>');
li = $('<li></li>');
......@@ -403,8 +428,10 @@ autostudio.Toolbar = Class.extend({
if( !(!event.getStack().canUndo() && !event.getStack().canRedo()) ) {
this.saveButton.parent().removeClass("disabled");
this.saveAsButton.parent().removeClass("disabled");
} else {
this.saveButton.parent().addClass("disabled");
this.saveAsButton.parent().addClass("disabled");
}
}
......
......@@ -12,14 +12,14 @@ autostudio.dialog.NewDialog = Class.extend({
var _this = this;
container.modal();
$(".modal-title").text("Create new definition");
$(".modal-title").text("Create new Flow-Design");
// Form part
//
var output =
'<form id="newFileNameForm">'+
' <label>Name of the definition</label>'+
' <input id="newFileName" type="text" class="form-control input-lg" placeholder="name of the new definition">'+
' <label>Name of the Flow-Design</label>'+
' <input id="newFileName" type="text" class="form-control input-lg" placeholder="name of the new flow-design">'+
'</form>';
// var compiled = Hogan.compile(template);
// var output = $(compiled.render({}));
......@@ -54,6 +54,6 @@ autostudio.dialog.NewDialog = Class.extend({
if(!S(id).endsWith(pstudioJSON.fileExtension)) {
id = id + pstudioJSON.fileExtension;
}
app.createDefinition(id);
app.createDefinition(id, true);
}
});
\ No newline at end of file
......@@ -6,8 +6,8 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="nikhilkrane">
<link rel="icon" href="../../favicon.ico">
<meta name="author" content="nikhilrane">
<link rel="icon" href="./public/images/favicon.png">
<title>AutoStudio</title>
......@@ -258,13 +258,12 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">AutoStudio</a>
<a class="navbar-brand active" href="#">AutoStudio</a>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="#">Apps</a></li>
<li><a href="#about">About</a></li>
<li><a href="#contact">Contact</a></li>
<li><a href="/about">About</a></li>
<li><a href="/contact">Contact</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="/logout">Logout</a></li>
......
......@@ -105,6 +105,23 @@ app.get('/', function(req, res){
res.redirect('/login');
});
/*
* Send the 'about' page.
*/
app.get('/about', function(req, res) {
res.status(200).sendfile('./public/about.html');
});
/*
* Send the 'contact' page.
*/
app.get('/contact', function(req, res) {
res.status(200).sendfile('./public/contact.html');
});
// Initialize the public directory for exposing client side
app.use('/public', express.static('public'));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment