1. #1
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,483
    Vote Rating
    35
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default Ext bookmarklets

    Ext bookmarklets


    Contribute useful bookmarklets in this thread.

    I'll kick off

    To log all Observable events being fired:

    Code:
    javascript:(function(){var%20l,op;if(!Ext){alert("Ext%20not%20in%20page");return;}if(!(l=console.log)){alert("Browser%20does%20not%20support%20logging");return;}op=Ext.util.Observable.prototype;op.fireEvent=op.fireEvent.createInterceptor(function(evt){l("Ext%20fired%20event%20"+evt+"%20with%20the%20following%20arguments");l(Array.prototype.splice.call(arguments,1,arguments.length-1));});})()
    To log all Container layout invocations:

    Code:
    javascript:(function(){Ext.Container.prototype.doLayout=Ext.Container.prototype.doLayout.createSequence(function(){if(this.canLayout())console.log("Laying%20out%20",%20this.el.dom);});})()

  2. #2
    Sencha User
    Join Date
    Jun 2009
    Posts
    750
    Vote Rating
    0
    meroy is on a distinguished road

      0  

    Default


    Quote Originally Posted by Animal View Post
    To log all Observable events being fired: ...
    To log all Container layout invocations: ...
    You are unbelievable. Thanks for sharing this.

  3. #3
    Sencha - Community Support Team mankz's Avatar
    Join Date
    Nov 2007
    Location
    Stockholm, Sweden
    Posts
    2,639
    Vote Rating
    103
    mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all

      0  

    Default


    Great stuff animal, hope to more of what people got in their private toolboxes

  4. #4
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,483
    Vote Rating
    35
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    This would be a good place to re-post your code formatting bookmarklets since it's a sticky.

  5. #5
    Sencha - Community Support Team jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,337
    Vote Rating
    75
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    I agree with nige. I use it a lot and it deserves much more exposure.

  6. #6
    Sencha - Community Support Team mankz's Avatar
    Join Date
    Nov 2007
    Location
    Stockholm, Sweden
    Posts
    2,639
    Vote Rating
    103
    mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all

      0  

    Default


    Good to hear I'll clean up it and repost it here soon!

  7. #7
    Sencha - Community Support Team mankz's Avatar
    Join Date
    Nov 2007
    Location
    Stockholm, Sweden
    Posts
    2,639
    Vote Rating
    103
    mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all mankz is a name known to all

      0  

    Default Readable code in forums

    Readable code in forums


    Usage:

    1. Find unformatted code
    2. Select any text and fire the bookmarklet
    3. Read pretty code

    More info here: http://www.extjs.com/forum/showthread.php?p=393025

    Testcase: http://www.extjs.com/forum/showthrea...611#post392611

    Code:
    javascript:(function(){try{function js_beautify(D,S){var A,V,O,f,K,T,n,p,o;var Y,k,G,M,Q,m;var d,i,W,X,H,E;var R;var S=S||{};var a=S.indent_size||4;var J=S.indent_char||" ";var h=typeof S.preserve_newlines==="undefined"?true:S.preserve_newlines;var l=S.indent_level||0;function P(){while(V.length&&(V[V.length-1]===" "||V[V.length-1]===o)){V.pop()}}function U(r){r=typeof r==="undefined"?true:r;E=false;P();if(!V.length){return}if(V[V.length-1]!=="\n"||!r){V.push("\n")}for(var q=0;q<R;q++){V.push(o)}}function I(){var q=V.length?V[V.length-1]:" ";if(q!==" "&&q!=="\n"&&q!==o){V.push(" ")}}function Z(){V.push(O)}function N(){R++}function e(){if(R){R--}}function c(){if(V.length&&V[V.length-1]===o){V.pop()}}function L(q){p.push(n);n=q}function F(){W=n==="DO_BLOCK";n=p.pop()}function b(s,q){for(var r=0;r<q.length;r++){if(q[r]===s){return true}}return false}function j(){var x=0;var v="";do{if(M>=A.length){return["","TK_EOF"]}v=A.charAt(M);M+=1;if(v==="\n"){x+=1}}while(b(v,Y));var w=false;if(h){if(x>1){for(var r=0;r<2;r++){U(r===0)}}w=(x===1)}if(b(v,k)){if(M<A.length){while(b(A.charAt(M),k)){v+=A.charAt(M);M+=1;if(M===A.length){break}}}if(M!==A.length&&v.match(/^[0-9]+[Ee]$/)&&A.charAt(M)==="-"){M+=1;var y=j(M);v+="-"+y[0];return[v,"TK_WORD"]}if(v==="in"){return[v,"TK_OPERATOR"]}if(w&&f!=="TK_OPERATOR"&&!E){U()}return[v,"TK_WORD"]}if(v==="("||v==="["){return[v,"TK_START_EXPR"]}if(v===")"||v==="]"){return[v,"TK_END_EXPR"]}if(v==="{"){return[v,"TK_START_BLOCK"]}if(v==="}"){return[v,"TK_END_BLOCK"]}if(v===";"){return[v,"TK_SEMICOLON"]}if(v==="/"){var s="";if(A.charAt(M)==="*"){M+=1;if(M<A.length){while(!(A.charAt(M)==="*"&&A.charAt(M+1)&&A.charAt(M+1)==="/")&&M<A.length){s+=A.charAt(M);M+=1;if(M>=A.length){break}}}M+=2;return["/*"+s+"*/","TK_BLOCK_COMMENT"]}if(A.charAt(M)==="/"){s=v;while(A.charAt(M)!=="\x0d"&&A.charAt(M)!=="\x0a"){s+=A.charAt(M);M+=1;if(M>=A.length){break}}M+=1;if(w){U()}return[s,"TK_COMMENT"]}}if(v==="'"||v==='"'||(v==="/"&&((f==="TK_WORD"&&K==="return")||(f==="TK_START_EXPR"||f==="TK_END_BLOCK"||f==="TK_OPERATOR"||f==="TK_EOF"||f==="TK_SEMICOLON")))){var z=v;var u=false;var q="";if(M<A.length){while(u||A.charAt(M)!==z){q+=A.charAt(M);if(!u){u=A.charAt(M)==="\\"}else{u=false}M+=1;if(M>=A.length){break}}}M+=1;q=z+q+z;if(z=="/"){while(M<A.length&&b(A.charAt(M),k)){q+=A.charAt(M);M+=1}}return[q,"TK_STRING"]}if(b(v,G)){while(M<A.length&&b(v+A.charAt(M),G)){v+=A.charAt(M);M+=1;if(M>=A.length){break}}return[v,"TK_OPERATOR"]}return[v,"TK_UNKNOWN"]}o="";while(a--){o+=J}R=l;A=D;T="";f="TK_START_EXPR";K="";V=[];W=false;X=false;H=false;Y="\n\r\t ".split("");k="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$".split("");G="+ - * / % & ++ -- = += -= *= /= %= == === != !== > < >= <= >> << >>> >>>= >>= <<= && &= | || ! !! , : ? ^ ^= |= ::".split(" ");Q="continue,try,throw,return,var,if,switch,case,default,for,while,break,function".split(",");n="BLOCK";p=[n];M=0;m=false;while(true){var g=j(M);O=g[0];i=g[1];if(i==="TK_EOF"){break}switch(i){case"TK_START_EXPR":X=false;L("EXPRESSION");if(K===";"){U()}else{if(f==="TK_END_EXPR"||f==="TK_START_EXPR"){}else{if(f!=="TK_WORD"&&f!=="TK_OPERATOR"){I()}else{if(b(T,Q)&&T!=="function"){I()}}}}Z();break;case"TK_END_EXPR":Z();F();break;case"TK_START_BLOCK":if(T==="do"){L("DO_BLOCK")}else{L("BLOCK")}if(f!=="TK_OPERATOR"&&f!=="TK_START_EXPR"){if(f==="TK_START_BLOCK"){U()}else{I()}}Z();N();break;case"TK_END_BLOCK":if(f==="TK_START_BLOCK"){P();e()}else{e();U()}Z();F();break;case"TK_WORD":if(W){I();Z();I();break}if(O==="case"||O==="default"){if(K===":"){c()}else{e();U();N()}Z();m=true;break}d="NONE";if(f==="TK_END_BLOCK"){if(!b(O.toLowerCase(),["else","catch","finally"])){d="NEWLINE"}else{d="SPACE";I()}}else{if(f==="TK_SEMICOLON"&&(n==="BLOCK"||n==="DO_BLOCK")){d="NEWLINE"}else{if(f==="TK_SEMICOLON"&&n==="EXPRESSION"){d="SPACE"}else{if(f==="TK_STRING"){d="NEWLINE"}else{if(f==="TK_WORD"){d="SPACE"}else{if(f==="TK_START_BLOCK"){d="NEWLINE"}else{if(f==="TK_END_EXPR"){I();d="NEWLINE"}}}}}}}if(f!=="TK_END_BLOCK"&&b(O.toLowerCase(),["else","catch","finally"])){U()}else{if(b(O,Q)||d==="NEWLINE"){if(K==="else"){I()}else{if((f==="TK_START_EXPR"||K==="=")&&O==="function"){}else{if(f==="TK_WORD"&&(K==="return"||K==="throw")){I()}else{if(f!=="TK_END_EXPR"){if((f!=="TK_START_EXPR"||O!=="var")&&K!==":"){if(O==="if"&&f==="TK_WORD"&&T==="else"){I()}else{U()}}}else{if(b(O,Q)&&K!==")"){U()}}}}}}else{if(d==="SPACE"){I()}}}Z();T=O;if(O==="var"){X=true;H=false}if(O==="if"||O==="else"){E=true}break;case"TK_SEMICOLON":Z();X=false;break;case"TK_STRING":if(f==="TK_START_BLOCK"||f==="TK_END_BLOCK"||f=="TK_SEMICOLON"){U()}else{if(f==="TK_WORD"){I()}}Z();break;case"TK_OPERATOR":var B=true;var C=true;if(X&&O!==","){H=true;if(O===":"){X=false}}if(X&&O===","&&n==="EXPRESSION"){H=false}if(O===":"&&m){Z();U();break}if(O==="::"){Z();break}m=false;if(O===","){if(X){if(H){Z();U();H=false}else{Z();I()}}else{if(f==="TK_END_BLOCK"){Z();U()}else{if(n==="BLOCK"){Z();U()}else{Z();I()}}}break}else{if(O==="--"||O==="++"){if(K===";"){B=true;C=false}else{B=false;C=false}}else{if(O==="!"&&f==="TK_START_EXPR"){B=false;C=false}else{if(f==="TK_OPERATOR"){B=false;C=false}else{if(f==="TK_END_EXPR"){B=true;C=true}else{if(O==="."){B=false;C=false}else{if(O===":"){if(K.match(/^\d+$/)){B=true}else{B=false}}}}}}}}if(B){I()}Z();if(C){I()}break;case"TK_BLOCK_COMMENT":U();Z();U();break;case"TK_COMMENT":I();Z();U();break;case"TK_UNKNOWN":Z();break}f=i;K=O}return V.join("")};function replaceSelection(t){var range=window.getSelection().getRangeAt(0);range.deleteContents();var newDiv=document.createElement('div');newDiv.innerHTML="<pre>"+t+"</pre>";newDiv.className='codeblock';range.insertNode(newDiv);}
    function getSelText(){var txt='';if(window.getSelection){txt=window.getSelection();}
    else if(document.getSelection){txt=document.getSelection();}
    else if(document.selection){txt=document.selection.createRange().text;}
    return txt.toString();}
    if(getSelText()){replaceSelection(getSelText());}
    var nodeList=document.getElementsByTagName('pre');for(var i=0;i<nodeList.length;i++){var e=nodeList.item(i);e.innerHTML=js_beautify(e.textContent,{indent_size:4,indent_char:' ',preserve_newlines:true});}}catch(e){console.log(e);}
    var ss=document.createElement("style");ss.setAttribute("type","text/css");ss.innerHTML="pre.sh_sourceCode{background-color:white;color:black;font-style:normal;font-weight:normal;}pre.sh_sourceCode .sh_keyword{color:blue;font-weight:bold;}pre.sh_sourceCode .sh_type{color:darkgreen;}pre.sh_sourceCode .sh_usertype{color:teal;}pre.sh_sourceCode .sh_string{color:red;font-family:monospace;}pre.sh_sourceCode .sh_regexp{color:orange;font-family:monospace;}pre.sh_sourceCode .sh_specialchar{color:pink;font-family:monospace;}pre.sh_sourceCode .sh_comment{color:brown;font-style:italic;}pre.sh_sourceCode .sh_number{color:purple;}pre.sh_sourceCode .sh_preproc{color:darkblue;font-weight:bold;}pre.sh_sourceCode .sh_symbol{color:darkred;}pre.sh_sourceCode .sh_function{color:black;font-weight:bold;}pre.sh_sourceCode .sh_cbracket{color:red;}pre.sh_sourceCode .sh_todo{font-weight:bold;background-color:cyan;}pre.sh_sourceCode .sh_predef_var{color:darkblue;}pre.sh_sourceCode .sh_predef_func{color:darkblue;font-weight:bold;}pre.sh_sourceCode .sh_classname{color:teal;}pre.sh_sourceCode .sh_linenum{color:black;font-family:monospace;}pre.sh_sourceCode .sh_url{color:blue;text-decoration:underline;font-family:monospace;}pre.sh_sourceCode .sh_date{color:blue;font-weight:bold;}pre.sh_sourceCode .sh_time,pre.sh_sourceCode .sh_file{color:darkblue;font-weight:bold;}pre.sh_sourceCode .sh_ip,pre.sh_sourceCode .sh_name{color:darkgreen;}pre.sh_sourceCode .sh_variable{color:darkgreen;}pre.sh_sourceCode .sh_italics{color:darkgreen;font-style:italic;}pre.sh_sourceCode .sh_bold{color:darkgreen;font-weight:bold;}pre.sh_sourceCode .sh_underline{color:darkgreen;text-decoration:underline;}pre.sh_sourceCode .sh_fixed{color:green;font-family:monospace;}pre.sh_sourceCode .sh_argument{color:darkgreen;}pre.sh_sourceCode .sh_optionalargument{color:purple;}pre.sh_sourceCode .sh_math{color:orange;}pre.sh_sourceCode .sh_bibtex{color:blue;}pre.sh_sourceCode .sh_oldfile{color:orange;}pre.sh_sourceCode .sh_newfile{color:darkgreen;}pre.sh_sourceCode .sh_difflines{color:blue;}pre.sh_sourceCode .sh_selector{color:purple;}pre.sh_sourceCode .sh_property{color:blue;}pre.sh_sourceCode .sh_value{color:darkgreen;font-style:italic;}pre.sh_sourceCode .sh_section{color:black;font-weight:bold;}pre.sh_sourceCode .sh_paren{color:red;}pre.sh_sourceCode .sh_attribute{color:darkgreen;}";document.getElementsByTagName("head")[0].appendChild(ss);void(ss);if(!this.sh_languages){this.sh_languages={}}var sh_requests={};function sh_isEmailAddress(A){if(/^mailto:/.test(A)){return false}return A.indexOf("@")!==-1}function sh_setHref(B,C,D){var A=D.substring(B[C-2].pos,B[C-1].pos);if(A.length>=2&&A.charAt(0)==="<"&&A.charAt(A.length-1)===">"){A=A.substr(1,A.length-2)}if(sh_isEmailAddress(A)){A="mailto:"+A}B[C-2].node.href=A}function sh_konquerorExec(B){var A=[""];A.index=B.length;A.input=B;return A}function sh_highlightString(W,M){if(/Konqueror/.test(navigator.userAgent)){if(!M.konquered){for(var b=0;b<M.length;b++){for(var d=0;d<M[b].length;d++){var c=M[b][d][0];if(c.source==="$"){c.exec=sh_konquerorExec}}}M.konquered=true}}var k=document.createElement("a");var N=document.createElement("span");var V=[];var H=0;var L=[];var X=0;var I=null;var S=function(i,a){var m=i.length;if(m===0){return}if(!a){var p=L.length;if(p!==0){var n=L[p-1];if(!n[3]){a=n[1]}}}if(I!==a){if(I){V[H++]={pos:X};if(I==="sh_url"){sh_setHref(V,H,W)}}if(a){var o;if(a==="sh_url"){o=k.cloneNode(false)}else{o=N.cloneNode(false)}o.className=a;V[H++]={node:o,pos:X}}}X+=m;I=a};var O=/\r\n|\r|\n/g;O.lastIndex=0;var C=W.length;while(X<C){var Q=X;var J;var R;var G=O.exec(W);if(G===null){J=C;R=C}else{J=G.index;R=O.lastIndex}var F=W.substring(Q,J);var j=[];for(;;){var e=X-Q;var Y;var T=L.length;if(T===0){Y=0}else{Y=L[T-1][2]}var l=M[Y];var U=l.length;var K=j[Y];if(!K){K=j[Y]=[]}var Z=null;var P=-1;for(var g=0;g<U;g++){var E;if(g<K.length&&(K[g]===null||e<=K[g].index)){E=K[g]}else{var B=l[g][0];B.lastIndex=e;E=B.exec(F);K[g]=E}if(E!==null&&(Z===null||E.index<Z.index)){Z=E;P=g;if(E.index===e){break}}}if(Z===null){S(F.substring(e),null);break}else{if(Z.index>e){S(F.substring(e,Z.index),null)}var D=l[P];var f=D[1];var A;if(f instanceof Array){for(var h=0;h<f.length;h++){A=Z[h+1];S(A,f[h])}}else{A=Z[0];S(A,f)}switch(D[2]){case-1:break;case-2:L.pop();break;case-3:L.length=0;break;default:L.push(D);break}}}if(I){V[H++]={pos:X};if(I==="sh_url"){sh_setHref(V,H,W)}I=null}X=R}return V}function sh_getClasses(D){var A=[];var B=D.className;if(B&&B.length>0){var E=B.split(" ");for(var C=0;C<E.length;C++){if(E[C].length>0){A.push(E[C])}}}return A}function sh_addClass(C,A){var D=sh_getClasses(C);for(var B=0;B<D.length;B++){if(A.toLowerCase()===D[B].toLowerCase()){return}}D.push(A);C.className=D.join(" ")}function sh_extractTagsFromNodeList(C,A){var F=C.length;for(var D=0;D<F;D++){var E=C.item(D);switch(E.nodeType){case 1:if(E.nodeName.toLowerCase()==="br"){var B;if(/MSIE/.test(navigator.userAgent)){B="\r"}else{B="\n"}A.text.push(B);A.pos++}else{A.tags.push({node:E.cloneNode(false),pos:A.pos});sh_extractTagsFromNodeList(E.childNodes,A);A.tags.push({pos:A.pos})}break;case 3:case 4:A.text.push(E.data);A.pos+=E.length;break}}}function sh_extractTags(C,B){var A={};A.text=[];A.tags=B;A.pos=0;sh_extractTagsFromNodeList(C.childNodes,A);return A.text.join("")}function sh_mergeTags(D,F){var A=D.length;if(A===0){return F}var C=F.length;if(C===0){return D}var I=[];var E=0;var B=0;while(E<A&&B<C){var H=D[E];var G=F[B];if(H.pos<=G.pos){I.push(H);E++}else{I.push(G);if(F[B+1].pos<=H.pos){B++;I.push(F[B]);B++}else{I.push({pos:H.pos});F[B]={node:G.node.cloneNode(false),pos:H.pos}}}}while(E<A){I.push(D[E]);E++}while(B<C){I.push(F[B]);B++}return I}function sh_insertTags(K,H){var G=document;var L=document.createDocumentFragment();var E=0;var D=K.length;var B=0;var J=H.length;var C=L;while(B<J||E<D){var I;var A;if(E<D){I=K[E];A=I.pos}else{A=J}if(A<=B){if(I.node){var F=I.node;C.appendChild(F);C=F}else{C=C.parentNode}E++}else{C.appendChild(G.createTextNode(H.substring(B,A)));B=A}}return L}function sh_highlightElement(D,G){sh_addClass(D,"sh_sourceCode");var C=[];var E=sh_extractTags(D,C);var F=sh_highlightString(E,G);var B=sh_mergeTags(C,F);var A=sh_insertTags(B,E);while(D.hasChildNodes()){D.removeChild(D.firstChild)}D.appendChild(A)}function sh_getXMLHttpRequest(){if(window.ActiveXObject){return new ActiveXObject("Msxml2.XMLHTTP")}else{if(window.XMLHttpRequest){return new XMLHttpRequest()}}throw"No XMLHttpRequest implementation available"}function sh_load(language,element,prefix,suffix){if(language in sh_requests){sh_requests[language].push(element);return}sh_requests[language]=[element];var request=sh_getXMLHttpRequest();var url=prefix+"sh_"+language+suffix;request.open("GET",url,true);request.onreadystatechange=function(){if(request.readyState===4){try{if(!request.status||request.status===200){eval(request.responseText);var elements=sh_requests[language];for(var i=0;i<elements.length;i++){sh_highlightElement(elements[i],sh_languages[language])}}else{throw"HTTP error: status "+request.status}}finally{request=null}}};request.send(null)}function sh_highlightDocument(D,E){var A=document.getElementsByTagName("pre");for(var C=0;C<A.length;C++){var B=A.item(C);sh_highlightElement(B,sh_languages.javascript)}}if(!this.sh_languages){this.sh_languages={}}sh_languages.javascript=[[[/\/\/\//g,"sh_comment",1],[/\/\//g,"sh_comment",7],[/\/\*\*/g,"sh_comment",8],[/\/\*/g,"sh_comment",9],[/\b(?:abstract|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|final|finally|for|function|goto|if|implements|in|instanceof|interface|native|new|null|private|protected|prototype|public|return|static|super|switch|synchronized|throw|throws|this|transient|true|try|typeof|var|volatile|while|with)\b/g,"sh_keyword",-1],[/(\+\+|--|\)|\])(\s*)(\/=?(?![*\/]))/g,["sh_symbol","sh_normal","sh_symbol"],-1],[/(0x[A-Fa-f0-9]+|(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?)(\s*)(\/(?![*\/]))/g,["sh_number","sh_normal","sh_symbol"],-1],[/([A-Za-z$_][A-Za-z0-9$_]*\s*)(\/=?(?![*\/]))/g,["sh_normal","sh_symbol"],-1],[/\/(?:\\.|[^*\\\/])(?:\\.|[^\\\/])*\/[gim]*/g,"sh_regexp",-1],[/\b[+-]?(?:(?:0x[A-Fa-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/g,"sh_number",-1],[/"/g,"sh_string",10],[/'/g,"sh_string",11],[/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\|:|;|,|\.|\/|\?|&|<|>|\|/g,"sh_symbol",-1],[/\{|\}/g,"sh_cbracket",-1],[/\b(?:Math|Infinity|NaN|undefined|arguments)\b/g,"sh_predef_var",-1],[/\b(?:Array|Boolean|Date|Error|EvalError|Function|Number|Object|RangeError|ReferenceError|RegExp|String|SyntaxError|TypeError|URIError|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|isNaN|parseFloat|parseInt)\b/g,"sh_predef_func",-1],[/(?:[A-Za-z]|_)[A-Za-z0-9_]*(?=[ \t]*\()/g,"sh_function",-1]],[[/$/g,null,-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",2,1],[/<!DOCTYPE/g,"sh_preproc",4,1],[/<!--/g,"sh_comment",5],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",6,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",6,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\?>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/\\(?:\\|")/g,null,-1],[/"/g,"sh_string",-2]],[[/>/g,"sh_preproc",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/-->/g,"sh_comment",-2],[/<!--/g,"sh_comment",5]],[[/(?:\/)?>/g,"sh_keyword",-2],[/([^=" \t>]+)([ \t]*)(=?)/g,["sh_type","sh_normal","sh_symbol"],-1],[/"/g,"sh_string",3]],[[/$/g,null,-2]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/<\?xml/g,"sh_preproc",2,1],[/<!DOCTYPE/g,"sh_preproc",4,1],[/<!--/g,"sh_comment",5],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z](?:[A-Za-z0-9_:.-]*)/g,"sh_keyword",6,1],[/&(?:[A-Za-z0-9]+);/g,"sh_preproc",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*(?:\/)?>/g,"sh_keyword",-1],[/<(?:\/)?[A-Za-z][A-Za-z0-9]*/g,"sh_keyword",6,1],[/@[A-Za-z]+/g,"sh_type",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/\*\//g,"sh_comment",-2],[/(?:<?)[A-Za-z0-9_\.\/\-_~]+@[A-Za-z0-9_\.\/\-_~]+(?:>?)|(?:<?)[A-Za-z0-9_]+:\/\/[A-Za-z0-9_\.\/\-_~]+(?:>?)/g,"sh_url",-1],[/(?:TODO|FIXME|BUG)(?:[:]?)/g,"sh_todo",-1]],[[/"/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]],[[/'/g,"sh_string",-2],[/\\./g,"sh_specialchar",-1]]];sh_highlightDocument();})();

  8. #8

  9. #9
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,483
    Vote Rating
    35
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    Spam and spammer gone.

  10. #10
    Sencha User mashiki's Avatar
    Join Date
    Oct 2007
    Location
    Japan
    Posts
    139
    Vote Rating
    0
    mashiki is on a distinguished road

      0  

    Default to use ExtJS as bookmarklet

    to use ExtJS as bookmarklet


    Here is an example to use ExtJS as bookmarklet.

    how to work
    the bookmarklet loads table2grid.js from my server.
    table2grid.js loads css & library of ExtJS from cachefly, and wait Ext.grid.GridPanel is ready.
    table2grid.js search table tags which has th tag in 1st tr from current html, and convert to grid.

    how to use this
    0) bookmark following javascript with title like "table2grid"
    Code:
    javascript:(function(){var%20e=document.createElement('script');e.charset='utf-8';e.src='http://www123.ddo.jp/tools/table2grid.js';document.body.appendChild(e);})()
    1) open target url. ex:
    http://www.php.net/manual/en/languag...precedence.php

    2) select the bookmark table2grid to run

    bookmarklet code with indent:
    Code:
    (function(){
      var e=document.createElement('script');
      e.charset='utf-8';
      e.src='http://www123.ddo.jp/tools/table2grid.js';
      document.body.appendChild(e);
    })()
    table2grid.js's code:
    Code:
    // table2grid.js v 00 --- make grid from table (target table has th tag in the first row)
    // Bookmarklet example
    //   javascript:(function(){var%20e=document.createElement('script');e.charset='utf-8';e.src='http://www123.ddo.jp/tools/table2grid.js';document.body.appendChild(e);})()
    // License: GPL version 3
    (function(){
      var cf='http://extjs.cachefly.net/ext-3.3.1/';
      addEl('link',{rel:'stylesheet',type:'text/css',href:cf+'resources/css/ext-all.css'});
      addEl('script',{src:cf+'adapter/ext/ext-base.js'});
      addEl('script',{src:cf+'ext-all.js'});
      
      function addEl(tag, cfg) {
        var e=document.createElement(tag);
        for (var key in cfg) e[key]=cfg[key];
        document.body.appendChild(e);
      }
      var id=setInterval(function(){
        if(window.Ext && Ext.grid && Ext.grid.GridPanel) {
          clearInterval(id);
    
          var ce = Ext.select('table');
          ce.each(function(tbl){
            var tr0 = tbl.select('tr', true).first();
            var hdrs = tr0.query('th');
            
            if (hdrs.length>0 && tr0.query("td").length===0 ) {
              convertToGrid(tbl, hdrs);
            }
          },true);
        }
      },100);
    
      function convertToGrid(tbl, hdrs) {
        var ct = tbl.insertSibling(),
          flds = [{name:'no'}],
          cols = [];
    
        for (var i=0, h; h=hdrs[i]; ++i) {
          var text = h.innerHTML.replace(/<a\s[^>]+>(.+?)<\/a>/gi,'$1'),
            name = 'tcol-' + i;
          var fld = {
            name: name,
            mapping: 'td:nth('+ (i+1) +')/@innerHTML'
          };
          flds.push(fld);
    
          cols.push({
            header: text,
            dataIndex: name,
            width: h.offsetWidth,
            tooltip: h.title,
            align: 'left',
            sortable: true
          });
        }
    
        var ds = new Ext.data.Store({
            reader: new Ext.data.XmlReader({
                record: 'tbody tr'
            }, flds)
        });
    
        ds.loadData(tbl.dom);
        var r = ds.getAt(0);
        if (!(r.get(0))) ds.remove(r);
        i = 0;
        ds.each(function(r){r.set('no',++i)});
        ds.commitChanges();
    
        ct.setWidth(tbl.getWidth());
    
        tbl.remove();
    
        var grid = new Ext.grid.GridPanel({
          stripeRows: true,
          'ds': ds,
          'cm': new Ext.grid.ColumnModel(cols),
          'sm': new Ext.grid.RowSelectionModel(),
          autoHeight: true,
          autoWidth: false,
          renderTo:ct
        });
      }
    
    })();

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar