Browse Source

Developers preview version

pecesama 17 years ago
commit
9d9b17c90f
100 changed files with 7310 additions and 0 deletions
  1. 187 0
      admin/add.php
  2. 144 0
      admin/admin.php
  3. 40 0
      admin/ajax.php
  4. 64 0
      admin/close.php
  5. 337 0
      admin/css/style-codice.css
  6. 158 0
      admin/index.php
  7. 2 0
      admin/scripts/mootools.js
  8. BIN
      admin/scripts/player.swf
  9. 9 0
      admin/scripts/tiny_mce/blank.htm
  10. 41 0
      admin/scripts/tiny_mce/langs/en.js
  11. 9 0
      admin/scripts/tiny_mce/langs/readme.txt
  12. 504 0
      admin/scripts/tiny_mce/license.txt
  13. 23 0
      admin/scripts/tiny_mce/plugins/advhr/css/advhr.css
  14. 1 0
      admin/scripts/tiny_mce/plugins/advhr/editor_plugin.js
  15. 90 0
      admin/scripts/tiny_mce/plugins/advhr/editor_plugin_src.js
  16. BIN
      admin/scripts/tiny_mce/plugins/advhr/images/advhr.gif
  17. 43 0
      admin/scripts/tiny_mce/plugins/advhr/jscripts/rule.js
  18. 8 0
      admin/scripts/tiny_mce/plugins/advhr/langs/en.js
  19. 1 0
      admin/scripts/tiny_mce/plugins/advhr/readme.txt
  20. 61 0
      admin/scripts/tiny_mce/plugins/advhr/rule.htm
  21. 66 0
      admin/scripts/tiny_mce/plugins/advimage/css/advimage.css
  22. 1 0
      admin/scripts/tiny_mce/plugins/advimage/editor_plugin.js
  23. 148 0
      admin/scripts/tiny_mce/plugins/advimage/editor_plugin_src.js
  24. 241 0
      admin/scripts/tiny_mce/plugins/advimage/image.htm
  25. BIN
      admin/scripts/tiny_mce/plugins/advimage/images/sample.gif
  26. 534 0
      admin/scripts/tiny_mce/plugins/advimage/jscripts/functions.js
  27. 27 0
      admin/scripts/tiny_mce/plugins/advimage/langs/en.js
  28. 1 0
      admin/scripts/tiny_mce/plugins/advimage/readme.txt
  29. 35 0
      admin/scripts/tiny_mce/plugins/advlink/css/advlink.css
  30. 1 0
      admin/scripts/tiny_mce/plugins/advlink/editor_plugin.js
  31. 88 0
      admin/scripts/tiny_mce/plugins/advlink/editor_plugin_src.js
  32. 568 0
      admin/scripts/tiny_mce/plugins/advlink/jscripts/functions.js
  33. 46 0
      admin/scripts/tiny_mce/plugins/advlink/langs/en.js
  34. 337 0
      admin/scripts/tiny_mce/plugins/advlink/link.htm
  35. 1 0
      admin/scripts/tiny_mce/plugins/advlink/readme.txt
  36. 1 0
      admin/scripts/tiny_mce/plugins/autosave/editor_plugin.js
  37. 46 0
      admin/scripts/tiny_mce/plugins/autosave/editor_plugin_src.js
  38. 5 0
      admin/scripts/tiny_mce/plugins/autosave/langs/en.js
  39. 1 0
      admin/scripts/tiny_mce/plugins/autosave/readme.txt
  40. 1 0
      admin/scripts/tiny_mce/plugins/bbcode/editor_plugin.js
  41. 102 0
      admin/scripts/tiny_mce/plugins/bbcode/editor_plugin_src.js
  42. 0 0
      admin/scripts/tiny_mce/plugins/cleanup/editor_plugin.js
  43. 10 0
      admin/scripts/tiny_mce/plugins/cleanup/editor_plugin_src.js
  44. 1 0
      admin/scripts/tiny_mce/plugins/cleanup/readme.txt
  45. 74 0
      admin/scripts/tiny_mce/plugins/contextmenu/css/contextmenu.css
  46. 1 0
      admin/scripts/tiny_mce/plugins/contextmenu/editor_plugin.js
  47. 357 0
      admin/scripts/tiny_mce/plugins/contextmenu/editor_plugin_src.js
  48. BIN
      admin/scripts/tiny_mce/plugins/contextmenu/images/spacer.gif
  49. 1 0
      admin/scripts/tiny_mce/plugins/contextmenu/readme.txt
  50. 117 0
      admin/scripts/tiny_mce/plugins/devkit/css/devkit.css
  51. 15 0
      admin/scripts/tiny_mce/plugins/devkit/css/devkit_ui.css
  52. 140 0
      admin/scripts/tiny_mce/plugins/devkit/devkit.htm
  53. 1 0
      admin/scripts/tiny_mce/plugins/devkit/editor_plugin.js
  54. 325 0
      admin/scripts/tiny_mce/plugins/devkit/editor_plugin_src.js
  55. BIN
      admin/scripts/tiny_mce/plugins/devkit/images/flip_down.gif
  56. BIN
      admin/scripts/tiny_mce/plugins/devkit/images/flip_up.gif
  57. 331 0
      admin/scripts/tiny_mce/plugins/devkit/jscripts/devkit.js
  58. 1192 0
      admin/scripts/tiny_mce/plugins/devkit/jscripts/diff.js
  59. 23 0
      admin/scripts/tiny_mce/plugins/devkit/langs/en.js
  60. 1 0
      admin/scripts/tiny_mce/plugins/directionality/editor_plugin.js
  61. 90 0
      admin/scripts/tiny_mce/plugins/directionality/editor_plugin_src.js
  62. BIN
      admin/scripts/tiny_mce/plugins/directionality/images/ltr.gif
  63. BIN
      admin/scripts/tiny_mce/plugins/directionality/images/rtl.gif
  64. 6 0
      admin/scripts/tiny_mce/plugins/directionality/langs/en.js
  65. 1 0
      admin/scripts/tiny_mce/plugins/directionality/readme.txt
  66. 1 0
      admin/scripts/tiny_mce/plugins/emotions/editor_plugin.js
  67. 63 0
      admin/scripts/tiny_mce/plugins/emotions/editor_plugin_src.js
  68. 40 0
      admin/scripts/tiny_mce/plugins/emotions/emotions.htm
  69. BIN
      admin/scripts/tiny_mce/plugins/emotions/images/emotions.gif
  70. 2 0
      admin/scripts/tiny_mce/plugins/emotions/images/readme.txt
  71. BIN
      admin/scripts/tiny_mce/plugins/emotions/images/smiley-cool.gif
  72. BIN
      admin/scripts/tiny_mce/plugins/emotions/images/smiley-cry.gif
  73. BIN
      admin/scripts/tiny_mce/plugins/emotions/images/smiley-embarassed.gif
  74. BIN
      admin/scripts/tiny_mce/plugins/emotions/images/smiley-foot-in-mouth.gif
  75. BIN
      admin/scripts/tiny_mce/plugins/emotions/images/smiley-frown.gif
  76. BIN
      admin/scripts/tiny_mce/plugins/emotions/images/smiley-innocent.gif
  77. BIN
      admin/scripts/tiny_mce/plugins/emotions/images/smiley-kiss.gif
  78. BIN
      admin/scripts/tiny_mce/plugins/emotions/images/smiley-laughing.gif
  79. BIN
      admin/scripts/tiny_mce/plugins/emotions/images/smiley-money-mouth.gif
  80. BIN
      admin/scripts/tiny_mce/plugins/emotions/images/smiley-sealed.gif
  81. BIN
      admin/scripts/tiny_mce/plugins/emotions/images/smiley-smile.gif
  82. BIN
      admin/scripts/tiny_mce/plugins/emotions/images/smiley-surprised.gif
  83. BIN
      admin/scripts/tiny_mce/plugins/emotions/images/smiley-tongue-out.gif
  84. BIN
      admin/scripts/tiny_mce/plugins/emotions/images/smiley-undecided.gif
  85. BIN
      admin/scripts/tiny_mce/plugins/emotions/images/smiley-wink.gif
  86. BIN
      admin/scripts/tiny_mce/plugins/emotions/images/smiley-yell.gif
  87. 21 0
      admin/scripts/tiny_mce/plugins/emotions/jscripts/functions.js
  88. 22 0
      admin/scripts/tiny_mce/plugins/emotions/langs/en.js
  89. 1 0
      admin/scripts/tiny_mce/plugins/emotions/readme.txt
  90. 7 0
      admin/scripts/tiny_mce/plugins/flash/css/content.css
  91. 11 0
      admin/scripts/tiny_mce/plugins/flash/css/flash.css
  92. 1 0
      admin/scripts/tiny_mce/plugins/flash/editor_plugin.js
  93. 285 0
      admin/scripts/tiny_mce/plugins/flash/editor_plugin_src.js
  94. 70 0
      admin/scripts/tiny_mce/plugins/flash/flash.htm
  95. BIN
      admin/scripts/tiny_mce/plugins/flash/images/flash.gif
  96. 107 0
      admin/scripts/tiny_mce/plugins/flash/jscripts/flash.js
  97. 11 0
      admin/scripts/tiny_mce/plugins/flash/langs/en.js
  98. 1 0
      admin/scripts/tiny_mce/plugins/flash/readme.txt
  99. 9 0
      admin/scripts/tiny_mce/plugins/fullpage/blank.htm
  100. 0 0
      admin/scripts/tiny_mce/plugins/fullpage/css/fullpage.css

+ 187 - 0
admin/add.php View File

@@ -0,0 +1,187 @@
1
+<?
2
+/* ===========================
3
+
4
+  gelato CMS development version
5
+  http://www.gelatocms.com/
6
+
7
+  gelato CMS is a free software licensed under GPL (General public license)
8
+
9
+  =========================== */
10
+?>
11
+<?
12
+require_once('../config.php');
13
+include("../classes/user.class.php");
14
+include("../classes/gelato.class.php");
15
+include("../classes/templates.class.php");
16
+require_once("../classes/configuration.class.php");
17
+
18
+$user = new user();
19
+$tumble = new gelato();
20
+$conf = new configuration();
21
+$template = new plantillas("admin");
22
+
23
+if ($user->isAdmin()) {
24
+
25
+	if(isset($_POST["btnAdd"]))	{
26
+		unset($_POST["btnAdd"]);
27
+		
28
+		
29
+		if ($_POST["type"]=="2") { // is Photo type			
30
+			if (isset($_POST["url"]) && $_POST["url"]!="")  {			
31
+				$photoName = getFileName($_POST["url"]);
32
+				if (!$tumble->savePhoto($_POST["url"])) {
33
+					header("Location: ".$this->conf->urlGelato."/admin/index.php?photo=false");
34
+					die();
35
+				}
36
+				$_POST["url"] = $conf->urlGelato."/uploads/".$photoName;
37
+			}
38
+			
39
+			if ( move_uploaded_file( $_FILES['photo']['tmp_name'], "../uploads/".$_FILES['photo']['name'] ) ) {
40
+				$_POST["url"] = $conf->urlGelato."/uploads/".$_FILES['photo']['name'];
41
+			}
42
+			
43
+			unset($_POST["photo"]);
44
+			unset($_POST["MAX_FILE_SIZE"]);
45
+		}
46
+		
47
+		if ($_POST["type"]=="7") { // is MP3 type
48
+			set_time_limit(300);
49
+			$mp3Name = getFileName($_POST["url"]);
50
+			if (!$tumble->saveMP3($_POST["url"])) {
51
+				header("Location: ".$this->conf->urlGelato."/admin/index.php?mp3=false");
52
+				die();
53
+			}
54
+			$_POST["url"] = $conf->urlGelato."/uploads/".$mp3Name;
55
+		}
56
+		
57
+		
58
+		if (isset($_POST["id_post"])) {
59
+			//$tumble->modifyPost($_POST, $_POST["id_post"]);
60
+		} else {			
61
+			if ($tumble->addPost($_POST)) {
62
+				header("Location: ".$this->conf->urlGelato."/admin/index.php?added=true");
63
+				die();
64
+			} else {
65
+				header("Location: ".$this->conf->urlGelato."/admin/index.php?error=2&des=".$this->merror);
66
+				die();
67
+			}
68
+		}	
69
+	} elseif (isset($_GET["new"])) {	
70
+?>
71
+		<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
72
+		<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
73
+		<head>
74
+			<title>gelato</title>
75
+			<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
76
+			<link rel="shortcut icon" href="<?=$conf->urlGelato;?>/images/favicon.ico" />
77
+			<script language="javascript" type="text/javascript" src="<?=$conf->urlGelato;?>/admin/scripts/tiny_mce/tiny_mce.js"></script>
78
+			<script language="javascript" type="text/javascript" src="<?=$conf->urlGelato;?>/admin/scripts/tools.js"></script>
79
+			<script language="javascript" type="text/javascript" src="<?=$conf->urlGelato;?>/admin/scripts/mootools.js"></script>			
80
+			<style type="text/css" media="screen">	
81
+				@import "<?=$conf->urlGelato;?>/admin/css/style-codice.css";
82
+			</style>
83
+		</head>
84
+		<body>
85
+			<div id="div-process" style="display:none;">Processing request...</div>
86
+			<div id="titulo">
87
+				<img src="<?=$conf->urlGelato;?>/images/logo.jpg" alt="gelato CMS" title="gelato CMS" />	
88
+			</div>
89
+			
90
+			<div id="menuContenedor">
91
+				<ul>
92
+					<li id="active"><a href="#" id="current">Posts</a></li>
93
+						<ul>
94
+							<li id="subactive"><a href="#" id="subcurrent">Add</a></li>
95
+						</ul>
96
+					</li>
97
+					<li><a href="index.php">Control Panel</a></li>
98
+				</ul>
99
+			</div>
100
+			
101
+			<div id="contenido">
102
+				<div class="center">
103
+					<div  class="ventana">
104
+						<p class="titulo"><span class="handle">Add content</span></p>
105
+						<div id="formulario">
106
+							<form action="add.php" method="post" <?=($_GET["new"]=="photo") ? "enctype=\"multipart/form-data\"" : ""?> name="frmAdd">
107
+								<fieldset>
108
+<?
109
+						switch ($_GET["new"]) {
110
+							case "post":
111
+								$input = array("{type}", "{date}", "{id_user}");
112
+								$output = array("1", time(), $_SESSION['user_id']);
113
+								
114
+								$template->cargarPlantilla($input, $output, "template_add_post");
115
+								$template->mostrarPlantilla();
116
+							   	break;
117
+							case "photo":
118
+								$input = array("{type}", "{date}", "{id_user}");
119
+								$output = array("2", time(), $_SESSION['user_id']);
120
+								
121
+								$template->cargarPlantilla($input, $output, "template_add_photo");
122
+								$template->mostrarPlantilla();							   
123
+							   	break;
124
+							case "quote":
125
+							   	$input = array("{type}", "{date}", "{id_user}");
126
+								$output = array("3", time(), $_SESSION['user_id']);
127
+								
128
+								$template->cargarPlantilla($input, $output, "template_add_quote");
129
+								$template->mostrarPlantilla();
130
+							   	break;
131
+							case "url":
132
+							   	$input = array("{type}", "{date}", "{id_user}");
133
+								$output = array("4", time(), $_SESSION['user_id']);
134
+								
135
+								$template->cargarPlantilla($input, $output, "template_add_link");
136
+								$template->mostrarPlantilla();
137
+							   	break;
138
+							case "conversation":
139
+							   	$input = array("{type}", "{date}", "{id_user}");
140
+								$output = array("5", time(), $_SESSION['user_id']);
141
+								
142
+								$template->cargarPlantilla($input, $output, "template_add_conversation");
143
+								$template->mostrarPlantilla();
144
+							   	break;
145
+							case "video":
146
+							   	$input = array("{type}", "{date}", "{id_user}");
147
+								$output = array("6", time(), $_SESSION['user_id']);
148
+								
149
+								$template->cargarPlantilla($input, $output, "template_add_video");
150
+								$template->mostrarPlantilla();
151
+							   	break;
152
+							case "mp3":
153
+							   	$input = array("{type}", "{date}", "{id_user}");
154
+								$output = array("7", time(), $_SESSION['user_id']);
155
+								
156
+								$template->cargarPlantilla($input, $output, "template_add_mp3");
157
+								$template->mostrarPlantilla();
158
+							   	break;
159
+							default:
160
+								echo "<div class=\"error\">The specified type is not valid.</div>";
161
+								break;
162
+						}
163
+?>
164
+									<p>
165
+										<input class="submit" type="submit" name="btnAdd" value="Create post" />&nbsp;&nbsp;
166
+										<a href="#" onclick="if (confirm('Cancel editing this post?  All changes will be lost.'))
167
+	{location.href='index.php';}; return false;">Cancel</a>
168
+									</p>
169
+								</fieldset>
170
+							</form>
171
+						</div>
172
+					</div> 
173
+				</div> 		
174
+				<div id="pie">
175
+					<p>
176
+						<a href="http://www.gelatocms.com/" title="gelato CMS" target="_blank">gelato CMS</a> :: PHP/MySQL Tumblelog Content Management System.
177
+					</p>
178
+				</div>				
179
+			</div>
180
+		</body>
181
+		</html>
182
+<?
183
+	}
184
+} else {
185
+	header("Location: ".$conf->urlGelato."/login.php");
186
+}
187
+?>

+ 144 - 0
admin/admin.php View File

@@ -0,0 +1,144 @@
1
+<?
2
+/* ===========================
3
+
4
+  gelato CMS development version
5
+  http://www.gelatocms.com/
6
+
7
+  gelato CMS is a free software licensed under GPL (General public license)
8
+
9
+  =========================== */
10
+?>
11
+<?
12
+require_once('../config.php');
13
+include("../classes/user.class.php");
14
+require_once("../classes/configuration.class.php");
15
+
16
+$user = new user();
17
+$conf = new configuration();
18
+
19
+if ($user->isAdmin()) {
20
+	
21
+?>
22
+	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
23
+	<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
24
+	<head>
25
+		<title>gelato</title>
26
+		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
27
+		<link rel="shortcut icon" href="<?=$conf->urlGelato;?>/images/favicon.ico" />
28
+		<script language="javascript" type="text/javascript" src="<?=$conf->urlGelato;?>/admin/scripts/mootools.js"></script>
29
+		<style type="text/css" media="screen">	
30
+			@import "<?=$conf->urlGelato;?>/admin/css/style-codice.css";
31
+		</style>
32
+	</head>
33
+	<body>
34
+		<div id="div-process" style="display:none;">Processing request...</div>
35
+		<div id="titulo">
36
+			<img src="<?=$conf->urlGelato;?>/images/logo.jpg" alt="gelato CMS" title="gelato CMS" />	
37
+		</div>
38
+		
39
+		<div id="menuContenedor">
40
+			<ul>
41
+				<li id="active"><a href="#" id="current">Users</a></li>
42
+					<ul>
43
+						<li><a href="user.php">Add</a></li>
44
+						<li id="subactive"><a href="#" id="subcurrent">Manage</a></li>
45
+					</ul>
46
+				</li>
47
+				<li><a href="index.php">Control Panel</a></li>
48
+			</ul>
49
+		</div>
50
+		
51
+		<div id="contenido">
52
+			<div class="center">
53
+				<div  class="ventana">
54
+					<p class="titulo"><span class="handle">Manage the user information</span></p>
55
+					<div id="formulario">
56
+<?					
57
+						if (isset($_GET["added"])) {
58
+							if ($_GET["added"]=="true") {
59
+								echo "<div class=\"exito\">The user has been added successfully.</div>";
60
+							}
61
+						}
62
+						
63
+						if (isset($_GET["delete"])) {
64
+							if ($_GET["delete"]=="true") {
65
+								echo "<div class=\"exito\">The user has been eliminated successfully.</div>";
66
+							}
67
+						}
68
+						
69
+						if (isset($_GET["modified"])) {
70
+							if ($_GET["modified"]=="true") {
71
+								echo "<div class=\"exito\">The user has been modified successfully.</div>";
72
+							}
73
+						}
74
+						
75
+						if (isset($_GET["error"])) {
76
+							if ($_GET["error"]==1) {
77
+								echo "<div class=\"error\">The username is not available.</div>";
78
+							} elseif ($_GET["error"]==2) {
79
+								echo "<div class=\"error\"><strong>Error on the database server: </strong>".$_GET["des"]."</div>";
80
+							}
81
+						}
82
+?>						
83
+						<p>
84
+							<table class="sortable" id="admin-tabla">
85
+								<caption>Authors list.</caption>
86
+								<thead>
87
+									<tr>
88
+										<th scope="col">Login</th>
89
+										<th scope="col">Name</th>
90
+										<th colspan="2" scope="col" class="unsortable">Actions</th>
91
+									</tr>
92
+								</thead>
93
+								<tbody>
94
+<?	
95
+						$odd=false;
96
+						$rs = $user->getUsers();
97
+						if ($user->contarRegistros()>0) {
98
+							while($register = mysql_fetch_array($rs)) {
99
+?>
100
+								<tr <? if ($odd) { echo 'class="odd"'; } $odd=!$odd; ?>>
101
+									<td>
102
+										<? echo $register["login"]."\n"; ?>
103
+									</td>
104
+									<td>
105
+										<? echo $register["name"]."\n"; ?>
106
+									</td>
107
+									<td>
108
+										<a href="user.php?edit=<?=$register["id_user"]; ?>">Edit</a>
109
+									</td>
110
+									<td>
111
+										<a href="user.php?delete=<?=$register["id_user"]; ?>">Delete</a>	
112
+									</td>
113
+								</tr>
114
+<?
115
+							}
116
+						}
117
+						else {
118
+?>
119
+							<tr> 
120
+								<td colspan="4"><div class="exito">No users available.</div></td>
121
+							</tr>
122
+<?
123
+						}
124
+?>
125
+								</tbody>
126
+							</table>
127
+						</p>
128
+						<p>&nbsp;</p>
129
+					</div>
130
+				</div> 
131
+			</div> 		
132
+			<div id="pie">
133
+				<p>
134
+					<a href="http://www.gelatocms.com/" title="gelato CMS" target="_blank">gelato CMS</a> :: PHP/MySQL Tumblelog Content Management System.
135
+				</p>
136
+			</div>				
137
+		</div>
138
+	</body>
139
+	</html>
140
+<?
141
+} else {
142
+	header("Location: ".$conf->urlGelato."/login.php");
143
+}
144
+?>

+ 40 - 0
admin/ajax.php View File

@@ -0,0 +1,40 @@
1
+<?
2
+/* ===========================
3
+
4
+  gelato CMS development version
5
+  http://www.gelatocms.com/
6
+
7
+  gelato CMS is a free software licensed under GPL (General public license)
8
+
9
+  =========================== */
10
+?>
11
+<?
12
+	require_once('../config.php');
13
+	include("../classes/user.class.php");
14
+	$user = new user();
15
+	if ($user->isAdmin()) {
16
+		if ($_GET["action"]) {
17
+			
18
+			if ($_GET["action"] == "close") {
19
+				session_start();
20
+				if ($user->closeSession()) {
21
+					echo "&nbsp;ending session...";
22
+				} else {
23
+					echo "&nbsp;failure ending session...";
24
+				}
25
+			}	// $_GET["action"] == "close"
26
+			
27
+			if ($_GET["action"] == "verify") {
28
+				if ($_GET["login"]=="") {
29
+					echo "<div class=\"error\">Required field cannot be left blank.</div>";
30
+				} else {
31
+					if (!$user->userExist($_GET["login"])) {
32
+						echo "<div class=\"exito\">Username available.</div>";
33
+					} else {
34
+						echo "<div class=\"error\">The username is not available.</div>";
35
+					}
36
+				}
37
+			}	// $_GET["action"] == "verify"			
38
+		}	// $_GET["action"]
39
+	}	// $user->isAdmin()
40
+?>

+ 64 - 0
admin/close.php View File

@@ -0,0 +1,64 @@
1
+<?
2
+/* ===========================
3
+
4
+  gelato CMS development version
5
+  http://www.gelatocms.com/
6
+
7
+  gelato CMS is a free software licensed under GPL (General public license)
8
+
9
+  =========================== */
10
+?>
11
+<?
12
+require_once('../config.php');
13
+include("../classes/user.class.php");
14
+
15
+session_start();
16
+$user = new user();
17
+$user->closeSession()
18
+?>
19
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
20
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
21
+<head>
22
+	<title>gelato</title>
23
+	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
24
+	<link rel="shortcut icon" href="../images/favicon.ico" />
25
+	<meta http-equiv="Refresh" content="3;URL=../login.php" />
26
+	<style type="text/css" media="screen">	
27
+		@import "css/style-codice.css";
28
+	</style>
29
+</head>	
30
+<body>
31
+
32
+	<div id="titulo">
33
+		<img src="../images/logo.jpg" alt="gelato CMS" title="gelato CMS" />	
34
+	</div>
35
+
36
+	<div id="contenido">
37
+		<div class="piccola">
38
+			<div  class="ventana">
39
+				<p class="titulo"><span class="handle" style="cursor:move;">Closing session</span></p>
40
+				<p>
41
+<?
42
+if (@session_destroy()) {
43
+?>
44
+		</p>
45
+				<h3>Ending session...</h3>
46
+<?	
47
+} else {	
48
+?>
49
+		<h3>Has happened an error when closing the session.</h3>
50
+<?	
51
+}	
52
+?> 
53
+				</p>
54
+			</div>
55
+		</div>
56
+		<div id="pie">
57
+			<p>
58
+				<a href="http://www.gelatocms.com/" title="gelato CMS" target="_blank">gelato CMS</a> :: PHP/MySQL Tumblelog Content Management System.
59
+			</p>
60
+		</div>
61
+	</div>	
62
+</div>
63
+</body>
64
+</html>

+ 337 - 0
admin/css/style-codice.css View File

