6 |
<field name="NS_SLIDE">'urn:x-suika-fam-cx:markup:slide:1'</field> |
<field name="NS_SLIDE">'urn:x-suika-fam-cx:markup:slide:1'</field> |
7 |
<field name="NS_XHTML1">'http://www.w3.org/1999/xhtml'</field> |
<field name="NS_XHTML1">'http://www.w3.org/1999/xhtml'</field> |
8 |
<field name="NS_XHTML2">'http://www.w3.org/2002/06/xhtml2'</field> |
<field name="NS_XHTML2">'http://www.w3.org/2002/06/xhtml2'</field> |
9 |
|
<method name="getSlideList" type="application/x-javascript"> |
10 |
|
<body xml:space="preserve"><![CDATA[ |
11 |
|
return document.getElementsByTagNameNS (this.NS_SLIDE, 'slides')[0] |
12 |
|
.getElementsByTagNameNS (this.NS_SLIDE, 'slide'); |
13 |
|
]]></body> |
14 |
|
</method> |
15 |
|
<method name="createSlideBodyElement" type="application/x-javascript"> |
16 |
|
<parameter name="slide"/> |
17 |
|
<body xml:space="preserve"><![CDATA[ |
18 |
|
var slideBody = document.createElementNS (this.NS_SLIDE, 'slideBody'); |
19 |
|
var notes = document.createElementNS (this.NS_SLIDE, 'notes'); |
20 |
|
var slideChildren = slide.childNodes; |
21 |
|
while (slideChildren.length) { |
22 |
|
if (slideChildren[0].namespaceURI === this.NS_SLIDE |
23 |
|
&& slideChildren[0].localName === 'note') { |
24 |
|
notes.appendChild (slideChildren[0]); |
25 |
|
} else { |
26 |
|
slideBody.appendChild (slideChildren[0]); |
27 |
|
} |
28 |
|
} |
29 |
|
slide.appendChild (slideBody); |
30 |
|
if (notes.childNodes.length) |
31 |
|
slide.appendChild (notes); |
32 |
|
]]></body> |
33 |
|
</method> |
34 |
<constructor type="application/x-javascript" xml:space="preserve"><![CDATA[ |
<constructor type="application/x-javascript" xml:space="preserve"><![CDATA[ |
35 |
var slides = document.getElementsByTagNameNS (this.NS_SLIDE, 'slides')[0].getElementsByTagNameNS (this.NS_SLIDE, 'slide'); |
var topLevelNodes = document.documentElement.childNodes; |
36 |
|
for (var i = 0; i < topLevelNodes.length;) { |
37 |
|
if (topLevelNodes[i].nodeType === TEXT_NODE |
38 |
|
|| topLevelNodes[i].nodeType === COMMENT_NODE) { |
39 |
|
document.documentElement.removeChild (topLevelNodes[i]); |
40 |
|
} else { |
41 |
|
i++; |
42 |
|
} |
43 |
|
} |
44 |
|
var slides = this.getSlideList (); |
45 |
for (var i = 0; i < slides.length; i++) { |
for (var i = 0; i < slides.length; i++) { |
46 |
slides[i].setAttribute ('slideIndex', i); |
slides[i].setAttribute ('slideIndex', i); |
47 |
|
this.createSlideBodyElement (slides[i]); |
48 |
} |
} |
49 |
|
|
50 |
var h = document.getElementsByTagNameNS (this.NS_XHTML2, 'head')[0]; |
var h = document.getElementsByTagNameNS (this.NS_XHTML2, 'head')[0]; |
51 |
// Common slide style |
// Common slide style |
52 |
var l = document.createElementNS (this.NS_XHTML1, 'link'); |
var l = document.createElementNS (this.NS_XHTML1, 'link'); |
53 |
l.setAttribute ('rel', 'stylesheet'); |
l.setAttribute ('rel', 'stylesheet'); |
54 |
l.setAttribute ('href', this.SLIDE_XBL_BASE+'slide-style.css'); |
l.setAttribute ('href', |
55 |
|
/* URI-reference== */ |
56 |
|
this.SLIDE_XBL_BASE+'xhtml2.css' |
57 |
|
/* ==URI-reference */); |
58 |
|
h.appendChild (l); |
59 |
|
|
60 |
|
l = document.createElementNS (this.NS_XHTML1, 'link'); |
61 |
|
l.setAttribute ('rel', 'stylesheet'); |
62 |
|
l.setAttribute ('href', |
63 |
|
/* URI-reference== */ |
64 |
|
this.SLIDE_XBL_BASE+'slide-style.css' |
65 |
|
/* ==URI-reference */); |
66 |
h.appendChild (l); |
h.appendChild (l); |
67 |
|
|
68 |
// Slide listing style |
// Slide listing style |
69 |
l = document.createElementNS (this.NS_XHTML1, 'link'); |
l = document.createElementNS (this.NS_XHTML1, 'link'); |
70 |
l.setAttribute ('rel', 'stylesheet'); |
l.setAttribute ('rel', 'stylesheet'); |
71 |
l.setAttribute ('href', this.SLIDE_XBL_BASE+'slide-list.css'); |
l.setAttribute ('href', |
72 |
|
/* URI-reference== */ |
73 |
|
this.SLIDE_XBL_BASE+'slide-list.css' |
74 |
|
/* ==URI-reference */); |
75 |
l.setAttribute ('title', 'Slide List'); |
l.setAttribute ('title', 'Slide List'); |
76 |
h.appendChild (l); |
h.appendChild (l); |
77 |
|
|
78 |
// Slide showing style |
// Slide showing style |
79 |
l = document.createElementNS (this.NS_XHTML1, 'link'); |
l = document.createElementNS (this.NS_XHTML1, 'link'); |
80 |
l.setAttribute ('rel', 'stylesheet alternate'); |
l.setAttribute ('rel', 'stylesheet alternate'); |
81 |
l.setAttribute ('href', this.SLIDE_XBL_BASE+'slide-show.css'); |
l.setAttribute ('href', |
82 |
|
/* URI-reference== */ |
83 |
|
this.SLIDE_XBL_BASE+'slide-show.css' |
84 |
|
/* ==URI-reference */); |
85 |
l.setAttribute ('title', 'Slideshow'); |
l.setAttribute ('title', 'Slideshow'); |
86 |
h.appendChild (l); |
h.appendChild (l); |
87 |
} |
} |
110 |
return ret.join(''); |
return ret.join(''); |
111 |
]]></body> |
]]></body> |
112 |
</method> |
</method> |
113 |
|
<method name="getSlideList" type="application/x-javascript"> |
114 |
|
<body xml:space="preserve"><![CDATA[ |
115 |
|
return document.getElementsByTagNameNS (this.NS_SLIDE, 'slides')[0] |
116 |
|
.getElementsByTagNameNS (this.NS_SLIDE, 'slide'); |
117 |
|
]]></body> |
118 |
|
</method> |
119 |
<method name="setCurrentSlide" type="application/x-javascript"> |
<method name="setCurrentSlide" type="application/x-javascript"> |
120 |
<parameter name="n"/> |
<parameter name="n"/> |
121 |
<body xml:space="preserve"><![CDATA[ |
<body xml:space="preserve"><![CDATA[ |
122 |
var slides = document.getElementsByTagNameNS (this.NS_SLIDE, 'slides')[0].getElementsByTagNameNS (this.NS_SLIDE, 'slide'); |
var slides = this.getSlideList (); |
123 |
if (n < 0) n = slides.length + n; // -1 = slides.length-1 |
if (n < 0) n = slides.length + n; // -1 = slides.length-1 |
|
//else if (slides.length <= n) n = slides.length - 1; |
|
124 |
else if (slides.length <= n) n = 0; |
else if (slides.length <= n) n = 0; |
125 |
for (var i = 0; i < slides.length; i++) { |
for (var i = 0; i < slides.length; i++) { |
126 |
slides[i].setAttribute ('-isCurrentSlide', (i == n ? 'yes' : 'no')); |
slides[i].setAttributeNS (this.NS_SLIDE, 'isCurrentSlide', |
127 |
|
(i == n ? 'yes' : 'no')); |
128 |
} |
} |
129 |
this.currentSlideIndex = n; |
this.currentSlideIndex = n; |
130 |
]]></body> |
]]></body> |
132 |
<method name="getSlideTitle" type="application/x-javascript"> |
<method name="getSlideTitle" type="application/x-javascript"> |
133 |
<parameter name="n"/> |
<parameter name="n"/> |
134 |
<body xml:space="preserve"><![CDATA[ |
<body xml:space="preserve"><![CDATA[ |
135 |
var slides = document.getElementsByTagNameNS (this.NS_SLIDE, 'slides')[0].getElementsByTagNameNS (this.NS_SLIDE, 'slide'); |
var slides = this.getSlideList (); |
136 |
if (n < 0) n = slides.length + n; // -1 = slides.length-1 |
if (n < 0) n = slides.length + n; // -1 = slides.length-1 |
137 |
else if (slides.length <= n) n = slides.length - 1; |
else if (slides.length <= n) n = slides.length - 1; |
138 |
if (slides[n]) { |
if (slides[n]) { |
200 |
</binding> |
</binding> |
201 |
<binding id="seqNo"> |
<binding id="seqNo"> |
202 |
<implementation> |
<implementation> |
203 |
<field name="seqNo">[]</field> |
<field name="NS_SLIDE">'urn:x-suika-fam-cx:markup:slide:1'</field> |
204 |
<constructor type="application/x-javascript" xml:space="preserve"><![CDATA[ |
<constructor type="application/x-javascript" xml:space="preserve"><![CDATA[ |
205 |
var t; |
var t; |
206 |
var seqName = this.getAttribute ('name'); |
var seqName = this.getAttribute ('name'); |
213 |
} else { |
} else { |
214 |
t[seqName] = 1; |
t[seqName] = 1; |
215 |
} |
} |
216 |
this.setAttribute ('-seq-no', t[seqName]); |
this.setAttributeNS (this.NS_SLIDE, 's:seq-no', t[seqName]); |
217 |
]]></constructor> |
]]></constructor> |
218 |
</implementation> |
</implementation> |
219 |
</binding> |
</binding> |