Ignore:
Timestamp:
09/25/08 22:57:10 (12 years ago)
Author:
nicholasbs
Message:

Applied AbbreviationPlugin?.patch from #1176 with some general code cleanup

File:
1 copied

Legend:

Unmodified
Added
Removed
  • branches/new-dialogs/plugins/Abbreviation/dialog.html

    r1036 r1037  
    1 <html> 
    2 <head> 
    3   <title>Abbreviation</title> 
    4   <link rel="stylesheet" type="text/css" href="../../../popups/popup.css" /> 
    5   <script type="text/javascript" src="../../../popups/popup.js"></script> 
     1<h1 id="[h1]"><l10n>Abbreviation</l10n></h1> 
    62 
    7 <script type="text/javascript"> 
    8 var Abbreviation = window.opener.Abbreviation; // load the Abbreviation plugin and lang file ;-) 
     3<form name="form" action="" method="get" id="[inputs]"> 
     4  <fieldset> 
     5    <legend><l10n>Expansion:</l10n></legend> 
     6    <input type="text" id="[title]" name="[title]" size="35" /> 
     7 </fieldset> 
     8<p /> 
    99 
    10 function fillSelect(text) { 
    11   var abbr = window.location.href; 
    12   abbr = abbr.replace(/popups\/abbreviation.html/g, "abbr\/" + window.opener._editor_lang + ".js"); 
    13   var abbrData = Xinha._geturlcontent(abbr); 
    14   if (abbrData) { 
    15     eval('abbrObj = ' + abbrData); 
    16     if (abbrObj != "") { 
    17       dest = document.getElementById("select"); 
    18       for (var i in abbrObj) { 
    19         same = (i==text); 
    20         dest.options[dest.options.length] = new Option(i + "=" + abbrObj[i], abbrObj[i], false, same); 
    21         if (same) 
    22         document.getElementById("title").value = abbrObj[i]; 
    23       } 
    24     } 
    25   } 
    26 } 
    27  
    28 function Init() { 
    29   __dlg_translate("Abbreviation"); 
    30   __dlg_init(null,{width: 260, height: 160}); 
    31   var param = window.dialogArguments; 
    32   var text = null; 
    33   if (param) { 
    34     text = param["text"]; 
    35     document.getElementById("title").value = param["title"]; 
    36   } 
    37   fillSelect(text); 
    38   document.getElementById("title").focus(); 
    39 }; 
    40  
    41 function onOK() { 
    42   var param = new Object(); 
    43   param["title"] = document.getElementById("title").value; 
    44   __dlg_close(param); 
    45   return false; 
    46 } 
    47  
    48  
    49 function onDelete() { 
    50   // pass data back to the calling window 
    51   var param = new Object(); 
    52   param["title"] = ""; 
    53   __dlg_close(param); 
    54   return false; 
    55 }; 
    56  
    57 function onCancel() { 
    58   __dlg_close(null); 
    59   return false; 
    60 }; 
    61 </script> 
    62  
    63 </head> 
    64 <body class="dialog" onload="Init()"> 
    65 <div class="title">Abbreviation</div> 
    66 <form name="form" action=""> 
    67 <table border="0" style="width: 100%;"> 
    68   <tr> 
    69     <td class="lable">Expansion:</td> 
    70     <td> 
    71     <select id="select" name="select" 
    72             onChange="document.form.title.value=document.form.select.options[document.form.select.selectedIndex].value" 
    73             style="position:absolute; top:35px; left:100px; width:118px; clip:rect(0 120 22 100)"> 
    74       <option value=""></option> 
    75  
    76     </select> 
    77     <input type="text" id="title" name="title" 
    78            onChange="document.form.select.selectedIndex=-1" 
    79            style="position:absolute; top:35px; left:100px; width:100px; border-right:0"> 
    80     <!--<input type="text" id="title" name="title" value="" size="30">--> 
    81     </td> 
    82   </tr> 
    83 </table> 
    84  
    85 <div id="buttons"> 
    86    <button type="submit" name="ok" onclick="return onOK();">OK</button> 
    87    <button type="button" name="delete" onclick="return onDelete();">Delete</button> 
    88    <button type="button" name="cancel" onclick="return onCancel();">Cancel</button> 
     10<div class="buttons" id="[buttons]"> 
     11  <input type="button" id="[ok]"     value="_(OK)"     /> 
     12  <input type="button" id="[delete]" value="_(Delete)" /> 
     13  <input type="button" id="[cancel]" value="_(Cancel)" /> 
    8914</div> 
    9015</form> 
    91 </body> 
    92 </html> 
     16 
Note: See TracChangeset for help on using the changeset viewer.