Changeset 127
- Timestamp:
- 07/20/07 11:51:44 (1 year ago)
- Files:
-
- branch/views/elements/js_include.ctp (modified) (1 diff)
- branch/views/layouts/default.ctp (modified) (1 diff)
- branch/webroot/css/default.css (modified) (1 diff)
- branch/webroot/css/high-contrast.css (added)
- branch/webroot/css/jquery.ability.css (added)
- branch/webroot/js/jquery.ability.js (moved) (moved from branch/webroot/js/jquery.textsizer.js) (1 diff)
- branch/webroot/js/webrocket.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branch/views/elements/js_include.ctp
r125 r127 15 15 <?php e($javascript->link('jquery.tabs'));?> 16 16 <?php e($javascript->link('jquery.history_remote.pack'));?> 17 <?php e($javascript->link('jquery. textsizer'));?>17 <?php e($javascript->link('jquery.ability'));?> 18 18 <!-- WymEditor JavaScript--> 19 19 <?php e($javascript->link('wymeditor/jquery.wymeditor'));?> branch/views/layouts/default.ctp
r125 r127 9 9 <link rel="icon" href="<?php echo $this->webroot;?>favicon.ico" type="image/x-icon" /> 10 10 <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');?> 12 12 <?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');?>20 13 <?php e($this->element('js_include'));?> 21 14 22 15 </head> 23 <body class="jamal">16 <body> 24 17 <div id="doc3" class="yui-t7"> 25 18 <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 1 11 /* Layout Code */ 2 body { 12 body, body.m { 13 font: 76% "Lucida Grande", Verdana, sans-serif; 3 14 background: #36393B /*url('../img/bg.png') repeat-x*/; 4 15 color:#fff; 5 16 } 17 18 body.l {font-size: 90%; } 19 body.xl {font-size: 110%; } 20 body.xxl {font-size: 130%; } 21 6 22 a {color:#EEE6AB; text-decoration:none;} 7 23 div#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 3 12 */ 4 13 (function($) { 5 function textsize( trgt,inc ) {6 if (!document.getElementById) return7 var d = document,cEl = null,sz = startSz,i,j,cTags;8 14 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) { 13 34 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}); 22 38 } 39 40 if (settings.switcher == true) { 41 switchStyleSheet(settings.defaultcss, settings); 42 jQuery.cookie('style', null, {expires: -1}); 43 } 44 } 45 23 46 $.fn.extend({ 24 /* textsize: function(settings)47 /* ability: function(settings) 25 48 * The constructor method 26 * Example: $(). textsize();49 * Example: $().ability(); 27 50 */ 28 textsize: function(settings) {51 ability: function(settings) { 29 52 var version = "0.1"; 30 53 /* Default Settings*/ 31 54 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' 36 62 },settings); 37 63 38 64 return this.each(function(){ 39 65 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; 42 100 }); 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 43 110 }); 44 111 } branch/webroot/js/webrocket.js
r125 r127 58 58 $j('form#ImageAddForm').ajaxForm({success: showResponse}); 59 59 60 $j('#accessibility'). textsize();60 $j('#accessibility').ability(); 61 61 62 62 function showResponse(){