Commit 3259028b authored by Bas Lijnse's avatar Bas Lijnse

Updated login window to show application name.

git-svn-id: https://svn.cs.ru.nl/repos/iTask-system/trunk@1129 63da3aa8-80fd-4f01-9db8-e6ea747a3da2
parent 9d0e5bfb
......@@ -31,35 +31,30 @@ itasks.Application = function () {
//Store message
this.errorMsg = errorMsg;
//Load the config
this.loadConfig();
//Set cookie provider
Ext.state.Manager.setProvider(new Ext.state.CookieProvider({
expires: new Date(new Date().getTime()+(1000*60*60*24*30)), // 30 days from now
}));
//Load application information
this.loadAppInfo();
},
loadConfig: function() {
Ext.Ajax.request({url:"config.json",success: this.continueConfig, scope: this});
loadAppInfo: function() {
Ext.Ajax.request({url: itasks.config.serviceUrl + "/json/application",success: this.continueAppInfo, scope: this});
},
continueConfig: function(response) {
//Globally store config
itasks.config = Ext.decode(response.responseText);
continueAppInfo: function(response) {
Ext.apply(this,Ext.decode(response.responseText));
//Load skin
this.loadSkin();
//Create the login window
if(!this.loginWindow) {
this.loginWindow = new itasks.LoginWindow({
errorMsg: this.errorMsg,
continuation: this.loadUserInterface.createDelegate(this)
});
this.viewport.getComponent(0).add(this.loginWindow);
} else {
this.loginWindow.setError(this.errorMsg);
}
//Create the login window
this.loginWindow = new itasks.LoginWindow({
errorMsg: this.errorMsg,
continuation: this.loadUserInterface.createDelegate(this)
});
this.viewport.getComponent(0).add(this.loginWindow);
this.loginWindow.show();
},
loadSkin: function() {
......@@ -71,7 +66,7 @@ itasks.Application = function () {
link.href = "skins/" + itasks.config.skin + "/main.css";
document.body.appendChild(link);
document.title = itasks.config.appTitle;
document.title = itasks.app.application;
this.skinLoaded = true;
},
......@@ -102,6 +97,12 @@ itasks.Application = function () {
reset: function() {
this.viewport.layout.setActiveItem(0);
this.viewport.remove(1,true);
//Clear the old loginwindow
if(this.loginWindow) {
this.loginWindow.destroy();
delete this.loginWindow;
}
},
restart: function (errorMsg) {
this.reset();
......
......@@ -52,7 +52,7 @@ itasks.LoginWindow = Ext.extend(Ext.Window, {
shadow: false,
items: {
xtype: 'form',
url: '/services/json/sessions/create',
url: itasks.config.serviceUrl + "/json/sessions/create",
baseCls: 'x-plain',
style: 'padding: 5px',
layout: 'absolute',
......@@ -63,9 +63,11 @@ itasks.LoginWindow = Ext.extend(Ext.Window, {
x: 0,
y: 0,
xtype: 'label',
style: "color: red; font-weight: bold; background: url('skins/" + itasks.config.skin + "/img/loginwindow.png')",
style: "background: url('skins/" + itasks.config.skin + "/img/loginwindow.png') no-repeat;" +
"padding-left: 65px; padding-top: 20px; font-size: 16px; font-weight: bold;",
width: 300,
height: 40
height: 55,
text: itasks.app.application
},{
x: 55,
y: 45,
......
......@@ -15,7 +15,7 @@ itasks.ResultPanel = Ext.extend(itasks.RemoteDataPanel, {
autoDestroy: true,
iconCls: 'icon-task-result',
layout: 'border',
url: itasks.config.servicesUrl+'/json/tasks/'+this.taskId+'/result/tui',
url: itasks.config.serviceUrl+ "/json/tasks/" + this.taskId+ "/result/tui",
params: {},
items: [{
xtype: 'itasks.result-header',
......
......@@ -129,7 +129,7 @@ itasks.WorkListPanel = Ext.extend(Ext.Panel,{
var conn = new Ext.data.Connection();
conn.request({
url: itasks.config.servicesUrl + "/json/tasks",
url: itasks.config.serviceUrl + "/json/tasks",
params: { session : itasks.app.session },
callback: function(options,success,response) {
if(!success) itasks.app.restart('Cannot retrieve work list');
......
......@@ -18,7 +18,7 @@ itasks.WorkPanel = Ext.extend(itasks.RemoteDataPanel, {
closable: true,
autoDestroy: true,
iconCls: "icon-task",
url: itasks.config.servicesUrl + "/json/tasks/" + this.taskId + "/tui",
url: itasks.config.serviceUrl + "/json/tasks/" + this.taskId + "/tui",
params: {session: itasks.app.session},
layout: "border",
items: [{
......
//iTask client configuration
{ serverUrl: "/handlers"
, servicesUrl: "/services"
, appTitle: "iTasks"
, skin: "default"
, debug: true
, autoRefresh: false
, refreshRate: 60000
}
\ No newline at end of file
......@@ -3,6 +3,15 @@
<head>
<title>Loading...</title>
<script type="text/javascript">
itasks = {}; itasks.config = {} ;
itasks.config.serviceUrl = "/services";
itasks.config.skin = "default";
itasks.config.debug = true;
itasks.config.autoRefresh = false;
itasks.config.refreshRate = 60000;
</script>
<!-- import ExtJS css definitions -->
<link rel="stylesheet" type="text/css" href="../../lib/ext-3.2.1/resources/css/ext-all.css" />
<link rel="stylesheet" type="text/css" href="../../lib/ext-3.2.1/resources/css/xtheme-blue.css" />
......
......@@ -3,6 +3,15 @@
<head>
<title>Loading...</title>
<script type="text/javascript">
itasks = {}; itasks.config = {} ;
itasks.config.serviceUrl = "/services";
itasks.config.skin = "default";
itasks.config.debug = true;
itasks.config.autoRefresh = false;
itasks.config.refreshRate = 60000;
</script>
<!-- import ExtJS css definitions -->
<link rel="stylesheet" type="text/css" href="ext-3.2.1/resources/css/ext-all.css" />
<link rel="stylesheet" type="text/css" href="ext-3.2.1/resources/css/xtheme-blue.css" />
......
This diff was suppressed by a .gitattributes entry.
Markdown is supported
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