Subversion Repositories Applications.papyrus

Rev

Rev 1688 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1688 Rev 1921
Line 1... Line 1...
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2
<!--
2
<!--
3
 * FCKeditor - The text editor for internet
3
 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
4
 * Copyright (C) 2003-2006 Frederico Caldeira Knabben
4
 * Copyright (C) 2003-2008 Frederico Caldeira Knabben
-
 
5
 *
-
 
6
 * == BEGIN LICENSE ==
5
 * 
7
 *
6
 * Licensed under the terms of the GNU Lesser General Public License:
8
 * Licensed under the terms of any of the following licenses at your
7
 * 		http://www.opensource.org/licenses/lgpl-license.php
9
 * choice:
8
 * 
10
 *
9
 * For further information visit:
11
 *  - GNU General Public License Version 2 or later (the "GPL")
10
 * 		http://www.fckeditor.net/
12
 *    http://www.gnu.org/licenses/gpl.html
11
 * 
13
 *
12
 * "Support Open Source software. What about a donation today?"
14
 *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
-
 
15
 *    http://www.gnu.org/licenses/lgpl.html
13
 * 
16
 *
14
 * File Name: fck_template.html
17
 *  - Mozilla Public License Version 1.1 or later (the "MPL")
15
 * 	Template selection dialog window.
18
 *    http://www.mozilla.org/MPL/MPL-1.1.html
16
 * 
19
 *
17
 * File Authors:
20
 * == END LICENSE ==
-
 
21
 *
18
 * 		Frederico Caldeira Knabben (fredck@fckeditor.net)
22
 * Template selection dialog window.
19
-->
23
-->
20
<html xmlns="http://www.w3.org/1999/xhtml">
24
<html xmlns="http://www.w3.org/1999/xhtml">
21
<head>
25
<head>
22
	<title></title>
26
	<title></title>
23
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
27
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
Line 61... Line 65...
61
	// Set the right box height (browser dependent).
65
	// Set the right box height (browser dependent).
62
	GetE('eList').style.height = document.all ? '100%' : '295px' ;
66
	GetE('eList').style.height = document.all ? '100%' : '295px' ;
Line 63... Line 67...
63
 
67
 
64
	// Translate the dialog box texts.
68
	// Translate the dialog box texts.
65
	oEditor.FCKLanguageManager.TranslatePage(document) ;
69
	oEditor.FCKLanguageManager.TranslatePage(document) ;
66
	
70
 
67
	GetE('xChkReplaceAll').checked = ( FCKConfig.TemplateReplaceAll !== false ) ;
71
	GetE('xChkReplaceAll').checked = ( FCKConfig.TemplateReplaceAll !== false ) ;
68
	
72
 
69
	if ( FCKConfig.TemplateReplaceCheckbox !== false )
73
	if ( FCKConfig.TemplateReplaceCheckbox !== false )
Line 70... Line 74...
70
		GetE('xReplaceBlock').style.display = '' ;
74
		GetE('xReplaceBlock').style.display = '' ;
Line 71... Line 75...
71
 
75
 
72
	window.parent.SetAutoSize( true ) ;
76
	window.parent.SetAutoSize( true ) ;
Line 73... Line 77...
73
 
77
 
74
	LoadTemplatesXml() ;
78
	LoadTemplatesXml() ;
-
 
79
}
-
 
80
 
75
}
81
function LoadTemplatesXml()
76
 
