<HTML><HEAD><TITLE>Editor HTML en Javascript</TITLE><style type="text/css">
td { font-family:Arial; font-size:9pt; color:darkred; bold:true; }
th { font-family:Arial; font-size:7pt; color:darkred; bold:true; }</style></HEAD><BODY BGCOLOR=tan ><script language = "JavaScript">
mode = 1; function HTMLtag(name,tipo,tagstart,tagend,nested_tag,n_nest,input_nest,content,input_content,n_attr,attr1_name,attr1_value,attr1_input, attr2_name,attr2_value, attr2_input,attr3_name,attr3_value, attr3_input, attr4_name,attr4_value,attr4_input, attr5_name,attr5_value, attr5_input, attr6_name,attr6_value, attr6_input) {
this.name = name
this.tipo = tipo
this.tagstart=tagstart
this.tagend=tagend
this.nested_tag=nested_tag
this.n_nest=n_nest
this.input_nest=input_nest
this.content=content
this.input_content=input_content
this.n_attr=n_attr
this.attr_name=new MakeArray(6)
this.attr_value=new MakeArray(6)
this.attr_input=new MakeArray(6)
this.attr_name[0]=attr1_name
this.attr_value[0]=attr1_value
this.attr_input[0]=attr1_input
this.attr_name[1]=attr2_name
this.attr_value[1]=attr2_value
this.attr_input[1]=attr2_input
this.attr_name[2]=attr3_name
this.attr_value[2]=attr3_value
this.attr_input[2]=attr3_input
this.attr_name[3]=attr4_name
this.attr_value[3]=attr4_value
this.attr_input[3]=attr4_input
this.attr_name[4]=attr5_name
this.attr_value[4]=attr5_value
this.attr_input[4]=attr5_input
this.attr_name[5]=attr6_name
this.attr_value[5]=attr6_value
this.attr_input[5]=attr6_input
}
retorn_escriu_tag = 1;
function escriu_tag(txt,tag,tipo_ret){
var g=0
var addText='',lon,texto,v=0,valor='',tx='',val=''
if(tag.tipo==3){
if( (tag.name=='TR' && jTR.ask_cols==0) || tag.name=='TABLE'){
v=prompt( tag.input_nest, tag.n_nest)
if(v==null){
retorn_escriu_tag=0
return 0
}
else
{
v=parseInt(v)
if(isNaN(v) || v==0){
alert('$mesg1[$idi_edit]')
retorn_escriu_tag=0
return 0
}
else
{
tag.n_nest=v
}
}
if( tag.name=='TR' ){
jTR.ask_cols=1
}
}
else
{
if( tag.name!='TR' && tag.name!='TABLE' && tag.name != 'TF' && tag.name != 'BF' && tag.name != 'IF' ){
v=100000
}
else
{
v=tag.n_nest
}
}
}
addText=''+tag.tagstart
while(g<tag.n_attr){
if(tag.attr_name[g]!=''){
if(mode==1 && (tag.name!='TH' || (tag.name=='TH' && tag.ask_color==0)) && (tag.name!='TR' || (tag.name=='TR' && tag.ask_attr==0)) ){
if(tag.attr_name[g]!='0' && tag.attr_name[g]!='1'){
valor=prompt(tag.attr_input[g],tag.attr_value[g])
if(valor==null){
retorn_escriu_tag=0
return 0
}
if(tag.name=='OL' && g==0 && valor=='n'){
valor='l';
}
if(tag.name=='TR' || tag.name=='TH'){
tag.attr_value[g]=valor
}
}
else
{
if(tag.attr_name[g]=='0'){
val='no'; }
else
{
val='si'; }
val=prompt(tag.attr_input[g],val)
if(val=='si' || val=='yes'){
tag.attr_name[g]='1'
}
else
{
tag.attr_name[g]='0'
}
}
if(tag.name=='TH'){
jTH.ask_color=1
}
}
else
{
valor=tag.attr_value[g]
}
if(tag.attr_name[g]!='1' ){
addText+=' '+ tag.attr_name[g]+'="'+ valor +'"'
}
else
{
addText+=' '+tag.attr_value[g]
}
}
g++
}
if(tag.name=='TR'){
tag.ask_attr=1
}
if(tag.n_attr!=0){
addText+=' >'
}
if(tag.name=='TABLE'){
t=prompt(tag.inp_cap, tag.val_cap)
if(t==null){
retorn_escriu_tag=0
return 0
}
else
{
if(t=='si' || t=='sí' || t=='yes'){
jTable.cap=1
}
else
{
jTable.cap=0
}
}
}
if(tag.tipo==3){
g=0
fi=0
while(g<v && !fi){
nest=tag.nested_tag;
if(tag.name=='TABLE'){
jTD.filact=g+1
}
if(tag.name=='TR'){
jTD.colact=g+1
if(jTD.filact==1 && jTable.cap==1){
nest=jTH
}
}
tx=escriu_tag(txt,nest,0)
if(retorn_escriu_tag==0){
if(nest.name=='TR'){
jTR.ask_cols=0
jTH.ask_color=0
jTR.n_nest=1
jTR.ask_attr=0
}
if(nest.name=='TH'){
jTH.ask_color=0
}
if(nest.name!='LI'){
retorn_escriu_tag=0
return 0
}
else
{
fi=1
tx=''
}
}
addText+=tx
g++
}
}
if(tag.tipo==2) { if(mode==1){
inp=tag.input_content
if(tag.name=='TD' || tag.name=='TH'){
inp+=" "+jTD.filact+"-"+jTD.colact+":"
}
v=prompt(inp,tag.content)
if(v!=null){
addText+=v
}
else
{
retorn_escriu_tag=0
return 0
}
}
}
addText+=tag.tagend
if(tag.name=='TABLE'){
jTR.ask_cols=0
jTR.ask_attr=0
jTR.n_nest=1
jTH.ask_color=0
}
if(tipo_ret==1){
posi=nested(txt)
if(posi==-1){
txt.value+=addText
retorn_escriu_tag = 1;
return 1
}
else
{
texto=txt.value
lon=texto.length
txt.value=texto.substring(0,posi)+addText+texto.substring(posi,lon)
retorn_escriu_tag = 1;
return 1
}
}
else
{
return addText
}
}
function nested(txt){
var texto, lon, punter, punter_bo, fi, car
texto=txt.value
lon=texto.length
punter=lon-1
punter_bo=-1
fi=false
while(punter>0 && !fi){
car=texto.charAt(punter)
while(punter>0 && car == ' ' && !fi ){
punter--
car=texto.charAt(punter)
}
if(car != '>'){
fi=true
punter_bo=-1
}
while(punter>0 && car != '/' && car != '<' && !fi ){
punter--
car=texto.charAt(punter)
}
if(car != '/'){
fi=true
}
punter--
car=texto.charAt(punter)
if(car != '<'){
fi=true
}
if(!fi){
punter_bo=punter
}
punter--
}
return punter_bo
}
function spot_from_inici(s,l,ini) {
var len1,len2,foundat,i,comp
len1 = s.length
len2 = l.length
foundat = -1
i=ini
while(i<(len2-len1)) {
comp=l.substring(i,i+len1)
if (comp == s) {
foundat = i
break
}
i++
}
return foundat
}
function MakeArray(n)
{
this.length=n
for(var j=1; j<=n; j++){
this[n]=0
}
return this
}
function inici(a){
var texto='',aux=''
if(a==1){ aux=obj_txt.value;}
texto = '<HTML>'
texto += '<TITLE></TITLE>'
texto += '<HEAD>'
texto += '\n<STYLE TYPE="text/css" >'
texto += def_estils()
texto += '\n</STYLE>'
texto += '</HEAD>\n<BODY BGCOLOR="white" >\n'
if(a==1){ texto += aux }
obj_txt.value = texto
}
function mode() {
return mode
}
function canvi_mode(ob_sele){var ind;ind=ob_sele.selectedIndex;mode=ob_sele[ind].value;return true;}function save(txt){
alert('No hay función de salvado disponible. Tendrá que copiar y pegar, o bien utilizar otra función disponible en esta página.');
}
function preview(txt) {
var k,tix,afe,lon,j=0, cars='', car='', ref='', cad='', c=0
// Cal parsejar per arreglar els links a anchors:
afe='wysiwyg://0/'+document.location
tix=txt.value
lon=tix.length
while(j<(lon-1)){
fi=0
cars=''
car=tix.charAt(j)
cad+=car
while(cars!='<a' && cars!='<A' && j<(lon-1)){
cars=car;
car=tix.charAt(j+1)
cars+=car
cad+=car
j++
}
if(j>=(lon-1)){ fi=1 }
j++
while(!fi && tix.substring(j,j+5)!='href=' && tix.substring(j,j+5)!='HREF=' && tix.charAt(j)!='>' && j<(lon-5)){
cad+=tix.charAt(j)
j++
}
if(j>=(lon-5) || tix.charAt(j)=='>' ){
fi=1
}
else
{
cad+=tix.substring(j,j+5)
j+=5
}
if(!fi && tix.charAt(j)=='"' || tix.charAt(j)=="'" ){
cad+=tix.charAt(j)
j++
}
if(!fi && tix.charAt(j)=='#'){
cad+=afe
} cad+=tix.charAt(j)
j++
}
msg=window.open("","prelim","screenX=25,screenY=25,width=600,height=420,resizable,scrollbars")
k=msg.document
k.open()
k.write(cad+'</BODY></HTML>')
k.close()
msg.focus()
}
jAnchor=new HTMLtag('ANCHOR',2,'<A ','</A>','',0,'','','Entra el texto a mostrar en la referencia:',1,'NAME','','Entra el nombre de la referencia:','','','','','','','','','','','','','','','');function anchor(txt){
escriu_tag(txt,jAnchor,1)
}
jLink=new HTMLtag('Link',2,'<A ','</A>','',0,'','','Entra el texto a mostrar en el link:',1,'HREF','http://www.elquesigui.nose','Entra la URL (p.e. http://www.yahoo.com):','','','','','','','','','','','','','','','');function link(txt){
escriu_tag(txt,jLink,1)
}
jTD=new HTMLtag('TD',2,'\n<TD>','</TD>','',0,'','','Entra el texto de la celda',0,'','','','','','','','','','','','','','','','','','');
jTD.filact=1;
jTD.colact=1;
jTH=new HTMLtag('TH',2,'\n<TH','</TH>','',0,'','','Entra el contenido de la celda (de cabecera)',1,'BGCOLOR','CORNSILK','Entra el color de fondo de la cabecera','','','','','','','','','','','','','','','' );
jTH.ask_color=0;
jTR=new HTMLtag('TR',3,'\n<TR','\n</TR>',jTD,1,'Entra el número de columnas','', '' ,2,'ALIGN','CENTER','Entra la alineación horizontal','VALIGN','MIDDLE','Entra la alineación vertical','','','','','','','','','','','','' );
jTR.ask_cols = 0;
jTR.ask_attr = 0;
jTable=new HTMLtag( 'TABLE', 3, '\n<TABLE', '\n</TABLE>',jTR, 1,'Entra el número de filas','','',5,'BORDER','0','Entra el borde (en pixels):','BGCOLOR','WHITE','Entra el color de fondo:','CELLPADDING','1','Entra el espacio (pixels) entre el contenido y el borde de la celda:','CELLSPACING','1','Entra el espacio (en pixels) entre celdas:','WIDTH','100%','Entra la anchura de la tabla (en % de la página):','','','' );
jTable.inp_cap='Quiere que la tabla tenga cabecera ?(si | no)';
jTable.val_cap='si';
jTable.cap=1;function taula(txt){
escriu_tag(txt,jTable,1)
}
jIMG=new HTMLtag('IMG',1,'<IMG ','','',0, '','','',6,'SRC','grafic.gif','Entra el archivo de la imagen (p.e. grafico_1.gif):','ALIGN','LEFT','Entra la alineación de la imagen: \n LEFT:izquierda RIGHT:derecha TOP:arriba ABSBOTTOM:abajo \n MIDDLE:centrado verticalmente BASELINE:en la misma línia que el texto ','ALT','Text alternatiu','Entra el texto alternativo a la imagen:', 'BORDER','0', 'Entra el borde (en pixels):', 'WIDTH' ,'', 'Entra la anchura (opcional) (en pixels):','HEIGHT','','Entra la altura (opcional) (en pixels):' );function imatge(txt){
escriu_tag(txt,jIMG,1)
}
function titol(txt){
var texto,lon,tit,loc_ini,loc_fi
texto=txt.value
lon=texto.length
tit=prompt('Entra el título para el documento:',''); loc_ini=spot_from_inici("<TITLE>",texto,0)
if(loc_ini==-1){
alert('No se puede actualizar el título porque se ha borrado el tag <TITLE>. Se debe recomponer la cabecera.'); }
else
{
loc_fi=spot_from_inici("</TITLE>",texto,loc_ini)
if(loc_fi==-1){
alert('No se puede actualizar el título porque se ha borrado el tag </TITLE>. Se debe recomponer la cabecera.'); }
else
{
texto=texto.substring(0,loc_ini+7)+tit+texto.substring(loc_fi,lon)
txt.value=texto
}
}
}
colors= new MakeArray(42);
colors[0]='black';
colors[6]='gray';
colors[12]='darkgray';
colors[18]='lightgrey';
colors[24]='lavender';
colors[30]='cornsilk';
colors[36]='white';
colors[1]='maroon';
colors[7]='brown';
colors[13]='chocolate';
colors[19]='tan';
colors[25]='navajowhite';
colors[31]='moccasin';
colors[37]='blanchedalmond';
colors[2]='darkred';
colors[8]='red';
colors[14]='salmon';
colors[20]='darksalmon';
colors[26]='orange';
colors[32]='pink';
colors[38]='fuchsia';
colors[3]='indigo';
colors[9]='teal';
colors[15]='blueviolet';
colors[21]='blue';
colors[27]='skyblue';
colors[33]='cyan';
colors[39]='lightcyan';
colors[4]='olive';
colors[10]='green';
colors[16]='yellowgreen';
colors[22]='lawngreen';
colors[28]='greenyellow';
colors[34]='khaki';
colors[40]='darkkhaki';
colors[5]='gold';
colors[11]='yellow';
colors[17]='beige';
colors[23]='lemonchiffon';
colors[29]='bisque';
colors[35]='burlywood';
colors[41]='darkgoldenrod';
function taula_colors(){
var t=0,tc
tc='<center><br><br><table border=1 cellspacing=0 cellpadding=0>';
while(t<42){
if(t%6==0){
if(t!=0){
tc+='</tr>'
}
tc+='<tr>'
}
tc+='<td bgcolor="'+colors[t]+'" ><a href=javascript:canvi("'+colors[t]+'"); ><img src=http://titan.unica.edu:9999/gabi/php-js-webedit/trans.gif border=0 width=18 height=18 alt="'+colors[t]+'"></a></td>'
t++
}
tc+='</tr></table></center>'
return tc
}
function paleta_colors(ruta_funct){
var pal_col, k, tc
pal_col=window.open("","paleta_colors","screenX=80,screenY=80,width=200,height=220")
pal_col.document.open()
k=pal_col.document
k.writeln("<html><head><style> td,body { font-family:Arial; font-size:8pt; } </style> <script> function canvi(hexa) { "+ruta_funct+"(hexa); window.close(); }</"+"script></head><body bgcolor=white ><center>")
k.writeln("<font color=black face=arial size=-1 ><b> Haz click encima del color escogido:</b></font>")
tc=taula_colors()
k.writeln(tc)
k.writeln("</center></body></html>")
k.close()
pal_col.focus()
}
function paleta(txt){
paleta_colors("opener.nada")
}
function nada(){
}
function bgcolor(txt){
obj_txt=txt
paleta_colors('opener.bgcolor_posa')
}
function bgcolor_posa(hexa){
var texto, lon, loc, loc_bg, k, car
texto=obj_txt.value
lon=texto.length
loc=spot_from_inici("<BODY",texto,0)
if(loc==-1){
alert('No se puede actualizar el color de fondo porque se ha borrado el tag <BODY>. Se debe reconstruir la cabecera de la página.'); }
else
{
loc_bg=spot_from_inici("BGCOLOR=",texto,loc)
if(loc_bg==-1){
texto=texto.substring(0,loc+5)+' BGCOLOR="'+hexa+'" '+texto.substring(loc+5,lon)
}
else
{
k=loc_bg+8
car=texto.charAt(k)
while(car!=' ' && car!='>'){
k++
car=texto.charAt(k)
}
texto=texto.substring(0,loc_bg+8)+'"'+hexa+'"'+texto.substring(k,lon)
obj_txt.value=texto
}
}
}
function new_doc(txt){
if(confirm('Está a punto de hacer RESET del documento y volver a empezar con un documento en blanco. Perderá los cambios no salvados.\n\nSeguro que quiere continuar ?') && confirm('Está seguro que quiere volver a empezar con un documento en blanco y perder el trabajo no salvado ?')){ inici(0)
}
}
function estil_var(name,tipoletra,tamany,color,negreta,cursiva,subry) {
this.name=name
this.tip=tipoletra
this.tam=tamany
this.col=color
this.neg=negreta
this.cur=cursiva
this.sub=subry
}
estils=new MakeArray(7);
estils[0]=new estil_var('nr','Arial','10','black',0,0,0)
estils[1]=new estil_var('t1','Arial','20','black',1,0,1)
estils[2]=new estil_var('t2','Arial','16','black',1,0,1)
estils[3]=new estil_var('t3','Arial','14','black',0,1,0)
estils[4]=new estil_var('s1','Arial','12','black',0,1,0)
estils[5]=new estil_var('s2','Times','12','black',1,0,0)
estils[6]=new estil_var('s3','Times','10','black',0,0,0)
jEstil=new HTMLtag('Estil',2,'<SPAN','</SPAN>','',0,'','','Entra el texto a mostrar en el estilo:',1,'ID','nr','Entra la referencia del estilo (p.e. nr):','','','','','','','','','','','','','','','');function posa_estil(txt,ob_sele){
var ind, form, aux
ind=ob_sele.selectedIndex
jEstil.attr_value[0]=ob_sele[ind].value
aux=mode
mode=0
escriu_tag(txt,jEstil,1)
mode=aux
}
function gestio_estils(txt){
obj_txt=txt
var es_sele,jn,k,h
var f="<font color=white face=arial size=-1 ><b>"
var g="</b></font>"
var d="</td><td align=center valign=bottom >"
es_sele=""
msg=window.open("","gest_estils","screenX=50,screenY=50,width=400,height=280")
k=msg.document
k.open()
k.writeln("<html><head><style> td,body { font-family:Arial; font-size:8pt; }")
k.writeln(" a { text-decoration:none; }</style><script> function actualitza() { ")
jn=0
while(jn<7){
k.writeln(' var t=0; while(t<7){ ')
k.writeln(' ind=eval("document.gest_est.tipo"+t+".selectedIndex"); ')
k.writeln(' opener.estils[t].tip=eval("document.gest_est.tipo"+t+"["+ind+"].value"); ')
k.writeln(' ind=eval("document.gest_est.tam"+t+".selectedIndex"); ')
k.writeln(' opener.estils[t].tam=eval("document.gest_est.tam"+t+"["+ind+"].value"); ')
k.writeln(' if(eval("document.gest_est.neg"+t+".checked")==true){')
k.writeln(' opener.estils[t].neg=1; ')
k.writeln(' }else{ ')
k.writeln(' opener.estils[t].neg=0; ')
k.writeln(' } ')
k.writeln(' if(eval("document.gest_est.cur"+t+".checked")==true){')
k.writeln(' opener.estils[t].cur=1; ')
k.writeln(' }else{ ')
k.writeln(' opener.estils[t].cur=0; ')
k.writeln(' } ')
k.writeln(' if(eval("document.gest_est.subry"+t+".checked")==true){')
k.writeln(' opener.estils[t].sub=1; ')
k.writeln(' }else{ ')
k.writeln(' opener.estils[t].sub=0; } ')
k.writeln(' t++; ')
k.writeln(' } ')
jn++
}
k.writeln("opener.posa_estils();")
k.writeln("window.close();")
k.writeln(' }')
k.writeln(' obj="";')
k.writeln("</"+"script></head><body bgcolor=white >")
k.writeln("<font color=black face=arial size=-1 ><b> Pon los valores i haz click en validar:</b></font>")
k.writeln('<form name=gest_est >')
k.writeln('<table width=100% border=0 cellspacing=2 cellpadding=0 >')
k.writeln('<tr bgcolor=gray ><td align=center valign=bottom >')
k.writeln(f+'Nombre <br>Estilo'+g)
k.writeln(d)
k.writeln(f+'Tipo <br>Letra'+g)
k.writeln(d)
k.writeln(f+'Tamaño'+g)
k.writeln(d)
k.writeln(f+'Color'+g)
k.writeln(d)
k.writeln(f+'Negrita'+g)
k.writeln(d)
k.writeln(f+'Cursiva'+g)
k.writeln(d)
k.writeln(f+'Subrayado'+g)
k.writeln('</td></tr>')
jn=0
while(jn<7){
k.writeln('<tr><td align=center valign=middle >')
k.writeln('<font color=black face=arial size=-1 ><b>' + estils[jn].name + '</b></font>')
k.writeln('</td><td align=center valign=middle >')
k.writeln("<select name=tipo" + jn + " size=1 >")
tl=new MakeArray(10)
tl[0]="Arial";tl[1]="Courier";tl[2]="Serif";tl[3]="Times";
h=0
while(h<4){
es_sele=''
if(estils[jn].tip==tl[h]){
es_sele='selected'
}
k.writeln('<option value="' + tl[h] + '" ' + es_sele +'>'+tl[h]+'</option>')
h++
}
k.writeln('</select>')
k.writeln('</td><td align=center valign=middle >')
k.writeln("<select name=tam" + jn + " size=1 >")
tl[0]="8";tl[1]="9";tl[2]="10";tl[3]="11";tl[4]="12";tl[5]="14";tl[6]="16";tl[7]="20";tl[8]="24";tl[9]="30";
es_sele=''
h=0
while(h<10){
if(estils[jn].tam==tl[h]){
es_sele='selected'
}
k.writeln('<option value="'+tl[h]+'" '+ es_sele +'>'+tl[h]+'</option>')
es_sele=''
h++
}
k.writeln('</select>')
k.writeln('</td><td align=center valign=middle bgcolor=' + estils[jn].col +'>')
k.write('<a href=')
k.write("'javascript:obj="+jn+";opener.paleta_colors(")
k.write('"opener.col_est");')
k.write("' >")
k.write(' </a>')
k.writeln('</td><td align=center>')
es_sele=''
if(estils[jn].neg==1){
es_sele="checked"
}
k.writeln('<input type=checkbox name=neg' + jn + ' value=true ' + es_sele +'>')
k.writeln('</td><td align=center>')
es_sele=''
if(estils[jn].cur==1){
es_sele="checked"
}
k.writeln('<input type=checkbox name=cur' + jn + ' value=true ' + es_sele +'>')
k.writeln('</td><td align=center>')
es_sele=''
if(estils[jn].sub==1){
es_sele="checked"
}
k.writeln('<input type=checkbox name=subry' + jn + ' value=true ' + es_sele +'>')
k.writeln('</td></tr>')
jn++
}
k.writeln('<tr><td colspan=7 align=center>')
k.writeln("<font color=black face=arial size=-1 ><input type=button name=valida onclick='actualitza();' value=' Validar ' ></font>")
k.writeln('</td></tr>')
k.writeln('</table>')
k.writeln('</form>')
k.writeln("</body></html>")
k.close()
msg.focus()
}
function posa_estils(){
var texto, lon, loc, loc_end, k, d_est
texto=obj_txt.value
lon=texto.length
loc=spot_from_inici('<STYLE TYPE="text/css" >',texto,0)
if(loc==-1){
alert('$mesg_al1[$idi_edit]')
}
else
{
loc_end=spot_from_inici("</STYLE>",texto,loc)
if(loc_end==-1){
alert('$mesg_al2[$idi_edit]')
}
else
{
k=loc+24
d_est = def_estils()
texto=texto.substring(0,k)+ d_est + "\n" + texto.substring(loc_end,lon)
obj_txt.value=texto
}
}
}
function def_estils(){
var cad_estils='', t=0
while(t<7){
cad_estils += "\n #" + estils[t].name + " { font-family:" + estils[t].tip + "; font-size:" + estils[t].tam + "pt; color:" + estils[t].col + ";"
if(estils[t].neg==1){ cad_estils+=" font-weight:bold;" }
if(estils[t].cur==1){ cad_estils+=" font-style:italic;" }
if(estils[t].sub==1){ cad_estils+=" text-decoration:underline;" }
cad_estils += "}"
t++
}
return cad_estils
}
function col_est(hexa){
estils[msg.obj].col=hexa
msg.actualitza()
msg.close()
gestio_estils(obj_txt)
}
jBreak=new HTMLtag("BR",1,"","<BR>\n","","",0,"","","",0,"","","","","","","","","","","","","","","","","","");
function breakline(txt){
escriu_tag(txt,jBreak,1)
}jnbsp=new HTMLtag("NBSP",1," ","","",0,"","","",0,"","","","","","","","","","","","","","","","","","");
function nbsp(txt){
escriu_tag(txt,jnbsp,1)
}
jUFont=new HTMLtag('UF',2,'','','',0,'','','Entra el texto a poner con el estilo fijado:',0,'','','','','','','','','','','','','','','','','','');
jIFont=new HTMLtag('IF',3,'','',jUFont,1,'','','',0,'','','','','','','','','','','','','','','','','','');
jBFont=new HTMLtag('BF',3,'','',jIFont,1,'','','',0,'','','','','','','','','','','','','','','','','','');
jTipus_font=new HTMLtag('TF',3,'<FONT','</FONT>',jBFont,1,'','','',3,'face','arial','Tipo de fuente (Arial | Courier | Serif | Times ):','point-size','12pt','Tamaño de fuente (formato NNpt):','color','black','Color de la fuente (ver paleta):','','','','','','','','','');
function tipus_font(txt){
var val = '0'
val=prompt('Negrita (si | no):','no')
if( val == 'si' || val == 'yes' ){
jBFont.tagstart = '<B>'
jBFont.tagend = '</B>'
}
if( val == null ){
return false;
}
val=prompt('Cursiva (si | no):','no')
if( val == 'si' || val == 'yes' ){
jIFont.tagstart = '<I>'
jIFont.tagend = '</I>'
}
if( val == null ){
return false;
}
val=prompt('Subrayado (si | no):','no')
if( val == 'si' || val == 'yes' ){
jUFont.tagstart = '<U>'
jUFont.tagend = '</U>'
}
if( val == null ){
return false;
}
escriu_tag(txt,jTipus_font,1)
jBFont.tagstart = ''
jBFont.tagend = ''
jIFont.tagstart = ''
jIFont.tagend = ''
jUFont.tagstart = ''
jUFont.tagend = ''
return true;
}
jBold=new HTMLtag('B',2,'<B>','</B>','',0,'','','Entra el texto a poner en negrita:',0,'','','','','','','','','','','','','','','','','','');function negreta(txt){
escriu_tag(txt,jBold,1)
}
jCurs=new HTMLtag('I',2,'<I>','</I>','',0,'','','Entra el texto a poner en cursiva:',0,'','','','','','','','','','','','','','','','','','');function cursiva(txt){
escriu_tag(txt,jCurs,1)
}
jSubry=new HTMLtag('U',2,'<U>','</U>','',0,'','','Entra el texto a poner subrayado:',0,'','','','','','','','','','','','','','','','','','');function subry(txt){
escriu_tag(txt,jSubry,1)
}
jHR=new HTMLtag('HR',1,'\n<HR','\n','',0,'','' ,'',4,'ALIGN','CENTER','Tipus de alineación (CENTER | LEFT | RIGHT):','WIDTH','85%','Anchura (en % de la pàgina):','SIZE','2','Grosor (en pixels):','0','NOSHADE','Sacar el sombreado (si | no):','','','','','','');function lin_horiz(txt){
escriu_tag(txt,jHR,1)
}
jAlin_L=new HTMLtag('DIV_L',2,'<DIV ALIGN="LEFT" >','</DIV>','',0,'','','Entra el texto a mostrar alineado a la izquierda:',0,'','','','','','','','','','','','','','','','','','' );function alin_esq(txt){
escriu_tag(txt,jAlin_L,1)
}
jAlin_R=new HTMLtag('DIV_R',2,'<DIV ALIGN="RIGHT" >','</DIV>','',0,'','','Entra el texto a mostrar alineado a la derecha:',0,'','','','','','','','','','','','','','','','','','' );
function alin_dreta(txt){
escriu_tag(txt,jAlin_R,1)
}
jCenter=new HTMLtag('CENTER',2,'<CENTER>','</CENTER>','',0,'','', 'Entra el texto a mostrar centrado:',0,'','','','','','','','','','','','','','','','','','');function centrat(txt){
escriu_tag(txt,jCenter,1)
}
jLI=new HTMLtag('LI',2,'\n<LI>','</LI>','',0,'','','Entra elemento de la lista:',0,'','','','','','','','','','','','','','','','','','');
jOL=new HTMLtag('OL',3,'\n<OL','\n</OL>',jLI,0,'Entra el número de elementos de la lista:','','',2,'TYPE','l','Tipo de numeración: A: A,B,C,D,... a: a,b,c,d,... I: I,II,III,IV,... i: i,ii,iii,iv,... n: 1,2,3,4,... ','START','1','Número inicial:','','','','','','','','','','','','');function llista_numerada(txt){
escriu_tag(txt,jOL,1)
}
jUL=new HTMLtag('UL',3,'\n<UL','\n</UL>',jLI,0,'Entra el número de elementos de la lista:','','',1,'TYPE','DISC','Tipo de símbolo (CIRCLE | DISC | SQUARE):','','','','','','','','','','','','','','','' );function llista_no_num(txt){
escriu_tag(txt,jUL,1)
}
jIndent=new HTMLtag('BLQ',2,'\n<BLOCKQUOTE>','</BLOCKQUOTE>\n','',0,'','','Entra el texto a indentar:',0,'','','','','','','','','','','','','','','','','','');function indentat(txt){
escriu_tag(txt,jIndent,1)
}
</script>
<FORM NAME="doc_html" METHOD="Post" ACTION=""><table cellspacing=0 cellpadding=2 border=0 hspace=3 ><tr><td valign=middle > Modo: <select name=mode onchange='canvi_mode(this);' size=1 ><option value=0 > Directo </option><option value=1 selected > Guiado </option></select></td>
<td> <a href='' onclick='save(obj_txt); return false;' ><img src='http://titan.unica.edu:9999/gabi/php-js-webedit/save_2.gif' alt='Guardar la página' border=0 align=absmiddle ></a></td>
<td> <a href='' onclick='preview(obj_txt); return false;' ><img src='http://titan.unica.edu:9999/gabi/php-js-webedit/preview_2.gif' alt='Vista preliminar' border=0 ></a></td>
<td> <a href='' onclick='anchor(obj_txt); return false;' ><img src='http://titan.unica.edu:9999/gabi/php-js-webedit/anchor_2.gif' alt='Anchor en el document' border=0 ></a></td>
<td> <a href='' onclick='link(obj_txt); return false;' ><img src='http://titan.unica.edu:9999/gabi/php-js-webedit/link_2.gif' alt='Link' border=0 ></a></td>
<td> <a href='' onclick='taula(obj_txt); return false;' ><img src='http://titan.unica.edu:9999/gabi/php-js-webedit/table_2.gif' alt='Tabla' border=0 ></a></td>
<td> <a href='' onclick='imatge(obj_txt); return false;' ><img src='http://titan.unica.edu:9999/gabi/php-js-webedit/img_2.gif' alt='Insertar Imagen' border=0 ></a></td>
<td> <a href='' onclick='titol(obj_txt); return false;' ><img src='http://titan.unica.edu:9999/gabi/php-js-webedit/title_2.gif' alt='Poner título a la ventana del documento' border=0 ></a></td>
<td> <a href='' onclick='bgcolor(obj_txt); return false;' ><img src='http://titan.unica.edu:9999/gabi/php-js-webedit/background_2.gif' alt='Color de fondo del documento' border=0 ></a></td>
<td> <a href='' onclick='paleta(obj_txt); return false;' ><img src='http://titan.unica.edu:9999/gabi/php-js-webedit/paleta_2.gif' alt='Consulta de la paleta de colors' border=0 ></a></td>
<td> <a href='' onclick='new_doc(obj_txt); return false;' ><img src='http://titan.unica.edu:9999/gabi/php-js-webedit/new_doc_2.gif' alt='Nuevo documento (se perderá la información no salvada)' border=0 ></a></td>
</tr>
</table>
<table cellspacing=0 cellpadding=0 border=0 >
<tr>
<td valign=middle > Estilo: <select name=estil onchange='posa_estil(obj_txt,this);ob_est=this;' size=1 ><option value='nr' selected > normal </option><option value='t1' > Título 1 </option><option value='t2' > Título 2 </option><option value='t3' > Título 3 </option><option value='s1' > Estilo 1 </option><option value='s2' > Estilo 2 </option><option value='s3' > Estilo 3 </option></select>
</td>
<td><a href='' onclick='posa_estil(obj_txt,ob_est); return false;' ><img src='http://titan.unica.edu:9999/gabi/php-js-webedit/estil_3.gif' alt='Poner Estilo' border=0 ></a></td>
<td> <a href='' onclick='gestio_estils(obj_txt); return false;' ><img src='http://titan.unica.edu:9999/gabi/php-js-webedit/set_estil_3.gif' alt='Gestión de Estilos' border=0 ></a></td>
<td> </td>
<td> <a href='' onclick='breakline(obj_txt); return false;' ><img src='http://titan.unica.edu:9999/gabi/php-js-webedit/enter_3.gif' alt='Salto de línea' border=0 ></a></td>
<td> <a href='' onclick='nbsp(obj_txt); return false;' ><img src='http://titan.unica.edu:9999/gabi/php-js-webedit/nbsp_3.gif' alt='Espacios en blanco' border=0 ></a></td>
<td> <a href='' onclick='tipus_font(obj_txt); return false;' ><img src='http://titan.unica.edu:9999/gabi/php-js-webedit/tipus_font_3.gif' alt='Fuente con estilo' border=0 ></a></td>
<td> </td>
<td> <a href='' onclick='negreta(obj_txt); return false;' ><img src='http://titan.unica.edu:9999/gabi/php-js-webedit/neg_3.gif' alt='Negrita' border=0 ></a></td>
<td> <a href='' onclick='cursiva(obj_txt); return false;' ><img src='http://titan.unica.edu:9999/gabi/php-js-webedit/curs_3.gif' alt='Cursiva' border=0 ></a></td>
<td> <a href='' onclick='subry(obj_txt); return false;' ><img src='http://titan.unica.edu:9999/gabi/php-js-webedit/subry_3.gif' alt='Subrayado' border=0 ></a></td>
<td> <a href='' onclick='lin_horiz(obj_txt); return false;' ><img src='http://titan.unica.edu:9999/gabi/php-js-webedit/hr_3.gif' alt='Línea horizontal' border=0 ></a></td>
<td> </td>
<td> <a href='' onclick='alin_esq(obj_txt); return false;' ><img src='http://titan.unica.edu:9999/gabi/php-js-webedit/align_left_3.gif' alt='Alinear a la izquierda' border=0 ></a></td>
<td> <a href='' onclick='centrat(obj_txt); return false;' ><img src='http://titan.unica.edu:9999/gabi/php-js-webedit/align_center_3.gif' alt='Centrar' border=0 ></a></td>
<td> <a href='' onclick='alin_dreta(obj_txt); return false;' ><img src='http://titan.unica.edu:9999/gabi/php-js-webedit/align_right_3.gif' alt='Alinear a la derecha' border=0 ></a></td>
<td> </td>
<td> <a href='' onclick='llista_numerada(obj_txt); return false;' ><img src='http://titan.unica.edu:9999/gabi/php-js-webedit/numb_list_3.gif' alt='Lista numerada' border=0 ></a></td>
<td> <a href='' onclick='llista_no_num(obj_txt); return false;' ><img src='http://titan.unica.edu:9999/gabi/php-js-webedit/unord_list_3.gif' alt='Lista no numerada' border=0 ></a></td>
<td> </td>
<td> <a href='' onclick='indentat(obj_txt); return false;' ><img src='http://titan.unica.edu:9999/gabi/php-js-webedit/indent_3.gif' alt='Indentar' border=0 ></a></td>
</tr>
</table>
<TEXTAREA NAME="text" ONFOCUS="obj_txt=this;" ROWS="20" COLS="90" WRAP="SOFT"> </TEXTAREA>
</FORM>
<script>
obj_txt=document.doc_html.text;
ob_est=document.doc_html.estil;
inici(1);</script></BODY></HTML>