English
PHP, HTML & JavaScript- Forum

Done: Texteditor in JS

 

Thomas
Zielinski
Hello people,
I attempt straight one CMS To basteln. except for a kleinigkeit runs too everything. the einzigste what me care bereitet, is the editor for new Posts. Similar the editor here in the Community should one defined Tags by Button directly insert can. The problem lying now with whom Images.
its uncharted How many Images uses go. therefore must The input the Images The Hochgeladen go should dynamic his. This will from the function newImage() resolved. Zumindist fügt these new Inputfelder type="file" one. really wished I The Paths to that later Upload by mail on The suitable Page Send, allerdiengs weg thereby The Paths lost. means thinking I me, before The data into Hiddenelement umzuspeichern (as long as one The Page not leave remaining the way in the Value the Input type="file"). I could before The data on a JS-function Send in that Hiddenelement Save unnd then moreover on The Page to that evaluate Send. moreover be I but To thick --> HILFE! How are the?
through one Click on the Button right next to the Input type="file" should then the day into Textarea eingefügt go ([IMG SRC="entsprechender Pfad"]). still becomes this Button dynamic over The function newImage() eingefügt and any try there one onClick einzufügen so How I it with because static Buttons made have. though was is I do not possible, this onClick with incorporate. means here: How are the?

Thanks Schonmal in the Vorraus.

Folgender Script(JS):
(komplet visible under  [...]  )
<?php echo blub:.$_POST[bildpfad1]; ?>
<script type="text/javascript">
<!--
var bildzahl = 0;

function addText(area,type) {

    if (type == b1) {

        area.value += "[B]";
        the_button = document.getElementById(big1);
        the_button.style.display = none;
        the_button = document.getElementById(big2);
        the_button.style.display = ;

    }

    else if (type == b2) {

        area.value += "[/B]";
        the_button = document.getElementById(big2);
        the_button.style.display = none;
        the_button = document.getElementById(big1);
        the_button.style.display = ;

    }

    //... an so on any Buttons through

}

function newImage() {

    bildzahl++;
    var Ausgabebereich = document.getElementById("Bilder");
    var myINPUT = document.createElement("input");
    myINPUT.type = file;
    myINPUT.size = 45;
    myINPUT.name = IMGINPUT+bildzahl;
    Ausgabebereich.appendChild(myINPUT);
    var myHIDDEN = document.createElement("input");//<-- hiddenelement into to the Send the way stored go should circa it not To lose.
    myHIDDEN.type = hidden;
    myHIDDEN.name = bildpfad+bildzahl;
    myHIDDEN.value= ;
    Ausgabebereich.appendChild(myHIDDEN);
    var myBUTTON = document.createElement("input");//<-- onClick-Ereigniss bring into action similar addText() with IMG
    myBUTTON.type = button;
    myBUTTON.value = Image insert;
    Ausgabebereich.appendChild(myBUTTON);
    var myBR = document.createElement("br");
    Ausgabebereich.appendChild(myBR);

}

//-->
</script>
<shape action="<?php echo $_SERVER[PHP_SELF]; ?>" method="POST">
<textarea name="blubtext" rows="20" long="de" cols="53"></textarea><br>
<input type="button" value="Fett" onClick="addText(this.shape.blubtext,b1)" id="fett1">
<input style="display:none" type="button" value="/Fett" onClick="addText(this.shape.blubtext,b2) " id="fett2">
<input type="button" value="Kursiv" onClick="addText(this.shape.blubtext,k1)" id="kursiv1">
<input style="display:none" type="button" value="/Kursiv" onClick="addText(this.shape.blubtext,k2) " id="kursiv2">
<input type="button" value="U" onClick="addText(this.shape.blubtext,u1)" id="unter1">
<input style="display:none" type="button" value="/U" onClick="addText(this.shape.blubtext,u2) " id="unter2">
<input type="button" value="&Uuml;berschrift" onClick="addText(this.shape.blubtext,h1)" id="h1">
<input style="display:none" type="button" value="&Uuml;berschrift" onClick="addText(this.shape.blubtext,h2)" id="h2">
<input type="button" value="Table" onClick="addText(this.shape.blubtext,t1)" id="t1">
<input style="display:none" type="button" value="/Table" onClick="addText(this.shape.blubtext,t2)" id="t2">
<input type="button" value="Tr" onClick="addText(this.shape.blubtext,tr1)" id="tr1">
<input style="display:none" type="button" value="/Tr" onClick="addText(this.shape.blubtext,tr2)" id="tr2">
<input type="button" value="Td" onClick="addText(this.shape.blubtext,td1)" id="td1">
<input style="display:none" type="button" value="/Td" onClick="addText(this.shape.blubtext,td2)" id="td2">
<input type="Submit" value="Save" id="saveacomment">
<div id="Bilder"><input value="Neues Image laden" type="button" onClick="newImage();"><br></div>
<script type="text/javascript">newImage();</script>
</shape>

