Skip to content

Commit

Permalink
Little sample
Browse files Browse the repository at this point in the history
  • Loading branch information
jskonst committed Jul 4, 2016
1 parent 99741c4 commit d6335e7
Show file tree
Hide file tree
Showing 14 changed files with 229 additions and 47 deletions.
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
private.properties
web
WEB-INF
META-INF
pub
.DS_Store
appCache
reports
*lock.*
*.trace.db
*.war
28 changes: 28 additions & 0 deletions app/AppStart/UISample.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
*
* @author jskonst
*/
define('UISample', ['orm', 'forms', 'ui','FancyWidget'], function (Orm, Forms, Ui,FancyWidget, ModuleName) {
function module_constructor() {
var self = this
, model = Orm.loadModel(ModuleName)
, form = Forms.loadForm(ModuleName, model);

self.show = function () {
form.show();
};

var fancyWidget = new FancyWidget();
form.pnlPlaceholder1.height = null;
form.pnlPlaceholder2.height = null;
fancyWidget.showOn(form.pnlPlaceholder1);

form.pnlPlaceholder2.element.innerHTML ='<p> this plcae can be replaced</p>';

model.requery(function () {
// TODO : place your code here
});

}
return module_constructor;
});
9 changes: 9 additions & 0 deletions app/AppStart/UISample.layout
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?><layout title="" view="view">
<AnchorsPane background="#ffffff" cursor="0" name="view" prefHeight="300px" prefWidth="400px"/>
<BoxPane background="#e71414" cursor="0" name="pnlPlaceholder1" parent="view" prefHeight="50px" prefWidth="200px">
<AnchorsPaneConstraints height="50px" left="10px" top="10px" width="200px"/>
</BoxPane>
<BoxPane background="#dfb40f" cursor="0" name="pnlPlaceholder2" orientation="1" parent="view" prefHeight="70px" prefWidth="200px">
<AnchorsPaneConstraints height="70px" left="10px" top="90px" width="200px"/>
</BoxPane>
</layout>
File renamed without changes.
32 changes: 0 additions & 32 deletions app/AppStart/UiWithCustomImgSlider.js

This file was deleted.

15 changes: 0 additions & 15 deletions app/AppStart/UiWithCustomImgSlider.layout

This file was deleted.

30 changes: 30 additions & 0 deletions app/CustomWidgets/FancyWidget.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
*
* @author jskonst
*/
define('FancyWidget', ['orm', 'forms', 'ui'], function (Orm, Forms, Ui, ModuleName) {
function FancyButton() {
var self = this
, model = Orm.loadModel(ModuleName)
, form = Forms.loadForm(ModuleName, model);


self.show = function () {
form.show();
};

model.requery(function () {
// TODO : place your code here
});

self.showOn = function (aPanel) {
aPanel.add(form.view);
};

form.button.onActionPerformed = function(){
alert("Here");
};

}
return FancyButton;
});
6 changes: 6 additions & 0 deletions app/CustomWidgets/FancyWidget.layout
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?><layout title="" view="view">
<AnchorsPane background="#1bee25" cursor="0" name="view" prefHeight="52px" prefWidth="268px"/>
<Button cursor="0" name="button" parent="view" prefHeight="30px" prefWidth="100px" text="button">
<AnchorsPaneConstraints height="30px" left="10px" top="10px" width="100px"/>
</Button>
</layout>
3 changes: 3 additions & 0 deletions app/CustomWidgets/FancyWidget.model
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<datamodel>
</datamodel>
23 changes: 23 additions & 0 deletions app/start.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* Do not edit this file manually, it will be overwritten by
* Platypus Application Designer.
*/
require(['environment', 'logger'], function (F, Logger) {
var global = this;
//F.cacheBust(true);
//F.export(global);
require('UISample', function(UISample){
var m = new UISample();
m.show();
}, function(e){
Logger.severe(e);
if(global.document){
var messageParagraph = global.document.createElement('p');
global.document.body.appendChild(messageParagraph);
messageParagraph.innerHTML = 'An error occured while require(\'UISample\'). Error: ' + e;
messageParagraph.style.margin = '10px';
messageParagraph.style.fontFamily = 'Arial';
messageParagraph.style.fontSize = '14pt';
}
});
});
13 changes: 13 additions & 0 deletions application-start.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
<title>Platypus client start page</title>
<link rel="stylesheet" type="text/css" href="web/pwc/reset.css" />
<link rel="stylesheet" type="text/css" href="web/pwc/theme.css" />
<link rel="stylesheet" type="text/css" href="web/pwc/flaticon.css" />
</head>
<body>
<script type="text/javascript" src="web/pwc/pwc.nocache.js" source-path="app" entry-point="start"></script>
</body>
</html>
10 changes: 10 additions & 0 deletions login-failed.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="web/pwc/reset.css" />
<title>Platypus Application login fail.</title>
</head>
<body>
<div>Incorrect password or username entered.</div>
</body>
</html>
88 changes: 88 additions & 0 deletions login.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Platypus application login page</title>
<style>
body{
font-family:"Lucida Grande", "Lucida Sans Unicode", Verdana, Arial, Helvetica, sans-serif;
font-size:12px;
}
p, h1, form, button{border:0; margin:0; padding:0;}
.spacer{clear:both; height:1px;}
.myform{
margin:0 auto;
width:400px;
padding:14px;
}
#stylized{
border:solid 2px #b7ddf2;
background:#ebf4fb;
}
#stylized h1 {
font-size:14px;
font-weight:bold;
margin-bottom:8px;
}
#stylized p{
font-size:11px;
color:#666666;
margin-bottom:20px;
border-bottom:solid 1px #b7ddf2;
padding-bottom:10px;
}
#stylized label{
display:block;
margin-top: 6px;
font-weight:bold;
text-align:right;
width:140px;
float:left;
}
#stylized .small{
color:#666666;
display:block;
font-size:11px;
font-weight:normal;
text-align:right;
width:140px;
}
#stylized input{
float:left;
font-size:12px;
padding:4px 2px;
border:solid 1px #aacfe4;
width:200px;
margin:2px 0 20px 10px;
}
#stylized button{
clear:both;
margin-left:150px;
width:125px;
height:31px;
background:#666666;
text-align:center;
line-height:31px;
color:#FFFFFF;
font-size:11px;
font-weight:bold;
}
</style>
</head>
<body>
<div id="stylized" class="myform">
<form id="form" name="form" action="j_security_check" method="POST" enctype="application/x-www-form-urlencoded">
<h1>Login to Application</h1>
<p>Powered by Platypus.js</p>
<label>Username
</label>
<input type="text" name="j_username" id="name" />
<label>Password
</label>
<input type="password" name="j_password" id="password" />
<button type="submit">Login</button>
</form>
</div>
</body>
</html>

8 changes: 8 additions & 0 deletions private.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
clientLogLevel=INFO
serverLogLevel=INFO
debugClientPort=8900
debugServerPort=8901
j2eeServerId=tomcat80:home=/home/jskonst/apache-tomcat-8.0.30
runUser=
platypus-js-version=5.10.70
browserCacheBusting=false

0 comments on commit d6335e7

Please sign in to comment.