Changeset 549


Ignore:
Timestamp:
08/10/06 21:19:48 (13 years ago)
Author:
mokhet
Message:

warn the user when run locally. see ticket #415

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/htmlarea.js

    r547 r549  
    7979HTMLArea.is_win_ie = (HTMLArea.is_ie && !HTMLArea.is_mac); 
    8080HTMLArea.is_gecko  = (navigator.product == "Gecko"); 
     81HTMLArea.isRunLocally = document.URL.toLowerCase().search(/^file:/) != -1; 
     82if ( HTMLArea.isRunLocally ) 
     83{ 
     84  alert('Xinha *must* be installed on a web server. Locally opened files (those that use the "file://" protocol) cannot properly function. Xinha will try to initialize but may not be correctly loaded.'); 
     85} 
    8186 
    8287// Creates a new HTMLArea object.  Tries to replace the textarea with the given 
     
    61426147    if ( req.readyState == 4 ) 
    61436148    { 
    6144       if ( req.status == 200 ) 
     6149      if ( req.status == 200 || HTMLArea.isRunLocally && req.status == 0 ) 
    61456150      { 
    61466151        if ( typeof handler == 'function' ) 
     
    61806185    if ( req.readyState == 4 ) 
    61816186    { 
    6182       if ( req.status == 200 ) 
     6187      if ( req.status == 200 || HTMLArea.isRunLocally && req.status == 0 ) 
    61836188      { 
    61846189        handler(req.responseText, req); 
     
    62116216  req.open('GET', url, false); 
    62126217  req.send(null); 
    6213   if ( req.status == 200 ) 
     6218  if ( req.status == 200 || HTMLArea.isRunLocally && req.status == 0 ) 
    62146219  { 
    62156220    return req.responseText; 
Note: See TracChangeset for help on using the changeset viewer.