banner

[Rule] Rules  [Home] Main Forum  [Portal] Portal  
[Members] Member Listing  [Statistics] Statistics  [Search] Search  [Reading Room] Reading Room 
[Register] Register  
[Login] Loginhttp  | https  ]
 
Messages posted by: Linuxcodon  XML
Profile for Linuxcodon Messages posted by Linuxcodon [ number of posts not being displayed on this page: 3 ]
 
Code:
ï??/*
* AVIM JavaScript Vietnamese Input Method Source File dated 18-03-2006
*
* Copyright (C) 2004 Hieu Tran Dang <lt2hieu2004 (at) users (dot) sf (dot) net>
* Website: http://hdang.co.uk
* http://hieu.acunett.com
*
* You are allowed to use this software in any way you want providing:
* 1. You must retain this copyright notice at all time
* 2. You must not claim that you or any other third party is the author
* of this software in any way.
*/
va="email".split(',') //Put the ID of the fields you DON'T want to let users type Vietnamese in, multiple fields allowed, separated by a comma (,)
fID="vB_Editor_QR_iframe,vB_Editor_QE_1_iframe,vB_Editor_001_iframe,vB_Editor_002_iframe".split(',') //Put the ID of the iframes you want to let users type Vietnamese in separated by a comma (,)
method=0 //Default input method, 0=AUTO, 1=TELEX, 2=VNI, 3=VIQR
on_off=1 //Start H.I.M on
dockspell=1 //Start H.I.M with spell checking on
dauCu=1 //Start H.I.M with old way of marking accent (o`a, o`e, u`y)
useCookie=1 //Set this to 0 to NOT use cookies
radioID="him_auto,him_telex,him_vni,him_viqr,him_viqr2,him_off,him_ckspell,him_daucu".split(",")
var agt=navigator.userAgent.toLowerCase(),alphabet="QWERTYUIOPASDFGHJKLZXCVBNM\ ",them,spellerr,setCookie,getCookie
var is_ie=((agt.indexOf("msie")!=-1)&&(agt.indexOf("opera")==-1)),S,F,J,R,X,D,oc,sk,saveStr,wi,frame,is_opera=false,D2
var ver=0,support=true,changed=false,uni,uni2,g,h,SFJRX,DAWEO,Z,AEO,moc,trang,kl=0,tw5,range=null,doc
skey=new Array(97,226,259,101,234,105,111,244,417,117,432,121,65,194,258,69,202,73,79,212,416,85,431,89)
var skey2="a,a,a,e,e,i,o,o,o,u,u,y,A,A,A,E,E,I,O,O,O,U,U,Y".split(','),A,E,O,whit=false,english="Ä?Ã?Ä?Æ?Æ?ÊÃ?",ds1="d,D".split(","),db1=new Array(273,272)
os1="o,O,Æ?,Æ?,Ã?,Ã?,Ã?,Ã?,á??,á?Œ,á??,á?Ž,õ,Ã?,á??,á?š,á??,á?œ,á??,á??,á?Ÿ,á?ž,á??,á??".split(","),ob1="Ã?,Ã?,Ã?,Ã?,á??,á??,á??,á??,á??,á??,á??,á??,á??,á??,á??,á??,á??,á??,á??,á??,á??,á??,á??,á??".split(",")
mocs1="o,O,Ã?,Ã?,u,U,Ã?,Ã?,Ã?,Ã?,á??,á?Œ,á??,á?Ž,õ,Ã?,ú,Ú,Ã?,Ã?,á??,á??,á??,á??,Å?,Å?,á??,á??,á??,á??,á??,á??,á??,á??,á??,á??".split(",");mocb1="Æ?,Æ?,Æ?,Æ?,Æ?,Æ?,á??,á?š,á??,á?œ,á??,á??,á?Ÿ,á?ž,á??,á??,á??,á??,á??,á?ª,á??,á??,á??,á??,á??,á??,á??,á?š,á??,á?œ,á??,á??,á?Ÿ,á?ž,á??,á??".split(",")
trangs1="a,A,Ã?,Ã?,Ã?,Ã?,Ã?,Ã?,áº?,áº?,áº?,áº?,Ã?,Ã,áº?,áº?,áº?,áº?,áº?,áº?,áº?,áº?,áº?,Ẫ".split(",");trangb1="ă,Ä?,ă,Ä?,áº?,áº?,áº?,áº?,áº?,áº?,áº?,áº?,ẵ,áº?,áº?,áº?,áº?,áº?,áº?,áº?,áº?,áº?,ẵ,áº?".split(",")
as1="a,A,ă,Ä?,Ã?,Ã?,Ã?,Ã?,áº?,áº?,áº?,áº?,Ã?,Ã,áº?,áº?,áº?,áº?,áº?,áº?,áº?,áº?,ẵ,áº?,áº?,áº?,á??,á??,á??,á??,á?ƒ,á??,á??,á??".split(",");ab1="Ã?,Ã?,Ã?,Ã?,áº?,áº?,áº?,áº?,áº?,áº?,áº?,áº?,áº?,Ẫ,áº?,áº?,áº?,áº?,áº?,áº?,áº?,áº?,áº?,Ẫ,Ã?,Ã?,Ã?,Ã?,áº?,áº?,áº?,Ẻ,áº?,áº?".split(",")
es1="e,E,Ã?,Ã?,Ã?,Ã?,áº?,áº?,áº?,Ẻ,áº?,áº?".split(",");eb1="ê,Ê,áº?,áº?,á??,á??,á??,á??,á?ƒ,á??,á??,á??".split(",")
arA="Ã?,Ã?,áº?,Ã?,áº?,a,Ã?,Ã?,áº?,Ã,áº?,A".split(',');mocrA="Ã?,Ã?,á??,õ,á??,o,ú,Ã?,á??,Å?,á??,u,Ã?,Ã?,á?Ž,Ã?,á?Œ,O,Ú,Ã?,á??,Å?,á??,U".split(',');erA="Ã?,Ã?,áº?,áº?,áº?,e,Ã?,Ã?,Ẻ,áº?,áº?,E".split(',');orA="Ã?,Ã?,á??,õ,á??,o,Ã?,Ã?,á?Ž,Ã?,á?Œ,O".split(',')
aA="áº?,áº?,áº?,áº?,áº?,Ã?,áº?,áº?,áº?,Ẫ,áº?,Ã?".split(',');mocA="á??,á??,á?Ÿ,á??,á??,Æ?,á??,á??,á??,á??,á??,Æ?,á?š,á?œ,á?ž,á??,á??,Æ?,á??,á?ª,á??,á??,á??,Æ?".split(',');trangA="áº?,áº?,áº?,ẵ,áº?,ă,áº?,áº?,áº?,áº?,áº?,Ä?".split(',');eA="áº?,á??,á?ƒ,á??,á??,ê,áº?,á??,á??,á??,á??,Ê".split(',');oA="á??,á??,á??,á??,á??,Ã?,á??,á??,á??,á??,á??,Ã?".split(',')
function notWord(w) {
var str="\ \r\n#,\\;.:-_()<>+-*/=?!\"$%{}[]\'~|^\@\&\t"+fcc(160)
return (str.indexOf(w)>=0)
}
function mozGetText(obj) {
var v,pos,w="";g=1
v=(obj.data)?obj.data:obj.value
if(v.length<=0) return false
if(!obj.data) {
if(!obj.setSelectionRange) return false
pos=obj.selectionStart
} else pos=obj.pos
if(obj.selectionStart!=obj.selectionEnd) return new Array("",pos)
while(1) {
if(pos-g<0) break
else if(notWord(v.substr(pos-g,1))) { if(v.substr(pos-g,1)=="\\") w=v.substr(pos-g,1)+w; break }
else w=v.substr(pos-g,1)+w; g++
}
return new Array(w,pos)
}
function start(obj,key) {
var w="";oc=obj;uni2=false;fixed=false
if(method==0) { uni="D,A,E,O,W,W".split(','); uni2="9,6,6,6,7,8".split(','); D2="DAWEO6789" }
else if(method==1) { uni="D,A,E,O,W,W".split(','); D2="DAWEO" }
else if(method==2) { uni="9,6,6,6,7,8".split(','); D2="6789" }
else if(method==3) { uni="D,^,^,^,+,(".split(','); D2="D^+(" }
else if(method==4) { uni="D,^,^,^,*,(".split(','); D2="D^*(" }
if(!is_ie) {
key=fcc(key.which)
w=mozGetText(obj)
if((!w)||(obj.sel)) return
main(w[0],key,w[1],uni)
if(!dockspell) w=mozGetText(obj)
if((w)&&(uni2)&&(!changed)) main(w[0],key,w[1],uni2)
} else {
obj=ieGetText(obj)
if(obj) {
var sT=obj.cW.text
w=main(obj.cW.text,key,0,uni)
if((uni2)&&((w==sT)||(typeof(w)=='undefined'))) w=main(obj.cW.text,key,0,uni2)
if(w) obj.cW.text=w
}
}
if(D2.indexOf(key.toUpperCase())>=0) {
if(!is_ie) {
w=mozGetText(obj)
if(!w) return
normC(w[0],key,w[1])
} else if(typeof(obj)=="object") {
obj=ieGetText(obj)
if(obj) {
w=obj.cW.text
if(!changed) { w+=key; changed=true }
obj.cW.text=w
w=normC(w,key,0)
if(w) { obj=ieGetText(obj); obj.cW.text=w }
}
}
}
}
function ieGetText(obj) {
var caret=obj.document.selection.createRange(),w=""
if(caret.text) caret.text=""
else {
while(1) {
caret.moveStart("character",-1)
if(w.length==caret.text.length) break
w=caret.text
if(notWord(w.charAt(0))) {
if(w.charCodeAt(0)==13) w=w.substr(2)
else if(w.charAt(0)!="\\") w=w.substr(1)
break
}
}
}
if(w.length) {
caret.collapse(false)
caret.moveStart("character",-w.length)
obj.cW=caret.duplicate()
return obj
} else return false
}
function ie_replaceChar(w,pos,c) {
var r="",uc=0
if(isNaN(c)) uc=c.toUpperCase()
if((whit)&&(w.substr(w.length-pos-1,1).toUpperCase()=='U')&&(pos!=1)&&(w.substr(w.length-pos-2,1).toUpperCase()!='Q')) {
whit=false
if((unV(fcc(c)).toUpperCase()=="Æ ")||(uc=="O")) {
if(w.substr(w.length-pos-1,1)=='u') r=fcc(432)
else r=fcc(431)
}
if(uc=="O") {
if(c=="o") c=417
else c=416
}
}
if(!isNaN(c)) {
changed=true;r+=fcc(c)
return w.substr(0,w.length-pos-r.length+1)+r+w.substr(w.length-pos+1)
} else return w.substr(0,w.length-pos)+c+w.substr(w.length-pos+1)
}
function tr(k,w,by,sf,i) {
var r,pos=findC(w,k,sf)
if(pos) {
if(pos[1]) {
if(is_ie) return ie_replaceChar(w,pos[0],pos[1])
else return replaceChar(oc,i-pos[0],pos[1])
} else {
var c,pC=w.substr(w.length-pos,1);r=sf
for(g=0;g<r.length;g++) {
if(isNaN(r[g])) var cmp=pC
else var cmp=pC.charCodeAt(0)
if(cmp==r[g]) {
if(!isNaN(by[g])) c=by[g]
else c=by[g].charCodeAt(0)
if(is_ie) return ie_replaceChar(w,pos,c)
else return replaceChar(oc,i-pos,c)
}
}
}
}
return false
}
function main(w,k,i,a) {
var uk=k.toUpperCase(),bya=new Array(db1,ab1,eb1,ob1,mocb1,trangb1),got=false,t="d,D,a,A,a,A,o,O,u,U,e,E,o,O".split(",")
var sfa=new Array(ds1,as1,es1,os1,mocs1,trangs1),by=new Array(),sf=new Array()
if((method==2)||((method==0)&&(a[0]=="9"))) {
DAWEO="6789";SFJRX="12534";S="1";F="2";J="5";R="3";X="4";Z="0";D="9";FRX="234";AEO="6";moc="7";trang="8";them="678";A="^";E="^";O="^"
} else if(method==3) {
DAWEO="^+(D";SFJRX="'`.?~";S="'";F="`";J=".";R="?";X="~";Z="-";D="D";FRX="`?~";AEO="^";moc="+";trang="(";them="^+(";A="^";E="^";O="^"
} else if(method==4) {
DAWEO="^*(D";SFJRX="'`.?~";S="'";F="`";J=".";R="?";X="~";Z="-";D="D";FRX="`?~";AEO="^";moc="*";trang="(";them="^*(";A="^";E="^";O="^"
} else if((method==1)||((method==0)&&(a[0]=="D"))) {
SFJRX="SFJRX";DAWEO="DAWEO";D='D';S='S';F='F';J='J';R='R';X='X';Z='Z';FRX="FRX";them="AOEW";trang="W";moc="W";A="A";E="E";O="O"
}
if(SFJRX.indexOf(uk)>=0) {
var ret=sr(w,k,i); got=true
if(ret) return ret
} else if(uk==Z) {
sf=repSign(null)
for(h=0;h<english.length;h++) {
sf[sf.length]=english.toLowerCase().charCodeAt(h)
sf[sf.length]=english.charCodeAt(h)
}
for(h=0;h<5;h++) for(g=0;g<skey.length;g++) by[by.length]=skey[g]
for(h=0;h<t.length;h++) by[by.length]=t[h]
got=true
}
else for(h=0;h<a.length;h++) if(a[h]==uk) { got=true; by=by.concat(bya[h]); sf=sf.concat(sfa[h]) }
if(uk==moc) whit=true;
if(!got) return normC(w,k,i)
return DAWEOZ(k,w,by,sf,i,uk)
}
function DAWEOZ(k,w,by,sf,i,uk) { if((DAWEO.indexOf(uk)>=0)||(Z.indexOf(uk)>=0)) return tr(k,w,by,sf,i) }
function normC(w,k,i) {
var uk=k.toUpperCase(),u=repSign(null),fS,c,j,space=(k.charCodeAt(0)==32)?true:false
if((!is_ie)&&(space)) return
for(j=1;j<=w.length;j++) {
for(h=0;h<u.length;h++) {
if(u[h]==w.charCodeAt(w.length-j)) {
if(h<=23) fS=S
else if(h<=47) fS=F
else if(h<=71) fS=J
else if(h<=95) fS=R
else fS=X
c=skey[h%24]; if((alphabet.indexOf(uk)<0)&&(D2.indexOf(uk)<0)) return w; w=unV(w)
if((!space)&&(!changed)) w+=k
if(!is_ie) {
if(!changed) {
if(!oc.data) {
var sp=oc.selectionStart,sst=oc.scrollTop
oc.value=oc.value.substr(0,oc.selectionStart)+k+oc.value.substr(oc.selectionEnd); changed=true
oc.setSelectionRange(sp+k.length,sp+k.length); oc.scrollTop=sst
} else { oc.insertData(oc.pos,k); range.setEnd(oc,oc.pos+1); oc.pos++; changed=true }
}
if(!ckspell(w,fS)) {
replaceChar(oc,i-j,c)
if(!oc.data) {
var pos=oc.selectionStart
var a=new Array(D)
main(w,fS,pos,a)
} else {
var ww=mozGetText(oc)
var a=new Array(D)
main(ww[0],fS,ww[1],a)
}
}
} else {
var ret=sr(w,fS,0)
if((space)&&(ret)) ret+=fcc(32)
if(ret) return ret
}
}
}
}
}
function nospell(w,k) { return false }
function ckspell(w,k) {
w=unV(w); var exc="UOU,IEU".split(','),z,next=true,noE="UU,UOU,UOI,IEU,AO,IA,AI,AY,AU,AO".split(','),noBE="YEU",test,a,b
var check=true,noM="UE,UYE,IU,EU,UY".split(','),noMT="AY,AU".split(','),noT="UA",t=-1,notV2="IAO"
var uw=w.toUpperCase(),tw=uw,update=false,gi="IO",noAOEW="OE,OO,AO,EO,IA,AI".split(','),noAOE="OA"
var notViet="AA,AE,EE,OU,YY,YI,IY,EY,EA,EI,II,IO,YO,YA,YU,OOO".split(','),uk=k.toUpperCase(),twE,uw2=unV2(uw)
var vSConsonant="B,C,D,G,H,K,L,M,N,P,Q,R,S,T,V,X".split(','),vDConsonant="CH,GI,KH,NGH,GH,NG,NH,PH,QU,TH,TR".split(',')
var vDConsonantE="CH,NG,NH".split(','),sConsonant="C,P,T,CH".split(','),vSConsonantE="C,M,N,P,T".split(',')
var noNHE="O,U,IE,Ô,Æ ,Ư,IÊ,Ä‚,Â,UYE,UYÊ,UO,Æ¯Æ ,ƯO,UÆ ,UA,ƯA,OÄ‚,OE,OÊ".split(','),oMoc="UU,UOU".split(',')
if(FRX.indexOf(uk)>=0) for(a=0;a<sConsonant.length;a++) if(uw.substr(uw.length-sConsonant[a].length,sConsonant[a].length)==sConsonant[a]) return true
for(a=0;a<uw.length;a++) {
if("FJZW1234567890".indexOf(uw.substr(a,1))>=0) return true
for(b=0;b<notViet.length;b++) {
if(uw2.substr(a,notViet[b].length)==notViet[b]) {
for(z=0;z<exc.length;z++) if(uw2.indexOf(exc[z])>=0) next=false
if((next)&&((gi.indexOf(notViet[b])<0)||(a<=0)||(uw2.substr(a-1,1)!='G'))) return true
}
}
}
for(b=0;b<vDConsonant.length;b++) if(tw.indexOf(vDConsonant[b])==0){tw=tw.substr(vDConsonant[b].length);update=true;t=b;break}
if(!update) for(b=0;b<vSConsonant.length;b++) if(tw.indexOf(vSConsonant[b])==0){tw=tw.substr(1);break}
update=false;twE=tw
for(b=0;b<vDConsonantE.length;b++) {
if(tw.substr(tw.length-vDConsonantE[b].length)==vDConsonantE[b]) {
tw=tw.substr(0,tw.length-vDConsonantE[b].length)
if(b==2){
for(z=0;z<noNHE.length;z++) if(tw==noNHE[z]) return true
if((uk==trang)&&((tw=="OA")||(tw=="A"))) return true
}
update=true;break
}
}
if(!update) for(b=0;b<vSConsonantE.length;b++) if(tw.substr(tw.length-1)==vSConsonantE[b]){tw=tw.substr(0,tw.length-1);break}
if(tw) {
for(a=0;a<vDConsonant.length;a++) {
for(b=0;b<tw.length;b++) { if(tw.substr(b,vDConsonant[a].length)==vDConsonant[a]) return true }
}
for(a=0;a<vSConsonant.length;a++) { if(tw.indexOf(vSConsonant[a])>=0) return true }
}
test=tw.substr(0,1)
if((t==3)&&((test=="A")||(test=="O")||(test=="U")||(test=="Y"))) return true
if((t==5)&&((test=="E")||(test=="I")||(test=="Y"))) return true
uw2=unV2(tw)
if(uw2==notV2) return true
if(tw!=twE) for(z=0;z<noE.length;z++) if(uw2==noE[z]) return true
if((tw!=uw)&&(uw2==noBE)) return true
if(uk!=moc) for(z=0;z<oMoc.length;z++) if(tw==oMoc[z]) return true
if((uw2.indexOf('UYE')>0)&&(uk=='E')) check=false
if((them.indexOf(uk)>=0)&&(check)) {
for(a=0;a<noAOEW.length;a++) if(uw2.indexOf(noAOEW[a])>=0) return true
if(uk!=trang) if(uw2==noAOE) return true
if((uk==trang)&&(trang!='W')) if(uw2==noT) return true
if(uk==moc) for(a=0;a<noM.length;a++) if(uw2==noM[a]) return true
if((uk==moc)||(uk==trang)) for(a=0;a<noMT.length;a++) if(uw2==noMT[a]) return true
}
tw5=tw
if((uw2.charCodeAt(0)==272)||(uw2.charCodeAt(0)==273)) { if(uw2.length>4) return true }
else if(uw2.length>3) return true
return false
}
function DAWEOF(cc,k) {
var ret=new Array(),kA=new Array(A,moc,trang,E,O),z,a;ret[0]=g
var ccA=new Array(aA,mocA,trangA,eA,oA),ccrA=new Array(arA,mocrA,arA,erA,orA)
for(a=0;a<kA.length;a++) if(k==kA[a]) for(z=0;z<ccA[a].length;z++) if(cc==ccA[a][z]) ret[1]=ccrA[a][z]
if(ret[1]) return ret
else return false
}
function findC(w,k,sf) {
if(((method==3)||(method==4))&&(w.substr(w.length-1,1)=="\\")) return new Array(1,k.charCodeAt(0))
var str="",res,cc="",pc="",tE="",vowA=new Array(),s="Ã‚Ä‚ÃŠÃ”Æ Æ¯",c=0,dn=false,uw=w.toUpperCase(),tv;spellerr(w,k)
var DAWEOFA=aA.join()+eA.join()+mocA.join()+trangA.join()+oA.join()+english;DAWEOFA=DAWEOFA.toUpperCase()
for(g=0;g<sf.length;g++) {
if(isNaN(sf[g])) str+=sf[g]
else str+=fcc(sf[g])
}
var uk=k.toUpperCase(),i=w.length,uni_array=repSign(k),w2=unV2(unV(w).toUpperCase()),dont="ƯA,ƯU".split(',')
if (DAWEO.indexOf(uk)>=0) {
if(uk==moc) {
if((w2.indexOf("UU")>=0)&&(tw5!=dont[1])) {
if(w2.indexOf("UU")==(w.length-2)) res=2
else return false
} else if(w2.indexOf("UOU")>=0) {
if(w2.indexOf("UOU")==(w.length-3)) res=2
else return false
}
}
if(!res) {
for(g=1;g<=w.length;g++) {
cc=w.substr(w.length-g,1)
pc=w.substr(w.length-g-1,1).toUpperCase()
uc=cc.toUpperCase()
for(h=0;h<dont.length;h++) if((tw5==dont[h])&&(tw5==unV(pc+uc))) dn=true
if(dn) { dn=false; continue }
if(str.indexOf(uc)>=0) {
if(((uk==moc)&&(unV(uc)=="U")&&(unV(w.substr(w.length-g+1,1)).toUpperCase()=="A"))||((uk==trang)&&(unV(uc)=='A')&&(unV(pc)=='U'))) {
if(unV(uc)=="U") tv=1
else tv=2
ccc=w.substr(w.length-g-tv,1).toUpperCase()
if(ccc!="Q") res=g+tv-1
else if(uk==trang) res=g
else if(moc!=trang) return false
} else res=g
if((!whit)||(uw.indexOf("Ư")<0)||(uw.indexOf("W")<0)) break
} else if(DAWEOFA.indexOf(uc)>=0) {
if(uk==D) {
if(cc=="Ä‘") res=new Array(g,'d')
else if(cc=="Đ") res=new Array(g,'D')
} else res=DAWEOF(cc,uk)
if(res) break
}
}
}
}
if((uk!=Z)&&(DAWEO.indexOf(uk)<0)) { var tEC=retKC(uk); for (g=0;g<tEC.length;g++) tE+=fcc(tEC[g]) }
for(g=1;g<=w.length;g++) {
if(DAWEO.indexOf(uk)<0) {
cc=w.substr(w.length-g,1).toUpperCase()
pc=w.substr(w.length-g-1,1).toUpperCase()
if(str.indexOf(cc)>=0) {
if(cc=='U') {
if(pc!='Q') { c++;vowA[vowA.length]=g }
} else if(cc=='I') {
if((pc!='G')||(c<=0)) { c++;vowA[vowA.length]=g }
} else { c++;vowA[vowA.length]=g }
} else if(uk!=Z) {
for(h=0;h<uni_array.length;h++) if(uni_array[h]==w.charCodeAt(w.length-g)) {
if(spellerr(w,k)) return false
return new Array(g,tEC[h%24])
}
for(h=0;h<tEC.length;h++) if(tEC[h]==w.charCodeAt(w.length-g)) return new Array(g,fcc(skey[h]))
}
}
}
if((uk!=Z)&&(typeof(res)!='object')) if(spellerr(w,k)) return false
if(DAWEO.indexOf(uk)<0) {
for(g=1;g<=w.length;g++) {
if((uk!=Z)&&(s.indexOf(w.substr(w.length-g,1).toUpperCase())>=0)) return g
else if(tE.indexOf(w.substr(w.length-g,1))>=0) {
for(h=0;h<tEC.length;h++) {
if(w.substr(w.length-g,1).charCodeAt(0)==tEC[h]) return new Array(g,fcc(skey[h]))
}
}
}
}
if(res) return res
if((c==1)||(uk==Z)) return vowA[0]
else if(c==2) {
var v=2
if(w.substr(w.length-1)==" ") v=3
var ttt=w.substr(w.length-v,2).toUpperCase()
if((dauCu==0)&&((ttt=="UY")||(ttt=="OA")||(ttt=="OE"))) return vowA[0]
var c2=0,fdconsonant,sc="BCD"+fcc(272)+"GHKLMNPQRSTVX",dc="CH,GI,KH,NGH,GH,NG,NH,PH,QU,TH,TR".split(',')
for(h=1;h<=w.length;h++) {
fdconsonant=false
for(g=0;g<dc.length;g++) {
if(dc[g].indexOf(w.substr(w.length-h-dc[g].length+1,dc[g].length).toUpperCase())>=0) {
c2++;fdconsonant=true
if(dc[g]!='NGH') h++
else h+=2
}
}
if(!fdconsonant) {
if(sc.indexOf(w.substr(w.length-h,1).toUpperCase())>=0) c2++
else break
}
}
if((c2==1)||(c2==2)) return vowA[0]
else return vowA[1]
} else if(c==3) return vowA[1]
else return false
}
function unV(w) {
var u=repSign(null),b,a
for(a=1;a<=w.length;a++) {
for(b=0;b<u.length;b++) {
if(u[b]==w.charCodeAt(w.length-a)) {
w=w.substr(0,w.length-a)+fcc(skey[b%24])+w.substr(w.length-a+1)
}
}
}
return w
}
function unV2(w) {
var a,b
for(a=1;a<=w.length;a++) {
for(b=0;b<skey.length;b++) {
if(skey[b]==w.charCodeAt(w.length-a)) {
w=w.substr(0,w.length-a)+skey2[b]+w.substr(w.length-a+1)
}
}
}
return w
}
function repSign(k) {
var t=new Array(),u=new Array(),a,b
for(a=0;a<5;a++) {
if((k==null)||(SFJRX.substr(a,1)!=k.toUpperCase())) {
t=retKC(SFJRX.substr(a,1))
for(b=0;b<t.length;b++) u[u.length]=t[b]
}
}
return u
}
function sr(w,k,i) {
var sf=getSF()
pos=findC(w,k,sf)
if(pos) {
if(pos[1]) {
if(!is_ie) replaceChar(oc,i-pos[0],pos[1])
else return ie_replaceChar(w,pos[0],pos[1])
} else {
var c=retUni(w,k,pos)
if (!is_ie) replaceChar(oc,i-pos,c)
else return ie_replaceChar(w,pos,c)
}
}
return false
}
function retUni(w,k,pos) {
var u=retKC(k.toUpperCase()),uC,lC,c=w.charCodeAt(w.length-pos),a
for (a=0;a<skey.length;a++) if (skey[a]==c) {
if (a<12) { lC=a;uC=a+12 }
else { lC=a-12;uC=a }
if (fcc(c)!=fcc(c).toUpperCase()) return u[lC]
return u[uC]
}
}
function replaceChar(o,pos,c) {
var bb=false; if(!isNaN(c)) { var replaceBy=fcc(c),wfix=unV(fcc(c)).toUpperCase(); changed=true }
else { var replaceBy=c; if((c.toUpperCase()=="O")&&(whit)) bb=true }
if(!o.data) {
var savePos=o.selectionStart,sst=o.scrollTop
if ((o.value.substr(pos-1,1).toUpperCase()=='U')&&(pos<savePos-1)&&(o.value.substr(pos-2,1).toUpperCase()!='Q')) {
if((wfix=="Æ ")||(bb))
{
if (o.value.substr(pos-1,1)=='u') var r=fcc(432)
else var r=fcc(431)
}
if(bb) {
changed=true; if(c=="o") replaceBy="Æ¡"
else replaceBy="Æ "
}
}
o.setSelectionRange(pos,pos+1)
o.value=o.value.substr(0,o.selectionStart)+replaceBy+o.value.substr(o.selectionEnd)
if(r) {
o.setSelectionRange(pos-1,pos)
o.value=o.value.substr(0,o.selectionStart)+r+o.value.substr(o.selectionEnd)
}
o.setSelectionRange(savePos,savePos); o.scrollTop=sst
} else {
if ((o.data.substr(pos-1,1).toUpperCase()=='U')&&(pos<o.pos-1)) {
if((wfix=="Æ ")||(bb))
{
if (o.data.substr(pos-1,1)=='u') var r=fcc(432)
else var r=fcc(431)
}
if(bb) {
changed=true; if(c=="o") replaceBy="Æ¡"
else replaceBy="Æ "
}
}
o.deleteData(pos,1); o.insertData(pos,replaceBy)
if(r) { o.deleteData(pos-1,1); o.insertData(pos-1,r) }
}
if(whit) whit=false
}
function retKC(k) {
if(k==S) return new Array(225,7845,7855,233,7871,237,243,7889,7899,250,7913,253,193,7844,7854,201,7870,205,211,7888,7898,218,7912,221)
if(k==F) return new Array(224,7847,7857,232,7873,236,242,7891,7901,249,7915,7923,192,7846,7856,200,7872,204,210,7890,7900,217,7914,7922)
if(k==J) return new Array(7841,7853,7863,7865,7879,7883,7885,7897,7907,7909,7921,7925,7840,7852,7862,7864,7878,7882,7884,7896,7906,7908,7920,7924)
if(k==R) return new Array(7843,7849,7859,7867,7875,7881,7887,7893,7903,7911,7917,7927,7842,7848,7858,7866,7874,7880,7886,7892,7902,7910,7916,7926)
if(k==X) return new Array(227,7851,7861,7869,7877,297,245,7895,7905,361,7919,7929,195,7850,7860,7868,7876,296,213,7894,7904,360,7918,7928)
}
function getEL(id) { return document.getElementById(id) }
function getSF() { var sf=new Array(),x; for(x=0;x<skey.length;x++) sf[sf.length]=fcc(skey[x]); return sf }
function statusMessage() {
var str='Kiểu gõ: '
if(on_off==0) str+='Tắt'
else if(method==1) str+='TELEX'
else if(method==2) str+='VNI'
else if(method==3) str+='VIQR'
else if(method==4) str+='VIQR*'
else if(method==0) str+='Tá»± Ä‘á»™ng'
str+=" [F9] | Chính tả: "
str+=(dockspell==0)?"Tắt":"Bật"
str+=" [F8] | Bỏ dấu: "
str+=(dauCu==1)?"CÅ©":"Má»›i"
str+=" [F7] | Bật/Tắt [F12] - HIM 20060318"
window.status=str
}
function updateInfo() { setCookie(); if(support) statusMessage() }
function setMethod(m) {
if(m==-1) { on_off=0; if(getEL(radioID[5])) getEL(radioID[5]).checked=true }
else { on_off=1; method=m; if(getEL(radioID[m])) getEL(radioID[m]).checked=true }
setSpell(dockspell); setDauCu(dauCu); updateInfo()
}
function setDauCu(box) {
if(typeof(box)=="number") {
dauCu=box; if(getEL(radioID[7])) getEL(radioID[7]).checked=box
} else dauCu=(box.checked)?1:0
updateInfo()
}
function setSpell(box) {
if(typeof(box)=="number") {
spellerr=(box==1)?ckspell:nospell
if(getEL(radioID[6])) getEL(radioID[6]).checked=box
}
else {
if(box.checked) { spellerr=ckspell; dockspell=1 }
else { spellerr=nospell; dockspell=0 }
}
updateInfo()
}
function onKeyDown(e) {
if (e=='iframe') { frame=findF(); var key=frame.event.keyCode }
else var key=(!is_ie)?e.which:window.event.keyCode
if((key==120)||(key==123)||(key==119)||(key==118)) {
if(key==120) { on_off=1; setMethod(((method==4)?0:++method)) }
else if(key==118) { setDauCu(((dauCu==1)?0:1)) }
else if(key==119) { dockspell=(dockspell==0)?1:0; setSpell(dockspell) }
else if(key==123) {
on_off=(on_off==0)?1:0
if(on_off==0) setMethod(-1)
else setMethod(method)
}
updateInfo()
}
}
function ifInit(w) {
var sel=w.getSelection();w.focus()
range=sel?sel.getRangeAt(0):document.createRange()
}
function ifMoz(e) {
if((e.ctrlKey)||((e.altKey)&&(code!=92)&&(code!=126))) return;ifInit(e.target.parentNode.wi)
var code=e.which,node=range.endContainer;sk=fcc(code);saveStr=""
if(checkCode(code)||(!range.startOffset)||(typeof(node.data)=='undefined')) return;node.sel=false
if(node.data) {
saveStr=node.data.substr(range.endOffset)
if(range.startOffset!=range.endOffset) node.sel=true
node.deleteData(range.startOffset,node.data.length)
}
range.setEnd(node,range.endOffset)
range.setStart(node,0)
if(!node.data) return
node.value=node.data; node.pos=node.data.length; node.which=code
start(node,e)
node.insertData(node.data.length,saveStr)
range.setEnd(node,node.data.length-saveStr.length+kl)
range.setStart(node,node.data.length-saveStr.length+kl); kl=0
if(changed) { changed=false; e.preventDefault() }
}
function FKeyPress() {
var obj=findF()
sk=fcc(obj.event.keyCode)
if(checkCode(obj.event.keyCode)||((obj.event.ctrlKey)&&(obj.event.keyCode!=92)&&(obj.event.keyCode!=126))) return
start(obj,fcc(obj.event.keyCode))
}
function checkCode(code) { if(((on_off==0)||((code<45)&&(code!=42))||(code==145)||(code==255))&&(code!=32)&&(code!=39)&&(code!=40)&&(code!=43)) return true }
function fcc(x) { return String.fromCharCode(x) }
if(useCookie==1) { setCookie=doSetCookie; getCookie=doGetCookie }
else { setCookie=noCookie; getCookie=noCookie }
function noCookie() {}
function doSetCookie() {
var exp=new Date(11245711156480).toGMTString()
document.cookie='HIM_on_off='+on_off+';expires='+exp
document.cookie='HIM_method='+method+';expires='+exp
document.cookie='HIM_ckspell='+dockspell+';expires='+exp
document.cookie='HIM_daucu='+dauCu+';expires='+exp
}
function doGetCookie() {
var ck=document.cookie, res=/HIM_method/.test(ck)
if((!res)||(ck.indexOf('HIM_ckspell')<0)) { setCookie(); return }
var p,ckA=ck.split(';')
for(var i=0;i<ckA.length;i++) {
p=ckA[i].split('='); p[0]=p[0].replace(/^\s+/g,""); p[1]=parseInt(p[1])
if(p[0]=='HIM_on_off') on_off=p[1]
else if(p[0]=='HIM_method') method=p[1]
else if(p[0]=='HIM_ckspell') {
if(p[1]==0) { dockspell=0; spellerr=nospell }
else { dockspell=1; spellerr=ckspell }
} else if(p[0]=='HIM_daucu') dauCu=parseInt(p[1])
}
}
if(!is_ie) {
if(agt.indexOf("opera")<0) {
ver=agt.substr(agt.indexOf("rv:")+3)
ver=parseFloat(ver.substr(0,ver.indexOf(" ")))
if(agt.indexOf("mozilla")<0) ver=0
} else {
operaV=agt.split(" ")
if(parseInt(operaV[operaV.length-1])>=8) is_opera=true
else {
operaV=operaV[0].split("/")
if(parseInt(operaV[1])>=8) is_opera=true
}
}
}
if((is_ie)||(ver>=1.3)||(is_opera)) {
getCookie()
if(on_off==0) setMethod(-1)
else setMethod(method)
setSpell(dockspell);setDauCu(dauCu);statusMessage()
} else support=false
document.onkeydown=function(e) { onKeyDown(e) }
document.onkeypress=function(e) {
if(!support) return
if(!is_ie) { var el=e.target,code=e.which; if(e.ctrlKey) return; if((e.altKey)&&(code!=92)&&(code!=126)) return }
else { var el=window.event.srcElement,code=window.event.keyCode; if((event.ctrlKey)&&(code!=92)&&(code!=126)) return }
if(((el.type!='textarea')&&(el.type!='text'))||checkCode(code)) return
sk=fcc(code); for(i=0;i<va.length;i++) if((el.id==va[i])&&(va[i].length>0)) return
if(!is_ie) start(el,e)
else start(el,sk)
if(changed) { changed=false; return false }
}
function findF() {
for(g=0;g<fID.length;g++) {
frame=document.frames[fID[g]]
if((typeof(frame)!='undefined')&&(frame.document)&&(frame.event)) return frame
}
}
if((support)&&(!is_opera)&&(fID.length>0)) {
for(g=0;g<fID.length;g++) {
if(is_ie) {
frame=document.frames[fID[g]]
if((typeof(frame)!='undefined')&&(frame.document)) {
doc=frame.document;doc.designMode="On"
doc.onkeydown=function() { onKeyDown('iframe') }
doc.onkeypress=function() { FKeyPress(); if(changed) { changed=false; return false } }
}
} else {
if(getEL(fID[g])) {
wi=getEL(fID[g]).contentWindow;iframedit=wi.document;iframedit.wi=wi;iframedit.designMode="On"
iframedit.addEventListener("keypress",ifMoz,false)
iframedit.addEventListener("keydown",onKeyDown,true)
}
}
}
}