@@ -0,0 +1,337 @@
1
+/* Estructura */
2
+
3
+*{ padding:0; margin:0;}
4
+
5
+body {
6
+	background-color: #F7F7F7;
7
+	color: #333333;
8
+	font-family: "Trebuchet MS", Vendana, Arial, sans-serif;
9
+	font-size: 10pt;
10
+	font-weight: normal;
11
+	margin: auto;
12
+}
13
+
14
+#div-process {
15
+	padding-left: 22px;	
16
+	font: normal 14.5px/17px georgia, "times new roman", serif;
17
+	background: url(../../images/proceso.gif) no-repeat 0% 10%;
18
+	float: right;
19
+	height: 20px;
20
+	width: 150px;
21
+	border: 1px solid #000066;
22
+	background-color:#FFFFCC;
23
+	color:#011940;
24
+}
25
+
26
+#titulo {
27
+	background-color: #FcFcFc;
28
+	border:1px solid #FcFcFc;
29
+	margin-top: 0;
30
+	padding-top: 0;
31
+	width: 100%;
32
+}
33
+
34
+#contenido {
35
+	background-color: #F7F7F7;
36
+	border:1px solid #F7F7F7;
37
+}
38
+	.piccola{ width:30%; margin: 0 auto;}
39
+	.center{ width:60%; margin: 0 auto;}	
40
+	.right{ width:40%; float:right;}
41
+	.left{ width: 60%; float:left; }
42
+	.ventana{ margin:10px; padding:0 0 4px 0; border:1px solid #999; background-color:#DEDEDE;}
43
+		.titulo{ background-color:#336699; color:#FFFFFF; font-weight:bold; text-align:center; border-bottom:2px solid #FFF;}
44
+
45
+#contenido h3 {
46
+	font: normal 17.5px/17px georgia, "times new roman", serif;
47
+	margin-bottom: 0;
48
+	padding-bottom: 0;
49
+}
50
+
51
+#pie {
52
+	clear: both;
53
+	color: #808080;
54
+	background: #FFF;
55
+	font-size: 0.8em;
56
+	text-align: right;
57
+	padding: 9px 10px 9px 0;
58
+	margin: 10px 5px 10px 5px;
59
+	border: 1px solid #ccc;
60
+	width:60%;
61
+	margin: 0 auto;
62
+	margin-top:50px;
63
+	text-align:center;	
64
+}
65
+
66
+#pie a {
67
+	text-decoration: underline;
68
+	color: #3A6794;
69
+}
70
+
71
+#pie a:hover {
72
+	color: #000;
73
+}
74
+
75
+/* Mensajes para el usuario */
76
+
77
+.error {
78
+	width:80%;
79
+	background: #FFF7F2 url('../../images/error.png') 15px center no-repeat;
80
+	border-top: 2px solid #CC0000;
81
+	border-bottom: 2px solid #CC0000;
82
+	margin: 0 auto;
83
+	padding: 5px 20px 5px 45px;
84
+}
85
+
86
+.exito {
87
+	width:80%;
88
+	background: #F4FBF5 url('../../images/information.png') 15px center no-repeat;
89
+	border-top: 2px solid #006600;
90
+	border-bottom: 2px solid #006600;
91
+	margin: 0 auto;
92
+	padding: 5px 20px 5px 45px;
93
+}
94
+
95
+.info {
96
+	width:80%;
97
+	background: #FFF6BF url('../../images/icon_info.gif') 15px center no-repeat;
98
+	border-top: 2px solid #FFD324;
99
+	border-bottom: 2px solid #FFD324;
100
+	margin: 0 auto;
101
+	padding: 5px 20px 5px 45px;
102
+}
103
+
104
+/* Formularios */
105
+
106
+#formulario {
107
+	margin: 30px;
108
+	padding: 0px;
109
+	border: 0px;
110
+}
111
+
112
+#formulario fieldset{ border: none;}
113
+#formulario label{ width:100px; text-align:left;}
114
+	label.required { padding-left: 22px; background: url(../../images/required.gif) no-repeat 0% 50%; }	
115
+	label.problem { padding-left: 22px; background: url(../../images/caution.gif) no-repeat 0% 50%; }	
116
+	label.completed { padding-left: 22px; background: url(../../images/complete.gif) no-repeat 0% 50%; }
117
+#formulario p{margin: 8px 0 ;}
118
+.input-text{ width: 100%; border: 1px solid #7591B5; background-color:#fff; margin: 1px; padding: 3px; font: 14px Verdana, Arial, Helvetica, sans-serif;}
119
+.input-corto{ width: 200px; border: 1px solid #7591B5; background-color:#fff; padding: 1px 0;}
120
+.check { border: 1px solid #7591B5; background-color:#fff; }
121
+input:hover { 
122
+		background: #f5f5f5;
123
+		color: #000;	
124
+	}
125
+
126
+
127
+input.submit
128
+{
129
+	width: 200px;
130
+	margin-top: 0.5em;
131
+	margin-bottom: 0.5em;
132
+	text-align: center;
133
+	cursor:pointer;
134
+	border-bottom:solid 2px #000;
135
+	border-right:solid 2px #000;
136
+	border-top:solid 1px #336699;
137
+	border-left:solid 1px #336699;
138
+	background-color:#002255;
139
+	color:#fff;
140
+	font-size:105%;
141
+	text-decoration:none;
142
+	padding:.4em;
143
+	font-weight:bold;
144
+}
145
+
146
+input.submit:hover
147
+{
148
+	text-decoration:none;
149
+	background-color:#003366;
150
+	color:#fff;
151
+}
152
+
153
+.submit_naranja {
154
+	width: 200px;
155
+	margin-top: 0.5em;
156
+	margin-bottom: 0.5em;
157
+	text-align: center;
158
+	cursor:pointer;
159
+	border-bottom:solid 2px #E55C00;
160
+	border-right:solid 2px #E55C00;
161
+	border-top:solid 1px #FF751A;
162
+	border-left:solid 1px #FF751A;
163
+	background-color:#ff6600;
164
+	color:#fff;
165
+	font-size:105%;
166
+	text-decoration:none;
167
+	padding:.4em;
168
+	font-weight:bold;
169
+}
170
+
171
+.submit_naranja:hover {
172
+	text-decoration:none;
173
+	background-color:#FF751A;
174
+	color:#fff;
175
+}
176
+
177
+.submit_normal_azul {
178
+	border-bottom:solid 2px #000;
179
+	border-right:solid 2px #000;
180
+	border-top:solid 1px #336699;
181
+	border-left:solid 1px #336699;
182
+	background-color:#002255;
183
+	color:#fff;
184
+	margin-left:10px;
185
+}
186
+
187
+.submit_normal_azul:hover {
188
+	text-decoration:none;
189
+	background-color:#003366;
190
+	color:#fff;
191
+}
192
+
193
+
194
+/* Menu */
195
+
196
+#menuContenedor a {
197
+	text-decoration: none;
198
+}
199
+
200
+#menuContenedor ul
201
+{
202
+	padding: 0;
203
+	margin: 0;
204
+	list-style-type: none;
205
+	position: relative;
206
+}
207
+
208
+#menuContenedor ul li { 
209
+	display: inline; 
210
+	margin: 0 0 0px;
211
+}
212
+
213
+/*1st level elements*/
214
+#menuContenedor ul
215
+{
216
+	border-top: 1px solid #FcFcFc;
217
+	border-bottom: 1px solid #36c;
218
+	background-color: #FcFcFc;
219
+	padding: 2px 0;
220
+	margin-bottom: 2em;
221
+}
222
+
223
+#menuContenedor ul a,
224
+#menuContenedor ul a:link,
225
+#menuContenedor ul a:visited
226
+{
227
+	background: #900;
228
+	border: 1px solid #FFF;
229
+	bottom: 2px;
230
+	color: #FFF;
231
+	height: 1em;
232
+	margin:0;
233
+	margin-left: 15px;
234
+	padding: 2px 4px 2px 4px;
235
+	position: relative;
236
+	right: 2px;
237
+	text-decoration: none;
238
+	z-index:1;
239
+}
240
+
241
+#menuContenedor ul a:hover,
242
+#menuContenedor ul a:focus
243
+{
244
+	background: #C00;
245
+	bottom: 1px;
246
+	color: #FFF;
247
+	position: relative;
248
+	right: 1px;
249
+}
250
+
251
+/*current Link*/
252
+#menuContenedor ul a#current,
253
+#menuContenedor ul a#current:link,
254
+#menuContenedor ul a#current:visited { 
255
+	background: #369;
256
+	border-bottom: none;
257
+	border-left: 1px solid #9CC;
258
+	border-right: 1px solid #9CC;
259
+	border-top: 1px solid #9CC;
260
+	bottom: 0;
261
+	color: #FFF;
262
+	cursor: text;
263
+	margin: 0;
264
+	margin-left: 15px;
265
+	padding: 2px 5px 0 5px;
266
+	position: relative;
267
+	right: 0;
268
+ }
269
+
270
+/*Second and subsequent levels*/
271
+#menuContenedor ul ul
272
+{
273
+	font-size: 80%;
274
+	position: absolute;
275
+	top: 20px;
276
+	left: 0;
277
+	width: 100%;
278
+	border-top: none;
279
+	background-color: #369;
280
+	height: 2em;
281
+}
282
+
283
+#menuContenedor ul ul li { display: inline; }
284
+
285
+#menuContenedor ul ul a,
286
+#menuContenedor ul ul a:link,
287
+#menuContenedor ul ul a:visited
288
+{
289
+	background-color: #95B1BB;
290
+	border: 1px solid black;
291
+	color: black;
292
+	top: 12px;
293
+}
294
+
295
+#menuContenedor ul ul a:hover,
296
+#menuContenedor ul ul a:focus
297
+{
298
+	background-color: #9CD4F7;
299
+	border: 1px solid #000000;
300
+	color: black;
301
+}
302
+
303
+/*current Link*/
304
+#menuContenedor ul ul a#subcurrent,
305
+#menuContenedor ul ul a#subcurrent:link,
306
+#menuContenedor ul ul a#subcurrent:visited { 
307
+	background-color: #F7F7F7;
308
+	border: 1px solid #F7F7F7;
309
+	color: black;
310
+	cursor: text;
311
+	margin: 0;
312
+	margin-left: 15px;	
313
+	position: relative;
314
+	right: 0;
315
+}
316
+
317
+#menu {
318
+	display:block;
319
+	top:50px;
320
+}
321
+
322
+	.opcion {
323
+		float: left;		
324
+		margin-left: 15px;
325
+		padding-right: 5px;
326
+	}
327
+	
328
+		.opcion img {
329
+			display: block;
330
+			margin-left: auto;
331
+			margin-right: auto;
332
+			border: 0;
333
+		}
334
+
335
+h2 {color: #9a4723; margin:0px;}
336
+
337
+legend {color: #9a4723; margin:0px; font-size:large;}

File diff suppressed because it is too large
+ 158 - 0
admin/index.php


File diff suppressed because it is too large
+ 2 - 0
admin/scripts/mootools.js


BIN
admin/scripts/player.swf View File


+ 9 - 0
admin/scripts/tiny_mce/blank.htm View File

@@ -0,0 +1,9 @@
1
+<html xmlns="http://www.w3.org/1999/xhtml">
2
+<head>
3
+	<title>blank_page</title>
4
+	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5
+</head>
6
+<body class="mceContentBody">
7
+
8
+</body>
9
+</html>

+ 41 - 0
admin/scripts/tiny_mce/langs/en.js View File

@@ -0,0 +1,41 @@
1
+// UK lang variables
2
+
3
+tinyMCE.addToLang('',{
4
+bold_desc : 'Bold (Ctrl+B)',
5
+italic_desc : 'Italic (Ctrl+I)',
6
+underline_desc : 'Underline (Ctrl+U)',
7
+striketrough_desc : 'Strikethrough',
8
+justifyleft_desc : 'Align left',
9
+justifycenter_desc : 'Align center',
10
+justifyright_desc : 'Align right',
11
+justifyfull_desc : 'Align full',
12
+bullist_desc : 'Unordered list',
13
+numlist_desc : 'Ordered list',
14
+outdent_desc : 'Outdent',
15
+indent_desc : 'Indent',
16
+undo_desc : 'Undo (Ctrl+Z)',
17
+redo_desc : 'Redo (Ctrl+Y)',
18
+link_desc : 'Insert/edit link',
19
+unlink_desc : 'Unlink',
20
+image_desc : 'Insert/edit image',
21
+cleanup_desc : 'Cleanup messy code',
22
+focus_alert : 'A editor instance must be focused before using this command.',
23
+edit_confirm : 'Do you want to use the WYSIWYG mode for this textarea?',
24
+insert_link_title : 'Insert/edit link',
25
+insert : 'Insert',
26
+update : 'Update',
27
+cancel : 'Cancel',
28
+insert_link_url : 'Link URL',
29
+insert_link_target : 'Target',
30
+insert_link_target_same : 'Open link in the same window',
31
+insert_link_target_blank : 'Open link in a new window',
32
+insert_image_title : 'Insert/edit image',
33
+insert_image_src : 'Image URL',
34
+insert_image_alt : 'Image description',
35
+help_desc : 'Help',
36
+bold_img : "bold.gif",
37
+italic_img : "italic.gif",
38
+underline_img : "underline.gif",
39
+clipboard_msg : 'Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?',
40
+popup_blocked : 'Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.'
41
+});

+ 9 - 0
admin/scripts/tiny_mce/langs/readme.txt View File

@@ -0,0 +1,9 @@
1
+Beginning with version 2.0.5 the language packs are no
2
+longer included with the core distribution.
3
+Language packs can be downloaded from the TinyMCE website:
4
+http://tinymce.moxiecode.com/download.php
5
+
6
+The language pack codes are based on ISO-639-1:
7
+http://www.loc.gov/standards/iso639-2/englangn.html
8
+
9
+Plrease try using entities if possible. Like &aring; etc for non a-z characters.

+ 504 - 0
admin/scripts/tiny_mce/license.txt View File

@@ -0,0 +1,504 @@
1
+		  GNU LESSER GENERAL PUBLIC LICENSE
2
+		       Version 2.1, February 1999
3
+
4
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
5
+ 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
6
+ Everyone is permitted to copy and distribute verbatim copies
7
+ of this license document, but changing it is not allowed.
8
+
9
+[This is the first released version of the Lesser GPL.  It also counts
10
+ as the successor of the GNU Library Public License, version 2, hence
11
+ the version number 2.1.]
12
+
13
+			    Preamble
14
+
15
+  The licenses for most software are designed to take away your
16
+freedom to share and change it.  By contrast, the GNU General Public
17
+Licenses are intended to guarantee your freedom to share and change
18
+free software--to make sure the software is free for all its users.
19
+
20
+  This license, the Lesser General Public License, applies to some
21
+specially designated software packages--typically libraries--of the
22
+Free Software Foundation and other authors who decide to use it.  You
23
+can use it too, but we suggest you first think carefully about whether
24
+this license or the ordinary General Public License is the better
25
+strategy to use in any particular case, based on the explanations below.
26
+
27
+  When we speak of free software, we are referring to freedom of use,
28
+not price.  Our General Public Licenses are designed to make sure that
29
+you have the freedom to distribute copies of free software (and charge
30
+for this service if you wish); that you receive source code or can get
31
+it if you want it; that you can change the software and use pieces of
32
+it in new free programs; and that you are informed that you can do
33
+these things.
34
+
35
+  To protect your rights, we need to make restrictions that forbid
36
+distributors to deny you these rights or to ask you to surrender these
37
+rights.  These restrictions translate to certain responsibilities for
38
+you if you distribute copies of the library or if you modify it.
39
+
40
+  For example, if you distribute copies of the library, whether gratis
41
+or for a fee, you must give the recipients all the rights that we gave
42
+you.  You must make sure that they, too, receive or can get the source
43
+code.  If you link other code with the library, you must provide
44
+complete object files to the recipients, so that they can relink them
45
+with the library after making changes to the library and recompiling
46
+it.  And you must show them these terms so they know their rights.
47
+
48
+  We protect your rights with a two-step method: (1) we copyright the
49
+library, and (2) we offer you this license, which gives you legal
50
+permission to copy, distribute and/or modify the library.
51
+
52
+  To protect each distributor, we want to make it very clear that
53
+there is no warranty for the free library.  Also, if the library is
54
+modified by someone else and passed on, the recipients should know
55
+that what they have is not the original version, so that the original
56
+author's reputation will not be affected by problems that might be
57
+introduced by others.
58
+
59
+  Finally, software patents pose a constant threat to the existence of
60
+any free program.  We wish to make sure that a company cannot
61
+effectively restrict the users of a free program by obtaining a
62
+restrictive license from a patent holder.  Therefore, we insist that
63
+any patent license obtained for a version of the library must be
64
+consistent with the full freedom of use specified in this license.
65
+
66
+  Most GNU software, including some libraries, is covered by the
67
+ordinary GNU General Public License.  This license, the GNU Lesser
68
+General Public License, applies to certain designated libraries, and
69
+is quite different from the ordinary General Public License.  We use
70
+this license for certain libraries in order to permit linking those
71
+libraries into non-free programs.
72
+
73
+  When a program is linked with a library, whether statically or using
74
+a shared library, the combination of the two is legally speaking a
75
+combined work, a derivative of the original library.  The ordinary
76
+General Public License therefore permits such linking only if the
77
+entire combination fits its criteria of freedom.  The Lesser General
78
+Public License permits more lax criteria for linking other code with
79
+the library.
80
+
81
+  We call this license the "Lesser" General Public License because it
82
+does Less to protect the user's freedom than the ordinary General
83
+Public License.  It also provides other free software developers Less
84
+of an advantage over competing non-free programs.  These disadvantages
85
+are the reason we use the ordinary General Public License for many
86
+libraries.  However, the Lesser license provides advantages in certain
87
+special circumstances.
88
+
89
+  For example, on rare occasions, there may be a special need to
90
+encourage the widest possible use of a certain library, so that it becomes
91
+a de-facto standard.  To achieve this, non-free programs must be
92
+allowed to use the library.  A more frequent case is that a free
93
+library does the same job as widely used non-free libraries.  In this
94
+case, there is little to gain by limiting the free library to free
95
+software only, so we use the Lesser General Public License.
96
+
97
+  In other cases, permission to use a particular library in non-free
98
+programs enables a greater number of people to use a large body of
99
+free software.  For example, permission to use the GNU C Library in
100
+non-free programs enables many more people to use the whole GNU
101
+operating system, as well as its variant, the GNU/Linux operating
102
+system.
103
+
104
+  Although the Lesser General Public License is Less protective of the
105
+users' freedom, it does ensure that the user of a program that is
106
+linked with the Library has the freedom and the wherewithal to run
107
+that program using a modified version of the Library.
108
+
109
+  The precise terms and conditions for copying, distribution and
110
+modification follow.  Pay close attention to the difference between a
111
+"work based on the library" and a "work that uses the library".  The
112
+former contains code derived from the library, whereas the latter must
113
+be combined with the library in order to run.
114
+
115
+		  GNU LESSER GENERAL PUBLIC LICENSE
116
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
117
+
118
+  0. This License Agreement applies to any software library or other
119
+program which contains a notice placed by the copyright holder or
120
+other authorized party saying it may be distributed under the terms of
121
+this Lesser General Public License (also called "this License").
122
+Each licensee is addressed as "you".
123
+
124
+  A "library" means a collection of software functions and/or data
125
+prepared so as to be conveniently linked with application programs
126
+(which use some of those functions and data) to form executables.
127
+
128
+  The "Library", below, refers to any such software library or work
129
+which has been distributed under these terms.  A "work based on the
130
+Library" means either the Library or any derivative work under
131
+copyright law: that is to say, a work containing the Library or a
132
+portion of it, either verbatim or with modifications and/or translated
133
+straightforwardly into another language.  (Hereinafter, translation is
134
+included without limitation in the term "modification".)
135
+
136
+  "Source code" for a work means the preferred form of the work for
137
+making modifications to it.  For a library, complete source code means
138
+all the source code for all modules it contains, plus any associated
139
+interface definition files, plus the scripts used to control compilation
140
+and installation of the library.
141
+
142
+  Activities other than copying, distribution and modification are not
143
+covered by this License; they are outside its scope.  The act of
144
+running a program using the Library is not restricted, and output from
145
+such a program is covered only if its contents constitute a work based
146
+on the Library (independent of the use of the Library in a tool for
147
+writing it).  Whether that is true depends on what the Library does
148
+and what the program that uses the Library does.
149
+  
150
+  1. You may copy and distribute verbatim copies of the Library's
151
+complete source code as you receive it, in any medium, provided that
152
+you conspicuously and appropriately publish on each copy an
153
+appropriate copyright notice and disclaimer of warranty; keep intact
154
+all the notices that refer to this License and to the absence of any
155
+warranty; and distribute a copy of this License along with the
156
+Library.
157
+
158
+  You may charge a fee for the physical act of transferring a copy,
159
+and you may at your option offer warranty protection in exchange for a
160
+fee.
161
+
162
+  2. You may modify your copy or copies of the Library or any portion
163
+of it, thus forming a work based on the Library, and copy and
164
+distribute such modifications or work under the terms of Section 1
165
+above, provided that you also meet all of these conditions:
166
+
167
+    a) The modified work must itself be a software library.
168
+
169
+    b) You must cause the files modified to carry prominent notices
170
+    stating that you changed the files and the date of any change.
171
+
172
+    c) You must cause the whole of the work to be licensed at no
173
+    charge to all third parties under the terms of this License.
174
+
175
+    d) If a facility in the modified Library refers to a function or a
176
+    table of data to be supplied by an application program that uses
177
+    the facility, other than as an argument passed when the facility
178
+    is invoked, then you must make a good faith effort to ensure that,
179
+    in the event an application does not supply such function or
180
+    table, the facility still operates, and performs whatever part of
181
+    its purpose remains meaningful.
182
+
183
+    (For example, a function in a library to compute square roots has
184
+    a purpose that is entirely well-defined independent of the
185
+    application.  Therefore, Subsection 2d requires that any
186
+    application-supplied function or table used by this function must
187
+    be optional: if the application does not supply it, the square
188
+    root function must still compute square roots.)
189
+
190
+These requirements apply to the modified work as a whole.  If
191
+identifiable sections of that work are not derived from the Library,
192
+and can be reasonably considered independent and separate works in
193
+themselves, then this License, and its terms, do not apply to those
194
+sections when you distribute them as separate works.  But when you
195
+distribute the same sections as part of a whole which is a work based
196
+on the Library, the distribution of the whole must be on the terms of
197
+this License, whose permissions for other licensees extend to the
198
+entire whole, and thus to each and every part regardless of who wrote
199
+it.
200
+
201
+Thus, it is not the intent of this section to claim rights or contest
202
+your rights to work written entirely by you; rather, the intent is to
203
+exercise the right to control the distribution of derivative or
204
+collective works based on the Library.
205
+
206
+In addition, mere aggregation of another work not based on the Library
207
+with the Library (or with a work based on the Library) on a volume of
208
+a storage or distribution medium does not bring the other work under
209
+the scope of this License.
210
+
211
+  3. You may opt to apply the terms of the ordinary GNU General Public
212
+License instead of this License to a given copy of the Library.  To do
213
+this, you must alter all the notices that refer to this License, so
214
+that they refer to the ordinary GNU General Public License, version 2,
215
+instead of to this License.  (If a newer version than version 2 of the
216
+ordinary GNU General Public License has appeared, then you can specify
217
+that version instead if you wish.)  Do not make any other change in
218
+these notices.
219
+
220
+  Once this change is made in a given copy, it is irreversible for
221
+that copy, so the ordinary GNU General Public License applies to all
222
+subsequent copies and derivative works made from that copy.
223
+
224
+  This option is useful when you wish to copy part of the code of
225
+the Library into a program that is not a library.
226
+
227
+  4. You may copy and distribute the Library (or a portion or
228
+derivative of it, under Section 2) in object code or executable form
229
+under the terms of Sections 1 and 2 above provided that you accompany
230
+it with the complete corresponding machine-readable source code, which
231
+must be distributed under the terms of Sections 1 and 2 above on a
232
+medium customarily used for software interchange.
233
+
234
+  If distribution of object code is made by offering access to copy
235
+from a designated place, then offering equivalent access to copy the
236
+source code from the same place satisfies the requirement to
237
+distribute the source code, even though third parties are not
238
+compelled to copy the source along with the object code.
239
+
240
+  5. A program that contains no derivative of any portion of the
241
+Library, but is designed to work with the Library by being compiled or
242
+linked with it, is called a "work that uses the Library".  Such a
243
+work, in isolation, is not a derivative work of the Library, and
244
+therefore falls outside the scope of this License.
245
+
246
+  However, linking a "work that uses the Library" with the Library
247
+creates an executable that is a derivative of the Library (because it
248
+contains portions of the Library), rather than a "work that uses the
249
+library".  The executable is therefore covered by this License.
250
+Section 6 states terms for distribution of such executables.
251
+
252
+  When a "work that uses the Library" uses material from a header file
253
+that is part of the Library, the object code for the work may be a
254
+derivative work of the Library even though the source code is not.
255
+Whether this is true is especially significant if the work can be
256
+linked without the Library, or if the work is itself a library.  The
257
+threshold for this to be true is not precisely defined by law.
258
+
259
+  If such an object file uses only numerical parameters, data
260
+structure layouts and accessors, and small macros and small inline
261
+functions (ten lines or less in length), then the use of the object
262
+file is unrestricted, regardless of whether it is legally a derivative
263
+work.  (Executables containing this object code plus portions of the
264
+Library will still fall under Section 6.)
265
+
266
+  Otherwise, if the work is a derivative of the Library, you may
267
+distribute the object code for the work under the terms of Section 6.
268
+Any executables containing that work also fall under Section 6,
269
+whether or not they are linked directly with the Library itself.
270
+
271
+  6. As an exception to the Sections above, you may also combine or
272
+link a "work that uses the Library" with the Library to produce a
273
+work containing portions of the Library, and distribute that work
274
+under terms of your choice, provided that the terms permit
275
+modification of the work for the customer's own use and reverse
276
+engineering for debugging such modifications.
277
+
278
+  You must give prominent notice with each copy of the work that the
279
+Library is used in it and that the Library and its use are covered by
280
+this License.  You must supply a copy of this License.  If the work
281
+during execution displays copyright notices, you must include the
282
+copyright notice for the Library among them, as well as a reference
283
+directing the user to the copy of this License.  Also, you must do one
284
+of these things:
285
+
286
+    a) Accompany the work with the complete corresponding
287
+    machine-readable source code for the Library including whatever
288
+    changes were used in the work (which must be distributed under
289
+    Sections 1 and 2 above); and, if the work is an executable linked
290
+    with the Library, with the complete machine-readable "work that
291
+    uses the Library", as object code and/or source code, so that the
292
+    user can modify the Library and then relink to produce a modified
293
+    executable containing the modified Library.  (It is understood
294
+    that the user who changes the contents of definitions files in the
295
+    Library will not necessarily be able to recompile the application
296
+    to use the modified definitions.)
297
+
298
+    b) Use a suitable shared library mechanism for linking with the
299
+    Library.  A suitable mechanism is one that (1) uses at run time a
300
+    copy of the library already present on the user's computer system,
301
+    rather than copying library functions into the executable, and (2)
302
+    will operate properly with a modified version of the library, if
303
+    the user installs one, as long as the modified version is
304
+    interface-compatible with the version that the work was made with.
305
+
306
+    c) Accompany the work with a written offer, valid for at
307
+    least three years, to give the same user the materials
308
+    specified in Subsection 6a, above, for a charge no more
309
+    than the cost of performing this distribution.
310
+
311
+    d) If distribution of the work is made by offering access to copy
312
+    from a designated place, offer equivalent access to copy the above
313
+    specified materials from the same place.
314
+
315
+    e) Verify that the user has already received a copy of these
316
+    materials or that you have already sent this user a copy.
317
+
318
+  For an executable, the required form of the "work that uses the
319
+Library" must include any data and utility programs needed for
320
+reproducing the executable from it.  However, as a special exception,
321
+the materials to be distributed need not include anything that is
322
+normally distributed (in either source or binary form) with the major
323
+components (compiler, kernel, and so on) of the operating system on
324
+which the executable runs, unless that component itself accompanies
325
+the executable.
326
+
327
+  It may happen that this requirement contradicts the license
328
+restrictions of other proprietary libraries that do not normally
329
+accompany the operating system.  Such a contradiction means you cannot
330
+use both them and the Library together in an executable that you
331
+distribute.
332
+
333
+  7. You may place library facilities that are a work based on the
334
+Library side-by-side in a single library together with other library
335
+facilities not covered by this License, and distribute such a combined
336
+library, provided that the separate distribution of the work based on
337
+the Library and of the other library facilities is otherwise
338
+permitted, and provided that you do these two things:
339
+
340
+    a) Accompany the combined library with a copy of the same work
341
+    based on the Library, uncombined with any other library
342
+    facilities.  This must be distributed under the terms of the
343
+    Sections above.
344
+
345
+    b) Give prominent notice with the combined library of the fact
346
+    that part of it is a work based on the Library, and explaining
347
+    where to find the accompanying uncombined form of the same work.
348
+
349
+  8. You may not copy, modify, sublicense, link with, or distribute
350
+the Library except as expressly provided under this License.  Any
351
+attempt otherwise to copy, modify, sublicense, link with, or
352
+distribute the Library is void, and will automatically terminate your
353
+rights under this License.  However, parties who have received copies,
354
+or rights, from you under this License will not have their licenses
355
+terminated so long as such parties remain in full compliance.
356
+
357
+  9. You are not required to accept this License, since you have not
358
+signed it.  However, nothing else grants you permission to modify or
359
+distribute the Library or its derivative works.  These actions are
360
+prohibited by law if you do not accept this License.  Therefore, by
361
+modifying or distributing the Library (or any work based on the
362
+Library), you indicate your acceptance of this License to do so, and
363
+all its terms and conditions for copying, distributing or modifying
364
+the Library or works based on it.
365
+
366
+  10. Each time you redistribute the Library (or any work based on the
367
+Library), the recipient automatically receives a license from the
368
+original licensor to copy, distribute, link with or modify the Library
369
+subject to these terms and conditions.  You may not impose any further
370
+restrictions on the recipients' exercise of the rights granted herein.
371
+You are not responsible for enforcing compliance by third parties with
372
+this License.
373
+
374
+  11. If, as a consequence of a court judgment or allegation of patent
375
+infringement or for any other reason (not limited to patent issues),
376
+conditions are imposed on you (whether by court order, agreement or
377
+otherwise) that contradict the conditions of this License, they do not
378
+excuse you from the conditions of this License.  If you cannot
379
+distribute so as to satisfy simultaneously your obligations under this
380
+License and any other pertinent obligations, then as a consequence you
381
+may not distribute the Library at all.  For example, if a patent
382
+license would not permit royalty-free redistribution of the Library by
383
+all those who receive copies directly or indirectly through you, then
384
+the only way you could satisfy both it and this License would be to
385
+refrain entirely from distribution of the Library.
386
+
387
+If any portion of this section is held invalid or unenforceable under any
388
+particular circumstance, the balance of the section is intended to apply,
389
+and the section as a whole is intended to apply in other circumstances.
390
+
391
+It is not the purpose of this section to induce you to infringe any
392
+patents or other property right claims or to contest validity of any
393
+such claims; this section has the sole purpose of protecting the
394
+integrity of the free software distribution system which is
395
+implemented by public license practices.  Many people have made
396
+generous contributions to the wide range of software distributed
397
+through that system in reliance on consistent application of that
398
+system; it is up to the author/donor to decide if he or she is willing
399
+to distribute software through any other system and a licensee cannot
400
+impose that choice.
401
+
402
+This section is intended to make thoroughly clear what is believed to
403
+be a consequence of the rest of this License.
404
+
405
+  12. If the distribution and/or use of the Library is restricted in
406
+certain countries either by patents or by copyrighted interfaces, the
407
+original copyright holder who places the Library under this License may add
408
+an explicit geographical distribution limitation excluding those countries,
409
+so that distribution is permitted only in or among countries not thus
410
+excluded.  In such case, this License incorporates the limitation as if
411
+written in the body of this License.
412
+
413
+  13. The Free Software Foundation may publish revised and/or new
414
+versions of the Lesser General Public License from time to time.
415
+Such new versions will be similar in spirit to the present version,
416
+but may differ in detail to address new problems or concerns.
417
+
418
+Each version is given a distinguishing version number.  If the Library
419
+specifies a version number of this License which applies to it and
420
+"any later version", you have the option of following the terms and
421
+conditions either of that version or of any later version published by
422
+the Free Software Foundation.  If the Library does not specify a
423
+license version number, you may choose any version ever published by
424
+the Free Software Foundation.
425
+
426
+  14. If you wish to incorporate parts of the Library into other free
427
+programs whose distribution conditions are incompatible with these,
428
+write to the author to ask for permission.  For software which is
429
+copyrighted by the Free Software Foundation, write to the Free
430
+Software Foundation; we sometimes make exceptions for this.  Our
431
+decision will be guided by the two goals of preserving the free status
432
+of all derivatives of our free software and of promoting the sharing
433
+and reuse of software generally.
434
+
435
+			    NO WARRANTY
436
+
437
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
438
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
439
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
440
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
441
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
442
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
443
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
444
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
445
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
446
+
447
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
448
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
449
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
450
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
451
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
452
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
453
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
454
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
455
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
456
+DAMAGES.
457
+
458
+		     END OF TERMS AND CONDITIONS
459
+
460
+           How to Apply These Terms to Your New Libraries
461
+
462
+  If you develop a new library, and you want it to be of the greatest
463
+possible use to the public, we recommend making it free software that
464
+everyone can redistribute and change.  You can do so by permitting
465
+redistribution under these terms (or, alternatively, under the terms of the
466
+ordinary General Public License).
467
+
468
+  To apply these terms, attach the following notices to the library.  It is
469
+safest to attach them to the start of each source file to most effectively
470
+convey the exclusion of warranty; and each file should have at least the
471
+"copyright" line and a pointer to where the full notice is found.
472
+
473
+    <one line to give the library's name and a brief idea of what it does.>
474
+    Copyright (C) <year>  <name of author>
475
+
476
+    This library is free software; you can redistribute it and/or
477
+    modify it under the terms of the GNU Lesser General Public
478
+    License as published by the Free Software Foundation; either
479
+    version 2.1 of the License, or (at your option) any later version.
480
+
481
+    This library is distributed in the hope that it will be useful,
482
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
483
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
484
+    Lesser General Public License for more details.
485
+
486
+    You should have received a copy of the GNU Lesser General Public
487
+    License along with this library; if not, write to the Free Software
488
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
489
+
490
+Also add information on how to contact you by electronic and paper mail.
491
+
492
+You should also get your employer (if you work as a programmer) or your
493
+school, if any, to sign a "copyright disclaimer" for the library, if
494
+necessary.  Here is a sample; alter the names:
495
+
496
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
497
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
498
+
499
+  <signature of Ty Coon>, 1 April 1990
500
+  Ty Coon, President of Vice
501
+
502
+That's all there is to it!
503
+
504
+

+ 23 - 0
admin/scripts/tiny_mce/plugins/advhr/css/advhr.css View File

@@ -0,0 +1,23 @@
1
+input.radio {
2
+	border: 1px none #000000;
3
+	background-color: transparent;
4
+	vertical-align: middle;
5
+}
6
+
7
+.panel_wrapper div.current {
8
+	height: 80px;
9
+}
10
+
11
+#width {
12
+	width: 50px;
13
+	vertical-align: middle;
14
+}
15
+
16
+#width2 {
17
+	width: 50px;
18
+	vertical-align: middle;
19
+}
20
+
21
+#size {
22
+	width: 100px;
23
+}

File diff suppressed because it is too large
+ 1 - 0
admin/scripts/tiny_mce/plugins/advhr/editor_plugin.js


+ 90 - 0
admin/scripts/tiny_mce/plugins/advhr/editor_plugin_src.js View File

