Changeset 951


Ignore:
Timestamp:
01/27/08 23:13:50 (12 years ago)
Author:
ray
Message:
  • one more attempt to properly fix #1136
  • added compression script for yui_compressor (though not going to use it)
  • removed some evitable uses of eval()
  • removed alerts for very old Geckos, because the seem to fire with recent versions of Safari
Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Xinha.css

    r944 r951  
    7171.htmlarea .toolbar select:hover, 
    7272.htmlarea .toolbar select:active {  
    73  /* These settings don't work with Firefox 3 Linux 
    74   margin-top: 2px; 
    75   margin-bottom: 1px; 
    76   height: 17px; 
    77 */ 
     73  position:relative; 
     74  top:-2px; 
     75  margin-bottom:-2px; 
    7876  color: ButtonText; 
    7977} 
  • trunk/XinhaCore.js

    r949 r951  
    178178Xinha.checkSupportedBrowser = function() 
    179179{ 
    180   if ( Xinha.is_gecko ) 
    181   { 
    182     if ( navigator.productSub < 20021201 ) 
    183     { 
    184       alert("You need at least Mozilla-1.3 Alpha.\nSorry, your Gecko is not supported."); 
    185       return false; 
    186     } 
    187     if ( navigator.productSub < 20030210 ) 
    188     { 
    189       alert("Mozilla < 1.3 Beta is not supported!\nI'll try, though, but it might not work."); 
    190     } 
    191   } 
    192180  if ( Xinha.is_opera ) 
    193181  { 
     
    476464Xinha.Config = function() 
    477465{ 
    478   var cfg = this; 
    479466  this.version = Xinha.version.Revision; 
    480467   
     
    32123199  var plugin = arguments[0]; 
    32133200 
    3214   // @todo : try to avoid the use of eval() 
    32153201  // We can only register plugins that have been succesfully loaded 
    3216   if ( plugin === null || typeof plugin == 'undefined' || (typeof plugin == 'string' && eval('typeof ' + plugin) == 'undefined') ) 
     3202  if ( plugin === null || typeof plugin == 'undefined' || (typeof plugin == 'string' && typeof window[plugin] == 'undefined') ) 
    32173203  { 
    32183204    return false; 
     
    32343220Xinha.prototype.registerPlugin2 = function(plugin, args) 
    32353221{ 
    3236   // @todo : try to avoid the use of eval() 
    3237   if ( typeof plugin == "string" ) 
    3238   { 
    3239     plugin = eval(plugin); 
     3222  if ( typeof plugin == "string" && typeof window[plugin] == 'function' ) 
     3223  { 
     3224    plugin = window[plugin]; 
    32403225  } 
    32413226  if ( typeof plugin == "undefined" ) 
     
    32873272   
    32883273  Xinha.setLoadingMessage (Xinha._lc("Loading plugin $plugin="+pluginName+"$")); 
    3289   // @todo : try to avoid the use of eval() 
     3274 
    32903275  // Might already be loaded 
    3291   //if ( eval('typeof ' + pluginName) != 'undefined' ) 
    3292   // @todo: try if this works to avoid the use of eval, I've been never getting here when testing 
    32933276  if ( typeof window['pluginName'] != 'undefined' ) 
    32943277  { 
  • trunk/contrib/compress.php

    r905 r951  
    11<? 
    22die("Run this script to batch-compress the current Xinha snapshot. To run the script, open the file and comment out the die() command"); 
    3  
     3$repository_url = 'http://svn.xinha.webfactional.com/trunk'; 
     4$version =''; 
     5$date = date('r'); 
    46error_reporting(E_ALL); 
    57ini_set('show_errors',1); 
    68 
    79$return = array(); 
    8 function scan($dir, $durl = '',$min_size="3000") 
     10function scan($dir, $durl = '',$min_size="0") 
    911{ 
    1012        static $seen = array(); 
     
    4850scan("../"); 
    4951$cwd = getcwd(); 
     52 
     53$root_dir = realpath($cwd.'/..'); 
     54 
    5055print "Processing ".count($return)." files<br />"; 
    5156 
    52 $prefix = "/* This compressed file is part of Xinha. For uncomressed sources, forum, and bug reports, go to xinha.org */"; 
     57$prefix = "/* This compressed file is part of Xinha. For uncompressed sources, forum, and bug reports, go to xinha.org */"; 
     58if ($version) $prefix .= "\n/* This file is part of version $version released $date */"; 
     59 
    5360$core_prefix = ' 
    5461  /*-------------------------------------------------------------------------- 
     
    5865    --  BSD license)  please read license.txt in this package for details. 
    5966    -- 
    60     --  Copyright (c) 2005-2007 Xinha Developer Team and contributors 
     67    --  Copyright (c) 2005-2008 Xinha Developer Team and contributors 
    6168    --   
    6269    --  Xinha was originally based on work by Mihai Bazon which is: 
     
    7178        print "Processed $file<br />"; 
    7279        flush(); 
     80        $file_url = $repository_url.str_replace($root_dir,'',$file); 
     81 
    7382        copy($file,$file."_uncompr.js"); 
    74  
    75         exec("echo \"".(preg_match('/XinhaCore.js$/',$file) ? $prefix.$core_prefix : $prefix)."\" > $file && java -jar ${cwd}/dojo_js_compressor.jar -c ${file}_uncompr.js >> $file 2>&1"); 
     83         
     84        $file_prefix = $prefix."\n/* The URL of the most recent version of this file is $file_url */"; 
     85         
     86        exec("echo \"".(preg_match('/XinhaCore.js$/',$file) ? $file_prefix.$core_prefix : $file_prefix)."\" > $file && java -jar ${cwd}/dojo_js_compressor.jar -c ${file}_uncompr.js >> $file 2>&1"); 
    7687        if (preg_match('/js: ".*?", line \d+:/',file_get_contents($file))) 
    7788        { 
     
    8394                unlink($file."_uncompr.js"); 
    8495        } 
     96 
    8597} 
    8698print "Operation complete." 
Note: See TracChangeset for help on using the changeset viewer.