├── distrib ├── release-nb.txt ├── copyright-header-js.txt ├── library-header-js.txt ├── license-header-js.txt └── AUTHORS ├── .gitignore ├── design ├── photo │ ├── sample.jpg │ ├── credits.txt │ ├── vertical-align.html │ └── preview.html └── repeat │ ├── credits.txt │ └── preview.html ├── axel └── bundles │ ├── link │ └── goto.png │ ├── video │ └── tv.png │ ├── lens │ └── white.png │ ├── repeat │ ├── minus.png │ ├── plus.png │ ├── checked.png │ └── unchecked.png │ ├── photo │ ├── icons │ │ ├── photo.png │ │ ├── photobroken.png │ │ └── spiningwheel.gif │ ├── photo.css │ └── photo.xhtml │ ├── service_suggest │ ├── light_on.png │ └── light_off.png │ └── menubar │ └── input.html ├── data ├── article │ └── images │ │ ├── carte.png │ │ ├── perfs.png │ │ ├── wiki.png │ │ ├── editing.png │ │ ├── publis.png │ │ ├── cartesans.png │ │ ├── davmenubar.png │ │ ├── timetable.png │ │ ├── architecture.png │ │ ├── cartenocarte.png │ │ ├── selectcurrency.png │ │ └── greetingswithbar.png ├── youtube.xml ├── carteResto2.xml ├── cvHaddock.xml ├── hCVHaddock.xml ├── ficheCafeFlow.xml ├── pageWeb.xhtml ├── carteResto1.xml └── ficheProjetW.xml ├── contribs ├── migration │ ├── img │ │ ├── arrow-maximize.png │ │ └── arrow-minimize.png │ ├── minmax.js │ └── migration_tool.css ├── xmlschemas │ └── XTigerCleanup.xsl ├── cvmachine │ ├── readme.html │ └── nofileapi.html └── schematize │ └── schematize.xhtml ├── test ├── data │ ├── repeat.xml │ ├── hello.xml │ ├── filters.xml │ ├── video.xml │ ├── choice.xml │ ├── link.xml │ └── core.xml ├── templates │ ├── Template.css │ ├── Filters.xhtml │ ├── Repeat.xhtml │ ├── Image.xhtml │ ├── Link.xhtml │ ├── Wiki.xhtml │ ├── Choice.xhtml │ └── Empty.xhtml ├── migration │ ├── Case-a-1.xml │ ├── Case-e-1.xml │ ├── Case-a-2.xml │ ├── Case-b-1.xml │ ├── Case-c-1.xml │ ├── Case.css │ ├── Case-d-1.xml │ ├── Case-b-1.xhtml │ ├── Case-b-2.xhtml │ ├── Case-e-2a.xhtml │ └── Case-e-1.xhtml ├── auto │ ├── configuration.distrib.js │ ├── configuration.js │ └── assert.js ├── gui │ ├── toc.html │ └── Link.xhtml └── misc │ ├── simpleTemplate.xhtml │ ├── logErrors.html │ ├── document.xhtml │ ├── fontStyle.html │ └── textMetrics.html ├── examples ├── tutorial │ ├── sample.xml │ ├── src │ │ ├── tutorial.js │ │ ├── part2.js │ │ ├── part1.js │ │ └── common.js │ └── tutorial.css └── flow │ ├── separateFlow.xml │ └── mainFlow.xml ├── demos ├── redirect.html ├── installation.txt ├── launch.xhtml └── launch.js ├── templates ├── Preview.css ├── Template.xhtml ├── Hello-world.xhtml ├── Meeting-Report.xhtml ├── Study.xsl ├── Assistanat.xhtml ├── StructPart.css ├── YouTube.xhtml ├── Story.xhtml ├── Requirements.xhtml └── Article.css ├── docs ├── docu.css ├── toc.html └── Spec.css ├── src ├── filters │ ├── common.js │ ├── documentid.js │ └── autocomplete.js ├── services │ ├── capitalize.js │ ├── common.js │ ├── debug.js │ └── boundary.js ├── util │ ├── debug.js │ └── menubar.js └── editor │ └── classical │ └── tabgroupmgr.js ├── editor └── extras │ ├── editor.css │ ├── input.html │ └── intro.xhtml ├── scripts ├── ant.distrib.properties └── ant.properties └── config ├── templates.distrib.js └── templates.js /distrib/release-nb.txt: -------------------------------------------------------------------------------- 1 | 1.1.2-beta -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | *.diff 3 | *.patch 4 | .DS_Store 5 | -------------------------------------------------------------------------------- /distrib/copyright-header-js.txt: -------------------------------------------------------------------------------- 1 | Copyright (C) 2009, 2010, 2011 Stéphane Sire -------------------------------------------------------------------------------- /design/photo/sample.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darobin/axel/master/design/photo/sample.jpg -------------------------------------------------------------------------------- /axel/bundles/link/goto.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darobin/axel/master/axel/bundles/link/goto.png -------------------------------------------------------------------------------- /axel/bundles/video/tv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darobin/axel/master/axel/bundles/video/tv.png -------------------------------------------------------------------------------- /axel/bundles/lens/white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darobin/axel/master/axel/bundles/lens/white.png -------------------------------------------------------------------------------- /axel/bundles/repeat/minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darobin/axel/master/axel/bundles/repeat/minus.png -------------------------------------------------------------------------------- /axel/bundles/repeat/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darobin/axel/master/axel/bundles/repeat/plus.png -------------------------------------------------------------------------------- /data/article/images/carte.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darobin/axel/master/data/article/images/carte.png -------------------------------------------------------------------------------- /data/article/images/perfs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darobin/axel/master/data/article/images/perfs.png -------------------------------------------------------------------------------- /data/article/images/wiki.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darobin/axel/master/data/article/images/wiki.png -------------------------------------------------------------------------------- /axel/bundles/repeat/checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darobin/axel/master/axel/bundles/repeat/checked.png -------------------------------------------------------------------------------- /data/article/images/editing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darobin/axel/master/data/article/images/editing.png -------------------------------------------------------------------------------- /data/article/images/publis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darobin/axel/master/data/article/images/publis.png -------------------------------------------------------------------------------- /axel/bundles/photo/icons/photo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darobin/axel/master/axel/bundles/photo/icons/photo.png -------------------------------------------------------------------------------- /axel/bundles/repeat/unchecked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darobin/axel/master/axel/bundles/repeat/unchecked.png -------------------------------------------------------------------------------- /data/article/images/cartesans.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darobin/axel/master/data/article/images/cartesans.png -------------------------------------------------------------------------------- /data/article/images/davmenubar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darobin/axel/master/data/article/images/davmenubar.png -------------------------------------------------------------------------------- /data/article/images/timetable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darobin/axel/master/data/article/images/timetable.png -------------------------------------------------------------------------------- /data/article/images/architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darobin/axel/master/data/article/images/architecture.png -------------------------------------------------------------------------------- /data/article/images/cartenocarte.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darobin/axel/master/data/article/images/cartenocarte.png -------------------------------------------------------------------------------- /data/article/images/selectcurrency.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darobin/axel/master/data/article/images/selectcurrency.png -------------------------------------------------------------------------------- /axel/bundles/photo/icons/photobroken.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darobin/axel/master/axel/bundles/photo/icons/photobroken.png -------------------------------------------------------------------------------- /axel/bundles/photo/icons/spiningwheel.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darobin/axel/master/axel/bundles/photo/icons/spiningwheel.gif -------------------------------------------------------------------------------- /axel/bundles/service_suggest/light_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darobin/axel/master/axel/bundles/service_suggest/light_on.png -------------------------------------------------------------------------------- /contribs/migration/img/arrow-maximize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darobin/axel/master/contribs/migration/img/arrow-maximize.png -------------------------------------------------------------------------------- /contribs/migration/img/arrow-minimize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darobin/axel/master/contribs/migration/img/arrow-minimize.png -------------------------------------------------------------------------------- /data/article/images/greetingswithbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darobin/axel/master/data/article/images/greetingswithbar.png -------------------------------------------------------------------------------- /axel/bundles/service_suggest/light_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/darobin/axel/master/axel/bundles/service_suggest/light_off.png -------------------------------------------------------------------------------- /test/data/repeat.xml: -------------------------------------------------------------------------------- 1 | 2 | 1 3 | 2 4 | 3 5 | 4 6 | 5 7 | 6 8 | 7 9 | 8 10 | 11 | -------------------------------------------------------------------------------- /test/data/hello.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Stéphane Sire 4 | Antoine Yersin 5 | Jonathan Wafellman 6 | 7 | 8 | -------------------------------------------------------------------------------- /test/data/filters.xml: -------------------------------------------------------------------------------- 1 | 2 | 1 3 | 4 | 2 5 | 6 | **3** 7 | http://www.youtube.com/v/IT7P7ijpAPY 8 | 9 | -------------------------------------------------------------------------------- /design/photo/credits.txt: -------------------------------------------------------------------------------- 1 | photo.png 2 | photobroken.png 3 | => come from http://www.doublejdesign.co.uk/2009/09/a-free-icon-set-diagram/ 4 | 5 | spiningwheel.gif provided by Madeinlocal.com (built with an online free tool) -------------------------------------------------------------------------------- /examples/tutorial/sample.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Stéphane Sire 5 | Antoine Yersin 6 | Jonathan Wafellman 7 | 8 | 9 | -------------------------------------------------------------------------------- /design/repeat/credits.txt: -------------------------------------------------------------------------------- 1 | Les icones plus et moins proviennent de: 2 | 3 | http://commons.wikimedia.org/wiki/Torchlight 4 | http://fr.wikipedia.org/wiki/Utilisateur:Moti-v/icones 5 | 6 | Les icones check et unchek ont été construites à partir de snapshots dans Safari (ou Firefox) sur mon mac. 7 | 8 | Stéphane S. 9 | --- -------------------------------------------------------------------------------- /demos/redirect.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | XTiger XML Demos 7 | 8 | 9 |

Please follow this link

10 | 11 | 12 | -------------------------------------------------------------------------------- /test/data/video.xml: -------------------------------------------------------------------------------- 1 | 2 | http://www.youtube.com/v/EP7T_h0alAE 3 | 4 | 5 | http://www.youtube.com/v/w8-V1O2hbvk 6 | http://www.youtube.com/v/LNMp_LneNCE 7 | 8 | 9 | http://www.youtube.com/v/LNMp_LneNCE 10 | 11 | -------------------------------------------------------------------------------- /test/data/choice.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /distrib/library-header-js.txt: -------------------------------------------------------------------------------- 1 | /* ***** BEGIN LICENSE BLOCK ***** 2 | * 3 | * @COPYRIGHT@ 4 | * 5 | * This file contains files from the Adaptable XML Editing Library (AXEL) 6 | * Version @VERSION@ (Rev @REV@) 7 | * 8 | * @LICENSE@ 9 | * 10 | * Web site : http://media.epfl.ch/Templates/ 11 | * 12 | * Contributors(s) : Stephane Sire, Antoine Yersin, Jonathan Wafellmann, Useful Web Sàrl 13 | * 14 | * ***** END LICENSE BLOCK ***** */ 15 | -------------------------------------------------------------------------------- /test/templates/Template.css: -------------------------------------------------------------------------------- 1 | body { 2 | counter-reset: info; 3 | } 4 | .info:before { 5 | content: counter(info) ". "; 6 | counter-increment: info; 7 | } 8 | .info { 9 | font-family: "Avant Garde", sans-serif; 10 | font-weight: bold; 11 | } 12 | .desactivated { 13 | font-style: italic; 14 | } 15 | .desactivated:before { 16 | content: "this test has been desactivated"; 17 | } 18 | p.explain { 19 | margin-top: -1em; 20 | font-size: 80%; 21 | } -------------------------------------------------------------------------------- /data/youtube.xml: -------------------------------------------------------------------------------- 1 | 2 | http://www.youtube.com/v/IT7P7ijpAPY 3 | http://www.youtube.com/v/IT7P7ijpAPY 4 | 5 | http://www.youtube.com/v/IzJlwWR_WHI 6 | http://www.youtube.com/v/f6FarXsaZIw 7 | 8 | 9 | http://www.youtube.com/v/IzJlwWR_WHI 10 | http://www.youtube.com/v/f6FarXsaZIw 11 | 12 | 13 | -------------------------------------------------------------------------------- /test/migration/Case-a-1.xml: -------------------------------------------------------------------------------- 1 | 2 | 1 3 | 2 4 | 3 5 | 6 | 4 7 | 5 8 | 6 9 | 7 10 | 8 11 | 9 12 | 13 | 10 14 | 11 15 | 12 16 | 13 17 | 14 18 | 15 19 | 16 20 | 17 21 | 18 22 | 23 | 19 24 | 20 25 | 21 26 | 22 27 | 23 28 | 24 29 | 30 | 25 31 | 26 32 | 27 33 | 28 34 | 29 35 | 30 36 | 37 | -------------------------------------------------------------------------------- /examples/flow/separateFlow.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 08:00 14 | 19:00 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /axel/bundles/photo/photo.css: -------------------------------------------------------------------------------- 1 | /* XTiger Photo Plugin basic style */ 2 | 3 | div#xt-photo { 4 | width: 300px; 5 | height: 260px; 6 | } 7 | 8 | p#xt-photo-info { 9 | text-align: center; 10 | margin: 20px; 11 | } 12 | 13 | p#xt-photo-error { 14 | display: none; 15 | text-align: center; 16 | font-family: sans-serif; 17 | color: red; 18 | margin: 20px; 19 | } 20 | 21 | div#xt-photo-menu { 22 | position: absolute; 23 | bottom: 20px; 24 | margin: 0 20px; 25 | text-align: center; 26 | } 27 | 28 | div#xt-photo img { 29 | max-height: 200px; 30 | max-width: 280px; 31 | } 32 | 33 | iframe#xt-photo-target { 34 | visibility: hidden; 35 | height: 1px; 36 | } 37 | -------------------------------------------------------------------------------- /templates/Preview.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This style sheet adds some rules to hide AXEL structural menus 4 | when the body element (that contains an XTiger XML transformed templates) 5 | has a 'preview' class in its class attributes. 6 | 7 | It can be used in conjunction with utilities such as the WebDAV menu bar 8 | to easily create two display mode for documents based on templates 9 | 10 | */ 11 | 12 | body.preview .axel-repeat-left, 13 | body.preview .axel-repeat-right, 14 | body.preview .axel-option-checkbox, 15 | body.preview .axel-option-unset, 16 | body.preview .axel-repeat-unset, 17 | body.preview select { 18 | display: none !important; 19 | } 20 | -------------------------------------------------------------------------------- /examples/flow/mainFlow.xml: -------------------------------------------------------------------------------- 1 | 2 | Restaurant des embruns 3 | A chaque jour son ambiance 4 | 5 | Avenue d'Ouchy 6 | Evian 7 | 021.693.12.18 8 | 021.693.12.18 9 | s.sire@free.fr 10 | 11 | 12 | Restauration 13 | 14 | Poisson 15 | Pizzas 16 | 17 | Salle de jeux 18 | 19 | Flippers 20 | Billard 21 | Babyfoot 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /design/photo/vertical-align.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 16 | 17 | 18 |

Le but de ce test est de déterminer comment aligner le haut d'une image avec le haut d'une ligne de texte

19 | 20 | 21 | -------------------------------------------------------------------------------- /test/migration/Case-e-1.xml: -------------------------------------------------------------------------------- 1 | 2 | a content# 3 | 4 | c content# 5 | c content# 6 | 7 | a content# 8 | 9 | c content# 10 | 11 | c content# 12 | c content# 13 | 14 | 15 | c content# 16 | d content# 17 | e content# 18 | f content# 19 | 20 | d content# 21 | e content# 22 | f content# 23 | d content# 24 | e content# 25 | f content# 26 | 27 | d content# 28 | e content# 29 | f content# 30 | d content# 31 | e content# 32 | f content# 33 | 34 | -------------------------------------------------------------------------------- /test/data/link.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | http://www.lemonde.fr 4 | A 5 | 6 | text 7 | 8 | http://www.epfl.ch 9 | B 10 | 11 | no 12 | 13 | 14 | http://www.google.ch 15 | C 16 | 17 | 18 | 19 | http://www.apple.com 20 | D 21 | 22 | 23 | http://www.microsoft.com 24 | E 25 | 26 | 27 | http://www.sun.com 28 | F 29 | 30 | 31 | -------------------------------------------------------------------------------- /distrib/license-header-js.txt: -------------------------------------------------------------------------------- 1 | Adaptable XML Editing Library (AXEL) is free software ; you can redistribute it 2 | * and/or modify it under the terms of the GNU Lesser General Public License (the "LGPL") 3 | * as published by the Free Software Foundation ; either 4 | * version 2.1 of the License, or (at your option) any later version. 5 | * 6 | * The library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY ; 7 | * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 8 | * PURPOSE. See the GNU Lesser General Public License for more details. 9 | * 10 | * You should have received a copy of the GNU General Public License along with this library ; 11 | * if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, 12 | * Boston, MA 02111-1307 USA. -------------------------------------------------------------------------------- /test/migration/Case-a-2.xml: -------------------------------------------------------------------------------- 1 | 2 | 1 3 | 2 4 | 3 5 | 4 6 | 7 | 5 8 | 6 9 | 7 10 | 8 11 | 9 12 | 10 13 | 11 14 | 12 15 | 16 | 13 17 | 14 18 | 15 19 | 16 20 | 17 21 | 18 22 | 19 23 | 20 24 | 21 25 | 22 26 | 23 27 | 24 28 | 29 | 25 30 | 26 31 | 27 32 | 28 33 | 29 34 | 30 35 | 31 36 | 32 37 | 38 | 33 39 | 34 40 | 35 41 | 36 42 | 37 43 | 38 44 | 39 45 | 40 46 | 47 | -------------------------------------------------------------------------------- /axel/bundles/photo/photo.xhtml: -------------------------------------------------------------------------------- 1 | 2 |

Broken Image

3 |

Message