@@ -0,0 +1,90 @@
1
+/**
2
+ * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
3
+ *
4
+ * @author Moxiecode
5
+ * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
6
+ */
7
+
8
+/* Import plugin specific language pack */
9
+tinyMCE.importPluginLanguagePack('advhr');
10
+
11
+var TinyMCE_AdvancedHRPlugin = {
12
+	getInfo : function() {
13
+		return {
14
+			longname : 'Advanced HR',
15
+			author : 'Moxiecode Systems AB',
16
+			authorurl : 'http://tinymce.moxiecode.com',
17
+			infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr',
18
+			version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
19
+		}
20
+	},
21
+
22
+	getControlHTML : function(cn) {
23
+		switch (cn) {
24
+			case "advhr":
25
+				return tinyMCE.getButtonHTML(cn, 'lang_insert_advhr_desc', '{$pluginurl}/images/advhr.gif', 'mceAdvancedHr');
26
+		}
27
+
28
+		return "";
29
+	},
30
+
31
+	/**
32
+	 * Executes the mceAdvanceHr command.
33
+	 */
34
+	execCommand : function(editor_id, element, command, user_interface, value) {
35
+		// Handle commands
36
+		switch (command) {
37
+			case "mceAdvancedHr":
38
+				var template = new Array();
39
+
40
+				template['file']   = '../../plugins/advhr/rule.htm'; // Relative to theme
41
+				template['width']  = 250;
42
+				template['height'] = 160;
43
+
44
+				template['width']  += tinyMCE.getLang('lang_advhr_delta_width', 0);
45
+				template['height'] += tinyMCE.getLang('lang_advhr_delta_height', 0);
46
+
47
+				var size = "", width = "", noshade = "";
48
+				if (tinyMCE.selectedElement != null && tinyMCE.selectedElement.nodeName.toLowerCase() == "hr") {
49
+					tinyMCE.hrElement = tinyMCE.selectedElement;
50
+
51
+					if (tinyMCE.hrElement) {
52
+						size    = tinyMCE.hrElement.getAttribute('size') ? tinyMCE.hrElement.getAttribute('size') : "";
53
+						width   = tinyMCE.hrElement.getAttribute('width') ? tinyMCE.hrElement.getAttribute('width') : "";
54
+						noshade = tinyMCE.hrElement.getAttribute('noshade') ? tinyMCE.hrElement.getAttribute('noshade') : "";
55
+					}
56
+
57
+					tinyMCE.openWindow(template, {editor_id : editor_id, size : size, width : width, noshade : noshade, mceDo : 'update'});
58
+				} else {
59
+					if (tinyMCE.isMSIE) {
60
+						tinyMCE.execInstanceCommand(editor_id, 'mceInsertContent', false,'<hr />');
61
+					} else {
62
+						tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes", size : size, width : width, noshade : noshade, mceDo : 'insert'});
63
+					}
64
+				}
65
+
66
+				return true;
67
+		}
68
+
69
+		// Pass to next handler in chain
70
+		return false;
71
+	},
72
+
73
+	handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
74
+		if (node == null)
75
+			return;
76
+
77
+		do {
78
+			if (node.nodeName == "HR") {
79
+				tinyMCE.switchClass(editor_id + '_advhr', 'mceButtonSelected');
80
+				return true;
81
+			}
82
+		} while ((node = node.parentNode));
83
+
84
+		tinyMCE.switchClass(editor_id + '_advhr', 'mceButtonNormal');
85
+
86
+		return true;
87
+	}
88
+};
89
+
90
+tinyMCE.addPlugin("advhr", TinyMCE_AdvancedHRPlugin);

BIN
admin/scripts/tiny_mce/plugins/advhr/images/advhr.gif View File


+ 43 - 0
admin/scripts/tiny_mce/plugins/advhr/jscripts/rule.js View File

@@ -0,0 +1,43 @@
1
+function init() {
2
+	tinyMCEPopup.resizeToInnerSize();
3
+
4
+	var formObj = document.forms[0];
5
+	formObj.width.value  = tinyMCE.getWindowArg('width');
6
+	formObj.size.value   = tinyMCE.getWindowArg('size');
7
+	formObj.insert.value = tinyMCE.getLang('lang_' + tinyMCE.getWindowArg('mceDo'),'Insert',true);
8
+	if (tinyMCE.getWindowArg('noshade')) {
9
+		formObj.noshade.checked = true;
10
+	}
11
+	if (tinyMCE.getWindowArg('width').lastIndexOf('%')!=-1) {
12
+		formObj.width2.value = "%";
13
+		formObj.width.value  = formObj.width.value.substring(0,formObj.width.value.length-1);
14
+	}
15
+}
16
+
17
+function insertHR() {
18
+	var formObj = document.forms[0];
19
+	var width   = formObj.width.value;
20
+	var size    = formObj.size.value;
21
+	var html = '<hr';
22
+	if (size!='' && size!=0) {
23
+		html += ' size="' + size + '"';
24
+	}
25
+	if (width!='' && width!=0) {
26
+		html += ' width="' + width;
27
+		if (formObj.width2.value=='%') {
28
+			html += '%';
29
+		}
30
+		html += '"';
31
+	}
32
+	if (formObj.noshade.checked==true) {
33
+		html += ' noshade="noshade"';
34
+	}
35
+	html += ' />';
36
+
37
+	tinyMCEPopup.execCommand("mceInsertContent", true, html);
38
+	tinyMCEPopup.close();
39
+}
40
+
41
+function cancelAction() {
42
+	tinyMCEPopup.close();
43
+}

+ 8 - 0
admin/scripts/tiny_mce/plugins/advhr/langs/en.js View File

@@ -0,0 +1,8 @@
1
+// UK lang variables
2
+
3
+tinyMCE.addToLang('',{
4
+insert_advhr_desc : 'Horizontale rule',
5
+insert_advhr_width : 'Width',
6
+insert_advhr_size : 'Height',
7
+insert_advhr_noshade : 'No shadow'
8
+});

+ 1 - 0
admin/scripts/tiny_mce/plugins/advhr/readme.txt View File

@@ -0,0 +1 @@
1
+Check the TinyMCE documentation for details on this plugin.

+ 61 - 0
admin/scripts/tiny_mce/plugins/advhr/rule.htm View File

@@ -0,0 +1,61 @@
1
+<html xmlns="http://www.w3.org/1999/xhtml">
2
+<head>
3
+	<title>{$lang_insert_advhr_desc}</title>
4
+	<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
5
+	<script language="javascript" type="text/javascript" src="jscripts/rule.js"></script>
6
+	<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
7
+	<link href="css/advhr.css" rel="stylesheet" type="text/css" />
8
+	<base target="_self" />
9
+</head>
10
+<body onload="tinyMCEPopup.executeOnLoad('init();');">
11
+<form onsubmit="insertHR();return false;" action="#">
12
+	<div class="tabs">
13
+		<ul>
14
+			<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{$lang_insert_advhr_desc}</a></span></li>
15
+		</ul>
16
+	</div>
17
+
18
+	<div class="panel_wrapper">
19
+		<div id="general_panel" class="panel current">
20
+			<table border="0" cellpadding="4" cellspacing="0">
21
+                    <tr>
22
+                        <td><label for="width">{$lang_insert_advhr_width}</label></td>
23
+                        <td nowrap="nowrap">
24
+                            <input id="width" name="width" type="text" value="" />
25
+                            <select name="width2" id="width2">
26
+                                <option value="">px</option>
27
+                                <option value="%">%</option>
28
+                            </select>
29
+                        </td>
30
+                    </tr>
31
+                    <tr>
32
+                        <td><label for="size">{$lang_insert_advhr_size}</label></td>
33
+                        <td><select id="size" name="size">
34
+                            <option value="">Normal</option>
35
+                            <option value="1">1</option>
36
+                            <option value="2">2</option>
37
+                            <option value="3">3</option>
38
+                            <option value="4">4</option>
39
+                            <option value="5">5</option>
40
+                        </select></td>
41
+                    </tr>
42
+                    <tr>
43
+                        <td><label for="noshade">{$lang_insert_advhr_noshade}</label></td>
44
+                        <td><input type="checkbox" name="noshade" id="noshade" class="radio" /></td>
45
+                    </tr>
46
+            </table>
47
+		</div>
48
+	</div>
49
+
50
+	<div class="mceActionPanel">
51
+		<div style="float: left">
52
+			<input type="button" id="insert" name="insert" value="{$lang_insert}" onclick="insertHR();" />
53
+		</div>
54
+
55
+		<div style="float: right">
56
+			<input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
57
+		</div>
58
+	</div>
59
+</form>
60
+</body>
61
+</html>

+ 66 - 0
admin/scripts/tiny_mce/plugins/advimage/css/advimage.css View File

@@ -0,0 +1,66 @@
1
+/* CSS file for advimage plugin popup */
2
+
3
+.mceImageList {
4
+	width: 280px;
5
+}
6
+
7
+.mceActionPanel {
8
+	margin-top: 7px;
9
+}
10
+
11
+.alignPreview {
12
+	border: 1px solid black;
13
+	width: 140px;
14
+	height: 140px;
15
+	overflow: hidden;
16
+	padding: 5px;
17
+}
18
+
19
+.checkbox {
20
+	border: 0;
21
+}
22
+
23
+.panel_wrapper div.current {
24
+	height: 305px;
25
+}
26
+
27
+#prev {
28
+	margin: 0;
29
+	border: 1px
30
+	solid black;
31
+	width: 99%;
32
+	height: 150px;
33
+	overflow: auto;
34
+}
35
+
36
+#align, #classlist {
37
+	width: 150px;
38
+}
39
+
40
+#width, #height {
41
+	vertical-align: middle;
42
+	width: 50px;
43
+	text-align: center;
44
+}
45
+
46
+#vspace, #hspace, #border {
47
+	vertical-align: middle;
48
+	width: 30px;
49
+	text-align: center;
50
+}
51
+
52
+#classlist {
53
+	width: 180px;
54
+}
55
+
56
+input {
57
+	width: 280px;
58
+}
59
+
60
+#constrain, #onmousemovecheck {
61
+	width: auto;
62
+}
63
+
64
+#id, #dir, #lang, #usemap, #longdesc {
65
+	width: 200px;
66
+}

File diff suppressed because it is too large
+ 1 - 0
admin/scripts/tiny_mce/plugins/advimage/editor_plugin.js


+ 148 - 0
admin/scripts/tiny_mce/plugins/advimage/editor_plugin_src.js View File

@@ -0,0 +1,148 @@
1
+/**
2
+ * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
3
+ *
4
+ * @author Moxiecode
5
+ * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
6
+ */
7
+
8
+/* Import plugin specific language pack */
9
+tinyMCE.importPluginLanguagePack('advimage');
10
+
11
+var TinyMCE_AdvancedImagePlugin = {
12
+	getInfo : function() {
13
+		return {
14
+			longname : 'Advanced image',
15
+			author : 'Moxiecode Systems AB',
16
+			authorurl : 'http://tinymce.moxiecode.com',
17
+			infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage',
18
+			version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
19
+		};
20
+	},
21
+
22
+	getControlHTML : function(cn) {
23
+		switch (cn) {
24
+			case "image":
25
+				return tinyMCE.getButtonHTML(cn, 'lang_image_desc', '{$themeurl}/images/image.gif', 'mceAdvImage');
26
+		}
27
+
28
+		return "";
29
+	},
30
+
31
+	execCommand : function(editor_id, element, command, user_interface, value) {
32
+		switch (command) {
33
+			case "mceAdvImage":
34
+				var template = new Array();
35
+
36
+				template['file']   = '../../plugins/advimage/image.htm';
37
+				template['width']  = 480;
38
+				template['height'] = 380;
39
+
40
+				// Language specific width and height addons
41
+				template['width']  += tinyMCE.getLang('lang_advimage_delta_width', 0);
42
+				template['height'] += tinyMCE.getLang('lang_advimage_delta_height', 0);
43
+
44
+				var inst = tinyMCE.getInstanceById(editor_id);
45
+				var elm = inst.getFocusElement();
46
+
47
+				if (elm != null && tinyMCE.getAttrib(elm, 'class').indexOf('mceItem') != -1)
48
+					return true;
49
+
50
+				tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"});
51
+
52
+				return true;
53
+		}
54
+
55
+		return false;
56
+	},
57
+
58
+	cleanup : function(type, content) {
59
+		switch (type) {
60
+			case "insert_to_editor_dom":
61
+				var imgs = content.getElementsByTagName("img"), src, i;
62
+				for (i=0; i<imgs.length; i++) {
63
+					var onmouseover = tinyMCE.cleanupEventStr(tinyMCE.getAttrib(imgs[i], 'onmouseover'));
64
+					var onmouseout = tinyMCE.cleanupEventStr(tinyMCE.getAttrib(imgs[i], 'onmouseout'));
65
+
66
+					if ((src = this._getImageSrc(onmouseover)) != "") {
67
+						if (tinyMCE.getParam('convert_urls'))
68
+							src = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], src);
69
+
70
+						imgs[i].setAttribute('onmouseover', "this.src='" + src + "';");
71
+					}
72
+
73
+					if ((src = this._getImageSrc(onmouseout)) != "") {
74
+						if (tinyMCE.getParam('convert_urls'))
75
+							src = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], src);
76
+
77
+						imgs[i].setAttribute('onmouseout', "this.src='" + src + "';");
78
+					}
79
+				}
80
+				break;
81
+
82
+			case "get_from_editor_dom":
83
+				var imgs = content.getElementsByTagName("img");
84
+				for (var i=0; i<imgs.length; i++) {
85
+					var onmouseover = tinyMCE.cleanupEventStr(tinyMCE.getAttrib(imgs[i], 'onmouseover'));
86
+					var onmouseout = tinyMCE.cleanupEventStr(tinyMCE.getAttrib(imgs[i], 'onmouseout'));
87
+
88
+					if ((src = this._getImageSrc(onmouseover)) != "") {
89
+						if (tinyMCE.getParam('convert_urls'))
90
+							src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, null, true);");
91
+
92
+						imgs[i].setAttribute('onmouseover', "this.src='" + src + "';");
93
+					}
94
+
95
+					if ((src = this._getImageSrc(onmouseout)) != "") {
96
+						if (tinyMCE.getParam('convert_urls'))
97
+							src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, null, true);");
98
+
99
+						imgs[i].setAttribute('onmouseout', "this.src='" + src + "';");
100
+					}
101
+				}
102
+				break;
103
+		}
104
+
105
+		return content;
106
+	},
107
+
108
+	handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
109
+		if (node == null)
110
+			return;
111
+
112
+		do {
113
+			if (node.nodeName == "IMG" && tinyMCE.getAttrib(node, 'class').indexOf('mceItem') == -1) {
114
+				tinyMCE.switchClass(editor_id + '_advimage', 'mceButtonSelected');
115
+				return true;
116
+			}
117
+		} while ((node = node.parentNode));
118
+
119
+		tinyMCE.switchClass(editor_id + '_advimage', 'mceButtonNormal');
120
+
121
+		return true;
122
+	},
123
+
124
+	/**
125
+	 * Returns the image src from a scripted mouse over image str.
126
+	 *
127
+	 * @param {string} s String to get real src from.
128
+	 * @return Image src from a scripted mouse over image str.
129
+	 * @type string
130
+	 */
131
+	_getImageSrc : function(s) {
132
+		var sr, p = -1;
133
+
134
+		if (!s)
135
+			return "";
136
+
137
+		if ((p = s.indexOf('this.src=')) != -1) {
138
+			sr = s.substring(p + 10);
139
+			sr = sr.substring(0, sr.indexOf('\''));
140
+
141
+			return sr;
142
+		}
143
+
144
+		return "";
145
+	}
146
+};
147
+
148
+tinyMCE.addPlugin("advimage", TinyMCE_AdvancedImagePlugin);

+ 241 - 0
admin/scripts/tiny_mce/plugins/advimage/image.htm View File

@@ -0,0 +1,241 @@
1
+<html xmlns="http://www.w3.org/1999/xhtml">
2
+<head>
3
+	<title>{$lang_insert_image_title}</title>
4
+	<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
5
+	<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
6
+	<script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
7
+	<script language="javascript" type="text/javascript" src="../../utils/validate.js"></script>
8
+	<script language="javascript" type="text/javascript" src="jscripts/functions.js"></script>
9
+	<link href="css/advimage.css" rel="stylesheet" type="text/css" />
10
+	<base target="_self" />
11
+</head>
12
+<body id="advimage" onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
13
+    <form onsubmit="insertAction();return false;" action="#"> 
14
+		<div class="tabs">
15
+			<ul>
16
+				<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{$lang_advimage_tab_general}</a></span></li>
17
+				<li id="appearance_tab"><span><a href="javascript:mcTabs.displayTab('appearance_tab','appearance_panel');" onmousedown="return false;">{$lang_advimage_tab_appearance}</a></span></li>
18
+				<li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{$lang_advimage_tab_advanced}</a></span></li>
19
+			</ul>
20
+		</div>
21
+
22
+		<div class="panel_wrapper">
23
+			<div id="general_panel" class="panel current">
24
+				<fieldset>
25
+						<legend>{$lang_advimage_general}</legend>
26
+
27
+						<table class="properties">
28
+							<tr>
29
+								<td class="column1"><label id="srclabel" for="src">{$lang_insert_image_src}</label></td>
30
+								<td colspan="2"><table border="0" cellspacing="0" cellpadding="0">
31
+									<tr> 
32
+									  <td><input name="src" type="text" id="src" value="" onchange="showPreviewImage(this.value);" /></td> 
33
+									  <td id="srcbrowsercontainer">&nbsp;</td>
34
+									</tr>
35
+								  </table></td>
36
+							</tr>
37
+							<tr id="imagelistsrcrow">
38
+								<td class="column1"><label for="imagelistsrc">{$lang_image_list}</label></td>
39
+								<td colspan="2" id="imagelistsrccontainer">&nbsp;</td>
40
+							</tr>
41
+							<tr> 
42
+								<td class="column1"><label id="altlabel" for="alt">{$lang_insert_image_alt}</label></td> 
43
+								<td colspan="2"><input id="alt" name="alt" type="text" value="" /></td> 
44
+							</tr> 
45
+							<tr> 
46
+								<td class="column1"><label id="titlelabel" for="title">{$lang_advimage_title}</label></td> 
47
+								<td colspan="2"><input id="title" name="title" type="text" value="" /></td> 
48
+							</tr>
49
+						</table>
50
+				</fieldset>
51
+
52
+				<fieldset>
53
+					<legend>{$lang_advimage_preview}</legend>
54
+					<div id="prev"></div>
55
+				</fieldset>
56
+			</div>
57
+
58
+			<div id="appearance_panel" class="panel">
59
+				<fieldset>
60
+					<legend>{$lang_advimage_tab_appearance}</legend>
61
+
62
+					<table border="0" cellpadding="4" cellspacing="0">
63
+						<tr> 
64
+							<td class="column1"><label id="alignlabel" for="align">{$lang_insert_image_align}</label></td> 
65
+							<td><select id="align" name="align" onchange="changeAppearance();"> 
66
+									<option value="">{$lang_insert_image_align_default}</option> 
67
+									<option value="baseline">{$lang_insert_image_align_baseline}</option> 
68
+									<option value="top">{$lang_insert_image_align_top}</option> 
69
+									<option value="middle">{$lang_insert_image_align_middle}</option> 
70
+									<option value="bottom">{$lang_insert_image_align_bottom}</option> 
71
+									<option value="texttop">{$lang_insert_image_align_texttop}</option> 
72
+									<option value="absmiddle">{$lang_insert_image_align_absmiddle}</option> 
73
+									<option value="absbottom">{$lang_insert_image_align_absbottom}</option> 
74
+									<option value="left">{$lang_insert_image_align_left}</option> 
75
+									<option value="right">{$lang_insert_image_align_right}</option> 
76
+								</select> 
77
+							</td>
78
+							<td rowspan="6" valign="top">
79
+								<div class="alignPreview">
80
+									<img id="alignSampleImg" src="images/sample.gif" alt="{$lang_advimage_example_img}" />
81
+									Lorem ipsum, Dolor sit amet, consectetuer adipiscing loreum ipsum edipiscing elit, sed diam
82
+									nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Loreum ipsum
83
+									edipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam
84
+									erat volutpat.
85
+								</div>
86
+							</td>
87
+						</tr>
88
+
89
+						<tr>
90
+							<td class="column1"><label id="widthlabel" for="width">{$lang_insert_image_dimensions}</label></td>
91
+							<td nowrap="nowrap">
92
+								<input name="width" type="text" id="width" value="" size="5" maxlength="5" class="size" onchange="changeHeight();" /> x 
93
+								<input name="height" type="text" id="height" value="" size="5" maxlength="5" class="size" onchange="changeWidth();" /> px
94
+							</td>
95
+						</tr>
96
+
97
+						<tr>
98
+							<td>&nbsp;</td>
99
+							<td><table border="0" cellpadding="0" cellspacing="0">
100
+									<tr>
101
+										<td><input id="constrain" type="checkbox" name="constrain" class="checkbox" /></td>
102
+										<td><label id="constrainlabel" for="constrain">{$lang_advimage_constrain_proportions}</label></td>
103
+									</tr>
104
+								</table></td>
105
+						</tr>
106
+
107
+						<tr>
108
+							<td class="column1"><label id="vspacelabel" for="vspace">{$lang_insert_image_vspace}</label></td> 
109
+							<td><input name="vspace" type="text" id="vspace" value="" size="3" maxlength="3" class="number" onchange="changeAppearance();updateStyle();" />
110
+							</td>
111
+						</tr>
112
+
113
+						<tr> 
114
+							<td class="column1"><label id="hspacelabel" for="hspace">{$lang_insert_image_hspace}</label></td> 
115
+							<td><input name="hspace" type="text" id="hspace" value="" size="3" maxlength="3" class="number" onchange="changeAppearance();updateStyle();" /></td> 
116
+						</tr>
117
+
118
+						<tr>
119
+							<td class="column1"><label id="borderlabel" for="border">{$lang_insert_image_border}</label></td> 
120
+							<td><input id="border" name="border" type="text" value="" size="3" maxlength="3" class="number" onchange="changeAppearance();updateStyle();" /></td> 
121
+						</tr>
122
+
123
+						<tr>
124
+							<td><label id="classlabel" for="classlist">{$lang_class_name}</label></td>
125
+							<td colspan="2">
126
+								 <select id="classlist" name="classlist">
127
+									<option value="" selected>{$lang_not_set}</option>
128
+								 </select>
129
+							</td>
130
+						</tr>
131
+
132
+						<tr>
133
+							<td class="column1"><label id="stylelabel" for="style">{$lang_advimage_style}</label></td> 
134
+							<td colspan="2"><input id="style" name="style" type="text" value="" onchange="styleUpdated();" /></td> 
135
+						</tr>
136
+
137
+						<!-- <tr>
138
+							<td class="column1"><label id="classeslabel" for="classes">{$lang_advimage_classes}</label></td> 
139
+							<td colspan="2"><input id="classes" name="classes" type="text" value="" onchange="selectByValue(this.form,'classlist',this.value,true);" /></td> 
140
+						</tr> -->
141
+					</table>
142
+				</fieldset>
143
+			</div>
144
+
145
+			<div id="advanced_panel" class="panel">
146
+				<fieldset>
147
+					<legend>{$lang_advimage_swap_image}</legend>
148
+
149
+					<input type="checkbox" id="onmousemovecheck" name="onmousemovecheck" class="checkbox" onclick="changeMouseMove();" />
150
+					<label id="onmousemovechecklabel" for="onmousemovecheck">{$lang_advimage_alt_image}</label>
151
+
152
+					<table border="0" cellpadding="4" cellspacing="0" width="100%">
153
+							<tr>
154
+								<td class="column1"><label id="onmouseoversrclabel" for="onmouseoversrc">{$lang_advimage_mouseover}</label></td> 
155
+								<td><table border="0" cellspacing="0" cellpadding="0"> 
156
+									<tr> 
157
+									  <td><input id="onmouseoversrc" name="onmouseoversrc" type="text" value="" /></td> 
158
+									  <td id="onmouseoversrccontainer">&nbsp;</td>
159
+									</tr>
160
+								  </table></td>
161
+							</tr>
162
+							<tr id="imagelistoverrow">
163
+								<td class="column1"><label for="imagelistover">{$lang_image_list}</label></td>
164
+								<td id="imagelistovercontainer">&nbsp;</td>
165
+							</tr>
166
+							<tr> 
167
+								<td class="column1"><label id="onmouseoutsrclabel" for="onmouseoutsrc">{$lang_advimage_mouseout}</label></td> 
168
+								<td class="column2"><table border="0" cellspacing="0" cellpadding="0"> 
169
+									<tr> 
170
+									  <td><input id="onmouseoutsrc" name="onmouseoutsrc" type="text" value="" /></td> 
171
+									  <td id="onmouseoutsrccontainer">&nbsp;</td>
172
+									</tr> 
173
+								  </table></td> 
174
+							</tr>
175
+							<tr id="imagelistoutrow">
176
+								<td class="column1"><label for="imagelistout">{$lang_image_list}</label></td>
177
+								<td id="imagelistoutcontainer">&nbsp;</td>
178
+							</tr>
179
+					</table>
180
+				</fieldset>
181
+
182
+				<fieldset>
183
+					<legend>{$lang_advimage_misc}</legend>
184
+
185
+					<table border="0" cellpadding="4" cellspacing="0">
186
+						<tr>
187
+							<td class="column1"><label id="idlabel" for="id">{$lang_advimage_id}</label></td> 
188
+							<td><input id="id" name="id" type="text" value="" /></td> 
189
+						</tr>
190
+
191
+						<tr>
192
+							<td class="column1"><label id="dirlabel" for="dir">{$lang_advimage_langdir}</label></td> 
193
+							<td>
194
+								<select id="dir" name="dir" onchange="changeAppearance();"> 
195
+										<option value="">{$lang_not_set}</option> 
196
+										<option value="ltr">{$lang_advimage_ltr}</option> 
197
+										<option value="rtl">{$lang_advimage_rtl}</option> 
198
+								</select>
199
+							</td> 
200
+						</tr>
201
+
202
+						<tr>
203
+							<td class="column1"><label id="langlabel" for="lang">{$lang_advimage_langcode}</label></td> 
204
+							<td>
205
+								<input id="lang" name="lang" type="text" value="" />
206
+							</td> 
207
+						</tr>
208
+
209
+						<tr>
210
+							<td class="column1"><label id="usemaplabel" for="usemap">{$lang_advimage_image_map}</label></td> 
211
+							<td>
212
+								<input id="usemap" name="usemap" type="text" value="" />
213
+							</td> 
214
+						</tr>
215
+
216
+						<tr>
217
+							<td class="column1"><label id="longdesclabel" for="longdesc">{$lang_advimage_long_desc}</label></td>
218
+							<td><table border="0" cellspacing="0" cellpadding="0">
219
+									<tr>
220
+									  <td><input id="longdesc" name="longdesc" type="text" value="" /></td>
221
+									  <td id="longdesccontainer">&nbsp;</td>
222
+									</tr>
223
+								</table></td> 
224
+						</tr>
225
+					</table>
226
+				</fieldset>
227
+			</div>
228
+		</div>
229
+
230
+		<div class="mceActionPanel">
231
+			<div style="float: left">
232
+				<input type="button" id="insert" name="insert" value="{$lang_insert}" onclick="insertAction();" />
233
+			</div>
234
+
235
+			<div style="float: right">
236
+				<input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="cancelAction();" />
237
+			</div>
238
+		</div>
239
+    </form>
240
+</body> 
241
+</html> 

BIN
admin/scripts/tiny_mce/plugins/advimage/images/sample.gif View File


+ 534 - 0
admin/scripts/tiny_mce/plugins/advimage/jscripts/functions.js View File

