Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Marcos Coelho2

Formatar Texto Parecido com o Imaster Forum

Recommended Posts

Deixa eu explicar melhor oq eu quero

e axo q todos ja tiveram que fazer oq eu to querendo

 

Eu to querendo fazer um campo na minha pagina administrador em que eu possa colocar negrito italico colocar links...

igual esse campo que agent escreve aki no forum e programa se quer negrito italico e tals

 

Alguem sabe ond posso arrumar um?

pq ja fiz varias buscar na internet e nao consegui exemplos...

ou entao me deem dicas d como fazer

Compartilhar este post


Link para o post
Compartilhar em outros sites

olha um exemplo simples:

 

<% @LANGUAGE="VBSCRIPT" %>
<%



dim objFSO
set objFSO = createobject("scripting.filesystemobject")


dim stHomePage
strHomePage = "default.asp"



dim strFilePath
strFilePath = ""
'strFilePath = request.querystring("path")
'strFilePath = request.form("path")


dim strScriptName
strScriptName = request.servervariables("script_name")
strScriptName = mid(strScriptName, instrrev(strScriptName, "/") + 1)

if request.form("update") = "" then

const fsoForReading = 1


dim objFile
objFile = "example.asp"


'objFile = request.form("file")
'objFile = request.querystring("file")

dim objFileContents
set objFileContents = objFSO.OpenTextFile(server.mappath(strFilePath & objFile), fsoForReading)

dim strFileContents
strFileContents = objFileContents.ReadAll

else if request.form("update") <> "" then


dim strWriteContents
strWriteContents = request.form("pageHTML")

if strWriteContents = "" then
strWriteContents = "This page is currently un-available."
strWriteContents = strNewContent & vbCrLf & "<br><br>"
strWriteContents = strNewContent & vbCrLf & "We apologise for any inconvenience caused."
end if

set objWriteFile = objFSO.OpenTextFile(server.mappath(strFilePath & request.form("file")), 2, true)
objWriteFile.write(strWriteContents)
objWriteFile.close
set objWriteFile = nothing

response.redirect strHomePage


end if
end if


if request.querystring("mode") = "delete" then


dim deleteFile
deleteFile = request.querystring("file")