Bỏ vào giữa 2 tag body
Sử dụng các add bộ gõ của vbb hoặc kéo cái javascript ra và add vào trong tag body
Một số trang ở bài post đầu tiên ko ghi banwitch 1 só link bị die
Em lâu lâu ấn nhầm link thì hiện ra cái nì :
Code:
Bạn có khả năng đọc nhanh bằng vận tốc ánh sáng?
Bạn đã vượt quá giới hạn số lần xem trong một đơn vị thời gian cho phép.
Bấm ở đây để tiếp tục.


Các bác có thể chỉ em cách làm ko ?
Nếu là hacker mũ trằng thì nên báo cho người ta .......................... Còn nếu là hacker mũ đen thì .... he he he
Này , em có phát 1 câu mà lòi ra cả đống là sao , vu khống nhá
Trên mạng nhiều vô kể , chưa tìm mà đã hỏi rồi ...
Nếu ko chê , em xin bổ sung 1 tiện ích về edit .
Source Edit 3.0 - Công cụ edit Free tuyệt vời

Source Edit description
Source Edit is an editor especially made for developers but can of course be used as a regular text editor as well
Source Edit is an editor that can support programming languages but it can ve used as a regular text editor.

Source Edit natively supports the following languages:
ASP, PHP, Java, C/C++, C#, Visual Basi, Pascal, Per, Cold Fusion, SQL, HTML, CSS, XML.

