<?xml version="1.0" encoding="UTF-8"?>
<Module>
  <ModulePrefs title="__MSG_title__" 
                directory_title="__MSG_title__" 
                description="__MSG_description__"
                author="D.Pilsner" 
                author_email="dpilsner@tec-it.com" 
                author_location="Austria" 
                author_affiliation="__MSG_affiliation__" 
                height="210" 
                width="250" 
                screenshot="http://hosting.gmodules.com/ig/gadgets/file/105682671337516634136/bc_screenshot.png" 
                thumbnail="http://hosting.gmodules.com/ig/gadgets/file/105682671337516634136/bc_thumbnail.png" 
                title_url="http://www.tec-it.com/" 
                category="tools">
              <Locale messages="http://hosting.gmodules.com/ig/gadgets/file/105682671337516634136/ALL_ALL.xml"/>
              <Locale lang="en" messages="http://hosting.gmodules.com/ig/gadgets/file/105682671337516634136/ALL_ALL.xml"/>
              <Locale lang="de" messages="http://hosting.gmodules.com/ig/gadgets/file/105682671337516634136/de_ALL.xml"/>
              <Locale lang="es" />
              <Locale lang="zh" />
              <Require feature="dynamic-height"/>
              <optional feature="shareable-prefs"/>
  </ModulePrefs>

  <UserPref 
     name="showbc" 
     display_name="Show Barcode" 
     datatype="bool" 
     default_value="false"
   />

  <UserPref name="bccode" 
     display_name="Barcode Type" 
     default_value="MobileQRUrl" 
     datatype="enum" >
      <EnumValue value="MobileQRPhone" />
      <EnumValue value="MobileQRSMS" />
      <EnumValue value="MobileQRUrl" />
      <EnumValue value="MobileSemaPhone" />
      <EnumValue value="MobileSemaSMS" />
      <EnumValue value="MobileSemaUrl" />
  </UserPref> 

  <UserPref name="bcdata" 
     display_name="Data" 
     default_value="http://www.tec-it.com" 
   />

 <Content type="html">
 <![CDATA[
 <style type="text/css">
  table, 
  input, 
  select, 
  div       { font:9pt Arial; }
  a         { color:gray;
              text-decoration:none;
              font:8pt Courier New;}
 </style>
  
 <script type="text/javascript">

 // initialize image
 function init() {
  var prefs = new _IG_Prefs();

  if (prefs.getBool('showbc') == true) {
   bccreate(prefs.getString("bccode"),prefs.getString("bcdata"));
   _gel("settings").style.display = "none";
  } 
  else 
   generate();
 }

// create image 
function bccreate(code, data) {
 
  _gel("image").src = "http://www.tec-it.com/online-demos/tbarcode/barcode.aspx" 
         + "?code=" + code
         + "&amp;data=" + encodeURI(data) 
         + "&amp;dpi=96&amp;modulewidth=fit";
}
  
// generate
function generate() {
  bccreate(_gel("code").options[_gel("code").selectedIndex].value,_gel("data").value);
}

// preselects the value
function getvalue() {
 var c = _gel("code");
 var d = _gel("data");
 if ( c.selectedIndex == 0 || c.selectedIndex == 3) 
   d.value = "0043(7252)72720";
 else if ( c.selectedIndex == 1 || c.selectedIndex == 4) 
   d.value = "0043(699)10053283:text";
 else if ( c.selectedIndex == 2 || c.selectedIndex == 5) 
   d.value = "http://www.tec-it.com";

generate();
}
  
_IG_RegisterOnloadHandler(init);

</script>
<center>
 <img id="image" src="" />
 <table id="settings">
   <tr>
     <td>__MSG_barcodelabel__:</td>
     <td>
         <select id="code" onchange="getvalue()">
          <option value="MobileQRPhone">__MSG_qrcodephonenumber__</option>
          <option value="MobileQRSMS">__MSG_qrcodesms__</option>
          <option value="MobileQRUrl" selected="selected">__MSG_qrcodeurl__</option>
          <option value="MobileSemaPhone">__MSG_semacodephonenumber__</option>
          <option value="MobileSemaSMS">__MSG_semasms__</option>
          <option value="MobileSemaUrl">__MSG_semaurl__</option>
        </select>
     </td>
    </tr>
   <tr>
     <td>__MSG_datalabel__:</td>
     <td>
       <input type="text" onkeyup="generate()" value="http://www.tec-it.com" id="data"/>
     </td>
   </tr>
 </table>

 <p>
  <a href="http://www.tec-it.com/" target="blank">__MSG_footer__</a>
 </p>
 </center>
 ]]>
 </Content>
</Module>

