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 |
wakaba |
1.3 |
<!--
|
60 |
|
|
NOTE: When this code should be modified, modify <xhtml2-dynamic.xbl>,
|
61 |
|
|
too.
|
62 |
|
|
-->
|
63 |
wakaba |
1.2 |
</constructor>
|
64 |
|
|
</implementation>
|
65 |
|
|
</binding>
|
66 |
wakaba |
1.1 |
</bindings>
|
67 |
|
|
<!-- ***** BEGIN LICENSE BLOCK *****
|
68 |
|
|
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
69 |
|
|
-
|
70 |
|
|
- The contents of this file are subject to the Mozilla Public License Version
|
71 |
|
|
- 1.1 (the "License"); you may not use this file except in compliance with
|
72 |
|
|
- the License. You may obtain a copy of the License at
|
73 |
|
|
- <http://www.mozilla.org/MPL/>
|
74 |
|
|
-
|
75 |
|
|
- Software distributed under the License is distributed on an "AS IS" basis,
|
76 |
|
|
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
77 |
|
|
- for the specific language governing rights and limitations under the
|
78 |
|
|
- License.
|
79 |
|
|
-
|
80 |
|
|
- The Original Code is SuikaWiki code.
|
81 |
|
|
-
|
82 |
|
|
- The Initial Developer of the Original Code is Wakaba.
|
83 |
|
|
- Portions created by the Initial Developer are Copyright (C) 2003
|
84 |
|
|
- the Initial Developer. All Rights Reserved.
|
85 |
|
|
-
|
86 |
|
|
- Contributor(s):
|
87 |
|
|
- Wakaba <w@suika.fam.cx>
|
88 |
|
|
-
|
89 |
|
|
- Alternatively, the contents of this file may be used under the terms of
|
90 |
|
|
- either the GNU General Public License Version 2 or later (the "GPL"), or
|
91 |
|
|
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
92 |
|
|
- in which case the provisions of the GPL or the LGPL are applicable instead
|
93 |
|
|
- of those above. If you wish to allow use of your version of this file only
|
94 |
|
|
- under the terms of either the GPL or the LGPL, and not to allow others to
|
95 |
|
|
- use your version of this file under the terms of the MPL, indicate your
|
96 |
|
|
- decision by deleting the provisions above and replace them with the notice
|
97 |
|
|
- and other provisions required by the LGPL or the GPL. If you do not delete
|
98 |
|
|
- the provisions above, a recipient may use your version of this file under
|
99 |
|
|
- the terms of any one of the MPL, the GPL or the LGPL.
|
100 |
|
|
-
|
101 |
|
|
- ***** END LICENSE BLOCK ***** -->
|