Source Edit quickly and seamlessly colors all code written in any of these languages. Do you miss a language? You can also create a new one yourself using the Language Editor.

Here are some key features of "Source Edit":

Code Completion
· Source Edit has an IntelliSence like code completion feature.
Custom Help Files
· Source Edit allows you to add an unlimited amount of custom help files that can be used for content sensitive help.
Hex Editor
· Source Edit comes with a hex editor called HexSource.
Keyboard
macros
· Source Edit supports recording of keyboard macros that can be saved as a keyboard shortcut (for example Ctrl+1) and to the toolbar. Source Edit can also repeat any command any number of times automatically.
Custom tools
· You can also add any custom tool to Source Edit tools menu and toolbar. This is usefull for example when you want to compile your code. This feature also supports capturing of any output from the application you call. This output may be shown in the Output Window.
· If your compiler supports EMAC-style output
· Source Edit will also highlight the line in the editor where any errors or warnings has occured in the code when you click on the message in the Output Window.
RGB Mixer
· Quick and easy color mixer for web developers.
Bookmarks
· Source Edit supports any number of bookmarks in your code or document. Simply add a bookmark and you can then return to that part of the text with the click of a button. This is very handy when you're working with large documents.
Customizable
· Source Edit is highly customizable. You can change or set keyboard shortcut to all commands available. You can change how code is colorized. You can also set the "file mapping". By file mapping you associate different file types to different languages. So when you open or save a file with a *.cpp extention, for example, Source Edit will immediately use the C/C++ color coding. You are also able to change what files are shown in the Open and Save As dialog boxes.
Projects/Workspaces
· With the new Projects menu (new in version 1.2) you can add different Workspaces. You can add several files to one Workspace and by opening that Workspace all files will be opened at the same time.
Search and Replace in Files
· Source Edit reports in which file/files the search for text exists and on which line. You may then open the file and Source Edit will jump to the correct line.
Other Features
· Add/remove comments to a block of code with the click of a button
· Highlights the current line
· Show line numbers
· Allows column selection (by holding down the ALT key while dragging the mouse over the text)
· Unlimited undo and redo commands
· Quick file opening using the Files Window
· Show a file in the default browser with the click of a button
· Window splitter. Show one file in up to 4 different frames
· Is able to show whitespaces
· Find and replace with the ability to find and select all occurrences of a searched text 



