This commit is contained in:
parent
6e66e29ecc
commit
48a04582d3
Binary file not shown.
After Width: | Height: | Size: 3.9 KiB |
|
@ -0,0 +1,99 @@
|
|||
var Iliad = {
|
||||
|
||||
/* Public */
|
||||
|
||||
evaluateAnchorAction: function(anchor) {
|
||||
var actionUrl = jQuery(anchor).attr('href');
|
||||
this.evaluateAction(actionUrl);
|
||||
},
|
||||
|
||||
evaluateFormAction: function(form) {
|
||||
var actionUrl = this._getFormActionUrl(form);
|
||||
var data = jQuery(form).serialize();
|
||||
this.evaluateAction(actionUrl, "post", data);
|
||||
},
|
||||
|
||||
enableSubmitAction: function(button) {
|
||||
var name = jQuery(button).attr("name");
|
||||
if(name) {
|
||||
var hidden = "<input type='hidden' name='" + name + "'></input>";
|
||||
var form = jQuery(button).closest("form");
|
||||
jQuery(form).append(hidden);
|
||||
}
|
||||
},
|
||||
|
||||
evaluateAction:function(actionUrl, method, data) {
|
||||
if(!method) {method = 'get'};
|
||||
var that = this;
|
||||
jQuery.ajax({
|
||||
url: actionUrl,
|
||||
type: method,
|
||||
processUpdates: true,
|
||||
dataType: 'json',
|
||||
data: data,
|
||||
beforeSend: function(xhr) {
|
||||
xhr.setRequestHeader("X-Requested-With", "");
|
||||
Iliad._insertAjaxLoader()},
|
||||
success: function(json) {
|
||||
that._processUpdates(json);
|
||||
that._removeAjaxLoader();
|
||||
},
|
||||
error: function(err) {
|
||||
that._showError(actionUrl);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
/* Private */
|
||||
|
||||
_hasActionUrl:function(anchor) {
|
||||
if(anchor && jQuery(anchor).attr('href')) {
|
||||
return /action?=(.*)$/.test(jQuery(anchor).attr('href'));
|
||||
}
|
||||
},
|
||||
|
||||
_getFormActionUrl:function(form) {
|
||||
return jQuery(form).attr('action')
|
||||
},
|
||||
|
||||
_processUpdates:function(json) {
|
||||
/* handle redirect if any */
|
||||
if(json["redirect"]) {
|
||||
window.location.href = json["redirect"]
|
||||
}
|
||||
|
||||
/* else update dirty widgets */
|
||||
var dirtyWidgets = json['widgets'];
|
||||
for(var i in dirtyWidgets) {
|
||||
this._updateWidget(i, dirtyWidgets[i]);
|
||||
}
|
||||
|
||||
/* evaluate scripts */
|
||||
var scripts = json['scripts'];
|
||||
for(var i in scripts) {
|
||||
this._evalScript(scripts[i]);
|
||||
}
|
||||
},
|
||||
|
||||
_updateWidget:function(widget, contents) {
|
||||
jQuery("#"+widget).replaceWith(contents)
|
||||
},
|
||||
|
||||
_evalScript:function(script) {
|
||||
try {eval(jQuery(script).html())}
|
||||
catch(e){}
|
||||
},
|
||||
|
||||
_insertAjaxLoader:function() {
|
||||
jQuery('body').append('<div class="ajax_loader" style="position: fixed; top: 10px; right: 10px; z-index: 9999"><img src="/images/ajax_loader.gif"/></div>')
|
||||
},
|
||||
|
||||
_showError:function(actionUrl){
|
||||
jQuery("body").html("<h1>Error 500: Internal server error</h1>")
|
||||
},
|
||||
|
||||
_removeAjaxLoader:function() {
|
||||
jQuery(".ajax_loader").replaceWith("");
|
||||
}
|
||||
}
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,17 @@
|
|||
function updateLightbox() {
|
||||
_centerLightbox(jQuery(".lightbox"));
|
||||
}
|
||||
|
||||
|
||||
function _centerLightbox(e) {
|
||||
e.css("position", "absolute");
|
||||
e.css("width", "auto");
|
||||
e.css("height", "auto");
|
||||
var width = e.width();
|
||||
var height = e.height();
|
||||
var x = (jQuery(window).width() - width) / 2;
|
||||
var y = (jQuery(window).height() - height) / 2;
|
||||
x = x < 0 ? 0 : x; y = y < 0 ? 0 : y;
|
||||
e.css("left", x + "px");
|
||||
e.css("top", y + "px");
|
||||
}
|
|
@ -0,0 +1,2 @@
|
|||
jQuery.noConflict();
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
body {
|
||||
background-color: #fdfffc;
|
||||
font-family: "Verdana", "DejaVu Sans", sans-serif;
|
||||
color: #636363;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
h1, h2, h3 {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
h1 {
|
||||
color: #e75635;
|
||||
font-size: 26px;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 22px;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 18px;
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
a, a:visited {
|
||||
color: #e75635;
|
||||
text-decoration: none;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: #ffffff;
|
||||
background-color: #e75635;
|
||||
}
|
||||
|
||||
table {
|
||||
margin: 10px;
|
||||
padding: 10px;
|
||||
line-height: 1.5em;
|
||||
background-color: #f5fff4;
|
||||
border: 1px solid #cef6c9;
|
||||
}
|
||||
|
||||
thead {
|
||||
font-size: 1.4em
|
||||
}
|
||||
|
||||
td {
|
||||
padding-left: 14px;
|
||||
padding-right: 14px;
|
||||
}
|
||||
|
||||
pre {
|
||||
margin: 10px;
|
||||
padding: 10px;
|
||||
line-height: 1.5em;
|
||||
background-color: #f5fff4;
|
||||
border: 1px solid #cef6c9 ;
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
.overlay {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
background-color: black;
|
||||
z-index: 500;
|
||||
|
||||
filter: alpha(opacity=30);
|
||||
-moz-opacity: 0.3;
|
||||
opacity: 0.3;
|
||||
}
|
||||
|
||||
/* IE 6 specific fix for lack of 'position: fixed' implementation */
|
||||
* html .overlay {
|
||||
position: absolute;
|
||||
left: expression(documentElement.scrollLeft + 'px');
|
||||
top: expression(documentElement.scrollTop + 'px');
|
||||
width: expression(document.documentElement.clientWidth + 'px');
|
||||
height: expression(document.documentElement.clientHeight + 'px');
|
||||
}
|
||||
|
||||
.lightbox {
|
||||
/*position: fixed;
|
||||
_position: absolute; */
|
||||
z-index: 725;
|
||||
background-color: #fdfffc;
|
||||
padding: 10px;
|
||||
border: 1px solid #3b3b3b;
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
Acknowledgements
|
||||
----------------
|
||||
|
||||
The following parts of Iliad reuses portions of code from the Seaside framework:
|
||||
- The Widget class and its decorators
|
||||
- The HTTP abstraction library
|
||||
- The Swazoo adapter
|
||||
|
||||
Seaside is licenced under the MIT Licence.
|
||||
Copyright © 2001–2009 Avi Bryant, Julian Fitzell
|
||||
Copyright © 2007–2009 Lukas Renggli, Michel Bany, Philippe Marschall
|
||||
Copyright © Seaside Contributors
|
||||
|
||||
http://www.seaside.st/about/licence
|
||||
|
||||
----------------
|
||||
|
||||
The JSON library is adapted from http://www.squeaksource.com/Diplomacy/
|
||||
written by Avi Bryant and licenced under the MIT licence.
|
||||
|
||||
----------------
|
||||
|
||||
The Application class reuses code from HttpView2.
|
||||
HttpView2 is written by Göran Krampe and Giovanni Corriga and licenced
|
||||
under the MIT licence.
|
||||
|
||||
http://www.squeaksource.com/HttpView2
|
||||
|
||||
----------------
|
||||
|
||||
The javascript layer is inspired by the LISP web framework Weblocks
|
||||
http://weblocks.viridian-project.de/
|
|
@ -0,0 +1,143 @@
|
|||
\documentclass[a4paper,10pt]{report}
|
||||
\usepackage[
|
||||
papersize={6in,9in},
|
||||
hmargin={.75in,.75in},
|
||||
vmargin={.75in,1in},
|
||||
ignoreheadfoot
|
||||
]{geometry}
|
||||
|
||||
|
||||
%%\usepackage[francais]{babel}
|
||||
\usepackage[utf8]{inputenc}
|
||||
\usepackage[T1]{fontenc}
|
||||
\usepackage{lmodern}
|
||||
%%%\usepackage[left=2cm, right=2cm, top=3cm, bottom=3cm]{geometry}
|
||||
\usepackage{color}
|
||||
\usepackage{soul}
|
||||
\usepackage{graphicx}
|
||||
\usepackage{makeidx}
|
||||
\usepackage[newparttoc]{titlesec}
|
||||
\usepackage{listings}
|
||||
\usepackage{textcomp}
|
||||
|
||||
|
||||
|
||||
\titleformat{\chapter}[display]{}{\raggedleft\normalfont\sffamily\Huge\bfseries
|
||||
\thechapter}{1.5em}{\raggedleft\normalfont\sffamily\huge\bfseries\itshape}[]
|
||||
|
||||
\titleformat{\section}{\normalfont\sffamily\Large\bfseries}{\thesection}{0.7em}{}[]
|
||||
|
||||
\titleformat{\subsection}{\normalfont\sffamily\large\bfseries}{\thesubsection}{0.5em}{}[]
|
||||
|
||||
|
||||
%% FROM SBE %%
|
||||
\lstdefinelanguage{Smalltalk}{
|
||||
%%morekeywords={self,super,true,false,nil,thisContext}, % This is overkill
|
||||
morestring=[d]',
|
||||
morecomment=[s]{"}{"},
|
||||
alsoletter={\#:},
|
||||
escapechar={!},
|
||||
literate=
|
||||
{BANG}{!}1
|
||||
{UNDERSCORE}{\_}1
|
||||
{\\st}{Smalltalk}9 % convenience -- in case \st occurs in code
|
||||
% {'}{{\textquotesingle}}1 % replaced by upquote=true in \lstset
|
||||
{_}{{$\leftarrow$}}1
|
||||
{>>>}{{\sep}}1
|
||||
{~}{{$\sim$}}1
|
||||
{-}{{\sf -\hspace{-0.13em}-}}1 % the goal is to make - the same width as +
|
||||
{+}{\raisebox{0.08ex}{+}}1 % and to raise + off the baseline to match -
|
||||
{-->}{{\quad$\longrightarrow$\quad}}3
|
||||
, % Don't forget the comma at the end!
|
||||
tabsize=4
|
||||
}[keywords,comments,strings]
|
||||
|
||||
\lstset{language=Smalltalk,
|
||||
basicstyle=\sffamily,
|
||||
keywordstyle=\color{black}\bfseries,
|
||||
mathescape=true,
|
||||
showspaces=false,
|
||||
showstringspaces=false,
|
||||
keepspaces=true,
|
||||
breaklines=true,
|
||||
breakautoindent=true,
|
||||
lineskip={-1pt}, % Ugly hack
|
||||
upquote=true, % straight quote; requires textcomp package
|
||||
columns=fullflexible} % no fixed width fonts
|
||||
% In-line code (literal)
|
||||
% Normally use this for all in-line code:
|
||||
\newcommand{\ct}{\lstinline[mathescape=false,basicstyle={\sffamily\upshape}]}
|
||||
% apb 2007.8.28 added the \upshape declaration to avoid getting italicized code in \dothis{ } sections.
|
||||
% In-line code (latex enabled)
|
||||
% Use this only in special situations where \ct does not work
|
||||
% (within section headings ...):
|
||||
\newcommand{\lct}[1]{{\textsf{\textup{#1}}}}
|
||||
% Use these for system categories and protocols:
|
||||
\newcommand{\scat}[1]{\emph{\textsf{#1}}\xspace}
|
||||
\newcommand{\pkg}[1]{\emph{\textsf{#1}}\xspace}
|
||||
\newcommand{\prot}[1]{\emph{\textsf{#1}}\xspace}
|
||||
% Code environments
|
||||
% NB: the arg is for tests
|
||||
% Only code and example environments may be tests
|
||||
\lstnewenvironment{code}[1]{%
|
||||
\lstset{%
|
||||
frame=lines,
|
||||
mathescape=false
|
||||
}
|
||||
}{}
|
||||
|
||||
|
||||
|
||||
|
||||
%opening
|
||||
\title{\Huge\bf\sffamily Iliad 0.5\\\Large Smalltalk web framework}
|
||||
\author{Nicolas Petton}
|
||||
\makeindex
|
||||
|
||||
\begin{document}
|
||||
\sloppy
|
||||
\maketitle
|
||||
|
||||
%%\frontmatter %%for book only
|
||||
\tableofcontents
|
||||
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
\chapter*{introduction}
|
||||
|
||||
Iliad is a web framework for building complex and dynamic web applications in Smalltalk.
|
||||
This is not your ordinary PHP or Ruby web framework, Iliad is designed to be fast, lightweight and flexible.
|
||||
\bigskip
|
||||
|
||||
While working with views and REST-like urls, Iliad heavily uses widgets: stateful high level UI components.
|
||||
|
||||
%%\mainmatter %%for book only
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
\chapter{Applications}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
%% \include{chapter3}
|
||||
%% \include{chapter4}
|
||||
\chapter{Widgets: how to reuse code in views}
|
||||
\chapter{Pages}
|
||||
\chapter{sessions}
|
||||
\chapter{Url management} %TODO: NE PAS OUBLIER DE PARLER DES PARAMETRES SUPPLEMENTAIRES TELS QUE &mode=raw
|
||||
\chapter{Indexation}
|
||||
\chapter{Versionnage et support multilingue}
|
||||
\chapter{Validation des données}
|
||||
|
||||
\chapter{Création et maintenance de sites}
|
||||
\chapter{Utilisateurs et groupes}
|
||||
\chapter{Droits d'accès et Sécurité} %%TODO parler des liens et boutons (actions) pour effectuer des modifs sur le modèle
|
||||
|
||||
%%
|
||||
%%\backmatter %%for book only
|
||||
\printindex
|
||||
|
||||
\end{document}
|
Reference in New Issue