SE@RCHER
SE@RCHER
Золотая библиотека JAVASCRIPT Библиотека JAVASCRIPT + CSS
Золотая библиотека JAVASCRIPT Библиотека JAVASCRIPT + CSS
Золотая библиотека JAVASCRIPT ЛУЧШИЕ JAVASCRIPT
Золотая библиотека JAVASCRIPT
1997


ИЗБРАННЫЕ ПРИМЕРЫ АВГУСТ 2012 года

назад на главную страницу раздела - клавиша Esc

ПРИМЕР ↴

ПРИМЕР ↺

HTML ↴

размер Kb (клик на коде)

',ExpandCode:'+ expand code',ViewPlain:'код в отд окне',Print:'печать',CopyToClipboard:'копировать в память',About:'?',CopiedToClipboard:'Код скопирован в память.'};dp.SyntaxHighlighter=dp.sh;dp.sh.Utils.Expand=function(sender) {var table=sender;var span=sender;while(span!=null&&span.tagName!='SPAN') span=span.parentNode;while(table!=null&&table.tagName!='TABLE') table=table.parentNode;span.parentNode.removeChild(span);table.tBodies[0].className='show';table.parentNode.style.height='100%';} dp.sh.Utils.ViewSource=function(sender) {var code=sender.parentNode.originalCode;var wnd=window.open('','_blank','width=750, height=400, location=0, resizable=1, menubar=0, scrollbars=1');code=code.replace(/'+code+'');wnd.document.close();} dp.sh.Utils.ToClipboard=function(sender) {var code=sender.parentNode.originalCode;if(window.clipboardData) {window.clipboardData.setData('text',code);alert(dp.sh.Strings.CopiedToClipboard);}} dp.sh.Utils.PrintSource=function(sender) {var td=sender.parentNode;var code=td.processedCode;var iframe=document.createElement('IFRAME');var doc=null;var wnd=iframe.style.cssText='position:absolute; width:0px; height:0px; left:-5px; top:-5px;';td.appendChild(iframe);doc=iframe.contentWindow.document;code=code.replace(/'+code+'');doc.close();iframe.contentWindow.focus();iframe.contentWindow.print();td.removeChild(iframe);} dp.sh.Utils.About=function() {var wnd=window.open('','_blank','dialog,width=320,height=150,scrollbars=0');var doc=wnd.document;var styles=document.getElementsByTagName('style');var links=document.getElementsByTagName('link');doc.write(dp.sh.Strings.AboutDialog.replace('{V}',dp.sh.Version));for(var i=0;i'+styles[i].innerHTML+'');for(var i=0;i');doc.close();wnd.focus();} dp.sh.Match=function(value,index,css) {this.value=value;this.index=index;this.length=value.length;this.css=css;} dp.sh.Highlighter=function() {this.addGutter=true;this.addControls=true;this.collapse=false;this.tabsToSpaces=true;} dp.sh.Highlighter.SortCallback=function(m1,m2) {if(m1.indexm2.index) return 1;else {if(m1.lengthm2.length) return 1;} return 0;} dp.sh.Highlighter.prototype.GetMatches=function(regex,css) {var index=0;var match=null;while((match=regex.exec(this.code))!=null) {this.matches[this.matches.length]=new dp.sh.Match(match[0],match.index,css);}} dp.sh.Highlighter.prototype.AddBit=function(str,css) {var span=document.createElement('span');str=str.replace(/&/g,'&');str=str.replace(/ /g,' ');str=str.replace(/');if(css!=null) {var regex=new RegExp('
','gi');if(regex.test(str)) {var lines=str.split(' 
');str='';for(var i=0;ic.index)&&(match.index<=c.index+c.length)) return true;} return false;} dp.sh.Highlighter.prototype.ProcessRegexList=function() {for(var i=0;i/gi,'\n');var lines=html.split('\n');var row=null;var cell=null;var tBody=null;var html='';var pipe=' | ';function UtilHref(util,text) {return''+text+'';} tBody=document.createElement('TBODY');this.table.appendChild(tBody);if(this.addGutter==true) {row=tBody.insertRow(-1);cell=row.insertCell(-1);cell.className='tools-corner';} if(this.addControls==true) {var tHead=document.createElement('THEAD');this.table.appendChild(tHead);row=tHead.insertRow(-1);if(this.addGutter==true) {cell=row.insertCell(-1);cell.className='tools-corner';} cell=row.insertCell(-1);cell.originalCode=this.originalCode;cell.processedCode=this.code;cell.className='tools';if(this.collapse==true) {tBody.className='hide';cell.innerHTML+=''+UtilHref('Expand',dp.sh.Strings.ExpandCode)+''+pipe+'';} cell.innerHTML+=UtilHref('ViewSource',dp.sh.Strings.ViewPlain)+pipe+UtilHref('PrintSource',dp.sh.Strings.Print);if(window.clipboardData) cell.innerHTML+=pipe+UtilHref('ToClipboard',dp.sh.Strings.CopyToClipboard);cell.innerHTML+=pipe+UtilHref('About',dp.sh.Strings.About);} for(var i=0,lineIndex=this.firstLine;i0;i++) {if(Trim(lines[i]).length==0) continue;var matches=regex.exec(lines[i]);if(matches!=null&&matches.length>0) min=Math.min(matches[0].length,min);} if(min>0) for(var i=0;i','gm'),'cdata');this.GetMatches(new RegExp('','gm'),'comments');regex=new RegExp('([\\w-\.]+)\\s*=\\s*(".*?"|\'.*?\'|\\w+)*','gm');while((match=regex.exec(this.code))!=null) {push(this.matches,new dp.sh.Match(match[1],match.index,'attribute'));if(match[2]!=undefined) {push(this.matches,new dp.sh.Match(match[2],match.index+match[0].indexOf(match[2]),'attribute-value'));}} this.GetMatches(new RegExp('','gm'),'tag');regex=new RegExp('

Библиотека JAVASCRIPT 1997- Дизайн и сопровождение © SE@RCHER