@@ -0,0 +1,534 @@
1
+/* Functions for the advimage plugin popup */
2
+
3
+var preloadImg = null;
4
+var orgImageWidth, orgImageHeight;
5
+
6
+function preinit() {
7
+	// Initialize
8
+	tinyMCE.setWindowArg('mce_windowresize', false);
9
+
10
+	// Import external list url javascript
11
+	var url = tinyMCE.getParam("external_image_list_url");
12
+	if (url != null) {
13
+		// Fix relative
14
+		if (url.charAt(0) != '/' && url.indexOf('://') == -1)
15
+			url = tinyMCE.documentBasePath + "/" + url;
16
+
17
+		document.write('<sc'+'ript language="javascript" type="text/javascript" src="' + url + '"></sc'+'ript>');
18
+	}
19
+}
20
+
21
+function convertURL(url, node, on_save) {
22
+	return eval("tinyMCEPopup.windowOpener." + tinyMCE.settings['urlconverter_callback'] + "(url, node, on_save);");
23
+}
24
+
25
+function getImageSrc(str) {
26
+	var pos = -1;
27
+
28
+	if (!str)
29
+		return "";
30
+
31
+	if ((pos = str.indexOf('this.src=')) != -1) {
32
+		var src = str.substring(pos + 10);
33
+
34
+		src = src.substring(0, src.indexOf('\''));
35
+
36
+		if (tinyMCE.getParam('convert_urls'))
37
+			src = convertURL(src, null, true);
38
+
39
+		return src;
40
+	}
41
+
42
+	return "";
43
+}
44
+
45
+function init() {
46
+	tinyMCEPopup.resizeToInnerSize();
47
+
48
+	var formObj = document.forms[0];
49
+	var inst = tinyMCE.getInstanceById(tinyMCE.getWindowArg('editor_id'));
50
+	var elm = inst.getFocusElement();
51
+	var action = "insert";
52
+	var html = "";
53
+
54
+	// Image list src
55
+	html = getImageListHTML('imagelistsrc','src','onSelectMainImage');
56
+	if (html == "")
57
+		document.getElementById("imagelistsrcrow").style.display = 'none';
58
+	else
59
+		document.getElementById("imagelistsrccontainer").innerHTML = html;
60
+
61
+	// Image list oversrc
62
+	html = getImageListHTML('imagelistover','onmouseoversrc');
63
+	if (html == "")
64
+		document.getElementById("imagelistoverrow").style.display = 'none';
65
+	else
66
+		document.getElementById("imagelistovercontainer").innerHTML = html;
67
+
68
+	// Image list outsrc
69
+	html = getImageListHTML('imagelistout','onmouseoutsrc');
70
+	if (html == "")
71
+		document.getElementById("imagelistoutrow").style.display = 'none';
72
+	else
73
+		document.getElementById("imagelistoutcontainer").innerHTML = html;
74
+
75
+	// Src browser
76
+	html = getBrowserHTML('srcbrowser','src','image','advimage');
77
+	document.getElementById("srcbrowsercontainer").innerHTML = html;
78
+
79
+	// Over browser
80
+	html = getBrowserHTML('oversrcbrowser','onmouseoversrc','image','advimage');
81
+	document.getElementById("onmouseoversrccontainer").innerHTML = html;
82
+
83
+	// Out browser
84
+	html = getBrowserHTML('outsrcbrowser','onmouseoutsrc','image','advimage');
85
+	document.getElementById("onmouseoutsrccontainer").innerHTML = html;
86
+
87
+	// Longdesc browser
88
+	html = getBrowserHTML('longdescbrowser','longdesc','file','advimage');
89
+	document.getElementById("longdesccontainer").innerHTML = html;
90
+
91
+	// Resize some elements
92
+	if (isVisible('srcbrowser'))
93
+		document.getElementById('src').style.width = '260px';
94
+
95
+	if (isVisible('oversrcbrowser'))
96
+		document.getElementById('onmouseoversrc').style.width = '260px';
97
+
98
+	if (isVisible('outsrcbrowser'))
99
+		document.getElementById('onmouseoutsrc').style.width = '260px';
100
+
101
+	if (isVisible('longdescbrowser'))
102
+		document.getElementById('longdesc').style.width = '180px';
103
+
104
+	// Check action
105
+	if (elm != null && elm.nodeName == "IMG")
106
+		action = "update";
107
+
108
+	formObj.insert.value = tinyMCE.getLang('lang_' + action, 'Insert', true); 
109
+
110
+	if (action == "update") {
111
+		var src = tinyMCE.getAttrib(elm, 'src');
112
+		var onmouseoversrc = getImageSrc(tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onmouseover')));
113
+		var onmouseoutsrc = getImageSrc(tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onmouseout')));
114
+
115
+		src = convertURL(src, elm, true);
116
+
117
+		// Use mce_src if found
118
+		var mceRealSrc = tinyMCE.getAttrib(elm, 'mce_src');
119
+		if (mceRealSrc != "") {
120
+			src = mceRealSrc;
121
+
122
+			if (tinyMCE.getParam('convert_urls'))
123
+				src = convertURL(src, elm, true);
124
+		}
125
+
126
+		if (onmouseoversrc != "" && tinyMCE.getParam('convert_urls'))
127
+			onmouseoversrc = convertURL(onmouseoversrc, elm, true);
128
+
129
+		if (onmouseoutsrc != "" && tinyMCE.getParam('convert_urls'))
130
+			onmouseoutsrc = convertURL(onmouseoutsrc, elm, true);
131
+
132
+		// Setup form data
133
+		var style = tinyMCE.parseStyle(tinyMCE.getAttrib(elm, "style"));
134
+
135
+		// Store away old size
136
+		orgImageWidth = trimSize(getStyle(elm, 'width'))
137
+		orgImageHeight = trimSize(getStyle(elm, 'height'));
138
+
139
+		formObj.src.value    = src;
140
+		formObj.alt.value    = tinyMCE.getAttrib(elm, 'alt');
141
+		formObj.title.value  = tinyMCE.getAttrib(elm, 'title');
142
+		formObj.border.value = trimSize(getStyle(elm, 'border', 'borderWidth'));
143
+		formObj.vspace.value = tinyMCE.getAttrib(elm, 'vspace');
144
+		formObj.hspace.value = tinyMCE.getAttrib(elm, 'hspace');
145
+		formObj.width.value  = orgImageWidth;
146
+		formObj.height.value = orgImageHeight;
147
+		formObj.onmouseoversrc.value = onmouseoversrc;
148
+		formObj.onmouseoutsrc.value  = onmouseoutsrc;
149
+		formObj.id.value  = tinyMCE.getAttrib(elm, 'id');
150
+		formObj.dir.value  = tinyMCE.getAttrib(elm, 'dir');
151
+		formObj.lang.value  = tinyMCE.getAttrib(elm, 'lang');
152
+		formObj.longdesc.value  = tinyMCE.getAttrib(elm, 'longdesc');
153
+		formObj.usemap.value  = tinyMCE.getAttrib(elm, 'usemap');
154
+		formObj.style.value  = tinyMCE.serializeStyle(style);
155
+
156
+		// Select by the values
157
+		if (tinyMCE.isMSIE)
158
+			selectByValue(formObj, 'align', getStyle(elm, 'align', 'styleFloat'));
159
+		else
160
+			selectByValue(formObj, 'align', getStyle(elm, 'align', 'cssFloat'));
161
+
162
+		addClassesToList('classlist', 'advimage_styles');
163
+
164
+		selectByValue(formObj, 'classlist', tinyMCE.getAttrib(elm, 'class'));
165
+		selectByValue(formObj, 'imagelistsrc', src);
166
+		selectByValue(formObj, 'imagelistover', onmouseoversrc);
167
+		selectByValue(formObj, 'imagelistout', onmouseoutsrc);
168
+
169
+		updateStyle();
170
+		showPreviewImage(src, true);
171
+		changeAppearance();
172
+
173
+		window.focus();
174
+	} else
175
+		addClassesToList('classlist', 'advimage_styles');
176
+
177
+	// If option enabled default contrain proportions to checked
178
+	if (tinyMCE.getParam("advimage_constrain_proportions", true))
179
+		formObj.constrain.checked = true;
180
+
181
+	// Check swap image if valid data
182
+	if (formObj.onmouseoversrc.value != "" || formObj.onmouseoutsrc.value != "")
183
+		setSwapImageDisabled(false);
184
+	else
185
+		setSwapImageDisabled(true);
186
+}
187
+
188
+function setSwapImageDisabled(state) {
189
+	var formObj = document.forms[0];
190
+
191
+	formObj.onmousemovecheck.checked = !state;
192
+
193
+	setBrowserDisabled('overbrowser', state);
194
+	setBrowserDisabled('outbrowser', state);
195
+
196
+	if (formObj.imagelistover)
197
+		formObj.imagelistover.disabled = state;
198
+
199
+	if (formObj.imagelistout)
200
+		formObj.imagelistout.disabled = state;
201
+
202
+	formObj.onmouseoversrc.disabled = state;
203
+	formObj.onmouseoutsrc.disabled  = state;
204
+}
205
+
206
+function setAttrib(elm, attrib, value) {
207
+	var formObj = document.forms[0];
208
+	var valueElm = formObj.elements[attrib];
209
+
210
+	if (typeof(value) == "undefined" || value == null) {
211
+		value = "";
212
+
213
+		if (valueElm)
214
+			value = valueElm.value;
215
+	}
216
+
217
+	if (value != "") {
218
+		elm.setAttribute(attrib, value);
219
+
220
+		if (attrib == "style")
221
+			attrib = "style.cssText";
222
+
223
+		if (attrib == "longdesc")
224
+			attrib = "longDesc";
225
+
226
+		if (attrib == "width") {
227
+			attrib = "style.width";
228
+			value = value + "px";
229
+			value = value.replace(/%px/g, 'px');
230
+		}
231
+
232
+		if (attrib == "height") {
233
+			attrib = "style.height";
234
+			value = value + "px";
235
+			value = value.replace(/%px/g, 'px');
236
+		}
237
+
238
+		if (attrib == "class")
239
+			attrib = "className";
240
+
241
+		eval('elm.' + attrib + "=value;");
242
+	} else
243
+		elm.removeAttribute(attrib);
244
+}
245
+
246
+function makeAttrib(attrib, value) {
247
+	var formObj = document.forms[0];
248
+	var valueElm = formObj.elements[attrib];
249
+
250
+	if (typeof(value) == "undefined" || value == null) {
251
+		value = "";
252
+
253
+		if (valueElm)
254
+			value = valueElm.value;
255
+	}
256
+
257
+	if (value == "")
258
+		return "";
259
+
260
+	// XML encode it
261
+	value = value.replace(/&/g, '&amp;');
262
+	value = value.replace(/\"/g, '&quot;');
263
+	value = value.replace(/</g, '&lt;');
264
+	value = value.replace(/>/g, '&gt;');
265
+
266
+	return ' ' + attrib + '="' + value + '"';
267
+}
268
+
269
+function insertAction() {
270
+	var inst = tinyMCE.getInstanceById(tinyMCE.getWindowArg('editor_id'));
271
+	var elm = inst.getFocusElement();
272
+	var formObj = document.forms[0];
273
+	var src = formObj.src.value;
274
+	var onmouseoversrc = formObj.onmouseoversrc.value;
275
+	var onmouseoutsrc = formObj.onmouseoutsrc.value;
276
+
277
+	if (!AutoValidator.validate(formObj)) {
278
+		alert(tinyMCE.getLang('lang_invalid_data'));
279
+		return false;
280
+	}
281
+
282
+	if (tinyMCE.getParam("accessibility_warnings")) {
283
+		if (formObj.alt.value == "" && !confirm(tinyMCE.getLang('lang_advimage_missing_alt', '', true)))
284
+			return;
285
+	}
286
+
287
+	if (onmouseoversrc && onmouseoversrc != "")
288
+		onmouseoversrc = "this.src='" + convertURL(onmouseoversrc, tinyMCE.imgElement) + "';";
289
+
290
+	if (onmouseoutsrc && onmouseoutsrc != "")
291
+		onmouseoutsrc = "this.src='" + convertURL(onmouseoutsrc, tinyMCE.imgElement) + "';";
292
+
293
+	if (elm != null && elm.nodeName == "IMG") {
294
+		setAttrib(elm, 'src', convertURL(src, tinyMCE.imgElement));
295
+		setAttrib(elm, 'mce_src', src);
296
+		setAttrib(elm, 'alt');
297
+		setAttrib(elm, 'title');
298
+		setAttrib(elm, 'border');
299
+		setAttrib(elm, 'vspace');
300
+		setAttrib(elm, 'hspace');
301
+		setAttrib(elm, 'width');
302
+		setAttrib(elm, 'height');
303
+		setAttrib(elm, 'onmouseover', onmouseoversrc);
304
+		setAttrib(elm, 'onmouseout', onmouseoutsrc);
305
+		setAttrib(elm, 'id');
306
+		setAttrib(elm, 'dir');
307
+		setAttrib(elm, 'lang');
308
+		setAttrib(elm, 'longdesc');
309
+		setAttrib(elm, 'usemap');
310
+		setAttrib(elm, 'style');
311
+		setAttrib(elm, 'class', getSelectValue(formObj, 'classlist'));
312
+		setAttrib(elm, 'align', getSelectValue(formObj, 'align'));
313
+
314
+		//tinyMCEPopup.execCommand("mceRepaint");
315
+
316
+		// Repaint if dimensions changed
317
+		if (formObj.width.value != orgImageWidth || formObj.height.value != orgImageHeight)
318
+			inst.repaint();
319
+
320
+		// Refresh in old MSIE
321
+		if (tinyMCE.isMSIE5)
322
+			elm.outerHTML = elm.outerHTML;
323
+	} else {
324
+		var html = "<img";
325
+
326
+		html += makeAttrib('src', convertURL(src, tinyMCE.imgElement));
327
+		html += makeAttrib('mce_src', src);
328
+		html += makeAttrib('alt');
329
+		html += makeAttrib('title');
330
+		html += makeAttrib('border');
331
+		html += makeAttrib('vspace');
332
+		html += makeAttrib('hspace');
333
+		html += makeAttrib('width');
334
+		html += makeAttrib('height');
335
+		html += makeAttrib('onmouseover', onmouseoversrc);
336
+		html += makeAttrib('onmouseout', onmouseoutsrc);
337
+		html += makeAttrib('id');
338
+		html += makeAttrib('dir');
339
+		html += makeAttrib('lang');
340
+		html += makeAttrib('longdesc');
341
+		html += makeAttrib('usemap');
342
+		html += makeAttrib('style');
343
+		html += makeAttrib('class', getSelectValue(formObj, 'classlist'));
344
+		html += makeAttrib('align', getSelectValue(formObj, 'align'));
345
+		html += " />";
346
+
347
+		tinyMCEPopup.execCommand("mceInsertContent", false, html);
348
+	}
349
+
350
+	tinyMCE._setEventsEnabled(inst.getBody(), false);
351
+	tinyMCEPopup.close();
352
+}
353
+
354
+function cancelAction() {
355
+	tinyMCEPopup.close();
356
+}
357
+
358
+function changeAppearance() {
359
+	var formObj = document.forms[0];
360
+	var img = document.getElementById('alignSampleImg');
361
+
362
+	if (img) {
363
+		img.align = formObj.align.value;
364
+		img.border = formObj.border.value;
365
+		img.hspace = formObj.hspace.value;
366
+		img.vspace = formObj.vspace.value;
367
+	}
368
+}
369
+
370
+function changeMouseMove() {
371
+	var formObj = document.forms[0];
372
+
373
+	setSwapImageDisabled(!formObj.onmousemovecheck.checked);
374
+}
375
+
376
+function updateStyle() {
377
+	var formObj = document.forms[0];
378
+	var st = tinyMCE.parseStyle(formObj.style.value);
379
+
380
+	if (tinyMCE.getParam('inline_styles', false)) {
381
+		st['width'] = formObj.width.value == '' ? '' : formObj.width.value + "px";
382
+		st['height'] = formObj.height.value == '' ? '' : formObj.height.value + "px";
383
+		st['border-width'] = formObj.border.value == '' ? '' : formObj.border.value + "px";
384
+		st['margin-top'] = formObj.vspace.value == '' ? '' : formObj.vspace.value + "px";
385
+		st['margin-bottom'] = formObj.vspace.value == '' ? '' : formObj.vspace.value + "px";
386
+		st['margin-left'] = formObj.hspace.value == '' ? '' : formObj.hspace.value + "px";
387
+		st['margin-right'] = formObj.hspace.value == '' ? '' : formObj.hspace.value + "px";
388
+	} else {
389
+		st['width'] = st['height'] = st['border-width'] = null;
390
+
391
+		if (st['margin-top'] == st['margin-bottom'])
392
+			st['margin-top'] = st['margin-bottom'] = null;
393
+
394
+		if (st['margin-left'] == st['margin-right'])
395
+			st['margin-left'] = st['margin-right'] = null;
396
+	}
397
+
398
+	formObj.style.value = tinyMCE.serializeStyle(st);
399
+}
400
+
401
+function styleUpdated() {
402
+	var formObj = document.forms[0];
403
+	var st = tinyMCE.parseStyle(formObj.style.value);
404
+
405
+	if (st['width'])
406
+		formObj.width.value = st['width'].replace('px', '');
407
+
408
+	if (st['height'])
409
+		formObj.height.value = st['height'].replace('px', '');
410
+
411
+	if (st['margin-top'] && st['margin-top'] == st['margin-bottom'])
412
+		formObj.vspace.value = st['margin-top'].replace('px', '');
413
+
414
+	if (st['margin-left'] && st['margin-left'] == st['margin-right'])
415
+		formObj.hspace.value = st['margin-left'].replace('px', '');
416
+
417
+	if (st['border-width'])
418
+		formObj.border.value = st['border-width'].replace('px', '');
419
+}
420
+
421
+function changeHeight() {
422
+	var formObj = document.forms[0];
423
+
424
+	if (!formObj.constrain.checked || !preloadImg) {
425
+		updateStyle();
426
+		return;
427
+	}
428
+
429
+	if (formObj.width.value == "" || formObj.height.value == "")
430
+		return;
431
+
432
+	var temp = (parseInt(formObj.width.value) / parseInt(preloadImg.width)) * preloadImg.height;
433
+	formObj.height.value = temp.toFixed(0);
434
+	updateStyle();
435
+}
436
+
437
+function changeWidth() {
438
+	var formObj = document.forms[0];
439
+
440
+	if (!formObj.constrain.checked || !preloadImg) {
441
+		updateStyle();
442
+		return;
443
+	}
444
+
445
+	if (formObj.width.value == "" || formObj.height.value == "")
446
+		return;
447
+
448
+	var temp = (parseInt(formObj.height.value) / parseInt(preloadImg.height)) * preloadImg.width;
449
+	formObj.width.value = temp.toFixed(0);
450
+	updateStyle();
451
+}
452
+
453
+function onSelectMainImage(target_form_element, name, value) {
454
+	var formObj = document.forms[0];
455
+
456
+	formObj.alt.value = name;
457
+	formObj.title.value = name;
458
+
459
+	resetImageData();
460
+	showPreviewImage(formObj.elements[target_form_element].value, false);
461
+}
462
+
463
+function showPreviewImage(src, start) {
464
+	var formObj = document.forms[0];
465
+
466
+	selectByValue(document.forms[0], 'imagelistsrc', src);
467
+
468
+	var elm = document.getElementById('prev');
469
+	var src = src == "" ? src : tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], src);
470
+
471
+	if (!start && tinyMCE.getParam("advimage_update_dimensions_onchange", true))
472
+		resetImageData();
473
+
474
+	if (src == "")
475
+		elm.innerHTML = "";
476
+	else
477
+		elm.innerHTML = '<img id="previewImg" src="' + src + '" border="0" onload="updateImageData();" onerror="resetImageData();" />'
478
+}
479
+
480
+function updateImageData() {
481
+	var formObj = document.forms[0];
482
+
483
+	preloadImg = document.getElementById('previewImg');
484
+
485
+	if (formObj.width.value == "")
486
+		formObj.width.value = preloadImg.width;
487
+
488
+	if (formObj.height.value == "")
489
+		formObj.height.value = preloadImg.height;
490
+
491
+	updateStyle();
492
+}
493
+
494
+function resetImageData() {
495
+	var formObj = document.forms[0];
496
+	formObj.width.value = formObj.height.value = "";	
497
+}
498
+
499
+function getSelectValue(form_obj, field_name) {
500
+	var elm = form_obj.elements[field_name];
501
+
502
+	if (elm == null || elm.options == null)
503
+		return "";
504
+
505
+	return elm.options[elm.selectedIndex].value;
506
+}
507
+
508
+function getImageListHTML(elm_id, target_form_element, onchange_func) {
509
+	if (typeof(tinyMCEImageList) == "undefined" || tinyMCEImageList.length == 0)
510
+		return "";
511
+
512
+	var html = "";
513
+
514
+	html += '<select id="' + elm_id + '" name="' + elm_id + '"';
515
+	html += ' class="mceImageList" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.' + target_form_element + '.value=';
516
+	html += 'this.options[this.selectedIndex].value;';
517
+
518
+	if (typeof(onchange_func) != "undefined")
519
+		html += onchange_func + '(\'' + target_form_element + '\',this.options[this.selectedIndex].text,this.options[this.selectedIndex].value);';
520
+
521
+	html += '"><option value="">---</option>';
522
+
523
+	for (var i=0; i<tinyMCEImageList.length; i++)
524
+		html += '<option value="' + tinyMCEImageList[i][1] + '">' + tinyMCEImageList[i][0] + '</option>';
525
+
526
+	html += '</select>';
527
+
528
+	return html;
529
+
530
+	// tinyMCE.debug('-- image list start --', html, '-- image list end --');
531
+}
532
+
533
+// While loading
534
+preinit();

+ 27 - 0
admin/scripts/tiny_mce/plugins/advimage/langs/en.js View File

@@ -0,0 +1,27 @@
1
+// UK lang variables
2
+
3
+tinyMCE.addToLang('advimage',{
4
+tab_general : 'General',
5
+tab_appearance : 'Appearance',
6
+tab_advanced : 'Advanced',
7
+general : 'General',
8
+title : 'Title',
9
+preview : 'Preview',
10
+constrain_proportions : 'Constrain proportions',
11
+langdir : 'Language direction',
12
+langcode : 'Language code',
13
+long_desc : 'Long description link',
14
+style : 'Style',
15
+classes : 'Classes',
16
+ltr : 'Left to right',
17
+rtl : 'Right to left',
18
+id : 'Id',
19
+image_map : 'Image map',
20
+swap_image : 'Swap image',
21
+alt_image : 'Alternative image',
22
+mouseover : 'for mouse over',
23
+mouseout : 'for mouse out',
24
+misc : 'Miscellaneous',
25
+example_img : 'Appearance&nbsp;preview&nbsp;image',
26
+missing_alt : 'Are you sure you want to continue without including an Image Description? Without  it the image may not be accessible to some users with disabilities, or to those using a text browser, or browsing the Web with images turned off.'
27
+});

+ 1 - 0
admin/scripts/tiny_mce/plugins/advimage/readme.txt View File

@@ -0,0 +1 @@
1
+Check the TinyMCE documentation for details on this plugin.

+ 35 - 0
admin/scripts/tiny_mce/plugins/advlink/css/advlink.css View File

@@ -0,0 +1,35 @@
1
+/* CSS file for advimage plugin popup */
2
+
3
+.mceLinkList, .mceAnchorList, #targetlist {
4
+	width: 280px;
5
+}
6
+
7
+.mceActionPanel {
8
+	margin-top: 7px;
9
+}
10
+
11
+.panel_wrapper div.current {
12
+	height: 320px;
13
+}
14
+
15
+#classlist, #title, #href {
16
+	width: 280px;
17
+}
18
+
19
+#popupurl, #popupname {
20
+	width: 200px;
21
+}
22
+
23
+#popupwidth, #popupheight, #popupleft, #popuptop {
24
+	width: 30px;
25
+	vertical-align: middle;
26
+	text-align: center;
27
+}
28
+
29
+#id, #style, #classes, #target, #dir, #hreflang, #lang, #charset, #type, #rel, #rev, #tabindex, #accesskey {
30
+	width: 200px;
31
+}
32
+
33
+#events_panel input {
34
+	width: 200px;
35
+}

File diff suppressed because it is too large
+ 1 - 0
admin/scripts/tiny_mce/plugins/advlink/editor_plugin.js


+ 88 - 0
admin/scripts/tiny_mce/plugins/advlink/editor_plugin_src.js View File

@@ -0,0 +1,88 @@
1
+/**
2
+ * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
3
+ *
4
+ * @author Moxiecode
5
+ * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
6
+ */
7
+
8
+/* Import plugin specific language pack */
9
+tinyMCE.importPluginLanguagePack('advlink');
10
+
11
+var TinyMCE_AdvancedLinkPlugin = {
12
+	getInfo : function() {
13
+		return {
14
+			longname : 'Advanced link',
15
+			author : 'Moxiecode Systems AB',
16
+			authorurl : 'http://tinymce.moxiecode.com',
17
+			infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink',
18
+			version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
19
+		};
20
+	},
21
+
22
+	initInstance : function(inst) {
23
+		inst.addShortcut('ctrl', 'k', 'lang_advlink_desc', 'mceAdvLink');
24
+	},
25
+
26
+	getControlHTML : function(cn) {
27
+		switch (cn) {
28
+			case "link":
29
+				return tinyMCE.getButtonHTML(cn, 'lang_link_desc', '{$themeurl}/images/link.gif', 'mceAdvLink');
30
+		}
31
+
32
+		return "";
33
+	},
34
+
35
+	execCommand : function(editor_id, element, command, user_interface, value) {
36
+		switch (command) {
37
+			case "mceAdvLink":
38
+				var anySelection = false;
39
+				var inst = tinyMCE.getInstanceById(editor_id);
40
+				var focusElm = inst.getFocusElement();
41
+				var selectedText = inst.selection.getSelectedText();
42
+
43
+				if (tinyMCE.selectedElement)
44
+					anySelection = (tinyMCE.selectedElement.nodeName.toLowerCase() == "img") || (selectedText && selectedText.length > 0);
45
+
46
+				if (anySelection || (focusElm != null && focusElm.nodeName == "A")) {
47
+					var template = new Array();
48
+
49
+					template['file']   = '../../plugins/advlink/link.htm';
50
+					template['width']  = 480;
51
+					template['height'] = 400;
52
+
53
+					// Language specific width and height addons
54
+					template['width']  += tinyMCE.getLang('lang_advlink_delta_width', 0);
55
+					template['height'] += tinyMCE.getLang('lang_advlink_delta_height', 0);
56
+
57
+					tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"});
58
+				}
59
+
60
+				return true;
61
+		}
62
+
63
+		return false;
64
+	},
65
+
66
+	handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
67
+		if (node == null)
68
+			return;
69
+
70
+		do {
71
+			if (node.nodeName == "A" && tinyMCE.getAttrib(node, 'href') != "") {
72
+				tinyMCE.switchClass(editor_id + '_advlink', 'mceButtonSelected');
73
+				return true;
74
+			}
75
+		} while ((node = node.parentNode));
76
+
77
+		if (any_selection) {
78
+			tinyMCE.switchClass(editor_id + '_advlink', 'mceButtonNormal');
79
+			return true;
80
+		}
81
+
82
+		tinyMCE.switchClass(editor_id + '_advlink', 'mceButtonDisabled');
83
+
84
+		return true;
85
+	}
86
+};
87
+
88
+tinyMCE.addPlugin("advlink", TinyMCE_AdvancedLinkPlugin);

+ 568 - 0
admin/scripts/tiny_mce/plugins/advlink/jscripts/functions.js View File

