Skip to content

Commit

Permalink
Pre-release 1.3.2: new $axel functions (transform, load, xml), xmlloa…
Browse files Browse the repository at this point in the history
…der algorithm supporting multiple passes (it is now no longer necessary to reset an editor before loading new XML data !) ; fixed algorithm to select all text in primitive editors when default content even if there is no event; fixed CSS settings to better control textarea or input alignment (the library no longer shifts it by 2px to anticipate field border size, it also no longer inherits textarea and input margins which caused them to create extra margins when used direclty inside a block-level handle created with the xt:use optional handle attribute, replaced border with outline around axel-core-editable); added Illustration component type to upload images into Article template (and key attribute for bibliographic refs). TODO: rebuild axel.js when ready for release.
  • Loading branch information
ssire committed May 31, 2013
1 parent fd66e4f commit 39a9281
Show file tree
Hide file tree
Showing 25 changed files with 642 additions and 176 deletions.
14 changes: 4 additions & 10 deletions axel/axel.css
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ textarea.axel-text-placed,
input.axel-text-placed,
textarea.axel-text-float,
input.axel-text-float {
margin: inherit;
padding: inherit;
margin: 0;
padding: 0;
color: inherit;
font-style: inherit;
font-size: inherit;
Expand All @@ -76,12 +76,6 @@ input.axel-text-float {
display: inline;
}

textarea.axel-text-placed,
input.axel-text-placed {
position: relative;
left: -2px; /* assumes 2px input field border ? (empirical) */
}

/* Style for text container */
div.axel-text-container {
position: relative;
Expand Down Expand Up @@ -258,9 +252,9 @@ object.axel-repeat-unset {
/*****************/
/** Core styles **/

/* Style for ediatble parts of the template */
/* Style for editable parts of the template */
.axel-core-editable {
border: thin dashed #bbffdd;
outline: thin dashed #bbffdd;
}

/* Style for error message within the template as a result of a problem in the transformation process */
Expand Down
2 changes: 1 addition & 1 deletion distrib/release-nb.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3.1
1.3.2
2 changes: 0 additions & 2 deletions editor/editor.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
<script type="text/javascript" src="../src/core/plugin.js"></script>
<script type="text/javascript" src="../src/core/filter.js"></script>
<script type="text/javascript" src="../src/core/forms.js"></script>
<script type="text/javascript" src="../src/core/utils.js"></script>
<script type="text/javascript" src="../src/editor/classical/generator.js"></script>

<!-- alternative loaders and serializers -->
Expand All @@ -51,7 +50,6 @@
<script type="text/javascript" src="../src/editor/classical/choice.js"></script>
<script type="text/javascript" src="../src/editor/classical/keyboard.js"></script>
<script type="text/javascript" src="../src/editor/classical/tabgroupmgr.js"></script>
<script type="text/javascript" src="../src/editor/classical/string.js"></script>

<!-- native plugins and devices -->
<script type="text/javascript" src="../src/plugins/text.js"></script>
Expand Down
8 changes: 6 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
</style>
</head>
<body>
<h1>AXEL Version 1.3.1</h1>
<h1>AXEL Version 1.3.2</h1>

<p id="header">AXEL is a library for creating XML authoring applications based on document templates. The templates are written with a mix of XHTML and XTiger XML elements. It implements a client-side XTiger XML processor. AXEL has been first introduced at the <a href="http://www.xmlprague.cz/2010/index.html" target="_new">XML Prague 2010</a> conference and is continuously evolving since that time.</p>

Expand Down Expand Up @@ -100,6 +100,10 @@ <h3>Related projects</h3>

<p>You should also check the <a href="http://ssire.github.com/axel-forms/" target="_new">AXEL-FORMS</a> extensions to AXEL. They provide additional constructs to create more <i>form-oriented</i> user interfaces. They also provide microformat instructions to easily embed AXEL into web pages. If your are looking for a fully XML-oriented backend you may also check the <a href="http://ssire.github.io/oppidum/" target="_new">Oppidum</a> framework.</p>

<h3>Mailing list</h3>

<p>Check the <a href="http://groups.google.com/group/axel-dev" target="_blank">axel-dev</a> mailing list for assistance</p>

<div id="layout">
<h3>Project layout</h3>

Expand Down Expand Up @@ -140,7 +144,7 @@ <h3>Project layout</h3>
</dl>
</div>

<p id="timestamp">Last update: <span style="font-style: italic;">2013-05-01</span></p>
<p id="timestamp">Last update: <span style="font-style: italic;">2013-05-31</span></p>

</body>
</html>
8 changes: 7 additions & 1 deletion src/core/domdatasource.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,16 @@ xtiger.util.DOMDataSource.prototype = {
return null; // point must be -1
}
},

lengthFor : function (point) {
if (point instanceof Array) {
return point.length - 1;
// FIXME: should we consider no content as content ? I do not think since it may be an empty node with attribute(s)
// if ((point.length === 2) && (point[1] === null)) {
// return 0;
// } else {
// return point.length - 1;
// }
} else {
return 0;
}
Expand Down
25 changes: 17 additions & 8 deletions src/core/forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ xtiger.util.Logger.prototype = {
| |
| xtiger.util.Form module |
| |
| WILL BE DEPRECATED - use $axel wrapper object instead |
| |
| Class for calling AXEL parser and generator to transform a template into |
| an editor, then to load and/or save XML data from/to the editor. |
| |
Expand Down Expand Up @@ -159,20 +161,27 @@ xtiger.util.Form.prototype = {
this.targetContainerId = anId;
this.doEmptyTarget = doReplace;
},

setTarget : function (node, doReplace) {
this.curDoc = node.ownerDocument;
this.targetContainer = node;
this.doEmptyTarget = doReplace || true;
},

// Transforms template into editor
// log is an optional logger to report errors
transform : function (logger) {
var parser;
// FIXME: check this.srcDoc is set...
if (! this.srcForm) {
this._report (0, 'no template to transform', logger);
return false;
}
this.editor = new xtiger.editor.Generator (this.baseUrl);
this.parser = new xtiger.parser.Iterator (this.srcDoc, this.editor);
if (this.targetContainerId) { // checks if the transformation require a cross-document copy
var n = this.curDoc.getElementById(this.targetContainerId);
if (n) {
parser = new xtiger.parser.Iterator (this.srcDoc, this.editor);
if (this.targetContainer || this.targetContainerId) { // checks if the transformation require a cross-document copy
var n = this.targetContainer || this.curDoc.getElementById(this.targetContainerId);
if (n) {
if (this.doEmptyTarget) {
xtdom.removeChildrenOf (n);
}
Expand All @@ -182,7 +191,7 @@ xtiger.util.Form.prototype = {
this._report (0, 'transformation aborted because target container "' + this.targetContainerId + '" not found in target document', logger);
return false;
}
this.parser.importComponentStructs (this.curDoc); // to import component definitions
parser.importComponentStructs (this.curDoc); // to import component definitions
} else {
this.root = this.srcForm;
}
Expand All @@ -200,7 +209,7 @@ xtiger.util.Form.prototype = {
}
// finally makes form available to other plugins (e.g. lens may need it to know where to insert their wrapper)
xtiger.session(this.curDoc).save('form', this);
this.parser.transform (this.root, this.curDoc);
parser.transform (this.root, this.curDoc);
this._report (1, 'document transformed', logger);
return (this.status == 1);
},
Expand All @@ -226,7 +235,7 @@ xtiger.util.Form.prototype = {
} else {
this._report (0, "cannot inject editor's style sheet because target document has no head section", logger);
}
return (this.status == 1);
return (this.status == 1);
},

// Loads XML data into a template which has been previously loaded into a DOMDataSource
Expand All @@ -237,7 +246,7 @@ xtiger.util.Form.prototype = {
} else {
this._report (0, 'data source empty', logger);
}
return (this.status == 1);
return (this.status == 1);
},

// Loads XML data into a template from a string
Expand Down
Loading

0 comments on commit 39a9281

Please sign in to comment.