first commit
10
rus/admin/_V4/_lib/openwysiwyg/addons/imagelibrary/changelog
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
v0.2.2
|
||||
* changed - Using full php tags instead of <? only
|
||||
* fixed - Solved problem while generate source of an image if it is within a subdirectory
|
||||
* changed - Hide upload button if $allowuploads is false
|
||||
|
||||
v0.2.1
|
||||
* fixed - Problem with relative URL to images using openImageLibrary
|
||||
|
||||
v0.1
|
||||
* inital release
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
<?php
|
||||
/********************************************************************
|
||||
* openImageLibrary addon v0.2.2 Copyright (c) 2006 openWebWare.com
|
||||
* Contact us at devs@openwebware.com
|
||||
* This copyright notice MUST stay intact for use.
|
||||
*
|
||||
* $Id: config.inc.php,v 1.7 2006/12/17 21:34:28 xhaggi Exp $
|
||||
*
|
||||
* An open source image library addon for the openWYSIWYG.
|
||||
* This library gives you the possibility to upload, browse and select
|
||||
* images on your webserver.
|
||||
*
|
||||
* Requirements:
|
||||
* - PHP 4.1.x or later
|
||||
* - openWYSIWYG v1.4.6 or later
|
||||
********************************************************************/
|
||||
|
||||
/*
|
||||
* Path to a directory which holds the images.
|
||||
*/
|
||||
$imagebasedir = '../../uploads';
|
||||
|
||||
/*
|
||||
* An absolute or relative URL to the image folder.
|
||||
* This url is used to generate the source of the image.
|
||||
*/
|
||||
$imagebaseurl = 'uploads';
|
||||
|
||||
/*
|
||||
* Allow your users to browse the subdir of the defined basedir.
|
||||
*/
|
||||
$browsedirs = true;
|
||||
|
||||
/*
|
||||
* If enabled users will be able to upload
|
||||
* files to any viewable directory. You should really only enable
|
||||
* this if the area this script is in is already password protected.
|
||||
*/
|
||||
$allowuploads = true;
|
||||
|
||||
/*
|
||||
* If a user uploads a file with the same
|
||||
* name as an existing file do you want the existing file
|
||||
* to be overwritten?
|
||||
*/
|
||||
$overwrite = false;
|
||||
|
||||
/*
|
||||
* Define the extentions you want to show within the
|
||||
* directory listing. The extensions also limit the
|
||||
* files the user can upload to your image folders.
|
||||
*/
|
||||
$supportedextentions = array(
|
||||
'gif',
|
||||
'png',
|
||||
'jpeg',
|
||||
'jpg',
|
||||
'bmp'
|
||||
);
|
||||
|
||||
/*
|
||||
* If you want to add your own special file icons use
|
||||
* this section below. Each entry relates to the extension of the
|
||||
* given file, in the form <extension> => <filename>.
|
||||
* These files must be located within the dlf directory.
|
||||
*/
|
||||
$filetypes = array (
|
||||
'png' => 'jpg.gif',
|
||||
'jpeg' => 'jpg.gif',
|
||||
'bmp' => 'jpg.gif',
|
||||
'jpg' => 'jpg.gif',
|
||||
'gif' => 'gif.gif',
|
||||
'psd' => 'psd.gif',
|
||||
);
|
||||
|
||||
?>
|
||||
|
After Width: | Height: | Size: 644 B |
|
After Width: | Height: | Size: 410 B |
|
After Width: | Height: | Size: 596 B |
|
After Width: | Height: | Size: 597 B |
|
After Width: | Height: | Size: 386 B |
|
After Width: | Height: | Size: 266 B |
|
|
@ -0,0 +1,301 @@
|
|||
<?php
|
||||
/********************************************************************
|
||||
* openImageLibrary addon Copyright (c) 2006 openWebWare.com
|
||||
* Contact us at devs@openwebware.com
|
||||
* This copyright notice MUST stay intact for use.
|
||||
********************************************************************/
|
||||
|
||||
require('config.inc.php');
|
||||
error_reporting(0);
|
||||
// get the identifier of the editor
|
||||
$wysiwyg = $_GET['wysiwyg'];
|
||||
// set image dir
|
||||
$leadon = $rootdir.$imagebasedir;
|
||||
|
||||
if($leadon=='.') $leadon = '';
|
||||
if((substr($leadon, -1, 1)!='/') && $leadon!='') $leadon = $leadon . '/';
|
||||
$startdir = $leadon;
|
||||
|
||||
// validate the directory
|
||||
$_GET['dir'] = $_POST['dir'] ? $_POST['dir'] : $_GET['dir'];
|
||||
if($_GET['dir']) {
|
||||
if(substr($_GET['dir'], -1, 1)!='/') {
|
||||
$_GET['dir'] = $_GET['dir'] . '/';
|
||||
}
|
||||
$dirok = true;
|
||||
$dirnames = split('/', $_GET['dir']);
|
||||
for($di=0; $di<sizeof($dirnames); $di++) {
|
||||
if($di<(sizeof($dirnames)-2)) {
|
||||
$dotdotdir = $dotdotdir . $dirnames[$di] . '/';
|
||||
}
|
||||
}
|
||||
if(substr($_GET['dir'], 0, 1)=='/') {
|
||||
$dirok = false;
|
||||
}
|
||||
|
||||
if($_GET['dir'] == $leadon) {
|
||||
$dirok = false;
|
||||
}
|
||||
|
||||
if($dirok) {
|
||||
$leadon = $_GET['dir'];
|
||||
}
|
||||
}
|
||||
|
||||
// upload file
|
||||
if($allowuploads && $_FILES['file']) {
|
||||
$upload = true;
|
||||
if(!$overwrite) {
|
||||
if(file_exists($leadon.$_FILES['file']['name'])) {
|
||||
$upload = false;
|
||||
}
|
||||
}
|
||||
$ext = strtolower(substr($_FILES['file']['name'], strrpos($_FILES['file']['name'], '.')+1));
|
||||
if(!in_array($ext, $supportedextentions)) {
|
||||
$upload = false;
|
||||
}
|
||||
if($upload) {
|
||||
move_uploaded_file($_FILES['file']['tmp_name'], $leadon . $_FILES['file']['name']);
|
||||
}
|
||||
}
|
||||
|
||||
if($allowuploads) {
|
||||
$phpallowuploads = (bool) ini_get('file_uploads');
|
||||
$phpmaxsize = ini_get('upload_max_filesize');
|
||||
$phpmaxsize = trim($phpmaxsize);
|
||||
$last = strtolower($phpmaxsize{strlen($phpmaxsize)-1});
|
||||
switch($last) {
|
||||
case 'g':
|
||||
$phpmaxsize *= 1024;
|
||||
case 'm':
|
||||
$phpmaxsize *= 1024;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>openWYSIWYG | Insert Image</title>
|
||||
|
||||
<script type="text/javascript" src="../../scripts/wysiwyg-popup.js"></script>
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
|
||||
/* ---------------------------------------------------------------------- *\
|
||||
Function : insertImage()
|
||||
Description : Inserts image into the WYSIWYG.
|
||||
\* ---------------------------------------------------------------------- */
|
||||
function insertImage() {
|
||||
var n = WYSIWYG_Popup.getParam('wysiwyg');
|
||||
|
||||
// get values from form fields
|
||||
var src = document.getElementById('src').value;
|
||||
var alt = document.getElementById('alt').value;
|
||||
var width = document.getElementById('width').value
|
||||
var height = document.getElementById('height').value
|
||||
var border = document.getElementById('border').value
|
||||
var align = document.getElementById('align').value
|
||||
var vspace = document.getElementById('vspace').value
|
||||
var hspace = document.getElementById('hspace').value
|
||||
|
||||
// insert image
|
||||
WYSIWYG.insertImage(src, width, height, align, border, alt, hspace, vspace, n);
|
||||
window.close();
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- *\
|
||||
Function : loadImage()
|
||||
Description : load the settings of a selected image into the form fields
|
||||
\* ---------------------------------------------------------------------- */
|
||||
function loadImage() {
|
||||
var n = WYSIWYG_Popup.getParam('wysiwyg');
|
||||
|
||||
// get selection and range
|
||||
var sel = WYSIWYG.getSelection(n);
|
||||
var range = WYSIWYG.getRange(sel);
|
||||
|
||||
// the current tag of range
|
||||
var img = WYSIWYG.findParent("img", range);
|
||||
|
||||
// if no image is defined then return
|
||||
if(img == null) return;
|
||||
|
||||
// assign the values to the form elements
|
||||
for(var i = 0;i < img.attributes.length;i++) {
|
||||
var attr = img.attributes[i].name.toLowerCase();
|
||||
var value = img.attributes[i].value;
|
||||
//alert(attr + " = " + value);
|
||||
if(attr && value && value != "null") {
|
||||
switch(attr) {
|
||||
case "src":
|
||||
// strip off urls on IE
|
||||
if(WYSIWYG_Core.isMSIE) value = WYSIWYG.stripURLPath(n, value, false);
|
||||
document.getElementById('src').value = value;
|
||||
break;
|
||||
case "alt":
|
||||
document.getElementById('alt').value = value;
|
||||
break;
|
||||
case "align":
|
||||
selectItemByValue(document.getElementById('align'), value);
|
||||
break;
|
||||
case "border":
|
||||
document.getElementById('border').value = value;
|
||||
break;
|
||||
case "hspace":
|
||||
document.getElementById('hspace').value = value;
|
||||
break;
|
||||
case "vspace":
|
||||
document.getElementById('vspace').value = value;
|
||||
break;
|
||||
case "width":
|
||||
document.getElementById('width').value = value;
|
||||
break;
|
||||
case "height":
|
||||
document.getElementById('height').value = value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// get width and height from style attribute in none IE browsers
|
||||
if(!WYSIWYG_Core.isMSIE && document.getElementById('width').value == "" && document.getElementById('width').value == "") {
|
||||
document.getElementById('width').value = img.style.width.replace(/px/, "");
|
||||
document.getElementById('height').value = img.style.height.replace(/px/, "");
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- *\
|
||||
Function : selectItem()
|
||||
Description : Select an item of an select box element by value.
|
||||
\* ---------------------------------------------------------------------- */
|
||||
function selectItemByValue(element, value) {
|
||||
if(element.options.length) {
|
||||
for(var i=0;i<element.options.length;i++) {
|
||||
if(element.options[i].value == value) {
|
||||
element.options[i].selected = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body bgcolor="#EEEEEE" marginwidth="0" marginheight="0" topmargin="0" leftmargin="0" onLoad="loadImage();">
|
||||
<table border="0" cellpadding="0" cellspacing="0" style="padding: 10px;">
|
||||
<form method="post" action="<?php echo $_SERVER['../../../../../_lib/openwysiwyg/addons/imagelibrary/PHP_SELF'];?>?wysiwyg=<?php echo $wysiwyg; ?>" enctype="multipart/form-data">
|
||||
<input type="hidden" id="dir" name="dir" value="">
|
||||
<tr>
|
||||
<td style="vertical-align:top;">
|
||||
<span style="font-family: arial, verdana, helvetica; font-size: 11px; font-weight: bold;">Insert Image:</span>
|
||||
<table width="380" border="0" cellpadding="0" cellspacing="0" style="background-color: #F7F7F7; border: 2px solid #FFFFFF; padding: 5px;">
|
||||
<?php
|
||||
if($allowuploads) {
|
||||
if($phpallowuploads) {
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td style="padding-top: 0px;padding-bottom: 0px; font-family: arial, verdana, helvetica; font-size: 11px;width:80px;">Upload:</td>
|
||||
<td style="padding-top: 0px;padding-bottom: 0px;width:300px;"><input type="file" name="file" size="30" style="font-size: 10px; width: 100%;" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-top: 0px;padding-bottom: 2px;font-family: tahoma; font-size: 9px;"> </td>
|
||||
<td style="padding-top: 0px;padding-bottom: 2px;font-family: tahoma; font-size: 9px;">(Max Filesize: <?php echo $phpmaxsize; ?>KB)</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
else {
|
||||
?>
|
||||
<tr>
|
||||
<td style="padding-bottom: 2px; padding-top: 0px; font-family: arial, verdana, helvetica; font-size: 11px;" colspan="2">
|
||||
File uploads are disabled in your php.ini file. Please enable them.
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td style="padding-bottom: 2px; padding-top: 0px; font-family: arial, verdana, helvetica; font-size: 11px;" width="80">Image URL:</td>
|
||||
<td style="padding-bottom: 2px; padding-top: 0px;" width="300"><input type="text" name="src" id="src" value="" style="font-size: 10px; width: 100%;"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-bottom: 2px; padding-top: 0px; font-family: arial, verdana, helvetica; font-size: 11px;">Alternate Text:</td>
|
||||
<td style="padding-bottom: 2px; padding-top: 0px;"><input type="text" name="alt" id="alt" value="" style="font-size: 10px; width: 100%;"></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table width="380" border="0" cellpadding="0" cellspacing="0"><tr><td style="vertical-align:top;">
|
||||
<span style="font-family: arial, verdana, helvetica; font-size: 11px; font-weight: bold;">Layout:</span>
|
||||
<table width="180" border="0" cellpadding="0" cellspacing="0" style="background-color: #F7F7F7; border: 2px solid #FFFFFF; padding: 5px;">
|
||||
<tr>
|
||||
<td style="padding-bottom: 2px; padding-top: 0px; font-family: arial, verdana, helvetica; font-size: 11px;">Width:</td>
|
||||
<td style="width:60px;padding-bottom: 2px; padding-top: 0px;"><input type="text" name="width" id="width" value="" style="font-size: 10px; width: 100%;"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-bottom: 2px; padding-top: 0px; font-family: arial, verdana, helvetica; font-size: 11px;">Height:</td>
|
||||
<td style="padding-bottom: 2px; padding-top: 0px;"><input type="text" name="height" id="height" value="" style="font-size: 10px; width: 100%;"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-bottom: 2px; padding-top: 0px; font-family: arial, verdana, helvetica; font-size: 11px;">Border:</td>
|
||||
<td style="padding-bottom: 2px; padding-top: 0px;"><input type="text" name="border" id="border" value="0" style="font-size: 10px; width: 100%;"></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</td>
|
||||
<td width="10"> </td>
|
||||
<td style="vertical-align:top;">
|
||||
|
||||
<span style="font-family: arial, verdana, helvetica; font-size: 11px; font-weight: bold;"> </span>
|
||||
<table width="200" border="0" cellpadding="0" cellspacing="0" style="background-color: #F7F7F7; border: 2px solid #FFFFFF; padding: 5px;">
|
||||
<tr>
|
||||
<td style="width: 115px;padding-bottom: 2px; padding-top: 0px; font-family: arial, verdana, helvetica; font-size: 11px;" width="100">Alignment:</td>
|
||||
<td style="width: 85px;padding-bottom: 2px; padding-top: 0px;">
|
||||
<select name="align" id="align" style="font-family: arial, verdana, helvetica; font-size: 11px; width: 100%;">
|
||||
<option value="">Not Set</option>
|
||||
<option value="left">Left</option>
|
||||
<option value="right">Right</option>
|
||||
<option value="texttop">Texttop</option>
|
||||
<option value="absmiddle">Absmiddle</option>
|
||||
<option value="baseline">Baseline</option>
|
||||
<option value="absbottom">Absbottom</option>
|
||||
<option value="bottom">Bottom</option>
|
||||
<option value="middle">Middle</option>
|
||||
<option value="top">Top</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-bottom: 2px; padding-top: 0px; font-family: arial, verdana, helvetica; font-size: 11px;">Horizontal Space:</td>
|
||||
<td style="padding-bottom: 2px; padding-top: 0px;"><input type="text" name="hspace" id="hspace" value="" style="font-size: 10px; width: 100%;"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-bottom: 2px; padding-top: 0px; font-family: arial, verdana, helvetica; font-size: 11px;">Vertical Space:</td>
|
||||
<td style="padding-bottom: 2px; padding-top: 0px;"><input type="text" name="vspace" id="vspace" value="" style="font-size: 10px; width: 100%;"></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td style="vertical-align: top;width: 150px; padding-left: 5px;">
|
||||
<span style="font-family: arial, verdana, helvetica; font-size: 11px; font-weight: bold;">Select Image:</span>
|
||||
<iframe id="chooser" frameborder="0" style="height:165px;width: 180px;border: 2px solid #FFFFFF; padding: 5px;" src="select_image.php?dir=<?php echo $leadon; ?>"></iframe>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" align="right" style="padding-top: 5px;">
|
||||
<input type="submit" value=" Submit " onclick="insertImage();return false;" style="font-size: 12px;">
|
||||
<?php if ( $allowuploads ) { ?>
|
||||
<input type="submit" value=" Upload " style="font-size: 12px;">
|
||||
<?php } ?>
|
||||
<input type="button" value=" Cancel " onclick="window.close();" style="font-size: 12px;">
|
||||
</td>
|
||||
</tr>
|
||||
</form>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,201 @@
|
|||
<?php
|
||||
/********************************************************************
|
||||
* openImageLibrary addon Copyright (c) 2006 openWebWare.com
|
||||
* Contact us at devs@openwebware.com
|
||||
* This copyright notice MUST stay intact for use.
|
||||
********************************************************************/
|
||||
require('config.inc.php');
|
||||
error_reporting(0);
|
||||
if((substr($imagebaseurl, -1, 1)!='/') && $imagebaseurl!='') $imagebaseurl = $imagebaseurl . '/';
|
||||
if((substr($imagebasedir, -1, 1)!='/') && $imagebasedir!='') $imagebasedir = $imagebasedir . '/';
|
||||
$leadon = $imagebasedir;
|
||||
if($leadon=='.') $leadon = '';
|
||||
if((substr($leadon, -1, 1)!='/') && $leadon!='') $leadon = $leadon . '/';
|
||||
$startdir = $leadon;
|
||||
|
||||
if($_GET['dir']) {
|
||||
if(substr($_GET['dir'], -1, 1)!='/') {
|
||||
$_GET['dir'] = $_GET['dir'] . '/';
|
||||
}
|
||||
$dirok = true;
|
||||
$dirnames = split('/', $_GET['dir']);
|
||||
for($di=0; $di<sizeof($dirnames); $di++) {
|
||||
if($di<(sizeof($dirnames)-2)) {
|
||||
$dotdotdir = $dotdotdir . $dirnames[$di] . '/';
|
||||
}
|
||||
}
|
||||
if(substr($_GET['dir'], 0, 1)=='/') {
|
||||
$dirok = false;
|
||||
}
|
||||
|
||||
if($_GET['dir'] == $leadon) {
|
||||
$dirok = false;
|
||||
}
|
||||
|
||||
if($dirok) {
|
||||
$leadon = $_GET['dir'];
|
||||
}
|
||||
}
|
||||
|
||||
$opendir = $leadon;
|
||||
if(!$leadon) $opendir = '.';
|
||||
if(!file_exists($opendir)) {
|
||||
$opendir = '.';
|
||||
$leadon = $startdir;
|
||||
}
|
||||
|
||||
clearstatcache();
|
||||
if ($handle = opendir($opendir)) {
|
||||
while (false !== ($file = readdir($handle))) {
|
||||
//first see if this file is required in the listing
|
||||
if ($file == "." || $file == "..") continue;
|
||||
if (@filetype($leadon.$file) == "dir") {
|
||||
if(!$browsedirs) continue;
|
||||
|
||||
$n++;
|
||||
if($_GET['sort']=="date") {
|
||||
$key = @filemtime($leadon.$file) . ".$n";
|
||||
}
|
||||
else {
|
||||
$key = $n;
|
||||
}
|
||||
$dirs[$key] = $file . "/";
|
||||
}
|
||||
else {
|
||||
$n++;
|
||||
if($_GET['sort']=="date") {
|
||||
$key = @filemtime($leadon.$file) . ".$n";
|
||||
}
|
||||
elseif($_GET['sort']=="size") {
|
||||
$key = @filesize($leadon.$file) . ".$n";
|
||||
}
|
||||
else {
|
||||
$key = $n;
|
||||
}
|
||||
$files[$key] = $file;
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
|
||||
//sort our files
|
||||
if($_GET['sort']=="date") {
|
||||
@ksort($dirs, SORT_NUMERIC);
|
||||
@ksort($files, SORT_NUMERIC);
|
||||
}
|
||||
elseif($_GET['sort']=="size") {
|
||||
@natcasesort($dirs);
|
||||
@ksort($files, SORT_NUMERIC);
|
||||
}
|
||||
else {
|
||||
@natcasesort($dirs);
|
||||
@natcasesort($files);
|
||||
}
|
||||
|
||||
//order correctly
|
||||
if($_GET['order']=="desc" && $_GET['sort']!="size") {$dirs = @array_reverse($dirs);}
|
||||
if($_GET['order']=="desc") {$files = @array_reverse($files);}
|
||||
$dirs = @array_values($dirs); $files = @array_values($files);
|
||||
?>
|
||||
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>openWYSIWYG | Select Image</title>
|
||||
<style type="text/css">
|
||||
body {
|
||||
margin: 0px;
|
||||
}
|
||||
a {
|
||||
font-family: Arial, verdana, helvetica;
|
||||
font-size: 11px;
|
||||
color: #000000;
|
||||
text-decoration: none;
|
||||
}
|
||||
a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function selectImage(url) {
|
||||
if(parent) {
|
||||
parent.document.getElementById("src").value = url;
|
||||
}
|
||||
}
|
||||
|
||||
if(parent) {
|
||||
parent.document.getElementById("dir").value = '<?php echo $leadon; ?>';
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<table border="0">
|
||||
<tbody>
|
||||
<?php
|
||||
$breadcrumbs = split('/', str_replace($basedir."/", "", $leadon));
|
||||
if(($bsize = sizeof($breadcrumbs)) > 0) {
|
||||
if(($bsize-1) > 0) {
|
||||
echo "<tr><td>";
|
||||
$sofar = '';
|
||||
for($bi=0;$bi<($bsize-1);$bi++) {
|
||||
$sofar = $sofar . $breadcrumbs[$bi] . '/';
|
||||
echo '<a href="'.$_SERVER['PHP_SELF'].'?dir='.urlencode($sofar).'" style="font-size:10px;font-family:Tahoma;">» '.$breadcrumbs[$bi].'</a><br>';
|
||||
}
|
||||
echo "</td></tr>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<?php
|
||||
$class = 'b';
|
||||
if($dirok) {
|
||||
?>
|
||||
<a href="<?php echo $_SERVER['../../../../../_lib/openwysiwyg/addons/imagelibrary/PHP_SELF'].'?dir='.urlencode($dotdotdir); ?>"><img src="images/dirup.png" alt="Folder" border="0" /> <strong>..</strong></a><br>
|
||||
<?php
|
||||
if($class=='b') $class='w';
|
||||
else $class = 'b';
|
||||
}
|
||||
$arsize = sizeof($dirs);
|
||||
for($i=0;$i<$arsize;$i++) {
|
||||
$dir = substr($dirs[$i], 0, strlen($dirs[$i]) - 1);
|
||||
?>
|
||||
<a href="<?php echo $_SERVER['../../../../../_lib/openwysiwyg/addons/imagelibrary/PHP_SELF'].'?dir='.urlencode($leadon.$dirs[$i]); ?>"><img src="images/folder.png" alt="<?php echo $dir; ?>" border="0" /> <strong><?php echo $dir; ?></strong></a><br>
|
||||
<?php
|
||||
if($class=='b') $class='w';
|
||||
else $class = 'b';
|
||||
}
|
||||
|
||||
$arsize = sizeof($files);
|
||||
for($i=0;$i<$arsize;$i++) {
|
||||
$icon = 'unknown.png';
|
||||
$ext = strtolower(substr($files[$i], strrpos($files[$i], '.')+1));
|
||||
if(in_array($ext, $supportedextentions)) {
|
||||
|
||||
$thumb = '';
|
||||
if($filetypes[$ext]) {
|
||||
$icon = $filetypes[$ext];
|
||||
}
|
||||
|
||||
$filename = $files[$i];
|
||||
if(strlen($filename)>43) {
|
||||
$filename = substr($files[$i], 0, 40) . '...';
|
||||
}
|
||||
$fileurl = $leadon . $files[$i];
|
||||
$filedir = str_replace($imagebasedir, "", $leadon);
|
||||
?>
|
||||
<a href="javascript:void(0)" onclick="selectImage('<?php echo $imagebaseurl.$filedir.$filename; ?>');"><img src="images/<?php echo $icon; ?>" alt="<?php echo $files[$i]; ?>" border="0" /> <strong><?php echo $filename; ?></strong></a><br>
|
||||
<?php
|
||||
if($class=='b') $class='w';
|
||||
else $class = 'b';
|
||||
}
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
152
rus/admin/_V4/_lib/openwysiwyg/changelog
Normal file
|
|
@ -0,0 +1,152 @@
|
|||
v1.4.7
|
||||
* added - Possibilty to maximize the editor window
|
||||
* fixed - Correct relative image path on preview, now it works for all images
|
||||
* added - Table highlighting possibility
|
||||
* added - Possiblity to assign headings (crashed)
|
||||
* changed - Code improvments to tons of functions
|
||||
* changed - WYSIWYG.formatText() function renamed to WYSIWYG.execCommand()
|
||||
* changed - WYSIWYG.findParentTag() renamed to WYSIWYG.findParent()
|
||||
* added - WYSIWYG_Core.findParentNode(tagName, node) function which finds a parent node by tag name starts on the given node
|
||||
* fixed - Implement function WYSIWYG_Core.getAttribute which solve the problem while getting the style attribute on IE
|
||||
* changed - Getting style attribute while editing a link
|
||||
* added - WYSIWYG_Table object, which is used for improving table editing
|
||||
* changed - New icons print and preview (thx sweb)
|
||||
* added - Save and return button on toolbar, the return button is disabled by default. (thx sweb)
|
||||
* added - Table function improvments
|
||||
* added - New WYSIWYG_Color object, which handels the color choosing
|
||||
* added - Full justify text (code by tim)
|
||||
|
||||
v1.4.6c
|
||||
* fixed - Solved issue with backcolor command on IE
|
||||
* changed - Add parameter value to WYSIWYG_Core.execCommand() function
|
||||
|
||||
v1.4.6b
|
||||
* changed - Debug code on context menu removed
|
||||
* fixed - Add "px" to left and top style information on context menu
|
||||
* changed - Correct comment of wyswiwyg-settings.js
|
||||
|
||||
v1.4.6a
|
||||
* fixed - bad class name on mouse over of toolbar buttons fixed
|
||||
* changed - Rewritten function to get the current position of an element (iframe)
|
||||
* fixed - Context menu position issue solved
|
||||
* fixed - Wrong variable call fixed
|
||||
* fixed - Problem while removing elements with the context menu solved
|
||||
|
||||
v1.4.6 (2006-12-17)
|
||||
* changed - Modification changed to be the official version of openWYSIWYG
|
||||
* fixed - Child nodes will be copied to the parent if a node is removed
|
||||
* changed - Complete rewritten context menu
|
||||
* changed - Behaviours of the context menu dependents on selection
|
||||
* added - Copy/Cut/Paste to context menu
|
||||
* changed - Code structure changes
|
||||
* added - wysiwyg-popup.js which holds popup specific functions
|
||||
* added - new object WYSIWYG_Core added, which holds all core functions
|
||||
* added - addEvent() and removeEvent() core function added
|
||||
* added - attach() and attachAll() functions which used to attach the editor to textareas
|
||||
* changed - Complete rewritten insertLink function, now it works with tags like img, h1 etc
|
||||
* added - Override width and height of the editor with size given by the style attributes width and height of the textarea
|
||||
* added - New function includeCSS() in Core object, which includes a given stylesheet file on the head tag of the current page
|
||||
* fixed - Solved problem if you want to attach the editor to all textareas
|
||||
* changed - Include of stylesheet files changed, now using the includeCSS function
|
||||
* changed - Complete rewritten display function, now you can use it like like function attach()
|
||||
|
||||
v0.4.5 (2006-11-12)
|
||||
* added - openImageLibrary addon (for now PHP only)
|
||||
* fixed - correct relative anchor and image path on preview
|
||||
* changed - various javascript code changes
|
||||
|
||||
v0.4.4 (2006-11-11)
|
||||
* added - capability of using image library addons
|
||||
* fixed - corrupt font + font size selection html
|
||||
|
||||
v0.4.3 (2006-10-20)
|
||||
* added - Possibility to invert the line break print outs of IE (ENTER = <br>, SHIFT + ENTER = <p>)
|
||||
* fixed - Replace of <p> with <br> on carriage return prevented the IE to set ordered and unordered lists.
|
||||
* added - Settings object to customize the Editor
|
||||
* fixed - Solve javascript error on example.html
|
||||
* fixed - Change html layout of the editor to solve the minimum width problem on dynamic editor size.
|
||||
* added - Enable/disable possibilty of the context menu
|
||||
* added - A general remove function, so it is possible to remove each html element
|
||||
* added - Adding an option 'Remove Node' to the context menu
|
||||
* added - Adding the possibilty to add the font + font size selection to toolbar2 or placing them where ever you want on the toolbars
|
||||
* changed - Removing the vars EnableFontSelection and EnableFontSizeSelection because font + font size selection goes to ToolBar Array like all other buttons.
|
||||
* changed - Removing vars EditorMinimumWidth and EditorMinimumHeight after solving the minimum width problem on IE. No more use.
|
||||
* added - New Function addToolbarElement() and removeToolbarElement within the settings object
|
||||
* added - Possibility to select a html node using the status bar node structure
|
||||
* changed - Complete redesign of the toolbar implementation
|
||||
* changed - Remove function removeImage() and removeLink(), because function removeNode() do it for all
|
||||
* added - Two new functions getEditorOffsetY() and getEditorOffsetX() to get the offsets of the editor window to the body if the the page
|
||||
* fixed - broken image path on toolbar button text view
|
||||
* added - New function enable(), now you can enable/display the editor on the fly
|
||||
|
||||
v0.4.2 (2006-10-16)
|
||||
* added - Converting decimal colors to hex colors within style attributes
|
||||
* changed - Rename getParentTag() to findParentTag(), the function finds a tag by a given tag name
|
||||
* changed - Improving function findParentTag(), now it finds IMG tags and do not return #tags but the parent tag
|
||||
* added - Reimplementing function getTag(). The function gets the current selected tag
|
||||
* added - New Function getParent(). Returns the parent node of the given element
|
||||
* added - New Function getNodeTree(). The function returns a tree of nodes as array, beginning with the current selected element (node) and ending with the HTML node (element).
|
||||
* added - New status bar implemented. It's shown the element structure, beginning with the current selected element and ending with the HTML element.
|
||||
* added - New Function updateStatusBar(). Updates the status bar with the element structure.
|
||||
* changed - Possibility of setting dynamic width and height of the editor
|
||||
* fixed - Solving bug while setting style attribute on links
|
||||
|
||||
v0.4.1 (2006-10-14)
|
||||
* added - Custom context menu for images and links
|
||||
* added - Remove option for images and links on the context menu
|
||||
* added - New functions removeLink() and removeImages()
|
||||
* added - New function $() implemented, its a replacement for document.getElementById()
|
||||
* changed - Some small other code changes
|
||||
|
||||
v0.4 (2006-10-12)
|
||||
* fixed - Dublicated id attribute in color chooser popup
|
||||
* fixed - Preventing IE to insert <p> tags on carriage return. IE will insert a normal <br> instead. (Thx to richyrich)
|
||||
* fixed - Crappy layout of hyperlink popup on IE (fields: class and name)
|
||||
* fixed - With multiple editors on one form, the global var viewTextMode is not unique for each editor. Used an Array instead to set the var for each editor individually
|
||||
* fixed - Submitting the editor while in text mode then it will submit escaped html (<br> -> submit -> <br>). Auto switch to HTML Mode if submit
|
||||
* fixed - Validate objects on hideFonts() and hideFontSizes() function
|
||||
* changed - Improvements on closing font + font size selection. Add a unique event listener for each selection.
|
||||
|
||||
v0.3.2a (2006-10-11)
|
||||
* added - Improvements on font and font size selection, now the drop downs will be closed if you go through the editor.
|
||||
* fixed - Opera bug in insertNodeAtSelection() function solved. That's why the table popup won`t close if you submit it.
|
||||
* fixed - CSS file problem in table popup. There was a hard coded path to the CSS file. I changed it so the path to the CSS file will be dynamically inserted.
|
||||
* added - Improvements to the color selection menus on table popup, now the button "pick" has a toggle function (open/close the color selections).
|
||||
* fixed - Font and font size selection fixed. I improved the closing a little bit, so if you choose font and then click an font size the font menue will be closed before.
|
||||
* added - Added a select field to the hyperlink popup which holds the default targets _blank, _self, _parent, _top. On change the select field updates the 'target' text field.
|
||||
|
||||
|
||||
v0.3.1 (2006-10-10)
|
||||
* fixed - Solve the habit of IE to convert relative urls into absolute. Now you can set two vars AnchorPathToStrip and ImagePathToStrip which holds an url that will be stripped off the href and src attributes. If you set the vars to "auto" then the url will automatically get of the current document. I recommend that you use the "auto" methode.
|
||||
|
||||
v0.3 (2006-10-09)
|
||||
* added - Default style now also applies to the preview window
|
||||
* added - Print button + function
|
||||
* fixed - A little mistake within the function setAttribute, attr.toLowerCase -> attr.toLowerCase() it prevented the script to apply the styles in IE correctly
|
||||
* fixed - Problem while replacing \n with <br> after submitting data in IE solved.
|
||||
* fixed - Complete rewritten function insertLink + insertImage. Improving edit capabiltity on both links and images.
|
||||
|
||||
v0.2 (2006-10-08)
|
||||
* added - New function insertLink(), now you can insert and edit links. New available attributes are target, styleclass, name and style. (IE has some limitations, getting style attribute doesn`t work, hope i can solve this problem)
|
||||
* fixed - Stripping MS Word HTML (removed some bugs within the regex)
|
||||
* changed - Complete rewritten source code, now all functions + var are within a var WYSIWYG. (ex. WYSIWYG.generate('textarea1', 500, 200); )
|
||||
* fixed - Replace <div> with <span> while insert html on none IE Browsers, this solve the new line problem after the <div> tag.
|
||||
* added - New function insertImage(), now you can insert and editing images
|
||||
* added - Validation of browser versions (thx to TIM)
|
||||
|
||||
v0.1 (2006-10-06)
|
||||
* added - Possibility to replace \n with <br> to be compatible with previous content coming from a database, for example.
|
||||
* added - Button to strip any HTML added by word
|
||||
* changed - Modified generate_wysiwyg() method (added width and height to customize size of each editor, width and height are optional parameter)
|
||||
* added - Possibility to set the default font family, font size and font color of the editor area
|
||||
* added - New function disable_wysiwyg() to disable a editor area
|
||||
* changed - Some changes were made to toolbar1 and toolbar2. now toolbar2 is hidden if no elements are assigned.
|
||||
* changed - Now you can add the viewSource button to toolbar1
|
||||
* added - A new function display_wysiwyg() only for displaying an iframe with content of a textarea (without any editable features)
|
||||
* added - A style-class for the iframe to customize the background-color (useful in firefox, because firefox use the background of the parent element)
|
||||
* added - Preview button + function (thx to Korvo), now it works in Firefox and use the innerHTML of the iframe instead of the texteare value
|
||||
* fixed - Some code improvements for better compatibility with Firefox + IE
|
||||
* changed - The var cssDir changed to cssFile, now it includes the complete file path (ex. styles/wysiwyg.css)
|
||||
* added - new stylesheet classes, check the css file
|
||||
* added - Possibility to enable/disable font + font size selection
|
||||
* fixed - Firefox BackColor problem fixed (thx to Merk), no hilite button needed only solve the problem on firefox
|
||||
178
rus/admin/_V4/_lib/openwysiwyg/docs/addons.html
Normal file
|
|
@ -0,0 +1,178 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<title>openWYSIWYG</title>
|
||||
<link rel="stylesheet" href="style.css" type="text/css">
|
||||
</head>
|
||||
<body>
|
||||
<table border="0" cellpadding="2" cellspacing="0" style="width:100%;">
|
||||
<tbody>
|
||||
<tr style="vertical-align: top;">
|
||||
<td>
|
||||
<a href="http://www.openwebware.com" target="_blank">
|
||||
<img src="images/logo.gif" border="0">
|
||||
</a>
|
||||
</td>
|
||||
<td style="text-align:right;">
|
||||
<font class="naviblock">
|
||||
<a href="doc.html" class="navi" title="Documentation">DOCUMENTATION</a> | <a href="addons.html" class="navi" title="Addons">ADDONS</a> | <a href="../example.html" class="navi" title="Examples">EXAMPLES</a>
|
||||
</font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<br>
|
||||
<table border="0" cellpadding="2" cellspacing="0" style="width:100%;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="headline">
|
||||
<h1>Addons</h1>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="info">
|
||||
Copyright (c) 2006 openWebWare.com
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="">
|
||||
<br>
|
||||
<h2>openImageLibrary addon (PHP)<br></h2>
|
||||
<p>
|
||||
Here we want to explain how you can use the openImageLibrary addon (for now PHP only) to let your users uploading, browsing and selecting images on your webserver.<br>
|
||||
First you have to download the latest version of the openWYSIWYG modification, which includes the openImageLibrary addon.<br>
|
||||
You will find a directory called <i>addons</i> in the root of the openWYSIWYG directory. If it not there you do not have the latest version of the openWYSIWYG editor.<br><br>
|
||||
To enable the openImageLibrary addon you have to customize the insert image popup implementation of the openWYSIWYG.<br>
|
||||
The following shows how you change the implementation of the insert image popup.
|
||||
<div class="codeblock">
|
||||
<span class="darkblue">var <span class="red">mysettings</span> = new WYSIWYG.Settings();</span>
|
||||
<br><br>
|
||||
<span class="green">// define the location of the openImageLibrary addon</span><br>
|
||||
<span class="darkblue"><span class="red">mysettings</span>.<b>ImagePopupFile</b> = "addons/imagelibrary/insert_image.php";</span>
|
||||
<br>
|
||||
<span class="green">// define the width of the insert image popup</span><br>
|
||||
<span class="darkblue"><span class="red">mysettings</span>.<b>ImagePopupWidth</b> = 600;</span>
|
||||
<br>
|
||||
<span class="green">// define the height of the insert image popup</span><br>
|
||||
<span class="darkblue"><span class="red">mysettings</span>.<b>ImagePopupHeight</b> = 245;</span>
|
||||
<br>
|
||||
</div>
|
||||
<br>Attach the editor on the textarea with the previously defined <span class="red"><i>mysettings</i></span> object.
|
||||
<div class="codeblock">
|
||||
<span class="blue"></span><span class="blue"><script language=</span><span class="green">"javascript1.2"</span><span class="blue">></span><br>
|
||||
<span class="darkblue">WYSIWYG.<b>attach</b>('textareaID', <span class="red">mysettings</span><span class="darkblue">);</span><br>
|
||||
<span class="blue"></script></span>
|
||||
</div>
|
||||
<br>
|
||||
Now try it out!
|
||||
<br>
|
||||
</p>
|
||||
<br><br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<h2>
|
||||
Customize the openImageLibrary addon
|
||||
</h2>
|
||||
This section describe how you can customize the openImageLibrary addon.<br><br>
|
||||
|
||||
<h3>Settings of the openImageLibrary addon:</h3>
|
||||
<br>
|
||||
The following settings can be modified within the config file <i>(addons/imagelibrary/config.inc.php)</i>
|
||||
<br>
|
||||
<table border="0" cellpadding="2" cellspacing="0" class="codeblock" style="width:91%">
|
||||
<colgroup>
|
||||
<col width="35%">
|
||||
<col width="65%">
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<b>$imagebasedir</b> = '../../uploads';
|
||||
</td>
|
||||
<td>
|
||||
<span class="green">
|
||||
Path to a directory which holds the images.
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<b>$imagebaseurl</b> = 'uploads';
|
||||
</td>
|
||||
<td>
|
||||
<span class="green">
|
||||
An absolute or relative URL to the image folder.
|
||||
This url is used to generate the source of the image.
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<b>$browsedirs</b> = true;
|
||||
</td>
|
||||
<td>
|
||||
<span class="green">
|
||||
Allow your users to browse the subdir of the defined basedir.
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<b>$allowuploads</b> = true;
|
||||
</td>
|
||||
<td>
|
||||
<span class="green">
|
||||
If enabled users will be able to upload files to any viewable directory.
|
||||
You should really only enable this if the area this script is in is already password protected.
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<b>$overwrite</b> = false;
|
||||
</td>
|
||||
<td>
|
||||
<span class="green">
|
||||
If a user uploads a file with the same name as an existing
|
||||
file do you want the existing file to be overwritten ?
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<b>$supportedextentions</b> = array(<file extensions>);
|
||||
</td>
|
||||
<td>
|
||||
<span class="green">
|
||||
Define the extentions you want to show within the directory listing.<br>
|
||||
The extensions also limit the files the user can upload to your image folders.
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<b>$filetypes</b> = array (<extension> => <filename>)
|
||||
</td>
|
||||
<td>
|
||||
<span class="green">
|
||||
If you want to add your own special file icons use this section below.
|
||||
Each entry relates to the extension of the given file, in the form <extension> => <filename>. <br>
|
||||
These files must be located within the dlf directory.
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<br>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
536
rus/admin/_V4/_lib/openwysiwyg/docs/doc.html
Normal file
|
|
@ -0,0 +1,536 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<title>openWYSIWYG</title>
|
||||
<link rel="stylesheet" href="style.css" type="text/css">
|
||||
</head>
|
||||
<body>
|
||||
<table border="0" cellpadding="2" cellspacing="0" style="width:100%;">
|
||||
<tbody>
|
||||
<tr style="vertical-align: top;">
|
||||
<td>
|
||||
<a href="http://www.openwebware.com" target="_blank">
|
||||
<img src="images/logo.gif" border="0">
|
||||
</a>
|
||||
</td>
|
||||
<td style="text-align:right;">
|
||||
<font class="naviblock">
|
||||
<a href="doc.html" class="navi" title="Documentation">DOCUMENTATION</a> | <a href="addons.html" class="navi" title="Addons">ADDONS</a> | <a href="../example.html" class="navi" title="Examples">EXAMPLES</a>
|
||||
</font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<br>
|
||||
<table border="0" cellpadding="2" cellspacing="0" style="width:100%;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="headline">
|
||||
<h1>Documentation</h1>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="info">
|
||||
Copyright (c) 2006 openWebWare.com
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="">
|
||||
<br>
|
||||
<h2>Setup the openWYSIWYG editor</h2>
|
||||
<p>
|
||||
Include the javascript files like the following:
|
||||
<br>
|
||||
<div class="codeblock">
|
||||
<span class="blue"><script language=</span><span class="green">"JavaScript"</span> <span class="blue">type=</span><span class="green">"text/javascript"</span> <span class="blue">src=</span><span class="green">"<span class="red">scripts</span>/wysiwyg.js"</span><span class="blue">></script></span>
|
||||
<br>
|
||||
<span class="blue"><script language=</span><span class="green">"JavaScript"</span> <span class="blue">type=</span><span class="green">"text/javascript"</span> <span class="blue">src=</span><span class="green">"<span class="red">scripts</span>/wysiwyg-settings.js"</span><span class="blue">></script><span class="green"> // optional</span></span>
|
||||
</div>
|
||||
<br>
|
||||
Note: You might need to change the src path (red), depending on where you put the files.
|
||||
</p>
|
||||
<p>Now you have to attach the openWYSIWYG editor to all or to defined textareas of your page.<br>
|
||||
<div class="codeblock">
|
||||
<span class="blue"></span><span class="blue"><script language=</span><span class="green">"javascript1.2"</span><span class="blue">><br> </span><span class="darkblue"><span class="green">// attach the editor to all textareas of your page.</span></span><br>
|
||||
<span class="darkblue">WYSIWYG.<strong>attach</strong>('all'); <br> <br></span><span class="darkblue"> <span class="green">// attach the editor to the textarea with the identifier 'textarea1'.</span></span><br><span class="darkblue"> WYSIWYG.<strong>attach</strong>('textarea1');<br></span><span class="darkblue"></span>
|
||||
<span class="blue"></script></span>
|
||||
</div>
|
||||
<br>
|
||||
Now try it out!
|
||||
<br><br>
|
||||
If you don't see any images on the toolbar then you have to change the image path.<br>
|
||||
Have a look at the customize section.
|
||||
<br><br>
|
||||
If you need to display contents of textarea's with HTML output support, but without the editing possibilities, you can use a function called display.
|
||||
<div class="codeblock">
|
||||
<span class="blue"></span><span class="blue"><script language=</span><span class="green">"javascript1.2"</span><span class="blue">><br> </span><span class="darkblue"><span class="green">// display iframes instead of textareas. It apply's to all textareas of your page.</span></span><br>
|
||||
<span class="darkblue">WYSIWYG.<strong>display</strong>('all'); <br> <br></span><span class="darkblue"> <span class="green">// display an iframe instead of the textarea with the identifier 'textarea1'</span></span><br><span class="darkblue"> WYSIWYG.<strong>display</strong>('textarea1');<br></span><span class="darkblue"></span>
|
||||
<span class="blue"></script></span>
|
||||
</div>
|
||||
</p>
|
||||
<br><br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<h2>
|
||||
Customize the openWYSIWYG
|
||||
</h2>
|
||||
This section describe how you can customize the openWYSIWYG editor.<br><br>
|
||||
<h3>The Settings object:</h3><br>
|
||||
You can create a new instance of the settings object.
|
||||
This object will be used to customize your editor.
|
||||
<div class="codeblock">
|
||||
<span class="darkblue">var <span class="red">mysettings</span> = new WYSIWYG.Settings();</span>
|
||||
</div>
|
||||
<br>Now attach the editor to all or to defined textareas of your page.<br>
|
||||
<div class="codeblock">
|
||||
<span class="darkblue">WYSIWYG.<b>attach</b>(</span><span class="green">'all'</span><span class="darkblue">, <span class="red">mysettings</span><span class="darkblue">);</span><br>
|
||||
</div>
|
||||
<br><br>
|
||||
<h3>Properties of the Settings object:</h3>
|
||||
<br>
|
||||
Here is a list of all properties you can change to customize the look and feel of your editor.
|
||||
<br>
|
||||
<table border="0" cellpadding="2" cellspacing="0" class="codeblock" style="width:91%">
|
||||
<colgroup>
|
||||
<col width="35%">
|
||||
<col width="65%">
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><span class="red">mysettings</span>.<b>ImagesDir</b> = "<path>";</td>
|
||||
<td><span class="green">The path where your images are located (default: 'images/')</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="red">mysettings</span>.<b>PopupsDir</b> = "<path>"; </td>
|
||||
<td><span class="green">The path where your popup htmls are located (default: 'popups/')</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="red">mysettings</span>.<b>CSSFile</b> = "<path>"; </td>
|
||||
<td><span class="green">The path + file where your stylesheet file is located (default: 'styles/wysiwyg.css')</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="red">mysettings</span>.<b>Width</b> = "<width>"; </td>
|
||||
<td><span class="green">The width of the editor window (valid units are px and %) (default: '500px')</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="red">mysettings</span>.<b>Height</b> = "<height>"; </td>
|
||||
<td><span class="green">The height of the editor window (valid units are px and %) (default: '200px')</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="red">mysettings</span>.<b>DefaultStyle</b> = "<stylesheet>"; </td>
|
||||
<td><span class="green">The default stylesheet of the editor window <br>(default: 'font-family: Arial; font-size: 12px; background-color: #FFFFFF')</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="red">mysettings</span>.<b>DisabledStyle</b> = "<stylesheet>"; </td>
|
||||
<td><span class="green">The style which appears if the editor is disabled<br> (default: 'font-family: Arial; font-size: 12px; background-color: #EEEEEE')</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="red">mysettings</span>.<b>ReplaceLineBreaks</b> = <true/false>; </td>
|
||||
<td><span class="green">Replace line breaks (\n) with html line breaks <br> (used for none html content) (default: false)</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="red">mysettings</span>.<b>PreviewWidth</b> = <width>; </td>
|
||||
<td><span class="green">The width of the preview popup (default: 500)</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="red">mysettings</span>.<b>PreviewHeight</b> = <height>; </td>
|
||||
<td><span class="green">The height of the preview popup (default: 400)</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="red">mysettings</span>.<b>RemoveFormatConfMessage</b> = "<text>"; </td>
|
||||
<td><span class="green">Text which appears if the MS word clean up button is pressed (default: 'Clean HTML inserted by MS Word ?')</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="red">mysettings</span>.<b>NoValidBrowserMessage</b> = "<text>"; </td>
|
||||
<td><span class="green">Text which appears if the browser is not supported by openWYSIWYG (default: 'openWYSIWYG does not support your browser.')</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="red">mysettings</span>.<b>AnchorPathToStrip</b> = "<url>"; </td>
|
||||
<td><span class="green">The url which is striped off on anchors (only IE, recommended: auto) (default: 'auto')</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="red">mysettings</span>.<b>ImagePathToStrip</b> = "<url>"; </td>
|
||||
<td><span class="green">The url which is striped off on images (only IE, recommended: auto) (default: 'auto')</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="red">mysettings</span>.<b>ContextMenu</b> = <true/false>;</td>
|
||||
<td><span class="green">Enable / disable the custom context menu (default: true)</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="red">mysettings</span>.<b>StatusBarEnabled</b> = <true/false>;</td>
|
||||
<td><span class="green">Enable / disable the status bar (default: true)</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="red">mysettings</span>.<b>InvertIELineBreaks</b> = <true/false>;</td>
|
||||
<td><span class="green">Enable / disable invert of line break capability in IE (default: false)</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="red">mysettings</span>.<b>InsertImagePopup</b> = <path/file>;</td>
|
||||
<td><span class="green">If you use another implementation like an image library written in PHP, then you can use this setting to customize the location of the implementation file. No need to edit the main javascript file.<br>(It's used for future upcoming image library addons)</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="red">mysettings</span>.<b>InsertImageWith</b> = <width>;</td>
|
||||
<td><span class="green">Width of the image popup window. (Default: 400)</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="red">mysettings</span>.<b>InsertImageWith</b> = <height>;</td>
|
||||
<td><span class="green">Height of the image popup window. (Default: 210)</span></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<br>
|
||||
<h3>Methods of the Settings object:</h3>
|
||||
<br>
|
||||
There are three methods to customize the toolbar elements. (Recommended if you newly to javascript)
|
||||
<br>
|
||||
<table border="0" cellpadding="2" cellspacing="0" class="codeblock" style="width:91%">
|
||||
<colgroup>
|
||||
<col width="50%">
|
||||
<col width="50%">
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><span class="red">mysettings</span>.<b>addToolbarElement</b>("<element>", <toolbar>, <position>);</td>
|
||||
<td>
|
||||
<span class="green">
|
||||
Add the given <element> to the defined <toolbar> on the defined <position>.<br><br>
|
||||
Valid elements are:<br>
|
||||
<i>font, fontsize, bold, italic, underline, forecolor, backcolor, justifyleft, justifycenter, justifyright,
|
||||
unorderedlist, orderedlist, outdent, indent, subscript, superscript, cut, copy, paste, removeformat,
|
||||
undo, redo, inserttable, insertimage, createlink, seperator, undo, redo, seperator, preview, print,
|
||||
viewSource, help</i>
|
||||
<br><br>
|
||||
The element <i>seperator</i> adds a line seperator between elements
|
||||
<br><br>
|
||||
<toolbar> is an integer starts with 1.
|
||||
<br>
|
||||
<position> is an integer starts with 1.
|
||||
<br><br>
|
||||
Example:
|
||||
</span>
|
||||
<span color="darkblue"> mysettings.addToolbarElement("bold", 1, 1);</span>
|
||||
<br><br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="red">mysettings</span>.<b>removeToolbarElement</b>("<element>");</td>
|
||||
<td>
|
||||
<span class="green">
|
||||
Removes the given <element> on the toolbar.<br><br>
|
||||
Valid elements are:<br>
|
||||
<i>font, fontsize, bold, italic, underline, forecolor, backcolor, justifyleft, justifycenter, justifyright,
|
||||
unorderedlist, orderedlist, outdent, indent, subscript, superscript, cut, copy, paste, removeformat,
|
||||
undo, redo, inserttable, insertimage, createlink, seperator, undo, redo, seperator, preview, print,
|
||||
viewSource, help</i>
|
||||
<br><br>
|
||||
You can not remove the element <i>seperator</i> only overriding with the function addToolbarElement()
|
||||
<br><br>
|
||||
Example:
|
||||
</span>
|
||||
<span color="darkblue"> mysettings.removeToolbarElement("bold");</span>
|
||||
<br><br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="red">mysettings</span>.<b>clearToolbar</b>(<toolbar>);</td>
|
||||
<td>
|
||||
<span class="green">
|
||||
Clears the given <toolbar>. If the element <toolbar> is not defined then the functions clear all existing toolbars.<br><br>
|
||||
<br><br>
|
||||
<toolbar> is an integer starts with 1.
|
||||
<br><br>
|
||||
Example:
|
||||
</span>
|
||||
<span color="darkblue"> mysettings.clearToolbar(1);</span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<br><br>
|
||||
<br>
|
||||
<h3>Array of the Settings object:</h3>
|
||||
<br>
|
||||
There are some arrays within the Settings object you can define directly. So let`s show how does it works.
|
||||
<br>
|
||||
<br>
|
||||
<table border="0" cellpadding="2" cellspacing="0" class="codeblock" style="width:91%">
|
||||
<colgroup>
|
||||
<col width="50%">
|
||||
<col width="50%">
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><span class="red">mysettings</span>.<b>Toolbar</b>[<toolbar index>][<element index>] = "<element>";</td>
|
||||
<td>
|
||||
<span class="green">
|
||||
The toolbar array is defined in two dimensions, the first dimension is the toolbar index,
|
||||
the second the element index. If you want to define an element in toolbar 2 on position 3
|
||||
then you have to do this:
|
||||
</span>
|
||||
<span class="darkblue">
|
||||
mysettings.Toolbar[1][2] = "bold";
|
||||
</span>
|
||||
<br><br>
|
||||
<span class="green">
|
||||
Valid elements can be found on addToolbarElement().
|
||||
</span>
|
||||
<br><br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="red">mysettings</span>.<b>Fonts</b>[<element index>] = "<element>";</td>
|
||||
<td>
|
||||
<span class="green">
|
||||
You have the posibility to change the font families by setting the Fonts array
|
||||
of the Settings object. If you want to add Arial on the second position then you have to do this:
|
||||
</span>
|
||||
<span class="darkblue">
|
||||
mysettings.Fonts[1] = "Arial";
|
||||
</span>
|
||||
<br><br>
|
||||
<span class=green>
|
||||
Valid elements are:<br>
|
||||
All font family elements (look at a stylesheet description of the tag font-family)
|
||||
</span>
|
||||
<br><br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="red">mysettings</span>.<b>Fontsizes</b>[<element index>] = "<size>";</td>
|
||||
<td>
|
||||
<span class="green">
|
||||
You can also change the font size which you can use on the editor.
|
||||
If you want to add the font size 5 on the first position of drop down box,
|
||||
then you have to do this:
|
||||
</span>
|
||||
<span class="darkblue">
|
||||
mysettings.Fontsizes[0] = "5";
|
||||
</span>
|
||||
<br><br>
|
||||
<span class=green>
|
||||
Valid sizes are:<br>
|
||||
1 - ... (i dont know if the size attribute is limit)
|
||||
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<br><br><br><br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<h2>
|
||||
Change Log
|
||||
</h2>
|
||||
<p>
|
||||
<b>v1.4.7 (Released: September 9, 2007)</b><br>
|
||||
Addresses the following: <br></p>
|
||||
<ul>
|
||||
<li>added - Possibilty to maximize the editor window</li>
|
||||
<li>fixed - Correct relative image path on preview, now it works for all images</li>
|
||||
<li>added - Table highlighting possibility</li>
|
||||
<li>added - Possiblity to assign headings (crashed)</li>
|
||||
<li>changed - Code improvments to tons of functions</li>
|
||||
<li>changed - WYSIWYG.formatText() function renamed to WYSIWYG.execCommand()</li>
|
||||
<li>changed - WYSIWYG.findParentTag() renamed to WYSIWYG.findParent()</li>
|
||||
<li>added - WYSIWYG_Core.findParentNode(tagName, node) function which finds a parent node by tag name starts on the given node</li>
|
||||
<li>fixed - Implement function WYSIWYG_Core.getAttribute which solve the problem while getting the style attribute on IE</li>
|
||||
<li>changed - Getting style attribute while editing a link</li>
|
||||
<li>added - WYSIWYG_Table object, which is used for improving table editing</li>
|
||||
<li>changed - New icons print and preview (thx sweb)</li>
|
||||
<li>added - Save and return button on toolbar, the return button is disabled by default. (thx sweb)</li>
|
||||
<li>added - Table function improvments</li>
|
||||
<li>added - New WYSIWYG_Color object, which handels the color choosing</li>
|
||||
<li>added - Full justify text (code by tim)</li>
|
||||
</ul>
|
||||
<p>
|
||||
<b>v1.4.6c (Released: December 25, 2006)</b><br>
|
||||
Addresses the following: <br></p>
|
||||
<ul>
|
||||
<li>fixed - Solved issue with backcolor command on IE</li>
|
||||
<li>changed - Add parameter value to WYSIWYG_Core.execCommand() function</li>
|
||||
</ul>
|
||||
<b>v1.4.6b (Released: December 23, 2006)</b><br>
|
||||
Addresses the following: <br></p>
|
||||
<ul>
|
||||
<li>changed - Debug code on context menu removed</li>
|
||||
<li>fixed - Add "px" to left and top style information on context menu</li>
|
||||
<li>changed - Correct comment of wyswiwyg-settings.js</li>
|
||||
</ul>
|
||||
<b>v1.4.6a (Released: December 21, 2006)</b><br>
|
||||
Addresses the following: <br></p>
|
||||
<ul>
|
||||
<li>fixed - bad class name on mouse over of toolbar buttons fixed</li>
|
||||
<li>changed - Rewritten function to get the current position of an element (iframe)</li>
|
||||
<li>fixed - Context menu position issue solved</li>
|
||||
<li>fixed - Wrong variable call fixed</li>
|
||||
<li>fixed - Problem while removing elements with the context menu solved</li>
|
||||
</ul>
|
||||
<b>v1.4.6 (Released: December 17, 2006)</b><br>
|
||||
Addresses the following: <br></p>
|
||||
<ul>
|
||||
<li>changed - Modification changed to be the official version of openWYSIWYG</li>
|
||||
<li>fixed - Child nodes will be copied to the parent if a node is removed</li>
|
||||
<li>changed - Complete rewritten context menu</li>
|
||||
<li>changed - Behaviours of the context menu dependents on selection</li>
|
||||
<li>added - Copy/Cut/Paste to context menu</li>
|
||||
<li>changed - Code structure changes</li>
|
||||
<li>added - wysiwyg-popup.js which holds popup specific functions</li>
|
||||
<li>added - new object WYSIWYG_Core added, which holds all core functions</li>
|
||||
<li>added - addEvent() and removeEvent() core function added</li>
|
||||
<li>added - attach() and attachAll() functions which used to attach the editor to textareas</li>
|
||||
<li>changed - Complete rewritten insertLink function, now it works with tags like img, h1 etc</li>
|
||||
<li>added - Override width and height of the editor with size given by the style attributes width and height of the textarea</li>
|
||||
<li>added - New function includeCSS() in Core object, which includes a given stylesheet file on the head tag of the current page</li>
|
||||
<li>fixed - Solved problem if you want to attach the editor to all textareas</li>
|
||||
<li>changed - Include of stylesheet files changed, now using the includeCSS function</li>
|
||||
<li>changed - Complete rewritten display function, now you can use it like like function attach()</li>
|
||||
</ul>
|
||||
<b>Modification v0.4.5 (Released: November 12, 2006)</b><br>
|
||||
Addresses the following:
|
||||
</p><ul>
|
||||
<li>added - openImageLibrary addon (for now PHP only)</li>
|
||||
<li>fixed - correct relative anchor and image path on preview</li>
|
||||
<li>changed - various javascript code changes</li>
|
||||
</ul>
|
||||
<b>Modification v0.4.4 (Released: November 11, 2006)</b><br />
|
||||
Addresses the following:
|
||||
<ul>
|
||||
<li>added - capability of using image library addons</li>
|
||||
<li>fixed - corrupt font + font size selection html</li>
|
||||
</ul>
|
||||
<b>Modification v0.4.3 (Released: October 20, 2006)</b><br />
|
||||
Addresses the following:
|
||||
<ul>
|
||||
<li>added - Possibility to invert the line break print outs of IE (ENTER = <br>, SHIFT + ENTER = <p>)</li>
|
||||
<li>fixed - Replace of <p> with <br> on carriage return prevented the IE to set ordered and unordered lists.</li>
|
||||
<li>added - Settings object to customize the Editor</li>
|
||||
<li>fixed - Solve javascript error on example.html</li>
|
||||
<li>fixed - Change html layout of the editor to solve the minimum width problem on dynamic editor size.</li>
|
||||
<li>added - Enable/disable possibilty of the context menu</li>
|
||||
<li>added - A general remove function, so it is possible to remove each html element</li>
|
||||
<li>added - Adding an option 'Remove Node' to the context menu</li>
|
||||
<li>added - Adding the possibilty to add the font + font size selection to toolbar2 or placing them where ever you want on the toolbars</li>
|
||||
<li>changed - Removing the vars EnableFontSelection and EnableFontSizeSelection because font + font size selection goes to ToolBar Array like all other buttons.</li>
|
||||
<li>changed - Removing vars EditorMinimumWidth and EditorMinimumHeight after solving the minimum width problem on IE. No more use.</li>
|
||||
<li>added - New Function addToolbarElement() and removeToolbarElement within the settings object</li>
|
||||
<li>added - Possibility to select a html node using the status bar node structure </li>
|
||||
<li>changed - Complete redesign of the toolbar implementation</li>
|
||||
<li>changed - Remove function removeImage() and removeLink(), because function removeNode() do it for all</li>
|
||||
<li>added - Two new functions getEditorOffsetY() and getEditorOffsetX() to get the offsets of the editor window to the body if the the page</li>
|
||||
<li>fixed - broken image path on toolbar button text view</li>
|
||||
<li>added - New function enable(), now you can enable/display the editor on the fly</li>
|
||||
</ul>
|
||||
<b>Modification v0.4.2 (Released: October 16, 2006)</b><br />
|
||||
Addresses the following:
|
||||
<ul>
|
||||
<li>added - Converting decimal colors to hex colors within style attributes</li>
|
||||
<li>changed - Rename getParentTag() to findParentTag(), the function finds a tag by a given tag name</li>
|
||||
<li>changed - Improving function findParentTag(), now it finds IMG tags and do not return #tags but the parent tag</li>
|
||||
<li>added - Reimplementing function getTag(). The function gets the current selected tag</li>
|
||||
<li>added - New Function getParent(). Returns the parent node of the given element</li>
|
||||
<li>added - New Function getNodeTree(). The function returns a tree of nodes as array, beginning with the current selected element (node) and ending with the HTML node (element).</li>
|
||||
<li>added - New status bar implemented. It's shown the element structure, beginning with the current selected element and ending with the HTML element.</li>
|
||||
<li>added - New Function updateStatusBar(). Updates the status bar with the element structure.</li>
|
||||
<li>changed - Possibility of setting dynamic width and height of the editor</li>
|
||||
<li>fixed - Solving bug while setting style attribute on links</li>
|
||||
</ul>
|
||||
<p><b>Modification v0.4.1 (Released: October 14, 2006)</b><br />
|
||||
Addresses the following:
|
||||
<ul>
|
||||
<li>added - Custom context menu for images and links</li>
|
||||
<li>added - Remove option for images and links on the context menu</li>
|
||||
<li>added - New functions removeLink() and removeImages()
|
||||
<li>added - New function $() implemented, its a replacement for document.getElementById()</li>
|
||||
<li>changed - Some small other code changes</li>
|
||||
</ul>
|
||||
<p><b>Modification v0.4 (Released: October 12, 2006)</b><br />
|
||||
Addresses the following:
|
||||
<ul>
|
||||
<li>fixed - Dublicated id attribute in color chooser popup</li>
|
||||
<li>fixed - Preventing IE to insert <p> tags on carriage return. IE will insert a normal <br> instead. (Thx to richyrich)</li>
|
||||
<li>fixed - Crappy layout of hyperlink popup on IE (fields: class and name)</li>
|
||||
<li>fixed - With multiple editors on one form, the global var viewTextMode is not unique for each editor. Used an Array instead to set the var for each editor individually</li>
|
||||
<li>fixed - Submitting the editor while in text mode then it will submit escaped html (<br> -> submit -> &lt;br&gt;). Auto switch to HTML Mode if submit</li>
|
||||
<li>fixed - Validate objects on hideFonts() and hideFontSizes() function</li>
|
||||
<li>changed - Improvements on closing font + font size selection. Add a unique event listener for each selection.</li>
|
||||
</ul>
|
||||
<p><b>Modification v0.3.2a (Released: October 11, 2006)</b><br />
|
||||
Addresses the following:
|
||||
<ul>
|
||||
<li>added - Improvements on font and font size selection, now the drop downs will be closed if you go through the editor.</li>
|
||||
<li>fixed - Opera bug in insertNodeAtSelection() function solved. That's why the table popup won`t close if you submit it.</li>
|
||||
<li>fixed - CSS file problem in table popup. There was a hard coded path to the CSS file. I changed it so the path to the CSS file will be dynamically inserted.</li>
|
||||
<li>added - Improvements to the color selection menus on table popup, now the button "pick" has a toggle function (open/close the color selections).</li>
|
||||
</ul>
|
||||
<p><b>Modification v0.3.2a (Released: October 11, 2006)</b><br />
|
||||
Addresses the following:
|
||||
<ul>
|
||||
<li>fixed - Font and font size selection fixed. I improved the closing a little bit, so if you choose font and then click an font size the font menue will be closed before.</li>
|
||||
<li>added - Added a select field to the hyperlink popup which holds the default targets _blank, _self, _parent, _top. On change the select field updates the 'target' text field.</li>
|
||||
</ul>
|
||||
<p><b>Modification v0.3.1 (Released: October 10, 2006)</b><br />
|
||||
Addresses the following:
|
||||
<ul>
|
||||
<li>fixed - Solve the habit of IE to convert relative urls into absolute.
|
||||
Now you can set two vars AnchorPathToStrip and ImagePathToStrip
|
||||
which holds an url that will be stripped off the href and src attributes.
|
||||
If you set the vars to "auto" then the url will automatically get of the current document. I recommend that you use the "auto" methode. </li>
|
||||
</ul>
|
||||
<p><b>Modification v0.3 (Released: October 9, 2006)</b><br />
|
||||
Addresses the following:
|
||||
<ul>
|
||||
<li>added - Default style now also applies to the preview window</li>
|
||||
<li>added - Print button + function</li>
|
||||
<li>fixed - A little mistake within the function setAttribute, attr.toLowerCase -> attr.toLowerCase() it prevented the script to apply the styles in IE correctly</li>
|
||||
<li>fixed - Problem while replacing \n with <br> after submitting data in IE solved.</li>
|
||||
<li>fixed - Complete rewritten function insertLink + insertImage. Improving edit capabiltity on both links and images. </li>
|
||||
</ul>
|
||||
<p><b>Modification v0.2 (Released: October 8, 2006)</b><br />
|
||||
Addresses the following:
|
||||
<ul>
|
||||
<li>added - New function insertLink(), now you can insert and edit links.
|
||||
New available attributes are target, styleclass, name and style.
|
||||
(IE has some limitations, getting style attribute doesn`t work, hope i can solve this problem)</li>
|
||||
<li>fixed - Stripping MS Word HTML (removed some bugs within the regex)</li>
|
||||
<li>changed - Complete rewritten source code, now all functions + var are within a var WYSIWYG. (ex. WYSIWYG.generate('textarea1', 500, 200); )</li>
|
||||
<li>fixed - Replace <div> with <span> while insert html on none IE Browsers, this solve the new line problem after the <div> tag.</li>
|
||||
<li>added - New function insertImage(), now you can insert and editing images</li>
|
||||
<li>added - Validation of browser versions (thx to TIM) </li>
|
||||
</ul>
|
||||
|
||||
<p><b>Modification v0.1 (Released: October 6, 2006)</b><br />
|
||||
Addresses the following:
|
||||
<ul>
|
||||
<li>added - Possibility to replace \n with <br> to be compatible with previous content coming from a database, for example.</li>
|
||||
<li>added - Button to strip any HTML added by word</li>
|
||||
<li>changed - Modified generate_wysiwyg() method (added width and height to customize size of each editor, width and height are optional parameter)</li>
|
||||
<li>added - Possibility to set the default font family, font size and font color of the editor area</li>
|
||||
<li>added - New function disable_wysiwyg() to disable a editor area</li>
|
||||
<li>changed - Some changes were made to toolbar1 and toolbar2. now toolbar2 is hidden if no elements are assigned.</li>
|
||||
<li>changed - Now you can add the viewSource button to toolbar1</li>
|
||||
<li>added - A new function display_wysiwyg() only for displaying an iframe with content of a textarea (without any editable features)</li>
|
||||
<li>added - A style-class for the iframe to customize the background-color (useful in firefox, because firefox use the background of the parent element)</li>
|
||||
<li>added - Preview button + function (thx to Korvo), now it works in Firefox and use the innerHTML of the iframe instead of the texteare value</li>
|
||||
<li>fixed - Some code improvements for better compatibility with Firefox + IE</li>
|
||||
<li>changed - The var cssDir changed to cssFile, now it includes the complete file path (ex. styles/wysiwyg.css)</li>
|
||||
<li>added - new stylesheet classes, check the css file</li>
|
||||
<li>added - Possibility to enable/disable font + font size selection</li>
|
||||
<li>fixed - Firefox BackColor problem fixed (thx to Merk), no hilite button needed only solve the problem on firefox </li>
|
||||
</ul>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
BIN
rus/admin/_V4/_lib/openwysiwyg/docs/images/logo.gif
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
112
rus/admin/_V4/_lib/openwysiwyg/docs/style.css
Normal file
|
|
@ -0,0 +1,112 @@
|
|||
body {
|
||||
font-family: Arial;
|
||||
color: #000000;
|
||||
font-weight: normal;
|
||||
font-size: 13px;
|
||||
background-color: #EEEEEE;
|
||||
}
|
||||
|
||||
td {
|
||||
font-family: Arial;
|
||||
color: #000000;
|
||||
font-weight: normal;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-family: Tahoma;
|
||||
color: #444444;
|
||||
font-weight: bold;
|
||||
font-size: 16px;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-family: Tahoma;
|
||||
color: #444444;
|
||||
font-weight: bold;
|
||||
font-size: 14px;
|
||||
margin: 0px;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-family: Tahoma;
|
||||
color: #444444;
|
||||
font-weight: bold;
|
||||
font-size: 12px;
|
||||
margin: 0px;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.headline {
|
||||
border-bottom: 1px solid #FF3300;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.naviblock {
|
||||
width:280px;
|
||||
text-align:center;
|
||||
border: 1px solid #AAAAAA;
|
||||
padding:5px;
|
||||
background-color:#FFFFFF;
|
||||
}
|
||||
|
||||
a.navi {
|
||||
font-family: Tahoma;
|
||||
color: #444444;
|
||||
font-weight: bold;
|
||||
font-size: 13px;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a.navi:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.codeblock {
|
||||
background-color: #FFFFEE;
|
||||
font-family: courier new;
|
||||
font-size: 12px;
|
||||
padding: 5px;
|
||||
width: 90%;
|
||||
border: 1px solid #AAAAAA;
|
||||
margin-left: 10px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.codeblock td {
|
||||
font-family: courier new;
|
||||
font-size: 12px;
|
||||
vertical-align: top;
|
||||
color: #000088;
|
||||
}
|
||||
|
||||
.list {
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
.red {
|
||||
color: #FF3300;
|
||||
}
|
||||
|
||||
.blue {
|
||||
color: #0000FF;
|
||||
}
|
||||
|
||||
.green {
|
||||
color: #008080;
|
||||
}
|
||||
|
||||
.darkblue {
|
||||
color: #000088;
|
||||
}
|
||||
|
||||
.info {
|
||||
color: #EE0000;
|
||||
font-size:10px;
|
||||
}
|
||||
141
rus/admin/_V4/_lib/openwysiwyg/example.html
Normal file
|
|
@ -0,0 +1,141 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<title>openWYSIWYG</title>
|
||||
<link rel="stylesheet" href="docs/style.css" type="text/css">
|
||||
|
||||
<!--
|
||||
Include the WYSIWYG javascript files
|
||||
-->
|
||||
<script type="text/javascript" src="scripts/wysiwyg.js"></script>
|
||||
<script type="text/javascript" src="scripts/wysiwyg-settings.js"></script>
|
||||
<!--
|
||||
Attach the editor on the textareas
|
||||
-->
|
||||
<script type="text/javascript">
|
||||
// Use it to attach the editor to all textareas with full featured setup
|
||||
//WYSIWYG.attach('all', full);
|
||||
|
||||
// Use it to attach the editor directly to a defined textarea
|
||||
WYSIWYG.attach('textarea1'); // default setup
|
||||
WYSIWYG.attach('textarea2', full); // full featured setup
|
||||
WYSIWYG.attach('textarea3', small); // small setup
|
||||
|
||||
// Use it to display an iframes instead of a textareas
|
||||
//WYSIWYG.display('all', full);
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<table border="0" cellpadding="2" cellspacing="0" style="width:100%;">
|
||||
<tbody>
|
||||
<tr style="vertical-align: top;">
|
||||
<td>
|
||||
<a href="http://www.openwebware.com" target="_blank">
|
||||
<img src="docs/images/logo.gif" border="0">
|
||||
</a>
|
||||
</td>
|
||||
<td style="text-align: right;">
|
||||
<font class="naviblock">
|
||||
<a href="docs/doc.html" class="navi" title="Documentation">DOCUMENTATION</a> | <a href="docs/addons.html" class="navi" title="Addons">ADDONS</a> | <a href="example.html" class="navi" title="Examples">EXAMPLES</a>
|
||||
</font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<br>
|
||||
<table border="0" cellpadding="2" cellspacing="0" style="width:100%;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="headline">
|
||||
<h1>Examples</h1>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="info">
|
||||
Copyright (c) 2006 openWebWare.com
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<br>
|
||||
<form name="exampleForm" action="example.html" method="post">
|
||||
<!--
|
||||
Default settings
|
||||
-->
|
||||
<h2>
|
||||
Default setup applied to this editor:
|
||||
</h2>
|
||||
<br>
|
||||
<textarea id="textarea1" name="test1" style="width:560px;height:200px;">
|
||||
<table border="0" cellpadding="0" cellspacing="0" style="margin-left: 10px;">
|
||||
<tr>
|
||||
<td style="padding: 0 10 10 0;">
|
||||
<a href="http://www.openwebware.com/products/openwysiwyg/">
|
||||
<img src="http://www.openwebware.com/images/openwysiwyg/logo9060.gif" border="0" height="60" width="90" alt="openWYSIWYG - Cross-browser WYSIWYG editor">
|
||||
</a>
|
||||
</td>
|
||||
<td style="font-family: verdana; font-size: 11px; line-height: 130%; color: #494949;" valign="top">
|
||||
<b>
|
||||
<a href="http://www.openwebware.com/products/openwysiwyg/" style="font-family: arial; font-size: 12px; color: #055F92;">openWYSIWYG - Cross-browser WYSIWYG editor</a>
|
||||
</b>
|
||||
<br />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</textarea>
|
||||
<br />
|
||||
<br />
|
||||
|
||||
<!--
|
||||
Three toolbars and dynamicly width applied to this editor
|
||||
-->
|
||||
<h2>
|
||||
Customized toolbar and openImageLibrary addon applied to this editor:
|
||||
</h2>
|
||||
<br>
|
||||
<textarea id="textarea2" name="test2" style="width:80%;height:200px;">
|
||||
<h1>GNU Lesser General Public License</h1>
|
||||
<tt>
|
||||
<p>Version 2.1, February 1999</p>
|
||||
|
||||
<blockquote>
|
||||
<p>Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.</p>
|
||||
|
||||
<p>[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]</p>
|
||||
</blockquote>
|
||||
|
||||
<h3>Preamble</h3>
|
||||
<p>The licenses for most software are designed to take away your freedom to share and change it.</p></tt>
|
||||
</textarea>
|
||||
|
||||
<br />
|
||||
<br />
|
||||
|
||||
<!--
|
||||
A really small setup applied to this editor
|
||||
-->
|
||||
<h2>
|
||||
A really small setup applied to this editor:
|
||||
</h2>
|
||||
<br>
|
||||
<textarea id="textarea3" name="test3">
|
||||
A small editor...can come in handy when you just need font size, bold, italic, etc.
|
||||
</textarea>
|
||||
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
BIN
rus/admin/_V4/_lib/openwysiwyg/images/backcolor.gif
Normal file
|
After Width: | Height: | Size: 138 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/backcolor_on.gif
Normal file
|
After Width: | Height: | Size: 185 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/background_silver.jpg
Normal file
|
After Width: | Height: | Size: 299 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/bold.gif
Normal file
|
After Width: | Height: | Size: 76 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/bold_on.gif
Normal file
|
After Width: | Height: | Size: 76 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/copy.gif
Normal file
|
After Width: | Height: | Size: 364 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/copy_on.gif
Normal file
|
After Width: | Height: | Size: 381 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/cut.gif
Normal file
|
After Width: | Height: | Size: 244 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/cut_on.gif
Normal file
|
After Width: | Height: | Size: 353 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/delete.gif
Normal file
|
After Width: | Height: | Size: 236 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/delete_on.gif
Normal file
|
After Width: | Height: | Size: 243 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/forecolor.gif
Normal file
|
After Width: | Height: | Size: 114 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/forecolor_on.gif
Normal file
|
After Width: | Height: | Size: 174 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/help.gif
Normal file
|
After Width: | Height: | Size: 683 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/help_on.gif
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/indent_left.gif
Normal file
|
After Width: | Height: | Size: 90 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/indent_left_on.gif
Normal file
|
After Width: | Height: | Size: 90 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/indent_right.gif
Normal file
|
After Width: | Height: | Size: 90 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/indent_right_on.gif
Normal file
|
After Width: | Height: | Size: 90 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/insert_hyperlink.gif
Normal file
|
After Width: | Height: | Size: 304 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/insert_hyperlink_on.gif
Normal file
|
After Width: | Height: | Size: 309 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/insert_picture.gif
Normal file
|
After Width: | Height: | Size: 622 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/insert_picture_on.gif
Normal file
|
After Width: | Height: | Size: 625 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/insert_table.gif
Normal file
|
After Width: | Height: | Size: 626 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/insert_table_on.gif
Normal file
|
After Width: | Height: | Size: 1 KiB |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/italics.gif
Normal file
|
After Width: | Height: | Size: 79 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/italics_on.gif
Normal file
|
After Width: | Height: | Size: 79 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/justify_center.gif
Normal file
|
After Width: | Height: | Size: 79 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/justify_center_on.gif
Normal file
|
After Width: | Height: | Size: 70 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/justify_justify.gif
Normal file
|
After Width: | Height: | Size: 80 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/justify_justify_on.gif
Normal file
|
After Width: | Height: | Size: 71 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/justify_left.gif
Normal file
|
After Width: | Height: | Size: 80 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/justify_left_on.gif
Normal file
|
After Width: | Height: | Size: 71 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/justify_right.gif
Normal file
|
After Width: | Height: | Size: 79 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/justify_right_on.gif
Normal file
|
After Width: | Height: | Size: 70 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/list_ordered.gif
Normal file
|
After Width: | Height: | Size: 84 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/list_ordered_on.gif
Normal file
|
After Width: | Height: | Size: 84 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/list_unordered.gif
Normal file
|
After Width: | Height: | Size: 83 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/list_unordered_on.gif
Normal file
|
After Width: | Height: | Size: 83 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/logo.gif
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/maximize.gif
Normal file
|
After Width: | Height: | Size: 118 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/maximize_on.gif
Normal file
|
After Width: | Height: | Size: 118 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/paste.gif
Normal file
|
After Width: | Height: | Size: 289 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/paste_on.gif
Normal file
|
After Width: | Height: | Size: 618 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/preview.gif
Normal file
|
After Width: | Height: | Size: 372 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/preview_on.gif
Normal file
|
After Width: | Height: | Size: 587 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/print.gif
Normal file
|
After Width: | Height: | Size: 393 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/print_on.gif
Normal file
|
After Width: | Height: | Size: 612 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/redo.gif
Normal file
|
After Width: | Height: | Size: 336 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/redo_on.gif
Normal file
|
After Width: | Height: | Size: 339 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/remove_format.gif
Normal file
|
After Width: | Height: | Size: 292 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/remove_format_on.gif
Normal file
|
After Width: | Height: | Size: 604 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/return.gif
Normal file
|
After Width: | Height: | Size: 372 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/return_on.gif
Normal file
|
After Width: | Height: | Size: 581 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/save.gif
Normal file
|
After Width: | Height: | Size: 403 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/save_on.gif
Normal file
|
After Width: | Height: | Size: 403 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/select_font.gif
Normal file
|
After Width: | Height: | Size: 419 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/select_font_on.gif
Normal file
|
After Width: | Height: | Size: 424 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/select_heading.gif
Normal file
|
After Width: | Height: | Size: 313 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/select_heading_on.gif
Normal file
|
After Width: | Height: | Size: 317 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/select_size.gif
Normal file
|
After Width: | Height: | Size: 344 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/select_size_on.gif
Normal file
|
After Width: | Height: | Size: 350 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/seperator.gif
Normal file
|
After Width: | Height: | Size: 57 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/seperator2.gif
Normal file
|
After Width: | Height: | Size: 60 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/settings.gif
Normal file
|
After Width: | Height: | Size: 169 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/strikethrough.gif
Normal file
|
After Width: | Height: | Size: 91 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/strikethrough_on.gif
Normal file
|
After Width: | Height: | Size: 80 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/subscript.gif
Normal file
|
After Width: | Height: | Size: 79 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/subscript_on.gif
Normal file
|
After Width: | Height: | Size: 79 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/superscript.gif
Normal file
|
After Width: | Height: | Size: 79 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/superscript_on.gif
Normal file
|
After Width: | Height: | Size: 79 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/underline.gif
Normal file
|
After Width: | Height: | Size: 87 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/underline_on.gif
Normal file
|
After Width: | Height: | Size: 87 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/undo.gif
Normal file
|
After Width: | Height: | Size: 333 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/undo_on.gif
Normal file
|
After Width: | Height: | Size: 334 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/view_source.gif
Normal file
|
After Width: | Height: | Size: 79 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/view_source_on.gif
Normal file
|
After Width: | Height: | Size: 79 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/view_text.gif
Normal file
|
After Width: | Height: | Size: 78 B |
BIN
rus/admin/_V4/_lib/openwysiwyg/images/view_text_on.gif
Normal file
|
After Width: | Height: | Size: 78 B |
100
rus/admin/_V4/_lib/openwysiwyg/popups/about.html
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>openWYSIWYG | About</title>
|
||||
<script type="text/javascript" src="../scripts/wysiwyg-popup.js"></script>
|
||||
<script type="text/javascript">
|
||||
var n = WYSIWYG_Popup.getParam('wysiwyg');
|
||||
</script>
|
||||
</head>
|
||||
<body bgcolor="#EEEEEE" marginwidth="0" marginheight="0" topmargin="0" leftmargin="0">
|
||||
<table border="0" cellpadding="0" cellspacing="0" style="padding: 10px;">
|
||||
<tr>
|
||||
<td>
|
||||
<table width="380" border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td style="border-bottom: 2px solid #FFFFFF;" rowspan="2">
|
||||
<script type="text/javascript">
|
||||
document.write('<img src="../' + window.opener.WYSIWYG.config[n].ImagesDir + 'logo.gif" alt="openWebWare: openWYSIWYG">');
|
||||
</script>
|
||||
</td>
|
||||
<td colspan="4" style="height: 50px;">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="60" style="background-color: #F7F7F7;">
|
||||
|
||||
<table width="60" border="0" cellpadding="0" cellspacing="0" style="background-color: #F7F7F7; border-width: 2 2 0 2; border-style: solid; border-color: #FFFFFF; border-bottom: 2px solid #F7F7F7; padding: 2px;">
|
||||
<tr>
|
||||
<td align="center" style="font-family: arial, verdana, helvetica, sans serif; font-size: 10px;">
|
||||
<script type="text/javascript">
|
||||
document.write('<a href="about.html?wysiwyg=' + n + '" style="color: #000000; text-decoration: none;">About</a>');
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</td>
|
||||
<td width="5" style="border-bottom: 2px solid #FFFFFF;">
|
||||
|
||||
</td>
|
||||
<td width="60" style="background-color: #F7F7F7;">
|
||||
|
||||
<table width="60" border="0" cellpadding="0" cellspacing="0" style="background-color: #DDDDDD; border: 2px solid #FFFFFF; padding: 2px;">
|
||||
<tr>
|
||||
<td align="center" style="font-family: arial, verdana, helvetica, sans serif; font-size: 10px;">
|
||||
<script type="text/javascript">
|
||||
document.write('<a href="about_license.html?wysiwyg=' + n + '" style="color: #000000; text-decoration: none;">License</a>');
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</td>
|
||||
<td width="5" style="border-bottom: 2px solid #FFFFFF;">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table width="380" border="0" cellpadding="0" cellspacing="0" style="height: 260px; background-color: #F7F7F7; border-width: 0 2 2 2; border-style: solid; border-color: #FFFFFF; padding: 5px;">
|
||||
<tr>
|
||||
<td style="font-family: arial, verdana, helvetica, sans serif; font-size: 10px;">
|
||||
An open source cross-browser WYSIWYG editor.<br><br>
|
||||
Version 1.4.7<br>
|
||||
|
||||
Copyright © 2006
|
||||
<a href="http://www.openwebware.com/" target="_blank">openWebWare.com</a>
|
||||
<br>
|
||||
All Rights Reserved
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<br>
|
||||
<b style="font-size: 12px;">Resources:</b>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="http://www.openwebware.com/" target="_blank">openWebWare.com Website</a> - open source applications and developer tools.
|
||||
</li>
|
||||
<li style="margin-top: 3px;">
|
||||
<a href="http://www.openwebware.com/products/openwysiwyg/" target="_blank">openWYSIWYG Homepage</a> - cross browser <textarea> replacelemt.
|
||||
</li>
|
||||
<li style="margin-top: 3px;">
|
||||
<a href="http://www.openwebware.com/forum/viewforum.php?f=1" target="_blank">User Forums</a> - trade openWYSIWYG tips and tricks with other developers.
|
||||
</li>
|
||||
<!--
|
||||
<li style="margin-top: 3px;">
|
||||
<a href="http://www.openwebware.com/products/openwysiwyg/docs/" target="_blank">Online Documentation</a> - user documentation.
|
||||
</li>
|
||||
-->
|
||||
</ul>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
75
rus/admin/_V4/_lib/openwysiwyg/popups/about_license.html
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>openWYSIWYG | About</title>
|
||||
<script type="text/javascript" src="../scripts/wysiwyg-popup.js"></script>
|
||||
<script type="text/javascript">
|
||||
var n = WYSIWYG_Popup.getParam('wysiwyg');
|
||||
</script>
|
||||
</head>
|
||||
<body bgcolor="#EEEEEE" marginwidth="0" marginheight="0" topmargin="0" leftmargin="0">
|
||||
<table border="0" cellpadding="0" cellspacing="0" style="padding: 10px;">
|
||||
<tr>
|
||||
<td>
|
||||
<table width="380" border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td style="border-bottom: 2px solid #FFFFFF;" rowspan="2">
|
||||
<script type="text/javascript">
|
||||
document.write('<img src="../' + window.opener.WYSIWYG.config[n].ImagesDir + 'logo.gif" alt="openWebWare: openWYSIWYG">');
|
||||
</script>
|
||||
</td>
|
||||
<td colspan="4" style="height: 50px;">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="60" style="background-color: #F7F7F7;">
|
||||
<table width="60" border="0" cellpadding="0" cellspacing="0"
|
||||
style="background-color: #DDDDDD; border: 2px solid #FFFFFF; padding: 2px;">
|
||||
<tr>
|
||||
<td align="center" style="font-family: arial, verdana, helvetica, sans serif; font-size: 10px;">
|
||||
<script type="text/javascript">
|
||||
document.write('<a href="about.html?wysiwyg=' + n + '" style="color: #000000; text-decoration: none;">About</a>');
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</td>
|
||||
<td width="5" style="border-bottom: 2px solid #FFFFFF;">
|
||||
|
||||
</td>
|
||||
<td width="60" style="background-color: #F7F7F7;">
|
||||
|
||||
<table width="60" border="0" cellpadding="0" cellspacing="0"
|
||||
style="background-color: #F7F7F7; border-width: 2 2 0 2; border-style: solid; border-color: #FFFFFF; border-bottom: 2px solid #F7F7F7; padding: 2px;">
|
||||
<tr>
|
||||
<td align="center"
|
||||
style="font-family: arial, verdana, helvetica, sans serif; font-size: 10px;">
|
||||
<script type="text/javascript">
|
||||
document.write('<a href="about_license.html?wysiwyg=' + n + '" style="color: #000000; text-decoration: none;">License</a>');
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</td>
|
||||
<td width="5" style="border-bottom: 2px solid #FFFFFF;">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table width="380" border="0" cellpadding="0" cellspacing="0"
|
||||
style="height: 260px; background-color: #F7F7F7; border-width: 0 2 2 2; border-style: solid; border-color: #FFFFFF; padding: 5px;">
|
||||
<tr>
|
||||
<td>
|
||||
<iframe style="width: 360px; height: 244px; border: none;" src="license.html"></iframe>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
262
rus/admin/_V4/_lib/openwysiwyg/popups/create_table.html
Normal file
|
|
@ -0,0 +1,262 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>openWYSIWYG | Create or Modify Table</title>
|
||||
|
||||
<style type="text/css">
|
||||
body, td {
|
||||
font-family: arial, verdana, helvetica;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
select, input, button {
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.table-settings {
|
||||
background-color: #F7F7F7;
|
||||
border: 2px solid #FFFFFF;
|
||||
padding: 5px;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<script type="text/javascript" src="../scripts/wysiwyg-popup.js"></script>
|
||||
<script type="text/javascript" src="../scripts/wysiwyg-color.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var n = WYSIWYG_Popup.getParam('wysiwyg');
|
||||
|
||||
// add stylesheet file
|
||||
if(n) document.write('<link rel="stylesheet" type="text/css" href="../' + WYSIWYG.config[n].CSSFile +'">\n');
|
||||
|
||||
/* ---------------------------------------------------------------------- *\
|
||||
Function : buildTable()
|
||||
Description : Builds a table and inserts it into the WYSIWYG.
|
||||
\* ---------------------------------------------------------------------- */
|
||||
function buildTable() {
|
||||
|
||||
var WYSIWYG_Table = window.opener.WYSIWYG_Table;
|
||||
var doc = WYSIWYG.getEditorWindow(n).document;
|
||||
// create a table object
|
||||
var table = doc.createElement("TABLE");
|
||||
// set cols and rows
|
||||
WYSIWYG_Core.setAttribute(table, "tmpcols", document.getElementById("cols").value);
|
||||
WYSIWYG_Core.setAttribute(table, "tmprows", document.getElementById("rows").value);
|
||||
// alignment
|
||||
if(document.getElementById("alignment").value != "")
|
||||
WYSIWYG_Core.setAttribute(table, "align", document.getElementById("alignment").value);
|
||||
|
||||
// style attributes
|
||||
var style = "";
|
||||
// padding
|
||||
style += "padding:" + document.getElementById("padding").value + "px;";
|
||||
// width
|
||||
style += "width:" + document.getElementById("width").value + document.getElementById("widthType").value + ";";
|
||||
// border
|
||||
style += "border:" + document.getElementById("border").value + "px;";
|
||||
// borderstyle
|
||||
if(document.getElementById("borderstyle").value != "none")
|
||||
style += "border-style:" + document.getElementById("borderstyle").value + ";";
|
||||
// border-color
|
||||
if(document.getElementById("bordercolor").value != "none")
|
||||
style += "border-color:" + document.getElementById("bordercolor").value + ";";
|
||||
// border-collapse
|
||||
var collapse = document.getElementById("bordercollapse").checked ? "true" : "separate";
|
||||
style += "border-collapse:" + collapse + ";";
|
||||
// background-color
|
||||
if(document.getElementById("backgroundcolor").value != "none")
|
||||
style += "background-color:" + document.getElementById("backgroundcolor").value + ";";
|
||||
|
||||
WYSIWYG_Core.setAttribute(table, "style", style);
|
||||
|
||||
|
||||
WYSIWYG_Table.create(n, table);
|
||||
window.close();
|
||||
return;
|
||||
|
||||
// Checks if the table border will use the BORDER-COLLAPSE CSS attribute
|
||||
var collapse;
|
||||
if (document.getElementById('borderCollapse').checked == true) {
|
||||
collapse = document.getElementById('borderCollapse').value;
|
||||
}
|
||||
else {
|
||||
collapse = "separate";
|
||||
}
|
||||
|
||||
// Builds a table based on the data input into the form
|
||||
var table = '<table border="0" cellpadding="0" cellspacing="0" style="';
|
||||
table += 'BORDER-COLLAPSE: ' + collapse + ';';
|
||||
table += ' border: ' + document.getElementById('borderWidth').value + ' ' + document.getElementById('borderStyle').value + ' ' + document.getElementById('borderColor').value + ';';
|
||||
table += ' width: ' + document.getElementById('tableWidth').value + document.getElementById('widthType').value + ';';
|
||||
table += ' background-color: ' + document.getElementById('shadingColor').value + ';"';
|
||||
table += ' alignment="' + document.getElementById('alignment').value + '">\n';
|
||||
|
||||
// Creates the number of rows and cols the table will have
|
||||
for (var i = 0; i < document.getElementById('rows').value; i++) {
|
||||
table += '<tr>\n';
|
||||
for (var j = 0; j < document.getElementById('cols').value; j++) {
|
||||
table += '<td style="border: ' + document.getElementById('borderWidth').value + ' ' + document.getElementById('borderStyle').value + ' ' + document.getElementById('borderColor').value + '; padding: ' + document.getElementById('padding').value + ';"> </td>\n';
|
||||
}
|
||||
table += '</tr>\n';
|
||||
}
|
||||
table += '</table>\n';
|
||||
|
||||
|
||||
// Inserts the table code into the WYSIWYG editor
|
||||
WYSIWYG.insertHTML(table, n);
|
||||
window.close();
|
||||
}
|
||||
</script>
|
||||
|
||||
<body bgcolor="#EEEEEE" marginwidth="0" marginheight="0" topmargin="0" leftmargin="0" onload="WYSIWYG_ColorInst.init();">
|
||||
|
||||
<table border="0" cellpadding="0" cellspacing="0" style="width:100%;padding: 10px;">
|
||||
<tr>
|
||||
<td>
|
||||
<span style=" font-weight: bold;">Table Properties:</span>
|
||||
|
||||
<table style="width:100%;" border="0" cellpadding="1" cellspacing="0"
|
||||
class="table-settings">
|
||||
<tr>
|
||||
<td style="width: 20%;">
|
||||
Rows:
|
||||
</td>
|
||||
<td style="width: 25%;">
|
||||
<input type="text" size="4" id="rows" name="rows" value="2" style="width: 50px;">
|
||||
</td>
|
||||
<td style="width: 25%;">
|
||||
Width:
|
||||
</td>
|
||||
<td style="width: 30%;">
|
||||
<input type="text" name="width" id="width" value="100" size="10" style="width: 50px;">
|
||||
<select name="widthType" id="widthType"
|
||||
style="margin-right: 10px; font-size: 10px;">
|
||||
<option value="%">%</option>
|
||||
<option value="px">px</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Cols:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" size="4" id="cols" name="cols" value="2" style="width: 50px;">
|
||||
</td>
|
||||
<td>
|
||||
Alignment:
|
||||
</td>
|
||||
<td>
|
||||
<select name="alignment" id="alignment" style="margin-right: 10px; width: 95px;">
|
||||
<option value="">Not Set</option>
|
||||
<option value="left">Left</option>
|
||||
<option value="right">Right</option>
|
||||
<option value="center">Center</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Padding:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="padding" name="padding" value="2" style="width: 50px;">
|
||||
</td>
|
||||
<td>
|
||||
Background-Color:
|
||||
</td>
|
||||
<td>
|
||||
<table border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td width="25">
|
||||
<table border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td>
|
||||
<input type="text" name="backgroundcolor" id="backgroundcolor" value="none" style="width:50px;">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td>
|
||||
<button style="margin-left: 2px;" onClick="WYSIWYG_ColorInst.choose('backgroundcolor');">
|
||||
Choose
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Border-Size:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" size="4" id="border" name="border" value="0" style="width: 50px;">
|
||||
</td>
|
||||
<td>
|
||||
Border-Color:
|
||||
</td>
|
||||
<td>
|
||||
<table border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td width="25">
|
||||
<table border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td>
|
||||
<input type="text" name="bordercolor" id="bordercolor" value="none" style="width:50px;">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td>
|
||||
<button style="margin-left: 2px;" onClick="WYSIWYG_ColorInst.choose('bordercolor');">
|
||||
Choose
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Border-Style:
|
||||
</td>
|
||||
<td>
|
||||
<select id="borderstyle" name="borderstyle" style="width: 80px;">
|
||||
<option value="none">none</option>
|
||||
<option value="solid">solid</option>
|
||||
<option value="double">double</option>
|
||||
<option value="dotted">dotted</option>
|
||||
<option value="dashed">dashed</option>
|
||||
<option value="groove">groove</option>
|
||||
<option value="ridge">ridge</option>
|
||||
<option value="inset">inset</option>
|
||||
<option value="outset">outset</option>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
Border-Collapse:
|
||||
</td>
|
||||
<td>
|
||||
<input type="checkbox" name="bordercollapse" id="bordercollapse">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div align="right">
|
||||
<input type="submit" value=" Submit " onClick="buildTable();"
|
||||
style="font-size: 12px;">
|
||||
|
||||
<input type="submit" value=" Cancel " onClick="window.close();"
|
||||
style="font-size: 12px; margin-right: 15px;">
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
173
rus/admin/_V4/_lib/openwysiwyg/popups/insert_hyperlink.html
Normal file
|
|
@ -0,0 +1,173 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>openWYSIWYG | Create or Modify Link</title>
|
||||
</head>
|
||||
<script type="text/javascript" src="../scripts/wysiwyg-popup.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
/* ---------------------------------------------------------------------- *\
|
||||
Function : insertHyperLink() (changed)
|
||||
Description : Insert the link into the iframe html area
|
||||
\* ---------------------------------------------------------------------- */
|
||||
function insertHyperLink() {
|
||||
var n = WYSIWYG_Popup.getParam('wysiwyg');
|
||||
|
||||
// get values from form fields
|
||||
var href = document.getElementById('linkUrl').value;
|
||||
var target = document.getElementById('linkTarget').value;
|
||||
var style = document.getElementById('linkStyle').value;
|
||||
var styleClass = document.getElementById('linkClass').value;
|
||||
var name = document.getElementById('linkName').value;
|
||||
|
||||
// insert link
|
||||
WYSIWYG.insertLink(href, target, style, styleClass, name, n);
|
||||
window.close();
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- *\
|
||||
Function : loadLink() (new)
|
||||
Description : Load the link attributes to the form
|
||||
\* ---------------------------------------------------------------------- */
|
||||
function loadLink() {
|
||||
// get params
|
||||
var n = WYSIWYG_Popup.getParam('wysiwyg');
|
||||
|
||||
// get selection and range
|
||||
var sel = WYSIWYG.getSelection(n);
|
||||
var range = WYSIWYG.getRange(sel);
|
||||
var lin = null;
|
||||
if(WYSIWYG_Core.isMSIE) {
|
||||
if(sel.type == "Control" && range.length == 1) {
|
||||
range = WYSIWYG.getTextRange(range(0));
|
||||
range.select();
|
||||
}
|
||||
if (sel.type == 'Text' || sel.type == 'None') {
|
||||
sel = WYSIWYG.getSelection(n);
|
||||
range = WYSIWYG.getRange(sel);
|
||||
// find a as parent element
|
||||
lin = WYSIWYG.findParent("a", range);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// find a as parent element
|
||||
lin = WYSIWYG.findParent("a", range);
|
||||
}
|
||||
|
||||
// if no link as parent found exit here
|
||||
if(lin == null) return;
|
||||
|
||||
// set form elements with attribute values
|
||||
for(var i=0; i<lin.attributes.length; i++) {
|
||||
var attr = lin.attributes[i].name.toLowerCase();
|
||||
var value = lin.attributes[i].value;
|
||||
if(attr && value && value != "null") {
|
||||
switch (attr) {
|
||||
case "href":
|
||||
// strip off urls on IE
|
||||
if(WYSIWYG_Core.isMSIE) value = WYSIWYG.stripURLPath(n, value, false);
|
||||
document.getElementById('linkUrl').value = value;
|
||||
break;
|
||||
case "target":
|
||||
document.getElementById('linkTarget').value = value;
|
||||
selectItemByValue(document.getElementById('linkTargetChooser'), value);
|
||||
break;
|
||||
case "name":
|
||||
document.getElementById('linkName').value = value;
|
||||
break;
|
||||
case "class":
|
||||
document.getElementById('linkClass').value = value;
|
||||
break;
|
||||
case "className":
|
||||
document.getElementById('linkClass').value = value;
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Getting style attribute of the link separately, because IE interprets the
|
||||
// style attribute is an complex object, and do not return a text stylesheet like Mozilla.
|
||||
document.getElementById('linkStyle').value = WYSIWYG_Core.replaceRGBWithHexColor(WYSIWYG_Core.getAttribute(lin, "style"));
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- *\
|
||||
Function : updateTarget() (new)
|
||||
Description : Updates the target text field
|
||||
Arguments : value - Value to be set
|
||||
\* ---------------------------------------------------------------------- */
|
||||
function updateTarget(value) {
|
||||
document.getElementById('linkTarget').value = value;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- *\
|
||||
Function : selectItem()
|
||||
Description : Select an item of an select box element by value.
|
||||
\* ---------------------------------------------------------------------- */
|
||||
function selectItemByValue(element, value) {
|
||||
if(element.options.length) {
|
||||
for(var i=0;i<element.options.length;i++) {
|
||||
if(element.options[i].value == value) {
|
||||
element.options[i].selected = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
element.options[(element.options.length-1)].selected = true;
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
<body bgcolor="#EEEEEE" marginwidth="0" marginheight="0" topmargin="0" leftmargin="0" onLoad="loadLink();">
|
||||
|
||||
<table border="0" cellpadding="0" cellspacing="0" style="padding: 10px;"><tr><td>
|
||||
|
||||
<span style="font-family: arial, verdana, helvetica; font-size: 11px; font-weight: bold;">Insert Hyperlink:</span>
|
||||
<table width="330" border="0" cellpadding="1" cellspacing="0" style="background-color: #F7F7F7; border: 2px solid #FFFFFF; padding: 5px;">
|
||||
<tr>
|
||||
<td style="padding-bottom: 2px; padding-top: 0px; font-family: arial, verdana, helvetica; font-size: 11px;">URL:</td>
|
||||
<td style="padding-bottom: 2px; padding-top: 0px;" colspan="3">
|
||||
<input type="text" name="linkUrl" id="linkUrl" value="http://" style="font-size: 10px; width: 100%;">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-bottom: 2px; width: 50px; font-family: arial, verdana, helvetica; font-size: 11px;">Target:</td>
|
||||
<td style="padding-bottom: 2px;" colspan="3">
|
||||
<input type="text" name="linkTarget" id="linkTarget" value="" style="font-size: 10px; width: 65%;">
|
||||
|
||||
<select name="linkTargetChooser" id="linkTargetChooser" style="font-size: 10px; width: 30%;" onchange="updateTarget(this.value);">
|
||||
<option value="" selected>no target</option>
|
||||
<option value="_blank">_blank</option>
|
||||
<option value="_self">_self</option>
|
||||
<option value="_parent">_parent</option>
|
||||
<option value="_top">_top</option>
|
||||
<option value="">custom</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-bottom: 2px; width: 50px; font-family: arial, verdana, helvetica; font-size: 11px;">Style:</td>
|
||||
<td style="padding-bottom: 2px;" colspan="3">
|
||||
<input type="text" name="linkStyle" id="linkStyle" value="" style="font-size: 10px; width: 100%;">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-bottom: 2px; width: 50px; font-family: arial, verdana, helvetica; font-size: 11px;">Class:</td>
|
||||
<td style="padding-bottom: 2px;">
|
||||
<input type="text" name="linkClass" id="linkClass" value="" style="font-size: 10px; width: 90%;">
|
||||
</td>
|
||||
<td style="padding-bottom: 2px; width: 30px; font-family: arial, verdana, helvetica; font-size: 11px;">Name:</td>
|
||||
<td style="padding-bottom: 2px; width: 120px;">
|
||||
<input type="text" name="linkName" id="linkName" value="" style="font-size: 10px; width: 100%;">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
<div align="right" style="padding-top: 5px;"><input type="submit" value=" Submit " onClick="insertHyperLink();" style="font-size: 12px;" > <input type="submit" value=" Cancel " onClick="window.close();" style="font-size: 12px;" ></div>
|
||||
|
||||
</td></tr></table>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
185
rus/admin/_V4/_lib/openwysiwyg/popups/insert_image.html
Normal file
|
|
@ -0,0 +1,185 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>openWYSIWYG | Insert or Modify Image</title>
|
||||
|
||||
<script type="text/javascript" src="../scripts/wysiwyg-popup.js"></script>
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
|
||||
/* ---------------------------------------------------------------------- *\
|
||||
Function : insertImage()
|
||||
Description : Inserts image into the WYSIWYG.
|
||||
\* ---------------------------------------------------------------------- */
|
||||
function insertImage() {
|
||||
var n = WYSIWYG_Popup.getParam('wysiwyg');
|
||||
|
||||
// get values from form fields
|
||||
var src = document.getElementById('src').value;
|
||||
var alt = document.getElementById('alt').value;
|
||||
var width = document.getElementById('width').value
|
||||
var height = document.getElementById('height').value
|
||||
var border = document.getElementById('border').value
|
||||
var align = document.getElementById('align').value
|
||||
var vspace = document.getElementById('vspace').value
|
||||
var hspace = document.getElementById('hspace').value
|
||||
|
||||
// insert image
|
||||
WYSIWYG.insertImage(src, width, height, align, border, alt, hspace, vspace, n);
|
||||
window.close();
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- *\
|
||||
Function : loadImage()
|
||||
Description : load the settings of a selected image into the form fields
|
||||
\* ---------------------------------------------------------------------- */
|
||||
function loadImage() {
|
||||
var n = WYSIWYG_Popup.getParam('wysiwyg');
|
||||
|
||||
// get selection and range
|
||||
var sel = WYSIWYG.getSelection(n);
|
||||
var range = WYSIWYG.getRange(sel);
|
||||
|
||||
// the current tag of range
|
||||
var img = WYSIWYG.findParent("img", range);
|
||||
|
||||
// if no image is defined then return
|
||||
if(img == null) return;
|
||||
|
||||
// assign the values to the form elements
|
||||
for(var i = 0;i < img.attributes.length;i++) {
|
||||
var attr = img.attributes[i].name.toLowerCase();
|
||||
var value = img.attributes[i].value;
|
||||
//alert(attr + " = " + value);
|
||||
if(attr && value && value != "null") {
|
||||
switch(attr) {
|
||||
case "src":
|
||||
// strip off urls on IE
|
||||
if(WYSIWYG_Core.isMSIE) value = WYSIWYG.stripURLPath(n, value, false);
|
||||
document.getElementById('src').value = value;
|
||||
break;
|
||||
case "alt":
|
||||
document.getElementById('alt').value = value;
|
||||
break;
|
||||
case "align":
|
||||
selectItemByValue(document.getElementById('align'), value);
|
||||
break;
|
||||
case "border":
|
||||
document.getElementById('border').value = value;
|
||||
break;
|
||||
case "hspace":
|
||||
document.getElementById('hspace').value = value;
|
||||
break;
|
||||
case "vspace":
|
||||
document.getElementById('vspace').value = value;
|
||||
break;
|
||||
case "width":
|
||||
document.getElementById('width').value = value;
|
||||
break;
|
||||
case "height":
|
||||
document.getElementById('height').value = value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// get width and height from style attribute in none IE browsers
|
||||
if(!WYSIWYG_Core.isMSIE && document.getElementById('width').value == "" && document.getElementById('width').value == "") {
|
||||
document.getElementById('width').value = img.style.width.replace(/px/, "");
|
||||
document.getElementById('height').value = img.style.height.replace(/px/, "");
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- *\
|
||||
Function : selectItem()
|
||||
Description : Select an item of an select box element by value.
|
||||
\* ---------------------------------------------------------------------- */
|
||||
function selectItemByValue(element, value) {
|
||||
if(element.options.length) {
|
||||
for(var i=0;i<element.options.length;i++) {
|
||||
if(element.options[i].value == value) {
|
||||
element.options[i].selected = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body bgcolor="#EEEEEE" marginwidth="0" marginheight="0" topmargin="0" leftmargin="0" onLoad="loadImage();">
|
||||
|
||||
<table border="0" cellpadding="0" cellspacing="0" style="padding: 10px;"><tr><td>
|
||||
|
||||
<span style="font-family: arial, verdana, helvetica; font-size: 11px; font-weight: bold;">Insert Image:</span>
|
||||
<table width="380" border="0" cellpadding="0" cellspacing="0" style="background-color: #F7F7F7; border: 2px solid #FFFFFF; padding: 5px;">
|
||||
<tr>
|
||||
<td style="padding-bottom: 2px; padding-top: 0px; font-family: arial, verdana, helvetica; font-size: 11px;" width="80">Image URL:</td>
|
||||
<td style="padding-bottom: 2px; padding-top: 0px;" width="300"><input type="text" name="src" id="src" value="" style="font-size: 10px; width: 100%;"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-bottom: 2px; padding-top: 0px; font-family: arial, verdana, helvetica; font-size: 11px;">Alternate Text:</td>
|
||||
<td style="padding-bottom: 2px; padding-top: 0px;"><input type="text" name="alt" id="alt" value="" style="font-size: 10px; width: 100%;"></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
<table width="380" border="0" cellpadding="0" cellspacing="0" style="margin-top: 10px;"><tr><td style="vertical-align:top;">
|
||||
|
||||
<span style="font-family: arial, verdana, helvetica; font-size: 11px; font-weight: bold;">Layout:</span>
|
||||
<table width="180" border="0" cellpadding="0" cellspacing="0" style="background-color: #F7F7F7; border: 2px solid #FFFFFF; padding: 5px;">
|
||||
<tr>
|
||||
<td style="padding-bottom: 2px; padding-top: 0px; font-family: arial, verdana, helvetica; font-size: 11px;">Width:</td>
|
||||
<td style="width:60px;padding-bottom: 2px; padding-top: 0px;"><input type="text" name="width" id="width" value="" style="font-size: 10px; width: 100%;"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-bottom: 2px; padding-top: 0px; font-family: arial, verdana, helvetica; font-size: 11px;">Height:</td>
|
||||
<td style="padding-bottom: 2px; padding-top: 0px;"><input type="text" name="height" id="height" value="" style="font-size: 10px; width: 100%;"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-bottom: 2px; padding-top: 0px; font-family: arial, verdana, helvetica; font-size: 11px;">Border:</td>
|
||||
<td style="padding-bottom: 2px; padding-top: 0px;"><input type="text" name="border" id="border" value="0" style="font-size: 10px; width: 100%;"></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</td>
|
||||
<td width="10"> </td>
|
||||
<td style="vertical-align:top;">
|
||||
|
||||
<span style="font-family: arial, verdana, helvetica; font-size: 11px; font-weight: bold;"> </span>
|
||||
<table width="200" border="0" cellpadding="0" cellspacing="0" style="background-color: #F7F7F7; border: 2px solid #FFFFFF; padding: 5px;">
|
||||
<tr>
|
||||
<td style="width: 115px;padding-bottom: 2px; padding-top: 0px; font-family: arial, verdana, helvetica; font-size: 11px;" width="100">Alignment:</td>
|
||||
<td style="width: 85px;padding-bottom: 2px; padding-top: 0px;">
|
||||
<select name="align" id="align" style="font-family: arial, verdana, helvetica; font-size: 11px; width: 100%;">
|
||||
<option value="">Not Set</option>
|
||||
<option value="left">Left</option>
|
||||
<option value="right">Right</option>
|
||||
<option value="texttop">Texttop</option>
|
||||
<option value="absmiddle">Absmiddle</option>
|
||||
<option value="baseline">Baseline</option>
|
||||
<option value="absbottom">Absbottom</option>
|
||||
<option value="bottom">Bottom</option>
|
||||
<option value="middle">Middle</option>
|
||||
<option value="top">Top</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-bottom: 2px; padding-top: 0px; font-family: arial, verdana, helvetica; font-size: 11px;">Horizontal Space:</td>
|
||||
<td style="padding-bottom: 2px; padding-top: 0px;"><input type="text" name="hspace" id="hspace" value="" style="font-size: 10px; width: 100%;"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-bottom: 2px; padding-top: 0px; font-family: arial, verdana, helvetica; font-size: 11px;">Vertical Space:</td>
|
||||
<td style="padding-bottom: 2px; padding-top: 0px;"><input type="text" name="vspace" id="vspace" value="" style="font-size: 10px; width: 100%;"></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</td></tr></table>
|
||||
|
||||
<div align="right" style="padding-top: 5px;"><input type="submit" value=" Submit " onClick="insertImage();" style="font-size: 12px;" > <input type="submit" value=" Cancel " onClick="window.close();" style="font-size: 12px;" ></div>
|
||||
|
||||
</td></tr></table>
|
||||
|
||||
</body>
|
||||
</html>
|
||||