4 |
5 |
6 | 7 |
8 |
9 | 10 |
11 |
12 | 13 |
14 |
15 | 16 |
17 |
18 | 20 | -------------------------------------------------------------------------------- /docs/docu.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding: 0; 3 | background-color: white; 4 | margin: 10px 20px; 5 | } 6 | /* below is a trick from : http://labnol.blogspot.com/2006/10/html-css-trick-for-displaying-code.html 7 | to wrap long lines of text (note that it works in pre to display long lines of source code) */ 8 | pre { 9 | white-space: pre-wrap; /* css-3 */ 10 | white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */ 11 | white-space: -pre-wrap; /* Opera 4-6 */ 12 | white-space: -o-pre-wrap; /* Opera 7 */ 13 | word-wrap: break-word; /* Internet Explorer 5.5+ */ 14 | } 15 | li { 16 | margin-bottom: 10px; 17 | } 18 | @media print { 19 | body { 20 | padding: 0; 21 | background-color:white; 22 | margin: 20px 10px; 23 | } 24 | pre { 25 | text-align: justify; 26 | font-size: 10pt; 27 | } 28 | } 29 | li { 30 | margin: 0; 31 | } 32 | a:visited { 33 | color: blue; 34 | } -------------------------------------------------------------------------------- /test/auto/configuration.distrib.js: -------------------------------------------------------------------------------- 1 | // Auto tests configuration file 2 | // Use this file to create test configurations to be executed by the auto-tests in this folder 3 | 4 | var tests = { 5 | // IE 7 testing: do not leave trainling commas at the end of Hash enumaration ! 6 | 7 | 'loadSave' : { 8 | 9 | // each entry of the form: template URL : XML data URL 10 | '../templates/Core.xhtml' : '../data/core.xml', 11 | '../templates/Choice.xhtml' : '../data/choice.xml', 12 | '../templates/Repeat.xhtml' : '../data/repeat.xml', 13 | '../../templates/Hello-world.xhtml' : '../data/hello.xml', 14 | '../../templates/Curriculum.xhtml' : '../../data/cvHaddock.xml', 15 | '../../templates/Carte-Resto.xhtml' : '../../data/carteResto1.xml', 16 | '../../templates/Publications.xhtml' : '../../data/publications.xml', 17 | '../../templates/Fiche-Projet.xhtml' : '../../data/ficheProjetW.xml', 18 | '../../templates/Article.xhtml' : '../../data/article/final.xml' 19 | } 20 | } -------------------------------------------------------------------------------- /test/migration/Case-b-1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | "c1#" 5 | "c2#" 6 | 7 | 8 | 9 | "b1#" 10 | "b2#" 11 | 12 | 13 | 14 | "c1#" 15 | "c2#" 16 | 17 | 18 | "a1#" 19 | "a2#" 20 | 21 | 22 | "b1#" 23 | "b2#" 24 | 25 | 26 | 27 | 28 | "c1#" 29 | "c2#" 30 | 31 | 32 | 33 | "b1#" 34 | "b2#" 35 | 36 | 37 | 38 | "c1#" 39 | "c2#" 40 | 41 | 42 | "a1#" 43 | "a2#" 44 | 45 | 46 | "b1#" 47 | "b2#" 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /examples/tutorial/src/tutorial.js: -------------------------------------------------------------------------------- 1 | // AXEL Tutorial 2 | // Tutorial Show / Hide behaviours 3 | 4 | function toggle(button, target, action) { 5 | var cur = button.firstChild.data; 6 | if ((! action) || (action && (cur == action))) { 7 | target.style.display = guiTrans[cur][0]; 8 | button.firstChild.data = guiTrans[cur][1]; 9 | } 10 | } 11 | 12 | function installButton (name) { 13 | var n = document.getElementById(name + 'Toggle'); 14 | var m = document.getElementById(name); 15 | if (n && m) { 16 | xtdom.addEventListener(n, 'click', function (ev) { toggle(n, m) }, false); 17 | } else { 18 | alert('Failed to install ' + name + ' button !'); 19 | } 20 | } 21 | 22 | function initTutorial () { 23 | for (var i = 0; i < targets.length; i++) { 24 | installButton(targets[i]); 25 | } 26 | } 27 | 28 | function showAll() { 29 | for (var i = 0; i < targets.length; i++) { 30 | var n = document.getElementById(targets[i] + 'Toggle'); 31 | var m = document.getElementById(targets[i]); 32 | toggle(n,m, 'show'); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /test/gui/toc.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | AXEL Interactive (GUI) test case index 8 | 9 | 10 |

AXEL Interactive (GUI) test case index

11 | 12 |

Use these test to check the interactive behavior of AXEL