@@ -0,0 +1,568 @@
1
+/* Functions for the advlink plugin popup */
2
+
3
+var templates = {
4
+	"window.open" : "window.open('${url}','${target}','${options}')"
5
+};
6
+
7
+function preinit() {
8
+	// Initialize
9
+	tinyMCE.setWindowArg('mce_windowresize', false);
10
+
11
+	// Import external list url javascript
12
+	var url = tinyMCE.getParam("external_link_list_url");
13
+	if (url != null) {
14
+		// Fix relative
15
+		if (url.charAt(0) != '/' && url.indexOf('://') == -1)
16
+			url = tinyMCE.documentBasePath + "/" + url;
17
+
18
+		document.write('<sc'+'ript language="javascript" type="text/javascript" src="' + url + '"></sc'+'ript>');
19
+	}
20
+}
21
+
22
+function changeClass() {
23
+	var formObj = document.forms[0];
24
+	formObj.classes.value = getSelectValue(formObj, 'classlist');
25
+}
26
+
27
+function init() {
28
+	tinyMCEPopup.resizeToInnerSize();
29
+
30
+	var formObj = document.forms[0];
31
+	var inst = tinyMCE.getInstanceById(tinyMCE.getWindowArg('editor_id'));
32
+	var elm = inst.getFocusElement();
33
+	var action = "insert";
34
+	var html;
35
+
36
+	document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser','href','file','advlink');
37
+	document.getElementById('popupurlbrowsercontainer').innerHTML = getBrowserHTML('popupurlbrowser','popupurl','file','advlink');
38
+	document.getElementById('linklisthrefcontainer').innerHTML = getLinkListHTML('linklisthref','href');
39
+	document.getElementById('anchorlistcontainer').innerHTML = getAnchorListHTML('anchorlist','href');
40
+	document.getElementById('targetlistcontainer').innerHTML = getTargetListHTML('targetlist','target');
41
+
42
+	// Link list
43
+	html = getLinkListHTML('linklisthref','href');
44
+	if (html == "")
45
+		document.getElementById("linklisthrefrow").style.display = 'none';
46
+	else
47
+		document.getElementById("linklisthrefcontainer").innerHTML = html;
48
+
49
+	// Resize some elements
50
+	if (isVisible('hrefbrowser'))
51
+		document.getElementById('href').style.width = '260px';
52
+
53
+	if (isVisible('popupurlbrowser'))
54
+		document.getElementById('popupurl').style.width = '180px';
55
+
56
+	elm = tinyMCE.getParentElement(elm, "a");
57
+	if (elm != null && elm.nodeName == "A")
58
+		action = "update";
59
+
60
+	formObj.insert.value = tinyMCE.getLang('lang_' + action, 'Insert', true); 
61
+
62
+	setPopupControlsDisabled(true);
63
+
64
+	if (action == "update") {
65
+		var href = tinyMCE.getAttrib(elm, 'href');
66
+
67
+		href = convertURL(href, elm, true);
68
+
69
+		// Use mce_href if found
70
+		var mceRealHref = tinyMCE.getAttrib(elm, 'mce_href');
71
+		if (mceRealHref != "") {
72
+			href = mceRealHref;
73
+
74
+			if (tinyMCE.getParam('convert_urls'))
75
+				href = convertURL(href, elm, true);
76
+		}
77
+
78
+		var onclick = tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onclick'));
79
+
80
+		// Setup form data
81
+		setFormValue('href', href);
82
+		setFormValue('title', tinyMCE.getAttrib(elm, 'title'));
83
+		setFormValue('id', tinyMCE.getAttrib(elm, 'id'));
84
+		setFormValue('style', tinyMCE.serializeStyle(tinyMCE.parseStyle(tinyMCE.getAttrib(elm, "style"))));
85
+		setFormValue('rel', tinyMCE.getAttrib(elm, 'rel'));
86
+		setFormValue('rev', tinyMCE.getAttrib(elm, 'rev'));
87
+		setFormValue('charset', tinyMCE.getAttrib(elm, 'charset'));
88
+		setFormValue('hreflang', tinyMCE.getAttrib(elm, 'hreflang'));
89
+		setFormValue('dir', tinyMCE.getAttrib(elm, 'dir'));
90
+		setFormValue('lang', tinyMCE.getAttrib(elm, 'lang'));
91
+		setFormValue('tabindex', tinyMCE.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : ""));
92
+		setFormValue('accesskey', tinyMCE.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : ""));
93
+		setFormValue('type', tinyMCE.getAttrib(elm, 'type'));
94
+		setFormValue('onfocus', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onfocus')));
95
+		setFormValue('onblur', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onblur')));
96
+		setFormValue('onclick', onclick);
97
+		setFormValue('ondblclick', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'ondblclick')));
98
+		setFormValue('onmousedown', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onmousedown')));
99
+		setFormValue('onmouseup', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onmouseup')));
100
+		setFormValue('onmouseover', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onmouseover')));
101
+		setFormValue('onmousemove', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onmousemove')));
102
+		setFormValue('onmouseout', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onmouseout')));
103
+		setFormValue('onkeypress', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onkeypress')));
104
+		setFormValue('onkeydown', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onkeydown')));
105
+		setFormValue('onkeyup', tinyMCE.cleanupEventStr(tinyMCE.getAttrib(elm, 'onkeyup')));
106
+		setFormValue('target', tinyMCE.getAttrib(elm, 'target'));
107
+		setFormValue('classes', tinyMCE.getAttrib(elm, 'class'));
108
+
109
+		// Parse onclick data
110
+		if (onclick != null && onclick.indexOf('window.open') != -1)
111
+			parseWindowOpen(onclick);
112
+		else
113
+			parseFunction(onclick);
114
+
115
+		// Select by the values
116
+		selectByValue(formObj, 'dir', tinyMCE.getAttrib(elm, 'dir'));
117
+		selectByValue(formObj, 'rel', tinyMCE.getAttrib(elm, 'rel'));
118
+		selectByValue(formObj, 'rev', tinyMCE.getAttrib(elm, 'rev'));
119
+		selectByValue(formObj, 'linklisthref', href);
120
+
121
+		if (href.charAt(0) == '#')
122
+			selectByValue(formObj, 'anchorlist', href);
123
+
124
+		addClassesToList('classlist', 'advlink_styles');
125
+
126
+		selectByValue(formObj, 'classlist', tinyMCE.getAttrib(elm, 'class'), true);
127
+		selectByValue(formObj, 'targetlist', tinyMCE.getAttrib(elm, 'target'), true);
128
+	} else
129
+		addClassesToList('classlist', 'advlink_styles');
130
+
131
+	window.focus();
132
+}
133
+
134
+function setFormValue(name, value) {
135
+	document.forms[0].elements[name].value = value;
136
+}
137
+
138
+function convertURL(url, node, on_save) {
139
+	return eval("tinyMCEPopup.windowOpener." + tinyMCE.settings['urlconverter_callback'] + "(url, node, on_save);");
140
+}
141
+
142
+function parseWindowOpen(onclick) {
143
+	var formObj = document.forms[0];
144
+
145
+	// Preprocess center code
146
+	if (onclick.indexOf('return false;') != -1) {
147
+		formObj.popupreturn.checked = true;
148
+		onclick = onclick.replace('return false;', '');
149
+	} else
150
+		formObj.popupreturn.checked = false;
151
+
152
+	var onClickData = parseLink(onclick);
153
+
154
+	if (onClickData != null) {
155
+		formObj.ispopup.checked = true;
156
+		setPopupControlsDisabled(false);
157
+
158
+		var onClickWindowOptions = parseOptions(onClickData['options']);
159
+		var url = onClickData['url'];
160
+
161
+		if (tinyMCE.getParam('convert_urls'))
162
+			url = convertURL(url, null, true);
163
+
164
+		formObj.popupname.value = onClickData['target'];
165
+		formObj.popupurl.value = url;
166
+		formObj.popupwidth.value = getOption(onClickWindowOptions, 'width');
167
+		formObj.popupheight.value = getOption(onClickWindowOptions, 'height');
168
+
169
+		formObj.popupleft.value = getOption(onClickWindowOptions, 'left');
170
+		formObj.popuptop.value = getOption(onClickWindowOptions, 'top');
171
+
172
+		if (formObj.popupleft.value.indexOf('screen') != -1)
173
+			formObj.popupleft.value = "c";
174
+
175
+		if (formObj.popuptop.value.indexOf('screen') != -1)
176
+			formObj.popuptop.value = "c";
177
+
178
+		formObj.popuplocation.checked = getOption(onClickWindowOptions, 'location') == "yes";
179
+		formObj.popupscrollbars.checked = getOption(onClickWindowOptions, 'scrollbars') == "yes";
180
+		formObj.popupmenubar.checked = getOption(onClickWindowOptions, 'menubar') == "yes";
181
+		formObj.popupresizable.checked = getOption(onClickWindowOptions, 'resizable') == "yes";
182
+		formObj.popuptoolbar.checked = getOption(onClickWindowOptions, 'toolbar') == "yes";
183
+		formObj.popupstatus.checked = getOption(onClickWindowOptions, 'status') == "yes";
184
+		formObj.popupdependent.checked = getOption(onClickWindowOptions, 'dependent') == "yes";
185
+
186
+		buildOnClick();
187
+	}
188
+}
189
+
190
+function parseFunction(onclick) {
191
+	var formObj = document.forms[0];
192
+	var onClickData = parseLink(onclick);
193
+
194
+	// TODO: Add stuff here
195
+}
196
+
197
+function getOption(opts, name) {
198
+	return typeof(opts[name]) == "undefined" ? "" : opts[name];
199
+}
200
+
201
+function setPopupControlsDisabled(state) {
202
+	var formObj = document.forms[0];
203
+
204
+	formObj.popupname.disabled = state;
205
+	formObj.popupurl.disabled = state;
206
+	formObj.popupwidth.disabled = state;
207
+	formObj.popupheight.disabled = state;
208
+	formObj.popupleft.disabled = state;
209
+	formObj.popuptop.disabled = state;
210
+	formObj.popuplocation.disabled = state;
211
+	formObj.popupscrollbars.disabled = state;
212
+	formObj.popupmenubar.disabled = state;
213
+	formObj.popupresizable.disabled = state;
214
+	formObj.popuptoolbar.disabled = state;
215
+	formObj.popupstatus.disabled = state;
216
+	formObj.popupreturn.disabled = state;
217
+	formObj.popupdependent.disabled = state;
218
+
219
+	setBrowserDisabled('popupurlbrowser', state);
220
+}
221
+
222
+function parseLink(link) {
223
+	link = link.replace(new RegExp('&#39;', 'g'), "'");
224
+
225
+	var fnName = link.replace(new RegExp("\\s*([A-Za-z0-9\.]*)\\s*\\(.*", "gi"), "$1");
226
+
227
+	// Is function name a template function
228
+	var template = templates[fnName];
229
+	if (template) {
230
+		// Build regexp
231
+		var variableNames = template.match(new RegExp("'?\\$\\{[A-Za-z0-9\.]*\\}'?", "gi"));
232
+		var regExp = "\\s*[A-Za-z0-9\.]*\\s*\\(";
233
+		var replaceStr = "";
234
+		for (var i=0; i<variableNames.length; i++) {
235
+			// Is string value
236
+			if (variableNames[i].indexOf("'${") != -1)
237
+				regExp += "'(.*)'";
238
+			else // Number value
239
+				regExp += "([0-9]*)";
240
+
241
+			replaceStr += "$" + (i+1);
242
+
243
+			// Cleanup variable name
244
+			variableNames[i] = variableNames[i].replace(new RegExp("[^A-Za-z0-9]", "gi"), "");
245
+
246
+			if (i != variableNames.length-1) {
247
+				regExp += "\\s*,\\s*";
248
+				replaceStr += "<delim>";
249
+			} else
250
+				regExp += ".*";
251
+		}
252
+
253
+		regExp += "\\);?";
254
+
255
+		// Build variable array
256
+		var variables = new Array();
257
+		variables["_function"] = fnName;
258
+		var variableValues = link.replace(new RegExp(regExp, "gi"), replaceStr).split('<delim>');
259
+		for (var i=0; i<variableNames.length; i++)
260
+			variables[variableNames[i]] = variableValues[i];
261
+
262
+		return variables;
263
+	}
264
+
265
+	return null;
266
+}
267
+
268
+function parseOptions(opts) {
269
+	if (opts == null || opts == "")
270
+		return new Array();
271
+
272
+	// Cleanup the options
273
+	opts = opts.toLowerCase();
274
+	opts = opts.replace(/;/g, ",");
275
+	opts = opts.replace(/[^0-9a-z=,]/g, "");
276
+
277
+	var optionChunks = opts.split(',');
278
+	var options = new Array();
279
+
280
+	for (var i=0; i<optionChunks.length; i++) {
281
+		var parts = optionChunks[i].split('=');
282
+
283
+		if (parts.length == 2)
284
+			options[parts[0]] = parts[1];
285
+	}
286
+
287
+	return options;
288
+}
289
+
290
+function buildOnClick() {
291
+	var formObj = document.forms[0];
292
+
293
+	if (!formObj.ispopup.checked) {
294
+		formObj.onclick.value = "";
295
+		return;
296
+	}
297
+
298
+	var onclick = "window.open('";
299
+	var url = formObj.popupurl.value;
300
+
301
+	if (tinyMCE.getParam('convert_urls'))
302
+		url = convertURL(url, null, true);
303
+
304
+	onclick += url + "','";
305
+	onclick += formObj.popupname.value + "','";
306
+
307
+	if (formObj.popuplocation.checked)
308
+		onclick += "location=yes,";
309
+
310
+	if (formObj.popupscrollbars.checked)
311
+		onclick += "scrollbars=yes,";
312
+
313
+	if (formObj.popupmenubar.checked)
314
+		onclick += "menubar=yes,";
315
+
316
+	if (formObj.popupresizable.checked)
317
+		onclick += "resizable=yes,";
318
+
319
+	if (formObj.popuptoolbar.checked)
320
+		onclick += "toolbar=yes,";
321
+
322
+	if (formObj.popupstatus.checked)
323
+		onclick += "status=yes,";
324
+
325
+	if (formObj.popupdependent.checked)
326
+		onclick += "dependent=yes,";
327
+
328
+	if (formObj.popupwidth.value != "")
329
+		onclick += "width=" + formObj.popupwidth.value + ",";
330
+
331
+	if (formObj.popupheight.value != "")
332
+		onclick += "height=" + formObj.popupheight.value + ",";
333
+
334
+	if (formObj.popupleft.value != "") {
335
+		if (formObj.popupleft.value != "c")
336
+			onclick += "left=" + formObj.popupleft.value + ",";
337
+		else
338
+			onclick += "left='+(screen.availWidth/2-" + (formObj.popupwidth.value/2) + ")+',";
339
+	}
340
+
341
+	if (formObj.popuptop.value != "") {
342
+		if (formObj.popuptop.value != "c")
343
+			onclick += "top=" + formObj.popuptop.value + ",";
344
+		else
345
+			onclick += "top='+(screen.availHeight/2-" + (formObj.popupheight.value/2) + ")+',";
346
+	}
347
+
348
+	if (onclick.charAt(onclick.length-1) == ',')
349
+		onclick = onclick.substring(0, onclick.length-1);
350
+
351
+	onclick += "');";
352
+
353
+	if (formObj.popupreturn.checked)
354
+		onclick += "return false;";
355
+
356
+	// tinyMCE.debug(onclick);
357
+
358
+	formObj.onclick.value = onclick;
359
+
360
+	if (formObj.href.value == "")
361
+		formObj.href.value = url;
362
+}
363
+
364
+function setAttrib(elm, attrib, value) {
365
+	var formObj = document.forms[0];
366
+	var valueElm = formObj.elements[attrib.toLowerCase()];
367
+
368
+	if (typeof(value) == "undefined" || value == null) {
369
+		value = "";
370
+
371
+		if (valueElm)
372
+			value = valueElm.value;
373
+	}
374
+
375
+	if (value != "") {
376
+		elm.setAttribute(attrib.toLowerCase(), value);
377
+
378
+		if (attrib == "style")
379
+			attrib = "style.cssText";
380
+
381
+		if (attrib.substring(0, 2) == 'on')
382
+			value = 'return true;' + value;
383
+
384
+		if (attrib == "class")
385
+			attrib = "className";
386
+
387
+		eval('elm.' + attrib + "=value;");
388
+	} else
389
+		elm.removeAttribute(attrib);
390
+}
391
+
392
+function getAnchorListHTML(id, target) {
393
+	var inst = tinyMCE.getInstanceById(tinyMCE.getWindowArg('editor_id'));
394
+	var nodes = inst.getBody().getElementsByTagName("a");
395
+
396
+	var html = "";
397
+
398
+	html += '<select id="' + id + '" name="' + id + '" class="mceAnchorList" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.' + target + '.value=';
399
+	html += 'this.options[this.selectedIndex].value;">';
400
+	html += '<option value="">---</option>';
401
+
402
+	for (var i=0; i<nodes.length; i++) {
403
+		if ((name = tinyMCE.getAttrib(nodes[i], "name")) != "")
404
+			html += '<option value="#' + name + '">' + name + '</option>';
405
+	}
406
+
407
+	html += '</select>';
408
+
409
+	return html;
410
+}
411
+
412
+function insertAction() {
413
+	var inst = tinyMCE.getInstanceById(tinyMCE.getWindowArg('editor_id'));
414
+	var elm = inst.getFocusElement();
415
+
416
+	elm = tinyMCE.getParentElement(elm, "a");
417
+
418
+	tinyMCEPopup.execCommand("mceBeginUndoLevel");
419
+
420
+	// Create new anchor elements
421
+	if (elm == null) {
422
+		if (tinyMCE.isSafari)
423
+			tinyMCEPopup.execCommand("mceInsertContent", false, '<a href="#mce_temp_url#">' + inst.selection.getSelectedHTML() + '</a>');
424
+		else
425
+			tinyMCEPopup.execCommand("createlink", false, "#mce_temp_url#");
426
+
427
+		var elementArray = tinyMCE.getElementsByAttributeValue(inst.getBody(), "a", "href", "#mce_temp_url#");
428
+		for (var i=0; i<elementArray.length; i++) {
429
+			var elm = elementArray[i];
430
+
431
+			// Move cursor behind the new anchor
432
+			if (tinyMCE.isGecko) {
433
+				var sp = inst.getDoc().createTextNode(" ");
434
+
435
+				if (elm.nextSibling)
436
+					elm.parentNode.insertBefore(sp, elm.nextSibling);
437
+				else
438
+					elm.parentNode.appendChild(sp);
439
+
440
+				// Set range after link
441
+				var rng = inst.getDoc().createRange();
442
+				rng.setStartAfter(elm);
443
+				rng.setEndAfter(elm);
444
+
445
+				// Update selection
446
+				var sel = inst.getSel();
447
+				sel.removeAllRanges();
448
+				sel.addRange(rng);
449
+			}
450
+
451
+			setAllAttribs(elm);
452
+		}
453
+	} else
454
+		setAllAttribs(elm);
455
+
456
+	tinyMCE._setEventsEnabled(inst.getBody(), false);
457
+	tinyMCEPopup.execCommand("mceEndUndoLevel");
458
+	tinyMCEPopup.close();
459
+}
460
+
461
+function setAllAttribs(elm) {
462
+	var formObj = document.forms[0];
463
+	var href = formObj.href.value;
464
+	var target = getSelectValue(formObj, 'targetlist');
465
+
466
+	// Make anchors absolute
467
+	if (href.charAt(0) != '#')
468
+		href = convertURL(href, elm);
469
+
470
+	setAttrib(elm, 'href', href);
471
+	setAttrib(elm, 'mce_href', href);
472
+	setAttrib(elm, 'title');
473
+	setAttrib(elm, 'target', target == '_self' ? '' : target);
474
+	setAttrib(elm, 'id');
475
+	setAttrib(elm, 'style');
476
+	setAttrib(elm, 'class', getSelectValue(formObj, 'classlist'));
477
+	setAttrib(elm, 'rel');
478
+	setAttrib(elm, 'rev');
479
+	setAttrib(elm, 'charset');
480
+	setAttrib(elm, 'hreflang');
481
+	setAttrib(elm, 'dir');
482
+	setAttrib(elm, 'lang');
483
+	setAttrib(elm, 'tabindex');
484
+	setAttrib(elm, 'accesskey');
485
+	setAttrib(elm, 'type');
486
+	setAttrib(elm, 'onfocus');
487
+	setAttrib(elm, 'onblur');
488
+	setAttrib(elm, 'onclick');
489
+	setAttrib(elm, 'ondblclick');
490
+	setAttrib(elm, 'onmousedown');
491
+	setAttrib(elm, 'onmouseup');
492
+	setAttrib(elm, 'onmouseover');
493
+	setAttrib(elm, 'onmousemove');
494
+	setAttrib(elm, 'onmouseout');
495
+	setAttrib(elm, 'onkeypress');
496
+	setAttrib(elm, 'onkeydown');
497
+	setAttrib(elm, 'onkeyup');
498
+
499
+	// Refresh in old MSIE
500
+	if (tinyMCE.isMSIE5)
501
+		elm.outerHTML = elm.outerHTML;
502
+}
503
+
504
+function getSelectValue(form_obj, field_name) {
505
+	var elm = form_obj.elements[field_name];
506
+
507
+	if (elm == null || elm.options == null)
508
+		return "";
509
+
510
+	return elm.options[elm.selectedIndex].value;
511
+}
512
+
513
+function getLinkListHTML(elm_id, target_form_element, onchange_func) {
514
+	if (typeof(tinyMCELinkList) == "undefined" || tinyMCELinkList.length == 0)
515
+		return "";
516
+
517
+	var html = "";
518
+
519
+	html += '<select id="' + elm_id + '" name="' + elm_id + '"';
520
+	html += ' class="mceLinkList" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.' + target_form_element + '.value=';
521
+	html += 'this.options[this.selectedIndex].value;';
522
+
523
+	if (typeof(onchange_func) != "undefined")
524
+		html += onchange_func + '(\'' + target_form_element + '\',this.options[this.selectedIndex].text,this.options[this.selectedIndex].value);';
525
+
526
+	html += '"><option value="">---</option>';
527
+
528
+	for (var i=0; i<tinyMCELinkList.length; i++)
529
+		html += '<option value="' + tinyMCELinkList[i][1] + '">' + tinyMCELinkList[i][0] + '</option>';
530
+
531
+	html += '</select>';
532
+
533
+	return html;
534
+
535
+	// tinyMCE.debug('-- image list start --', html, '-- image list end --');
536
+}
537
+
538
+function getTargetListHTML(elm_id, target_form_element) {
539
+	var targets = tinyMCE.getParam('theme_advanced_link_targets', '').split(';');
540
+	var html = '';
541
+
542
+	html += '<select id="' + elm_id + '" name="' + elm_id + '" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.' + target_form_element + '.value=';
543
+	html += 'this.options[this.selectedIndex].value;">';
544
+
545
+	html += '<option value="_self">' + tinyMCE.getLang('lang_advlink_target_same') + '</option>';
546
+	html += '<option value="_blank">' + tinyMCE.getLang('lang_advlink_target_blank') + ' (_blank)</option>';
547
+	html += '<option value="_parent">' + tinyMCE.getLang('lang_advlink_target_parent') + ' (_parent)</option>';
548
+	html += '<option value="_top">' + tinyMCE.getLang('lang_advlink_target_top') + ' (_top)</option>';
549
+
550
+	for (var i=0; i<targets.length; i++) {
551
+		var key, value;
552
+
553
+		if (targets[i] == "")
554
+			continue;
555
+
556
+		key = targets[i].split('=')[0];
557
+		value = targets[i].split('=')[1];
558
+
559
+		html += '<option value="' + key + '">' + value + ' (' + key + ')</option>';
560
+	}
561
+
562
+	html += '</select>';
563
+
564
+	return html;
565
+}
566
+
567
+// While loading
568
+preinit();

+ 46 - 0
admin/scripts/tiny_mce/plugins/advlink/langs/en.js View File

@@ -0,0 +1,46 @@
1
+// UK lang variables
2
+
3
+tinyMCE.addToLang('advlink',{
4
+general_tab : 'General',
5
+popup_tab : 'Popup',
6
+events_tab : 'Events',
7
+advanced_tab : 'Advanced',
8
+general_props : 'General properties',
9
+popup_props : 'Popup properties',
10
+event_props : 'Events',
11
+advanced_props : 'Advanced properties',
12
+popup_opts : 'Options',
13
+anchor_names : 'Anchors',
14
+target_same : 'Open in this window / frame',
15
+target_parent : 'Open in parent window / frame',
16
+target_top : 'Open in top frame (replaces all frames)',
17
+target_blank : 'Open in new window',
18
+popup : 'Javascript popup',
19
+popup_url : 'Popup URL',
20
+popup_name : 'Window name',
21
+popup_return : 'Insert \'return false\'',
22
+popup_scrollbars : 'Show scrollbars',
23
+popup_statusbar : 'Show status bar',
24
+popup_toolbar : 'Show toolbars',
25
+popup_menubar : 'Show menu bar',
26
+popup_location : 'Show location bar',
27
+popup_resizable : 'Make window resizable',
28
+popup_dependent : 'Dependent (Mozilla/Firefox only)',
29
+popup_size : 'Size',
30
+popup_position : 'Position (X/Y)',
31
+id : 'Id',
32
+style: 'Style',
33
+classes : 'Classes',
34
+target_name : 'Target name',
35
+langdir : 'Language direction',
36
+target_langcode : 'Target language',
37
+langcode : 'Language code',
38
+encoding : 'Target character encoding',
39
+mime : 'Target MIME type',
40
+rel : 'Relationship page to target',
41
+rev : 'Relationship target to page',
42
+tabindex : 'Tabindex',
43
+accesskey : 'Accesskey',
44
+ltr : 'Left to right',
45
+rtl : 'Right to left'
46
+});

+ 337 - 0
admin/scripts/tiny_mce/plugins/advlink/link.htm View File

@@ -0,0 +1,337 @@
1
+<html xmlns="http://www.w3.org/1999/xhtml">
2
+<head>
3
+	<title>{$lang_insert_link_title}</title>
4
+	<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
5
+	<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
6
+	<script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
7
+	<script language="javascript" type="text/javascript" src="jscripts/functions.js"></script>
8
+	<link href="css/advlink.css" rel="stylesheet" type="text/css" />
9
+	<base target="_self" />
10
+</head>
11
+<body id="advlink" onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
12
+    <form onsubmit="insertAction();return false;" action="#">
13
+		<div class="tabs">
14
+			<ul>
15
+				<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{$lang_advlink_general_tab}</a></span></li>
16
+				<li id="popup_tab"><span><a href="javascript:mcTabs.displayTab('popup_tab','popup_panel');" onmousedown="return false;">{$lang_advlink_popup_tab}</a></span></li>
17
+				<li id="events_tab"><span><a href="javascript:mcTabs.displayTab('events_tab','events_panel');" onmousedown="return false;">{$lang_advlink_events_tab}</a></span></li>
18
+				<li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{$lang_advlink_advanced_tab}</a></span></li>
19
+			</ul>
20
+		</div>
21
+
22
+		<div class="panel_wrapper">
23
+			<div id="general_panel" class="panel current">
24
+				<fieldset>
25
+					<legend>{$lang_advlink_general_props}</legend>
26
+
27
+					<table border="0" cellpadding="4" cellspacing="0">
28
+						<tr>
29
+						  <td nowrap="nowrap"><label id="hreflabel" for="href">{$lang_insert_link_url}</label></td>
30
+						  <td><table border="0" cellspacing="0" cellpadding="0">
31
+								<tr>
32
+								  <td><input id="href" name="href" type="text" value="" onchange="selectByValue(this.form,'linklisthref',this.value);" /></td>
33
+								  <td id="hrefbrowsercontainer">&nbsp;</td>
34
+								</tr>
35
+							  </table></td>
36
+						</tr>
37
+						<tr id="linklisthrefrow">
38
+							<td class="column1"><label for="linklisthref">{$lang_link_list}</label></td>
39
+							<td colspan="2" id="linklisthrefcontainer">&nbsp;</td>
40
+						</tr>
41
+						<tr>
42
+							<td class="column1"><label for="anchorlist">{$lang_advlink_anchor_names}</label></td>
43
+							<td colspan="2" id="anchorlistcontainer">&nbsp;</td>
44
+						</tr>
45
+						<tr>
46
+							<td><label id="targetlistlabel" for="targetlist">{$lang_insert_link_target}</label></td>
47
+							<td id="targetlistcontainer">&nbsp;</td>
48
+						</tr>
49
+						<tr>
50
+							<td nowrap="nowrap"><label id="titlelabel" for="title">{$lang_theme_insert_link_titlefield}</label></td>
51
+							<td><input id="title" name="title" type="text" value="" /></td>
52
+						</tr>
53
+						<tr>
54
+							<td><label id="classlabel" for="classlist">{$lang_class_name}</label></td>
55
+							<td>
56
+								 <select id="classlist" name="classlist" onchange="changeClass();">
57
+									<option value="" selected>{$lang_not_set}</option>
58
+								 </select>
59
+							</td>
60
+						</tr>
61
+					</table>
62
+				</fieldset>
63
+			</div>
64
+
65
+			<div id="popup_panel" class="panel">
66
+				<fieldset>
67
+					<legend>{$lang_advlink_popup_props}</legend>
68
+
69
+					<input type="checkbox" id="ispopup" name="ispopup" class="radio" onclick="setPopupControlsDisabled(!this.checked);buildOnClick();" />
70
+					<label id="ispopuplabel" for="ispopup">{$lang_advlink_popup}</label>
71
+
72
+					<table border="0" cellpadding="0" cellspacing="4">
73
+						<tr>
74
+							<td nowrap="nowrap"><label for="popupurl">{$lang_advlink_popup_url}</label>&nbsp;</td>
75
+							<td>
76
+								<table border="0" cellspacing="0" cellpadding="0">
77
+									<tr>
78
+										<td><input type="text" name="popupurl" id="popupurl" value="" onchange="buildOnClick();" /></td>
79
+										<td id="popupurlbrowsercontainer">&nbsp;</td>
80
+									</tr>
81
+								</table>
82
+							</td>
83
+						</tr>
84
+						<tr>
85
+							<td nowrap="nowrap"><label for="popupname">{$lang_advlink_popup_name}</label>&nbsp;</td>
86
+							<td><input type="text" name="popupname" id="popupname" value="" onchange="buildOnClick();" /></td>
87
+						</tr>
88
+						<tr>
89
+							<td nowrap="nowrap"><label>{$lang_advlink_popup_size}</label>&nbsp;</td>
90
+							<td nowrap="nowrap">
91
+								<input type="text" id="popupwidth" name="popupwidth" value="" onchange="buildOnClick();" /> x
92
+								<input type="text" id="popupheight" name="popupheight" value="" onchange="buildOnClick();" /> px
93
+							</td>
94
+						</tr>
95
+						<tr>
96
+							<td nowrap="nowrap" id="labelleft"><label>{$lang_advlink_popup_position}</label>&nbsp;</td>
97
+							<td nowrap="nowrap">
98
+								<input type="text" id="popupleft" name="popupleft" value="" onchange="buildOnClick();" /> /                                
99
+								<input type="text" id="popuptop" name="popuptop" value="" onchange="buildOnClick();" /> (c /c = center)
100
+							</td>
101
+						</tr>
102
+					</table>
103
+
104
+					<fieldset>
105
+						<legend>{$lang_advlink_popup_opts}</legend>
106
+
107
+						<table border="0" cellpadding="0" cellspacing="4">
108
+							<tr>
109
+								<td><input type="checkbox" id="popuplocation" name="popuplocation" class="checkbox" onchange="buildOnClick();" /></td>
110
+								<td nowrap="nowrap"><label id="popuplocationlabel" for="popuplocation">{$lang_advlink_popup_location}</label></td>
111
+								<td><input type="checkbox" id="popupscrollbars" name="popupscrollbars" class="checkbox" onchange="buildOnClick();" /></td>
112
+								<td nowrap="nowrap"><label id="popupscrollbarslabel" for="popupscrollbars">{$lang_advlink_popup_scrollbars}</label></td>
113
+							</tr>
114
+							<tr>
115
+								<td><input type="checkbox" id="popupmenubar" name="popupmenubar" class="checkbox" onchange="buildOnClick();" /></td>
116
+								<td nowrap="nowrap"><label id="popupmenubarlabel" for="popupmenubar">{$lang_advlink_popup_menubar}</label></td>
117
+								<td><input type="checkbox" id="popupresizable" name="popupresizable" class="checkbox" onchange="buildOnClick();" /></td>
118
+								<td nowrap="nowrap"><label id="popupresizablelabel" for="popupresizable">{$lang_advlink_popup_resizable}</label></td>
119
+							</tr>
120
+							<tr>
121
+								<td><input type="checkbox" id="popuptoolbar" name="popuptoolbar" class="checkbox" onchange="buildOnClick();" /></td>
122
+								<td nowrap="nowrap"><label id="popuptoolbarlabel" for="popuptoolbar">{$lang_advlink_popup_toolbar}</label></td>
123
+								<td><input type="checkbox" id="popupdependent" name="popupdependent" class="checkbox" onchange="buildOnClick();" /></td>
124
+								<td nowrap="nowrap"><label id="popupdependentlabel" for="popupdependent">{$lang_advlink_popup_dependent}</label></td>
125
+							</tr>
126
+							<tr>
127
+								<td><input type="checkbox" id="popupstatus" name="popupstatus" class="checkbox" onchange="buildOnClick();" /></td>
128
+								<td nowrap="nowrap"><label id="popupstatuslabel" for="popupstatus">{$lang_advlink_popup_statusbar}</label></td>
129
+								<td><input type="checkbox" id="popupreturn" name="popupreturn" class="checkbox" onchange="buildOnClick();" checked="checked" /></td>
130
+								<td nowrap="nowrap"><label id="popupreturnlabel" for="popupreturn">{$lang_advlink_popup_return}</label></td>
131
+							</tr>
132
+						</table>
133
+					</fieldset>
134
+				</fieldset>
135
+			</div>
136
+
137
+			<div id="advanced_panel" class="panel">
138
+			<fieldset>
139
+					<legend>{$lang_advlink_advanced_props}</legend>
140
+
141
+					<table border="0" cellpadding="0" cellspacing="4">
142
+						<tr>
143
+							<td class="column1"><label id="idlabel" for="id">{$lang_advlink_id}</label></td> 
144
+							<td><input id="id" name="id" type="text" value="" /></td> 
145
+						</tr>
146
+
147
+						<tr>
148
+							<td><label id="stylelabel" for="style">{$lang_advlink_style}</label></td>
149
+							<td><input type="text" id="style" name="style" value="" /></td>
150
+						</tr>
151
+
152
+						<tr>
153
+							<td><label id="classeslabel" for="classes">{$lang_advlink_classes}</label></td>
154
+							<td><input type="text" id="classes" name="classes" value="" onchange="selectByValue(this.form,'classlist',this.value,true);" /></td>
155
+						</tr>
156
+
157
+						<tr>
158
+							<td><label id="targetlabel" for="target">{$lang_advlink_target_name}</label></td>
159
+							<td><input type="text" id="target" name="target" value="" onchange="selectByValue(this.form,'targetlist',this.value,true);" /></td>
160
+						</tr>
161
+
162
+						<tr>
163
+							<td class="column1"><label id="dirlabel" for="dir">{$lang_advlink_langdir}</label></td> 
164
+							<td>
165
+								<select id="dir" name="dir"> 
166
+										<option value="">{$lang_not_set}</option> 
167
+										<option value="ltr">{$lang_advlink_ltr}</option> 
168
+										<option value="rtl">{$lang_advlink_rtl}</option> 
169
+								</select>
170
+							</td> 
171
+						</tr>
172
+
173
+						<tr>
174
+							<td><label id="hreflanglabel" for="hreflang">{$lang_advlink_target_langcode}</label></td>
175
+							<td><input type="text" id="hreflang" name="hreflang" value="" /></td>
176
+						</tr>
177
+
178
+						<tr>
179
+							<td class="column1"><label id="langlabel" for="lang">{$lang_advlink_langcode}</label></td> 
180
+							<td>
181
+								<input id="lang" name="lang" type="text" value="" />
182
+							</td> 
183
+						</tr>
184
+
185
+						<tr>
186
+							<td><label id="charsetlabel" for="charset">{$lang_advlink_encoding}</label></td>
187
+							<td><input type="text" id="charset" name="charset" value="" /></td>
188
+						</tr>
189
+
190
+						<tr>
191
+							<td><label id="typelabel" for="type">{$lang_advlink_mime}</label></td>
192
+							<td><input type="text" id="type" name="type" value="" /></td>
193
+						</tr>
194
+
195
+						<tr>
196
+							<td><label id="rellabel" for="rel">{$lang_advlink_rel}</label></td>
197
+							<td><select id="rel" name="rel"> 
198
+									<option value="">{$lang_not_set}</option> 
199
+									<option value="lightbox">Lightbox</option> 
200
+									<option value="alternate">Alternate</option> 
201
+									<option value="designates">Designates</option> 
202
+									<option value="stylesheet">Stylesheet</option> 
203
+									<option value="start">Start</option> 
204
+									<option value="next">Next</option> 
205
+									<option value="prev">Prev</option> 
206
+									<option value="contents">Contents</option> 
207
+									<option value="index">Index</option> 
208
+									<option value="glossary">Glossary</option> 
209
+									<option value="copyright">Copyright</option> 
210
+									<option value="chapter">Chapter</option> 
211
+									<option value="subsection">Subsection</option> 
212
+									<option value="appendix">Appendix</option> 
213
+									<option value="help">Help</option> 
214
+									<option value="bookmark">Bookmark</option>
215
+									<option value="nofollow">No Follow</option>
216
+									<option value="tag">Tag</option>
217
+								</select> 
218
+							</td>
219
+						</tr>
220
+
221
+						<tr>
222
+							<td><label id="revlabel" for="rev">{$lang_advlink_rev}</label></td>
223
+							<td><select id="rev" name="rev"> 
224
+									<option value="">{$lang_not_set}</option> 
225
+									<option value="alternate">Alternate</option> 
226
+									<option value="designates">Designates</option> 
227
+									<option value="stylesheet">Stylesheet</option> 
228
+									<option value="start">Start</option> 
229
+									<option value="next">Next</option> 
230
+									<option value="prev">Prev</option> 
231
+									<option value="contents">Contents</option> 
232
+									<option value="index">Index</option> 
233
+									<option value="glossary">Glossary</option> 
234
+									<option value="copyright">Copyright</option> 
235
+									<option value="chapter">Chapter</option> 
236
+									<option value="subsection">Subsection</option> 
237
+									<option value="appendix">Appendix</option> 
238
+									<option value="help">Help</option> 
239
+									<option value="bookmark">Bookmark</option> 
240
+								</select> 
241
+							</td>
242
+						</tr>
243
+
244
+						<tr>
245
+							<td><label id="tabindexlabel" for="tabindex">{$lang_advlink_tabindex}</label></td>
246
+							<td><input type="text" id="tabindex" name="tabindex" value="" /></td>
247
+						</tr>
248
+
249
+						<tr>
250
+							<td><label id="accesskeylabel" for="accesskey">{$lang_advlink_accesskey}</label></td>
251
+							<td><input type="text" id="accesskey" name="accesskey" value="" /></td>
252
+						</tr>
253
+					</table>
254
+				</fieldset>
255
+			</div>
256
+
257
+			<div id="events_panel" class="panel">
258
+			<fieldset>
259
+					<legend>{$lang_advlink_event_props}</legend>
260
+
261
+					<table border="0" cellpadding="0" cellspacing="4">
262
+						<tr>
263
+							<td class="column1"><label for="onfocus">onfocus</label></td> 
264
+							<td><input id="onfocus" name="onfocus" type="text" value="" /></td> 
265
+						</tr>
266
+
267
+						<tr>
268
+							<td class="column1"><label for="onblur">onblur</label></td> 
269
+							<td><input id="onblur" name="onblur" type="text" value="" /></td> 
270
+						</tr>
271
+
272
+						<tr>
273
+							<td class="column1"><label for="onclick">onclick</label></td> 
274
+							<td><input id="onclick" name="onclick" type="text" value="" /></td> 
275
+						</tr>
276
+
277
+						<tr>
278
+							<td class="column1"><label for="ondblclick">ondblclick</label></td> 
279
+							<td><input id="ondblclick" name="ondblclick" type="text" value="" /></td> 
280
+						</tr>
281
+
282
+						<tr>
283
+							<td class="column1"><label for="onmousedown">onmousedown</label></td> 
284
+							<td><input id="onmousedown" name="onmousedown" type="text" value="" /></td> 
285
+						</tr>
286
+
287
+						<tr>
288
+							<td class="column1"><label for="onmouseup">onmouseup</label></td> 
289
+							<td><input id="onmouseup" name="onmouseup" type="text" value="" /></td> 
290
+						</tr>
291
+
292
+						<tr>
293
+							<td class="column1"><label for="onmouseover">onmouseover</label></td> 
294
+							<td><input id="onmouseover" name="onmouseover" type="text" value="" /></td> 
295
+						</tr>
296
+
297
+						<tr>
298
+							<td class="column1"><label for="onmousemove">onmousemove</label></td> 
299
+							<td><input id="onmousemove" name="onmousemove" type="text" value="" /></td> 
300
+						</tr>
301
+
302
+						<tr>
303
+							<td class="column1"><label for="onmouseout">onmouseout</label></td> 
304
+							<td><input id="onmouseout" name="onmouseout" type="text" value="" /></td> 
305
+						</tr>
306
+
307
+						<tr>
308
+							<td class="column1"><label for="onkeypress">onkeypress</label></td> 
309
+							<td><input id="onkeypress" name="onkeypress" type="text" value="" /></td> 
310
+						</tr>
311
+
312
+						<tr>
313
+							<td class="column1"><label for="onkeydown">onkeydown</label></td> 
314
+							<td><input id="onkeydown" name="onkeydown" type="text" value="" /></td> 
315
+						</tr>
316
+
317
+						<tr>
318
+							<td class="column1"><label for="onkeyup">onkeyup</label></td> 
319
+							<td><input id="onkeyup" name="onkeyup" type="text" value="" /></td> 
320
+						</tr>
321
+					</table>
322
+				</fieldset>
323
+			</div>
324
+		</div>
325
+
326
+		<div class="mceActionPanel">
327
+			<div style="float: left">
328
+				<input type="button" id="insert" name="insert" value="{$lang_insert}" onclick="insertAction();" />
329
+			</div>
330
+
331
+			<div style="float: right">
332
+				<input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
333
+			</div>
334
+		</div>
335
+    </form>
336
+</body>
337
+</html>

+ 1 - 0
admin/scripts/tiny_mce/plugins/advlink/readme.txt View File

@@ -0,0 +1 @@
1
+Check the TinyMCE documentation for details on this plugin.

File diff suppressed because it is too large
+ 1 - 0
admin/scripts/tiny_mce/plugins/autosave/editor_plugin.js


+ 46 - 0
admin/scripts/tiny_mce/plugins/autosave/editor_plugin_src.js View File

@@ -0,0 +1,46 @@
1
+/**
2
+ * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
3
+ *
4
+ * @author Moxiecode
5
+ * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
6
+ */
7
+
8
+/* Import plugin specific language pack */
9
+tinyMCE.importPluginLanguagePack('autosave');
10
+
11
+var TinyMCE_AutoSavePlugin = {
12
+	getInfo : function() {
13
+		return {
14
+			longname : 'Auto save',
15
+			author : 'Moxiecode Systems AB',
16
+			authorurl : 'http://tinymce.moxiecode.com',
17
+			infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave',
18
+			version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
19
+		};
20
+	},
21
+
22
+	// Private plugin internal methods
23
+
24
+	_beforeUnloadHandler : function() {
25
+		var n, inst, anyDirty = false, msg = tinyMCE.getLang("lang_autosave_unload_msg");
26
+
27
+		if (tinyMCE.getParam("fullscreen_is_enabled"))
28
+			return;
29
+
30
+		for (n in tinyMCE.instances) {
31
+			inst = tinyMCE.instances[n];
32
+
33
+			if (!tinyMCE.isInstance(inst))
34
+				continue;
35
+
36
+			if (inst.isDirty())
37
+				return msg;
38
+		}
39
+
40
+		return;
41
+	}
42
+};
43
+
44
+window.onbeforeunload = TinyMCE_AutoSavePlugin._beforeUnloadHandler;
45
+
46
+tinyMCE.addPlugin("autosave", TinyMCE_AutoSavePlugin);

+ 5 - 0
admin/scripts/tiny_mce/plugins/autosave/langs/en.js View File

@@ -0,0 +1,5 @@
1
+// EN lang variables
2
+
3
+tinyMCE.addToLang('',{
4
+autosave_unload_msg : 'The changes you made will be lost if you navigate away from this page.'
5
+});

+ 1 - 0
admin/scripts/tiny_mce/plugins/autosave/readme.txt View File

@@ -0,0 +1 @@
1
+Check the TinyMCE documentation for details on this plugin.

File diff suppressed because it is too large
+ 1 - 0
admin/scripts/tiny_mce/plugins/bbcode/editor_plugin.js


+ 102 - 0
admin/scripts/tiny_mce/plugins/bbcode/editor_plugin_src.js View File

@@ -0,0 +1,102 @@
1
+var TinyMCE_BBCodePlugin = {
2
+	getInfo : function() {
3
+		return {
4
+			longname : 'BBCode Plugin',
5
+			author : 'Moxiecode Systems AB',
6
+			authorurl : 'http://tinymce.moxiecode.com',
7
+			infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode',
8
+			version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
9
+		};
10
+	},
11
+
12
+	cleanup : function(type, content) {
13
+		var dialect = tinyMCE.getParam('bbcode_dialect', 'punbb').toLowerCase();
14
+
15
+		switch (type) {
16
+			case "insert_to_editor":
17
+				content = this['_' + dialect + '_bbcode2html'](content);
18
+				break;
19
+
20
+			case "get_from_editor":
21
+				content = this['_' + dialect + '_html2bbcode'](content);
22
+				break;
23
+		}
24
+
25
+		return content;
26
+	},
27
+
28
+	// Private methods
29
+
30
+	// HTML -> BBCode in PunBB dialect
31
+	_punbb_html2bbcode : function(s) {
32
+		s = tinyMCE.trim(s);
33
+
34
+		function rep(re, str) {
35
+			s = s.replace(re, str);
36
+		};
37
+
38
+		// example: <strong> to [b]
39
+		rep(/<a href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url]$1[/url]");
40
+		rep(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");
41
+		rep(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");
42
+		rep(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");
43
+		rep(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");
44
+		rep(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]");
45
+		rep(/<font>(.*?)<\/font>/gi,"$1");
46
+		rep(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]");
47
+		rep(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]");
48
+		rep(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]");
49
+		rep(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]");
50
+		rep(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]");
51
+		rep(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]");
52
+		rep(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]");
53
+		rep(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]");
54
+		rep(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]");
55
+		rep(/<\/(strong|b)>/gi,"[/b]");
56
+		rep(/<(strong|b)>/gi,"[b]");
57
+		rep(/<\/(em|i)>/gi,"[/i]");
58
+		rep(/<(em|i)>/gi,"[i]");
59
+		rep(/<\/u>/gi,"[/u]");
60
+		rep(/<u>/gi,"[u]");
61
+		rep(/<br \/>/gi,"\n");
62
+		rep(/<br\/>/gi,"\n");
63
+		rep(/<br>/gi,"\n");
64
+		rep(/<p>/gi,"");
65
+		rep(/<\/p>/gi,"\n");
66
+		rep(/&nbsp;/gi," ");
67
+		rep(/&quot;/gi,"\"");
68
+		rep(/&lt;/gi,"<");
69
+		rep(/&gt;/gi,">");
70
+		rep(/&amp;/gi,"&");
71
+		rep(/&undefined;/gi,"'"); // quickfix
72
+
73
+		return s; 
74
+	},
75
+
76
+	// BBCode -> HTML from PunBB dialect
77
+	_punbb_bbcode2html : function(s) {
78
+		s = tinyMCE.trim(s);
79
+
80
+		function rep(re, str) {
81
+			s = s.replace(re, str);
82
+		};
83
+
84
+		// example: [b] to <strong>
85
+		rep(/\n/gi,"<br />");
86
+		rep(/\[b\]/gi,"<strong>");
87
+		rep(/\[\/b\]/gi,"</strong>");
88
+		rep(/\[i\]/gi,"<em>");
89
+		rep(/\[\/i\]/gi,"</em>");
90
+		rep(/\[u\]/gi,"<u>");
91
+		rep(/\[\/u\]/gi,"</u>");
92
+		rep(/\[url\](.*?)\[\/url\]/gi,"<a href=\"$1\">$1</a>");
93
+		rep(/\[img\](.*?)\[\/img\]/gi,"<img src=\"$1\" />");
94
+		rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"<font color=\"$1\">$2</font>");
95
+		rep(/\[code\](.*?)\[\/code\]/gi,"<span class=\"codeStyle\">$1</span>&nbsp;");
96
+		rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"<span class=\"quoteStyle\">$1</span>&nbsp;");
97
+
98
+		return s; 
99
+	}
100
+};
101
+
102
+tinyMCE.addPlugin("bbcode", TinyMCE_BBCodePlugin);

+ 0 - 0
admin/scripts/tiny_mce/plugins/cleanup/editor_plugin.js View File


+ 10 - 0
admin/scripts/tiny_mce/plugins/cleanup/editor_plugin_src.js View File

@@ -0,0 +1,10 @@
1
+/**
2
+ * $Id: editor_plugin_src.js 162 2007-01-03 16:16:52Z spocke $
3
+ *
4
+ * Experimental plugin for new Cleanup routine, this logic will be moved into the core ones it's stable enougth.
5
+ *
6
+ * @author Moxiecode
7
+ * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
8
+ */
9
+
10
+/* Dummy file since cleanup is now moved to core */

+ 1 - 0
admin/scripts/tiny_mce/plugins/cleanup/readme.txt View File

@@ -0,0 +1 @@
1
+Dummy plugin since cleanup is now moved into core.

+ 74 - 0
admin/scripts/tiny_mce/plugins/contextmenu/css/contextmenu.css View File

@@ -0,0 +1,74 @@
1
+.contextMenuIEPopup {
2
+	padding: 0;
3
+	margin: 0;
4
+	border: 0;
5
+	overflow: hidden;
6
+}
7
+
8
+.contextMenu {
9
+	position: absolute;
10
+	cursor: default;
11
+	z-index: 1000;
12
+	border: 1px solid #D4D0C8;
13
+	background-color: #FFFFFF;
14
+}
15
+
16
+.contextMenuItem, .contextMenuItemOver {
17
+}
18
+
19
+.contextMenuSeparator {
20
+	width: 100%;
21
+	background-color: #D4D0C8;
22
+	border: 0;
23
+}
24
+
25
+.contextMenuImage, .contextMenuItemDisabled {
26
+	border: 0;
27
+}
28
+
29
+.contextMenuIcon {
30
+	background-color: #F0F0EE;
31
+}
32
+
33
+.contextMenuItemOver .contextMenuIcon {
34
+	background-color: #B6BDD2;
35
+}
36
+
37
+.contextMenuIcon {
38
+	background-color: #F0F0EE;
39
+}
40
+
41
+.contextMenuItemDisabled img {
42
+	filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30);
43
+	-moz-opacity:0.3;
44
+	opacity: 0.3;
45
+}
46
+
47
+.contextMenuText {
48
+	font-family: Tahoma, Verdana, Arial, Helvetica;
49
+	font-size: 11px;
50
+	line-height: 20px;
51
+}
52
+
53
+.contextMenuItemDisabled {
54
+	color: #AAAAAA;
55
+}
56
+
57
+.contextMenuText a {
58
+	display: block;
59
+	line-height: 20px;
60
+	width: 100%;
61
+	text-decoration: none;
62
+	color: black;
63
+	font-weight: normal;
64
+	margin: 0;
65
+	padding: 0;
66
+}
67
+
68
+.contextMenuText a:hover {
69
+	background-color: #B6BDD2;
70
+	text-decoration: none !important;
71
+	font-weight: normal;
72
+	margin: 0;
73
+	padding: 0;
74
+}

File diff suppressed because it is too large
+ 1 - 0
admin/scripts/tiny_mce/plugins/contextmenu/editor_plugin.js


+ 357 - 0
admin/scripts/tiny_mce/plugins/contextmenu/editor_plugin_src.js View File

@@ -0,0 +1,357 @@
1
+/**
2
+ * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
3
+ *
4
+ * @author Moxiecode
5
+ * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
6
+ */
7
+
8
+/* Import plugin specific language pack */
9
+if (!tinyMCE.settings['contextmenu_skip_plugin_css']) {
10
+	tinyMCE.loadCSS(tinyMCE.baseURL + "/plugins/contextmenu/css/contextmenu.css");
11
+}
12
+
13
+var TinyMCE_ContextMenuPlugin = {
14
+	// Private fields
15
+	_contextMenu : null,
16
+
17
+	getInfo : function() {
18
+		return {
19
+			longname : 'Context menus',
20
+			author : 'Moxiecode Systems AB',
21
+			authorurl : 'http://tinymce.moxiecode.com',
22
+			infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu',
23
+			version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
24
+		};
25
+	},
26
+
27
+	initInstance : function(inst) {
28
+		// Is not working on MSIE 5.0 or Opera no contextmenu event
29
+		if (tinyMCE.isMSIE5_0 && tinyMCE.isOpera)
30
+			return;
31
+
32
+		TinyMCE_ContextMenuPlugin._contextMenu = new TinyMCE_ContextMenu({
33
+			commandhandler : "TinyMCE_ContextMenuPlugin._commandHandler",
34
+			spacer_image : tinyMCE.baseURL + "/plugins/contextmenu/images/spacer.gif"
35
+		});
36
+
37
+		// Add hide event handles
38
+		tinyMCE.addEvent(inst.getDoc(), "click", TinyMCE_ContextMenuPlugin._hideContextMenu);
39
+		tinyMCE.addEvent(inst.getDoc(), "keypress", TinyMCE_ContextMenuPlugin._hideContextMenu);
40
+		tinyMCE.addEvent(inst.getDoc(), "keydown", TinyMCE_ContextMenuPlugin._hideContextMenu);
41
+		tinyMCE.addEvent(document, "click", TinyMCE_ContextMenuPlugin._hideContextMenu);
42
+		tinyMCE.addEvent(document, "keypress", TinyMCE_ContextMenuPlugin._hideContextMenu);
43
+		tinyMCE.addEvent(document, "keydown", TinyMCE_ContextMenuPlugin._hideContextMenu);
44
+
45
+		// Attach contextmenu event
46
+		if (tinyMCE.isGecko) {
47
+			tinyMCE.addEvent(inst.getDoc(), "contextmenu", function(e) {TinyMCE_ContextMenuPlugin._showContextMenu(tinyMCE.isMSIE ? inst.contentWindow.event : e, inst);});
48
+		} else
49
+			tinyMCE.addEvent(inst.getDoc(), "contextmenu", TinyMCE_ContextMenuPlugin._onContextMenu);
50
+	},
51
+
52
+	// Private plugin internal methods
53
+
54
+	_onContextMenu : function(e) {
55
+		var elm = tinyMCE.isMSIE ? e.srcElement : e.target;
56
+		var targetInst, body;
57
+
58
+		// Find instance
59
+		if ((body = tinyMCE.getParentElement(elm, "body")) != null) {
60
+			for (var n in tinyMCE.instances) {
61
+				var inst = tinyMCE.instances[n];
62
+				if (!tinyMCE.isInstance(inst))
63
+					continue;
64
+
65
+				if (body == inst.getBody()) {
66
+					targetInst = inst;
67
+					break;
68
+				}
69
+			}
70
+
71
+			return TinyMCE_ContextMenuPlugin._showContextMenu(tinyMCE.isMSIE ? targetInst.contentWindow.event : e, targetInst);
72
+		}
73
+	},
74
+
75
+	_showContextMenu : function(e, inst) {
76
+		function getAttrib(elm, name) {
77
+			return elm.getAttribute(name) ? elm.getAttribute(name) : "";
78
+		}
79
+
80
+		var x, y, elm, contextMenu;
81
+		var pos = tinyMCE.getAbsPosition(inst.iframeElement);
82
+
83
+		x = tinyMCE.isMSIE ? e.screenX : pos.absLeft + (e.pageX - inst.getBody().scrollLeft);
84
+		y = tinyMCE.isMSIE ? e.screenY : pos.absTop + (e.pageY - inst.getBody().scrollTop);
85
+		elm = tinyMCE.isMSIE ? e.srcElement : e.target;
86
+
87
+		contextMenu = this._contextMenu;
88
+		contextMenu.inst = inst;
89
+
90
+		// Mozilla needs some time
91
+		window.setTimeout(function () {
92
+			var theme = tinyMCE.getParam("theme");
93
+
94
+			contextMenu.clearAll();
95
+			var sel = inst.selection.getSelectedText().length != 0 || elm.nodeName == "IMG";
96
+
97
+			// Default items
98
+			contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/cut.gif", "$lang_cut_desc", "Cut", "", !sel);
99
+			contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/copy.gif", "$lang_copy_desc", "Copy", "", !sel);
100
+			contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/paste.gif", "$lang_paste_desc", "Paste", "", false);
101
+
102
+			if (sel || (elm ? (elm.nodeName == 'A' && tinyMCE.getAttrib(elm, 'name') == '') || (elm.nodeName == 'IMG') : false)) {
103
+				contextMenu.addSeparator();
104
+				contextMenu.addItem(tinyMCE.baseURL + "/themes/advanced/images/link.gif", "$lang_link_desc", inst.hasPlugin("advlink") ? "mceAdvLink" : "mceLink");
105
+				contextMenu.addItem(tinyMCE.baseURL + "/themes/advanced/images/unlink.gif", "$lang_unlink_desc", "unlink", "", (elm ? (elm.nodeName != 'A') && (elm.nodeName != 'IMG') : true));
106
+			}
107
+
108
+			// Get element
109
+			elm = tinyMCE.getParentElement(elm, "img,table,td" + (inst.hasPlugin("advhr") ? ',hr' : ''));
110
+			if (elm) {
111
+				switch (elm.nodeName) {
112
+					case "IMG":
113
+						contextMenu.addSeparator();
114
+
115
+						// If flash
116
+						if (tinyMCE.hasPlugin('flash') && tinyMCE.getAttrib(elm, 'class').indexOf('mceItemFlash') != -1)
117
+							contextMenu.addItem(tinyMCE.baseURL + "/plugins/flash/images/flash.gif", "$lang_flash_props", "mceFlash");
118
+						else if (tinyMCE.hasPlugin('media') && /mceItem(Flash|ShockWave|WindowsMedia|QuickTime|RealMedia)/.test(tinyMCE.getAttrib(elm, 'class')))
119
+							contextMenu.addItem(tinyMCE.baseURL + "/plugins/flash/images/flash.gif", "$lang_media_title", "mceMedia");
120
+						else
121
+							contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/image.gif", "$lang_image_props_desc", inst.hasPlugin("advimage") ? "mceAdvImage" : "mceImage");
122
+						break;
123
+
124
+					case "HR":
125
+						contextMenu.addSeparator();
126
+						contextMenu.addItem(tinyMCE.baseURL + "/plugins/advhr/images/advhr.gif", "$lang_insert_advhr_desc", "mceAdvancedHr");
127
+						break;
128
+
129
+					case "TABLE":
130
+					case "TD":
131
+						// Is table plugin loaded
132
+						if (inst.hasPlugin("table")) {
133
+							var colspan = (elm.nodeName == "TABLE") ? "" : getAttrib(elm, "colspan");
134
+							var rowspan = (elm.nodeName == "TABLE") ? "" : getAttrib(elm, "rowspan");
135
+
136
+							colspan = colspan == "" ? "1" : colspan;
137
+							rowspan = rowspan == "" ? "1" : rowspan;
138
+
139
+							contextMenu.addSeparator();
140
+							contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/cut.gif", "$lang_table_cut_row_desc", "mceTableCutRow");
141
+							contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/copy.gif", "$lang_table_copy_row_desc", "mceTableCopyRow");
142
+							contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/paste.gif", "$lang_table_paste_row_before_desc", "mceTablePasteRowBefore", "", inst.tableRowClipboard == null);
143
+							contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/paste.gif", "$lang_table_paste_row_after_desc", "mceTablePasteRowAfter", "", inst.tableRowClipboard == null);
144
+
145
+	/*						contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/justifyleft.gif", "$lang_justifyleft_desc", "JustifyLeft", "", false);
146
+							contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/justifycenter.gif", "$lang_justifycenter_desc", "JustifyCenter", "", false);
147
+							contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/justifyright.gif", "$lang_justifyright_desc", "JustifyRight", "", false);
148
+							contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/justifyfull.gif", "$lang_justifyfull_desc", "JustifyFull", "", false);*/
149
+							contextMenu.addSeparator();
150
+							contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table.gif", "$lang_table_desc", "mceInsertTable", "insert");
151
+							contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table.gif", "$lang_table_props_desc", "mceInsertTable");
152
+							contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_cell_props.gif", "$lang_table_cell_desc", "mceTableCellProps");
153
+							contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_delete.gif", "$lang_table_del", "mceTableDelete");
154
+							contextMenu.addSeparator();
155
+							contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_row_props.gif", "$lang_table_row_desc", "mceTableRowProps");
156
+							contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_insert_row_before.gif", "$lang_table_row_before_desc", "mceTableInsertRowBefore");
157
+							contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_insert_row_after.gif", "$lang_table_row_after_desc", "mceTableInsertRowAfter");
158
+							contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_delete_row.gif", "$lang_table_delete_row_desc", "mceTableDeleteRow");
159
+							contextMenu.addSeparator();
160
+							contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_insert_col_before.gif", "$lang_table_col_before_desc", "mceTableInsertColBefore");
161
+							contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_insert_col_after.gif", "$lang_table_col_after_desc", "mceTableInsertColAfter");
162
+							contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_delete_col.gif", "$lang_table_delete_col_desc", "mceTableDeleteCol");
163
+							contextMenu.addSeparator();
164
+							contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_split_cells.gif", "$lang_table_split_cells_desc", "mceTableSplitCells", "", (colspan == "1" && rowspan == "1"));
165
+							contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_merge_cells.gif", "$lang_table_merge_cells_desc", "mceTableMergeCells", "", false);
166
+						}
167
+						break;
168
+				}
169
+			}  else {
170
+				// Add table specific
171
+				if (inst.hasPlugin("table")) {
172
+					contextMenu.addSeparator();
173
+					contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table.gif", "$lang_table_desc", "mceInsertTable", "insert");
174
+				}
175
+			}
176
+
177
+			contextMenu.show(x, y);
178
+		}, 10);
179
+
180
+		// Cancel default handeling
181
+		tinyMCE.cancelEvent(e);
182
+		return false;
183
+	},
184
+
185
+	_hideContextMenu : function() {
186
+		if (TinyMCE_ContextMenuPlugin._contextMenu)
187
+			TinyMCE_ContextMenuPlugin._contextMenu.hide();
188
+	},
189
+
190
+	_commandHandler : function(command, value) {
191
+		var cm = TinyMCE_ContextMenuPlugin._contextMenu;
192
+
193
+		cm.hide();
194
+
195
+		// UI must be true on these
196
+		var ui = false;
197
+		if (command == "mceInsertTable" || command == "mceTableCellProps" || command == "mceTableRowProps" || command == "mceTableMergeCells")
198
+			ui = true;
199
+
200
+		if (command == "Paste")
201
+			value = null;
202
+
203
+		if (tinyMCE.getParam("dialog_type") == "modal" && tinyMCE.isMSIE) {
204
+			// Cell properties will generate access denied error is this isn't done?!
205
+			window.setTimeout(function() {
206
+				cm.inst.execCommand(command, ui, value);
207
+			}, 100);
208
+		} else
209
+			cm.inst.execCommand(command, ui, value);
210
+	}
211
+};
212
+
213
+tinyMCE.addPlugin("contextmenu", TinyMCE_ContextMenuPlugin);
214
+
215
+// Context menu class
216
+
217
+function TinyMCE_ContextMenu(settings) {
218
+	var doc, self = this;
219
+
220
+	// Default value function
221
+	function defParam(key, def_val) {
222
+		settings[key] = typeof(settings[key]) != "undefined" ? settings[key] : def_val;
223
+	}
224
+
225
+	this.isMSIE = (navigator.appName == "Microsoft Internet Explorer");
226
+
227
+	// Setup contextmenu div
228
+	this.contextMenuDiv = document.createElement("div");
229
+	this.contextMenuDiv.className = "contextMenu";
230
+	this.contextMenuDiv.setAttribute("class", "contextMenu");
231
+	this.contextMenuDiv.style.display = "none";
232
+	this.contextMenuDiv.style.position = 'absolute';
233
+	this.contextMenuDiv.style.zindex = 1000;
234
+	this.contextMenuDiv.style.left = '0';
235
+	this.contextMenuDiv.style.top = '0';
236
+	this.contextMenuDiv.unselectable = "on";
237
+
238
+	document.body.appendChild(this.contextMenuDiv);
239
+
240
+	// Setup default values
241
+	defParam("commandhandler", "");
242
+	defParam("spacer_image", "images/spacer.gif");
243
+
244
+	this.items = new Array();
245
+	this.settings = settings;
246
+	this.html = "";
247
+
248
+	// IE Popup
249
+	if (tinyMCE.isMSIE && !tinyMCE.isMSIE5_0 && !tinyMCE.isOpera) {
250
+		this.pop = window.createPopup();
251
+		doc = this.pop.document;
252
+		doc.open();
253
+		doc.write('<html><head><link href="' + tinyMCE.baseURL + '/plugins/contextmenu/css/contextmenu.css" rel="stylesheet" type="text/css" /></head><body unselectable="yes" class="contextMenuIEPopup"></body></html>');
254
+		doc.close();
255
+	}
256
+};
257
+
258
+TinyMCE_ContextMenu.prototype = {
259
+	clearAll : function() {
260
+		this.html = "";
261
+		this.contextMenuDiv.innerHTML = "";
262
+	},
263
+
264
+	addSeparator : function() {
265
+		this.html += '<tr class="contextMenuItem"><td class="contextMenuIcon"><img src="' + this.settings['spacer_image'] + '" width="20" height="1" class="contextMenuImage" /></td><td><img class="contextMenuSeparator" width="1" height="1" src="' + this.settings['spacer_image'] + '" /></td></tr>';
266
+	},
267
+
268
+	addItem : function(icon, title, command, value, disabled) {
269
+		if (title.charAt(0) == '$')
270
+			title = tinyMCE.getLang(title.substring(1));
271
+
272
+		var onMouseDown = '';
273
+		var html = '';
274
+
275
+		if (tinyMCE.isMSIE && !tinyMCE.isMSIE5_0)
276
+			onMouseDown = 'contextMenu.execCommand(\'' + command + '\', \'' + value + '\');return false;';
277
+		else
278
+			onMouseDown = this.settings['commandhandler'] + '(\'' + command + '\', \'' + value + '\');return false;';
279
+
280
+		if (icon == "")
281
+			icon = this.settings['spacer_image'];
282
+
283
+		if (!disabled)
284
+			html += '<tr class="contextMenuItem">';
285
+		else
286
+			html += '<tr class="contextMenuItemDisabled">';
287
+
288
+		html += '<td class="contextMenuIcon"><img src="' + icon + '" width="20" height="20" class="contextMenuImage" /></td>';
289
+		html += '<td><div class="contextMenuText">';
290
+		html += '<a href="javascript:void(0);" onclick="' + onMouseDown + '" onmousedown="return false;">&#160;';
291
+
292
+		// Add text
293
+		html += title;
294
+
295
+		html += '&#160;</a>';
296
+		html += '</div></td>';
297
+		html += '</tr>';
298
+
299
+		// Add to main
300
+		this.html += html;
301
+	},
302
+
303
+	show : function(x, y) {
304
+		var vp, width, height, yo;
305
+
306
+		if (this.html == "")
307
+			return;
308
+
309
+		var html = '';
310
+
311
+		html += '<a href="#"></a><table border="0" cellpadding="0" cellspacing="0">';
312
+		html += this.html;
313
+		html += '</table>';
314
+
315
+		this.contextMenuDiv.innerHTML = html;
316
+
317
+		// Get dimensions
318
+		this.contextMenuDiv.style.display = "block";
319
+		width = this.contextMenuDiv.offsetWidth;
320
+		height = this.contextMenuDiv.offsetHeight;
321
+		this.contextMenuDiv.style.display = "none";
322
+
323
+		if (tinyMCE.isMSIE && !tinyMCE.isMSIE5_0 && !tinyMCE.isOpera) {
324
+			// Setup popup and show
325
+			this.pop.document.body.innerHTML = '<div class="contextMenu">' + html + "</div>";
326
+			this.pop.document.tinyMCE = tinyMCE;
327
+			this.pop.document.contextMenu = this;
328
+			this.pop.show(x, y, width, height);
329
+		} else {
330
+			vp = this.getViewPort();
331
+			yo = tinyMCE.isMSIE5_0 ? document.body.scrollTop : self.pageYOffset;
332
+			this.contextMenuDiv.style.left = (x > vp.left + vp.width - width ? vp.left + vp.width - width : x) + 'px';
333
+			this.contextMenuDiv.style.top = (y > vp.top + vp.height - height ? vp.top + vp.height - height : y) + 'px';
334
+			this.contextMenuDiv.style.display = "block";
335
+		}
336
+	},
337
+
338
+	getViewPort : function() {
339
+		return {
340
+			left : self.pageXOffset || self.document.documentElement.scrollLeft || self.document.body.scrollLeft,
341
+			top: self.pageYOffset || self.document.documentElement.scrollTop || self.document.body.scrollTop,
342
+			width : document.documentElement.offsetWidth || document.body.offsetWidth,
343
+			height : self.innerHeight || document.documentElement.clientHeight || document.body.clientHeight
344
+		};
345
+	},
346
+
347
+	hide : function() {
348
+		if (tinyMCE.isMSIE && !tinyMCE.isMSIE5_0 && !tinyMCE.isOpera)
349
+			this.pop.hide();
350
+		else
351
+			this.contextMenuDiv.style.display = "none";
352
+	},
353
+
354
+	execCommand : function(command, value) {
355
+		eval(this.settings['commandhandler'] + "(command, value);");
356
+	}
357
+};

BIN
admin/scripts/tiny_mce/plugins/contextmenu/images/spacer.gif View File


+ 1 - 0
admin/scripts/tiny_mce/plugins/contextmenu/readme.txt View File

@@ -0,0 +1 @@
1
+Check the TinyMCE documentation for details on this plugin.

+ 117 - 0
admin/scripts/tiny_mce/plugins/devkit/css/devkit.css View File

@@ -0,0 +1,117 @@
1
+body {
2
+	overflow: hidden;
3
+}
4
+
5
+h1 {
6
+	font-size: 14px;
7
+	margin: 0 0 10px 0;
8
+}
9
+
10
+h2 {
11
+	font-size: 12px;
12
+	margin: 3px 0 3px 0;
13
+}
14
+
15
+h3 {
16
+	font-size: 11px;
17
+	margin: 3px 0 3px 0;
18
+}
19
+
20
+#log {
21
+	font-family: Verdana;
22
+	border: 1px solid gray;
23
+	width: 100%; height: 240px;
24
+	overflow: scroll;
25
+	white-space: nowrap;
26
+}
27
+
28
+#log span {
29
+	display: block;
30
+}
31
+
32
+#log span.msg {
33
+	float: left;
34
+}
35
+
36
+#log span.time {
37
+	float: left;
38
+}
39
+
40
+#log br {
41
+	clear: both;
42
+}
43
+
44
+#logfilter {
45
+	width: 350px;
46
+}
47
+
48
+#logenabled {
49
+	border: 0;
50
+}
51
+
52
+#settings_panel span, #info_panel span, #content_panel span, #command_states_panel span, #undo_redo_panel span {
53
+	display: block;
54
+	margin: 5px 0 5px 0;
55
+}
56
+
57
+div.data {
58
+	width: 100%; height: 240px;
59
+	overflow: scroll;
60
+	border: 1px solid gray;
61
+}
62
+
63
+#misc_panel div.data {
64
+	height: 270px;
65
+}
66
+
67
+.data input {
68
+	width: 265px;
69
+	border: 0;
70
+}
71
+
72
+.data h2 {
73
+	margin-left: 5px;
74
+}
75
+
76
+.data h3 {
77
+	margin-left: 7px;
78
+}
79
+
80
+.data div {
81
+	margin-left: 7px;
82
+}
83
+
84
+.data table {
85
+	margin: 0 0 15px 15px;
86
+}
87
+
88
+.data p {
89
+	margin: 0; padding: 0;
90
+	margin-top: 5px;
91
+	margin-left: 5px;
92
+}
93
+
94
+table, td {
95
+	border: 1px solid gray;
96
+	border-collapse: collapse;
97
+}
98
+
99
+#flip {
100
+	position: absolute;
101
+	left: 295; top: 384px;
102
+}
103
+
104
+.bspec {
105
+	color: gray;
106
+}
107
+
108
+.dep {
109
+	color: #880000;
110
+}
111
+
112
+.col1 {
113
+	width: 265px;
114
+}
115
+
116
+div.undodata {
117
+}

