/[suikacvs]/webroot/www/style/html/xhtml2-translate.xbl
Suika

Contents of /webroot/www/style/html/xhtml2-translate.xbl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations) (download)
Sun Dec 5 06:48:19 2004 UTC (21 years, 6 months ago) by wakaba
Branch: MAIN
Changes since 1.1: +14 -0 lines
XLink'ing support

1 wakaba 1.1 <?xml version="1.0"?>
2     <bindings xmlns="http://www.mozilla.org/xbl">
3     <binding id="copy-as-child">
4     <implementation>
5     <constructor type="application/x-javascript" xml:space="preserve">
6     <![CDATA[
7     var clone = document.createElementNS
8     ('http://www.w3.org/1999/xhtml',
9     this.localName);
10     for (var i = 0; i < this.attributes.length; i++) {
11     var attr = this.attributes[i];
12     clone.setAttributeNS (attr.namespaceURI, attr.localName,
13     attr.nodeValue);
14     }
15     for (i = 0; i < this.childNodes.length; i++) {
16     clone.appendChild (this.childNodes[i]);
17     }
18     this.appendChild (clone);
19     ]]>
20     </constructor>
21     </implementation>
22     </binding>
23     <binding id="meta">
24     <implementation>
25     <constructor type="application/x-javascript" xml:space="preserve">
26     <![CDATA[
27     /*
28     var clone = document.createElementNS
29     ('http://www.w3.org/1999/xhtml', 'meta');
30     for (var i = 0; i < this.attributes.length; i++) {
31     var attr = this.attributes[i];
32     clone.setAttributeNS (attr.namespaceURI, attr.localName,
33     attr.nodeValue);
34     }
35     if (!clone.hasAttribute ('content'))
36     clone.setAttribute ('content', this.textContent);
37     this.appendChild (clone);
38     */
39     this.name = this.getAttribute ('name');
40     if (this.hasAttribute ('content'))
41     this.content = this.getAttribute ('content')
42     else
43     this.content = this.textContent;
44     ]]>
45     </constructor>
46     </implementation>
47     </binding>
48 wakaba 1.2 <binding id="href">
49     <implementation>
50     <constructor type="application/x-javascript" xml:space="preserve">
51     <![CDATA[
52     if (this.hasAttributeNS (null, 'href')) {
53     this.setAttributeNS ('http://www.w3.org/1999/xlink', 'xlink:href',
54     this.getAttributeNS (null, 'href'));
55     this.setAttributeNS ('http://www.w3.org/1999/xlink', 'xlink:type',
56     'simple');
57     }
58     ]]>
59     </constructor>
60     </implementation>
61     </binding>
62 wakaba 1.1 </bindings>
63     <!-- ***** BEGIN LICENSE BLOCK *****
64     - Version: MPL 1.1/GPL 2.0/LGPL 2.1
65     -
66     - The contents of this file are subject to the Mozilla Public License Version
67     - 1.1 (the "License"); you may not use this file except in compliance with
68     - the License. You may obtain a copy of the License at
69     - <http://www.mozilla.org/MPL/>
70     -
71     - Software distributed under the License is distributed on an "AS IS" basis,
72     - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
73     - for the specific language governing rights and limitations under the
74     - License.
75     -
76     - The Original Code is SuikaWiki code.
77     -
78     - The Initial Developer of the Original Code is Wakaba.
79     - Portions created by the Initial Developer are Copyright (C) 2003
80     - the Initial Developer. All Rights Reserved.
81     -
82     - Contributor(s):
83     - Wakaba <w@suika.fam.cx>
84     -
85     - Alternatively, the contents of this file may be used under the terms of
86     - either the GNU General Public License Version 2 or later (the "GPL"), or
87     - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
88     - in which case the provisions of the GPL or the LGPL are applicable instead
89     - of those above. If you wish to allow use of your version of this file only
90     - under the terms of either the GPL or the LGPL, and not to allow others to
91     - use your version of this file under the terms of the MPL, indicate your
92     - decision by deleting the provisions above and replace them with the notice
93     - and other provisions required by the LGPL or the GPL. If you do not delete
94     - the provisions above, a recipient may use your version of this file under
95     - the terms of any one of the MPL, the GPL or the LGPL.
96     -
97     - ***** END LICENSE BLOCK ***** -->

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24