http://www.softpedia.com/get/Programming/File-Editors/Source-Edit.shtml

Link Softpedia khỏi sợ virus ..
Điền key Win vô Avtive Key , cái này trong HVA cũng đã có ... (lâu rồi )
Em có 1 thắc mắc . Làm sao để chèn FF và Opera vô . Em hơi bị mù chữ về Javascript . Xin bác trả lời dùm .
Cảm ơn anh rất nhiều . Em hiểu rồi
Giờ bỏ ngỏ luôn là sao , giúp em đi . Hay cho em 1 đoạn mã JS khác đi
JForum chẳng lẽ lại không có lỗi , với lại bản VBB 3.68 cũng fix hết rồi .
Code:
<head>
<title>11b6 Homepage</title>
</head>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<meta http-equiv="Content-Language" content="vi">
</head>
<body> <center>
<SCRIPT LANGUAGE="JavaScript1.2">
<!-- Begin
var no = 25; var speed = 1;
var snowflake = "Pic/Snow-Lend.gif";
var ns4up = (document.layers) ? 1 : 0;
var ie4up = (document.all) ? 1 : 0;
var dx, xp, yp; var am, stx, sty;
var i, doc_width = 800, doc_height = 600;
if (ns4up) {
doc_width = self.innerWidth;
doc_height = self.innerHeight;
} else if (ie4up) {
doc_width = document.body.clientWidth;
doc_height = document.body.clientHeight;
}
dx = new Array(); xp = new Array();
yp = new Array(); am = new Array();
stx = new Array(); sty = new Array();
for (i = 0; i < no; ++ i) {
dx[i] = 0;
xp[i] = Math.random()*(doc_width-100);
yp[i] = Math.random()*doc_height;
am[i] = Math.random()*20;
stx[i] = 0.02 + Math.random()/10;
sty[i] = 0.7 + Math.random();
if (ns4up) {
if (i == 0) {
document.write("<layer name=\"dot"+ i +"\" left=\"15\" ");
document.write("top=\"15\" visibility=\"show\"><img src=\"");
document.write(snowflake + "\" border=\"0\"></layer>");
} else {
document.write("<layer name=\"dot"+ i +"\" left=\"15\" ");
document.write("top=\"15\" visibility=\"show\"><img src=\"");
document.write(snowflake + "\" border=\"0\"></layer>");
}
} else if (ie4up) {
if (i == 0) {
document.write("<div id=\"dot"+ i +"\" style=\"POSITION: ");
document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: ");
document.write("visible; TOP: 15px; LEFT: 15px;\"><img src=\"");
document.write(snowflake + "\" border=\"0\"></div>");
} else {
document.write("<div id=\"dot"+ i +"\" style=\"POSITION: ");
document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: ");
document.write("visible; TOP: 15px; LEFT: 15px;\"><img src=\"");
document.write(snowflake + "\" border=\"0\"></div>");
}
}
}
function snowNS() {
for (i = 0; i < no; ++ i) {
yp[i] += sty[i];
if (yp[i] > doc_height-50) {
xp[i] = Math.random()*(doc_width-am[i]-30);
yp[i] = 0;
stx[i] = 0.02 + Math.random()/10;
sty[i] = 0.7 + Math.random();
doc_width = self.innerWidth;
doc_height = self.innerHeight;
}
dx[i] += stx[i];
document.layers["dot"+i].top = yp[i];
document.layers["dot"+i].left = xp[i] + am[i]*Math.sin(dx[i]);
}
setTimeout("snowNS()", speed);
}
function snowIE() {
for (i = 0; i < no; ++ i) {
yp[i] += sty[i];
if (yp[i] > doc_height-50) {
xp[i] = Math.random()*(doc_width-am[i]-30);
yp[i] = 0;
stx[i] = 0.02 + Math.random()/10;
sty[i] = 0.7 + Math.random();
doc_width = document.body.clientWidth;
doc_height = document.body.clientHeight;
}
dx[i] += stx[i];
document.all["dot"+i].style.pixelTop = yp[i];
document.all["dot"+i].style.pixelLeft = xp[i] + am[i]*Math.sin(dx[i]);
}
setTimeout("snowIE()", speed);
}
if (ns4up) {
snowNS();
} else if (ie4up) {
snowIE();
}
// End -->
</script> <body background="Pic/BR">
<div style="position: absolute; left: 61px; top: 405px; width: 200px; height: 200px; z-index: 1; " id="layer5">
<p><a href="http://music.tuantrinh.info/"><img border="0" src="Pic/buttonM.gif" width="200" height="200"></a></div>
<div style="position: absolute; left: 61px; top: 206px; width: 200px; height: 200px; z-index: 1" id="layer4">
<p><a href="download.php"><img border="0" src="Pic/buttonD.gif" width="200" height="200"></a></div>
<div style="position: absolute; left: 60px; top: 5px; width: 200px; height: 200px; z-index: 1" id="layer1">
<p><a href="11b6">
<img border="0" src="Pic/buttonF.gif" width="200" height="200"></a></div>
</p>
<div style="position: absolute; width: 640px; height: 480px; z-index: 2; left: 271px; top: 4px" id="layer2">
<img src="Pic/1"/></div>
<div style="position: absolute; width: 325px; height: 37px; z-index: 3; left: 443px; top: 501px" id="layer3">
<embed width="281" height="46" src="Rami.wpl" align="middle"><noembed>FF music</noembed></div>
<p>
</body>
</html>


