October 9th, 2007 by W.Regenczuk

Ajaxifying

Generally, I feel bad when I see my own code. Especially, when the code has been written some time ago. But the code below is a real junk: it simply does not work(always) and it is meant to handle click on links; it replaces default links’ behavior by my own: meaning by calling “Ext.Ajax.Request”.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<script>
. . .
    // post click universal handler
    var maskClick = function(e){
        // find the "a" element that was clicked
        var a = e.getTarget('a');
        if (a) {
            if( a.rel != 'noajax'
                && cleanUrl.indexOf(Wp.bloginfo.url) == 0 
                && cleanUrl.indexOf('wp-admin') == -1 
                && cleanUrl.indexOf('wp-login') == -1 
                && cleanUrl.indexOf('feed') == -1 
              ){
                e.preventDefault();
                Wp.theme.loadPosts(a.href);
            }
 
        }
    };
. . .
</script>

I have made the function private of Wp.theme. The concept was to make universal click handler for links, but I have realised that not every link should be handled. Especially not blog URL (Wp.bloginfo.ur), all links that go to admin interface should not be handled also, neither feed links, and so on and so on…. As you can see the condition can be easily break. (the real maskClick is even more messy because it tries to handle links with #). Now it cannot be applied everywhere because Ext uses “A” tags very often. This is because some elements need focus and in some browsers there is no focus without “A” tag.

Please help me to find a better alternative!

ajax javascript framework grid tree javascript library component extjs ext js wordpress blog theme ajax javascript framework grid tree javascript library component extjs ext js wordpress blog theme ajax javascript framework grid tree javascript library component extjs ext js wordpress blog theme ajax javascript framework grid tree javascript library component extjs ext js wordpress blog theme ajax javascript framework grid tree javascript library component extjs ext js wordpress blog theme ajax javascript framework grid tree javascript library component extjs ext js wordpress blog theme ajax javascript framework grid tree javascript library component extjs ext js wordpress blog theme ajax javascript framework grid tree javascript library component extjs ext js wordpress blog theme ajax javascript framework grid tree javascript library component extjs ext js wordpress blog theme
Pages: 1 2 3 4 5 6 7 8 9
7 Responses to “Ext JS Theme Revealed”
Nico says:

Testing theme =)

Great app

testando says:

testando, m testando, m testando, m testando, m

Khashayar says:

well done

Me says:

good!

bywide says:

nice … O_O

Trojan, says:

hello! i like this themes, but i can’t install.why ? pls help me!