82
{
77
function LoadTemplatesXml()
83
	var oTemplate ;
Line 78... Line 84...
78
{
84
 
Line 94... Line 100...
94
		// Get the "Template" nodes defined in the XML file.
100
		// Get the "Template" nodes defined in the XML file.
95
		var aTplNodes = oXml.SelectNodes( 'Templates/Template' ) ;
101
		var aTplNodes = oXml.SelectNodes( 'Templates/Template' ) ;
Line 96... Line 102...
96
 
102
 
97
		for ( var i = 0 ; i < aTplNodes.length ; i++ )
103
		for ( var i = 0 ; i < aTplNodes.length ; i++ )
98
		{
104
		{
Line 99... Line 105...
99
			var oNode = aTplNodes[i]
105
			var oNode = aTplNodes[i] ;
Line 100... Line 106...
100
 
106
 
Line 101... Line 107...
101
			var oTemplate = new Object() ;
107
			oTemplate = new Object() ;
102
 
108
 
103
			var oPart ;
109
			var oPart ;
104
 
110
 
105
			// Get the Template Title.
111
			// Get the Template Title.
Line 106... Line 112...
106
			if ( oPart = oNode.attributes.getNamedItem('title') )
112
			if ( (oPart = oNode.attributes.getNamedItem('title')) )
107
				oTemplate.Title = oPart.value ;
113
				oTemplate.Title = oPart.value ;
108
			else
114
			else
Line 109... Line 115...
109
				oTemplate.Title = 'Template ' + ( i + 1 ) ;
115
				oTemplate.Title = 'Template ' + ( i + 1 ) ;
110
 
116
 
111
			// Get the Template Description.
117
			// Get the Template Description.
Line 112... Line 118...
112
			if ( oPart = oXml.SelectSingleNode( 'Description', oNode ) )
118
			if ( (oPart = oXml.SelectSingleNode( 'Description', oNode )) )
113
				oTemplate.Description = oPart.text ? oPart.text : oPart.textContent ;
119
				oTemplate.Description = oPart.text ? oPart.text : oPart.textContent ;
114
 
120
 
115
			// Get the Template Image.
121
			// Get the Template Image.
116
			if ( oPart = oNode.attributes.getNamedItem('image') )
122
			if ( (oPart = oNode.attributes.getNamedItem('image')) )
117
				oTemplate.Image = sImagesBasePath + oPart.value ;
123
				oTemplate.Image = sImagesBasePath + oPart.value ;
118
 
124
 
Line 133... Line 139...
133
 
139
 
134
	if ( FCK._Templates.length == 0 )
140
	if ( FCK._Templates.length == 0 )
135
		GetE('eEmpty').style.display = '' ;
141
		GetE('eEmpty').style.display = '' ;
136
	else
142
	else
137
	{
143
	{
138
		for ( var i = 0 ; i < FCK._Templates.length ; i++ )
144
		for ( var j = 0 ; j < FCK._Templates.length ; j++ )
139
		{
145
		{
Line 140... Line 146...
140
			var oTemplate = FCK._Templates[i] ;
146
			oTemplate = FCK._Templates[j] ;
141
 
147
 
142
			var oItemDiv = GetE('eList').appendChild( document.createElement( 'DIV' ) ) ;
148
			var oItemDiv = GetE('eList').appendChild( document.createElement( 'DIV' ) ) ;
Line 143... Line 149...
143
			oItemDiv.TplIndex = i ;
149
			oItemDiv.TplIndex = j ;
144
			oItemDiv.className = 'TplItem' ;
150
			oItemDiv.className = 'TplItem' ;
Line 155... Line 161...
155
				sInner += '<div>' + oTemplate.Description + '<\/div>' ;
161
				sInner += '<div>' + oTemplate.Description + '<\/div>' ;
Line 156... Line 162...
156
 
162
 
Line 157... Line 163...
157
			sInner += '<\/td><\/tr><\/table>' ;
163
			sInner += '<\/td><\/tr><\/table>' ;
158
 
164
 
159
			oItemDiv.innerHTML = sInner ;
165
			oItemDiv.innerHTML = sInner ;
160
			
166
 
161
			oItemDiv.onmouseover = ItemDiv_OnMouseOver ;
167
			oItemDiv.onmouseover = ItemDiv_OnMouseOver ;
162
			oItemDiv.onmouseout = ItemDiv_OnMouseOut ;
168
			oItemDiv.onmouseout = ItemDiv_OnMouseOut ;
163
			oItemDiv.onclick = ItemDiv_OnClick ;
169
			oItemDiv.onclick = ItemDiv_OnClick ;
Line 183... Line 189...
183
function SelectTemplate( index )
189
function SelectTemplate( index )
184
{
190
{
185
	oEditor.FCKUndo.SaveUndoStep() ;
191
	oEditor.FCKUndo.SaveUndoStep() ;
Line 186... Line 192...
186
 
192
 
187
	if ( GetE('xChkReplaceAll').checked )
193
	if ( GetE('xChkReplaceAll').checked )
188
		FCK.SetHTML( FCK._Templates[index].Html ) ;
194
		FCK.SetData( FCK._Templates[index].Html ) ;
189
	else
195
	else
Line 190... Line 196...
190
		FCK.InsertHtml( FCK._Templates[index].Html ) ;
196
		FCK.InsertHtml( FCK._Templates[index].Html ) ;
191
 
197