if len(deleteFile) = "" then
 response.write "ERROR! There was no file supplied to delete!<br>"
 response.write vbCrLf & "Please <a href="""& strScriptName & """>go back</a> and try again"
 response.end
end if

if objFSO.fileexists(server.mappath(strFilePath & deleteFile)) then

dim objFileDelete
set objFileDelete = objFSO.GetFile(server.mappath(strFilePath & deleteFile))
    objFileDelete.delete
set objFileDelete = nothing
else

 response.write "ERROR! File: " & deleteFile & " does not appear to exist.<br>"
 response.write vbCrLf & "Please check your <b>File Path</b> and <b>File Name</b>.<br>"
 response.write vbCrLf & "Go <a href=""" & strScriptName & """>Back</a> and try again."
 response.end
end if

response.redirect strHomePage


end if
%>
<html>
<head>
<title>Text Editor</title>
<script language="javascript">
<!--
function over(element) {
element.style.borderStyle= "solid";
element.style.borderWidth = "1px";
element.style.borderColor = "#000000";
element.style.backgroundColor = "#F1F1F1";
element.style.cursor = "hand";
}

function out(element) {
element.style.borderColor = "#CCCCCC";
element.style.backgroundColor = "#CCCCCC"
element.style.cursor = "default";
}

function readyDiv() {
var theHTML;
theHTML = document.all.tags('div')['pageHTML'].innerText;
document.all.tags('div')['pageHTML'].innerHTML = theHTML;
}

var isHTMLMode = false

// edit html feature currently disbaled, working on it when i have time
function checkMode() {
if(isHTMLMode) {
  alert("Please uncheck: 'Edit HTML'");
  return;
  }
}

function cmdExec(cmd,opt) {
checkMode();
pageHTML.document.execCommand(cmd,"",opt);
document.body.all.tags('div')['pageHTML'].focus();
}

function createLink() {
checkMode();
cmdExec("CreateLink");
}

function insertImage() {
checkMode();
var sImgSrc = prompt("Image: ", "http://www.[domain].[ext]/[folder]/[file]");
if(sImgSrc!=null)
cmdExec("InsertImage",sImgSrc);
}

function div2hidden(objForm) {
objForm.pageHTML.value = document.all.tags('div')['pageHTML'].innerHTML;
}

function go(where) {
window.location.href = where;
}
//-->
</script>
</head>
<body bgcolor="#FFFFFF">
<form name="frmedit" method="post" onsubmit="return div2hidden(this);" action="editor.asp">
<input type="hidden" name="pageHTML" value="">
<input type="hidden" name="update" value="1">
<input type="hidden" name="file" value="<%= objFile %>">
<table width="550" cellpadding="2" cellspacing="2" align="center" style="border-style: solid; border-width: 1px; border-color: #000000;" bgcolor="#CCCCCC">
<tr>
 <td width="100%" align="center">
 <input type="submit" value="Update">  
 <input type="button" value="Delete" onclick="go('<%= strScriptName & "?mode=delete&file="& objFile %>');">  
 <input type="button" value="Cancel" onclick="go('<%= strHomePage %>');">
 </td>
</tr>
<tr>
 <td>
 <table width="100%" cellpadding="0" cellspacing="0" border="1" bordercolor="#CCCCCC">
 <tr>
  <td valign="center" align="center" onmouseover="over(this);" onmouseout="out(this);" width="20" height="20">
  <div onclick="cmdExec('cut')">
  <img src="img/cut.gif" alt="CUT - Ctrl + X">
  </div>
  </td>
  <td valign="center" align="center" onmouseover="over(this);" onmouseout="out(this);" width="20" height="20">
  <div onclick="cmdExec('copy')">
  <img src="img/copy.gif" alt="COPY - Ctrl + C">
  </div>
  </td>
  <td valign="center" align="center" onmouseover="over(this);" onmouseout="out(this);" width="20" height="20">
  <div onclick="cmdExec('paste')">
  <img src="img/paste.gif" alt="PASTE - Ctrl + V">
  </div>
  </td>
  <td valign="center" align="center" onmouseover="over(this);" onmouseout="out(this);" width="20" height="20">
  <div onclick="cmdExec('bold')">
  <img src="img/bold.gif" alt="BOLD - Ctrl + B">
  </div>
  </td>
  <td valign="center" align="center" onmouseover="over(this);" onmouseout="out(this);" width="20" height="20">
  <div onclick="cmdExec('italic')">
  <img src="img/italic.gif" alt="ITALIC - Ctrl + I">
  </div>
  </td>
  <td valign="center" align="center" onmouseover="over(this);" onmouseout="out(this);" width="20" height="20">
  <div onclick="cmdExec('underline')">
  <img src="img/underline.gif" alt="UNDERLINE - Ctrl + U">
  </div>
  </td>
  <td valign="center" align="center" onmouseover="over(this);" onmouseout="out(this);" width="20" height="20">
  <div onclick="cmdExec('justifyleft')">
  <img src="img/left.gif" alt="Justify Left">
  </div>
  </td>
  <td valign="center" align="center" onmouseover="over(this);" onmouseout="out(this);" width="20" height="20">
  <div onclick="cmdExec('justifycenter')">
  <img src="img/center.gif" alt="Center">
  </div>
  </td>
  <td valign="center" align="center" onmouseover="over(this);" onmouseout="out(this);" width="20" height="20">
  <div onclick="cmdExec('justifyright')">
  <img src="img/right.gif" alt="Justify Right">
  </div>
  </td>
  <td valign="center" align="center" onmouseover="over(this);" onmouseout="out(this);" width="20" height="20">
  <div onclick="cmdExec('insertorderedlist')">
  <img hspace="2" vspace="1" src="img/numlist.gif" alt="Ordered List">
  </div>
  </td>
  <td valign="center" align="center" onmouseover="over(this);" onmouseout="out(this);" width="20" height="20">
  <div onclick="cmdExec('insertunorderedlist')">
  <img hspace="2" vspace="1" src="img/bullist.gif" alt="Unordered List">
  </div>
  </td>
  <td valign="center" align="center" onmouseover="over(this);" onmouseout="out(this);" width="20" height="20">
  <div onclick="cmdExec('outdent')">
  <img hspace="2" vspace="1" src="img/unindent.gif" alt="Decrease Indent">
  </div>
  </td>
  <td valign="center" align="center" onmouseover="over(this);" onmouseout="out(this);" width="20" height="20">
  <div onclick="cmdExec('indent')">
  <img hspace="2" vspace="1" src="img/indent.gif" alt="Increase Indent">
  </div>
  </td>
  <td valign="center" align="center" onmouseover="over(this);" onmouseout="out(this);" width="20" height="20">
  <div onclick="cmdExec('createLink')">
  <img hspace="2" vspace="1" src="img/link.gif" alt="LINK - Ctrl + K">
  </div>
  </td>
  <td valign="center" align="center" onmouseover="over(this);" onmouseout="out(this);" width="20" height="20">
  <div onclick="insertImage()">
  <img hspace="2" vspace="1" align="absmiddle" src="img/image.gif" alt="Image">
  </div>
  </td>
 </tr>
 <tr valign="middle">
  <td colspan="16" width="100%">
  <select onchange="cmdExec('foreColor',this[this.selectedIndex].value);this.selectedIndex=0">
  <option value="0">Font Color</option>
  <option value="#000000">Black</option>
  <option value="#FF0000">Red</option>
  <option value="blue">Blue</option>
  </select>
   
  <select onchange="cmdExec('fontname',this[this.selectedIndex].value);">
  <option selected>Font</option>
  <option value="Arial">Arial</option>
  <option value="Times New Roman">Times New Roman</option>
  <option value="Verdana">Verdana</option>
  </select>
   
  <select onchange="cmdExec('fontsize',this[this.selectedIndex].value);">
  <option selected>Size</option>
  <option value="1">1</option>
  <option value="2">2</option>
  <option value="3">3</option>
  <option value="4">4</option>
  <option value="5">5</option>
  <option value="6">6</option>
  <option value="7">7</option>
  <option value="8">8</option>
  </select>
  </td>
 </tr>
 </table>
 </td>
</tr>
<tr>
 <td align="center">
 <!-- page content div -->
 <div contentEditable="true" id="pageHTML" name="pageHTML" style="border-style: solid; border-width: 1px; border-color: #000000; background-color: #FFFFFF; padding-left: 3px; padding-right: 3px; padding-top: 3px; padding-bottom: 3px; width: 550px; height: 400px;">
 <%= strFileContents %>
 </div>
 <!-- / p c d -->
 </td>
</tr>
<tr>
 <td width="100%" align="center">
 <input type="submit" value="Update">  
 <input type="button" value="Delete" onclick="go('<%= strScriptName & "?mode=delete&file="& objFile %>');">  
 <input type="button" value="Cancel" onclick="go('<%= strHomePage %>');">
 </td>
</tr>
</table>

</form>
</body>
</html>

Compartilhar este post


Link para o post
Compartilhar em outros sites

xanburzum

Nao funcionou o codigo

eu tireo quase toda a parte de asp pq nao preciso de upload nem nada desse tipo

Estou fazendo testes nesse link

http://www.zonadownload.com.br/zonadownload/administrador/3.asp

 

Da uma olhada pra v se descobre oq to fazendo d errado

 

xanburzum

 

Se tiver como me passa o codigo dos arquivos que estao incluidos e as imagens.

 

pq ai to tiro oq eu nao precisar

Compartilhar este post


Link para o post
Compartilhar em outros sites

ele esta gerando algum erro ????

 

 

olha este muito bom

 

test.asp (o editor)

<%@language="vbscript"%>
<%

Response.Expires = 0
Response.Expiresabsolute = Now() - 1
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "no-cache"
%>

<!--#include file="etjs.asp"-->

<%dim mode,aspenab,formenab,cadreenab,lecontenu
aspenab="true"
cadreenab="true"
formenab="true"
lecontenu=""

mode=request.querystring("mode")
if mode="preview" then
response.write request.form("texte")
else
%>
<form name="formulaire" action=test.asp?mode=preview target=_blank method=post>
<!--#include file="tableaubouton.asp"-->
</form>
<%end if%>
</html>

etjs.asp

<% if instr(1,Request.ServerVariables("HTTP_USER_AGENT"),"windows",1)>0 then  %>

<script language="JavaScript1.2">
<!-- hide


function fancre() {
var str = document.selection.createRange().text;
document.formulaire.texte.focus();
var sel = document.selection.createRange();
var letit = prompt("Link","");
sel.text =str + "\n<a name=" + letit + ">"+ "\n";
} 



function ftitre() {
var str = document.selection.createRange().text;
document.formulaire.texte.focus();
var sel = document.selection.createRange();
var letit = prompt("Nivel de 1 à 6","1");
sel.text =str + "\n<h" + letit + ">"+  "</h" + letit + ">" + "\n";
} 

function valide() {
  document.reel.contenu.value=document.formulaire.texte.value
  document.reel.submit()
}

function fhr() {
var str = document.selection.createRange().text;
document.formulaire.texte.focus();
var hor = prompt("Largura en pixel ou % ","300");
var haut = prompt("Altura en pixel ","1");
var sel = document.selection.createRange();
sel.text = str +"\n<hr size=" + haut+ " width="+hor +">"+  "\n";
} 


function format(f) {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var sel = document.selection.createRange();
  sel.text = "<" + f + ">" + str + "</" + f + ">\n";
  return;
}


function balisesf(f) {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var sel = document.selection.createRange();
  sel.text = "<" + f + ">" + str +"\n" ;
  return;
}
function lien() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var lien = prompt("URL:","http://");
  var tar= prompt("Cible (target) :","");
  if (lien != null) {
    var sel = document.selection.createRange();
   sel.text = "<a href=\"" + lien  +'"'+ " target=" + tar +'"'+ "\">" + str + "</a>\n";
  }
  return;
} 
function pmcolor() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var lien = prompt("Entre com a cor: nome ou  código","");
  if (lien != null) {
    var sel = document.selection.createRange();
   sel.text = "<font color=\"" + lien + "\">" + str + "</font>\n";
  }
  return;
} 
function limage() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var lim = prompt("URL de imagem:","");
  if (lim != null) {
    var sel = document.selection.createRange();
 sel.text = "<img src=\"" + lim + "\"" + ">" +str+"\n" ;
   }
  return;
} 
function ftable(f) {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var sel = document.selection.createRange();
  sel.text = "<table border=2>\n<tr>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td></td>\n<td></td>\n</tr>\n</table>"  + str+"\n" ;
  return;
}
function mailto() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var lien = prompt("Email:","");
  if (lien != null) {
    var sel = document.selection.createRange();
   sel.text = "<a href=mailto:\"" + lien + "\">" + str + "</a>\n";
  }
  return;
} 
function fhtml() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var sel = document.selection.createRange();
  sel.text = "<html>\n<head>\n<title></title>\n</head>\n<body>\n\n\n</body>\n</html>\n"  + str+"\n" ;
  return;
}
function asp() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var sel = document.selection.createRange();
  sel.text = "<"+"%@ Language=VBScript %>" + str+"\n" ;
  return;
}
function asp1() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var lien = "";
  if (lien != null) {
    var sel = document.selection.createRange();
   sel.text = "<"+"%"  + str + "%>\n";
  }
  return;
} 
function asp2() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var lien = "";
  if (lien != null) {
    var sel = document.selection.createRange();
   sel.text = "<"+"%="  + str + "%>\n";
  }
  return;
} 
function fconn() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var lien = "";
  if (lien != null) {
    var sel = document.selection.createRange();
sel.text = "<"+"%Dim rs,sql,conn\nSet Conn = Server.CreateObject("+'"'+"ADODB.Connection"+'"'+")\n"+"Set rs= Server.CreateObject("+'"'+"ADODB.Recordset"+'"'+")\n"+"Conn.Open "+'"'+"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+'"'+"& Server.Mappath("+'"'+"db.mdb"+'"'+")"   +"\nsql ="+'"'+"SELECT * FROM table1"+'"\n'+ "rs.Open sql, conn , 2, 3 \n"+"conn.execute(sql)\ndo while not rs.eof\n" +"response.write rs.fields("+'"'+"field1"+'"'+").value"+"\nrs.movenext\nloop\nrs.Close\nSet rs = Nothing\nConn.Close\nSet Conn = Nothing\n"+ str + "\n%>\n";
}
  return;
} 


function comm() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var lien = "";
  if (lien != null) {
    var sel = document.selection.createRange();
   sel.text = "<"+"%'"  + str + "%>\n";
  }
  return;
} 
function pmtaille() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var lien = prompt("Titulo do texto:","");
  if (lien != null) {
    var sel = document.selection.createRange();
   sel.text = "<font size=\"" + lien + "\">" + str + "</font>\n";
  }
  return;
} 

function ajou() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var lien = "";
  if (lien != null) {
    var sel = document.selection.createRange();
sel.text = "<"+"% dim c1,c2\nc1=request.form("+'"'+"c1"+'"'+")\nc1=replace(c1,"+'"'+"'"+'"'+","+'"'+"''"+'"'+")\nc2=request.form("+'"'+"c2"+'"'+")\nc2=replace(c2,"+'"'+"'"+'"'+","+'"'+"''"+'"'+")\ndim sql\nSQL = "+'"'+"INSERT INTO table1(c1,c2)VALUES ('"+'"'+"\nsql=sql & c1\nsql = sql & "+'"'+"','"+'"'+"\nsql=sql & c2\nsql=sql & "+'"'+"')"+'"'+"\ndim conn\nSet conn = Server.CreateObject("+'"'+"ADODB.Connection"+'"'+")\nConn.Open "+'"'+"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+'"'+"& Server.Mappath("+'"'+"db.mdb"+'"'+")\nConn.Execute(SQL)\nConn.Close\nset conn=nothing\n" + str + "\n%>\n";
}
  return;
} 



function del() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var lien = "";
  if (lien != null) {
    var sel = document.selection.createRange();
sel.text = "<"+"%Dim rs,id,sQL,conn\nSet Conn=Server.CreateObject("+'"'+"ADODB.Connection"+'"'+")\nSet Rs = Server.CreateObject("+'"'+"ADODB.Recordset"+'"'+")\nConn.Open "+'"'+"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+'"'+"& Server.Mappath("+'"'+"db.mdb"+'"'+")\nid = request.form("+'"'+"id"+'"'+")\nSQL = "+'"'+"delete from"+'"'+"\nsql = sql & "+'"'+" table1"+'"'+"\nSQL = SQL & "+'"'+" WHERE ID="+'"'+" & id\nSet RS = conn.Execute(SQL)\nconn.close\nset conn=nothing\n" + "\n%><center>\nLa fiche a été supprimée avec succès!\n</center>\n\n"+ str ;
}
  return;
} 



function mod() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var lien = "";
  if (lien != null) {
    var sel = document.selection.createRange();
sel.text = "<"+"%"+"dim id,champ,SQL,conn,rs\nchamp=request.form("+'"'+"champ"+'"'+")\nchamp=replace(champ,"+'"'+"'"+'"'+","+'"'+"''"+'"'+")\nchamp=replace(nom,vbcrlf,"+'"'+"<br>"+'"'+")\nid=request.form("+'"'+"id"+'"'+")\nSet Conn = Server.CreateObject("+'"'+"ADODB.Connection"+'"'+")\nSet rs = Server.CreateObject("+'"'+"ADODB.Recordset"+'"'+")\nConn.Open "+'"'+"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+'"'+"& Server.Mappath("+'"'+"db.mdb"+'"'+")\nSQL ="+'"'+" update"+'"'+" \nsql = sql & "+'"'+" table1 "+'"'+"\nsql = sql &  set \nsql=sql & "+'"'+" champ ="+'"'+"\nsql= sql & "+'"'+"'"+'"'+" \nsql=sql & champ\nsql=sql & "+'"'+"'"+'"'+"\nSQL = SQL &  "+'"'+" WHERE ID="+'"'+" & id\nSet RS = conn.Execute(SQL)\nConn.Close\nSet conn = Nothing" + "\n%><center>\nLa fiche a été modifiée avec succès!\n</center>\n\n"+ str ;
}
  return;
} 

function efface() {
  document.formulaire.texte.value="";
} 


function cadreT() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var lien = "";
  if (lien != null) {
    var sel = document.selection.createRange();
sel.text = "<html>\n<head>\n<title></title>\n</head>\n<FRAMESET ROWS= "+'"'+"30%,70%"+'"'+">\n<FRAME NAME= "+'"'+"h"+'"'+" SRC= "+'"'+""+'"'+">\n<FRAMESET COLS= "+'"'+"20%,80%"+'"'+">\n<FRAME NAME= "+'"'+"g"+'"'+" SRC= "+'"'+""+'"'+">\n<FRAME NAME= "+'"'+"d"+'"'+" SRC= "+'"'+""+'"'+">\n</FRAMESET>\n</FRAMESET>\n</html>\n"+ str ;
}
  return;
} 

function cadreGD() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var lien = "";
  if (lien != null) {
    var sel = document.selection.createRange();
sel.text = "<html>\n<head>\n<title></title>\n</head>\n<FRAMESET COLS= "+'"'+"20%,80%"+'"'+">\n<FRAME NAME= "+'"'+"g"+'"'+" SRC= "+'"'+""+'"'+">\n<FRAME NAME= "+'"'+"d"+'"'+" SRC= "+'"'+""+'"'+">\n</FRAMESET>\n</html>\n"+ str ;
}
  return;
} 

function cadreHB() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var lien = "";
  if (lien != null) {
    var sel = document.selection.createRange();
sel.text = "<html>\n<head>\n<title></title>\n</head>\n<FRAMESET rows= "+'"'+"20%,80%"+'"'+">\n<FRAME NAME= "+'"'+"h"+'"'+" SRC= "+'"'+""+'"'+">\n<FRAME NAME= "+'"'+"b"+'"'+" SRC= "+'"'+""+'"'+">\n</FRAMESET>\n</html>\n"+ str ;
}
  return;
} 

function fform() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var lien = "";
  if (lien != null) {
    var sel = document.selection.createRange();
sel.text = "<form name="+'"'+""+'"'+" action="+'"'+""+'"'+" method="+'"'+""+'"'+">\n<input type="+'"'+"text"+'"'+" name="+'"'+""+'"'+" value="+'"'+""+'"'+" size="+'"'+""+'"'+">\n<input type="+'"'+"submit"+'"'+" value="+'"'+""+'"'+">\n</form>\n"+ str ;
}
  return;
} 


function fselect() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var lien = "";
  if (lien != null) {
    var sel = document.selection.createRange();
sel.text = "<select name="+'"'+""+'"'+">\n<option></option>\n<option></option>\n</select>\n"+ str ;
}
  return;
} 

function fbouton() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var lien = "";
  if (lien != null) {
    var sel = document.selection.createRange();
sel.text = "<input type=button value="+'"'+""+'"'+">\n"+ str ;
}
  return;
} 


function fsoumettre() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var lien = "";
  if (lien != null) {
    var sel = document.selection.createRange();
sel.text = "<input type=submit value="+'"'+""+'"'+">\n"+ str ;
}
  return;
} 


function fcb() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var lien = "";
  if (lien != null) {
    var sel = document.selection.createRange();
sel.text = "<input type=checkbox name="+'"'+""+'"'+">\n"+ str ;
}
  return;
} 




function fmopa() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var lien = "";
  if (lien != null) {
    var sel = document.selection.createRange();
sel.text = "<input type=password name="+'"'+""+'"'+" value="+'"'+""+'"'+" size="+'"'+""+'"'+">\n"+ str ;
}
  return;
} 

function fradio() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var lien = "";
  if (lien != null) {
    var sel = document.selection.createRange();
sel.text = "<input type=radio name="+'"'+""+'"'+" value="+'"'+""+'"'+">\n"+ str ;
}
  return;
} 


function ftext() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var lien = "";
  if (lien != null) {
    var sel = document.selection.createRange();
sel.text = "<input type=text name="+'"'+""+'"'+" value="+'"'+""+'"'+">\n"+ str ;
}
  return;
} 

function fhidden() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var lien = "";
  if (lien != null) {
    var sel = document.selection.createRange();
sel.text = "<input type=hidden name="+'"'+""+'"'+" value="+'"'+""+'"'+">\n"+ str ;
}
  return;
} 
function ftextarea() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var lien = "";
  if (lien != null) {
    var sel = document.selection.createRange();
sel.text = "<textarea name="+'"'+""+'"'+" rows=10 cols=60 ></textarea>\n"+ str ;
}
  return;
} 

function ol() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var vstyle = prompt("Tipo: 1 | A | a | I | i","1");
  var lien = "";
  if (lien != null) {
    var sel = document.selection.createRange();
sel.text = "<ol type="+vstyle+">\n<li>\n<li>\n</ol>\n"+ str ;
}
  return;
} 

function ul() {
  var str = document.selection.createRange().text;
  document.formulaire.texte.focus();
  var vstyle = prompt("Tipo: square | disc | circle","circle");
  var lien = "";
  if (lien != null) {
    var sel = document.selection.createRange();
sel.text = "<ul type="+vstyle+">\n<li>\n<li>\n</ul>\n"+ str ;
}
  return;
} 



// unhide -->

</script>


<% else
'Mac%>
<script language="JavaScript1.2">
<!-- hide
function efface() {
document.formulaire.texte.value="";
} 

function pmtaille() {
var vtaille = prompt("Titulo:","3");
var str=document.formulaire.texte.value
document.formulaire.texte.value = str + "\n<font size=\"" + vtaille  + "\">"  + "</font>\n";
}

function mailto() {
var cour = prompt("Email:","");
var str=document.formulaire.texte.value
document.formulaire.texte.value =str + "\n<a href=\"mailto:" + cour + "\">" + cour + "</a>\n";
} 


function fhtml() {
document.formulaire.texte.value="<html>\n<head>\n<title></title>\n</head>\n<body>\n\n\n</body>\n</html>\n"  +"\n" ;
}


function ol() {

var vstyle = prompt("Tipo: 1 | A | a | I | i","1");
var str=document.formulaire.texte.value
document.formulaire.texte.value =  str + "\n<ol type=\""+ vstyle+"\">\n<li>\n<li>\n</ol>\n" ;
} 

function ul() {
var vstyle = prompt("Tipo: square | disc | circle","circle");
var str=document.formulaire.texte.value
document.formulaire.texte.value =  str + "\n<ul type=\""+ vstyle+"\">\n<li>\n<li>\n</ul>\n" ;
} 

function valide() {
  document.reel.contenu.value=document.formulaire.texte.value
  document.reel.submit()
}

function format(f) {

var vtex = prompt("Texto","Votre texte");
var str=document.formulaire.texte.value
document.formulaire.texte.value =  str + "\n<" + f + ">" +vtex+ "</" + f + ">\n";
}



function balisesf(f) {
var str=document.formulaire.texte.value
document.formulaire.texte.value =  str + "\n<" + f + ">"  +"\n" ;
}


function lien() {
var lien = prompt("URL:","http://");
var tar= prompt("Cible (target) :","");
var str=document.formulaire.texte.value
document.formulaire.texte.value =  str + "\n<a href=\"" + lien  +'"'+ " target=\"" + tar + "\">"  + "</a>\n";
} 



function pmcolor() {
var colo = prompt("Cores (anglais ou código:","black");
var str=document.formulaire.texte.value
document.formulaire.texte.value = str + "\n<font color=\"" + colo  + "\">"  + "</font>\n";
}

function limage() {
var lim = prompt("URL de image:","");
var haut = prompt("Altura:","20");
var larg = prompt("Largura:","20");
var valt = prompt("Descrição:","Mon image");


var str=document.formulaire.texte.value
document.formulaire.texte.value =str + "\n<img src=\"" +lim  + "\" height=\""+ haut+ "\" width=\""+larg+"\" alt=\""+ valt+"\">"  + "\n";
} 

function ftable(f) {
var hor = prompt("Largura em pixel ou % ","300");
var vbgcol = prompt("Cor de fundo ","white");
var bord = prompt("Bordure, 1 à 5","1");
var str=document.formulaire.texte.value
document.formulaire.texte.value =str + "\n<table border=\""+ bord+ "\" bgcolor=\""+vbgcol+ "\" width=\""+hor+"\">\n<tr>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td></td>\n<td></td>\n</tr>\n</table>" +"\n" ;
}



function ftitre() {
var letit = prompt("Nivel de 1 à 6","1");
var str=document.formulaire.texte.value
document.formulaire.texte.value =str + "\n<h" + letit + ">"+  "</h" + letit + ">" + "\n";
} 


function fancre() {
var letit = prompt("Nom","");
var str=document.formulaire.texte.value
document.formulaire.texte.value =str + "\n<a name=" + letit + ">"+ "\n";
} 

function fhr() {
var hor = prompt("Largura em pixel ou % ","300");
var haut = prompt("Altura em pixel ","1");
var str=document.formulaire.texte.value
document.formulaire.texte.value =str + "\n<hr size=" + haut+ " width="+hor +">"+  "\n";
} 



function fform() {
var str = document.formulaire.texte.value
document.formulaire.texte.value=  str+ "\n<form name="+'"'+""+'"'+" action="+'"'+""+'"'+" method="+'"'+""+'"'+">\n<input type="+'"'+"text"+'"'+" name="+'"'+""+'"'+" value="+'"'+""+'"'+" size="+'"'+""+'"'+">\n<input type="+'"'+"submit"+'"'+" value="+'"'+""+'"'+">\n</form>\n" ;
}



function fselect() {
var str = document.formulaire.texte.value
document.formulaire.texte.value=  str+ "\n<select name="+'"'+""+'"'+">\n<option></option>\n<option></option>\n</select>\n" ;
}


function fbouton() {
  var str = document.formulaire.texte.value
 document.formulaire.texte.value=  str+ "\n<input type=button value="+'"'+""+'"'+">\n" ;
}















function fcb() {
  var str = document.formulaire.texte.value
 document.formulaire.texte.value=  str+ "\n<input type=checkbox name="+'"'+""+'"'+">\n" ;
}





function fmopa() {
  var str = document.formulaire.texte.value
 document.formulaire.texte.value=  str+ "\n<input type=password name="+'"'+""+'"'+" value="+'"'+""+'"'+" size="+'"'+""+'"'+">\n" ;
}


function fradio() {
  var str = document.formulaire.texte.value
 document.formulaire.texte.value=  str+ "\n<input type=radio name="+'"'+""+'"'+" value="+'"'+""+'"'+">\n" ;
}



function ftext() {
  var str = document.formulaire.texte.value
 document.formulaire.texte.value=  str+ "\n<input type=text name="+'"'+""+'"'+" value="+'"'+""+'"'+">\n" ;
}


function fhidden() {
  var str = document.formulaire.texte.value
 document.formulaire.texte.value=  str+ "\n<input type=hidden name="+'"'+""+'"'+" value="+'"'+""+'"'+">\n" ;
}




function ftextarea() {
  var str = document.formulaire.texte.value
 document.formulaire.texte.value=  str+ "\n<textarea name="+'"'+""+'"'+" rows=10 cols=60 ></textarea>\n" ;
}



function fsoumettre(){
var str = document.formulaire.texte.value
 document.formulaire.texte.value=  str+ "\n<input type=\"submit\" value=\"\">\n ";
}



function asp() {
var str=document.formulaire.texte.value
document.formulaire.texte.value =str+"\n<\"%@ Language=VBScript %>\n" ;
}


function asp1() {
var str=document.formulaire.texte.value
document.formulaire.texte.value=str + "\n<"+"% "+"%>\n";
} 


function asp2() {
var str=document.formulaire.texte.value
document.formulaire.texte.value=str +  "\n<"+"%= %>\n";
} 

function fconn() {
var str=document.formulaire.texte.value
document.formulaire.texte.value=str +  "\n<"+"%Dim rs,sql,conn\nSet Conn = Server.CreateObject("+'"'+"ADODB.Connection"+'"'+")\n"+"Set rs= Server.CreateObject("+'"'+"ADODB.Recordset"+'"'+")\n"+"Conn.Open "+'"'+"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+'"'+"& Server.Mappath("+'"'+"db.mdb"+'"'+")"   +"\nsql ="+'"'+"SELECT * FROM table1"+'"\n'+ "rs.Open sql, conn , 2, 3 \n"+"conn.execute(sql)\ndo while not rs.eof\n" +"response.write rs.fields("+'"'+"field1"+'"'+").value"+"\nrs.movenext\nloop\nrs.Close\nSet rs = Nothing\nConn.Close\nSet Conn = Nothing\n" + "\n%>\n";
} 


function comm() {
var str=document.formulaire.texte.value
document.formulaire.texte.value=str +  "\n<"+"%'"  + "%>\n";
} 



function ajou() {
var str=document.formulaire.texte.value
document.formulaire.texte.value=str +  "\n<"+"% dim c1,c2\nc1=request.form("+'"'+"c1"+'"'+")\nc1=replace(c1,"+'"'+"'"+'"'+","+'"'+"''"+'"'+")\nc2=request.form("+'"'+"c2"+'"'+")\nc2=replace(c2,"+'"'+"'"+'"'+","+'"'+"''"+'"'+")\ndim sql\nSQL = "+'"'+"INSERT INTO table1(c1,c2)VALUES ('"+'"'+"\nsql=sql & c1\nsql = sql & "+'"'+"','"+'"'+"\nsql=sql & c2\nsql=sql & "+'"'+"')"+'"'+"\ndim conn\nSet conn = Server.CreateObject("+'"'+"ADODB.Connection"+'"'+")\nConn.Open "+'"'+"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+'"'+"& Server.Mappath("+'"'+"db.mdb"+'"'+")\nConn.Execute(SQL)\nConn.Close\nset conn=nothing\n" + "\n%>\n";
} 



function del() {
var str=document.formulaire.texte.value
document.formulaire.texte.value=str +  "\n<"+"%Dim rs,id,sQL,conn\nSet Conn=Server.CreateObject("+'"'+"ADODB.Connection"+'"'+")\nSet Rs = Server.CreateObject("+'"'+"ADODB.Recordset"+'"'+")\nConn.Open "+'"'+"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+'"'+"& Server.Mappath("+'"'+"db.mdb"+'"'+")\nid = request.form("+'"'+"id"+'"'+")\nSQL = "+'"'+"delete from"+'"'+"\nsql = sql & "+'"'+" table1"+'"'+"\nSQL = SQL & "+'"'+" WHERE ID="+'"'+" & id\nSet RS = conn.Execute(SQL)\nconn.close\nset conn=nothing\n" + "\n%><center>\nLa fiche a été supprimée avec succès!\n</center>\n\n" ;
} 

function mod() {
var str=document.formulaire.texte.value
document.formulaire.texte.value=str +  "\n<"+"%"+"dim id,champ,SQL,conn,rs\nchamp=request.form("+'"'+"champ"+'"'+")\nchamp=replace(champ,"+'"'+"'"+'"'+","+'"'+"''"+'"'+")\nchamp=replace(nom,vbcrlf,"+'"'+"<br>"+'"'+")\nid=request.form("+'"'+"id"+'"'+")\nSet Conn = Server.CreateObject("+'"'+"ADODB.Connection"+'"'+")\nSet rs = Server.CreateObject("+'"'+"ADODB.Recordset"+'"'+")\nConn.Open "+'"'+"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+'"'+"& Server.Mappath("+'"'+"db.mdb"+'"'+")\nSQL ="+'"'+" update"+'"'+" \nsql = sql & "+'"'+" table1 "+'"'+"\nsql = sql &  set \nsql=sql & "+'"'+" champ ="+'"'+"\nsql= sql & "+'"'+"'"+'"'+" \nsql=sql & champ\nsql=sql & "+'"'+"'"+'"'+"\nSQL = SQL &  "+'"'+" WHERE ID="+'"'+" & id\nSet RS = conn.Execute(SQL)\nConn.Close\nSet conn = Nothing" + "\n%><center>\nLa fiche a été modifiée avec succès!\n</center>\n\n" ;
 } 





function cadreT() {
document.formulaire.texte.value= "<html>\n<head>\n<title></title>\n</head>\n<FRAMESET ROWS= "+'"'+"30%,70%"+'"'+">\n<FRAME NAME= "+'"'+"h"+'"'+" SRC= "+'"'+""+'"'+">\n<FRAMESET COLS= "+'"'+"20%,80%"+'"'+">\n<FRAME NAME= "+'"'+"g"+'"'+" SRC= "+'"'+""+'"'+">\n<FRAME NAME= "+'"'+"d"+'"'+" SRC= "+'"'+""+'"'+">\n</FRAMESET>\n</FRAMESET>\n</html>\n" ;
}
  
function cadreGD() {
    document.formulaire.texte.value= "<html>\n<head>\n<title></title>\n</head>\n<FRAMESET COLS= "+'"'+"20%,80%"+'"'+">\n<FRAME NAME= "+'"'+"g"+'"'+" SRC= "+'"'+""+'"'+">\n<FRAME NAME= "+'"'+"d"+'"'+" SRC= "+'"'+""+'"'+">\n</FRAMESET>\n</html>\n" ;
}


function cadreHB() {
  document.formulaire.texte.value="<html>\n<head>\n<title></title>\n</head>\n<FRAMESET rows= "+'"'+"20%,80%"+'"'+">\n<FRAME NAME= "+'"'+"h"+'"'+" SRC= "+'"'+""+'"'+">\n<FRAME NAME= "+'"'+"b"+'"'+" SRC= "+'"'+""+'"'+">\n</FRAMESET>\n</html>\n";
}

// unhide -->

</script>
<%end if %>

tableubouton.asp



 
 <table width="630" border="2" align="center" cellpadding="0" cellspacing="0">
 <tr> 
 <td bgcolor=#446DA5>
   
     <div align="center"><font size="1">
       <!-- / FORMATAGE -->
       <A Href="javascript:fhtml()"><font color="#ffffff" face="Verdana, Arial, Helvetica, sans-serif">Corpo HTML</font></A>	 
       <font face="Verdana, Arial, Helvetica, sans-serif">  |  
        <A Href="javascript:format('b')"><font color="#ffffff"><b>Negrito</b></font></A>   |  
        <A Href="javascript:format('i')"><font color="#ffffff"><i>Italico</i></font></A>   |  
        <A Href="javascript:format('u')"><font color="#ffffff"><u>Sublinhado</u></font></A>   |  
        <A Href="javascript:format('big')"><font color="#ffffff"><Big>Big</Big></font></A>   |  
        <A Href="javascript:format('xmp')"><font color="#ffffff">XMP</font></A>   |  
        <A Href="javascript:pmtaille()"><font color="#ffffff">Titulo Texto</font></A>   |  
        <A Href="javascript:pmcolor()"><font color="yellow">Cor</font></A>   |  
        <A Href="javascript:ftitre()"><font color="#ffffff">Titulo</font></A>   |  
        <A Href="javascript:format('center')"><font color="#ffffff">Centro</font></A>	 
        <!-- / FORMATAGE -->
        <br>
        <!-- PAGE -->
        <A Href="javascript:format('blockquote')"><font color="#99FF00">blockquote</font></A>   |  
        <A Href="javascript:balisesf('br')"><font color="#99FF00"><br></font></A>   |  
        <A Href="javascript:fhr()"><font color="#99FF00">Linha horizontal</font></A>   |  
        <A Href="javascript:lien()"><font color="#99FF00">Linha</font></A>   |  
        <A Href="javascript:mailto()"><font color="#99FF00">Mailto</font></A>   |  
        <A Href="javascript:fancre()"><font color="#99FF00">Âncora</font></A>   |  
         
        <A Href="javascript:ftable()"><font color="#99FF00">Tabela 2x2</font></A>   |  
        <A Href="javascript:limage()"><font color="#99FF00">Imagem</font></A>   |  
        <a href="http://xibios.free.fr/french/doc/xallwrite/Keyboard.html" target=_blank><font color="#99FF00">©</font></a>   |  
        <A Href="javascript:ul()"><font color="#99FF00">Lista com números</font></A>   |  
        <A Href="javascript:ol()"><font color="#99FF00">Liste com marcadores</font></A>	
        <!-- /PAGE -->
        <br>
        <!-- ASP -->
        <% If aspenab="true" then %>
    |  
        <A Href="javascript:asp()"><font color="pink">ASP</font></A>   |  
        <A Href="javascript:asp1()"><font color="pink">Delimitador Asp</font></A>   |  
        <A Href="javascript:asp2()"><font color="pink"><%=%></font></A>   |  
        <A Href="javascript:fconn()"><font color="pink">Connexão ASP</font></A>   |  
        <A Href="javascript:comm()"><font color="pink"><%'%></font></A>   |  
        <A Href="javascript:ajou()"><font color="pink">SQL Insert</font></A>   |  
        <A Href="javascript:del()"><font color="pink">SQL Delete</font></A>   |  
        <A Href="javascript:mod()"><font color="pink">SQL Update</font></A>	
         
         
        <br>
        <% End If %>
        <!-- /ASP -->
        <!-- / FORM -->
        <% If formenab="true" then %>
        <A Href="javascript:fform()"><font color="#663333"><b>Formulario</b></font></A>   |  
        <A Href="javascript:fselect()"><font color="#663333"><b>select name</b></font></A>   |  
        <A Href="javascript:fbouton()"><font color="#663333"><b>Botão</b></font></A>   |  
        <A Href="javascript:fsoumettre()"><font color="#663333"><b>Botão Submit</b></font></A>   |  
        <A Href="javascript:fcb()"><font color="#663333"><b>Checkbox </b></font></A>   |  
        <A Href="javascript:fradio()"><font color="#663333"><b>Botão Radio</b></font></A>   |  
        <A Href="javascript:fmopa()"><font color="#663333"><b>Senha</b></font></A>   |  
        <A Href="javascript:ftext()"><font color="#663333"><b>Campo Texto</b></font></A>   |  
        <A Href="javascript:fhidden()"><font color="#663333"><b>Campo Hidden</b></font></A>   |  
        <A Href="javascript:ftextarea()"><font color="#663333"><b>Textarea</b></font></A> 
        <% End If %>
        <!-- / FORM -->
         
        <% If cadreenab="true" then %>
        <br> 
        <!-- CADRE -->
    |  
        <A Href="javascript:cadreT()"><font color="#663333"><b>FRAMESET ROWS e COLS</b></font></A>   |  
        <A Href="javascript:cadreGD()"><font color="#663333"><b>FRAMESET COLS</b></font></A>   |  
        <A Href="javascript:cadreHB()"><font color="#663333"><b>FRAMESET ROWS</b></font></A>   |  
        <% End If %>
        <!-- / CADRE --> 
        <!-- AIDE -->
        <br clear="all" />
        <!-- COPIER COLLER -->
        <a href="javascript:document.formulaire.texte.select();"><font color="#ffffff"><b>Selecionar Tudo</b></font></a>   |  
        <A Href="javascript:efface()"><font color="#ffffff"><b>Apagar</b></font></A>   | </font> 
       <input type="submit" value="Visualizar Código">
       
       <!--/ COPIER COLLER -->
     </font> </div></td>
 </tr> 
 <tr>
 <td><div align="center">
   <textarea cols="90" rows="20" name="texte"><%= lecontenu %></textarea>
 </div></td>
 </tr>
</table>

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.