+ 15 - 0
admin/scripts/tiny_mce/plugins/devkit/css/devkit_ui.css View File

@@ -0,0 +1,15 @@
1
+#devkit {
2
+	position: absolute;
3
+	top: -385px; right: 0;
4
+	width: 640px; height: 390px;
5
+	border: 1px solid black;
6
+	z-index: 10000;
7
+}
8
+
9
+.devkitup {
10
+	top: -385px !important;
11
+}
12
+
13
+.devkitdown {
14
+	top: 0 !important;
15
+}

+ 140 - 0
admin/scripts/tiny_mce/plugins/devkit/devkit.htm View File

@@ -0,0 +1,140 @@
1
+<html xmlns="http://www.w3.org/1999/xhtml">
2
+<head>
3
+	<title>{$lang_devkit_title}</title>
4
+	<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
5
+	<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
6
+	<script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
7
+	<script language="javascript" type="text/javascript" src="jscripts/devkit.js"></script>
8
+	<script language="javascript" type="text/javascript" src="jscripts/diff.js"></script>
9
+	<link href="css/devkit.css" rel="stylesheet" type="text/css" />
10
+	<base target="_self" />
11
+</head>
12
+<body id="devkit" onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
13
+    <form action="#">
14
+		<h1>{$lang_devkit_title}</h1>
15
+
16
+		<div class="tabs">
17
+			<ul>
18
+				<li id="log_tab" class="current"><span><a href="javascript:mcTabs.displayTab('log_tab','log_panel');" onmousedown="return false;">{$lang_devkit_log_tab}</a></span></li>
19
+				<li id="info_tab"><span><a href="javascript:mcTabs.displayTab('info_tab','info_panel');" onmousedown="return false;">{$lang_devkit_info_tab}</a></span></li>
20
+				<li id="settings_tab"><span><a href="javascript:mcTabs.displayTab('settings_tab','settings_panel');" onmousedown="return false;">{$lang_devkit_settings_tab}</a></span></li>
21
+				<li id="content_tab"><span><a href="javascript:mcTabs.displayTab('content_tab','content_panel');" onmousedown="return false;">{$lang_devkit_content_tab}</a></span></li>
22
+				<!-- <li id="command_states_tab"><span><a href="javascript:mcTabs.displayTab('command_states_tab','command_states_panel');" onmousedown="return false;">{$lang_devkit_command_states_tab}</a></span></li> -->
23
+				<li id="undo_redo_tab"><span><a href="javascript:mcTabs.displayTab('undo_redo_tab','undo_redo_panel');" onmousedown="return false;">{$lang_devkit_undo_redo_tab}</a></span></li>
24
+				<li id="misc_tab"><span><a href="javascript:mcTabs.displayTab('misc_tab','misc_panel');" onmousedown="return false;">{$lang_devkit_misc_tab}</a></span></li>
25
+			</ul>
26
+		</div>
27
+
28
+		<div class="panel_wrapper">
29
+			<div id="log_panel" class="panel current">
30
+				<fieldset>
31
+					<legend>{$lang_devkit_log_tab}</legend>
32
+
33
+					<div style="float: left">
34
+						<label>{$lang_devkit_filter} </label><input type="text" id="logfilter" name="logfilter" value="" onchange="changeFilter(this.value);" />
35
+					</div>
36
+
37
+					<div style="float: left">
38
+						<input type="checkbox" id="logenabled" name="logenabled" value="true" checked="checked" onclick="toggleLog(this.checked);" />
39
+					</div>
40
+
41
+					<div style="float: right">
42
+						<a href="javascript:clearLog();">[{$lang_devkit_clear_log}]</a>
43
+					</div>
44
+
45
+					<br style="clear: both" />
46
+
47
+					<div id="log">
48
+					</div>
49
+
50
+					<input type="checkbox" id="debug_events" name="debug_events" class="checkbox" onclick="toggleDebugEvents(this.checked);" /><label for="debug_events" onclick="toggleDebugEvents(this.form.debug_events.checked);">{$lang_devkit_debug_events}</label>
51
+				</fieldset>
52
+			</div>
53
+
54
+			<div id="info_panel" class="panel">
55
+				<fieldset>
56
+					<legend>{$lang_devkit_info_tab}</legend>
57
+
58
+					<span><a href="javascript:renderInfo();">[{$lang_devkit_refresh}]</a></span>
59
+
60
+					<div id="info" class="data">
61
+						<p>{$lang_devkit_info_help}</p>
62
+					</div>
63
+				</fieldset>
64
+			</div>
65
+
66
+			<div id="settings_panel" class="panel">
67
+			<fieldset>
68
+					<legend>{$lang_devkit_settings_tab}</legend>
69
+
70
+					<span><a href="javascript:renderSettings();">[{$lang_devkit_refresh}]</a></span>
71
+
72
+					<div id="settings" class="data">
73
+						<p>{$lang_devkit_settings_help}</p>
74
+					</div>
75
+				</fieldset>
76
+			</div>
77
+
78
+			<div id="content_panel" class="panel">
79
+			<fieldset>
80
+					<legend>{$lang_devkit_content_tab}</legend>
81
+
82
+					<span><a href="javascript:renderContent();">[{$lang_devkit_refresh}]</a></span>
83
+
84
+					<div id="content" class="data">
85
+						<p>{$lang_devkit_content_help}</p>
86
+					</div>
87
+				</fieldset>
88
+			</div>
89
+
90
+			<div id="command_states_panel" class="panel">
91
+			<fieldset>
92
+					<legend>{$lang_devkit_command_states_tab}</legend>
93
+
94
+					<span><a href="javascript:renderCommandStates();">[{$lang_devkit_refresh}]</a></span>
95
+
96
+					<div id="command_states" class="data">
97
+						<p>{$lang_devkit_command_states_help}</p>
98
+					</div>
99
+				</fieldset>
100
+			</div>
101
+
102
+			<div id="undo_redo_panel" class="panel">
103
+				<fieldset>
104
+					<legend>{$lang_devkit_undo_redo_tab}</legend>
105
+
106
+					<span><a href="javascript:renderUndoRedo();">[{$lang_devkit_refresh}]</a></span>
107
+
108
+					<div id="undo_redo" class="data">
109
+						<p>{$lang_devkit_undo_redo_help}</p>
110
+					</div>
111
+
112
+					<input type="checkbox" id="undo_diff" name="undo_diff" class="checkbox" /><label for="undo_diff">{$lang_devkit_undo_diff}</label>
113
+				</fieldset>
114
+			</div>
115
+
116
+			<div id="misc_panel" class="panel">
117
+				<fieldset>
118
+					<legend>{$lang_devkit_misc_tab}</legend>
119
+
120
+					<div class="data">
121
+						<p>{$lang_devkit_misc_help}</p>
122
+						<hr />
123
+						<p>Selection: <a href="#" onmousedown="return storeSelection();">[Store selection]</a> <a href="#" onmousedown="return restoreSelection();">[Restore selection]</a></p>
124
+						<hr />
125
+						<div><strong>Insert custom HTML content</strong></div>
126
+						<div><textarea id="htmlcont" name="htmlcont" style="width: 90%" rows="5"></textarea></div>
127
+						<div><a href="#" onclick="return tinyMCE.execCommand('mceInsertContent',false,document.getElementById('htmlcont').value);">[Insert content]</a></div>
128
+						<hr />
129
+						<div><strong>Eval JS:</strong></div>
130
+						<div><textarea id="jscont" name="jscont" style="width: 90%" rows="5">tinyMCE.execCommand('Bold',false,null);</textarea></div>
131
+						<div><a href="#" onclick="return parent.window.eval(document.getElementById('jscont').value);">[Evaluate]</a></div>
132
+					</div>
133
+				</fieldset>
134
+			</div>
135
+		</div>
136
+    </form>
137
+
138
+	<div id="flip"><a href="javascript:toggleFlip();" onmousedown="return false;"><img id="flipbtn" src="images/flip_down.gif" border="0" /></a></div>
139
+</body>
140
+</html>

File diff suppressed because it is too large
+ 1 - 0
admin/scripts/tiny_mce/plugins/devkit/editor_plugin.js


+ 325 - 0
admin/scripts/tiny_mce/plugins/devkit/editor_plugin_src.js View File

@@ -0,0 +1,325 @@
1
+/**
2
+ * $Id: editor_plugin_src.js 42 2006-08-08 14:32:24Z spocke $
3
+ *
4
+ * @author Moxiecode
5
+ * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
6
+ */
7
+
8
+tinyMCE.importPluginLanguagePack('devkit');
9
+
10
+var TinyMCE_DevKitPlugin = {
11
+	_logFilter : '\\[(importCSS|execCommand|execInstanceCommand|debug)\\]',
12
+	_logPadding : '',
13
+	_startTime : null,
14
+	_benchMark : false,
15
+	_winLoaded : false,
16
+	_isDebugEvents : false,
17
+
18
+	getInfo : function() {
19
+		return {
20
+			longname : 'Development Kit',
21
+			author : 'Moxiecode Systems AB',
22
+			authorurl : 'http://tinymce.moxiecode.com',
23
+			infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/devkit',
24
+			version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
25
+		};
26
+	},
27
+
28
+	initInstance : function(inst) {
29
+		this._setup();
30
+	},
31
+
32
+	_setup : function() {
33
+		if (this._loaded)
34
+			return;
35
+
36
+		this._loaded = true;
37
+
38
+		// Register a document reference for more easy access in the FF DOM inspector
39
+		document.___TinyMCE = tinyMCE;
40
+
41
+		// Setup devkit by settings
42
+		this._logFilter = tinyMCE.getParam('devkit_log_filter', this._logFilter);
43
+		this._benchMark = tinyMCE.getParam('devkit_bench_mark', false);
44
+
45
+		var ifr = document.createElement('iframe');
46
+
47
+		ifr.setAttribute("id", "devkit");
48
+		ifr.setAttribute("frameBorder", "0");
49
+		ifr.setAttribute("src", tinyMCE.baseURL + '/plugins/devkit/devkit.htm');
50
+
51
+		document.body.appendChild(ifr);
52
+
53
+		// Workaround for strange IE reload bug
54
+		//if (tinyMCE.isRealIE)
55
+		//	document.getElementById('devkit').outerHTML = document.getElementById('devkit').outerHTML;
56
+
57
+		tinyMCE.importCSS(document, tinyMCE.baseURL + '/plugins/devkit/css/devkit_ui.css');
58
+	},
59
+
60
+	_start : function() {
61
+		this._logPadding += '\u00a0';
62
+
63
+		return new Date().getTime();
64
+	},
65
+
66
+	_end : function(st) {
67
+		if (this._logPadding.length > 0)
68
+			this._logPadding = this._logPadding.substring(0, this._logPadding.length - 1);
69
+
70
+		if (this._benchMark)
71
+			this._log("benchmark", "Execution time: " + (new Date().getTime() - st));
72
+	},
73
+
74
+	_log : function(t) {
75
+		var m, a, i, e = document.getElementById('devkit'), now = new Date().getTime();
76
+
77
+		if (!this._startTime)
78
+			this._startTime = now;
79
+
80
+		m = (this._logPadding.length > 1 ? this._logPadding : '') + '[' + (now - this._startTime) + '] [' + t + '] ';
81
+
82
+		a = this._log.arguments;
83
+		for (i=1; i<a.length; i++) {
84
+			if (typeof(a[i]) == 'undefined')
85
+				continue;
86
+
87
+			if (i > 1)
88
+				m += ', ';
89
+
90
+			m += a[i];
91
+		}
92
+
93
+		if (!new RegExp(this._logFilter, 'gi').test(m)) {
94
+			if (this._logPadding.length > 0)
95
+				this._logPadding = this._logPadding.substring(0, this._logPadding.length - 1);
96
+
97
+			return;
98
+		}
99
+
100
+		if (!this._winLoaded)
101
+			tinyMCE.log[tinyMCE.log.length] = m;
102
+		else
103
+			e.contentWindow.debug(m);
104
+	},
105
+
106
+	_debugEvents : function(s) {
107
+		var i, ld, inst, n, ev = ['CheckboxStateChange','DOMAttrModified','DOMMenuItemActive',
108
+				'DOMMenuItemInactive','DOMMouseScroll','DOMNodeInserted','DOMNodeRemoved',
109
+				'RadioStateChange','blur','broadcast','change','click','close','command',
110
+				'commandupdate','contextmenu','dblclick','dragdrop','dragenter','dragexit',
111
+				'draggesture','dragover','focus','input','keydown','keypress','keyup','load',
112
+				'mousedown','mouseout','mouseover','mouseup','overflow','overflowchanged','popuphidden',
113
+				'popuphiding','popupshowing','popupshown','select','syncfrompreference','synctopreference',
114
+				'underflow','unload','abort','activate','afterprint','afterupdate','beforeactivate',
115
+				'beforecopy','beforecut','beforedeactivate','beforeeditfocus','beforepaste','beforeprint',
116
+				'beforeunload','beforeupdate','bounce','cellchange','controlselect','copy','cut',
117
+				'dataavailable','datasetchanged','datasetcomplete','deactivate','dragend','dragleave',
118
+				'dragstart','drop','error','errorupdate','filterchange','finish','focusin','focusout',
119
+				'help','layoutcomplete','losecapture','mouseenter','mouseleave','mousewheel',
120
+				'move','moveend','movestart','paste','propertychange','readystatechange','reset','resize',
121
+				'resizeend','resizestart','rowenter','rowexit','rowsdelete','rowsinserted','scroll',
122
+				'selectionchange','selectstart','start','stop','submit'];
123
+		// mousemove
124
+
125
+		if (TinyMCE_DevKitPlugin._isDebugEvents == s)
126
+			return;
127
+
128
+		TinyMCE_DevKitPlugin._isDebugEvents = s;
129
+
130
+		for (n in tinyMCE.instances) {
131
+			inst = tinyMCE.instances[n];
132
+
133
+			if (!tinyMCE.isInstance(inst) || inst.getDoc() == ld)
134
+				continue;
135
+
136
+			ld = inst.getDoc();
137
+
138
+			for (i=0; i<ev.length; i++) {
139
+				if (s)
140
+					tinyMCE.addEvent(ld, ev[i], TinyMCE_DevKitPlugin._debugEvent);
141
+				else
142
+					tinyMCE.removeEvent(ld, ev[i], TinyMCE_DevKitPlugin._debugEvent);
143
+			}
144
+		}
145
+	},
146
+
147
+	_debugEvent : function(e) {
148
+		var t;
149
+
150
+		e = e ? e : tinyMCE.selectedInstance.getWin().event;
151
+		t = e.srcElement ? e.srcElement : e.target;
152
+
153
+		tinyMCE.debug(e.type, t ? t.nodeName : '');
154
+	},
155
+
156
+	_serialize : function(o) {
157
+		var i, v, s = TinyMCE_DevKitPlugin._serialize;
158
+
159
+		if (o == null)
160
+			return 'null';
161
+
162
+		switch (typeof o) {
163
+			case 'string':
164
+				v = '\bb\tt\nn\ff\rr\""\'\'\\\\';
165
+
166
+				return '"' + o.replace(new RegExp('([\u0080-\uFFFF\\x00-\\x1f\\"])', 'g'), function(a, b) {
167
+					i = v.indexOf(b);
168
+
169
+					if (i+1)
170
+						return '\\' + v.charAt(i + 1);
171
+
172
+					a = b.charCodeAt().toString(16);
173
+
174
+					return '\\u' + '0000'.substring(a.length) + a;
175
+				}) + '"';
176
+
177
+			case 'object':
178
+				if (o instanceof Array) {
179
+					for (i=0, v = '['; i<o.length; i++)
180
+						v += (i > 0 ? ',' : '') + s(o[i]);
181
+
182
+					return v + ']';
183
+				}
184
+
185
+				v = '{';
186
+
187
+				for (i in o)
188
+					v += typeof o[i] != 'function' ? (v.length > 1 ? ',"' : '"') + i + '":' + s(o[i]) : '';
189
+
190
+				return v + '}';
191
+		}
192
+
193
+		return '' + o;
194
+	}
195
+};
196
+
197
+// Patch and piggy back functions
198
+tinyMCE.__debug = tinyMCE.debug;
199
+tinyMCE.debug = function() {
200
+	var a, i, m = '', now = new Date().getTime(), start = TinyMCE_DevKitPlugin._startTime;
201
+
202
+	if (!start)
203
+		TinyMCE_DevKitPlugin._startTime = start = now;
204
+
205
+	a = this.debug.arguments;
206
+	for (i=0; i<a.length; i++) {
207
+		if (typeof(a[i]) == 'undefined')
208
+			continue;
209
+
210
+		if (i > 0)
211
+			m += ', ';
212
+
213
+		m += a[i];
214
+	}
215
+
216
+	TinyMCE_DevKitPlugin._log('debug', m);
217
+};
218
+
219
+tinyMCE.dump = function(o) {
220
+	tinyMCE.debug(TinyMCE_DevKitPlugin._serialize(o));
221
+};
222
+
223
+tinyMCE.sleep = function(t) {
224
+	var s = new Date().getTime(), b;
225
+
226
+	while (new Date().getTime() - s < t) b=1;
227
+};
228
+
229
+tinyMCE.__execCommand = tinyMCE.execCommand;
230
+tinyMCE.execCommand = function(command, user_interface, value) {
231
+	var r, st, dk = TinyMCE_DevKitPlugin;
232
+
233
+	st = dk._start();
234
+	dk._log('execCommand', command, user_interface, value);
235
+	r = tinyMCE.__execCommand(command, user_interface, value);
236
+	dk._end(st);
237
+
238
+	return r;
239
+};
240
+
241
+tinyMCE.__execInstanceCommand = tinyMCE.execInstanceCommand;
242
+tinyMCE.execInstanceCommand = function(editor_id, command, user_interface, value, focus) {
243
+	var r, st, dk = TinyMCE_DevKitPlugin;
244
+
245
+	st = dk._start();
246
+	dk._log('execInstanceCommand', editor_id, command, user_interface, value);
247
+	r = tinyMCE.__execInstanceCommand(editor_id, command, user_interface, value);
248
+	dk._end(st);
249
+
250
+	return r;
251
+};
252
+
253
+TinyMCE_Engine.prototype.__handleEvent = TinyMCE_Engine.prototype.handleEvent;
254
+TinyMCE_Engine.prototype.handleEvent = function(e) {
255
+	var r, st, dk = TinyMCE_DevKitPlugin;
256
+
257
+	st = dk._start();
258
+	dk._log('handleEvent', e.type);
259
+	r = tinyMCE.__handleEvent(e);
260
+	dk._end(st);
261
+
262
+	return r;
263
+};
264
+
265
+tinyMCE.__importCSS = tinyMCE.importCSS;
266
+tinyMCE.importCSS = function(doc, css) {
267
+	var r, st, dk = TinyMCE_DevKitPlugin;
268
+
269
+	st = dk._start();
270
+	dk._log('importCSS', doc, css);
271
+	r = tinyMCE.__importCSS(doc, css);
272
+	dk._end(st);
273
+
274
+	return r;
275
+};
276
+
277
+tinyMCE.__triggerNodeChange = tinyMCE.triggerNodeChange;
278
+tinyMCE.triggerNodeChange = function(focus, setup_content) {
279
+	var r, st, dk = TinyMCE_DevKitPlugin;
280
+
281
+	st = dk._start();
282
+	dk._log('triggerNodeChange', focus, setup_content);
283
+	r = tinyMCE.__triggerNodeChange(focus, setup_content);
284
+	dk._end(st);
285
+
286
+	return r;
287
+};
288
+
289
+tinyMCE.__dispatchCallback = tinyMCE.dispatchCallback;
290
+tinyMCE.dispatchCallback = function(i, p, n) {
291
+	var r, st, dk = TinyMCE_DevKitPlugin;
292
+
293
+	st = dk._start();
294
+	dk._log('dispatchCallback', i, p, n);
295
+	r = tinyMCE.__dispatchCallback(i, p, n);
296
+	dk._end(st);
297
+
298
+	return r;
299
+};
300
+
301
+tinyMCE.__executeCallback = tinyMCE.executeCallback;
302
+tinyMCE.executeCallback = function(i, p, n) {
303
+	var r, st, dk = TinyMCE_DevKitPlugin;
304
+
305
+	st = dk._start();
306
+	dk._log('executeCallback', i, p, n);
307
+	r = tinyMCE.__executeCallback(i, p, n);
308
+	dk._end(st);
309
+
310
+	return r;
311
+};
312
+
313
+tinyMCE.__execCommandCallback = tinyMCE.execCommandCallback;
314
+tinyMCE.execCommandCallback = function(i, p, n) {
315
+	var r, st, dk = TinyMCE_DevKitPlugin;
316
+
317
+	st = dk._start();
318
+	dk._log('execCommandCallback', i, p, n);
319
+	r = tinyMCE.__execCommandCallback(i, p, n);
320
+	dk._end(st);
321
+
322
+	return r;
323
+};
324
+
325
+tinyMCE.addPlugin("devkit", TinyMCE_DevKitPlugin);

BIN
admin/scripts/tiny_mce/plugins/devkit/images/flip_down.gif View File


BIN
admin/scripts/tiny_mce/plugins/devkit/images/flip_up.gif View File


File diff suppressed because it is too large
+ 331 - 0
admin/scripts/tiny_mce/plugins/devkit/jscripts/devkit.js


File diff suppressed because it is too large
+ 1192 - 0
admin/scripts/tiny_mce/plugins/devkit/jscripts/diff.js


+ 23 - 0
admin/scripts/tiny_mce/plugins/devkit/langs/en.js View File

@@ -0,0 +1,23 @@
1
+// UK lang variables
2
+
3
+tinyMCE.addToLang('devkit',{
4
+title : 'TinyMCE Development Kit',
5
+info_tab : 'Info',
6
+settings_tab : 'Settings',
7
+log_tab : 'Log',
8
+content_tab : 'Content',
9
+command_states_tab : 'Commands',
10
+undo_redo_tab : 'Undo/Redo',
11
+misc_tab : 'Misc',
12
+filter : 'Filter:',
13
+clear_log : 'Clear log',
14
+refresh : 'Refresh',
15
+info_help : 'Press Refresh to view info.',
16
+settings_help : 'Press Refresh to display the settings array for each TinyMCE_Control instance.',
17
+content_help : 'Press Refresh to display the raw and cleaned HTML content for each TinyMCE_Control instance.',
18
+command_states_help : 'Press Refresh to display the current command states from inst.queryCommandState. This list will also mark unsupported commands.',
19
+undo_redo_help : 'Press Refresh to display the global and instance undo/redo levels.',
20
+misc_help : 'Here are various tools for debugging and development purposes.',
21
+debug_events : 'Debug events',
22
+undo_diff : 'Diff undo levels'
23
+});

File diff suppressed because it is too large
+ 1 - 0
admin/scripts/tiny_mce/plugins/directionality/editor_plugin.js


+ 90 - 0
admin/scripts/tiny_mce/plugins/directionality/editor_plugin_src.js View File

@@ -0,0 +1,90 @@
1
+/**
2
+ * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
3
+ *
4
+ * @author Moxiecode
5
+ * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
6
+ */
7
+
8
+/* Import plugin specific language pack */
9
+tinyMCE.importPluginLanguagePack('directionality');
10
+
11
+var TinyMCE_DirectionalityPlugin = {
12
+	getInfo : function() {
13
+		return {
14
+			longname : 'Directionality',
15
+			author : 'Moxiecode Systems AB',
16
+			authorurl : 'http://tinymce.moxiecode.com',
17
+			infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality',
18
+			version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
19
+		};
20
+	},
21
+
22
+	getControlHTML : function(cn) {
23
+		switch (cn) {
24
+			case "ltr":
25
+				return tinyMCE.getButtonHTML(cn, 'lang_directionality_ltr_desc', '{$pluginurl}/images/ltr.gif', 'mceDirectionLTR');
26
+
27
+			case "rtl":
28
+				return tinyMCE.getButtonHTML(cn, 'lang_directionality_rtl_desc', '{$pluginurl}/images/rtl.gif', 'mceDirectionRTL');
29
+		}
30
+
31
+		return "";
32
+	},
33
+
34
+	execCommand : function(editor_id, element, command, user_interface, value) {
35
+		// Handle commands
36
+		switch (command) {
37
+			case "mceDirectionLTR":
38
+				var inst = tinyMCE.getInstanceById(editor_id);
39
+				var elm = tinyMCE.getParentElement(inst.getFocusElement(), "p,div,td,h1,h2,h3,h4,h5,h6,pre,address");
40
+
41
+				if (elm)
42
+					elm.setAttribute("dir", "ltr");
43
+
44
+				tinyMCE.triggerNodeChange(false);
45
+				return true;
46
+
47
+			case "mceDirectionRTL":
48
+				var inst = tinyMCE.getInstanceById(editor_id);
49
+				var elm = tinyMCE.getParentElement(inst.getFocusElement(), "p,div,td,h1,h2,h3,h4,h5,h6,pre,address");
50
+
51
+				if (elm)
52
+					elm.setAttribute("dir", "rtl");
53
+
54
+				tinyMCE.triggerNodeChange(false);
55
+				return true;
56
+		}
57
+
58
+		// Pass to next handler in chain
59
+		return false;
60
+	},
61
+
62
+	handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
63
+		function getAttrib(elm, name) {
64
+			return elm.getAttribute(name) ? elm.getAttribute(name) : "";
65
+		}
66
+
67
+		if (node == null)
68
+			return;
69
+
70
+		var elm = tinyMCE.getParentElement(node, "p,div,td,h1,h2,h3,h4,h5,h6,pre,address");
71
+		if (!elm) {
72
+			tinyMCE.switchClass(editor_id + '_ltr', 'mceButtonDisabled');
73
+			tinyMCE.switchClass(editor_id + '_rtl', 'mceButtonDisabled');
74
+			return true;
75
+		}
76
+
77
+		tinyMCE.switchClass(editor_id + '_ltr', 'mceButtonNormal');
78
+		tinyMCE.switchClass(editor_id + '_rtl', 'mceButtonNormal');
79
+
80
+		var dir = getAttrib(elm, "dir");
81
+		if (dir == "ltr" || dir == "")
82
+			tinyMCE.switchClass(editor_id + '_ltr', 'mceButtonSelected');
83
+		else
84
+			tinyMCE.switchClass(editor_id + '_rtl', 'mceButtonSelected');
85
+
86
+		return true;
87
+	}
88
+};
89
+
90
+tinyMCE.addPlugin("directionality", TinyMCE_DirectionalityPlugin);

BIN
admin/scripts/tiny_mce/plugins/directionality/images/ltr.gif View File


BIN
admin/scripts/tiny_mce/plugins/directionality/images/rtl.gif View File


+ 6 - 0
admin/scripts/tiny_mce/plugins/directionality/langs/en.js View File

@@ -0,0 +1,6 @@
1
+// UK lang variables
2
+
3
+tinyMCE.addToLang('',{
4
+directionality_ltr_desc : 'Direction left to right',
5
+directionality_rtl_desc : 'Direction right to left'
6
+});

+ 1 - 0
admin/scripts/tiny_mce/plugins/directionality/readme.txt View File

@@ -0,0 +1 @@
1
+Check the TinyMCE documentation for details on this plugin.

File diff suppressed because it is too large
+ 1 - 0
admin/scripts/tiny_mce/plugins/emotions/editor_plugin.js


+ 63 - 0
admin/scripts/tiny_mce/plugins/emotions/editor_plugin_src.js View File

@@ -0,0 +1,63 @@
1
+/**
2
+ * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
3
+ *
4
+ * @author Moxiecode
5
+ * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
6
+ */
7
+
8
+/* Import plugin specific language pack */
9
+tinyMCE.importPluginLanguagePack('emotions');
10
+
11
+// Plucin static class
12
+var TinyMCE_EmotionsPlugin = {
13
+	getInfo : function() {
14
+		return {
15
+			longname : 'Emotions',
16
+			author : 'Moxiecode Systems AB',
17
+			authorurl : 'http://tinymce.moxiecode.com',
18
+			infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions',
19
+			version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
20
+		};
21
+	},
22
+
23
+	/**
24
+	 * Returns the HTML contents of the emotions control.
25
+	 */
26
+	getControlHTML : function(cn) {
27
+		switch (cn) {
28
+			case "emotions":
29
+				return tinyMCE.getButtonHTML(cn, 'lang_emotions_desc', '{$pluginurl}/images/emotions.gif', 'mceEmotion');
30
+		}
31
+
32
+		return "";
33
+	},
34
+
35
+	/**
36
+	 * Executes the mceEmotion command.
37
+	 */
38
+	execCommand : function(editor_id, element, command, user_interface, value) {
39
+		// Handle commands
40
+		switch (command) {
41
+			case "mceEmotion":
42
+				var template = new Array();
43
+
44
+				template['file'] = '../../plugins/emotions/emotions.htm'; // Relative to theme
45
+				template['width'] = 250;
46
+				template['height'] = 160;
47
+
48
+				// Language specific width and height addons
49
+				template['width'] += tinyMCE.getLang('lang_emotions_delta_width', 0);
50
+				template['height'] += tinyMCE.getLang('lang_emotions_delta_height', 0);
51
+
52
+				tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"});
53
+
54
+				return true;
55
+		}
56
+
57
+		// Pass to next handler in chain
58
+		return false;
59
+	}
60
+};
61
+
62
+// Register plugin
63
+tinyMCE.addPlugin('emotions', TinyMCE_EmotionsPlugin);

