Assembla home | Assembla project page
 

Changeset 127

Show
Ignore:
Timestamp:
07/20/07 11:51:44 (1 year ago)
Author:
digitalspaghetti
Message:

Created Full Plugin for Accessiblity

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branch/views/elements/js_include.ctp

    r125 r127  
    1515<?php e($javascript->link('jquery.tabs'));?> 
    1616<?php e($javascript->link('jquery.history_remote.pack'));?> 
    17 <?php e($javascript->link('jquery.textsizer'));?> 
     17<?php e($javascript->link('jquery.ability'));?> 
    1818<!-- WymEditor JavaScript--> 
    1919<?php e($javascript->link('wymeditor/jquery.wymeditor'));?> 
  • branch/views/layouts/default.ctp

    r125 r127  
    99        <link rel="icon" href="<?php echo $this->webroot;?>favicon.ico" type="image/x-icon" /> 
    1010        <link rel="shortcut icon" href="<?php echo $this->webroot;?>favicon.ico" type="image/x-icon" /> 
    11         <?php echo $html->css('reset-fonts-grids');?> 
     11        <?php echo $html->css('high-contrast');?> 
    1212        <?php echo $html->css('default');?> 
    13         <?php echo $html->css('thickbox');?> 
    14         <?php echo $html->css('jquery.autocomplete');?> 
    15         <?php echo $html->css('jdMenu');?> 
    16         <?php echo $html->css('jdMenu.slate');?> 
    17         <?php echo $html->css('jquery.tabs');?> 
    18         <?php echo $html->css('jquery.tabs.ie');?> 
    19         <?php echo $html->css('../js/wymeditor/skins/default/screen');?> 
    2013        <?php e($this->element('js_include'));?> 
    2114         
    2215</head> 
    23 <body class="jamal"
     16<body
    2417        <div id="doc3" class="yui-t7"> 
    2518                <div id="hd"> 
  • branch/webroot/css/default.css

    r121 r127  
     1@import url('reset-fonts-grids.css'); 
     2@import url('jdMenu.css'); 
     3@import url('jdMenu.slate.css'); 
     4@import url('jquery.ability.css'); 
     5@import url('jquery.autocomplete.css'); 
     6@import url('jquery.tabs.css'); 
     7@import url('jquery.tabs-ie.css'); 
     8@import url('thickbox.css'); 
     9@import url('../js/wymeditor/skins/default/screen.css'); 
     10 
    111/* Layout Code */ 
    2 body { 
     12body, body.m { 
     13        font: 76% "Lucida Grande", Verdana, sans-serif; 
    314    background: #36393B /*url('../img/bg.png') repeat-x*/; 
    415    color:#fff; 
    516} 
     17 
     18body.l {font-size: 90%; } 
     19body.xl {font-size: 110%; } 
     20body.xxl {font-size: 130%; } 
     21 
    622a {color:#EEE6AB; text-decoration:none;} 
    723div#hd { 
  • branch/webroot/js/jquery.ability.js

    r125 r127  
    1 /** 
    2  * @author digitalspaghetti 
     1/* jQuery Accessibility Plugin (ability) - A jQuery plugin to provide accessibility functions 
     2 * Author: Tane Piper (digitalspaghetti@gmail.com)  
     3 * Website: http://code.google.com/p/ability/ 
     4 * Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php 
     5 *  
     6 * === Changelog === 
     7 * Version 1.0 (20/07/2007) 
     8 * Initial version. 
     9 * Modifies text size to one of 4 CSS styles 
     10 * Change page Style 
     11 * Reset function 
    312 */ 
    413(function($) { 
    5         function textsize( trgt,inc ) { 
    6                         if (!document.getElementById) return 
    7                         var d = document,cEl = null,sz = startSz,i,j,cTags; 
    814         
    9                         sz = inc; 
    10                         if ( sz < 0 ) sz = 0; 
    11                         if ( sz > 6 ) sz = 6; 
    12                         startSz = sz; 
     15        function switchStyleSheet(stylename, settings) { 
     16                $('link[@rel*=stylesheet]').each(function(){ 
     17                        this.disabled = true; 
     18                        if (jQuery(this).attr('href') == settings.styledir + stylename) this.disabled = false; 
     19                         
     20                        if (settings.savecookie == true){ 
     21                                jQuery.cookie('style', stylename, 365); 
     22                        } 
     23                }); 
     24        } 
     25         
     26        function switchTextSize(size, settings) { 
     27                jQuery('body').removeClass().addClass(size); 
     28                if (settings.savecookie == true){ 
     29                        jQuery.cookie('textsize', size, 365); 
     30                } 
     31        } 
     32         
     33        function reset(settings) { 
    1334                 
    14                         if ( !( cEl = d.getElementById( trgt ) ) ) cEl = d.getElementsByTagName( trgt )[ 0 ]; 
    15  
    16                         cEl.style.fontSize = szs[ sz ]; 
    17  
    18                         for ( i = 0 ; i < tgs.length ; i++ ) { 
    19                                 cTags = cEl.getElementsByTagName( tgs[ i ] ); 
    20                                 for ( j = 0 ; j < cTags.length ; j++ ) cTags[ j ].style.fontSize = szs[ sz ]; 
    21                         } 
     35                if (settings.textsizer == true) { 
     36                        jQuery('body').removeClass(); 
     37                        jQuery.cookie('textsize', null, {expires: -1}); 
    2238                } 
     39                 
     40                if (settings.switcher == true) { 
     41                        switchStyleSheet(settings.defaultcss, settings); 
     42                        jQuery.cookie('style', null, {expires: -1}); 
     43                } 
     44        } 
     45         
    2346        $.fn.extend({ 
    24         /* textsize: function(settings) 
     47        /* ability: function(settings) 
    2548         * The constructor method 
    26          * Example: $().textsize(); 
     49         * Example: $().ability(); 
    2750         */ 
    28                 textsize: function(settings) { 
     51                ability: function(settings) { 
    2952                        var version = "0.1"; 
    3053                        /* Default Settings*/    
    3154                        settings = jQuery.extend({ 
    32                                 tags: ['div', 'td', 'tr', 'h3', 'h4'], 
    33                                 sizes: ['0.8','0.9','0.95','1.1'], 
    34                                 sizetype: 'em', 
    35                                 defaultsize: '0.95' 
     55                                textsizer: true, 
     56                                textsizeclasses: ['m', 'l', 'xl', 'xxl'], 
     57                                switcher: true, 
     58                                switcherstyles: ['default.css', 'high-contrast.css'], 
     59                                styledir: "/css/", 
     60                                savecookie: true, 
     61                                defaultcss: 'default.css' 
    3662                        },settings); 
    3763                 
    3864                        return this.each(function(){ 
    3965                                controlbox = this; 
    40                                 $j(controlbox).html('Text Size<br /><ul><li>A</li><li>A</li><li>A</li><li>A</li></ul>', function(){ 
    41                                         $j(controlbox + ' > ul').attr('id', 'size-buttons'); 
     66                                 
     67                                var output = '<div class="ability">'; 
     68                                var breakline = '<br style="clear:both;" />'; 
     69                                 
     70                                var curstyle = jQuery.cookie('style'); 
     71                                var curtextsize = jQuery.cookie('textsize'); 
     72                                 
     73                                if (settings.textsizer == true) { 
     74                                        if (curtextsize) { jQuery('body').removeClass().addClass(curtextsize); } 
     75                                        var textsizer = '<ul class="fontsize">'; 
     76                                        for (var i=0, len = settings.textsizeclasses.length; i < len; i++) { 
     77                                                textsizer += '<li><a href="#" rel="' + settings.textsizeclasses[i] + '">' + settings.textsizeclasses[i].toUpperCase() + '</a></li>' 
     78                                        } 
     79                                        textsizer += '</ul>'; 
     80                                        output += textsizer + breakline; 
     81                                } 
     82                                 
     83                                if (settings.switcher == true) { 
     84                                        if (curstyle) { switchStyleSheet(curstyle, settings); } 
     85                                        var switcher = '<ul class="switcher">'; 
     86                                        for (var i=0, len = settings.switcherstyles.length; i < len; i++) { 
     87                                                var brokenstring=settings.switcherstyles[i].split("."); 
     88                                                switcher += '<li><a href="#" rel="' + settings.switcherstyles[i] + '">' + brokenstring[0].toUpperCase() + '</a></li>' 
     89                                        } 
     90                                        switcher += '</ul>'; 
     91                                        output += switcher + breakline 
     92                                } 
     93                                output += '<a href="#" class="reset">Reset</a></div>'; 
     94                                 
     95                                jQuery(controlbox).html(output); 
     96                                 
     97                                jQuery('ul.fontsize li a').bind('click', function(){ 
     98                                                switchTextSize(jQuery(this).attr('rel'), settings); 
     99                                                return false; 
    42100                                }); 
     101                                jQuery('ul.switcher li a').bind('click', function(){ 
     102                                        switchStyleSheet(jQuery(this).attr('rel'), settings); 
     103                                        return false; 
     104                                }); 
     105                                jQuery('a.reset').bind('click', function(){ 
     106                                        reset(settings); 
     107                                        return false; 
     108                                }); 
     109                                 
    43110                        }); 
    44111                } 
  • branch/webroot/js/webrocket.js

    r125 r127  
    5858        $j('form#ImageAddForm').ajaxForm({success: showResponse}); 
    5959         
    60         $j('#accessibility').textsize(); 
     60        $j('#accessibility').ability(); 
    6161         
    6262        function showResponse(){