Greeting Thomas
 
XProfan X4; Win10 x64
Der Kuchen ist eine lüge!
06/25/09  
 



to that Text+Image there to Time 2 gängige Opportunities, one Applet (Java) or one editierbarer Body (Contenteditable).

One simple example for Variante 2 shows vBulletin z.B. with Paule  [...]  . (eingeloggt his) (Click The Smilies.)

this is the "gängige" principle what too slight adaptierbar is.

The whole others Problems solve itself with of/ one Session or. with a Cookie, otherwise only by Variablenweitergabe of form To form.

You can your Hochladeformular too into hidden Iframe lenken by Target, The dahinterliegende PHP can JavaScript zurücksenden on Top How <script>top.myInsertToMyEdit("someText")</script> around the "Antwort" in your Edit To Send.
 
06/25/09  
 




Thomas
Zielinski
I Have the feeling you've got me wrong.
at that first point werd I with the because Keksen make or Session. time sehn on what I pleasure get.
what whom second unkt angeht talk we each other past. i will not the image directly insert. is me schnuppe. is finally Yes only for writer. separate one day into Textarea ala [IMG SRC="entspechender Pfad"]. for normal would I here whom Button so style <input type="button" onClick="der funktionsaufruf">. only I get here:

no onClickereigniss with herrein what then trigger would. the should Yes dynamic his. at that Upload of append here in the Community functions The Number of Fields for present still too dynamic, iF.
Greeting Thomas
 
XProfan X4; Win10 x64
Der Kuchen ist eine lüge!
06/25/09  
 



moreover was the hint virtual:

You can your Hochladeformular too into hidden Iframe lenken by Target, The dahinterliegende PHP can JavaScript zurücksenden on Top How <script>top.myInsertToMyEdit("someText")</script> around the "Antwort" in your Edit To Send.
 
06/25/09  
 



Ah, i'm invaded where I the so institute of technology - in the actually smallBum  [...]  !

even at the same time up to 5 Downloads.

(these Variante can itself too roughly strain)
;if ($_FILES[postfilein][size]>$_smallbum_conf[MaxUploadSize])
The("< script style=text/javascript>;top.gal_ui_upfreset(".$uploadTargetForm.")< /script>")
 
06/25/09  
 




Thomas
Zielinski
Ah okay. has I übersehn. I versuchs time. the sound well.
 
XProfan X4; Win10 x64
Der Kuchen ist eine lüge!
06/25/09  
 



have I first thereafter angefügt, "Nachtrag:" has gefehlt, have You means probably not at all time overlooking.

Mist, Have again ne idea.
 
06/25/09  
 




Thomas
Zielinski
Re quiet always out so. I Have of course only rudimentärste Grundkentinisse of JS but one plan B can never damage.
Greeting Thomas
 
XProfan X4; Win10 x64
Der Kuchen ist eine lüge!
06/25/09  
 



Sorry, no about.

the Stabilste is really if you the < shape target="myIframe" ... > as response one < script type="text/javascript" >;top.eineFunc("[insertText]")< /script > give back can. in the main hold a function eineFunc(s){ The s then in that Edit einfügt. therefore the You the shape too one onSubmit miss out on can, can You even dynamic the shape.target Change.

so seen is JS How XProfan one Cockaigne. ^^ (and PHP naturally too)
 
06/25/09  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

13.200 Views

Untitledvor 0 min.
Walter07/24/23
iF09/28/20
Nkh201807/21/18
Michael Borowiak11/30/14
More...

Themeninformationen

this Topic has 2 subscriber:

iF (5x)
Thomas Zielinski (4x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie