<html>
<head>
<link rel="stylesheet" href="../css/editor.css" type="text/css" />
<script type="text/javascript" src="../js/s-editor.js"></script>
<script type="text/javascript">
window.onload = function (){
Editor = document.getElementById('box').contentWindow.document;
Editor.open();
Editor.write('<?
$text=$_SESSION['s_text']['TEXT'];
Editor.close();
Editor.designMode = "on";
}
</script>
<script>
$(document).ready(function(){
new Ajax_upload('#addImage_add', {
action: '../include/s-editor_addImage.php',
onSubmit : function(file , ext){
if (ext && /^(jpg|png|jpeg|gif)$/.test(ext)){
/* Setting data */
$('#addImage_add').text('Ładuje ' + file);
} else {
$('#addImage_add').text('Tylko pliki graficzne! (GIF, JPG lub PNG)');
return false;
}
},
onComplete : function(file, response){
$('#addImage_add').text("Kliknij, aby dodać nowe zdjęcie...");
//insertlocalimage(file);
//$.get('../include/s-editor_refImage.php',function(data){alert(data)});
$('#miniaturki_ref').load('../include/s-editor_refImage.php');
}
});
});
function open_image(){
$('#addImage').toggle('slide',{ direction: 'left'});
}
function delete_image(file){
if(confirm('Skasować?')){
$('#addImage_add').load('../include/s-editor_deleteImage.php',{plik: file},function(file, response){
$('#addImage_add').text("Kliknij, aby dodać nowe zdjęcie...");
$('#miniaturki_ref').load('../include/s-editor_refImage.php');
});
//document.getElementById('addImage').style.display='none';
}}
function insertlocalimage(imagePath) {
Editor.execCommand('InsertImage', false, 'http://
<?echo $_SERVER['SERVER_NAME'];?>/site_images/miniaturki/'+imagePath );
}
//<img id="greatphoto" src="brush-seller.jpg" alt="brush seller" />
function insertimage() {
imagePath=prompt('Wstaw adres do obrazka:', 'http://');
if ((imagePath != null) && (imagePath != "")) {
Editor.execCommand('InsertImage', false, imagePath);
}
}
</script>
<script type="text/javascript" src="../js/color/color.js"></script>
<BODY>
<table cellspacing=0 cellmargin= 0 id="table" >
<tr><td>
<table id="przyciski"><tr>
<td><div class="ibutton"><img src="../images/editor/undo.gif" onClick="dowithtext('Undo')" title="undo" /></div></td>
<td><div class="ibutton"><img src="../images/editor/redo.gif" onClick="dowithtext('Redo')" title="redo" /></div></td>
<td><div class="ibutton"><img src="../images/editor/bold.gif" onClick="dowithtext('bold')" title="bold" /></div></td>
<td><div class="ibutton"><img src="../images/editor/italic.gif" onClick="dowithtext('italic')" title="italic" /></div></td>
<td><div class="ibutton"><img src="../images/editor/underline.gif" onClick="dowithtext('underline')" title="underline" /></div></td>
<td><div class="ibutton"><img src="../images/editor/link.gif" onClick="createURL()" title="URL" /></div></td>
<td><div class="ibutton"><img src="../images/editor/unlink.gif" onClick="dowithtext('Unlink')" title="unlink" /></div></td>
<td><div class="ibutton"><img src="../images/editor/insertlocalimage.gif" onClick="open_image()" title="insert image" /></div></td>
<td><div class="ibutton"><img src="../images/editor/insertimage.gif" onClick="insertimage()" title="insert image" /></div></td>
<td><div class="ibutton"><img src="../images/editor/justifyleft.gif" onClick="dowithtext('justifyleft')" title="justify left" /></div></td>
<td><div class="ibutton"><img src="../images/editor/justifycenter.gif" onClick="dowithtext('justifycenter')" title="justify center" /></div></td>
<td><div class="ibutton"><img src="../images/editor/justifyright.gif" onClick="dowithtext('justifyright')" title="justify right" /></div></td>
<td><div class="ibutton"><img src="../images/editor/justifyfully.gif" onClick="dowithtext('justifyfull')" title="justify fully" /></div></td>
<td><div class="ibutton"><img src="../images/editor/unorderedlist.gif" onClick="dowithtext('insertunorderedlist')" title="unordered list" /></div></td>
<td><div class="ibutton"><img src="../images/editor/orderedlist.gif" onClick="dowithtext('insertorderedlist')" title="ordered list" /></div></td>
<td><div class="ibutton"><img src="../images/editor/down.png" onClick="textbox_resize(100);" title="down" /></div></td>
<td><div class="ibutton"><img src="../images/editor/up.png" onClick="textbox_resize(-100);" title="up" /></div></td>
</tr><tr>
<td colspan="3"><select unselectable="on" id="fontsize" onchange="Select(this.id);">
<option value="Size">Size</option>
<option value="1">Tiny</option>
<option value="2">Small</option>
<option value="3">Normal</option>
<option value="5">Large</option>
<option value="7">Huge</option>
</select></td>
<td colspan="5"><select id="fontname" onChange="Font(this.options[this.selectedIndex].value)">
<option value ="">-- Font --</option>
<option value ="Arial">Arial</option>
<option value ="Courier">Courier</option>
<option value ="Georgia">Georgia</option>
<option value ="Comic Sans MS">Comic Sans MS</option>
<option value ="Sans Serif">Sans Serif</option>
<option value ="Tahoma">Tahoma</option>
<option value ="Times New Roman">Times New Roman</option>
<option value ="Verdana">Verdana</option>
<option value ="Weddings">Wingdings</option>
</select></td>
<td colspan="3"><input class="color {pickerFaceColor:'transparent',pickerFace:3,pickerBorder:0,pickerInsetColor:'black',pickerMode:'HSV'}" value="000000"
size="4" onchange="Colour(this.color);"></td>
</tr></table></td><td rowspan="2">
<div id="addImage">
<div id="addImage_add">Kliknij, aby dodać nowe zdjęcie...</div>
<div id="miniaturki_ref" style="margin-top:10px;height: 450px;overflow:scroll;overflow-x: hidden;">
<?php
$d = dir("../site_images/miniaturki"); while (false !== ($file = $d->read())) {
//echo $entry."\n";
if($file !== "." && $file !== "..")
echo "<div id=\"miniaturka\"><img src='../site_images/miniaturki/".$file."' alt='".$file."' title='".$file."' onclick=\"insertlocalimage('".$file."');document.getElementById('addImage').style.display='none' ;\"><div id='delete_image' onclick=\"delete_image('".$file."')\"></div></div>"; }
$d->close();
?>
</div>
</div></td>
</tr><tr><td>
<form method="POST" action="index.php?tryb=
<?php echo($_GET['tryb']); ?>&offer_id=
<?php echo($_GET['offer_id']); ?>">
<Br>
<?php echo('<b><div id="red">Tytuł:</b><input type="text" value="'.$_SESSION['s_text']['TITLE'].'" name="title"/></div>'); ?><br>
<?php echo('<b><div id="red">Tytuł SEO:</b><input type="text" size="80" value="'.$_SESSION['s_text']['TITLESEO'].'" name="titleseo"/></div>'); ?><br>
<?php echo('<b><div id="red">Opis SEO:</b><input type="text" size="80" value="'.$_SESSION['s_text']['DESCRIPTIONS'].'" name="descriptions"/></div>'); ?><br>
<?php echo('<b><div id="red">Slowa kluczowe:</b><input type="text" size="74" value="'.$_SESSION['s_text']['TAGS'].'" name="tags"/></div>'); ?><br>
<input type="hidden" id="htext" name="htext"/>
<input type="hidden" name="s_id" value="
<?php echo((!empty($_GET['offer_id']) ?
$_GET['offer_id'] : $_GET['id']));?>"/>
<input type="hidden" name="s_tryb" value="
<?php echo($_GET['tryb']);?>"/>
<input type="hidden" name="s_kat" value="
<?php echo($_GET['page_kat']);?>"/>
<input type="hidden" name="s_save" value="true"/>
<iframe id="box" width="100%" scrolling="auto" height="300"></iframe>
<?php
if(strpos($brow, 'msie') == false) { echo('<input type="checkbox" id="source" onclick="viewsource(this.checked)"> Tryb HTML</input>');}
?>
<input type="submit" id="save" onclick="Gettext()" value="Zapisz">
</form>
</td></tr>
</table>
<br />
</body>
</html>