13 | 14 |
15 | 16 |
Core
17 |
Test of the core features (repetition, option, choice) with the 'string', 'text' and 'select' primitive editors
18 | 19 |
Link
20 |
Test of the 'link' plugin
21 | 22 |
Photo
23 |
Test of the 'photo' plugin
24 | 25 |
RichText
26 |
Test of the 'richtext' plugin
27 | 28 |
Video
29 |
Test of the 'video' plugin
30 | 31 |
32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/filters/common.js: -------------------------------------------------------------------------------- 1 | /* ***** BEGIN LICENSE BLOCK ***** 2 | * 3 | * @COPYRIGHT@ 4 | * 5 | * This file is part of the Adaptable XML Editing Library (AXEL), version @VERSION@ 6 | * 7 | * @LICENSE@ 8 | * 9 | * Web site : http://media.epfl.ch/Templates/ 10 | * 11 | * Author(s) : Stephane Sire 12 | * 13 | * ***** END LICENSE BLOCK ***** */ 14 | 15 | /** 16 | * Class NoXMLFilter (filter mixin) 17 | * 18 | * @class _NoXMLFilter 19 | */ 20 | var _NoXMLFilter = (function _NoXMLFilter() { 21 | return { 22 | 23 | // No mapping 24 | '->': { 25 | }, 26 | 27 | load : function (point, dataSrc) { 28 | // do not load 29 | }, 30 | 31 | save : function (text) { 32 | // do not save 33 | } 34 | } 35 | })(); 36 | 37 | // Do not forget to register your filter on any compatible primitive editor plugin 38 | xtiger.editor.Plugin.prototype.pluginEditors['text'].registerFilter('noxml', _NoXMLFilter); 39 | xtiger.editor.Plugin.prototype.pluginEditors['select'].registerFilter('noxml', _NoXMLFilter); 40 | 41 | // TBD : 'hidden' filter (forces handle's style to display:'none') 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /examples/tutorial/src/part2.js: -------------------------------------------------------------------------------- 1 | // AXEL tutorial part 2 2 | // Javascript file for using AXEL to load and transform a template with Ajax 3 | // See also common.js 4 | 5 | var xtDoc; // XML document template holder 6 | 7 | // Loads the template inside an internal XML document object using Ajax 8 | // You could use your own Ajax method call and set xtDoc to xhr.responseXML 9 | // or use an ActiveX object under IE (e.g using the MSXML ActiveX) 10 | function load () { 11 | var result = new xtiger.util.Logger(); 12 | xtDoc = xtiger.cross.loadDocument('../../templates/Hello-world.xhtml', result); 13 | if (result.inError()) { 14 | alert(result.printErrors()); 15 | } else { 16 | alert('Template loaded'); 17 | level = 1; 18 | } 19 | } 20 | 21 | // Transforms the template into an editor 22 | // The template is taken from xtDoc and the resulting editor is copied into a div within a target document 23 | function transform () { 24 | if (! checkLevel(1)) return; 25 | form = new xtiger.util.Form('../../axel/bundles'); 26 | form.setTemplateSource(xtDoc); 27 | form.setTargetDocument (document, 'container', true); 28 | form.enableTabGroupNavigation(); 29 | if (! form.transform()) { 30 | alert(form.msg); // feedback about errors 31 | } 32 | level = 2; 33 | } 34 | -------------------------------------------------------------------------------- /examples/tutorial/src/part1.js: -------------------------------------------------------------------------------- 1 | // AXEL tutorial part 1 2 | // Javascript file for using AXEL to load and transform a template within an iframe 3 | // See also common.js 4 | 5 | var iframe; // XML document template holder (iframe.contentDocument) 6 | 7 | // Loads the template inside an iframe 8 | function load () { 9 | iframe = document.getElementById('container'); 10 | xtdom.addEventListener(iframe, 'load', frameLoaded, false); 11 | iframe.setAttribute('src', '../../templates/Hello-world.xhtml'); 12 | } 13 | 14 | function frameLoaded () { 15 | level = 1; 16 | var iframe = document.getElementById('container'); 17 | xtdom.removeEventListener(iframe, 'load', frameLoaded, false); 18 | } 19 | 20 | // Transforms the template into an editor 21 | function transform () { 22 | if (! checkLevel(1)) return; 23 | var result = new xtiger.util.Logger(); 24 | form = new xtiger.util.Form('../axel/bundles'); 25 | form.setTemplateSource(iframe.contentDocument); 26 | form.enableTabGroupNavigation(); 27 | if (form.transform(result)) { 28 | form.injectStyleSheet('../../axel/axel.css', result); // relative to template path ! 29 | } 30 | if (result.inError()) { // Optional feedback about errors 31 | alert(result.printErrors()); 32 | } 33 | level = 2; 34 | } 35 | 36 | -------------------------------------------------------------------------------- /editor/extras/editor.css: -------------------------------------------------------------------------------- 1 | /* 2 | * ***** BEGIN LICENSE BLOCK ***** 3 | * This file is part of "XTiger Forms" by S. Sire. 4 | * 5 | * "XTiger Forms" License will be added soon 6 | * 7 | * ***** END LICENSE BLOCK ***** 8 | */ 9 | 10 | body { 11 | min-width: 650px; 12 | } 13 | 14 | #formular { 15 | background: lightgray; 16 | margin: 0; 17 | padding: 5px; 18 | position: fixed; 19 | top: 10px; 20 | left: 10px; 21 | right: 10px; 22 | z-index: 1; 23 | } 24 | 25 | #formularNoFrame { 26 | background: lightgray; 27 | margin: 0; 28 | padding: 5px; 29 | top: 10px; 30 | left: 10px; 31 | right: 10px; 32 | z-index: 1; 33 | } 34 | 35 | #url { 36 | width: 60%; 37 | } 38 | 39 | .single-line { 40 | text-align: center; 41 | } 42 | 43 | .hide { 44 | margin-left: 100px; 45 | } 46 | 47 | input { 48 | margin-left: 10px; 49 | } 50 | 51 | #frameContainer { 52 | border: none; 53 | background: white; 54 | position: fixed; 55 | top: 8em; 56 | right: 10px; 57 | bottom: 10px; 58 | left: 10px; 59 | margin: 0; 60 | padding: 0; 61 | z-index: 2; 62 | } 63 | 64 | #container { 65 | border: none; 66 | position: static; 67 | width: 100%; 68 | height: 100%; 69 | } 70 | -------------------------------------------------------------------------------- /test/auto/configuration.js: -------------------------------------------------------------------------------- 1 | // Auto tests configuration file 2 | // Use this file to create test configurations to be executed by the auto-tests in this folder 3 | 4 | var tests = { 5 | // IE 7 testing: do not leave trainling commas at the end of Hash enumaration ! 6 | 7 | 'loadSave' : { 8 | 9 | // each entry of the form: template URL : XML data URL 10 | '../templates/Core.xhtml' : '../data/core.xml', 11 | '../templates/Choice.xhtml' : '../data/choice.xml', 12 | '../templates/Repeat.xhtml' : '../data/repeat.xml', 13 | '../../templates/Hello-world.xhtml' : '../data/hello.xml', 14 | '../../templates/Curriculum.xhtml' : '../../data/cvHaddock.xml', 15 | '../../templates/Carte-Resto.xhtml' : '../../data/carteResto1.xml', 16 | '../../templates/Publications.xhtml' : '../../data/publications.xml', 17 | '../../templates/Fiche-Cafe-Flow.xhtml' : '../../data/ficheCafeFlow.xml', 18 | '../../templates/Fiche-Projet.xhtml' : '../../data/ficheProjetW.xml', 19 | '../../templates/Article.xhtml' : '../../data/article/final.xml', 20 | '../templates/Link.xhtml' : '../data/link.xml', 21 | '../templates/RichText.xhtml' : '../data/richtext.xml', 22 | '../templates/Video.xhtml' : '../data/video.xml' 23 | } 24 | } -------------------------------------------------------------------------------- /test/migration/Case-c-1.xml: -------------------------------------------------------------------------------- 1 | 2 | a content# 3 | b content# 4 | c content# 5 | 6 | a content1# 7 | b content1# 8 | c content1# 9 | a content2# 10 | b content2# 11 | c content2# 12 | 13 | d content1# 14 | e content1# 15 | f content1# 16 | d content2# 17 | e content2# 18 | f content2# 19 | g content# 20 | h content# 21 | i content# 22 | 23 | g content1# 24 | h content1# 25 | i content1# 26 | g content2# 27 | h content2# 28 | i content2# 29 | 30 | j content1# 31 | k content1# 32 | l content1# 33 | j content2# 34 | k content2# 35 | l content2# 36 | m content# 37 | n content# 38 | o content# 39 | 40 | m content1# 41 | n content1# 42 | o content1# 43 | m content2# 44 | n content2# 45 | o content2# 46 | 47 |

p content1#

48 | q content1# 49 | r content1# 50 |

p content2#

51 | q content2# 52 | r content2# 53 |
54 | -------------------------------------------------------------------------------- /src/services/capitalize.js: -------------------------------------------------------------------------------- 1 | /* ***** BEGIN LICENSE BLOCK ***** 2 | * 3 | * @COPYRIGHT@ 4 | * 5 | * This file is part of the Adaptable XML Editing Library (AXEL), version @VERSION@ 6 | * 7 | * @LICENSE@ 8 | * 9 | * Web site : http://media.epfl.ch/Templates/ 10 | * 11 | * Author(s) : Stephane Sire, Antoine Yersin 12 | * 13 | * ***** END LICENSE BLOCK ***** */ 14 | 15 | /** 16 | *

17 | * This object acts as a filter on model's instances (formerly named editors). 18 | * It catches calls made on the filtered method to add some behavior. Here the 19 | * behavior is to notify the relevant service with updates. 20 | *

21 | * 22 | *

23 | * As this object is used in a delegation pattern, model's instances that are 24 | * filtered still appear as "usual" instances. That is, their external aspect is 25 | * kept unchanged 26 | */ 27 | var _CapitalizeService = (function () { 28 | 29 | return { 30 | 31 | /** 32 | * Remap property 33 | */ 34 | '->': {'onBroadcast': '__capitalizeSuperBroadcast'}, 35 | 36 | onBroadcast : function (aModel, aResource, aData) { 37 | this.__capitalizeSuperBroadcast(aModel, aResource, aData.toUpperCase()); 38 | } 39 | } 40 | 41 | })(); 42 | 43 | xtiger.factory('service').registerDelegate('capitalize', _CapitalizeService); 44 | -------------------------------------------------------------------------------- /test/migration/Case.css: -------------------------------------------------------------------------------- 1 | h1 { 2 | margin-bottom: 0; 3 | } 4 | body { 5 | counter-reset: sect1 sect2 sect3; 6 | } 7 | /*h2.info { 8 | counter-increment: sect1; 9 | counter-reset: sect2; 10 | } 11 | h2.info:before { 12 | content: counter(sect1) ". "; 13 | } 14 | */h3.info { 15 | counter-increment: sect2; 16 | counter-reset: sect3; 17 | } 18 | h3.info:before { 19 | content: counter(sect2) ". "; 20 | /* content: counter(sect1) ". " counter(sect2) ". ";*/ 21 | } 22 | span.info:before { 23 | content: counter(sect2) ". " counter(sect3) ". "; 24 | /* content: counter(sect1) ". " counter(sect2) ". " counter(sect3) ". ";*/ 25 | counter-increment: sect3; 26 | } 27 | .info { 28 | font-family: "Avant Garde", sans-serif; 29 | font-weight: bold; 30 | } 31 | .desactivated { 32 | font-style: italic; 33 | } 34 | .desactivated:before { 35 | content: "this test has been desactivated"; 36 | } 37 | .new, .add { 38 | color: green; 39 | } 40 | .del { 41 | color: red; 42 | } 43 | .changed { 44 | color: orange; 45 | } 46 | p { 47 | margin-left: 30px; 48 | } 49 | p.explain { 50 | margin-top: -1em; 51 | font-size: 120%; 52 | color: blue; 53 | } 54 | p.subject { 55 | margin-top: 0; 56 | text-align: right; 57 | font-size: 120%; 58 | font-variant:small-caps; 59 | color: orange; 60 | float: right; 61 | } -------------------------------------------------------------------------------- /templates/Template.xhtml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Your title here 13 | 14 | 15 | 16 | 17 |

A component

18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 |

Your template title here

30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /templates/Hello-world.xhtml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | My first template 13 | 14 | 15 | 16 | 17 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 |

List of persons to great:

34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /examples/tutorial/src/common.js: -------------------------------------------------------------------------------- 1 | // AXEL tutorial - Javascript file for using AXEL 2 | // Functions commons to the 3 different parts of the tutorial 3 | // for loading and serializing XML content from a template 4 | 5 | var level = 0; 6 | var form; // for interacting with the template-generated-editor 7 | 8 | // Retrieves an XML data file and loads it inside a template object 9 | function feed (dontcheck) { 10 | if ((! dontcheck) && (! checkLevel(2))) return; 11 | var result = new xtiger.util.Logger(); 12 | var data = xtiger.cross.loadDocument('sample.xml', result); 13 | if (data) { 14 | var dataSrc = new xtiger.util.DOMDataSource(data); 15 | if (form.loadData(dataSrc, result)) { 16 | alert('Data loaded'); 17 | } 18 | } 19 | if (result.inError()) { alert(result.printErrors()); } 20 | } 21 | 22 | // Dumps the current XML content of a template into a string and print it inside the window 23 | function dump (dontcheck) { 24 | if ((! dontcheck) && (! checkLevel(2))) return; 25 | var dump = new xtiger.util.DOMLogger (); 26 | form.serializeData (dump); 27 | var xmlString = dump.dump(); 28 | var n = document.getElementById('content'); 29 | n.firstChild.data = xmlString; 30 | } 31 | 32 | // Utility method only useful in the tutorial context to monitor the progression 33 | function checkLevel (num) { 34 | var res = true; 35 | if (level < num) { 36 | alert(['Load a template first', 'Transform the template first'][level]); 37 | res = false; 38 | } 39 | return res; 40 | } -------------------------------------------------------------------------------- /editor/extras/input.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | XTigerForms input 6 | 31 | 32 | 43 | 44 | 45 | 46 |

Paste some XML data and press load to upload it to the template

47 |
48 | 49 |
50 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /axel/bundles/menubar/input.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | XML data input 6 | 31 | 32 | 43 | 44 | 45 | 46 |

Paste some XML data and press load to upload it to the template

47 |
48 | 49 |
50 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /demos/installation.txt: -------------------------------------------------------------------------------- 1 | To install these demos on a Web server, just copy the following folders from the AXEL distribution to a target folder on the Web server: 2 | 3 | axel/ 4 | config/ 5 | demos/ 6 | data/ 7 | templates/ 8 | 9 | You can have a look inside config/templates (function getDemoTemplates) to see exactly which files from data/ and templates/ are needed. 10 | 11 | Eventually you need to rebuild the axel/axel.js Library using the build.xml ant script in scripts/ with the build.lib target and adjusting build.xml so that it includes the davmenubar.js utility which is required by launch.xhtml 12 | 13 | The demos use the utility davmenubar.js (see launcher.xhtml and launcher.js), so if you use a WebDAV server, the users will be able to save data to the WebDAV server by clicking on the "Save" button. 14 | 15 | Internet Explorer special instructions 16 | -------------------------------------- 17 | 18 | To run the demos from a Web server with Internet Explorer, index.html dynamically changes the links. It replaces launch.xhtml with launch.html, and it changes the template suffixes from .xhtml to .html. Hence you must copy launch.xhtml to launch.html and all the templates to their counterpart with an html extension after installation. Links are not changed if the files are opened from the local file system, because in that case IE uses the meta tag content-type for MIME-Type detection. However the demos doesn't work in that case on IE as it does not allow to open the template files inside an iframe. 19 | 20 | 21 | -------------------------------------------------------------------------------- /design/repeat/preview.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | Icon Visu Test 7 | 30 | 31 | 32 | 38 |

Avec span (optimisation future)

39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /contribs/migration/minmax.js: -------------------------------------------------------------------------------- 1 | function minmax(node) { 2 | var div = node.parentNode.parentNode; 3 | if (div.isminified) { 4 | node.src = "img/arrow-minimize.png"; 5 | doHeightChangeMem(div, div.currentHeight, div.maxHeight, 10, 10, 0.5); 6 | div.style.borderBottom = 'none'; 7 | div.isminified = false; 8 | } else { 9 | div.maxHeight = parseInt(xtdom.getComputedStyle(div, 'height')); 10 | div.currentHeight = div.maxHeight; 11 | node.src = "img/arrow-maximize.png"; 12 | doHeightChangeMem(div, div.currentHeight, (div.currentHeight - 320), 13 | 10, 10, 0.5); 14 | div.style.borderBottom = '2px solid #F0F0F0'; 15 | div.isminified = true; 16 | } 17 | } 18 | function doHeightChangeMem(elem, startHeight, endHeight, steps, intervals, powr) { 19 | //Height changer with Memory by www.hesido.com 20 | if (elem.heightChangeMemInt) 21 | window.clearInterval(elem.heightChangeMemInt); 22 | var curStep = 0; 23 | elem.heightChangeMemInt = window.setInterval(function() { 24 | elem.currentHeight = easeInOut(startHeight, endHeight, steps, curStep, 25 | powr); 26 | elem.style.height = elem.currentHeight + "px"; 27 | curStep++; 28 | if (curStep > steps) 29 | window.clearInterval(elem.heightChangeMemInt); 30 | }, intervals) 31 | } 32 | 33 | function easeInOut(minValue, maxValue, totalSteps, actualStep, powr) { 34 | //Generic Animation Step Value Generator By www.hesido.com 35 | var delta = maxValue - minValue; 36 | var stepp = minValue 37 | + (Math.pow(((1 / totalSteps) * actualStep), powr) * delta); 38 | return Math.ceil(stepp) 39 | } -------------------------------------------------------------------------------- /data/carteResto2.xml: -------------------------------------------------------------------------------- 1 | 2 | La carte... 3 | 4 | Entrées 5 | 6 | 7 | Salade de crudités 8 | 6 9 | 10 | 11 | Salade de cabécou 12 | 7.50 13 | 14 | 15 | Salade de coeurs de canard 16 | 8 17 | 18 | 19 | 20 | 21 | Plats 22 | 23 | 24 | Brochette de veau au romarin 25 | 11 26 | 27 | 28 | Cuisse de canette farcie aux raisins secs 29 | 12 30 | 31 | 32 | Selle d'agneau grillée beurre maître d'hôtel 33 | 13.5 34 | 35 | 36 | 37 | 38 | Desserts 39 | 40 | 41 | Le café gourmand 42 | 4.8 43 | 44 | 45 | Crème brulée au miel 46 | 4.8 47 | 48 | 49 | Mi cuit au chocolat 50 | 4.8 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /data/cvHaddock.xml: -------------------------------------------------------------------------------- 1 | 2 | Capitaine Haddock 3 | Inconnue 4 |
Chateau de Moulinsart
5 | 04 56 78 30 20 6 | 7 | Capitaine au long cours 8 | 9 | 10 | 11 | 1965-1968 12 | École de la marine 13 | Diplôme otbenu avec félicitations 14 | Brest 15 | 16 | 17 | 1961-1964 18 | Lycée des cadets de marine 19 | Animateur du club des joyeux Bacchus 20 | La Rochelle 21 | 22 | 23 | 24 | 25 | Héro de bande dessinée 26 | Moulinsart 27 | 28 | 29 | 30 | 31 | Breton 32 | Natif 33 | 34 | 35 | Français 36 | Natif 37 | 38 | 39 | 40 | Expert en wiskhy et spiritueux 41 | Navigation par tout temps 42 | 43 | 44 | Inventeur d'onomatopées 45 | 46 |
47 | -------------------------------------------------------------------------------- /test/misc/simpleTemplate.xhtml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | Test Template 9 | 10 | 11 | 12 | 13 |

Textarea: un

14 |

Input: deux

15 |

Textarea (w class): un

16 |

Input (w class): deux

17 |

Same with layout=fload

18 |

Textarea: un

19 |

Input: deux

20 |

Textarea (w class): un

21 |

Input (w class): deux

22 | 23 | 24 | -------------------------------------------------------------------------------- /data/hCVHaddock.xml: -------------------------------------------------------------------------------- 1 | 2 | Capitaine Haddock 3 | Inconnue 4 |
Chateau de Moulinsart
5 | 04 56 78 30 20 6 | haddock@moulinsart.fr 7 | 8 | Capitaine au long cours 9 | 10 | 11 | 12 | 1965-1968 13 | École de la marine 14 | Diplôme otbenu avec félicitations 15 | Brest 16 | 17 | 18 | 1961-1964 19 | Lycée des cadets de marine 20 | Animateur du club des joyeux Bacchus 21 | La Rochelle 22 | 23 | 24 | 25 | 26 | 1969 27 | Aujourd'hui 28 | Héro de bande dessinée 29 | Moulinsart 30 | 31 | 32 | 33 | 34 | Breton 35 | Natif 36 | 37 | 38 | Français 39 | Natif 40 | 41 | 42 | 43 | Expert en wiskhy et spiritueux 44 | Navigation par tout temps 45 | 46 | 47 | Inventeur d'onomatopées 48 | 49 |
50 | -------------------------------------------------------------------------------- /distrib/AUTHORS: -------------------------------------------------------------------------------- 1 | Copyright (C) 2008, 2009, 2010, 2011 Stéphane Sire 2 | 3 | Adaptable XML Editing Library (AXEL) is free software ; you can redistribute it 4 | and/or modify it under the terms of the GNU Lesser General Public License (the "LGPL") 5 | as published by the Free Software Foundation ; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | 8 | The library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY ; 9 | without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 10 | PURPOSE. See the GNU Lesser General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License along with this library ; 13 | if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, 14 | Boston, MA 02111-1307 USA. 15 | 16 | Contact & Author: 17 | 18 | Stéphane Sire (s.sire@free.fr) 19 | 20 | Contributors: 21 | 22 | Antoine Yersin (antoine.yersin@epfl.ch) 23 | Jonathan Wafellman (jonathan.wafellman@a3.epfl.ch) 24 | Useful Web Sàrl (manuel@madeinlocal.com) 25 | Vincent Quint (vincent.quint@inria.fr) [contribs/xmlschemas] 26 | 27 | Web site : http://media.epfl.ch/Templates/ 28 | 29 | Acknowledgment : 30 | 31 | Early work on this project has been initiated in the framework of the PALETTE Integrated 32 | Project supported by the IST programme of the European Commission (DG Information Society 33 | and Media, no. 028038). Further developments of the XTiger language are currently supported 34 | by the Innovation Promotion Agency of Switzerland under grant No 10813.1 PFES-ES, a project 35 | in collaboration with Useful Web Sàrl. 36 | -------------------------------------------------------------------------------- /test/data/core.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | PASSED 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | PASSED 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | Hello 33 | World 34 | PASSED 35 | 36 | 37 | 38 | 39 | 40 | PASSED 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | PASSED 61 | 62 | 63 | 64 | 65 | 66 | PASSED 67 | PASSED 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /test/misc/logErrors.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | AXEL Test for the error logging functions 9 | 17 | 18 | 19 | 20 | 21 | 41 | 42 | 43 | 44 | 45 | 46 |

This test checks the xtiger.cross.log and xtiger.cross.print functions

47 |

Use it without the console enabled, when you click on the link below you should see an alert, 48 | if not something wrong happend.

49 |

Test log or Test print

50 | 51 | 52 | -------------------------------------------------------------------------------- /scripts/ant.distrib.properties: -------------------------------------------------------------------------------- 1 | # core 2 | core.src.dir = ../src/core 3 | core.lib.files = loader.js dom.js domdatasource.js domlogger.js defaultbrowser.js iebrowser.js filterable.js parser.js forms.js 4 | 5 | # editor / generator 6 | editor.src.dir = ../src/editor/classical 7 | editor.lib.files = generator.js repeat.js choice.js keyboard.js tabgroupmgr.js string.js xmlloader.js xmlserializer.js 8 | # removed : xmlrobustloader.js 9 | 10 | # devices 11 | devices.src.dir = ../src/devices 12 | devices.lib.files = text.js popup.js lens.js upload.js 13 | 14 | # plugins 15 | plugins.src.dir = ../src/plugins 16 | plugins.lib.files = text.js select.js link.js richtext.js photo.js video.js 17 | 18 | # filters 19 | filters.src.dir = ../src/filters 20 | filters.lib.files = service.js common.js debug.js documentid.js image.js layout.js video.js wiki.js 21 | 22 | # services 23 | services.src.dir = ../src/services 24 | services.lib.files = service.js common.js date.js debug.js 25 | 26 | # utilities 27 | util.src.dir = ../src/util 28 | util.lib.files = debug.js ioutils.js 29 | 30 | # css 31 | css.dir = ../stylesheets 32 | 33 | # editor application 34 | editor.app.dir = ../editor 35 | template.dir = ../editor/templates 36 | 37 | # library 38 | product.name = axel 39 | build.dir = ../axel 40 | # PLEASE set the next property to the path to your YUI compressor jar file 41 | # if you want to run the ant build.lib task 42 | javascript.compressor = /Volumes/Macintosh\ HD/Applications/Outils/yuicompressor-2.4.2/build/yuicompressor-2.4.2.jar 43 | 44 | # JSDoc documentation (unmaintained at that time) 45 | doc.build.dir = ../docs/jsdoc 46 | # PLEASE set the next property to the path to your jsdoc installation 47 | # if you want to run the ant build.doc task 48 | jsdoc.generator.dir = /home/gnaffron/bin/jsdoc 49 | # FIXME : we should use a shell variable such as $JSDOC and fallback here if undefined 50 | 51 | 52 | -------------------------------------------------------------------------------- /templates/Meeting-Report.xhtml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Meeting minutes 13 | 14 | 15 | 16 | 17 |
    18 | 19 |
  • participant name
  • 20 |
    21 |
22 |
23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 |

Meeting title

34 | 35 | Goal 36 | 37 |

Present

38 | 39 |

Decisions

40 | 45 |

Excused

46 | 47 | 48 | -------------------------------------------------------------------------------- /test/templates/Filters.xhtml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | XTiger XML and AXEL test case : 'text' Filter features 13 | 14 | 15 | 16 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |

This template contains XTiger XML declarations that stress the 'text' Filters of the AXEL library

25 | 26 |

'placed' 'textarea' 'text' editor with no filter : content

27 | 28 |

'placed' 'textarea' 'text' editor with a wiki filter : content

29 | 30 |

'placed' 'textarea' 'text' editor with no filter : content

31 | 32 |

'placed' 'textarea' 'text' editor with video filter : content

33 | 34 | 35 | -------------------------------------------------------------------------------- /src/filters/documentid.js: -------------------------------------------------------------------------------- 1 | /* ***** BEGIN LICENSE BLOCK ***** 2 | * 3 | * @COPYRIGHT@ 4 | * 5 | * This file is part of the Adaptable XML Editing Library (AXEL), version @VERSION@ 6 | * 7 | * @LICENSE@ 8 | * 9 | * Web site : http://media.epfl.ch/Templates/ 10 | * 11 | * Author(s) : Stephane Sire 12 | * 13 | * ***** END LICENSE BLOCK ***** */ 14 | 15 | /* 16 | * DocumentId stores its value into xtiger.session(doc) as "documentId" 17 | * When used in an invisible part of the template, this allows to generate a document identifier 18 | * which can be used by some primitive plugin editors to communicate with a server (e.g. Photo upload) 19 | */ 20 | var _DocumentIdFilter = (function _DocumentIdFilter() { 21 | 22 | ///////////////////////////////////////////////// 23 | ///// Static DocumentId Mixin Part /////// 24 | ///////////////////////////////////////////////// 25 | 26 | // none 27 | 28 | return { 29 | 30 | /////////////////////////////////////////////////// 31 | ///// Instance DocumentId Mixin Part //////// 32 | /////////////////////////////////////////////////// 33 | 34 | // Property remapping for chaining 35 | '->' : { 36 | '_setData' : '__DocumentIdSuperSetData' 37 | }, 38 | 39 | /** Creates the entry for the identifier into the TOC using it's default text 40 | * DOES forward call. 41 | */ 42 | _setData : function(aData) { 43 | this.__DocumentIdSuperSetData(aData); 44 | xtiger.session(this.getDocument()).save('documentId', aData); 45 | } 46 | 47 | /** add any other method from the filtered object that you want to override */ 48 | 49 | /** add any other method you want to add to the filtered object to be called with can() / execute() */ 50 | 51 | }; 52 | 53 | })(); 54 | 55 | //Register this filter as a filter of the 'text' plugin (i.e. text.js must have been loaded) 56 | xtiger.editor.Plugin.prototype.pluginEditors['text'].registerFilter( 57 | 'documentId', _DocumentIdFilter); -------------------------------------------------------------------------------- /templates/Study.xsl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | . 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 23 | 24 | 25 | 26 | 27 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 54 | 55 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /test/templates/Repeat.xhtml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | XTiger XML and AXEL test case : Repeat features 13 | 14 | 15 | 16 | 17 |

Element A : a content

18 |

Element B : b content

19 |

Element C : c content

20 |
21 | 22 |
23 | 24 | 25 | 26 | 27 |

This template contains XTiger XML declarations that stress the repeat editor of the AXEL library

28 | 29 | 30 |

Simple text field with label : content

31 | 32 |

Anonymous repetition from 1 to * at the end of the document

33 | 34 | 35 |
36 | 37 | 38 |
39 |
40 | 41 |

Simple text field with label : content

42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /templates/Assistanat.xhtml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Tâches 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |
    22 |
  • Langage Java :
  • 23 |
  • Toolkit GWT :
  • 24 |
25 |
26 | 27 |
28 | 29 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 |

Fiche d'assistance

44 | 45 |

Identité

46 |

Nom : Nom

47 |

Prénom : Prénom

48 | 49 |

Connaissances

50 | 51 |

Indiquez vos niveaux de connaissance:

52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /data/ficheCafeFlow.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Restaurant des embruns 4 | A chaque jour son ambiance 5 | 6 | Avenue d'Ouchy 7 | Evian 8 | 021.693.12.18 9 | 021.693.12.18 10 | s.sire@free.fr 11 | 12 | 13 | Restauration 14 | 15 | Poisson 16 | Pizzas 17 | 18 | Salle de jeux 19 | 20 | Flippers 21 | Billard 22 | Babyfoot 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 17:00 39 | 24:00 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 17:00 49 | 23:00 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 7:00 59 | 9:00 60 | 61 | 62 | 12:00 63 | 14:00 64 | 65 | 66 | 19:00 67 | 1:00 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 17:00 77 | 23:00 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /examples/tutorial/tutorial.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 20px 10px; 3 | font-family: Optima,'Trebuchet MS', Helvetica, sans-serif; 4 | background-color: #999; 5 | } 6 | 7 | div.content { 8 | background: white; 9 | padding: 20px 15px; 10 | -moz-box-shadow: 2px 2px 1px #000; 11 | -webkit-box-shadow: 2px 2px 1px #000; 12 | } 13 | 14 | h1 { 15 | text-align: center; 16 | } 17 | 18 | h1, span.step { 19 | font-family: Tahoma, Geneva, sans-serif; 20 | } 21 | 22 | p.step { 23 | margin-top: 2em; 24 | } 25 | 26 | span.stepTitle { 27 | font-size: 120%; 28 | } 29 | 30 | div.source { 31 | display: none; 32 | border: dotted 1px black; 33 | padding: 0.2em; 34 | margin: 1em 0 1em 5%; 35 | background: rgb(238, 238, 238); 36 | font-family: monospace; 37 | } 38 | 39 | div.explanation { 40 | display: none; 41 | border: dotted 1px black; 42 | margin: 0.5em 0 1em 5%; 43 | padding: 0.2em; 44 | background: rgb(255, 255, 170); 45 | } 46 | 47 | p.explain { 48 | text-align: right; 49 | padding: 0; 50 | margin: 0 1em 0.2em 0; 51 | } 52 | 53 | span.button { 54 | font-size: 80%; 55 | border-bottom: dotted 1px darkviolet; 56 | color: darkviolet; 57 | } 58 | 59 | div#document { 60 | position: relative; 61 | margin: 0 auto; 62 | width: 500px; 63 | border: inset 1px black; 64 | overflow: hidden; 65 | } 66 | 67 | p.template { 68 | position: absolute; 69 | top: 0; 70 | left: 0; 71 | color: white; 72 | background-color: blue; 73 | padding: 0; 74 | margin: 0; 75 | } 76 | 77 | iframe#container, div#container { 78 | width: 100%; 79 | padding-top: 1.5em; 80 | overflow: hidden; 81 | min-height: 100px; 82 | } 83 | 84 | @media print { 85 | .noprint { 86 | display: none 87 | } 88 | 89 | body { 90 | margin: 20px; 91 | font-family: Optima,'Trebuchet MS', Helvetica, sans-serif; 92 | background-color: white; 93 | } 94 | 95 | div.content { 96 | background: white; 97 | padding: 0; 98 | -moz-box-shadow: none; 99 | -webkit-box-shadow: none; 100 | } 101 | 102 | div.source { 103 | background: white; 104 | border: none; 105 | } 106 | 107 | div.explanation { 108 | background: white; 109 | border: none; 110 | } 111 | } -------------------------------------------------------------------------------- /test/migration/Case-d-1.xml: -------------------------------------------------------------------------------- 1 | 2 | a1 content# 3 | b1 content# 4 | c1 content# 5 | 6 | a1 content1# 7 | b1 content1# 8 | c1 content1# 9 | d1 content1# 10 | a1 content2# 11 | b1 content2# 12 | c1 content2# 13 | a1 content3# 14 | b1 content3# 15 | c1 content3# 16 | d1 content3# 17 | 18 | 19 | 20 | a1 content1# 21 | b1 content1# 22 | c1 content1# 23 | d1 content1# 24 | 25 | 26 | a1 content2# 27 | b1 content2# 28 | c1 content2# 29 | 30 | 31 | a1 content3# 32 | b1 content3# 33 | c1 content3# 34 | d1 content3# 35 | 36 | 37 | a2 content1# 38 | b2 content1# 39 | c2 content1# 40 | d2 content1# 41 | a2 content2# 42 | b2 content2# 43 | c2 content2# 44 | a2 content3# 45 | b2 content3# 46 | c2 content3# 47 | d2 content3# 48 | 49 | a2 content1# 50 | b2 content1# 51 | c2 content1# 52 | d2 content1# 53 | 54 | 55 | a2 content2# 56 | b2 content2# 57 | c2 content2# 58 | 59 | 60 | a2 content3# 61 | b2 content3# 62 | c2 content3# 63 | d2 content3# 64 | 65 | 66 | e content1# 67 | f content1# 68 | e content2# 69 | f content2# 70 | 71 | 72 | g content1# 73 | h content1# 74 | 75 | e content1# 76 | f content1# 77 | e content2# 78 | f content2# 79 | g content1# 80 | h content1# 81 | 82 | i content1# 83 | j content1# 84 | i content2# 85 | j content2# 86 | 87 | i content1# 88 | j content1# 89 | i content2# 90 | j content2# 91 | 92 | -------------------------------------------------------------------------------- /src/util/debug.js: -------------------------------------------------------------------------------- 1 | /* ***** BEGIN LICENSE BLOCK ***** 2 | * 3 | * @COPYRIGHT@ 4 | * 5 | * This file is part of the Adaptable XML Editing Library (AXEL), version @VERSION@ 6 | * 7 | * @LICENSE@ 8 | * 9 | * Web site : http://media.epfl.ch/Templates/ 10 | * 11 | * Author(s) : Stephane Sire 12 | * 13 | * ***** END LICENSE BLOCK ***** */ 14 | 15 | /** 16 | * This file contains some utility functions to debug AXEL applications 17 | * These functions are located within the xtiger.debug namespace 18 | * This file should not be built with the other files when deploying AXEL applications, it's for debug only 19 | */ 20 | xtiger.debug = {}; 21 | 22 | /** 23 | * Loads the XHTML document at URL 24 | * Experimental version that uses XMLHTTPRequest object on all browser except IE 25 | * On IE (IE8, IE7 ?, untested on IE6) it uses the MSXML2.DOMDocument ActiveX for parsing XML documents into an IXMLDOMElement 26 | * as a benefit it can open templates / XML documents from the local file system on IE 27 | * 28 | * Accepts an optional logger (xtiger.util.Logger) object to report errors 29 | * Returns the document (should be a DOM Document object) or false in case of error 30 | */ 31 | xtiger.debug.loadDocument = function (url, logger) { 32 | if (window.navigator.appName == "Microsoft Internet Explorer") { // will try with MSXML2.DOMDocument 33 | var errMsg; 34 | try { 35 | var xtDoc = new ActiveXObject("MSXML2.DOMDocument.6.0"); 36 | xtDoc.async = false; 37 | xtDoc.resolveExternals = false; 38 | xtDoc.validateOnParse = false; 39 | xtDoc.setProperty("ProhibitDTD", false); // true seems to reject files with a DOCTYPE declaration 40 | xtDoc.load(url); 41 | if (xtDoc.parseError.errorCode != 0) { 42 | errMsg = xtDoc.parseError + ' ' + xtDoc.parseError.reason; 43 | } else { 44 | return xtDoc; // OK, returns the IXMLDOMElement DOM element 45 | } 46 | } catch (e) { 47 | errMsg = e.name; 48 | } 49 | if (errMsg) { 50 | if (logger) { 51 | logger.logError('Error while loading $$$ : ' + errMsg, url); 52 | } else { 53 | alert("ERROR:" + errMsg); 54 | } 55 | xtDoc = null; 56 | } 57 | } else { 58 | return xtiger.cross.loadDocument(url, logger); 59 | } 60 | return false; 61 | } 62 | 63 | -------------------------------------------------------------------------------- /scripts/ant.properties: -------------------------------------------------------------------------------- 1 | # core 2 | core.src.dir = ../src/core 3 | core.lib.files = loader.js dom.js domdatasource.js domlogger.js defaultbrowser.js iebrowser.js filterable.js parser.js forms.js 4 | core.distrib.files = ${core.lib.files} 5 | 6 | # editor / generator 7 | editor.src.dir = ../src/editor/classical 8 | editor.lib.files = generator.js repeat.js choice.js keyboard.js tabgroupmgr.js string.js xmlrobustloader.js xmlloader.js xmlserializer.js 9 | editor.distrib.files = ${editor.lib.files} 10 | # htmlloader.js htmlserializer.js 11 | 12 | # devices 13 | devices.src.dir = ../src/devices 14 | devices.lib.files = text.js popup.js lens.js upload.js autocomplete.js trackermenu.js 15 | devices.distrib.files = text.js popup.js lens.js upload.js trackermenu.js 16 | 17 | # plugins 18 | plugins.src.dir = ../src/plugins 19 | plugins.lib.files = text.js select.js link.js richtext.js photo.js video.js 20 | plugins.distrib.files = ${plugins.lib.files} 21 | 22 | # filters 23 | filters.src.dir = ../src/filters 24 | filters.lib.files = service.js autocomplete.js common.js debug.js documentid.js image.js layout.js video.js wiki.js 25 | filters.distrib.files = service.js common.js debug.js documentid.js image.js layout.js video.js wiki.js 26 | 27 | # services 28 | services.src.dir = ../src/services 29 | services.lib.files = service.js common.js date.js debug.js suggest.js 30 | services.distrib.files = service.js common.js date.js debug.js 31 | 32 | # utilities 33 | util.src.dir = ../src/util 34 | util.lib.files = debug.js ioutils.js 35 | util.distrib.files = debug.js ioutils.js davmenubar.js editorbar.js 36 | 37 | # css 38 | css.dir = ../stylesheets 39 | 40 | # editor application 41 | editor.app.dir = ../editor 42 | template.dir = ../editor/templates 43 | 44 | # library 45 | product.name = axel 46 | dist.package.name = ${product.name}-${version.number} 47 | build.dir = ../axel 48 | javascript.compressor = /Volumes/Macintosh\ HD/Applications/Outils/yuicompressor-2.4.2/build/yuicompressor-2.4.2.jar 49 | 50 | # "exemplify" target (deprecated) 51 | product.path = ../axel 52 | # product.path should depend on where you expect the template files to be placed 53 | # they will include the library as ${product.path}/${product.name}.stg 54 | 55 | # JSDoc documentation (unmaintained at that time) 56 | doc.build.dir = ../docs/jsdoc 57 | jsdoc.generator.dir = /home/gnaffron/bin/jsdoc 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /src/services/common.js: -------------------------------------------------------------------------------- 1 | /* ***** BEGIN LICENSE BLOCK ***** 2 | * 3 | * @COPYRIGHT@ 4 | * 5 | * This file is part of the Adaptable XML Editing Library (AXEL), version @VERSION@ 6 | * 7 | * @LICENSE@ 8 | * 9 | * Web site : http://media.epfl.ch/Templates/ 10 | * 11 | * Author(s) : Stephane Sire 12 | * 13 | * ***** END LICENSE BLOCK ***** */ 14 | 15 | var _CopyService = (function () { 16 | 17 | return { 18 | 19 | /** 20 | * Remap property 21 | */ 22 | '->': {'onBroadcast': '__copySuperBroadcast'}, 23 | 24 | onBroadcast : function (aModel, aResource, aData) { 25 | aModel.update(aData, true); // true to avoid reemitting update event 26 | this.__copySuperBroadcast(aModel, aResource, aData); // chains service 27 | } 28 | } 29 | 30 | })(); 31 | 32 | xtiger.factory('service').registerDelegate('copy', _CopyService); 33 | 34 | var _CopyCondService = (function () { 35 | 36 | // Only copies aData to consumers subscribed to service with a resource key 37 | // similar to "aResourceKey(floor)" or "aResourceKey(ceiling)" and if they meet the condition 38 | var _testAndCopy = function(aDelegate, aProducer, aResource, aDataAsNumber, aModel) { 39 | var cur; 40 | if (aModel == aProducer) { 41 | return; // no need to test the producer itself 42 | } 43 | if (aModel.checkServiceKey(aDelegate.getKey(), aResource + '(floor)')) { 44 | cur = parseInt(aModel.getData()); 45 | if (isNaN(cur) || (aDataAsNumber < cur)) { 46 | aModel.update(aDataAsNumber.toString(), true); // true to avoid reemitting update event 47 | } 48 | } else if (aModel.checkServiceKey(aDelegate.getKey(), aResource + '(ceiling)')) { 49 | cur = parseInt(aModel.getData()); 50 | if(isNaN(cur) || (aDataAsNumber > cur)) { 51 | aModel.update(aDataAsNumber.toString(), true); // true to avoid reemitting update event 52 | } 53 | } // ignores other keys 54 | } 55 | 56 | return { 57 | 58 | /** 59 | * Remap property 60 | */ 61 | '->': {}, 62 | 63 | notifyUpdate : function (aProducer, aResource, aData) { 64 | var newVal = parseInt(aData); 65 | if (! isNaN(newVal)) { 66 | this._apply(aProducer, aResource, newVal, this.getHandle(), _testAndCopy); 67 | } 68 | } 69 | } 70 | 71 | })(); 72 | 73 | xtiger.factory('service').registerDelegate('copycond', _CopyCondService); -------------------------------------------------------------------------------- /contribs/xmlschemas/XTigerCleanup.xsl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 17 | 18 | 22 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 53 | 54 | 55 | 56 | filter=wiki 57 | 58 | 59 | 60 | 61 | filter=image 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /demos/launch.xhtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | AXEL demo launcher 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 50 | 51 | 58 | 59 | 60 | 61 | 62 | 63 | 69 | 70 | 71 | 74 |
75 | 76 |
77 | 78 | -------------------------------------------------------------------------------- /data/pageWeb.xhtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | edit 9 |

Ecrire du HTML avec XTiger Forms

10 |

Ce template experimental montre qu'il est possible de créer des documents XHTML directement comme langage cibles de XTiger Forms. Il est possible de créer par exemple:

11 |
    12 |
  • des titres (h1, h2, h3)
  • 13 |
  • des listes simples (ul / li)
  • 14 |
  • des paragraphes
  • 15 |
16 |

Bien sûr rien n'interdit de créer un template plus complexe avec tous les autres éléments. Il est aussi possible de mélanger édition de type Wiki et édition HTML pour introduire plus d'éléments typographiques. A cette fin nous allons rapidement développer un filtre "wikiweb". Par exemple il est indispensable d'introduire les liens hypertextes.

17 |

À moyen terme toute la documentation sur XTiger Forms devrait pouvoir être écrite avec XTiger Forms.

18 |

Comment sauvegarder ce document

19 |
    20 |
  • Vérifiez bien que dans la partie supérieure que le HEAD définit un namespace par défaut xhtml, et que le Content-Type soit text/html
  • 21 |
  • Sauvegardez le fichier avec une extension .xhtml
  • 22 |
  • Faîtes pointer le "Top anchor" sur une URL du type xhtml.xhtml#data=votre_nom_de_fichier, ceci est nécessaire si vous souhaitez insérer correctement le lien pour éditer le fichier
  • 23 |
24 |

Pour ouvrir votre document après sauvegarde, pointez le navigateur sur celui-ci en changeant l'URL dans la barre de navigation du navigateur.

25 |

Idées

26 |

Nous pourrions aussi développer la partie éditable dans la section HEAD pour permettre l'édition du style du document lui-même en utilisant un éditeur de type code source multiline (balise <pre> par exemple, cf. le template Article) pour saisir le style. Nous pourrions aussi utiliser un template avec les sélecteurs et les règles CSS, mais dans ce cas il faudrait inventer un filtre non terminal pour transformer le XML produit en syntaxe CSS.

27 |

Sandbox

28 |

Vous pouvez vous amuser à compléter ce document et à le sauvegarder pour voir le résultat.

29 | 30 | 31 | -------------------------------------------------------------------------------- /templates/StructPart.css: -------------------------------------------------------------------------------- 1 | /************************************************ 2 | Structured Part XTiger Component style 3 | 4 | Parag | List{ ListItem | SubList{ SubListItem }} 5 | ************************************************/ 6 | 7 | /* Top level */ 8 | 9 | div.xtc-spart-row { 10 | clear: left; 11 | margin-bottom: 0.5em; 12 | /* border: solid 1px green; */ 13 | } 14 | 15 | span.xtc-spart-menu { 16 | float: left; 17 | margin-bottom: 10px; 18 | margin-right: 10px; 19 | } 20 | 21 | /* 1st level content */ 22 | 23 | .xtc-spart-content { 24 | margin-left: 80px; 25 | } 26 | 27 | p.xtc-spart-parag { 28 | margin: 0; 29 | /* border: solid 1px yellow;*/ 30 | } 31 | 32 | p.xtc-spart-listheader { 33 | margin: 0 0 0.4em 0; 34 | } 35 | 36 | ul.xtc-spart-list { 37 | padding: 0; 38 | margin: 0; 39 | } 40 | 41 | li.xtc-spart-listitemwrapper:first-of-type { 42 | clear: none; 43 | } 44 | 45 | li.xtc-spart-listitemwrapper { 46 | clear: left; 47 | list-style: none none inside; 48 | margin-bottom: 0.5em; 49 | } 50 | 51 | /* 2nd level content */ 52 | 53 | p.xtc-spart-listitem { 54 | margin: 0 0 0 70px; 55 | display: list-item; 56 | list-style: disc none inside; 57 | } 58 | 59 | p.xtc-spart-sublistheader { 60 | margin: 0 0 0.4em 0; 61 | list-style: disc none inside; 62 | color: green; 63 | } 64 | 65 | li.xtc-spart-sublistitem { 66 | margin-bottom: 0.5em; 67 | /* Opera */ 68 | list-style: circle none inside; 69 | margin-left: 1em; 70 | } 71 | 72 | li.xtc-spart-sublistitem:last-of-type { 73 | min-height: 2em; 74 | } 75 | 76 | /* Preview mode */ 77 | 78 | span.axel-core-on[display = none] + body.preview .nopreview { 79 | display : none; 80 | } 81 | 82 | body.preview span.xtc-spart-menu { 83 | display: none; 84 | } 85 | 86 | body.preview .xtc-spart-content, p.xtc-spart-listitem { 87 | margin-left: 0; 88 | } 89 | 90 | body.preview li.xtc-spart-listitemwrapper, body.preview li.xtc-spart-sublistitem { 91 | margin-bottom: 0.2em; 92 | } 93 | 94 | body.preview p.xtc-spart-parag { 95 | margin-bottom: 1em; 96 | } 97 | 98 | body.preview li.xtc-spart-sublistitem:last-of-type { 99 | min-height: 0; 100 | } 101 | 102 | -------------------------------------------------------------------------------- /src/services/debug.js: -------------------------------------------------------------------------------- 1 | /* ***** BEGIN LICENSE BLOCK ***** 2 | * 3 | * @COPYRIGHT@ 4 | * 5 | * This file is part of the Adaptable XML Editing Library (AXEL), version @VERSION@ 6 | * 7 | * @LICENSE@ 8 | * 9 | * Web site : http://media.epfl.ch/Templates/ 10 | * 11 | * Author(s) : Stephane Sire 12 | * 13 | * ***** END LICENSE BLOCK ***** */ 14 | 15 | var _DebugService = (function () { 16 | 17 | return { 18 | 19 | /** 20 | * Remap property 21 | */ 22 | '->': { 23 | // configuration method 24 | 'configure': '__debugSuperConfigure', 25 | // Producer notification methods 26 | 'notifyLoad': '__debugSuperNotifyLoad', 27 | 'notifyUpdate': '__debugSuperNotifyUpdate', 28 | 'askUpdate': '__debugSuperAskUpdate', 29 | 'notifyRemove': '__debugSuperNotifyRemove', 30 | // Consumer callback method 31 | 'onBroadcast': '__debugSuperOnBroadcast' 32 | }, 33 | 34 | configure : function (aConfigurator, aResource, aData) { 35 | xtiger.cross.log('debug', 'configure[' + aResource + '] => ' + aData); 36 | this.__debugSuperConfigure(aConfigurator, aResource, aData); 37 | }, 38 | 39 | notifyLoad : function (aProducer, aResource, aData) { 40 | xtiger.cross.log('debug', 'notifyLoad[' + aResource + '] => ' + aData); 41 | this.__debugSuperNotifyLoad(aProducer, aResource, aData); 42 | }, 43 | 44 | notifyUpdate : function (aProducer, aResource, aData) { 45 | // var k = aProducer.getKey(); 46 | xtiger.cross.log('debug', 'notifyUpdate[' + aResource + '] => ' + aData); 47 | this.__debugSuperNotifyUpdate(aProducer, aResource, aData); 48 | }, 49 | 50 | askUpdate : function (aConsumer, aResource) { 51 | // var k = aProducer.getKey(); 52 | xtiger.cross.log('debug', 'askUpdate[' + aResource + ']'); 53 | this.__debugSuperAskUpdate(aConsumer, aResource); 54 | }, 55 | 56 | notifyRemove : function (aProducer, aResource, aData) { 57 | // var k = aProducer.getKey(); 58 | xtiger.cross.log('debug', 'notifyRemove[' + aResource + '] => ' + aData); 59 | this.__debugSuperNotifyRemove(aProducer, aResource, aData); 60 | }, 61 | 62 | onBroadcast : function (aConsumer, aResource, aData) { 63 | // var k = aProducer.getKey(); 64 | xtiger.cross.log('debug', 'onBroadcast[' + aResource + '] => ' + aData); 65 | this.__debugSuperOnBroadcast(aConsumer, aResource, aData); 66 | } 67 | } 68 | 69 | })(); 70 | 71 | xtiger.factory('service').registerDelegate('debug', _DebugService); 72 | -------------------------------------------------------------------------------- /test/templates/Image.xhtml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Your title here 13 | 14 | 15 | 16 | 17 |

click to edit item textual content

18 | 19 |
20 | 21 | 22 | 23 | 24 |
25 | 26 |
27 |
28 |
29 | 30 | 31 |

click to edit paragraph

32 |
33 | 34 |
35 | 36 | 37 | 38 | 39 | 44 | 45 | 46 | 47 | 48 | 49 |

Image Filter Test File

50 | 51 |

image-tag='src'

52 | 53 | enter image file name 56 | 57 |

Second image, try to focus it with TAB

58 | 59 | enter image file name 62 | 63 |

Some other data

64 | Fin 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /test/templates/Link.xhtml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | XTiger XML and AXEL automatic (load / save) test case : 'link' primitive editor plugin 13 | 14 | 15 | 16 | 17 | 18 |

Automatic (load / save) test case for 'link' editor

19 | 20 |

This template contains XTiger XML declarations that stress the 'link' primitive editor plugin of the AXEL library

21 | 22 |

There are tested various situation involving the link editor, that is (at the moment), the 3-tuple composed with the link model, the lens device and the link lens content.

23 | 24 |

Simple editor

25 |

This is a link 1. Try to edit it.

26 | 27 |

Consecutive editors

28 |

Now test the succession of editors and the tab management. Here's a text editor, followed by 29 | a link 2 one. Isn't tabbing 30 | fun ? no. 31 |

32 | 33 |

Repeatable editors

34 |

Let's add more links

35 |
36 | 37 | repeatable link 38 |
39 |
40 |
41 | 42 |

Optional editor

43 |

Well, the title is self-explanatory enough, isn't it?

44 |

First, a try with a repeat 0:1.

45 | 46 | wanna use me ? 47 | 48 |
49 |

Then, a try this the attribute option="set".

50 | another opt link set 51 |
52 |

and one with option="unset".

53 | another opt link unset 54 | 55 | 56 | -------------------------------------------------------------------------------- /contribs/migration/migration_tool.css: -------------------------------------------------------------------------------- 1 | /* Common */ 2 | body { 3 | margin: 1em; 4 | } 5 | .side-button { 6 | float: right; 7 | } 8 | span.button-link { 9 | text-decoration: underline; 10 | color: blue; 11 | } 12 | body > div > h2 { 13 | font-family: arial, helvetica, sans-serif; 14 | font-size-adjust: 0.5; 15 | margin-top: 0; 16 | } 17 | .minmax { 18 | width: 30px; 19 | height: 30px; 20 | margin: 0 1em; 21 | float: right; 22 | } 23 | /* UI Slices */ 24 | div#top { 25 | position: fixed; 26 | top: 0; 27 | left: 0; 28 | right: 0; 29 | height: 130px; 30 | padding: 0 1em; 31 | border-bottom: 3px solid grey; 32 | background-color: white; 33 | z-index: 10; 34 | } 35 | 36 | #middle, #lower, #bottom { 37 | margin: 0; 38 | padding: 1em; 39 | position: relative; 40 | overflow: hidden; 41 | } 42 | #middle { 43 | margin-top: 140px; 44 | } 45 | #dataContainer { 46 | margin-left: 3em; 47 | margin-right: 3em; 48 | height: 300px; 49 | border: solid 1px gray; 50 | } 51 | 52 | .twocolcontainer { 53 | margin: 0 1em; 54 | height: 300px; 55 | width: 100% 56 | } 57 | .twocolcontainer > div { 58 | position: absolute; 59 | overflow: auto; 60 | border: solid 1px gray; 61 | width: 48%; 62 | height: 300px; 63 | } 64 | .col1 { 65 | left: 0 66 | } 67 | .col2 { 68 | right: 0; 69 | } 70 | /* Top Slice */ 71 | div#log { 72 | border: solid 1px gray; 73 | overflow: auto; 74 | height: 5em; 75 | } 76 | div#log p, p.result { 77 | padding: 0; 78 | margin: 0; 79 | } 80 | span.failed { 81 | color: red; 82 | } 83 | span.passed { 84 | color: green; 85 | } 86 | span.action { 87 | } 88 | span.file { 89 | font-family: Courier, monospace; 90 | color: brown; 91 | } 92 | /* Middle slice */ 93 | .bug { 94 | color: red; 95 | } 96 | p.status { 97 | font-style: italic; 98 | } 99 | p.file-info { 100 | margin-top: 1em; 101 | } 102 | .title { 103 | font-variant: small-caps; 104 | font-weight: bold; 105 | } 106 | div#src0 p, div#src1 p, div#dest p { 107 | margin: 0; 108 | padding: 0; 109 | } 110 | div#dest { 111 | position: absolute; 112 | top: 3em; 113 | left: 50%; 114 | right: 0; 115 | bottom: 0; 116 | overflow: auto; 117 | border: solid 1px gray; 118 | } 119 | /* Bottom slice */ 120 | span#load-template { 121 | display: none; 122 | } 123 | div#templateContainer { 124 | position: absolute; 125 | top: 3em; 126 | left: 0; 127 | bottom: 1em; 128 | right: 0; 129 | border: solid 1px gray; 130 | overflow: auto; 131 | } 132 | #resultContainer { 133 | display:none; 134 | } 135 | #dataContainer { 136 | overflow: scroll; 137 | } 138 | -------------------------------------------------------------------------------- /test/auto/assert.js: -------------------------------------------------------------------------------- 1 | // Source : http://msdn.microsoft.com/en-us/library/cc288325(VS.85).aspx 2 | function printIEMode () { 3 | var engine = null; 4 | if (window.navigator.appName == "Microsoft Internet Explorer") 5 | { 6 | // This is an IE browser. What mode is the engine in? 7 | if (document.documentMode) // IE8 8 | engine = document.documentMode; 9 | else // IE 5-7 10 | { 11 | engine = 5; // Assume quirks mode unless proven otherwise 12 | if (document.compatMode) 13 | { 14 | if (document.compatMode == "CSS1Compat") 15 | engine = 7; // standards mode 16 | } 17 | } 18 | // the engine variable now contains the document compatibility mode. 19 | 20 | // print it 21 | var n = document.getElementById('results'); 22 | var answer = document.createElement('p'); 23 | var buffer = "Internet Explorer mode = "; 24 | if (engine == 5) { 25 | buffer += 'quircks (5)'; 26 | } else if (engine == 7) { 27 | buffer += 'standards (7)'; 28 | } else { 29 | buffer += engine; 30 | } 31 | answer.innerHTML = buffer; 32 | n.appendChild(answer); 33 | } 34 | } 35 | 36 | // FIXME: LogEntry class to hold on results (diff results) 37 | 38 | function createLog () { 39 | var n = document.getElementById('results'); 40 | var entry = document.createElement('p'); 41 | entry.setAttribute('class', 'result'); 42 | n.appendChild(entry); 43 | return entry; 44 | } 45 | 46 | function logAction (node, action, file) { 47 | node.innerHTML = "" + action + " " + file.replace('&', '&', 'g') + ""; 48 | } 49 | 50 | // Adds a with status info and link to test data 51 | function logStatus (node, type, value, test) { 52 | var span = xtdom.createElement(document, 'span'); 53 | xtdom.addClassName(span, type); 54 | span.appendChild( xtdom.createTextNode(document, ' ' + value + ' ') ); 55 | node.appendChild(span); 56 | var a = xtdom.createElement(document, 'span'); 57 | a.appendChild( xtdom.createTextNode(document, '[inspect]') ); 58 | xtdom.addClassName(a, 'button-link'); 59 | node.appendChild(a); 60 | xtdom.addEventListener( a, 'click', function (ev) { test.inspect() } ) // closure 61 | } 62 | 63 | function logSuccess (message) { 64 | var n = document.getElementById('results'); 65 | var answer = document.createElement('p'); 66 | answer.setAttribute('class', 'result'); 67 | var buffer = message + "PASSED"; 68 | answer.innerHTML = buffer; 69 | n.appendChild(answer); 70 | } 71 | 72 | function logFailure (message) { 73 | var n = document.getElementById('results'); 74 | var answer = document.createElement('p'); 75 | answer.setAttribute('class', 'result'); 76 | var buffer = message + "FAILED"; 77 | answer.innerHTML = buffer; 78 | n.appendChild(answer); 79 | } 80 | -------------------------------------------------------------------------------- /src/services/boundary.js: -------------------------------------------------------------------------------- 1 | /* ***** BEGIN LICENSE BLOCK ***** 2 | * 3 | * @COPYRIGHT@ 4 | * 5 | * This file is part of the Adaptable XML Editing Library (AXEL), version @VERSION@ 6 | * 7 | * @LICENSE@ 8 | * 9 | * Web site : http://media.epfl.ch/Templates/ 10 | * 11 | * Author(s) : Stephane Sire 12 | * 13 | * ***** END LICENSE BLOCK ***** */ 14 | 15 | var _BoundaryService = (function () { 16 | 17 | var _storeKey : function(store, k1,k2,v) { 18 | if (! store[k1]) store[k1] = {}; 19 | store[k1][k2] = value; 20 | } 21 | 22 | return { 23 | 24 | /** 25 | * Remap property 26 | */ 27 | '->': {'init' : '__boundarySuperInit', 28 | 'onBroadcast': '__boundarySuperBroadcast'}, 29 | 30 | init: function (aType, aDefaultData, aKey, aParams) { 31 | this.boundarySuperInit(arguments); 32 | this._floor = {}; 33 | this._ceiling = {}; 34 | this._referent = {}; 35 | }, 36 | 37 | notifyUpdate : function (aProducer, aResourceKey, aData) { 38 | var key1, key2, condition, 39 | m = aResourceKey.match(/^([^\.]+)\.([^\(\.]*)\(floor|ceiling\)?/); 40 | // matches key1 or key1.key2 or key1(floor|ceiling) or key1.key2(floor|ceiling) 41 | if (m) { 42 | key1 = m[1]; 43 | key2 = (m[2] && (m[2].length > 0)) ? m[2] : '$'; 44 | condition = m[4]; 45 | if (! condition) { 46 | // stores reference value 47 | _storeKey(this._referent, key1, key2, aData); 48 | } else if (condition == 'floor') { 49 | // stores floor value, triggers referent update if smaller 50 | _storeKey(this._floor, key1, key2, aData); 51 | for (var k in this._floor) { 52 | 53 | } 54 | } else if (condition == 'ceiling') { 55 | _storeKey(this._ceiling, key1, key2, aData); 56 | 57 | } 58 | } 59 | 60 | 61 | 62 | if (/(floor)/.test(aResourceKey) { 63 | 64 | if (_floor after _referent) { 65 | _dispatch(_floor); 66 | if (_floor[Day]) this._broadcast ('Day', aData, this.getHandle()); 67 | if (_floor[Month]) this._broadcast ('Month', aData, this.getHandle()); 68 | if (_floor[Year]) this._broadcast ('Year', aData, this.getHandle()); 69 | } 70 | } else if (/(ceil)/.test(aResourceKey) { 71 | // store _ceil{Day/Year/Month} 72 | if (_floor before _referent) { 73 | this._broadcast ('Day', aData, this.getHandle()); 74 | this._broadcast ('Month', aData, this.getHandle()); 75 | this._broadcast ('Year', aData, this.getHandle()); 76 | } 77 | } else { 78 | // store _referent{Day/Year/Month} 79 | } 80 | } 81 | } 82 | 83 | })(); 84 | 85 | xtiger.factory('service').registerDelegate('boundary', _BoundaryService); 86 | 87 | -------------------------------------------------------------------------------- /src/filters/autocomplete.js: -------------------------------------------------------------------------------- 1 | /* ***** BEGIN LICENSE BLOCK ***** 2 | * 3 | * @COPYRIGHT@ 4 | * 5 | * This file is part of the Adaptable XML Editing Library (AXEL), version @VERSION@ 6 | * 7 | * @LICENSE@ 8 | * 9 | * Web site : http://media.epfl.ch/Templates/ 10 | * 11 | * Author(s) : Antoine Yersin, Stéphane Sire 12 | * 13 | * ***** END LICENSE BLOCK ***** */ 14 | 15 | /** 16 | * 17 | * 18 | * This static object is a shared front-end for the AutocompleteDevice. It acts as a 19 | * Filter, that is, it allows the implementation of additional behaviors for the 20 | * functions it declares. 21 | */ 22 | var _AutocompleteFilter = (function _AutocompleteFilter () { 23 | 24 | return { 25 | 26 | '->': { 27 | 'init' : '__autocompleteSuperInit', 28 | 'update': '__autocompleteSuperUpdate', 29 | 'startEditing': '__autocompleteSuperStartEditing' 30 | }, 31 | 32 | /** 33 | *

34 | * Inits as usual and gets the instance of an autocomplete device 35 | *

36 | * 37 | * @param aDefaultData 38 | * @param aParams 39 | * @param aOption 40 | * @param aUniqueKey 41 | */ 42 | init: function init (aDefaultData, aParams, aOption, aUniqueKey) { 43 | this.__autocompleteSuperInit(aDefaultData, aParams, aOption, aUniqueKey); 44 | this._autocompleteDevice = xtiger.editor.AutocompleteDevice.getInstance(this.getDocument()). 45 | validateParameters(this); 46 | }, 47 | 48 | /** 49 | * If the device is initialized with an autocomplete device, releases it 50 | * on update action 51 | * 52 | * @param {string} aData 53 | */ 54 | update : function update (aData) { 55 | this.__autocompleteSuperUpdate(aData); 56 | // Prevents the usual device to update against a completion. Otherwise it may overwrites the completion. 57 | this._device.cancelEditing(); 58 | if (this._autocompleteDevice) 59 | this._autocompleteDevice.release(); 60 | }, 61 | 62 | /** 63 | * On the start of an editing process, after grabbing the edition 64 | * device, grabs the autocomplete device. 65 | * 66 | * @param {DOMEvent} 67 | * aEvent 68 | */ 69 | startEditing: function startEditing (aEvent) { 70 | this.__autocompleteSuperStartEditing(aEvent); 71 | if (this._autocompleteDevice) 72 | this._autocompleteDevice.grab(this._device, this._device.getHandle()); 73 | }, 74 | 75 | /** 76 | *

77 | * Hook to be called as the device recieves a keyup keyboard event. 78 | *

79 | * 80 | * @see TextDevice#doKeyUp() 81 | */ 82 | onkeyup: function () { 83 | if (this._autocompleteDevice) 84 | this._autocompleteDevice.onKeyUp(); 85 | } 86 | } 87 | })(); 88 | 89 | xtiger.editor.Plugin.prototype.pluginEditors['text'].registerFilter('autocomplete', _AutocompleteFilter); 90 | -------------------------------------------------------------------------------- /data/carteResto1.xml: -------------------------------------------------------------------------------- 1 | 2 | Carte des plaisirs 3 | 4 | Pour Commencer 5 | 6 | 7 | Salade Champêtre et Vinaigrette Balsamique 8 | 8.50 9 | 10 | 11 | Gaspacho de Melon et Jambon Cru 12 | 10.50 13 | 14 | 15 | Tartare de Féra et Thon rouge à l'échalote 16 | 14.50 17 | 18 | 19 | Poisson Fumée et Petit Mélange de Salade 20 | 14.50 21 | 22 | 23 | Saladine Champêtre accompagnée de langoustine, de crevettes au tandoori et vinaigrette citron et Basilic 24 | 15.90 25 | 26 | 27 | Foie Gras de Canard à la « Petite Arvine » 28 | 17.60 29 | 30 | 31 | 32 | 33 | Pour Suivre 34 | 35 | 36 | Filets de Perche au Beurre Citronné 37 | 23.80 38 | 39 | 40 | Pavé de Thon Rouge rôti à la provençal 41 | 23.60 42 | 43 | 44 | Panaché de Poissons à la Crème de Crustacés 45 | 24.50 46 | 47 | 48 | Bar au Fenouil 49 | 24.50 50 | 51 | 52 | 53 | Selon la pêche ces poissons peuvent nous faire défaut, veuillez nous en excuser 54 | 55 | Filets de Perche du Léman Meunière 56 | 27.00 57 | 58 | 59 | Filet de Féra à la Rhubarbe 60 | 21.50 61 | 62 | 63 | 64 | 65 | Entrecôte de Charolais Beurre Maître d’Hôtel 66 | 22.80 67 | 68 | 69 | Suprême de Pintade à la Lullin 70 | 23.80 71 | 72 | 73 | Carré d’Agneau aux à la Sarriette et Romarin 74 | 24.00 75 | 76 | 77 | Côte de Bœuf Simmental Marinée aux Epices 78 | 27 79 | pour 2 personnes, 30 min, Pris/ pers 80 | 81 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /contribs/cvmachine/readme.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | AXEL CV Machine Readme 6 | 21 | 22 | 23 | 24 |

AXEL CV Machine is a simple CV editor built with the AXEL library.

25 | 26 |

Tu run the CV Machine open CV Machine in you browser. You can then edit your CV, click on a field to edit it. The Profile and Company fields are special fields that accept an input such as http://www.some.url[anchor] to enter a link. You can enlarge your browser window to get the top right menu on the side of your CV.

27 | 28 |

Tu save your CV, click on the Save button. You should see the source code of your CV in a plain window, copy and paste your CV in any text editor, then save it with an XHTML extension.

29 | 30 |

Tu load your CV (previously created with the CV Machine), click on the Load button. You should see a blank window with an empty text area in the center. Paste the source code of your CV in that window, then click on Load.

31 | 32 |

You can print your CV or save it as a PDF file directly from the CV Machine, use the printing functionality of your browser. Use the Preview button first to hide all the controls.

33 | 34 |

You can share your CV by saving it as an XHTML file and then generate a PDF file from a browser, or directly send it by email. The XHTML file should be viewable in any modern browser with support for HTML 5 (because they currently allow to define and style semantic XML elements, I do not know if this will last), however that option is much more risky. An alternative is to convert you CV (which contains plain semantic XML wrapped inside an XHTML envelope) to any format using an XSLT transformation.

35 | 36 |

Reload the CV Machine page each time you want to start with a new CV. It is also advised to reload the page before you use the Load button.

37 | 38 |

AXEL CV Machine is still under development. It has been tested with Firefox (> 3.5.7), Safari (> 4) and Opera (> 10.10).

39 | 40 |

AXEL CV Machine doesn't work yet with Internet Explorer, there is also an issue with Chromium (> 5.0) that prevents using the Load / Save dialogs (calling Javascript method in parent window from window.opener doesn't work).

41 | 42 | 43 | -------------------------------------------------------------------------------- /demos/launch.js: -------------------------------------------------------------------------------- 1 | // Pre-conditions: iframe with id #container and some element with id #feedback 2 | function Editor (base) { 3 | var _this = this; 4 | this.callback = function () { _this.frameLoaded() }; 5 | this.libPath = base; 6 | this.initialize (); 7 | } 8 | 9 | Editor.prototype = { 10 | 11 | initialize : function () { 12 | // Extracts mandatory template name and optional XML data file name from URL 13 | var m = document.location.href.match(/t=(.*?\.(xtd|xhtml|html))([&\+]d=(.*?\.(xml|xhtml)))?([&\+]p=(.*?))?$/); 14 | if (m) { 15 | this.template = m[1]; // template file name 16 | this.dataUrl = m[4]; // optional data file name 17 | if (m[7]) { 18 | this.libPath = m[7]; 19 | } 20 | } 21 | if (this.template) { 22 | this.submitPage(); 23 | } 24 | }, 25 | 26 | submitPage : function () { 27 | this.log('Loading document template "' + this.template + '"'); 28 | var iframe = document.getElementById('container'); 29 | if (iframe) { 30 | xtdom.addEventListener(iframe, 'load', this.callback , false); 31 | iframe.setAttribute('src', this.template); 32 | } else { 33 | this.log('Missing iframe !'); 34 | } 35 | }, 36 | 37 | // Creates the XTiger form UI on top of the document just loaded into the frame 38 | frameLoaded : function () { 39 | var iframeDoc; 40 | var result = new xtiger.util.Logger(); 41 | var iframe = document.getElementById('container'); 42 | xtdom.removeEventListener(iframe, 'load', this.callback, false); 43 | if (iframe.contentDocument) { 44 | iframeDoc = iframe.contentDocument; 45 | } else if (iframe.contentWindow) { 46 | iframeDoc = iframe.contentWindow.document; 47 | } 48 | this.form = new xtiger.util.Form(this.libPath + '/bundles'); 49 | this.form.setTemplateSource(iframeDoc); 50 | this.form.enableTabGroupNavigation(); 51 | if (this.form.transform(result)) { 52 | this.form.injectStyleSheet(this.libPath + '/axel.css', result); 53 | if (this.dataUrl) { 54 | this.log('Loading data "' + this.dataUrl + '"'); 55 | xmlDoc = xtiger.debug.loadDocument(this.dataUrl); 56 | if (xmlDoc) { 57 | var source = new xtiger.util.DOMDataSource(xmlDoc); 58 | if (! this.form.loadData(source)) { 59 | this.log('Error loading "' + this.dataUrl + '" : ' + this.form.msg); 60 | } 61 | } 62 | } 63 | } 64 | if (result.inError()) { // Optional feedback about errors 65 | this.log(result.printErrors()); 66 | } else { // hides log area 67 | var n = document.getElementById('feedback'); 68 | n.style.display = 'none'; 69 | } 70 | if (xtiger.util.MenuBar) { // Displays the menu bar 71 | var body = iframeDoc.getElementsByTagName('body')[0]; 72 | this.menubar = new xtiger.util.MenuBar(this.form); 73 | this.menubar.display(document.getElementById('menu'), body); 74 | xtiger.session(document).save('menubar', this.menubar); 75 | } else { 76 | alert('WebDAV menu bar component missing !') 77 | } 78 | }, 79 | 80 | log : function (msg) { 81 | var n = document.getElementById('feedback'); 82 | if (n) { 83 | n.firstChild.data = msg; 84 | } 85 | } 86 | 87 | } 88 | -------------------------------------------------------------------------------- /test/misc/document.xhtml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | AXEL API test : xtiger.util.Document 13 | 14 | 15 | 16 | 17 |

A component

18 |
19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 59 | 60 | 61 | 62 | 63 | SAVE (view) 64 |
65 |

AXEL API test : xtiger.util.Document

66 | 67 | 68 | 69 | 70 | 71 |
72 | 74 |
75 |
76 | 77 | -------------------------------------------------------------------------------- /test/templates/Wiki.xhtml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Your title here 13 | 14 | 15 | 16 | 17 |

click to edit item textual content

18 | 19 |
20 | 21 | 22 | 23 | 24 |
25 | 26 |
27 |
28 |
29 | 30 | 31 |

click to edit paragraph

32 |
33 | 34 |
35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 |

Wiki Test File

44 | 45 |

wiki_lang='html'

46 | 47 |

http://www.enotes.com/shakespeare-quotes/all-world-s-stage[All the world's] a **stage**, And all the ''men'' and ''women'' merely __players__;

48 | 49 |

wiki_lang='span'

50 | 51 |

http://www.enotes.com/shakespeare-quotes/all-world-s-stage[All the world's] a **stage**, And all the ''men'' and ''women'' merely __players__;

52 | 53 |

wiki_lang='default'

54 | 55 |

http://www.enotes.com/shakespeare-quotes/all-world-s-stage[All the world's] a **stage**, And all the ''men'' and ''women'' merely __players__;

56 | 57 |

Repetition

58 | 59 |
    60 | 61 |
  • 62 | 63 |
  • 64 |
    65 |
66 | 67 | 68 | -------------------------------------------------------------------------------- /design/photo/preview.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | Photo Lens Designer 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 41 | 42 | 43 |

This file is a test for the photo uploader device. It allows to test the lens wrapper design which is stored in the bundles/photo folder. Please note that as it uses an Ajax request to get the photo lens dialog box, this may be consider as a security violation error in some browsers unless you open it from behind a Web server.

44 |
45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 |
57 |
58 |
59 | 60 | 61 | -------------------------------------------------------------------------------- /templates/YouTube.xhtml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Sample template with YouTube videos 13 | 14 | 15 | 16 | 17 | 32 | 33 | 34 | 35 | 36 |

Sample template with YouTube videos

37 | 38 |

You need the video.js and videofilter.js files to execute this template. You also must have an operational Internet connection to actually see the videos from YouTube.

39 | 40 |

Optional video

41 | 42 |

Using the video lens plugin editor...

43 | 44 |

Please select a video : 45 | URL from YouTube 46 |

47 | 48 |

Using the video filter on the text plugin editor...

49 | 50 |

Please select a video : URL from YouTube

51 | 52 |

Repeated video

53 | 54 |

Using the video lens plugin editor...

55 | 56 |

Please select a video : 57 | URL from YouTube 58 |

59 | 60 |

Using the video filter on the text plugin editor...

61 | 62 |

Please select a video : 63 | URL from YouTube 64 |

65 | 66 |
67 | 68 |

That template also uses the inline-block CSS style property which has been reported not working on Internet Explorer. In that case you should prefer float layout.

69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /test/templates/Choice.xhtml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | XTiger XML and AXEL test case : Choice features 13 | 14 | 15 | 16 | I like apples 17 | 18 | I prefer bananas 19 | 20 | I like oranges 21 | 22 | I prefer strawberries 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 55 | 56 | 57 | 58 | 59 | 60 |

This template contains XTiger XML declarations that stress the choice editor of the AXEL library

61 | 62 |

Basic choice :

63 | 64 |

Choice with outer label :

65 | 66 |

Choice with inner labels :

67 | 68 |

Choice with inner labels and outer label :

69 | 70 |

Choice with outer renamed labels with or without inner labels :

71 | 72 |

Choice with outer label and renamed labels with or without inner labels :

73 | 74 | 75 | -------------------------------------------------------------------------------- /contribs/cvmachine/nofileapi.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | AXEL alternative file input / output 6 | 36 | 37 | 84 | 85 | 86 | 87 |
88 |

89 | Copy & Paste you CV file in the area below and click the load button
90 | (Your file must have been created with the CV machine to be compatible) 91 |

92 |

93 | 94 |

95 |
96 |

97 | Copy your CV source code from the area below and paste it into a text editor, 98 | then save it in an XHTML file that you can share with others 99 |

100 |
101 | 102 |
103 | 104 | 105 | -------------------------------------------------------------------------------- /test/misc/fontStyle.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | AXEL Test for computing text metrics 9 | 20 | 21 | 22 | 24 | 25 | 75 | 76 | 77 | 78 | 79 | 80 |

Sample text (h1)

81 |

82 |

83 |

84 |

85 |

86 |

87 | 88 | 89 | -------------------------------------------------------------------------------- /config/templates.distrib.js: -------------------------------------------------------------------------------- 1 | /** 2 | * AXEL configuration file for selecting which templates to use in the demos 3 | * and to insert by default in the editor application if it cannot list 4 | * the content of the templates folder upon load 5 | */ 6 | 7 | /** Returns the list of templates and data file to show in demos/index.html 8 | * 9 | */ 10 | function getDefaultTemplates () { 11 | var res = [ 12 | "Article.xhtml", 13 | "Carte-Resto.xhtml", 14 | "Curriculum.xhtml", 15 | "Editors.xhtml", 16 | "Fiche-Projet.xhtml", 17 | "Hello-world.xhtml", 18 | "Meeting-Report.xhtml", 19 | "PageWeb.xhtml", 20 | "Photos.xhtml", 21 | "Plugins.xhtml", 22 | "Publications.xhtml", 23 | "Requirements.xhtml", 24 | "Services.xhtml", 25 | "Story.xhtml", 26 | "Suivi.xhtml", 27 | "Taches.xhtml", 28 | "Tickets.xhtml", 29 | "Workpackage.xhtml", 30 | "YouTube.xhtml" 31 | ] 32 | return res; 33 | } 34 | 35 | /** Returns the list of templates and data file to show in demos/index.html 36 | * 37 | */ 38 | function getDemoTemplates () { 39 | var res = { 40 | 'Curriculum.xhtml' : { 41 | data: 'cvHaddock.xml', 42 | description : 'shows a curriculum vitae' 43 | }, 44 | 'Carte-Resto.xhtml' : { 45 | data: 'carteResto2.xml', 46 | description: 'shows a restaurant menu card (photo upload not functional in this demo)' 47 | }, 48 | 'Article.xhtml' : { 49 | data: 'article/final.xml', 50 | description: 'is the template used to write XML Prague 2010 article on AXEL and XTiger XML. It works with an image filter which must be packaged inside the library. It also works with a wiki filter to allow simple formating in paragraphs and to enter hypertext links' 51 | }, 52 | 'Fiche-Projet.xhtml' : { 53 | data: 'ficheProjetW.xml', 54 | description: 'shows a student project description such as the one displayed at MEDIA student projects' 55 | }, 56 | 'Publications.xhtml' : { 57 | data: 'publications.xml', 58 | description: 'shows a bibliography' 59 | }, 60 | 'Taches.xhtml' : { 61 | compatibility: 'not-on-ie', 62 | description: 'shows a basic project task management record; in French' 63 | }, 64 | 'Tickets.xhtml' : { 65 | compatibility: 'not-on-ie', 66 | description: 'shows a basic ticket for a bug or feature tracking system' 67 | }, 68 | 'Story.xhtml' : { 69 | compatibility: 'not-on-ie', 70 | data: 'thailand.xml', 71 | description: 'shows an experimental template with an input filter that allows user\'s input to change the style of the document. It also uses the image filter that supports DnD on Firefox (3.6). Such template could be used to create pages in a Wiki for instance. It opens with a document that includes images on the Web, so you must have your Internet connection turned on' 72 | }, 73 | 'Editors.xhtml' : { 74 | compatibility: 'not-on-ie', 75 | description: 'shows a tutorial with all the different kind of editors supported with the core library' 76 | }, 77 | 'PageWeb.xhtml' : { 78 | compatibility: 'not-on-ie', 79 | data: 'pageWeb.xhtml', 80 | description: 'shows a generic Web page template with an XHTML subset target content model' 81 | } 82 | } 83 | return res; 84 | } 85 | 86 | 87 | 88 | 89 | 90 | -------------------------------------------------------------------------------- /test/migration/Case-b-1.xhtml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | Migration test case 14 | 15 | 16 | 17 | 18 |

Element A1 : "a1"

19 |

Element A2 : "a2"

20 |
21 | 22 | 23 |

Element B1 : "b1"

24 |

Element B2 : "b2"

25 |
26 | 27 | 28 |

Element C1 : "c1"

29 |

Element C2 : "c2"

30 |
31 | 32 | 33 |

Element D1 : "d1"

34 |

Element D2 : "d2"

35 |
36 | 37 |
38 | 39 | 40 | 41 | 42 | 43 |

Choice insertion / deletion series

44 | 45 |

Migration test : Case-b-1

46 | 47 |

Choice addition

48 | 49 |

This part will test choice addition, that is, adding a possible choice in an existing one.

50 | 51 |

Labelled choice

52 | 53 | 54 | 55 |

Anonymous choice

56 | 57 | 58 | 59 |

Anonymous choices in a repeat (labelled)

60 | 61 | 62 |
63 | 64 |
65 |
66 | 67 |

Choice deletion

68 | 69 |

Labelled choice

70 | 71 | 72 | 73 |

Anonymous choice

74 | 75 | 76 | 77 |

Anonymous choices in a repeat (labelled)

78 | 79 | 80 |
81 | 82 |
83 |
84 | 85 | 86 | -------------------------------------------------------------------------------- /editor/extras/intro.xhtml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | XTiger XML Demo Editor explanation file 8 | 25 | 26 | 27 | 28 |

XTiger XML Demo Editor

29 |

This is an application that can be run directly from your local file system (URL starting with file:///) with Firefox. 30 | For Firefox >= 3 you need to authorize access to local URL from the XMLHTTPRequest object. To do this type 31 | about:config in the URL bar then click on security.fileuri.strict_origin_policy to set it to false 32 | (source: mozillazine.org). You most probably will 33 | not be able to use it from the local file system on the other browsers (such as Safari or Internet Explorer) 34 | as they will not allow the application to access local files. For instance Safari will just show them in the finder.

35 |

On the contrary if you start the application from a Web server (URL starting with http://), 36 | including a WebDav server, it should work on most of the browsers. For instance it works for Internet Explorer, but only 37 | if you use the version of the application that uses no iframe (see the window title bar).

38 |
    39 |
  • Page : enter a file URL to open a template file as a document to edit (or use Page shortcut)
  • 40 |
  • Page shortcut : select directly a predefined template file
  • 41 |
  • [Visualize] : open the selected template file
  • 42 |
  • [Dump] : dump the XML content of the current document inside a popup window.
  • 43 |
  • [Input] : enter XML data from a popup window to the current document
  • 44 |
  • [Save] : prompts a dialog to select a local XML file name and saves the XML content to it (Firefox only)
  • 45 |
  • [Load] : prompts a dialog to select a local XML file name and loads XML data from it (Firefox only)
  • 46 |
47 |

The [Preferences] button opens a pannel with several actions

48 |
    49 |
  • Template repository [Ok] : enter the path for the default XTiger XML template folder (displayed in Page shortcut)
  • 50 |
  • File name [save] [load] [post]: save/load XML content in the current document, depending on the browser, [save] and [load] may work only if you have opened the application from a local server such as the one proposed in scripts/server. 51 | [post] asks the server to only dump the data without saving it.
  • 52 |
53 |

NOTE: you can use the application directly from a local volume (document URL starting 54 | with file://), or you can copy it and launch it from a Web server such as the one in scripts/server.

55 | 56 |

By default template files listed in the "Page shortcut" popup menu are stored in the "templates" folder.

57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /templates/Story.xhtml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Telling a Story with Images 13 | 14 | 15 | 16 | 17 |

Header

18 |
19 | 20 | 21 |

Text

22 |
23 | 24 | 25 |
26 | file name 27 |

Caption

28 |
29 |
30 | 31 |
32 | 33 | 34 | 35 | 81 | 82 | 83 | 84 | 85 | 86 |

Title

87 | 88 | 89 |
90 | 91 |
92 |
93 | 94 | 95 | -------------------------------------------------------------------------------- /test/gui/Link.xhtml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | XTiger XML and AXEL Interactive (GUI) test case : 'link' primitive editor plugin 13 | 14 | 15 | 16 | 17 | 26 | 27 | 28 | 29 | 30 | 44 | 45 | 46 |

Interactive (GUI) test case for 'link' editor

47 | 48 |

There are tested various situation involving the link editor, that is (at the moment), the 3-tuple composed with the link model, the lens device and the link lens content.

49 | 50 |

Simple editor

51 |

This is a link 1. Try to edit it.

52 | 53 |

Consecutive editors

54 |

Now test the succession of editors and the tab management. Here's a text editor, followed by a link 2 one. Isn't tabbing fun ? no. 55 |

56 | 57 |

Repeatable editors

58 |

Let's add more links

59 |
60 | 61 | repeatable link
62 |
63 |
64 | 65 |

Optional editor

66 |

Well, the title is self-explanatory enough, isn't it?

67 |

First, a try with a repeat 0:1.

68 | 69 | wanna use me ? 70 | 71 |
72 |

Then, a try this the attribute option="set".

73 | another opt link set 74 |
75 |

and one with option="unset".

76 | another opt link unset 77 | 78 | 79 | -------------------------------------------------------------------------------- /test/templates/Empty.xhtml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Your title here 13 | 14 | 15 | 16 | 17 | enter your text and enter your text 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 |

This template contains XTiger XML declarations to stress serialization of unselected nodes using the AXEL library

30 | 31 |

xt:use of 'string' primitive editor with option='set' and no default content :

32 | 33 |

xt:use of 'string' primitive editor with option='set' and default content of 'enter your text' : enter your text

34 | 35 |

xt:use of 'text' primitive editor with option='set' and no default content :

36 | 37 |

xt:use of 'text' primitive editor with option='set' and default content of 'enter your text' : enter your text

38 | 39 |

Repetition from 0 to '*' of 'text' primitive editor :

40 | 41 |
    42 | 43 |
  • enter your text
  • 44 |
    45 |
46 | 47 |

Repetition from 0 to '*' of one optional 'text' primitive editor :

48 | 49 |
    50 | 51 |
  • enter your text
  • 52 |
    53 |
54 | 55 |

Repetition from 0 to '*' of two optional 'text' primitive editors :

56 | 57 |
    58 | 59 |
  • enter your text and enter your text
  • 60 |
    61 |
62 | 63 |

Repetition from 0 to '*' of labelled two optional 'text' primitive editors :

64 | 65 |
    66 | 67 |
  • 68 |
    69 |
70 | 71 | -------------------------------------------------------------------------------- /src/editor/classical/tabgroupmgr.js: -------------------------------------------------------------------------------- 1 | /* ***** BEGIN LICENSE BLOCK ***** 2 | * 3 | * @COPYRIGHT@ 4 | * 5 | * This file is part of the Adaptable XML Editing Library (AXEL), version @VERSION@ 6 | * 7 | * @LICENSE@ 8 | * 9 | * Web site : http://media.epfl.ch/Templates/ 10 | * 11 | * Author(s) : Stephane Sire 12 | * 13 | * ***** END LICENSE BLOCK ***** */ 14 | 15 | /* 16 | * Manages tab navigation between basic string editors. 17 | */ 18 | xtiger.editor.TabGroupManager = function (rootNode) { 19 | this.root = rootNode; 20 | this.isChangingFocus = false; 21 | this.direction = 0; 22 | } 23 | 24 | xtiger.editor.TabGroupManager.prototype = { 25 | 26 | startEditingSession : function (editor) { 27 | if (this.isChangingFocus) return; // guard 28 | this.tabs = []; 29 | var treeWalker = xtiger.cross.makeTreeWalker (this.root, xtdom.NodeFilter.SHOW_ELEMENT, 30 | function (node) { 31 | if (node.xttPrimitiveEditor && node.xttPrimitiveEditor.isFocusable()) { 32 | return xtdom.NodeFilter.FILTER_ACCEPT 33 | } else { 34 | return xtdom.NodeFilter.FILTER_SKIP; 35 | } 36 | } ); 37 | while(treeWalker.nextNode()) { 38 | // FIXME: how to avoid input nodes within unselected XttChoiceEditor control ? 39 | this.tabs.push(treeWalker.currentNode.xttPrimitiveEditor); 40 | } 41 | this.curEditor = editor; 42 | }, 43 | 44 | stopEditingSession : function () { 45 | if (this.isChangingFocus) return; // guard 46 | this.tabs = undefined; 47 | this.curEditor = undefined; 48 | }, 49 | 50 | // Intercepts Tab KeyDown events 51 | // Returns true if it has intercepted it 52 | filterKeyDown : function (ev) { 53 | this.direction = 0; // For firefox 54 | if (ev.keyCode == 9) { // it's a Tab 55 | if (xtiger.cross.UA.gecko) { // we must wait for KeyPress event because canceling will not work 56 | this.direction = ev.shiftKey ? -1 : 1; 57 | } else { // we can act immediatly 58 | this._focusNextInput(ev.shiftKey ? -1 : 1); 59 | } 60 | try { 61 | xtdom.preventDefault(ev); 62 | xtdom.stopPropagation(ev); 63 | } catch (e) { 64 | // on IE ! 65 | } 66 | return true 67 | } else { 68 | return false; 69 | } 70 | }, 71 | 72 | // For some certain kinds of browsers filterKeyDown does not cancel the Tab event 73 | // in that case we get a chance to modify its effect in KeyPress event handling 74 | // This is the case with Firefox (v2 on OS X at least) 75 | filterKeyPress : function (ev) { 76 | if (xtiger.cross.UA.gecko && (this.direction != 0)) { 77 | // window.console.log('Focused next input'); 78 | return (this._focusNextInput(this.direction)); 79 | } 80 | return false; 81 | }, 82 | 83 | _focusNextInput : function (direction) { 84 | var res = false; 85 | if (!this.tabs) 86 | return; // safety guard 87 | for (var i = 0; i < this.tabs.length; i++) { 88 | if (this.tabs[i] == this.curEditor) { 89 | break; 90 | } 91 | } 92 | if (i < this.tabs.length) { 93 | var next; 94 | if ((i + direction) < 0) { 95 | next = this.tabs.length - 1; 96 | } else { 97 | next = (i + direction) % this.tabs.length; 98 | } 99 | this.isChangingFocus = true; 100 | this.tabs[i].unfocus(); 101 | this.tabs[next].focus (); 102 | this.isChangingFocus = false; 103 | this.curEditor = this.tabs[next]; 104 | res = true; 105 | } 106 | this.direction = 0; 107 | return res; 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /docs/toc.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | AXEL / XTiger XML documentation table of content 12 | 38 | 39 | 40 |

AXEL / XTiger XML documentation

41 | 42 |
43 | 44 |
XTiger XML language specification
45 |
This is the XTiger XML language specification.
46 | 47 |
Integrator's guide
48 |
A FAQ document targeting at developers that want to use AXEL in their Web application.
49 | 50 |
User's manuel
51 |
A very incomplete user's manual, however it can be quickly read as a follow up to the previous FAQ .
52 | 53 |
Howto plugins
54 |
This document describes the plugin API. Plugins are modules made of a registered factory object that can instantiate model objects that implement a primitive editor.
55 | 56 |
Howto filters
57 |
This document describes the filter architecture. Filters are easy to write object classes that extend AXEL primitive editor plugins.
58 | 59 |
Howto services
60 |
This document describes the service architecture. Services are modules that can be instantiated inside a template to add functionalities beyond editing that can react to editing events.
61 | 62 |
Howto photo plugin
63 |
This document describes the 'photo' primitive editor plugin. This editor can be used to upload photos inside a template. It requires a server-side counterpart to manage received photo files.
64 | 65 |
Howto link plugin
66 |
This document describes the 'link' primitive editor plugin. This editor can be used to edit link text and address. The handle only shows the link text, it triggers a lens showing the text and the address when selected.
67 | 68 |
Howto video plugin
69 |
This document describes the 'video' primitive editor plugin. This editor can be used to edit YouTube URLs. The handle shows a YouTube video player, it triggers a lens showing the video URL when selected.
70 | 71 |
Howto richtext plugin
72 |
This document describes the 'richtext' primitive editor plugin. This editor can be used to edit paragraphs with Italic, Bold and Underline formating. It's content model is saved as standard HTML code with CSS styling attributes. The handle shows the styled text, it triggers a lens with the Italic, Bold and Underline command buttons when selected.
73 | 74 |
75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /config/templates.js: -------------------------------------------------------------------------------- 1 | /** 2 | * AXEL configuration file for selecting which templates to use in the demos 3 | * and to insert by default in the editor application if it cannot list 4 | * the content of the templates folder upon load 5 | */ 6 | 7 | /** Returns the list of templates and data file to show in demos/index.html 8 | * 9 | */ 10 | function getDefaultTemplates () { 11 | var res = [ 12 | "Article.xhtml", 13 | "Carte-Resto.xhtml", 14 | "Curriculum.xhtml", 15 | "Editors.xhtml", 16 | "Fiche-Cafe++.xhtml", 17 | "Fiche-Cafe-Flow.xhtml", 18 | "Fiche-Cafe.xhtml", 19 | "Fiche-Projet.xhtml", 20 | "Hello-world.xhtml", 21 | "Meeting-Report.xhtml", 22 | "PageWeb.xhtml", 23 | "Photos.xhtml", 24 | "Plugins.xhtml", 25 | "Publications.xhtml", 26 | "Requirements.xhtml", 27 | "Services.xhtml", 28 | "Story.xhtml", 29 | "Suivi.xhtml", 30 | "Taches.xhtml", 31 | "Tickets.xhtml", 32 | "Workpackage.xhtml", 33 | "YouTube.xhtml" 34 | ] 35 | return res; 36 | } 37 | 38 | /** Returns the list of templates and data file to show in demos/index.html 39 | * 40 | */ 41 | function getDemoTemplates () { 42 | var res = { 43 | 'Curriculum.xhtml' : { 44 | data: 'cvHaddock.xml', 45 | description : 'shows a curriculum vitae' 46 | }, 47 | 'Carte-Resto.xhtml' : { 48 | data: 'carteResto2.xml', 49 | description: 'shows a restaurant menu card (photo upload not functional in this demo)' 50 | }, 51 | 'Fiche-Cafe++.xhtml' : { 52 | description: 'shows a page that describes a bar or a restaurant' 53 | }, 54 | 'Article.xhtml' : { 55 | data: 'article/final.xml', 56 | description: 'is the template used to write XML Prague 2010 article on AXEL and XTiger XML. It works with an image filter which must be packaged inside the library. It also works with a wiki filter to allow simple formating in paragraphs and to enter hypertext links' 57 | }, 58 | 'Fiche-Projet.xhtml' : { 59 | data: 'ficheProjetW.xml', 60 | description: 'shows a student project description such as the one displayed at MEDIA student projects' 61 | }, 62 | 'Publications.xhtml' : { 63 | data: 'publications.xml', 64 | description: 'shows a bibliography' 65 | }, 66 | 'Taches.xhtml' : { 67 | compatibility: 'not-on-ie', 68 | description: 'shows a basic project task management record; in French' 69 | }, 70 | 'Tickets.xhtml' : { 71 | compatibility: 'not-on-ie', 72 | description: 'shows a basic ticket for a bug or feature tracking system' 73 | }, 74 | 'Story.xhtml' : { 75 | compatibility: 'not-on-ie', 76 | data: 'thailand.xml', 77 | description: 'shows an experimental template with an input filter that allows user\'s input to change the style of the document. It also uses the image filter that supports DnD on Firefox (3.6). Such template could be used to create pages in a Wiki for instance. It opens with a document that includes images on the Web, so you must have your Internet connection turned on' 78 | }, 79 | 'Editors.xhtml' : { 80 | compatibility: 'not-on-ie', 81 | description: 'shows a tutorial with all the different kind of editors supported with the core library' 82 | }, 83 | 'Workpackage.xhtml' : { 84 | data: 'wp1.xml', 85 | description: 'shows a European Project Workpackage description template, currently the default wp1.xml shows an XSLT generated view of a document created with this template, ready to be included in a project proposal' 86 | }, 87 | 'PageWeb.xhtml' : { 88 | compatibility: 'not-on-ie', 89 | data: 'pageWeb.xhtml', 90 | description: 'shows a generic Web page template with an XHTML subset target content model' 91 | } 92 | } 93 | return res; 94 | } 95 | 96 | 97 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /templates/Requirements.xhtml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Requirements 13 | 14 | 15 | 16 | 17 |

Last edited by name on date

18 |
19 | 20 | 21 |
22 |

23 | Description. 24 |

25 | 26 |
27 |

e.g.:

28 | 29 | 30 |
code
31 |
32 |
33 |
34 |
35 | 36 |
37 | 38 | 39 | 40 | 41 | 42 | 43 | 99 | 100 | 101 | 102 | 103 | 104 |

Requirements

105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /templates/Article.css: -------------------------------------------------------------------------------- 1 | /* Main document */ 2 | body { 3 | counter-reset: sect1 sect2 sect3 figure code; 4 | margin: 20px 25px; 5 | } 6 | h1 { 7 | text-align: center; 8 | font-family: sans-serif; 9 | } 10 | h2 { 11 | counter-reset: sect2 sect3; 12 | } 13 | h2:before { 14 | content: counter(sect1) ". "; 15 | counter-increment: sect1; 16 | } 17 | h3 { 18 | counter-reset: sect3; 19 | } 20 | h3:before { 21 | content: counter(sect1) ". " counter(sect2) ". "; 22 | counter-increment: sect2; 23 | } 24 | h4 { 25 | } 26 | h4:before { 27 | content: counter(sect1) ". " counter(sect2) ". " counter(sect3) ". "; 28 | counter-increment: sect3; 29 | } 30 | p.parag { 31 | margin-bottom: .5em; 32 | margin-top: .5em; 33 | } 34 | p.parag, li, div.authors { 35 | /* line-height: 1.5; */ 36 | } 37 | span.verbatim { 38 | font-size: 75%; 39 | font-family: "Bitstream Vera Sans Mono", "Lucida Console", monospace 40 | } 41 | span.important { 42 | font-style: italic; 43 | } 44 | pre { 45 | margin: 0; 46 | } 47 | p.heading { 48 | font-size: 110%; 49 | font-weight: bold; 50 | clear: both; 51 | } 52 | 53 | /* Authors */ 54 | div.authors { 55 | margin-left: 10%; 56 | margin-right: 10%; 57 | font-family: sans-serif; 58 | text-align: center; 59 | } 60 | p.vcard { 61 | float: left; 62 | margin-left: 10%; 63 | } 64 | span.fn { 65 | font-size: 110%; 66 | } 67 | span.addr { 68 | } 69 | span.email { 70 | font-size: 90%; 71 | } 72 | 73 | /* Figures and Code Example */ 74 | p.figure-caption { 75 | margin-left: 10%; 76 | margin-right: 10%; 77 | } 78 | p.figure-caption, p.code-caption { 79 | font-style: italic; 80 | margin-top: 0.4em; 81 | padding-top: 0; 82 | } 83 | p.code-caption { 84 | text-align: left; 85 | } 86 | p.figure-caption:before { 87 | content: "Figure " counter(figure) ". "; 88 | counter-increment: figure; 89 | font-style: normal; 90 | } 91 | p.code-caption:before { 92 | content: "Example " counter(code) ". "; 93 | counter-increment: code; 94 | font-style: normal; 95 | } 96 | div.figure img { 97 | border: 1px solid gray; 98 | } 99 | div.code, div.figure { 100 | padding: 0; 101 | margin-top: 1em; 102 | margin-bottom: 1em; 103 | } 104 | div.figure { 105 | text-align: center; 106 | } 107 | div.figure img { 108 | max-width: 16cm; 109 | max-height: 12cm; 110 | } 111 | 112 | /* Bibliography */ 113 | div.biblio-entry, p.biblio-entry { 114 | margin-bottom: 1.6em; 115 | } 116 | p.biblio-entry > span.title { 117 | font-style: italic; 118 | } 119 | 120 | /* Printing Adjustments */ 121 | @media print { 122 | 123 | .noprint, #davmenubar, #preview { 124 | display: none 125 | } 126 | html { 127 | /* This sets the margins on each page at least on Opera and Firefox, but not Safari */ 128 | margin-left: 1cm; 129 | margin-right: 0.5cm; 130 | margin-top: 1cm; 131 | padding: 0; 132 | } 133 | body { 134 | font: 11pt geargia, serif; 135 | } 136 | p.parag { 137 | orphans: 2; 138 | } 139 | p.parag, li, dd { 140 | text-align: justify; 141 | } 142 | pre { 143 | font-size: 70%; 144 | } 145 | h1 { 146 | font-size: 150%; 147 | page-break-after: avoid; 148 | } 149 | h2 { 150 | font-size: 130%; margin-bottom: .2em; margin-top: .6em; 151 | page-break-after: avoid; 152 | } 153 | h3 { 154 | font-size: 120%; margin-bottom: .2em; margin-top: .6em; 155 | page-break-after: avoid; 156 | } 157 | div.figure p, div.code p { 158 | page-break-before: avoid; 159 | } 160 | } -------------------------------------------------------------------------------- /test/migration/Case-b-2.xhtml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Migration test case 13 | 14 | 15 | 16 | 17 |

Element A1 : "a1"

18 |

Element A2 : "a2"

19 |
20 | 21 | 22 |

Element B1 : "b1"

23 |

Element B2 : "b2"

24 |
25 | 26 | 27 |

Element C1 : "c1"

28 |

Element C2 : "c2"

29 |
30 | 31 | 32 |

Element D1 : "d1"

33 |

Element D2 : "d2"

34 |
35 | 36 |
37 | 38 | 39 | 40 | 41 | 42 |

Choice insertion / deletion series

43 | 44 |

Migration test : case-b-2

45 | 46 |

Choice addition

47 | 48 |

49 | This part will test choice addition, that is, adding a possible choice in an existing one. 50 |

51 | 52 |

Labelled choice

53 | 54 | type_d addition (start) 55 | 56 | 57 |

Anonymous choice

58 | 59 | type_d addition (middle) 60 | 61 | 62 |

Anonymous choices in a repeat (labelled)

63 | 64 | 65 |
66 | type_d addition (end) 67 | 68 |
69 |
70 | 71 |

Choice deletion

72 | 73 |

Labelled choice

74 | 75 | type_c deletion (end) 76 | 77 | 78 |

Anonymous choice

79 | 80 | type_c deletion (end) 81 | 82 | 83 |

Anonymous choices in a repeat (labelled)

84 | 85 | 86 |
87 | type_c deletion (end) 88 | 89 |
90 |
91 | 92 | 93 | -------------------------------------------------------------------------------- /test/misc/textMetrics.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | AXEL Test for computing text metrics 9 | 47 | 48 | 49 | 50 | 51 | 52 | 93 | 94 | 95 | 96 | 97 | 98 |

This test for investigating how to adjust the TextMetrics object in textdevice.js

99 |

First, here is a textarea where you can enter text

100 |

101 | 102 |

103 |

The text is replicated in the div below to study how it grows

104 |

Width : ? / Height : ?

105 |
empty
106 |

107 |

108 | 109 | 110 | -------------------------------------------------------------------------------- /docs/Spec.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding: 2em; 3 | margin: 0; 4 | color: black; 5 | background: white; 6 | font-family: sans-serif; 7 | } 8 | h1, h2, h3 { 9 | font-weight: normal; 10 | color: rgb(0, 90, 156); 11 | 12 | } 13 | h2:before { 14 | content: counter(chapter) ". "; 15 | } 16 | h2 { 17 | counter-increment: chapter; 18 | } 19 | h1 tt, h2 tt { 20 | font-family: courier, monospace; 21 | color: rgb(0, 90, 156); 22 | font-weight: 500; 23 | font-size: 110%; 24 | } 25 | tt { 26 | font-weight: bold; 27 | font-family: "Times New Roman",Times,serif; 28 | color: purple; 29 | } 30 | div.containBox .tt { 31 | font-weight: normal; 32 | } 33 | /* markup attribute */ 34 | .attribute { 35 | font-weight: bold; 36 | font-family: "Times New Roman",Times,serif; 37 | color: purple; 38 | } 39 | /* reference to a markup element or to an identifier in a code fragment */ 40 | .identifier { 41 | font-style: italic; 42 | } 43 | /* inline code sample */ 44 | .sample { 45 | font-family: "Courier New",Courier,monospace; 46 | } 47 | div.containBox { 48 | border: 2px dotted gray; 49 | padding: 10px; 50 | margin: 20px 80px; 51 | } 52 | p.contains { 53 | margin: 0; 54 | padding: 0; 55 | } 56 | p.containedin { 57 | margin: 0; 58 | padding: 0; 59 | } 60 | div.containBox > p > span:first-child:after { 61 | content: " :"; 62 | } 63 | div.containBox > p > span:first-child { 64 | text-decoration: underline; 65 | padding-right: 20px; 66 | } 67 | /* Code examples */ 68 | pre { 69 | background-color: #F0F0F0; 70 | border: solid thin blue !important; 71 | padding: 10px; 72 | margin-top: 20px; 73 | margin-left: 20px; 74 | } 75 | div.containBox pre { 76 | background-color: white; 77 | border: none !important; 78 | margin: 0; 79 | padding: 0; 80 | } 81 | pre > strong { 82 | color: green; 83 | } 84 | pre > em { 85 | color: blue; 86 | font-style: normal; 87 | } 88 | /* Tables */ 89 | table { 90 | border-collapse: separate; 91 | border-style: double; 92 | border-color: gray; 93 | border-spacing: 2px; 94 | border-width: 2px; 95 | } 96 | thead { 97 | 98 | } 99 | tbody { 100 | } 101 | td, th { 102 | padding: 5px; 103 | background-color: #FFFFF0; 104 | border-style: inset; 105 | border-color: gray; 106 | border-width: 1px; 107 | } 108 | th { 109 | font-weight: bold; 110 | } 111 | 112 | /* editor specific rules */ 113 | h2 { 114 | margin: 2em 0 1em 0; 115 | clear: both; 116 | } 117 | span.identifier { 118 | position: absolute; 119 | top: 1.5em; 120 | left: 0; 121 | font-size: 0.6em; 122 | color: #343434; 123 | display: none; 124 | } 125 | h2:hover > span.identifier { 126 | display: inline; 127 | } 128 | div.row:first-of-type { 129 | clear: none; 130 | } 131 | div.row { 132 | clear: left; 133 | margin: 1em 0; 134 | } 135 | span.row-menu { 136 | width: 80px; 137 | float: left; 138 | margin-bottom: 1em; 139 | } 140 | .row-content { 141 | margin-left: 80px; 142 | } 143 | pre > textarea { 144 | margin: 0 !important; 145 | padding: 0 !important; 146 | } 147 | td:not(.menu) img, th img { 148 | display: none; 149 | } 150 | td:hover img, th:hover img { 151 | display: inline; 152 | } 153 | body.preview span.row-menu { 154 | display: none; 155 | } 156 | body.preview .row-content { 157 | margin-left: 0; 158 | } 159 | body.preview .nopreview { 160 | display: none; 161 | } 162 | 163 | /* Printing Adjustments */ 164 | @media print { 165 | .noprint { 166 | display: none 167 | } 168 | body { 169 | font: 11pt geargia, serif; 170 | } 171 | p, li, dd { 172 | text-align: justify; 173 | } 174 | pre, code { 175 | font-size: 70% !important; 176 | } 177 | table { 178 | border-collapse: collapse; 179 | } 180 | .sample { 181 | font-family: "Courier New",Courier,monospace; 182 | font-size:75%; 183 | } 184 | } -------------------------------------------------------------------------------- /contribs/schematize/schematize.xhtml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | AXEL Javascript Schema Generator 10 | 124 | 125 | 126 | 127 | 128 | 129 | 136 | 137 | 138 | 139 | 140 | 141 |
142 |

Generate Schema

143 | 144 |

145 | 148 |

149 | 150 |
151 |
152 |
153 | 154 | 155 |
156 |

Schema : status

157 |
158 |
159 | 161 |
162 | 163 |
164 |
165 | 166 | 167 | 168 | -------------------------------------------------------------------------------- /data/ficheProjetW.xml: -------------------------------------------------------------------------------- 1 | 2 | Conception d'un environnement d'exécution de widgets W3C pour mobiles 3 | master 4 | 5 | Contexte 6 | 7 | Depuis sa création en 1987, le 8 | Centre de Recherche Public Henri Tudor 9 | affiche les technologies de l’information et de la communication (TIC) parmi ses technologies-clés. Pour ce faire, il s’appuie sur son département 10 | Centre d’Innovation par les Technologies de l’Information 11 | (CITI) qui compte plus de 120 ingénieurs. L’objectif du CITI est d’accompagner, par la recherche et le conseil en innovation, l’économie luxembourgeoise vers les applications TIC les plus prometteuses, notamment dans le domaine de la mobilité. 12 | 13 | 14 | L'avènement des « application stores » sur mobile pose désormais le problème de la portabilité des applications. En effet les principales plateformes mobiles actuelles sont toutes propriétaires et incompatibles entre elles. Une solution peut être entrevue du côté du web mobile qui permet de régler en partie le problème de l'interopérabilité. Cependant le web actuel ne permet pas de répondre à tous les défis de la mobilité, notamment les problèmes de connexion et de débits des réseaux GSM actuels. Une solution peut être alors d'étudier l'approche des 15 | 16 | widgets W3C 17 | http://www.w3.org/TR/2009/WD-widgets-20091029/ 18 | 19 | , dans laquelle l'application web est packagée, fonctionne localement et télécharge uniquement ses données sur Internet. Comme l'application est téléchargée une seule fois, sa réactivité perçue en est d'autant améliorée. 20 | 21 | Description du stage 22 | 23 | Dans ce contexte, l'objectif de ce stage sera de spécifier et d'implémenter un environnement d'exécution de widgets open source pour mobiles. Cet environnement devra être compatible avec les spécifications du W3C relatives aux Widgets et exposer des APIs JavaScript spécifiques aux environnements mobiles comme 24 | 25 | DCCI 26 | http://www.w3.org/TR/DPF/ 27 | 28 | ou 29 | 30 | BONDI 31 | http://bondi.omtp.org/default.aspx 32 | 33 | (ex: appareil photo, répertoire, sms, …). Une veille préalable sur ce type d'APIs et sur les usages associés sera nécessaire. 34 | 35 | 36 | Cet environnement pourra s'appuyer sur la base de code du navigateur mobile 37 | 38 | Mozilla Fennec 39 | http://wiki.mozilla.org/Fennec 40 | 41 | et sur le portail de widgets open source 42 | 43 | Ripple 44 | http://code.google.com/p/mywiwall/ 45 | 46 | développé au CRP Henri Tudor. Une collaboration avec le groupe de travail 47 | 48 | WebApps 49 | http://www.w3.org/2008/webapps/ 50 | 51 | du W3C pourra être envisagée. 52 | 53 | Compétences attendues 54 | 55 | Bonnes connaissances en génie logiciel et conception d'interfaces utilisateur technologies web (XHTML, CSS, HTTP, REST) et dans les langages de développement classiques (C, C++, Java). Bonnes connaissances en JavaScript (programmation par prototype, POO, DOM, traitements XML, AJAX, Comet, JQuery). Bon rédactionnel et capacités d'intégration dans l'équipe projet des connaissances des contraintes liées au développement sur mobile seraient un plus. 56 | 57 | 58 | Stéphane 59 | 60 | -------------------------------------------------------------------------------- /src/util/menubar.js: -------------------------------------------------------------------------------- 1 | /* ***** BEGIN LICENSE BLOCK ***** 2 | * 3 | * @COPYRIGHT@ 4 | * 5 | * This file is part of the Adaptable XML Editing Library (AXEL), version @VERSION@ 6 | * 7 | * @LICENSE@ 8 | * 9 | * Web site : http://media.epfl.ch/Templates/ 10 | * 11 | * Author(s) : Stephane Sire 12 | * 13 | * ***** END LICENSE BLOCK ***** */ 14 | 15 | /** 16 | * This is a Firefox only simple menu bar (Dump, Load, Save) 17 | * 18 | * It uses the local file selection dialog box (if privilege are granted by user) to access local files on the disk 19 | * If you prefer have a look at davmenubar.js that uses XHR requests and that runs in more browsers 20 | * 21 | */ 22 | xtiger.util.MenuBar = function (aForm) { 23 | this.curform = aForm; 24 | this.installBar (); 25 | this.nbLoad = 0; 26 | } 27 | 28 | xtiger.util.MenuBar.prototype = { 29 | 30 | checkFireFox : function () { 31 | if (! xtiger.cross.UA.gecko) { 32 | alert('This option is only available on Firefox'); 33 | return false; 34 | } 35 | return true; 36 | }, 37 | 38 | installBar : function () { 39 | var body = document.getElementsByTagName('body')[0]; 40 | body.style.margin = "40px 10px 0 10px"; 41 | var bar = xtdom.createElement(document, 'p'); 42 | bar.style.position = 'fixed'; 43 | bar.style.top = '0'; 44 | bar.style.left = '0'; 45 | bar.style.right = '0'; 46 | bar.style.background = 'lightgray'; 47 | bar.style.margin = '0'; 48 | bar.style.padding = '5px 40px 5px 40px'; 49 | // Dump button 50 | var dump = xtdom.createElement(document, 'input'); 51 | xtdom.setAttribute(dump, 'type', 'button'); 52 | xtdom.setAttribute(dump, 'value', 'Dump'); 53 | dump.style.margin = "0 0 0 20px"; 54 | // Load button 55 | var load = xtdom.createElement(document, 'input'); 56 | xtdom.setAttribute(load, 'type', 'button'); 57 | xtdom.setAttribute(load, 'value', 'Load'); 58 | load.style.margin = "0 0 0 20px"; 59 | // Save button 60 | var save = xtdom.createElement(document, 'input'); 61 | xtdom.setAttribute(save, 'type', 'button'); 62 | xtdom.setAttribute(save, 'value', 'Save'); 63 | save.style.margin = "0 0 0 20px"; 64 | var t = xtdom.createTextNode(document, 'XTiger Forms bar : '); 65 | bar.appendChild (t); 66 | bar.appendChild (dump); 67 | bar.appendChild (load); 68 | bar.appendChild (save); 69 | body.appendChild(bar); 70 | var _this = this; // closure 71 | xtdom.addEventListener(dump, 'click', function () { _this.doDump() }, false); 72 | xtdom.addEventListener(load, 'click', function () { _this.doLoad() }, false); 73 | xtdom.addEventListener(save, 'click', function () { _this.doSave() }, false); 74 | }, 75 | 76 | doDump : function () { 77 | var log = new xtiger.util.LogWin ("XML instance data", 400, 600, true); 78 | log.dump(this.curform); 79 | }, 80 | 81 | doLoad : function () { 82 | if (this.checkFireFox()) { 83 | if (this.nbLoad > 0) { 84 | var doIt = confirm('You have already loaded some data into the template, it is recommended to reload the template before loading again some data, please confirm'); 85 | if (! doIt) { 86 | return; 87 | } 88 | } 89 | var filePath = xtiger.util.fileDialog('open', "*.xml", "Select a file to load XML data from"); 90 | if (filePath) { 91 | var name = filePath.match(/[^\/]*\.xml$/)[0]; 92 | if (! this.curform.loadDataFromFile(filePath, xtiger.cross.getXHRObject()) ) { 93 | alert('Failure "' + name + '" returns: ' + this.curform.msg, 1 ); 94 | } 95 | this.nbLoad++; 96 | } 97 | } 98 | }, 99 | 100 | doSave : function () { 101 | if (this.checkFireFox()) { 102 | var filePath = xtiger.util.fileDialog('save', "*.xml", "Select a file to save XML data"); 103 | if (filePath) { 104 | var name = filePath.match(/[^\/]*\.xml$/)[0]; 105 | if (! this.curform.saveDataToFile (filePath)) { 106 | alert(this.curform.msg, 1); 107 | } 108 | } 109 | } 110 | } 111 | 112 | } 113 | -------------------------------------------------------------------------------- /test/migration/Case-e-2a.xhtml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Migration test case 13 | 14 | 15 | 16 | 17 |

type_a

18 |
19 | 20 | 21 |

type_b

22 |
23 | 24 | 25 |

type_c

26 |
27 | 28 | 29 |

New element : new content

30 |

A? : a content

31 | type_a | type_b | type_c : 32 | 33 |
34 | 35 |

Element C : c content

36 |
37 |
38 |
39 | 40 | 41 |

Element D : d content

42 | type_a | type_b | type_c : 43 |

Element E : e content

44 |

Element F : f content

45 |
46 | 47 |
48 | 49 | 50 | 51 | 52 | 53 |

Complex series : complex addition

54 | 55 |

Migration test : case-e-2a

56 | 57 |

Addition of a simple element in a complex sequence

58 | 59 |

60 | Addition of a simple element as first one in a complex sequence. 61 |

62 | 63 |

Simple uses

64 | 65 | 66 | 67 |

Labelled repeat 1 to *

68 | 69 | 70 |
71 | 72 | 73 |
74 |
75 | 76 |

Unlabelled repeat 1 to *

77 | 78 | 79 |
80 | 81 | 82 |
83 |
84 | 85 | 86 | 87 |
88 |

Addition of a complex element in a simple sequence

89 | 90 |

Addition of a labelled choice

91 | 92 |

Simple uses

93 | 94 | 95 | 96 |

Labelled repeat 1 to *

97 | 98 | 99 |
100 | 101 | 102 |
103 |
104 | 105 |

Unlabelled repeat 1 to *

106 | 107 | 108 |
109 | 110 | 111 |
112 |
113 | 114 | -------------------------------------------------------------------------------- /test/migration/Case-e-1.xhtml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Migration test case 13 | 14 | 15 | 16 | 17 |

type_a

18 |
19 | 20 | 21 |

type_b

22 |
23 | 24 | 25 |

type_c

26 |
27 | 28 | 29 |

A? : a content

30 | type_a | type_b | type_c : 31 | 32 |
33 | 34 |

Element C : c content

35 |
36 |
37 |
38 | 39 | 40 |

Element D : d content

41 |

Element E : e content

42 |

Element F : f content

43 |
44 | 45 |
46 | 47 | 48 | 49 | 50 | 51 |

Complex series : complex addition

52 | 53 |

Migration test : case-2-1

54 | 55 |

This template is used to test the addition of an element (not a choice, not an option, not a repeat) in a more complex situation. This situation involves an optional element, an unlabelled choice and an unlabelled repeat.

56 | 57 |

58 | It also tests the addition of the following elements in a simple sequence : a labelled choice, a labelled repeat and a unlabelled one. 59 |

60 | 61 |

Addition of a simple element in a complex sequence

62 | 63 |

Simple uses

64 | 65 | 66 | 67 |

Labelled repeat 1 to *

68 | 69 | 70 |
71 | 72 | 73 |
74 |
75 | 76 |

Unlabelled repeat 1 to *

77 | 78 | 79 |
80 | 81 | 82 |
83 |
84 | 85 | 86 | 87 |
88 |

Addition of a complex element in a simple sequence

89 | 90 |

Simple uses

91 | 92 | 93 | 94 |

Labelled repeat 1 to *

95 | 96 | 97 |
98 | 99 | 100 |
101 |
102 | 103 |

Unlabelled repeat 1 to *

104 | 105 | 106 |
107 | 108 | 109 |
110 |
111 | 112 | --------------------------------------------------------------------------------