Changeset 328

Show
Ignore:
Timestamp:
04/20/06 15:06:26
Author:
piv
Message:

realise 0.2.0

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • qPloneTiles/trunk/HISTORY.txt

    r327 r328  
    1 2006-04-19 - version 0.0.1 
     12006-04-20 - version 0.2.0 
     2 
     3  * added finding function 
     4  
     5  * fixed bug (onclick evaluation) 
     6   
     7  * 'pimary' class functionality 
     8   
     9  * added TODO.txt 
     10 
     11 
     12 
     132006-04-19 - version 0.1.0 
    214 
    315 * created install procedure 
  • qPloneTiles/trunk/README.txt

    r327 r328  
    11qPloneTiles 
    22 
    3  #120: Support and use "Tile" links 
     3 
     4Inspiration 
     5 
     6  "#120: Support and use "Tile" links": 
    47  
    5 One of the classic, testable usability laws is Fitt's 
    6 Law, which simply says that the efficiency of a user 
    7 interface item is directly proportional to its size. 
    8 Plone currently has a lot of user interface items that 
    9 could have bigger clickable areas without changing the 
    10 elements themselves. 
     8  One of the classic, testable usability laws is Fitt's 
     9  Law, which simply says that the efficiency of a user 
     10  interface item is directly proportional to its size. 
     11  Plone currently has a lot of user interface items that 
     12  could have bigger clickable areas without changing the 
     13  elements themselves. 
    1114                       
    12  Proposed by 
    13       Alexander Limi 
    14  Proposal type 
    15       User interface 
    16  Assigned to release 
    17       * Plone 3.0 
    18  State 
    19       being-discussed 
     15  Proposed by:: 
     16    Alexander Limi 
     17  Proposal type:: 
     18    User interface 
     19  Assigned to release:: 
     20    Plone 3.0 
     21  State:: 
     22    being-discussed 
    2023 
    21   
    2224Motivation 
    2325 
    24  A lot of the user interface elements in Plone only work when you click the links they define instead of the entire UI 
    25 element. This is bad UI, although most web-based systems work this way. 
    26  I have already experimented with changing this for a limited set of items in previous Plone versions; in Plone 2.0 I made 
    27 the entire item in the navigation tree clickable and it indicates when it is selected with a block of color around itself, 
    28 so you know you can click (this doesn't work in Internet Explorer because it's a buggy piece of crap, more about that 
    29 later ;). In Plone 2.1 I made all the portlet items be clickable in the entire area through a display:block definition of 
    30 the link tag. 
    31  It's time to take this to the next level. 
     26  A lot of the user interface elements in Plone only  
     27  work when you click the links they define instead  
     28  of the entire UI element. This is bad UI, although 
     29  most web-based systems work this way. 
     30 
     31  I have already experimented with changing this for  
     32  a limited set of items in previous Plone versions;  
     33  in Plone 2.0 I made the entire item in the  
     34  navigation tree clickable and it indicates when it 
     35  is selected with a block of color around itself, 
     36  so you know you can click (this doesn't work in  
     37  Internet Explorer because it's a buggy piece of 
     38  crap, more about that later ;). In Plone 2.1 I made 
     39  all the portlet items be clickable in the entire 
     40  area through a display:block definition of the link 
     41  tag. 
     42  It's time to take this to the next level. 
    3243 
    3344 
    3445Proposal 
    3546                                           
    36  Because of the limitations (as far as I have found, at least), it's hard to make certain elements entirely clickable 
    37 through re-defining the link tag only. In a separate project I was involved in, we used a tiny piece of JS to assign 
    38 clickable behaviour to an arbitrary element, which worked well. 
    39  (Note that the normal "read more" or whatever link still remains, so it's not removing links for people that have JS 
    40 turned off or browsing via lynx or similar — this is merely augmenting the link behaviour, not moving it into JS.) 
    41  This also has the advantage of being able to make any area clickable. My pet peeve is that Plone in "Summary view" 
    42 doesn't accept clicks anywhere within the area of one of the items listed, but only on the links. The interface would be 
    43 so much more efficient if we could click anywhere within that item's area. 
    44                                            
    45                                            
     47  Because of the limitations (as far as I have found,  
     48  at least), it's hard to make certain elements 
     49  entirely clickable through re-defining the link tag 
     50  only. In a separate project I was involved in, we 
     51  used a tiny piece of JS to assign clickable behaviour 
     52  to an arbitrary element, which worked well. 
     53  (Note that the normal "read more" or whatever link 
     54  still remains, so it's not removing links for people 
     55  that have JS turned off or browsing via lynx or 
     56  similar — this is merely augmenting the link behaviour, 
     57  not moving it into JS.) 
     58  This also has the advantage of being able to make any 
     59  area clickable. My pet peeve is that Plone in "Summary 
     60  view" doesn't accept clicks anywhere within the area 
     61  of one of the items listed, but only on the links. The 
     62  interface would be so much more efficient if we could 
     63  click anywhere within that item's area. 
     64   
     65                                           
    4666Implementation 
    4767                                           
    48  We should find a good way to define an area as clickable. In the project I was in, we defined that on the tag itself, and 
    49 did it explicitly, but this can possibly be improved. 
     68  We should find a good way to define an area as clickable. 
     69  In the project I was in, we defined that on the tag 
     70  itself, and did it explicitly, but this can possibly be 
     71  improved. 
  • qPloneTiles/trunk/skins/qPloneTiles/tiles.js

    r327 r328  
    11// tiles.js 
    22 
    3 var DEBUG = false, styles = ""; 
     3var DEBUG = true, message = ""; 
    44 
    55function getElementsByClassName(className, parentElement) { 
    66    var result = new Array(), 
    7     list = (parentElement || window.document.body).getElementsByTagName('*'); 
     7        list = (parentElement || window.document.body).getElementsByTagName('*'); 
    88    if(list.length == 0) list = (parentElement || window.document.body).all; 
    99    for(var i = 0; i < list.length; i++) { 
    10         if(DEBUG) styles += '\n' + list[i].className; 
     10//        if(DEBUG) message += '\n' + list[i].className; 
    1111        if(list[i].className.match(new RegExp('(^|\\s)' + className + '(\\s|$)'))) result[result.length] = list[i]; 
    1212    } 
     
    1414}; 
    1515 
     16function getNeededHref(a_list) { 
     17    var result, classname_re = new RegExp('(^|\\s)' + 'primary' + '(\\s|$)'); 
     18    if(a_list.length == 0) return false; 
     19    for(var i = 0; i < a_list.length; i++) { 
     20        if(classname_re.exec(a_list[i].className)) return a_list[i].href; 
     21    } 
     22    return a_list[0].href 
     23} 
     24 
    1625function setTiles(){ 
    1726    var tiles_elms = getElementsByClassName("tile", window.document) 
    1827    for(var i = 0; i < tiles_elms.length; i++) { 
    1928        var tiles_a = tiles_elms[i].getElementsByTagName('A'); 
    20         if(tiles_a.length > 0) tiles_elms[i].onclick = function(){ 
    21             location.href = this.getElementsByTagName('A')[0].href 
    22             }; 
    23         if(DEBUG) styles += '\n' + tiles_elms[i].onclick; 
     29        if(tiles_a.length > 0) { 
     30            var Href = getNeededHref(tiles_a); 
     31            if(Href != false) tiles_elms[i].onclick = new Function("window.location = '"+Href+"'; return false;") 
     32            } 
     33        if(DEBUG) message += '\n' + tiles_elms[i].onclick + ' - ' + Href; 
    2434    } 
    25     if(DEBUG) window.alert(styles); 
     35    if(DEBUG) window.alert(message); 
    2636} 
    2737 
  • qPloneTiles/trunk/version.txt

    r327 r328  
    1 0.1.0 
     10.2.0