Các bác xem dùm em nhé
http://11b6.isgreat.org/
Đây là trang em mới làm cho lớp em , nhưng khổ nỗi chèn hiệu ứng tuyết rơi vào thì Fire Fox ko thể hiển thị được mà IE và Opera lại đọc tốt . Có ai biết cách khắc phục hoặc cho 1 đoạn mã JavaScript khác được không ạ .
HVA tại sao không bỏ 1 số tiền nào đó mua VBB về sài , vừa tiện , bảo mật lại tốt , chỉ sợ bị DDOS mà thôi , nhưng HVA thì rành nhất vụ này mà . Tại sao lại ko dùng VBB
Nói tóm lại cũng chỉ là rapid smilie)
có ai up lên mediafire dùm đc ko

vnkimlong wrote:
MÌnh học lớp 11 là nhà trường bắt học Pascal rồi , chúng ta có thể trao đổi thêm về pascal, email của mình là : marsdtn@gmail.com

Y!M : Linuxcodon
Y!M của mình . Mình cũng học 11 . Trao đổi nhé .
Chuyển qua Mediafire cho em nhờ .
Đưa link cũng như ko . CŨng dẫn tới trang chủ thôi
Em rất cần 1 Free host xài đc mà em đã thử tìm rồi , 1 tuần vật lộn , kết quả vẫn là số không (tất nhiên là kể cả những Free host của mem HVA post ) . Xin cho em 1 lời khuyên ( 1 cái Free Host càng tốt )...

Cảm ơn :cry: :cry: :cry: :lolsmilie :lolsmilie :lolsmilie :cry: :cry: :cry: smilie( smilie( smilie( :lolsmilie :lolsmilie :lolsmilie
Có ai có Ebook CHM về C ko cho em đi smilie !
Bác có Pertium thì chia xẻ cách để có đi .(cách để có chứ ko phải là cái account của bác )
Sặc , toàn rapid , chịu . Này Osama Binladen trong trang đó ebook dạng .chm hả !
Cái này dùng để làm gì !!!!
Vậy trang nào hỗ trợ rứa ?????
 
Go to Page:  First Page Page 1 Page 3 Last Page

Powered by JForum - Extended by HVAOnline
 hvaonline.net  |  hvaforum.net  |  hvazone.net  |  hvanews.net  |  vnhacker.org
1999 - 2013 © v2012|0504|218|