Advertisement
cgrunwald

Untitled

Jul 27th, 2010
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.44 KB | None | 0 0
  1. <?php defined('SYSPATH') or die('No direct script access.');
  2.  
  3. class Controller_Util extends Controller {
  4.  
  5.     public function action_ui($can_cookie, $width)
  6.     {
  7.         if(!Request::$is_ajax)
  8.             return $this->request->response = 'Error: This is not a valid interface.';
  9.  
  10.         if (((int)$can_cookie != 1)&&((int)$can_cookie != 2))
  11.         if((int)$width <= 0) {
  12.             $this->request->response = 'Error';
  13.             return;
  14.         }
  15.         //!($has_seen = Cookie::get('rvj_ui'))
  16.         Cookie::set('rvj_ui', 'script|' . $width);
  17.         $width = (int) $width;
  18.         if ($width >= 1300) {
  19.             $this->request->response = '';
  20.         }
  21.         elseif (($width > 1065)&&($width < 1300)) {
  22.             $this->request->response = 'var x = 0;;';
  23.         } elseif (($width >= 980) && ($width <= 1064)) {
  24.             $this->request->response = '
  25.             $("#HdLogoText")
  26.                 .add("#HdPacJunt")
  27.                 .each(
  28.                     function() {
  29.                         $(this).animate({left : "20px"}, 600);
  30.                     }
  31.                 );
  32.             $("div.navisection")
  33.                 .each(
  34.                     function(i,el) {
  35.                        
  36.                         var _newWidth = ($("body").width() - ((3 - i) * 128)) + "px";
  37.                         $(this).animate({left : _newWidth}, 600);
  38.                     }
  39.                 );';
  40.         } elseif ($width <= 979) {
  41.             $this->request->response = '
  42.             $(".ico").each(function(){
  43.                  var _height = Math.ceil(parseInt($(this).attr("height")) / 2);
  44.                  var _width = Math.ceil(parseInt($(this).attr("width")) / 2);
  45.                  $(this).animate({ width: _width + "px", height: _height + "px"}, 600, function() {
  46.                     $(this).attr("width", _width).attr("height", _height);
  47.                 });
  48.              });
  49.             $("div.navisection")
  50.                 .each(
  51.                     function(i,el) {
  52.                         var _newWidth = ($("#CenterContainer").outerWidth() - ((2 - i) * 64)) + "px";
  53.                         $(this)
  54.                             .css({width: "64px",height:"64px"})
  55.                             .animate({left : _newWidth}, 600).animate({top : "3px"}, 600);
  56.                     }
  57.                 );
  58.             $("#HdLogoText")
  59.                 .add("#HdPacJunt")
  60.                 .each(
  61.                     function() {
  62.                         $(this)
  63.                             .css({
  64.                                 width: Math.ceil($(this).width() / 2) + "px",
  65.                                 height: Math.ceil($(this).height() / 2) + "px"})
  66.                             .animate({
  67.                                 left : $("#CenterContainer").offset().left + "px",
  68.                                 top : "3px",
  69.                                 marginLeft :  Math.ceil(parseInt($(this).css("margin-left")) / 2) + "px"
  70.                             }, 600);
  71.                     }
  72.                 );
  73.             $("#HdLogo").animate({height : Math.ceil($("#HdLogo").height() / 2) + "px"}, 600);
  74.             Ui.Ratio = 0.5;
  75.             alert("I\'m currently working on making this site accessible to people using 800x600 resolution. Until then, sorry. :/");
  76.             Ui.BindEvents();
  77.             ';
  78.         } else {
  79.             $this->request->response = 'var x = 0;';
  80.         }
  81.     }
  82.  
  83. } // End Welcome
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement