Changeset 734 for trunk/modules


Ignore:
Timestamp:
02/13/07 16:43:06 (13 years ago)
Author:
htanaka
Message:

fix #950 all terms in ContextMenu? will be translated even if baseHref is specified.

  • _editor_url might be converted as absolute if it is relative.
  • _resolveRelativeUrl function was moved from insert_image.html to Xinha core class.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/modules/InsertImage/insert_image.html

    r733 r734  
    1414function i18n(str) { 
    1515  return (Xinha._lc(str, 'Xinha')); 
    16 } 
    17  
    18 function resolveRelativeUrl(base, url){ 
    19         if(url.match(/^([^:]+\:)?\//)){ 
    20                 return url; 
    21         } 
    22         else{ 
    23                 var b = base.split("/"); 
    24                 if(b[b.length - 1] == ""){ 
    25                         b.pop(); 
    26                 } 
    27                 var p = url.split("/"); 
    28                 if(p[0] == "."){ 
    29                         p.shift(); 
    30                 } 
    31                 while(p[0] == ".."){ 
    32                         b.pop(); 
    33                         p.shift(); 
    34                 } 
    35                 return b.join("/") + "/" + p.join("/"); 
    36         } 
    3716} 
    3817 
     
    5433  document.getElementById("f_horiz").value  = (typeof param["f_horiz"]!="undefined") ? param["f_horiz"] : ""; 
    5534  if (param["f_url"]) { 
    56       window.ipreview.location.replace(resolveRelativeUrl(param.f_base, param.f_url)); 
     35      window.ipreview.location.replace(Xinha._resolveRelativeUrl(param.f_base, param.f_url)); 
    5736  } 
    5837  document.getElementById("f_url").focus(); 
     
    9877    return false; 
    9978  } 
    100   window.ipreview.location.replace(resolveRelativeUrl(base, url)); 
     79  window.ipreview.location.replace(Xinha._resolveRelativeUrl(base, url)); 
    10180  return false; 
    10281} 
Note: See TracChangeset for help on using the changeset viewer.