+ 40 - 0
admin/scripts/tiny_mce/plugins/emotions/emotions.htm View File

@@ -0,0 +1,40 @@
1
+<html xmlns="http://www.w3.org/1999/xhtml">
2
+<head>
3
+	<title>{$lang_emotions_title}</title>
4
+	<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
5
+	<script language="javascript" type="text/javascript" src="jscripts/functions.js"></script>
6
+	<base target="_self" />
7
+</head>
8
+<body onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
9
+	<div align="center">
10
+		<div class="title">{$lang_emotions_title}:<br /><br /></div>
11
+
12
+		<table border="0" cellspacing="0" cellpadding="4">
13
+		  <tr>
14
+			<td><a href="javascript:insertEmotion('smiley-cool.gif','lang_emotions_cool');"><img src="images/smiley-cool.gif" width="18" height="18" border="0" alt="{$lang_emotions_cool}" title="{$lang_emotions_cool}" /></a></td>
15
+			<td><a href="javascript:insertEmotion('smiley-cry.gif','lang_emotions_cry');"><img src="images/smiley-cry.gif" width="18" height="18" border="0" alt="{$lang_emotions_cry}" title="{$lang_emotions_cry}" /></a></td>
16
+			<td><a href="javascript:insertEmotion('smiley-embarassed.gif','lang_emotions_embarassed');"><img src="images/smiley-embarassed.gif" width="18" height="18" border="0" alt="{$lang_emotions_embarassed}" title="{$lang_emotions_embarassed}" /></a></td>
17
+			<td><a href="javascript:insertEmotion('smiley-foot-in-mouth.gif','lang_emotions_foot_in_mouth');"><img src="images/smiley-foot-in-mouth.gif" width="18" height="18" border="0" alt="{$lang_emotions_foot_in_mouth}" title="{$lang_emotions_foot_in_mouth}" /></a></td>
18
+		  </tr>
19
+		  <tr>
20
+			<td><a href="javascript:insertEmotion('smiley-frown.gif','lang_emotions_frown');"><img src="images/smiley-frown.gif" width="18" height="18" border="0" alt="{$lang_emotions_frown}" title="{$lang_emotions_frown}" /></a></td>
21
+			<td><a href="javascript:insertEmotion('smiley-innocent.gif','lang_emotions_innocent');"><img src="images/smiley-innocent.gif" width="18" height="18" border="0" alt="{$lang_emotions_innocent}" title="{$lang_emotions_innocent}" /></a></td>
22
+			<td><a href="javascript:insertEmotion('smiley-kiss.gif','lang_emotions_kiss');"><img src="images/smiley-kiss.gif" width="18" height="18" border="0" alt="{$lang_emotions_kiss}" title="{$lang_emotions_kiss}" /></a></td>
23
+			<td><a href="javascript:insertEmotion('smiley-laughing.gif','lang_emotions_laughing');"><img src="images/smiley-laughing.gif" width="18" height="18" border="0" alt="{$lang_emotions_laughing}" title="{$lang_emotions_laughing}" /></a></td>
24
+		  </tr>
25
+		  <tr>
26
+			<td><a href="javascript:insertEmotion('smiley-money-mouth.gif','lang_emotions_money_mouth');"><img src="images/smiley-money-mouth.gif" width="18" height="18" border="0" alt="{$lang_emotions_money_mouth}" title="{$lang_emotions_money_mouth}" /></a></td>
27
+			<td><a href="javascript:insertEmotion('smiley-sealed.gif','lang_emotions_sealed');"><img src="images/smiley-sealed.gif" width="18" height="18" border="0" alt="{$lang_emotions_sealed}" title="{$lang_emotions_sealed}" /></a></td>
28
+			<td><a href="javascript:insertEmotion('smiley-smile.gif','lang_emotions_smile');"><img src="images/smiley-smile.gif" width="18" height="18" border="0" alt="{$lang_emotions_smile}" title="{$lang_emotions_smile}" /></a></td>
29
+			<td><a href="javascript:insertEmotion('smiley-surprised.gif','lang_emotions_surprised');"><img src="images/smiley-surprised.gif" width="18" height="18" border="0" alt="{$lang_emotions_surprised}" title="{$lang_emotions_surprised}" /></a></td>
30
+		  </tr>
31
+		  <tr>
32
+			<td><a href="javascript:insertEmotion('smiley-tongue-out.gif','lang_emotions_tongue_out');"><img src="images/smiley-tongue-out.gif" width="18" height="18" border="0" alt="{$lang_emotions_tongue-out}" title="{$lang_emotions_tongue_out}" /></a></td>
33
+			<td><a href="javascript:insertEmotion('smiley-undecided.gif','lang_emotions_undecided');"><img src="images/smiley-undecided.gif" width="18" height="18" border="0" alt="{$lang_emotions_undecided}" title="{$lang_emotions_undecided}" /></a></td>
34
+			<td><a href="javascript:insertEmotion('smiley-wink.gif','lang_emotions_wink');"><img src="images/smiley-wink.gif" width="18" height="18" border="0" alt="{$lang_emotions_wink}" title="{$lang_emotions_wink}" /></a></td>
35
+			<td><a href="javascript:insertEmotion('smiley-yell.gif','lang_emotions_yell');"><img src="images/smiley-yell.gif" width="18" height="18" border="0" alt="{$lang_emotions_yell}" title="{$lang_emotions_yell}" /></a></td>
36
+		  </tr>
37
+		</table>
38
+	</div>
39
+</body>
40
+</html>

BIN
admin/scripts/tiny_mce/plugins/emotions/images/emotions.gif View File


+ 2 - 0
admin/scripts/tiny_mce/plugins/emotions/images/readme.txt View File

@@ -0,0 +1,2 @@
1
+These emotions where taken from Mozilla Thunderbird.
2
+I hope they don't get angry if I use them here after all this is a open source project aswell.

BIN
admin/scripts/tiny_mce/plugins/emotions/images/smiley-cool.gif View File


BIN
admin/scripts/tiny_mce/plugins/emotions/images/smiley-cry.gif View File


BIN
admin/scripts/tiny_mce/plugins/emotions/images/smiley-embarassed.gif View File


BIN
admin/scripts/tiny_mce/plugins/emotions/images/smiley-foot-in-mouth.gif View File


BIN
admin/scripts/tiny_mce/plugins/emotions/images/smiley-frown.gif View File


BIN
admin/scripts/tiny_mce/plugins/emotions/images/smiley-innocent.gif View File


BIN
admin/scripts/tiny_mce/plugins/emotions/images/smiley-kiss.gif View File


BIN
admin/scripts/tiny_mce/plugins/emotions/images/smiley-laughing.gif View File


BIN
admin/scripts/tiny_mce/plugins/emotions/images/smiley-money-mouth.gif View File


BIN
admin/scripts/tiny_mce/plugins/emotions/images/smiley-sealed.gif View File


BIN
admin/scripts/tiny_mce/plugins/emotions/images/smiley-smile.gif View File


BIN
admin/scripts/tiny_mce/plugins/emotions/images/smiley-surprised.gif View File


BIN
admin/scripts/tiny_mce/plugins/emotions/images/smiley-tongue-out.gif View File


BIN
admin/scripts/tiny_mce/plugins/emotions/images/smiley-undecided.gif View File


BIN
admin/scripts/tiny_mce/plugins/emotions/images/smiley-wink.gif View File


BIN
admin/scripts/tiny_mce/plugins/emotions/images/smiley-yell.gif View File


+ 21 - 0
admin/scripts/tiny_mce/plugins/emotions/jscripts/functions.js View File

@@ -0,0 +1,21 @@
1
+function init() {
2
+	tinyMCEPopup.resizeToInnerSize();
3
+}
4
+
5
+function insertEmotion(file_name, title) {
6
+	title = tinyMCE.getLang(title);
7
+
8
+	if (title == null)
9
+		title = "";
10
+
11
+	// XML encode
12
+	title = title.replace(/&/g, '&amp;');
13
+	title = title.replace(/\"/g, '&quot;');
14
+	title = title.replace(/</g, '&lt;');
15
+	title = title.replace(/>/g, '&gt;');
16
+
17
+	var html = '<img src="' + tinyMCE.baseURL + "/plugins/emotions/images/" + file_name + '" mce_src="' + tinyMCE.baseURL + "/plugins/emotions/images/" + file_name + '" border="0" alt="' + title + '" title="' + title + '" />';
18
+
19
+	tinyMCE.execCommand('mceInsertContent', false, html);
20
+	tinyMCEPopup.close();
21
+}

+ 22 - 0
admin/scripts/tiny_mce/plugins/emotions/langs/en.js View File

@@ -0,0 +1,22 @@
1
+// UK lang variables
2
+
3
+tinyMCE.addToLang('emotions',{
4
+title : 'Insert emotion',
5
+desc : 'Emotions',
6
+cool : 'Cool',
7
+cry : 'Cry',
8
+embarassed : 'Embarassed',
9
+foot_in_mouth : 'Foot in mouth',
10
+frown : 'Frown',
11
+innocent : 'Innocent',
12
+kiss : 'Kiss',
13
+laughing : 'Laughing',
14
+money_mouth : 'Money mouth',
15
+sealed : 'Sealed',
16
+smile : 'Smile',
17
+surprised : 'Surprised',
18
+tongue_out : 'Tongue out',
19
+undecided : 'Undecided',
20
+wink : 'Wink',
21
+yell : 'Yell'
22
+});

+ 1 - 0
admin/scripts/tiny_mce/plugins/emotions/readme.txt View File

@@ -0,0 +1 @@
1
+Check the TinyMCE documentation for details on this plugin.

+ 7 - 0
admin/scripts/tiny_mce/plugins/flash/css/content.css View File

@@ -0,0 +1,7 @@
1
+.mceItemFlash {
2
+	border: 1px dotted #cc0000;
3
+	background-image: url('../images/flash.gif');
4
+	background-position: center;
5
+	background-repeat: no-repeat;
6
+	background-color: #ffffcc;
7
+}

+ 11 - 0
admin/scripts/tiny_mce/plugins/flash/css/flash.css View File

@@ -0,0 +1,11 @@
1
+.panel_wrapper div.current {
2
+	height: 100px;
3
+}
4
+
5
+#width, #height {
6
+	width: 50px;
7
+}
8
+
9
+#file {
10
+	width: 250px;
11
+}

File diff suppressed because it is too large
+ 1 - 0
admin/scripts/tiny_mce/plugins/flash/editor_plugin.js


+ 285 - 0
admin/scripts/tiny_mce/plugins/flash/editor_plugin_src.js View File

@@ -0,0 +1,285 @@
1
+/**
2
+ * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
3
+ *
4
+ * @author Moxiecode
5
+ * @copyright Copyright © 2004-2007, Moxiecode Systems AB, All rights reserved.
6
+ */
7
+
8
+/* Import plugin specific language pack */
9
+tinyMCE.importPluginLanguagePack('flash');
10
+
11
+var TinyMCE_FlashPlugin = {
12
+	getInfo : function() {
13
+		return {
14
+			longname : 'Flash',
15
+			author : 'Moxiecode Systems AB',
16
+			authorurl : 'http://tinymce.moxiecode.com',
17
+			infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/flash',
18
+			version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
19
+		};
20
+	},
21
+
22
+	initInstance : function(inst) {
23
+		if (!tinyMCE.settings['flash_skip_plugin_css'])
24
+			tinyMCE.importCSS(inst.getDoc(), tinyMCE.baseURL + "/plugins/flash/css/content.css");
25
+	},
26
+
27
+	getControlHTML : function(cn) {
28
+		switch (cn) {
29
+			case "flash":
30
+				return tinyMCE.getButtonHTML(cn, 'lang_flash_desc', '{$pluginurl}/images/flash.gif', 'mceFlash');
31
+		}
32
+
33
+		return "";
34
+	},
35
+
36
+	execCommand : function(editor_id, element, command, user_interface, value) {
37
+		// Handle commands
38
+		switch (command) {
39
+			case "mceFlash":
40
+				var name = "", swffile = "", swfwidth = "", swfheight = "", action = "insert";
41
+				var template = new Array();
42
+				var inst = tinyMCE.getInstanceById(editor_id);
43
+				var focusElm = inst.getFocusElement();
44
+
45
+				template['file']   = '../../plugins/flash/flash.htm'; // Relative to theme
46
+				template['width']  = 430;
47
+				template['height'] = 175;
48
+
49
+				template['width'] += tinyMCE.getLang('lang_flash_delta_width', 0);
50
+				template['height'] += tinyMCE.getLang('lang_flash_delta_height', 0);
51
+
52
+				// Is selection a image
53
+				if (focusElm != null && focusElm.nodeName.toLowerCase() == "img") {
54
+					name = tinyMCE.getAttrib(focusElm, 'class');
55
+
56
+					if (name.indexOf('mceItemFlash') == -1) // Not a Flash
57
+						return true;
58
+
59
+					// Get rest of Flash items
60
+					swffile = tinyMCE.getAttrib(focusElm, 'alt');
61
+
62
+					if (tinyMCE.getParam('convert_urls'))
63
+						swffile = eval(tinyMCE.settings['urlconverter_callback'] + "(swffile, null, true);");
64
+
65
+					swfwidth = tinyMCE.getAttrib(focusElm, 'width');
66
+					swfheight = tinyMCE.getAttrib(focusElm, 'height');
67
+					action = "update";
68
+				}
69
+
70
+				tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes", swffile : swffile, swfwidth : swfwidth, swfheight : swfheight, action : action});
71
+			return true;
72
+	   }
73
+
74
+	   // Pass to next handler in chain
75
+	   return false;
76
+	},
77
+
78
+	cleanup : function(type, content) {
79
+		switch (type) {
80
+			case "insert_to_editor_dom":
81
+				// Force relative/absolute
82
+				if (tinyMCE.getParam('convert_urls')) {
83
+					var imgs = content.getElementsByTagName("img");
84
+					for (var i=0; i<imgs.length; i++) {
85
+						if (tinyMCE.getAttrib(imgs[i], "class") == "mceItemFlash") {
86
+							var src = tinyMCE.getAttrib(imgs[i], "alt");
87
+
88
+							if (tinyMCE.getParam('convert_urls'))
89
+								src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, null, true);");
90
+
91
+							imgs[i].setAttribute('alt', src);
92
+							imgs[i].setAttribute('title', src);
93
+						}
94
+					}
95
+				}
96
+				break;
97
+
98
+			case "get_from_editor_dom":
99
+				var imgs = content.getElementsByTagName("img");
100
+				for (var i=0; i<imgs.length; i++) {
101
+					if (tinyMCE.getAttrib(imgs[i], "class") == "mceItemFlash") {
102
+						var src = tinyMCE.getAttrib(imgs[i], "alt");
103
+
104
+						if (tinyMCE.getParam('convert_urls'))
105
+							src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, null, true);");
106
+
107
+						imgs[i].setAttribute('alt', src);
108
+						imgs[i].setAttribute('title', src);
109
+					}
110
+				}
111
+				break;
112
+
113
+			case "insert_to_editor":
114
+				var startPos = 0;
115
+				var embedList = new Array();
116
+
117
+				// Fix the embed and object elements
118
+				content = content.replace(new RegExp('<[ ]*embed','gi'),'<embed');
119
+				content = content.replace(new RegExp('<[ ]*/embed[ ]*>','gi'),'</embed>');
120
+				content = content.replace(new RegExp('<[ ]*object','gi'),'<object');
121
+				content = content.replace(new RegExp('<[ ]*/object[ ]*>','gi'),'</object>');
122
+
123
+				// Parse all embed tags
124
+				while ((startPos = content.indexOf('<embed', startPos+1)) != -1) {
125
+					var endPos = content.indexOf('>', startPos);
126
+					var attribs = TinyMCE_FlashPlugin._parseAttributes(content.substring(startPos + 6, endPos));
127
+					embedList[embedList.length] = attribs;
128
+				}
129
+
130
+				// Parse all object tags and replace them with images from the embed data
131
+				var index = 0;
132
+				while ((startPos = content.indexOf('<object', startPos)) != -1) {
133
+					if (index >= embedList.length)
134
+						break;
135
+
136
+					var attribs = embedList[index];
137
+
138
+					// Find end of object
139
+					endPos = content.indexOf('</object>', startPos);
140
+					endPos += 9;
141
+
142
+					// Insert image
143
+					var contentAfter = content.substring(endPos);
144
+					content = content.substring(0, startPos);
145
+					content += '<img width="' + attribs["width"] + '" height="' + attribs["height"] + '"';
146
+					content += ' src="' + (tinyMCE.getParam("theme_href") + '/images/spacer.gif') + '" title="' + attribs["src"] + '"';
147
+					content += ' alt="' + attribs["src"] + '" class="mceItemFlash" />' + content.substring(endPos);
148
+					content += contentAfter;
149
+					index++;
150
+
151
+					startPos++;
152
+				}
153
+
154
+				// Parse all embed tags and replace them with images from the embed data
155
+				var index = 0;
156
+				while ((startPos = content.indexOf('<embed', startPos)) != -1) {
157
+					if (index >= embedList.length)
158
+						break;
159
+
160
+					var attribs = embedList[index];
161
+
162
+					// Find end of embed
163
+					endPos = content.indexOf('>', startPos);
164
+					endPos += 9;
165
+
166
+					// Insert image
167
+					var contentAfter = content.substring(endPos);
168
+					content = content.substring(0, startPos);
169
+					content += '<img width="' + attribs["width"] + '" height="' + attribs["height"] + '"';
170
+					content += ' src="' + (tinyMCE.getParam("theme_href") + '/images/spacer.gif') + '" title="' + attribs["src"] + '"';
171
+					content += ' alt="' + attribs["src"] + '" class="mceItemFlash" />' + content.substring(endPos);
172
+					content += contentAfter;
173
+					index++;
174
+
175
+					startPos++;
176
+				}
177
+
178
+				break;
179
+
180
+			case "get_from_editor":
181
+				// Parse all img tags and replace them with object+embed
182
+				var startPos = -1;
183
+
184
+				while ((startPos = content.indexOf('<img', startPos+1)) != -1) {
185
+					var endPos = content.indexOf('/>', startPos);
186
+					var attribs = TinyMCE_FlashPlugin._parseAttributes(content.substring(startPos + 4, endPos));
187
+
188
+					// Is not flash, skip it
189
+					if (attribs['class'] != "mceItemFlash")
190
+						continue;
191
+
192
+					endPos += 2;
193
+
194
+					var embedHTML = '';
195
+					var wmode = tinyMCE.getParam("flash_wmode", "");
196
+					var quality = tinyMCE.getParam("flash_quality", "high");
197
+					var menu = tinyMCE.getParam("flash_menu", "false");
198
+
199
+					// Insert object + embed
200
+					embedHTML += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
201
+					embedHTML += ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"';
202
+					embedHTML += ' width="' + attribs["width"] + '" height="' + attribs["height"] + '">';
203
+					embedHTML += '<param name="movie" value="' + attribs["title"] + '" />';
204
+					embedHTML += '<param name="quality" value="' + quality + '" />';
205
+					embedHTML += '<param name="menu" value="' + menu + '" />';
206
+					embedHTML += '<param name="wmode" value="' + wmode + '" />';
207
+					embedHTML += '<embed src="' + attribs["title"] + '" wmode="' + wmode + '" quality="' + quality + '" menu="' + menu + '" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + attribs["width"] + '" height="' + attribs["height"] + '"></embed></object>';
208
+
209
+					// Insert embed/object chunk
210
+					chunkBefore = content.substring(0, startPos);
211
+					chunkAfter = content.substring(endPos);
212
+					content = chunkBefore + embedHTML + chunkAfter;
213
+				}
214
+				break;
215
+		}
216
+
217
+		// Pass through to next handler in chain
218
+		return content;
219
+	},
220
+
221
+	handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
222
+		if (node == null)
223
+			return;
224
+
225
+		do {
226
+			if (node.nodeName == "IMG" && tinyMCE.getAttrib(node, 'class').indexOf('mceItemFlash') == 0) {
227
+				tinyMCE.switchClass(editor_id + '_flash', 'mceButtonSelected');
228
+				return true;
229
+			}
230
+		} while ((node = node.parentNode));
231
+
232
+		tinyMCE.switchClass(editor_id + '_flash', 'mceButtonNormal');
233
+
234
+		return true;
235
+	},
236
+
237
+	// Private plugin internal functions
238
+
239
+	_parseAttributes : function(attribute_string) {
240
+		var attributeName = "";
241
+		var attributeValue = "";
242
+		var withInName;
243
+		var withInValue;
244
+		var attributes = new Array();
245
+		var whiteSpaceRegExp = new RegExp('^[ \n\r\t]+', 'g');
246
+
247
+		if (attribute_string == null || attribute_string.length < 2)
248
+			return null;
249
+
250
+		withInName = withInValue = false;
251
+
252
+		for (var i=0; i<attribute_string.length; i++) {
253
+			var chr = attribute_string.charAt(i);
254
+
255
+			if ((chr == '"' || chr == "'") && !withInValue)
256
+				withInValue = true;
257
+			else if ((chr == '"' || chr == "'") && withInValue) {
258
+				withInValue = false;
259
+
260
+				var pos = attributeName.lastIndexOf(' ');
261
+				if (pos != -1)
262
+					attributeName = attributeName.substring(pos+1);
263
+
264
+				attributes[attributeName.toLowerCase()] = attributeValue.substring(1);
265
+
266
+				attributeName = "";
267
+				attributeValue = "";
268
+			} else if (!whiteSpaceRegExp.test(chr) && !withInName && !withInValue)
269
+				withInName = true;
270
+
271
+			if (chr == '=' && withInName)
272
+				withInName = false;
273
+
274
+			if (withInName)
275
+				attributeName += chr;
276
+
277
+			if (withInValue)
278
+				attributeValue += chr;
279
+		}
280
+
281
+		return attributes;
282
+	}
283
+};
284
+
285
+tinyMCE.addPlugin("flash", TinyMCE_FlashPlugin);

+ 70 - 0
admin/scripts/tiny_mce/plugins/flash/flash.htm View File

@@ -0,0 +1,70 @@
1
+<html xmlns="http://www.w3.org/1999/xhtml">
2
+<head>
3
+	<title>{$lang_flash_title}</title>
4
+	<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
5
+	<script language="javascript" type="text/javascript" src="jscripts/flash.js"></script>
6
+	<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
7
+	<script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
8
+	<link href="css/flash.css" rel="stylesheet" type="text/css" />
9
+	<base target="_self" />
10
+</head>
11
+<body onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
12
+    <form onsubmit="insertFlash();return false;" action="#">
13
+		<div class="tabs">
14
+			<ul>
15
+				<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{$lang_flash_general}</a></span></li>
16
+			</ul>
17
+		</div>
18
+
19
+		<div class="panel_wrapper">
20
+			<div id="general_panel" class="panel current">
21
+				<fieldset>
22
+					<legend>{$lang_flash_general}</legend>
23
+
24
+					<table border="0" cellpadding="4" cellspacing="0">
25
+							<tr>
26
+							<td nowrap="nowrap"><label for="file">{$lang_flash_file}</label></td>
27
+							  <td nowrap="nowrap">
28
+									<table border="0" cellspacing="0" cellpadding="0">
29
+									  <tr>
30
+										<td><input id="file" name="file" type="text" value="" onfocus="this.select();" /></td>
31
+										<td id="filebrowsercontainer">&nbsp;</td>
32
+									  </tr>
33
+									</table>
34
+								</td>
35
+							</tr>
36
+							<tr id="linklistrow">
37
+								<td><label for="linklist">{$lang_flash_list}</label></td>
38
+								<td id="linklistcontainer">&nbsp;</td>
39
+							</tr>
40
+							<tr>
41
+								<td nowrap="nowrap"><label>{$lang_flash_size}</label></td>
42
+								<td nowrap="nowrap">
43
+									<input type="text" id="width" name="width" value="" onfocus="this.select();" />
44
+									<select name="width2" id="width2" style="width: 50px">
45
+										<option value="">px</option>
46
+										<option value="%">%</option>
47
+									</select>&nbsp;x&nbsp;<input id="height" name="height" type="text"  value="" onfocus="this.select();" />
48
+									<select name="height2" id="height2" style="width: 50px">
49
+										<option value="">px</option>
50
+										<option value="%">%</option>
51
+									</select>
52
+								</td>
53
+							</tr>
54
+					</table>
55
+				</fieldset>
56
+			</div>
57
+		</div>
58
+
59
+		<div class="mceActionPanel">
60
+			<div style="float: left">
61
+				<input type="button" id="insert" name="insert" value="{$lang_insert}" onclick="insertFlash();" />
62
+			</div>
63
+
64
+			<div style="float: right">
65
+				<input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
66
+			</div>
67
+		</div>
68
+	</form>
69
+</body>
70
+</html>

BIN
admin/scripts/tiny_mce/plugins/flash/images/flash.gif View File


+ 107 - 0
admin/scripts/tiny_mce/plugins/flash/jscripts/flash.js View File

@@ -0,0 +1,107 @@
1
+var url = tinyMCE.getParam("flash_external_list_url");
2
+if (url != null) {
3
+	// Fix relative
4
+	if (url.charAt(0) != '/' && url.indexOf('://') == -1)
5
+		url = tinyMCE.documentBasePath + "/" + url;
6
+
7
+	document.write('<sc'+'ript language="javascript" type="text/javascript" src="' + url + '"></sc'+'ript>');
8
+}
9
+
10
+function init() {
11
+	tinyMCEPopup.resizeToInnerSize();
12
+
13
+	document.getElementById("filebrowsercontainer").innerHTML = getBrowserHTML('filebrowser','file','flash','flash');
14
+
15
+	// Image list outsrc
16
+	var html = getFlashListHTML('filebrowser','file','flash','flash');
17
+	if (html == "")
18
+		document.getElementById("linklistrow").style.display = 'none';
19
+	else
20
+		document.getElementById("linklistcontainer").innerHTML = html;
21
+
22
+	var formObj = document.forms[0];
23
+	var swffile   = tinyMCE.getWindowArg('swffile');
24
+	var swfwidth  = '' + tinyMCE.getWindowArg('swfwidth');
25
+	var swfheight = '' + tinyMCE.getWindowArg('swfheight');
26
+
27
+	if (swfwidth.indexOf('%')!=-1) {
28
+		formObj.width2.value = "%";
29
+		formObj.width.value  = swfwidth.substring(0,swfwidth.length-1);
30
+	} else {
31
+		formObj.width2.value = "px";
32
+		formObj.width.value  = swfwidth;
33
+	}
34
+
35
+	if (swfheight.indexOf('%')!=-1) {
36
+		formObj.height2.value = "%";
37
+		formObj.height.value  = swfheight.substring(0,swfheight.length-1);
38
+	} else {
39
+		formObj.height2.value = "px";
40
+		formObj.height.value  = swfheight;
41
+	}
42
+
43
+	formObj.file.value = swffile;
44
+	formObj.insert.value = tinyMCE.getLang('lang_' + tinyMCE.getWindowArg('action'), 'Insert', true);
45
+
46
+	selectByValue(formObj, 'linklist', swffile);
47
+
48
+	// Handle file browser
49
+	if (isVisible('filebrowser'))
50
+		document.getElementById('file').style.width = '230px';
51
+
52
+	// Auto select flash in list
53
+	if (typeof(tinyMCEFlashList) != "undefined" && tinyMCEFlashList.length > 0) {
54
+		for (var i=0; i<formObj.linklist.length; i++) {
55
+			if (formObj.linklist.options[i].value == tinyMCE.getWindowArg('swffile'))
56
+				formObj.linklist.options[i].selected = true;
57
+		}
58
+	}
59
+}
60
+
61
+function getFlashListHTML() {
62
+	if (typeof(tinyMCEFlashList) != "undefined" && tinyMCEFlashList.length > 0) {
63
+		var html = "";
64
+
65
+		html += '<select id="linklist" name="linklist" style="width: 250px" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.file.value=this.options[this.selectedIndex].value;">';
66
+		html += '<option value="">---</option>';
67
+
68
+		for (var i=0; i<tinyMCEFlashList.length; i++)
69
+			html += '<option value="' + tinyMCEFlashList[i][1] + '">' + tinyMCEFlashList[i][0] + '</option>';
70
+
71
+		html += '</select>';
72
+
73
+		return html;
74
+	}
75
+
76
+	return "";
77
+}
78
+
79
+function insertFlash() {
80
+	var formObj = document.forms[0];
81
+	var html      = '';
82
+	var file      = formObj.file.value;
83
+	var width     = formObj.width.value;
84
+	var height    = formObj.height.value;
85
+	if (formObj.width2.value=='%') {
86
+		width = width + '%';
87
+	}
88
+	if (formObj.height2.value=='%') {
89
+		height = height + '%';
90
+	}
91
+
92
+	if (width == "")
93
+		width = 100;
94
+
95
+	if (height == "")
96
+		height = 100;
97
+
98
+	html += ''
99
+		+ '<img src="' + (tinyMCE.getParam("theme_href") + "/images/spacer.gif") + '" mce_src="' + (tinyMCE.getParam("theme_href") + "/images/spacer.gif") + '" '
100
+		+ 'width="' + width + '" height="' + height + '" '
101
+		+ 'border="0" alt="' + file + '" title="' + file + '" class="mceItemFlash" />';
102
+
103
+	tinyMCEPopup.execCommand("mceInsertContent", true, html);
104
+	tinyMCE.selectedInstance.repaint();
105
+
106
+	tinyMCEPopup.close();
107
+}

+ 11 - 0
admin/scripts/tiny_mce/plugins/flash/langs/en.js View File

@@ -0,0 +1,11 @@
1
+// UK lang variables
2
+
3
+tinyMCE.addToLang('flash',{
4
+title : 'Insert / edit Flash Movie',
5
+desc : 'Insert / edit Flash Movie',
6
+file : 'Flash-File (.swf)',
7
+size : 'Size',
8
+list : 'Flash files',
9
+props : 'Flash properties',
10
+general : 'General'
11
+});

+ 1 - 0
admin/scripts/tiny_mce/plugins/flash/readme.txt View File

@@ -0,0 +1 @@
1
+Check the TinyMCE documentation for details on this plugin.

+ 9 - 0
admin/scripts/tiny_mce/plugins/fullpage/blank.htm View File

@@ -0,0 +1,9 @@
1
+<html xmlns="http://www.w3.org/1999/xhtml">
2
+<head>
3
+	<title>blank_page</title>
4
+	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5
+</head>
6
+<body onload="parent.setupIframe(document);">
7
+
8
+</body>
9
+</html>

+ 0 - 0
admin/scripts/tiny_mce/plugins/fullpage/css/fullpage.css View File


Some files were not shown because too many files changed in this diff