Changeset 133
- Timestamp:
- 07/21/07 18:59:46 (1 year ago)
- Files:
-
- branch/app_model.php (modified) (1 diff)
- branch/controllers/themes_controller.php (added)
- branch/models/theme.php (added)
- branch/models/user.php (modified) (1 diff)
- branch/tests/cases/controllers/themes_controller.test.php (added)
- branch/tests/cases/models/theme.test.php (added)
- branch/views/layouts/default.ctp (modified) (1 diff)
- branch/views/themes (added)
- branch/views/themes/add.ctp (added)
- branch/views/themes/admin_add.ctp (added)
- branch/views/themes/admin_edit.ctp (added)
- branch/views/themes/admin_index.ctp (added)
- branch/views/themes/admin_view.ctp (added)
- branch/views/themes/edit.ctp (added)
- branch/views/themes/index.ctp (added)
- branch/views/themes/view.ctp (added)
- branch/webroot/css/aqua.css (added)
- branch/webroot/css/default.css (modified) (2 diffs)
- branch/webroot/css/jquery.ability.css (modified) (1 diff)
- branch/webroot/js/jquery.ability.js (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branch/app_model.php
r118 r133 297 297 $this->$this->name->savefield('published', 0); 298 298 } 299 300 function usertheme() 301 { 302 303 } 299 304 } 300 305 ?> branch/models/user.php
r118 r133 28 28 var $hasOne = array( 29 29 'Profile' => array('className' => 'Profile'), 30 'Theme' => array('className' => 'Theme'), 30 31 ); 31 32 branch/views/layouts/default.ctp
r128 r133 10 10 <link rel="shortcut icon" href="<?php echo $this->webroot;?>favicon.ico" type="image/x-icon" /> 11 11 <?php echo $html->css('high-contrast');?> 12 <?php echo $html->css('aqua');?> 12 13 <?php echo $html->css('default');?> 13 14 <?php e($this->element('js_include'));?> branch/webroot/css/default.css
r127 r133 10 10 11 11 /* Layout Code */ 12 body , body.m{12 body { 13 13 font: 76% "Lucida Grande", Verdana, sans-serif; 14 14 background: #36393B /*url('../img/bg.png') repeat-x*/; … … 16 16 } 17 17 18 body.l {font-size: 90%; } 19 body.xl {font-size: 110%; } 20 body.xxl {font-size: 130%; } 18 .m { font-size: 76%; } 19 .l {font-size: 90%; } 20 .xl {font-size: 110%; } 21 .xxl {font-size: 130%; } 21 22 22 23 a {color:#EEE6AB; text-decoration:none;} branch/webroot/css/jquery.ability.css
r127 r133 7 7 float:left; 8 8 margin-right:10px; 9 border: 2px solid #fff;10 9 padding: 2px; 11 10 text-align:center; 12 background: #000; 11 text-decoration: none; 12 vertical-align:middle; 13 13 } 14 15 ul.fontsize li:hover, ul.switcher li:hover { 16 color:#ccc; 17 border-bottom:2px solid #ccc; 18 } 19 20 ul.fontsize li a, ul.switcher li a { 21 font: 80% "Agency FB"; 22 } 23 24 ul.fontsize li a.selected, ul.switcher li a.selected { 25 font-weight:bold; 26 text-decoration:underline; 27 } branch/webroot/js/jquery.ability.js
r127 r133 13 13 (function($) { 14 14 15 function switchStyleSheet(stylename, settings ) {15 function switchStyleSheet(stylename, settings, button) { 16 16 $('link[@rel*=stylesheet]').each(function(){ 17 17 this.disabled = true; 18 if (jQuery(this).attr('href') == settings.styledir + stylename) this.disabled = false; 18 if (jQuery(this).attr('href') == settings.styledir + stylename) 19 { 20 this.disabled = false; 21 jQuery('ul.switcher li a.selected').removeClass(); 22 jQuery(button).removeClass().addClass("selected"); 23 } 19 24 20 25 if (settings.savecookie == true){ … … 24 29 } 25 30 26 function switchTextSize(size, settings ) {31 function switchTextSize(size, settings, button) { 27 32 jQuery('body').removeClass().addClass(size); 33 jQuery('ul.fontsize li a.selected').removeClass(); 34 jQuery(button).removeClass().addClass("selected"); 28 35 if (settings.savecookie == true){ 29 36 jQuery.cookie('textsize', size, 365); … … 35 42 if (settings.textsizer == true) { 36 43 jQuery('body').removeClass(); 44 jQuery('ul.fontsize li a.selected').removeClass(); 37 45 jQuery.cookie('textsize', null, {expires: -1}); 38 46 } … … 40 48 if (settings.switcher == true) { 41 49 switchStyleSheet(settings.defaultcss, settings); 50 jQuery('ul.switcher li a.selected').removeClass(); 42 51 jQuery.cookie('style', null, {expires: -1}); 43 52 } … … 56 65 textsizeclasses: ['m', 'l', 'xl', 'xxl'], 57 66 switcher: true, 58 switcherstyles: ['default.css', ' high-contrast.css'],67 switcherstyles: ['default.css', 'aqua.css' ,'high-contrast.css'], 59 68 styledir: "/css/", 60 69 savecookie: true, … … 73 82 if (settings.textsizer == true) { 74 83 if (curtextsize) { jQuery('body').removeClass().addClass(curtextsize); } 75 var textsizer = '<ul class="fontsize"> ';84 var textsizer = '<ul class="fontsize"><li>Text Size:</li>'; 76 85 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>'86 textsizer += '<li><a href="#" class="btn-' + settings.textsizeclasses[i] + '" rel="' + settings.textsizeclasses[i] + '">' + settings.textsizeclasses[i].toUpperCase() + '</a></li>' 78 87 } 79 88 textsizer += '</ul>'; … … 83 92 if (settings.switcher == true) { 84 93 if (curstyle) { switchStyleSheet(curstyle, settings); } 85 var switcher = '<ul class="switcher"> ';94 var switcher = '<ul class="switcher"><li>Style Sheet:</li>'; 86 95 for (var i=0, len = settings.switcherstyles.length; i < len; i++) { 87 96 var brokenstring=settings.switcherstyles[i].split("."); … … 96 105 97 106 jQuery('ul.fontsize li a').bind('click', function(){ 98 switchTextSize(jQuery(this).attr('rel'), settings );107 switchTextSize(jQuery(this).attr('rel'), settings, this); 99 108 return false; 100 109 }); 101 110 jQuery('ul.switcher li a').bind('click', function(){ 102 switchStyleSheet(jQuery(this).attr('rel'), settings );111 switchStyleSheet(jQuery(this).attr('rel'), settings, this); 103 112 return false; 104 113 });