Commit bb2fbc28 authored by François Billioud's avatar François Billioud

mobileApp files

parent e7de2e06
body {
background: #fff !important;
width:100%;
height:100%;
margin: 0;
padding: 0;
font-family: arial,sans-serif;
display:inline-block;
font-weight:normal;
overflow-x: hidden;
}
/* widget fields */
fieldset.widget {
border: 0 none;
}
/* hide legends */
div.field label, span.headline, a.listbox_title, div.actions, div.actions,
legend.group_title, fieldset.left {
display: none;
}
/* Hidden input */
fieldset#hidden_fieldset,
div#upload_document,
div#edit_document {
display: none;
}
/* navigation classes */
div.navigation {
border-bottom: 1px solid #C9D7F1;
font-family: arial,sans-serif;
font-size: 11px;
height: 2em;
}
div.navigation fieldset.widget {
border: 0px;
}
/* right */
div.navigation-right a {
margin-left: 2px;
}
div.navigation-right fieldset.widget div {
float: left;
}
/* language selection */
div#select_language {
font-family: arial,sans-serif;
font-size: 14px;
list-style: none outside none;
white-space: nowrap;
}
div#select_language {
color: #2200CC;
}
div#select_language ul li span {
cursor: pointer;
}
span#available_language {
text-decoration: underline;
}
div#select_language ul li ul {
display: none;
height: auto;
position: absolute;
z-index: 200;
width: 70px;
}
div#select_language ul {
list-style: none outside none;
margin: 0;
padding: 0;
}
div#select_language ul li li {
background: none repeat scroll 0 0 #FFFFFF;
border-left: 1px solid #C9D7F1;
border-right: 1px solid #C9D7F1;
}
div#select_language ul li span {
cursor: pointer;
}
div#select_language ul li:hover ul {
display: block;
}
.menu_create_object li li:hover, div#select_language ul li li:hover {
background-color: #DAE6F6;
}
/* other options */
a#left_message, a#right_message {
color: #FD0A0A;
display: none;
}
/* header */
div.header {
height: 6em;
width: 100%;
}
div#wrapper_header {
width: 100%;
height: 100%;
display: inline-block;
}
/* left */
div.header-left {
margin-top: -4px;
}
div.header-left h2 {
font-size: 14pt;
}
/* logo UNG */
a#loading_message {
display: none;
}
div.logo-area {
padding-right: 10px;
}
a.ung_docs img {
border:0 none;
position:relative;
top:9px;
}
/* document title & state */
div#wrapper_header div.field a[name="document_title"] {
color: #060605;
padding-left: 1em;
padding-right: 1em;
text-decoration: none;
}
div#wrapper_header div.field a[name="document_title"], div#wrapper_header div.field a[name="document_state"] {
font-size: 15px;
margin-left: 22px;
}
div#wrapper_header div.field a[name="document_state"] {
color: #A7A2A2;
}
div#wrapper_header div.field a[name="document_title"]:hover {
background: none repeat scroll 0 0 #FFFFD6;
border: 1px solid #AAAAAA;
}
/* research bar */
div.input form {
width: 90%;
margin-top: 0.5em;
text-align: center;
}
div.input form input[name="button_search"] {
background-image: url('../images/ung/button_background.png');
border: 1px solid #BBBBBB;
border-radius: 4px 4px 4px 4px;
}
/* right */
div.header-right{
position: relative;
}
div.header-right fieldset.widget {
padding: 0;
}
/* last modification & author */
div.header-right div.input {
margin-top: 1em;
}
div.header-right div.input div{
position: relative;
}
div.header-right div.input a {
color: #A7A2A2;
font-size: 13px;
}
/* main */
div.main {
height: auto;
margin-top: 0.5em;
}
/***************** UNG main page ********************/
/* left */
div.main-left {
border-bottom: 4px solid #BBCCFF;
background-color: #DAE6F6;
}
/* "create new" menu */
.menu_create_object {
font-family: arial,sans-serif;
font-size: 13px;
list-style: none outside none;
white-space: nowrap;
color: #8E8E8E;
margin-left: 1px;
}
.menu_create_object select {
background-image: url('../images/ung/button_background.png');
border: 1px solid #BBBBBB;
border-radius: 4px 4px 4px 4px;
float: left;
}
.menu_create_object select option {
text-align: left;
}
.menu_create_object select option#new {
text-align: center;
}
/* upload button */
div.gadget-action input#upload {
background-image: url('../images/ung/button_background.png');
border: 1px solid #BBBBBB;
border-radius: 4px 4px 4px 4px;
color: #333333;
margin-left: 2px;
float: right;
position: relative;
}
/* right */
div.main-right {
height: 100%;
}
div.main-right fieldset.widget {
padding: 0;
}
/* buttons delete, refresh, change state */
div.toolbar {
border-collapse: collapse;
background-color: #E3E9FF;
height: 27px;
text-align: center;
}
button.delete {
margin-top: 0.2em;
margin-bottom: 0.2em;
background-image: url("../images/ung/button_background.png");
border: 1px solid #BBBBBB;
border-radius: 4px 4px 4px 4px;
color: #333333;
width: 95%;
text-align: center;
}
/* header */
div.listbox-header-box {
height: 0;
}
div.listbox-content a, a:visited, a:focus {
background-color: inherit;
color: #002E3F;
text-decoration: none;
}
div.listbox-content a:hover {
background-color: inherit;
color: #3D6474;
text-decoration: underline;
}
a.your_listbox_title {
display: none;
}
/* document list */
/* headlines */
table.listbox {
background: none repeat scroll 0 0 #EFF3FA;
}
.listbox {
border-collapse: collapse;
}
thead {
background: url("../images/ung/href_background.gif") repeat scroll 0 0 transparent;
font-family: serif;
font-size: medium;
font-style: normal;
font-variant: normal;
font-weight: normal;
letter-spacing: normal;
line-height: 100%;
word-spacing: normal;
}
div.listbox-content tr {
border-bottom: 1px solid #D1D1D1;
empty-cells: show;
font-size: 13px;
padding-top: 1px;
white-space: nowrap;
}
.listbox th {
border-right: 1px solid #BBCCFF;
}
.listbox-table-select-cell {
width: 0.5%;
}
.listbox-table-header-cell {
text-align: left;
}
.sort-button {
background: url("../images/ung/href_background.gif") repeat scroll 0 0 transparent;
border: 0 none;
}
.sort-button span {
color: #112ABB;
}
/* document line */
tr.text:hover, tr.illustration:hover, tr.table:hover {/*editable document*/
background-color: #DAE6F6;
}
tr.other td.listbox-table-data-cell a {/*uneditable document*/
color: #8E8E8E;
text-decoration: none !important;
}
div.listbox-content tr {
border-bottom: 1px solid #D1D1D1;
empty-cells: show;
font-size: 13px;
padding-top: 1px;
white-space: nowrap;
}
div.listbox-content table.listbox tbody tr td {
padding: 2.2px;
vertical-align: middle;
}
div.listbox-content a:hover {
background-color: inherit;
color: #3D6474;
text-decoration: underline;
}
div.listbox-content td.listbox-table-data-cell {
cursor: pointer;
}
div.listbox-content td.listbox-table-data-cell a img {
margin-right: -8px;
}
div.listbox-content a img, div.main-content a img {
border: 0 none;
}
/**********************************************************
******************* editor page ***********************/
/* content */
div.content {
/*background: none repeat scroll 0 0 #DAE6F6;*/
width:100%;
border-bottom: 4px solid #BBCCFF;
border-top: 4px solid #BBCCFF;
}
fieldset.bottom {
border: 0 none;
width:100%;
list-style: none outside none;
padding: 0;
position: relative;
}
/* SVG-edit */
iframe#svgframe {
width: 100%;
border: 0 none;
overflow: hidden;
}
/**********************************************************
******************* login page ************************/
/* welcome message */
div#advertisement b {
font-size: 12px;
}
div#advertisement img{
position: absolute;
margin-top: 3em;
height: 10em;
}
/* login table */
span#id_provider_details {
font-size: 8px;
float: left;
}
table#field_table, table#new-account-table, table#create-new-user {
border: 1px solid #C3D9FF;
width: 78%;
}
table#field_table tbody, table#new-account-table tbody, table#create-new-user tbody {
background: none repeat scroll 0 0 #E8EEFA;
}
table#field_table tbody label {
float: right;
font-size: 10pt;
white-space: nowrap;
}
/* new user table */
table#create-new-user {
display: none;
margin-top: -22px;
}
table#new-account-table table td, table#create-new-user td {
font-size: 10pt;
}
td#form-message {
color: #EC1D1D;
display: none;
}
form#create-user table tbody tr:last-child td a{
color: #2200CC;
cursor: pointer;
font-size: 8pt;
text-decoration: underline;
}
/* new account "button" */
td#new-account-form {
color: #0000CC;
cursor: pointer;
font-weight: bold;
text-decoration: underline;
}
/* footer */
div.footer {
font-size: 10pt;
margin-top: 40px;
text-align: center;
}
div.footer a {
margin-left: 0.5em;
margin-right: 0.5em;
}
/**********************************************************
******************** tooltip area *********************/
span.tooltipElement {
cursor: pointer;
color: #0099CC;
}
div.toolLocation{
visibility: hidden;
position: absolute;
border-radius: 10px 10px 10px 10px;
border: 1px solid Black;
padding: 10px;
font-family: Verdana, Arial;
font-size: 10px;
background-color: #FFFFCC;
}
/**********************************************************
******************* dialog box ************************/
div.ui-dialog {
background: none repeat scroll 0 0 #C1D9FF;
}
fieldset#edit_document {
border: 0 none;
height: 72px;
margin-left: -1em;
margin-top: -0.5em;
width: 379px;
}
div.ui-dialog-titlebar {
background: none repeat scroll 0 0 #E0EDFE;
border: 0 none;
border-radius: 1px 1px 1px 1px;
height: 15px;
}
span#ui-dialog-title-edit_document, span#ui-dialog-title-upload_document, span#ui-dialog-title-gadget-listbox {
color: #222222 !important;
font: bold 12pt Arial,Sans-serif;
margin-left: -8px;
margin-top: -3px;
}
div#edit_document.ui-dialog-content {
background-color: #FFFFFF;
}
div#edit_document {
height: 80px;
overflow: hidden;
width: 368px;
}
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
float: none !important;
height: 21px;
margin-top: -10px;
width: 104px;
}
.ui-dialog .ui-dialog-buttonpane button {
margin: 0 0.4em 0.5em 0 !important;
}
.ui-button .ui-button-text {
line-height: 1em !important;
}
.ui-button-text-only .ui-button-text {
padding: 0.2em 0.3em !important;
}
span.ui-button-text {
font-size: 12px;
}
/**
* change the display if the new account button is clicked
*/
var displayNewAccountForm = function(bool) {
if(bool) {
$("table#create-new-user").css("display","table");
$("table#field_table").css("display","none");
$("table#new-account-table").css("display","none");
}
else {
$("table#create-new-user").css("display","none");
$("table#field_table").css("display","table");
$("table#new-account-table").css("display","table");
}
}
/**
* Log an user with it's Name and ID provider
*/
var logUser = function() {
var name = $("input#name").attr("value");
var IDProvider = $("input#id_provider").attr("value");
if(name) {
setCurrentStorage(IDProvider ? new JIOStorage(name,IDProvider) : new LocalStorage(name));
window.location = "ung-mobile.html";
}
}
/**
* create an account (to use only if UNG is also an ID provider)
*/
var createNewUser = function() {
var form = $("form#create-user")[0];
/* check that the form is complete */
for(var i = 0; i<form.length-1; i++) {
if(!form[i].value) {formError("please fill each field");}
}
if(form[4].value!=form[5].value) {
formError("please enter the same password twice");
form[4].value="";
form[5].value="";
}
if(!testEMail()) {formError("please enter a valid email");}
/* create the new user */
//JIO
}
/**
* Report an error when filling the form
*/
var formError = function(message) {
$("td#form-message").attr("value",message);
$("td#form-message").css("display","table-cell");
}
/**
* check if an email address is valid
*/
function testEMail(email) {
var patern="^([a-zA-Z0-9]+(([\.\-\_]?[a-zA-Z0-9]+)+)?)\@(([a-zA-Z0-9]+[\.\-\_])+[a-zA-Z]{2,4})$";
var regEx = new RegExp(patern);
return regEx.test(email);
}
function setFocus() {
login = document.getElementById('name');
password = document.getElementById('password');
if (login.value != '')
password.focus();
else
login.focus();
}
/**
* This file provides main classes to display the web page
*/
/*
* global variables
*/
languages = ["fr","en"];
var availableLanguages = $("#available_languages");
currentPage = null;
currentDocument = null;
currentStorage = null;
/*
* Page Class
* used to decompose the page and give access to useful elements
* @param page : name of the page to be created
*/
var Page = function(page) {
this.name = page;
this.html = window.document;
this.xml = null;
this.editor = null;
//define as current page
currentPage = this;
if(page!="ung" && page !=undefined) {this.loadXML("xml/"+page+".xml");}
}
Page.prototype = {
setXML: function(data) {
this.xml = data;
this.loadPage();
},
//getters
getName: function() {return this.name;},
getXML: function() {return this.xml;},
getHTML: function() {return this.html;},
getTitle: function() {return $(this.getXML()).find("title").text();},
getContent: function() {return $(this.getXML()).find("content").html();},
getDependencies: function() {return $(this.getXML()).find("dependencies");},
getEditor: function() {return this.editor;},
setEditor: function(editor) {this.editor = editor;},
//loaders
/* load the xml document which contains the web page information */
loadXML: function(source) {
loadFile(source,"html",function(data) {getCurrentPage().setXML(data);});
},
/* update the HTML page from the XML document */
loadPage: function() {
//Page content
this.displayPageTitle();
this.displayPageContent();
var dependencies = this.getDependencies();
$(dependencies).find("linkfile").each(function() {currentPage.include($(this).text(),"link");});//includes css
$(dependencies).find("scriptfile").each(function() {currentPage.include($(this).text(),"script");});//includes js
var doc = null;
var editor = null;
/* load the editor to work with and a new document to work on */
switch(this.name) {
case "text-editor":
editor = new AlohaInterface();
doc=new JSONTextDocument();
break;
case "table-editor":
editor = new SheetEditor();
doc=new JSONSheetDocument();
break;
case "image-editor":
editor = new SVGEditor();
doc=new JSONIllustrationDocument();
break;
default://renvoie à la page d'accueil
window.location = "ung.html";
return;
break;
}
if(getCurrentDocument()) {doc.load(getCurrentDocument());}
this.setEditor(editor);
doc.setAsCurrentDocument();
},
/* include a javascript or a css file */
include: function(file,type) {
var object = null;
switch(type) {
case "script":
/*object = window.document.createElement("script");
object.type = "text/javascript";
object.src = file;*/
includeJS(file);includeJS2(file);return;
break;
case "style":
object = this.getHTML().createElement("link");
object.rel = "stylesheet";
object.href = file;
object.type = "text/css";
break;
}
var head = $(this.getHTML()).find("head").append(object);
},
/* these methods display dynamically information about the page, user or current document
* at the right place on the web page
*/
//user information
/* display the list of availaible languages */
displayLanguages: function(user) {
var avLang = "";
for (var i = 0; i<languages.length; i++) {
var l = languages[i];
if(l==user.getSetting("language")) {$("span#current_language").html(l);}
else {
avLang = avLang + "<li><span onclick='changeLanguage($(this).html())' id='" +l+ "'>"+l+"</span></li>\n"
}
}
$("ul#available_languages").html(avLang);
},
displayUserName: function(user) {$("a#userName").html(user.getName());},
//document information
displayLastUserName: function(doc) {$("a#author").html(doc.getAuthor());},
displayLastModification: function(doc) {$("a#last_update").html(doc.getLastModification());},
displayDocumentTitle: function(doc) {
$("a#document_title").html(limitedString(doc.getTitle(),30));
},
displayDocumentContent: function(doc) {this.getEditor().loadContentFromDocument(doc);},
displayDocumentState: function(doc) {$("a#document_state").html(doc.getState()[getCurrentUser().getSetting("language")]);},
//web page information
displayPageTitle: function() {$("title#page_title").html(this.getTitle());},
displayPageContent: function() {$("div#page_content").html(this.getContent());}
}
getCurrentPage = function() {return currentPage;}
setCurrentPage = function(page) {currentPage = page;}
/*
* User Class
* stores useful information about a user and provides methods to manipulate them
* @param arg : a json User object to load
*/
var User = function(arg) {
if(arg) {
this.load(arg);
if(window.DocumentList) {this.documentList = new DocumentList(arg.documentList);}
}
else {
this.name = "UNG";//default name
this.settings = {
language: "en"
}
this.documentList = new DocumentList();
this.documents = {};
}
}
User.prototype = new UngObject();//inherits from UngObject
User.prototype.load({//add methods thanks to the UngObject.load method
getName: function() {return this.name;},
setName: function(newName) {this.name = newName;},
getSetting: function(key) {return this.settings[key];},
setSetting: function(key,value) {this.settings[key] = value;},
getSettings: function() {return this.settings;},
getDocumentList: function() {return this.documentList;},
setDocumentList: function(list) {this.documentList = list;},
getIDProvider: function() {return this.IDProvider;},
setAsCurrentUser: function() {
getCurrentPage().displayUserName(this);
getCurrentPage().displayLanguages(this);
getCurrentStorage().setUser(this);
if(getCurrentPage().getName()=="ung") getDocumentList().setAsCurrentDocumentList();
}
});
getCurrentUser = function() {
return getCurrentStorage().getUser();
}
/**
* Class Storage
* this class provides usual API to save/load/delete documents
* @param type : "local" to save in localStorage, or "JIO" for remote storage
* @param userName : the name of the user concerned by this storage
*/
var Storage = function(type, userName) {
this.type = type;
if(userName) {
var loaded = this.loadUser(userName)//load an existing user
if(!loaded) {//create a new user if there was no such one
var user = new User();
user.setName(userName);
this.setUser(user);
}
}
}
Storage.prototype = new UngObject();
Storage.prototype.load({
getType: function() {return this.type;},
getUser: function() {return this.user;},
loadUser: function(userName) {},
setUser: function(user) {this.user = user},
getDocument: function(address, instruction) {},
saveDocument: function(doc, address, instruction) {},
deleteDocument: function(address, instruction) {}
});
/**
* Class LocalStorage
* this class provides usual API to save/load/delete documents on the localStorage
*/
var LocalStorage = function(userName) {
Storage.call(this,"local", userName);
}
LocalStorage.prototype = new Storage();
LocalStorage.prototype.load({
/* try to load the user information in the storage and save it in the
* storage instance.
* @param userName : the name of the user
* @return : true if the user existed and has been loaded, false otherwise
*/
loadUser: function(userName) {
try{
if(!localStorage[userName]) {throw "noSuchUser";}
this.user = new User(JSON.parse(localStorage[userName]));
return true;
} catch(e) {
if(e!="noSuchUser") {alert(e);}
return false
}
},
getUser: function() {return this.user;},
setUser: function(user) {
this.user = user;
localStorage[this.user.name] = JSON.stringify(user);
},
updateUser: function() {localStorage[this.user.name] = JSON.stringify(this.user);},
getDocument: function(address, instruction) {
var doc = new JSONDocument(this.user.documents[address]);
if(instruction) instruction(doc);
return doc;
},
saveDocument: function(doc, address, instruction) {
this.user.documents[address] = doc;
this.updateUser();
if(instruction) instruction();
},
deleteDocument: function(address, instruction) {
delete this.user.documents[address];
this.updateUser();
if(instruction) instruction();
},
save: function() {
this.updateUser();
localStorage.setItem("currentStorage", JSON.stringify(this));
}
});
/**
* Class JIOStorage
* this class provides usual API to save/load/delete documents on a remote storage
*/
var JIOStorage = function(userName, IDProvider) {
Storage.call(this,"JIO", userName);
if(this.user) this.user.IDProvider = IDProvider;
}
JIOStorage.prototype = new Storage();
JIOStorage.prototype.load({
loadUser: function(userName) {
//JIO : IDProvider
},
getDocument: function(address, instruction) {
$.ajax({
url: address,
type: "GET",
dataType: type,
headers: {Authorization: "Basic "+btoa("smik:asdf")},
fields: {withCredentials: "true"},
success: instruction,
error: function(type) {alert("Error "+type.status+" : fail while trying to load "+address);}
});
},
saveDocument: function(content, address, instruction) {
this.user.documents[address] = doc;
$.ajax({
url: address,
type: "PUT",
dataType: "json",
data: JSON.stringify(content),
headers: {Authorization: "Basic "+btoa("smik:asdf")},
fields: {withCredentials: "true"},
success: instruction,
error: function(type) {
if(type.status==201 || type.status==204) {instruction();}//ajax thinks that 201 is an error...
}
});
},
deleteDocument: function(address, instruction) {
delete this.user.documents[address];
$.ajax({
url: address,
type: "DELETE",
headers: {Authorization: "Basic "+btoa("smik:asdf")},
fields: {withCredentials: "true"},
success: instruction,
error: function(type) {
alert(type.status);//ajax thinks that 201 is an error...
}
});
}
});
getCurrentStorage = function() {
if(!currentStorage) {//if storage has not been loaded yet
var dataStorage = JSON.parse(localStorage.getItem("currentStorage"));
if(!dataStorage) {
setCurrentStorage(new LocalStorage("ung"));
//window.location = "login-mobile.html";
return null;
}//if it's the first connexion
switch(dataStorage.type) {//load the last storage used
case "local":currentStorage = new LocalStorage();break;
case "JIO":currentStorage = new JIOStorage();break;
}
currentStorage.loadUser(dataStorage.user.name);
currentStorage.type = dataStorage.type;
}
return currentStorage;
}
setCurrentStorage = function(storage) {
currentStorage = storage;
localStorage.setItem("currentStorage", JSON.stringify(storage));
}
/**
* Documents
* This class is used to store information about document and provide methodes
* to manipulate these elements.
*/
/**
* JSON document
* @param arg : a json JSONDocument object to load
*/
var JSONDocument = function(arg) {
if(arg) {this.load(arg);}
else {
this.language = getCurrentUser().getSetting("language");
this.version = null;
this.author=getCurrentUser().getName();
this.lastUser=getCurrentUser().getName();
this.title="Untitled";
this.content="";
this.creation=currentTime();
this.lastModification=currentTime();
this.state=JSONDocument.prototype.states.draft;
}
}
JSONDocument.prototype = new UngObject();//inherits from UngObject
JSONDocument.prototype.load({//add methods thanks to the UngObject.load method
//type
getType: function() {return this.type;},
setType: function(newType) {this.type = newType;},
//version
getVersion: function() {return this.version;},
setVersion: function(version) {this.version = version;},
//language
getLanguage: function() {return this.language;},
setLanguage: function(language) {this.language = language;},
//content
getContent:function() {return this.content;},
setContent:function(content) {this.content=content;},
//title
getTitle:function() {return this.title;},
setTitle:function(title) {this.title=title;},
//author
getAuthor:function() {return this.author;},
setAuthor:function(userName) {this.author=userName;},
getLastUser:function() {return this.lastUser;},
setLastUser:function(user) {this.lastUser = user;},
//dates
getCreation:function() {return this.creation;},
getLastModification:function() {
var date = (new Date(this.lastModification)).toGMTString();
var day = date.substring(0,16);
var today = (new Date(currentTime())).toGMTString().substring(0,16);
return (day===today) ? date.substring(17,date.length) : day;
},
setLastModification:function(date) {this.lastModification=date;},
//state
getState:function() {return this.state;},
setState:function(state) {this.state=state;},
setAsCurrentDocument: function() {
setCurrentDocument(this);
},
save: function(instruction) {
var doc = this;
getCurrentStorage().saveDocument(doc, getDocumentAddress(this), instruction);
},
remove: function(instruction) {getCurrentStorage().deleteDocument(getDocumentAddress(this), instruction);}
});
JSONDocument.prototype.states = {
draft:{"fr":"Brouillon","en":"Draft"},
saved:{"fr":"Enregistré","en":"Saved"},
deleted:{"fr":"Supprimé","en":"Deleted"}
}
getCurrentDocument = function() {
if(!currentDocument) {
currentDocument = new JSONDocument(JSON.parse(localStorage.getItem("currentDocument")));
}
return currentDocument;
}
setCurrentDocument = function(doc) {
currentDocument = doc;
localStorage.setItem("currentDocument",JSON.stringify(doc));
}
supportedDocuments = {"text":{editorPage:"text-editor",icon:"images/icons/document.png"},
"illustration":{editorPage:"image-editor",icon:"images/icons/svg.png"},
"table":{editorPage:"table-editor",icon:"images/icons/table.png"},
"other":{editorPage:null,icon:"images/icons/other.gif"},
undefined:{editorPage:null,icon:"images/icons/other.gif"}
}
getDocumentAddress = function(doc) {
return getCurrentStorage().getType()=="local" ? doc.getCreation() : "http://"+getCurrentUser().getIDProvider()+"/ungdav/"+doc.getCreation();
}
/*************************************************
****************** actions ******************
*************************************************/
/**
* open a dialog box to edit document information
*/
editDocumentSettings = function() {
saveCurrentDocument();
loadFile("xml/xmlElements.xml", "html", function(data) {
$("rename", data).dialog({
autoOpen: true,
height: 131,
width: 389,
modal: true,
buttons: {
"Save": function(){
var doc = getCurrentDocument();
doc.setTitle($(this).find("#name").attr("value"));
doc.setLanguage($(getCurrentDocument()).find("#language").attr("value"));
doc.setVersion($(getCurrentDocument()).find("#version").attr("value"));
saveCurrentDocument();
doc.setAsCurrentDocument();//diplay modifications
$(this).dialog("close");
},
Cancel: function() {
$(this).dialog("close");
}
}
});
$("p#more_properties") .click(function(){
$("div#more_property").show();
$("p#hide_properties").show();
$("div#edit_document fieldset").animate({"height": "186px"}, "slow");
$("div.ui-dialog").animate({"top": "50px"}, "slow")
.animate({"height": "255px"}, "slow");
$("div#edit_document").animate({"height": "183px"}, "slow");
$("div#edit_document fieldset input").css("margin", "0")
.css("width", "60%");
$("div#edit_document fieldset label").css("float", "left")
.css("width", "35%");
$("div#more_property input").css("width", "47%");
$("p#more_properties").hide();
});
$("p#hide_properties") .click(function(){
$("div#more_property").hide();
$("p#more_properties").show();
$("p#hide_properties").hide();
$("div#edit_document fieldset input").css("width", "95%")
.css("margin-top", "14px");
$("div#edit_document fieldset").animate({"height": "69px"}, "slow");
$("div.ui-dialog").animate({"height": "148px"}, "slow");
$("div#edit_document").animate({"height": "78px"}, "slow");
});
}
)}
/**
* open a dialog box to upload a document
*/
uploadDocument = function() {
loadFile("xml/xmlElements.xml", "html", function(data) {
$("upload", data).dialog({
autoOpen: false,
height: 116,
width: 346,
modal: true
});
});
}
/**
* open a dialog box to propose gadgets
*/
gadgetListBox = function() {
loadFile("xml/xmlElements.xml", "html", function(data) {
$("gadget", data).dialog({
autoOpen: false,
height: 416,
width: 600,
modal: true,
buttons: {
"Add": function(){
var gadgetIdList = Array();
$("table#gadget-table tbody tr td input").each(function(){
if (this.checked){
gadgetIdList.push($(this).attr("id"));
}
});
if (gadgetIdList.length == 0){
$(this).dialog("close");
}
var tabTitle = $("div#tabs ul li.tab_selected span").html();
$.ajax({
type: "post",
url:"WebSection_addGadgetList",
data: [{name:"gadget_id_list", value: gadgetIdList}],
success: function(data) {
window.location.reload();
}
});
}
}
});
});
}
/**
* open a dialog box to propose settings
*/
editUserSettings = function() {
$("div#preference_dialog").dialog({
autoOpen: false,
height: 215,
width: 319,
modal:true,
buttons: {
"Save": function(){
},
Cancel: function() {
$(this).dialog("close");
}
}
});
}
saveCurrentDocument = function() {
getCurrentPage().getEditor().saveEdition();
getCurrentDocument().save();
}
/**
* start an editor to edit the document
* @param doc : the document to edit
*/
var startDocumentEdition = function(doc) {
getCurrentStorage().getDocument(getDocumentAddress(doc), function(data) {
doc.load(data);
setCurrentDocument(doc);
if(supportedDocuments[doc.getType()].editorPage) {window.location = "theme-mobile.html";}
else alert("no editor available for this document");
});
}
var stopDocumentEdition = function() {
saveCurrentDocument();
window.location = "ung-mobile.html";
return false;
}
/**
* change the language of the user and reload the web page
* @param language : the new language
*/
var changeLanguage = function(language) {
getCurrentUser().setSetting("language");
getCurrentStorage().save();
getCurrentPage().displayLanguages(user);
window.location.reload();
}
var signOut = function() {
delete localStorage.currentStorage;
delete localStorage.currentDocumentID;
window.location = "login-mobile.html";
return false;
}
cancel_sharing = function() {alert("cancel");}
translate = function() {alert("translate");}
submit = function() {alert("submit");}
share = function() {alert("share");}
/***
* This file provides some useful element used in the whole web site
*/
/**
* Class UngObject
* provides useful general methods
*/
UngObject = function() {}
/* return true if this object implements the interface */
UngObject.prototype.Implements = function(myInterface)
{
for(var property in myInterface)
{
if( typeof myInterface[property] != "string")
continue;
if(this[property]==undefined || typeof this[property] != myInterface[property] )
return false;
}
return true;
};
/* Load a JSON data into an object */
UngObject.prototype.load = function(data) {
for(var property in data) {
this[property] = data[property];
}
};
/* Load methods from a class to another class */
UngObject.prototype.inherits = function(superClass) {
this.prototype.load(superClass.prototype);
}
/* return true only if two objects are equals */
UngObject.prototype.equals = function(object) {
for (var property in object) {
if (this.hasOwnProperty(property)) {
var isEquals = this[property]&&typeof(this[property])=="object" ? UngObject.prototype.equals.call(this[property],object[property]) : this[property]===object[property];
if (!isEquals) {return false}
}
}
return true;
}
/**
* Class List
* this class provides usual API to manipulate list structure
* @param arg : a json list object
* @param contentType : the type of the elements of the list
*/
var List = function(arg, contentType) {
if(arg && arg.headElement) {
if(contentType) {
this.headElement=new contentType(arg.headElement);
} else {
this.headElement = arg.headElement;
}
this.length = arg.length;
this.previous = new List(arg.previous, contentType);
}
else {
this.nullElement();
}
}
List.prototype = new UngObject();
List.prototype.load({
nullElement: function() {
this.headElement = null;
this.previous = undefined;
this.length = 0;
},
size: function() {return this.length;},
head: function() {return this.headElement;},
tail: function() {return this.previous;},
isEmpty: function() {return this.head()===null;},
equals: function(list) {
return this.head().equals(list.head()) && this.tail().equals(list.tail());
},
add: function(value) {
var t = new List();
t.load(this);
this.headElement = value;
this.previous = t;
this.length = t.size()+1;
},
get: function(i) {
if(i>=this.size()) {return null;}
if(i==0) {return this.head();}
return this.tail().get(i-1);
},
set: function(i,element) {
if(i>=this.size()) {errorMessage("set out of bounds, "+i+" : "+this.size(),this);return}
if(i==0) {
this.headElement=element;
} else {
this.tail().set(i-1,element);
}
},
remove: function(i) {
if(i>=this.size()) {errorMessage("remove out of bounds, "+i+" : "+this.size(),this);return}//particular case
if(i==0) {this.pop();return}//particular case
if(i==1) {//init
this.previous = this.tail().tail();
} else {//recursion
this.tail().remove(i-1);
}
this.length--;
},
pop: function() {
if(this.isEmpty()) {errorMessage("pop on empty list",this);return null;}
var h = this.head();
this.load(this.tail())
return h;
},
find: function(object) {
if(this.isEmpty()) {return -1}//init-false
var elt = this.head();
if(object.equals) {//init-true
if(object.equals(this.head())) {return 0;}//with an adapted comparator
} else {
if(object===this.head()) {return 0;}//with usual comparator
}
var recursiveResult = this.tail().find(object);//recursion
return recursiveResult>=0 ? this.tail().find(object)+1 : recursiveResult;
},
contains: function(object) {if(this.isEmpty()) {return false} else {return object===this.head() ? true : this.tail().contains(object)}},
insert: function(element,i) {
if(i>this.size()) {errorMessage("insert out of bounds, "+i+" : "+this.size(),this);return}//particular case
if(i==0) {//init
this.add(element);
} else {//recursion
this.tail().insert(element,i-1);
this.length++;
}
},
replace: function(oldElement,newElement) {
if(this.isEmpty()) {errorMessage("<<element not found>> when trying to replace",this);return}//init-false
if(oldElement===this.head()) {
this.set(0,newElement);//init-true
} else {
this.tail().replace(oldElement,newElement);//recursion
}
},
removeElement: function(element) {//remove each occurence of the element in this list
if(this.isEmpty()) {return}
this.tail().removeElement(element);
if(element.equals) {//init-true
if(element.equals(this.head())) {this.pop();}//with an adapted comparator
} else {
if(element===this.head()) {this.pop();}//with usual comparator
}
}
});
/**
* load a public file with a basic ajax request
* @param address : the address of the document
* @param type : the type of the document content
* @param instruction : a function to execute when getting the document
*/
loadFile = function(address, type, instruction) {
$.ajax({
url: address,
type: "GET",
dataType: type,
success: instruction,
error: function(type) {alert("Error "+type.status+" : fail while trying to load "+address);}
});
}
/*
* wait an event before execute an action
* @param required : function we are waiting for a result
* @param func : function we will try to execute in a loop
*/
waitBeforeSucceed = function(required, func) {
var nb = 2;//avoid to test too much times
var execute = function() {
try {
if(!required.call()) {throw 0;}
func.call();}
catch(e) {console.log(e);if(nb<100) {setTimeout(execute,nb*100);}}
nb*=nb;
}
execute();
}
/*
* try a function until the execution meets with no error
* @param func : function to execute in a loop until it encounters no exception
*/
tryUntilSucceed = function(func) {
var nb = 2;//avoid to test too much times
var execute = function() {
try {func.call();}
catch(e) {if(nb<100) {setTimeout(execute,nb*200);}console.log(e);}
nb*=nb;
}
execute();
}
/**
* Resize the right part of ung main page
* could be developed to implement more beautiful resizments
*/
var resize = function() {
return $("div.main-right").width($(window).width()-$("div.main-left").width());
}
/**
* Used to debug
*/
errorMessage = function(message,object) {
errorObject = object;
console.log(message);
}
/**
* returns the current date (number of ms since 1/1/1970 at 12:00 AM)
*/
currentTime = function() {return Date.now();}
/**
* cuts a string if too long
*/
limitedString = function(s, max) {
return (s.length < max) ? s : (s.substring(0,max) + "...");
}
/**
* Paste a toolkit at the mouse position
*/
Tooltip = function() {
this.visible=false; // La variable i nous dit si la bulle est visible ou non
}
Tooltip.prototype = {
isVisible: function() {return this.visible;},
move: function(e) {$("div.toolLocation").css("left",e.pageX+5+"px").css("top",e.pageY + 10+"px");},
show: function(text) {
if(!this.isVisible()) {
$("div.toolLocation")
.css("display","inline")
.css("visibility","visible")
.html(text);
this.visible = true;
}
},
hide: function() {
if(this.isVisible()) {
$("div.toolLocation")
.css("display","none")
.css("visibility","hidden");
this.visible = false;
}
}
}
includeJS = function(file) {
/*var script = document.createElement('script');
script.type = 'text/javascript';
script.src = file;
document.getElementsByTagName('head')[0].appendChild(script);
*/$("<script>", {type:"text/javascript",src:file}).appendTo("head");
}
includeJS2 = function(file) {
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = file;
document.getElementsByTagName('head')[0].appendChild(script);
}
\ No newline at end of file
/**
* This file provides the javascript used to display the list of user's documents
*/
/* global variable */
/* the last modified document */
getCurrentDocumentID = function() {return localStorage.getItem("currentDocumentID");}
setCurrentDocumentID = function(ID) {return localStorage.setItem("currentDocumentID",ID);}
/**
* class DocumentList
* This class provides methods to manipulate the list of documents of the current user
* @param arg : a documentList json object to load
*/
var DocumentList = function(arg) {
//List.call(this);
if(arg) {
this.load(arg);
this.load(new List(arg,JSONDocument));
this.selectionList = new List(arg.selectionList);//load methods of selectionList
}
else {
List.call(this);
this.selectionList = new List();
}
}
DocumentList.prototype = new List();
DocumentList.prototype.load({
removeDocument: function(doc) {
var i = this.find(doc);
this.get(i).remove()//delete the file
this.remove(i);//remove from the list
getCurrentStorage().save();//save changes
},
getSelectionList: function() {return this.selectionList;},
resetSelectionList: function() {
this.selectionList = new List();
//display consequences
for(var i=0; i<this.size(); i++) {
$("tr td.listbox-table-select-cell input#"+i).attr("checked",false);//uncheck
}
$("span#selected_row_number a").html(0);//display the selected row number
},
checkAll: function() {
this.selectionList = new List();
for(var i=0; i<this.size(); i++) {
this.getSelectionList().add(this.get(i));
}
//display consequences
for(i=0; i<this.size(); i++) {
$("tr td.listbox-table-select-cell input#"+i).attr("checked",true);//check
}
$("span#selected_row_number a").html(this.size());//display the selected row number
},
deleteSelectedDocuments: function() {
var selection = this.getSelectionList();
while(!selection.isEmpty()) {
var doc = selection.pop();
this.removeDocument(doc);
}
this.display();
},
/* display the list of documents in the web page */
displayContent: function() {
$("table.listbox tbody").html("");//empty the previous displayed list
for(var i=0;i<this.size();i++) {
var doc = this.get(i);
var ligne = new Line(doc,i);
ligne.updateHTML();
ligne.display();
if(this.getSelectionList().contains(doc)) {ligne.setSelected(true);}//check the box if selected
}
},
display: function() {
this.displayContent();
},
/* update the ith document information */
updateDocumentInformation: function(i) {
var list = this;
var doc = list.get(i);
getCurrentStorage().getDocument(getDocumentAddress(doc), function(data) {
doc.load(data);//todo : replace by data.header
doc.setContent("");//
list.set(i,doc);
});
},
setAsCurrentDocumentList: function() {
this.display();
}
});
getDocumentList = function() {
return getCurrentUser().getDocumentList();
}
/**
* create a line representing a document in the main table
* @param doc : document to represent
* @param i : ID of the line (number)
*/
var Line = function(doc, i) {
this.document = doc;
this.ID = i;
this.html = Line.getOriginalHTML();
}
Line.prototype = {
getDocument: function() {return this.document;},
getID: function() {return this.ID;},
getType: function() {return this.document.getType() ? this.document.getType() : "other";},
getHTML: function() {return this.html;},
setHTML: function(newHTML) {this.html = newHTML;},
setSelected: function(bool) {$("tr td.listbox-table-select-cell input#"+this.getID()).attr("checked",bool)},
isSelected: function() {
return $("tr td.listbox-table-select-cell input#"+this.getID()).attr("checked");
},
/* add the document of this line to the list of selected documents */
addToSelection: function() {
getDocumentList().getSelectionList().add(this.getDocument());
},
/* remove the document of this line from the list of selected documents */
removeFromSelection: function() {
getDocumentList().getSelectionList().removeElement(this.getDocument());
},
/* check or uncheck the line */
changeState: function() {
this.isSelected() ? this.addToSelection() : this.removeFromSelection();
$("span#selected_row_number a").html(getDocumentList().getSelectionList().size());//display the selected row number
},
/* load the document information in the html of a default line */
updateHTML: function() {
var line = this;
this.setHTML($(this.getHTML()).attr("class",this.getType())
.find("td.listbox-table-select-cell input")
.attr("id",this.getID())//ID
.click(function() {line.changeState();})//clic on a checkbox
.end()
.find("td.listbox-table-data-cell")
.click(function() {//clic on a line
setCurrentDocumentID(line.getID());
startDocumentEdition(line.getDocument())
})
.find("a.listbox-document-icon")
.find("img")
.attr("src",supportedDocuments[this.getType()].icon)//icon
.end()
.end()
.find("a.listbox-document-title").html(limitedString(this.getDocument().getTitle(),10)).end()
.find("a.listbox-document-date").html(this.getDocument().getLastModification()).end()
.end());
},
/* add the line in the table */
display: function() {$("table.listbox tbody").append($(this.getHTML()));}
}
/* load the html code of a default line */
Line.loadHTML = function() {
loadFile("xml/xmlElements.xml", "html", function(data) {Line.originalHTML = $(data).find("line table tbody").html();});
return Line.originalHTML;
}
/* return the html code of a default line */
Line.getOriginalHTML = function() {return Line.originalHTML;}
/**
* create a new document and start an editor to edit it
* @param type : the type of the document to create
*/
var createNewDocument = function(type) {
if(type=="title") {return}
var newDocument = new JSONDocument();
newDocument.setType(type);
newDocument.save(function() {
getDocumentList().add(newDocument);
getCurrentStorage().save();
startDocumentEdition(newDocument);
});
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta name="generator" content="ERP5 - Copyright (C) 2001 - 2008. All rights reserved." />
<meta name="description"
content="ERP5 Free Open Source ERP and CRM" />
<meta name="keywords" content="" />
<meta name="robots" content="index, follow" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<title>ERP5 | ERP5</title>
<link type="text/css" rel="stylesheet" href="css/jquery-ui.css" />
<link type="text/css" rel="stylesheet" href="css/ung-mobile.css" />
<script type="text/javascript" src="js/jquery/jquery.js"></script>
<script type="text/javascript" src="js/tools.js"></script>
<script type="text/javascript" src="js/theme-mobile.js"></script>
<script type="text/javascript" src="js/ung-mobile.js"></script>
<script type="text/javascript" src="js/login-mobile.js"></script>
<link rel="icon" type="image/x-icon"
href="images/ung/favicon.ico" />
<link rel="shortcut icon" type="image/x-icon"
href="images/ung/favicon.ico" />
<script type="text/javascript">
var init = function() {
tooltip = new Tooltip();
$("span.tooltipElement")
.mouseover(function() {tooltip.show("sdf")})
.mouseout(function() {tooltip.hide();})
.mousemove(function(event) {tooltip.move(event);});
}
$(document).ready(init);
</script>
</head>
<body>
<div class="container">
<div class="navigation" style="display:none">
<!-- Each aggregate of groups is a div wrapper -->
<div class="wrapper" id="wrapper_navigation">
<div class=" navigation-right">
<fieldset class="widget">
<legend class="group_title"></legend>
<div class="field" title="">
<label> your_language </label>
<div class="input"><div >
<div id="select_language">
<!-- todo : interface to change the language -->
</div>
</div></div>
</div>
</fieldset>
</div>
</div>
</div>
<div class="main">
<!-- Each aggregate of groups is a div wrapper -->
<div class="wrapper" id="wrapper_main">
<div class="content">
<fieldset class="widget">
<p></p>
<h2>Welcome to UNG Web Office</h2>
<div id="main-content">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td valign="top">
<div id="advertisement">
<b>Sign in to edit documents, spreadsheets and drawing and share this document with other users</b>
<br/>
<img src="images/ung/ung-logo.png" alt=""/>
</div>
</td>
<td>
<table id="field_table" style="display: table; width: 78%;">
<tbody>
<tr>
<td align="center">
<table>
<tbody>
<tr>
<td align="center" colspan="2">
<font size="-1">Login in</font>
</td>
</tr>
<tr><td></td></tr>
<tr>
<td align="center">
<label for="name">Name</label>
</td>
<td align="center">
<input id="name" type="text" value="" name="name" />
</td>
</tr>
<tr>
<td align="center">
<label for="id_provider">
ID provider
<span class="tooltipElement"
onmouseover="tooltip.show('please, indicate the storage server<br/>where your data will be stored<br/>let free to store on your computer')">
(?)</span>
</label>
</td>
<td>
<input id="id_provider" type="text" value="" name="id_provider" />
</td>
</tr>
<tr>
<td align="center" colspan="2">
<input class="submit" onclick="logUser()" type="button" value="Login" name="logged_in:method" />
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<br/>
</td>
<td>
<table id="create-new-user" style="width: 78%; display: none;">
<tbody>
<tr>
<td>
<form id="create-user" action="javascript:createNewUser()" method="post">
<table width="100%">
<tbody>
<tr>
<td align="center" colspan="2">
<b>Create an account</b>
</td>
</tr>
<tr>
<td id="form-message" align="center" colspan="2"></td>
</tr>
<tr>
<td>First Name</td>
<td>
<input type="text" name="firstname" />
</td>
</tr>
<tr>
<td>Last Name</td>
<td>
<input type="text" name="lastname" />
</td>
</tr>
<tr>
<td>Email</td>
<td>
<input type="text" name="email" />
</td>
</tr>
<tr>
<td>Login name</td>
<td>
<input type="text" name="login_name" />
</td>
</tr>
<tr>
<td>Password</td>
<td>
<input type="password" name="password" />
</td>
</tr>
<tr>
<td>Confirm Password</td>
<td>
<input type="password" name="confirm" />
</td>
</tr>
<tr>
<td align="center" colspan="2">
<input class="submit" type="submit" value="Create Account" name="logged_in:method" />
</td>
</tr>
<tr>
<td id="back-login" align="left" colspan="2">
<a onclick="displayNewAccountForm(false)">&lt;&lt;Back</a>
</td>
</tr>
</tbody>
</table>
</form>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr><td></td></tr>
<tr>
<td></td>
<td>
<table id="new-account-table" style="display: table; width: 78%;">
<tbody>
<tr>
<td>
<table width="100%">
<tbody>
<tr>
<td align="center" colspan="2">
<b>Don't have an
<span class="tooltipElement"
onmouseover="tooltip.show('register to store your data<br/>on our server<br/>(not implemented yet)')">
UNG Account
</span>
?
</b>
</td>
</tr>
<tr>
<td id="new-account-form" align="center" colspan="2" onclick="displayNewAccountForm(true)">Create an account now</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
<div class="footer">
<a href="http://www.freecloudalliance.org/">Free Cloud Alliance</a>
-
<a href="#">Help</a>
</div>
<p></p>
</fieldset>
</div>
</div>
</div>
</div>
<div id="page_bottom">
</div>
<div class="toolLocation"></div>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta name="viewport" content="width=device-width"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="keywords" content="" />
<meta name="robots" content="index, follow" />
<title id="page_title"> Theme </title>
<link rel="icon" type="image/x-icon"
href="images/ung/favicon.ico" />
<link rel="shortcut icon" type="image/x-icon"
href="images/ung/favicon.ico" />
<!-- this is a placeholder for different extensions to head which could be required by web themes -->
<!-- jquery -->
<script id="jquery_loader" type="text/javascript" src="js/jquery/jquery.js"></script>
<script id="jquery_loader2" type="text/javascript" src="js/jquery/jquery-ui.js"></script>
<link type="text/css" rel="stylesheet" href="css/jquery-ui.css" />
<link rel="stylesheet" type="text/css" href="css/ung-mobile.css" />
<script type="text/javascript" src="js/base64.js"></script>
<script type="text/javascript" src="js/tools-mobile.js"></script>
<script type="text/javascript" src="js/theme-mobile.js"></script>
<script type="text/javascript">//hack for aloha
if(supportedDocuments[getCurrentDocument().getType()].editorPage=="text-editor") {
GENTICS_Aloha_base="aloha/aloha/"
includeJS("aloha/aloha/aloha.js");
}
</script>
<script type="text/javascript">
// initialize
var initPage = function() {
setCurrentPage(new Page(supportedDocuments[getCurrentDocument().getType()].editorPage));
}
var initUser = function() {
var user = getCurrentUser();
user.setAsCurrentUser();
}
var init = function() {
initPage();
waitBeforeSucceed(function() {return getCurrentPage().getXML();},initUser);
//$("script#jquery_loader").remove();
//$("script#jquery_loader2").remove();
//$("#author").aloha();
}
$(document).ready(init);
</script>
</head>
<body>
<div class="container">
<div class="navigation">
<!-- Each aggregate of groups is a div wrapper -->
<div class="wrapper" id="wrapper_navigation">
<div class=" navigation-right">
<fieldset class="widget">
<legend class="group_title"></legend>
<div class="field" title="">
<label>your_language</label>
<div class="input"><div >
<div id="select_language">
<ul><li>
<span id="current_language">en</span>
<img src="images/ung/arrow_20C.png" alt=">"/>
<ul id="available_languages">
<li></li>
</ul>
</li></ul>
</div>
</div></div>
</div>
<div class="field" title="">
<label>Login Box</label>
<div class="input"><div >
<a id="right_message" lang="en">Not Implemented yet</a>
<div id="preference_dialog" title="UNG Preferences"></div>
<a id="userName">Unknown</a>
| <a id="settings" href="#" lang="en">Parametres</a>
| <a id="help" href="#" lang="en">Help</a>
| <a href="login-mobile.html" onclick="signOut()" id="log" lang="en">Sign out</a>
</div></div>
</div>
</fieldset>
</div>
</div>
</div>
<div class="header">
<!-- Each aggregate of groups is a div wrapper -->
<div class="wrapper" id="wrapper_header">
<div class=" header-left">
<fieldset class="widget">
<legend class="group_title"></legend>
<div class="field" title="">
<label>search_bar</label>
<div class="input"><div >
<a class="ung_docs" onclick="stopDocumentEdition()">
<img src="images/ung/ung-logo.gif" alt="logo"/>
</a>
<a id="loading_message" lang="en">Loading...</a>
<a id="document_title" name="document_title" onclick="editDocumentSettings()">Untitled</a>
<a id="document_state" name="document_state">...</a>
</div></div>
</div>
</fieldset>
</div>
<div class=" header-right">
<fieldset class="widget">
<legend class="group_title"></legend>
<div class="field" title="">
<label>document_action_box</label>
<div class="input"><div >
<a id="last_update">Updated ... by</a>
<a id="author">Unknown</a>
<button type="button" onclick="saveCurrentDocument()">Save</button>
</div></div>
</div>
</fieldset>
</div>
</div>
</div>
<div class="main">
<div class="document">
<div class="content editable">
<fieldset class="bottom editable">
<div id="page_content" class="field page"
title="Contenu de la page web.">
</div>
<div id="document_content" class="field hidden"
title="The content of the document considered as a text string">
</div>
</fieldset>
</div>
</div>
</div>
</div>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta name="viewport" content="width=device-width"/>
<title>UNG Docs</title>
<link type="text/css" rel="stylesheet" href="css/ung-mobile.css" />
<link type="text/css" rel="stylesheet" href="css/jquery-ui.css" />
<link type="text/css" rel="stylesheet" href="css/gadget.css" />
<script type="text/javascript" src="js/jquery/jquery.js"></script>
<script type="text/javascript" src="js/jquery/jquery-ui.js"></script>
<script type="text/javascript" src="js/tools-mobile.js"></script>
<script type="text/javascript" src="js/theme-mobile.js"></script>
<script type="text/javascript" src="js/ung-mobile.js"></script>
<link rel="icon" type="image/x-icon"
href="images/ung/favicon.ico" />
<link rel="shortcut icon" type="image/x-icon"
href="images/ung/favicon.ico" />
<script type="text/javascript">
var init = function() {
//delete localStorage.documentList;//delete the list for tests
setCurrentPage(new Page("ung"));//provide methods on the page
getCurrentStorage().getUser().setAsCurrentUser();//initialize the user
if(getCurrentDocumentID()&&getDocumentList().get(getCurrentDocumentID())) {
/* update the list with the modifications of the last edited document
* (this method has to been rewritten if using multi users) */
getDocumentList().updateDocumentInformation(getCurrentDocumentID());
delete localStorage.currentDocumentID;
getCurrentStorage().save();
}
waitBeforeSucceed(//display the list of documents
function(){return Line.loadHTML()},function() {
getDocumentList().resetSelectionList();
getDocumentList().display();
}//hack for a bug with firefox
);
}
$(document).ready(init);
</script>
</head>
<body>
<div class="container">
<div class="navigation">
<!-- Each aggregate of groups is a div wrapper -->
<div class="wrapper" id="wrapper_navigation">
<div class=" navigation-right">
<fieldset class="widget">
<legend class="group_title"></legend>
<div class="field" title="">
<label> your_language </label>
<div class="input"><div >
<div id="select_language">
<ul><li>
<span id="current_language">en</span>
<img src="images/ung/arrow_20C.png"/>
<ul id="available_languages">
<li></li>
</ul>
</li></ul>
</div>
</div></div>
</div>
<div class="field" title="">
<label> user_login_box </label>
<div class="input"><div >
<a id="right_message">Not Implemented yet</a>
<div id="preference_dialog" title="UNG Preferences"></div>
<a id="userName">Unknown</a>
| <a id="settings" href="">Settings</a>
| <a id="help" href="">Help</a>
| <a id="sign_out" href="login-mobile.html" onclick="signOut()">Sign out</a>
</div></div>
</div>
</fieldset>
</div>
</div>
</div>
<div class="header">
<!-- Each aggregate of groups is a div wrapper -->
<div class="wrapper" id="wrapper_header">
<div class=" header-left">
<fieldset class="widget">
<legend class="group_title"></legend>
<div class="field" title="">
<label> search_bar </label>
<div class="input"><div >
<a class="ung_docs" href="ung.html">
<img src="images/ung/ung-logo.gif"/>
</a>
<a id="loading_message">Loading...</a>
<form>
<input type="text" name="field_your_search_text" class="field" onkeyup="submitFormOnEnter(event, this.form, 'WebSection_viewSearchResultList')" />
<input type="submit" value="Search Docs" name="button_search" />
</form>
</div></div>
</div>
</fieldset>
</div>
</div>
</div>
<div class="main">
<!-- Each aggregate of groups is a div wrapper -->
<div class="wrapper" id="wrapper_main">
<!--<td class=" main-left">-->
<div class=" main-left">
<fieldset class="widget">
<legend class="group_title"></legend>
<div class="field" title="">
<label> user_menu_box </label>
<div class="input"><div >
<div class="gadget-column">
<div class="gadget-action">
<div class="menu_create_object">
<label> create document </label>
<select name="create_document" onchange="createNewDocument(this.value)">
<option id="new" value="title" selected>New...</option>
<option value="text">text</option>
<option value="table">spreadshit</option>
<option value="illustration">illustration</option>
</select>
</div>
<input type="submit" id="upload" name="Upload" value="Upload" />
</div>
</div>
</div></div>
</div>
</fieldset>
</div>
<div class=" main-right">
<fieldset class="widget">
<legend class="group_title"></legend>
<div class="field" title="">
<label> Toolbar </label>
<div class="input"><div >
<div class="toolbar">
<button class="delete"
onclick="getDocumentList().deleteSelectedDocuments()">Delete
</button>
</div>
</div></div>
</div>
<div class="field" title="">
<label> Document List </label>
<div class="input">
<div class="listbox-container">
<div class="listbox-content listbox-content-fixed-width">
<div class="listbox-body">
<table class="listbox your_listbox your_listbox-table">
<thead>
<!--Column title -->
<tr class="listbox-label-line">
<!--Report tree-->
<!-- Anchor cell -->
<!-- Select cell -->
<th class="listbox-table-select-cell">
<input class="listbox-check-all" type="image"
name="your_listbox_checkAll:method"
value="1" alt="Check All"
title="Check All"
onclick="getDocumentList().checkAll()"
src="images/icons/checkall.png" />
&nbsp;
<input class="listbox-uncheck-all"
type="image"
name="your_listbox_uncheckAll:method"
value="1" alt="Uncheck All"
title="Uncheck All"
onclick="getDocumentList().resetSelectionList()"
src="images/icons/decheckall.png" />
</th>
<!-- Label column row -->
<th class="listbox-table-header-cell"></th>
<th class="listbox-table-header-cell">
<!-- Button in normal view -->
<!-- Button in gadget mode -->
<button type="button" class="sort-button"
onclick=""
title="Title">
<span>Title</span>
</button>
<!-- Icon showing sort order -->
<img src="images/ung/transparent-image.gif"
alt="Sort" class="sort-button"
title="Sort" />
</th>
<th class="listbox-table-header-cell">
<!-- Button in normal view -->
<!-- Button in gadget mode -->
<button type="button"
class="sort-button"
onclick=""
title="Date">
<span>Date</span>
</button>
<!-- Icon showing sort order -->
<img src="images/ung/transparent-image.gif"
alt="Sort" class="sort-button"
title="Sort" />
</th>
</tr>
<!--Search column input -->
</thead>
<!-- Stats -->
<tbody></tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</fieldset>
</div>
</div>
</div></div>
</body>
</html>
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