home *** CD-ROM | disk | FTP | other *** search
/ Freelog 117 / FreelogNo117-OctobreNovembre2013.iso / Theme / 8GadgetPack / 8GadgetPackSetup.msi / Gadgets.7z / Gadgets / MyWeather.gadget / js / settings.js < prev   
Text File  |  2011-07-30  |  16KB  |  289 lines

  1. function loading(){
  2.  
  3. // text color
  4. var tari = "";
  5. var txtcolor_var = "";
  6.     txtcolor_var = System.Gadget.Settings.read("txtcolor");
  7. if(txtcolor_var == '1')
  8. {
  9. tari  = "<div id='txtcolor1'><div id='txtC1'><input type='radio' name='txtcolor' onclick='txtcolory(\"1\");' value='1' checked></div><div id='txtC2'><img src='img/txtC1.png'></div>";
  10. tari += "<div id='txtC3'><input type='radio' name='txtcolor' onclick='txtcolory(\"2\");' value='2'></div><div id='txtC4'><img src='img/txtC2.png'></div></div>";
  11. }else{
  12. tari  = "<div id='txtcolor1'><div id='txtC1'><input type='radio' name='txtcolor' onclick='txtcolory(\"1\");' value='1'></div><div id='txtC2'><img src='img/txtC1.png'></div>";
  13. tari += "<div id='txtC3'><input type='radio' name='txtcolor' onclick='txtcolory(\"2\");' value='2' checked></div><div id='txtC4'><img src='img/txtC2.png'></div></div>";
  14. }   
  15. // text color
  16.  
  17.  
  18.  
  19. var tar = "";
  20. var userAgenty_var = "";
  21.     userAgenty_var = System.Gadget.Settings.read("userAgenty");
  22.     //confirm(userAgenty_var);
  23.  
  24. var win = System.Gadget.Settings.read("win"); 
  25. if(win == 'vista'){
  26. if(userAgenty_var == false)
  27. {
  28. tar="<div id='userAgenty1'><div id='userA1'><input type='checkbox' name='userAgenty' id='userAgenty' value='0'></div><div id='userA2'>"+lang.userAgent+"</div></div>";
  29. }else{
  30. tar="<div id='userAgenty1'><div id='userA1'><input type='checkbox' name='userAgenty' id='userAgenty' value='0' checked></div><div id='userA2'>"+lang.userAgent+"</div></div>";
  31. }
  32. }
  33.  
  34.  
  35. document.getElementById("txt1").innerHTML += '<div id="paypal_btn" style="position:absolute; top: 144px; left: 179px;"><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=4149245"><img border="0" src="../img/btn_spenden.png"></a></div>'; 
  36.  
  37. var s = "";
  38. var styley_var = "";
  39.     styley_var = System.Gadget.Settings.read("styley");
  40. if(styley_var == '1')
  41. {    
  42. s  = "<div id='styley1'><div id='sty1'><input type='radio' name='styley' onclick='styley(\"1\");' value='1' checked></div><div id='sty2'><img src='img/m1/28.png'></div>";
  43. s += "<div id='sty3'><input type='radio' name='styley' onclick='styley(\"2\");' value='2'></div><div id='sty4'><img src='img/m2/28.png'></div></div>";
  44. }else{ 
  45. s  = "<div id='styley1'><div id='sty1'><input type='radio' name='styley' onclick='styley(\"1\");' value='1'></div><div id='sty2'><img src='img/m1/28.png'></div>";
  46. s += "<div id='sty3'><input type='radio' name='styley' onclick='styley(\"2\");' value='2' checked></div><div id='sty4'><img src='img/m2/28.png'></div></div>";
  47. }
  48.  
  49.  
  50.  
  51.  
  52. var gg = "";
  53. var confirmy_var = "";
  54.     confirmy_var = System.Gadget.Settings.read("confirmy"); 
  55. if(confirmy_var == false)
  56. gg="<div id='alert'><div id='al1'><input type='checkbox' name='confirmy' id='confirmy' value='0'></div><div id='al2'>"+lang.alert+"</div></div>";  
  57. }else{ 
  58. gg="<div id='alert'><div id='al1'><input type='checkbox' name='confirmy' id='confirmy' value='0' checked></div><div id='al2'>"+lang.alert+"</div></div>";    
  59. }
  60.  
  61.  
  62.  
  63.     
  64. var e = "";
  65. var CF_var = "";
  66.     CF_var = System.Gadget.Settings.read("CF");
  67.     
  68. if(CF_var == 'F')
  69. {
  70. e = "<div id='cf1'><div id='cf_radio'><input type='radio' name='cf' onclick='CF(\"C\");' value='C'></div><div id='cf_image'>"+lang.cf+"</div></div>";
  71. e += "<div id='cf2'><div id='cf_radio'><input type='radio' name='cf' onclick='CF(\"F\");' value='F' checked></div><div id='cf_image'>"+lang.ff+"</div></div>";
  72. }else{
  73. e = "<div id='cf1'><div id='cf_radio'><input type='radio' name='cf' onclick='CF(\"C\");' value='C' checked></div><div id='cf_image'>"+lang.cf+"</div></div>";
  74. e += "<div id='cf2'><div id='cf_radio'><input type='radio' name='cf' onclick='CF(\"F\");' value='F'></div><div id='cf_image'>"+lang.ff+"</div></div>";
  75.  
  76. var d = "";
  77. var style_var = "";
  78.     style_var = System.Gadget.Settings.read("style");
  79.  
  80. d = style_var;
  81. if(style_var == 'c')
  82. {
  83. d = "<div style='padding-top: 8px;'><div id='c01'><div id='c_radio'><input type='radio' name='style' onclick='st(\"c\");' value='c' checked></div><div id='c_image'><img src='../img/c.png'></div></div>";
  84. d += "<div id='c02'><div id='c_radio'><input type='radio' name='style' onclick='st(\"w\");' value='w'></div><div id='c_image'><img src='../img/w.png'></div></div>";
  85. d += "<div id='c03'><div id='c_radio'><input type='radio' name='style' onclick='st(\"b\");' value='b' ></div><div id='c_image'><img src='../img/b.png'></div></div>";
  86. d += "<div id='c04'><div id='c_radio'><input type='radio' name='style' onclick='st(\"blue\");' value='blue' ></div><div id='c_image'><img src='../img/blue.png'></div></div>";
  87. d += "<div id='c05'><div id='c_radio'><input type='radio' name='style' onclick='st(\"r\");' value='r' ></div><div id='c_image'><img src='../img/r.png'></div></div>";
  88. d += "</div>";
  89. }
  90. else if(style_var == 'w')
  91. {
  92. d = "<div style='padding-top: 8px;'><div id='c01'><div id='c_radio'><input type='radio' name='style' onclick='st(\"c\");' value='c'></div><div id='c_image'><img src='../img/c.png'></div></div>";
  93. d += "<div id='c02'><div id='c_radio'><input type='radio' name='style' onclick='st(\"w\");' value='w' checked></div><div id='c_image'><img src='../img/w.png'></div></div>";
  94. d += "<div id='c03'><div id='c_radio'><input type='radio' name='style' onclick='st(\"b\");' value='b' ></div><div id='c_image'><img src='../img/b.png'></div></div>";
  95. d += "<div id='c04'><div id='c_radio'><input type='radio' name='style' onclick='st(\"blue\");' value='blue' ></div><div id='c_image'><img src='../img/blue.png'></div></div>";
  96. d += "<div id='c05'><div id='c_radio'><input type='radio' name='style' onclick='st(\"r\");' value='r' ></div><div id='c_image'><img src='../img/r.png'></div></div>";
  97. d += "</div>";
  98. }
  99. else if(style_var == 'blue')
  100. {
  101. d = "<div style='padding-top: 8px;'><div id='c01'><div id='c_radio'><input type='radio' name='style' onclick='st(\"c\");' value='c'></div><div id='c_image'><img src='../img/c.png'></div></div>";
  102. d += "<div id='c02'><div id='c_radio'><input type='radio' name='style' onclick='st(\"w\");' value='w'></div><div id='c_image'><img src='../img/w.png'></div></div>";
  103. d += "<div id='c03'><div id='c_radio'><input type='radio' name='style' onclick='st(\"b\");' value='b' ></div><div id='c_image'><img src='../img/b.png'></div></div>";
  104. d += "<div id='c04'><div id='c_radio'><input type='radio' name='style' onclick='st(\"blue\");' value='blue' checked></div><div id='c_image'><img src='../img/blue.png'></div></div>";
  105. d += "<div id='c05'><div id='c_radio'><input type='radio' name='style' onclick='st(\"r\");' value='r' ></div><div id='c_image'><img src='../img/r.png'></div></div>";
  106. d += "</div>";
  107. }
  108. else if(style_var == 'r')
  109. {
  110. d = "<div style='padding-top: 8px;'><div id='c01'><div id='c_radio'><input type='radio' name='style' onclick='st(\"c\");' value='c'></div><div id='c_image'><img src='../img/c.png'></div></div>";
  111. d += "<div id='c02'><div id='c_radio'><input type='radio' name='style' onclick='st(\"w\");' value='w'></div><div id='c_image'><img src='../img/w.png'></div></div>";
  112. d += "<div id='c03'><div id='c_radio'><input type='radio' name='style' onclick='st(\"b\");' value='b' ></div><div id='c_image'><img src='../img/b.png'></div></div>";
  113. d += "<div id='c04'><div id='c_radio'><input type='radio' name='style' onclick='st(\"blue\");' value='blue' ></div><div id='c_image'><img src='../img/blue.png'></div></div>";
  114. d += "<div id='c05'><div id='c_radio'><input type='radio' name='style' onclick='st(\"r\");' value='r' checked></div><div id='c_image'><img src='../img/r.png'></div></div>";
  115. d += "</div>";
  116. }
  117. else 
  118. {
  119. d = "<div style='padding-top: 8px;'><div id='c01'><div id='c_radio'><input type='radio' name='style' onclick='st(\"c\");' value='c'></div><div id='c_image'><img src='../img/c.png'></div></div>";
  120. d += "<div id='c02'><div id='c_radio'><input type='radio' name='style' onclick='st(\"w\");' value='w'></div><div id='c_image'><img src='../img/w.png'></div></div>";
  121. d += "<div id='c03'><div id='c_radio'><input type='radio' name='style' onclick='st(\"b\");' value='b' checked></div><div id='c_image'><img src='../img/b.png'></div></div>";
  122. d += "<div id='c04'><div id='c_radio'><input type='radio' name='style' onclick='st(\"blue\");' value='blue' ></div><div id='c_image'><img src='../img/blue.png'></div></div>";
  123. d += "<div id='c05'><div id='c_radio'><input type='radio' name='style' onclick='st(\"r\");' value='r' ></div><div id='c_image'><img src='../img/r.png'></div></div>";
  124. d += "</div>";
  125. }
  126. /*    
  127. if(style_var == "c")
  128. {
  129. d = "<input type='radio' name='style' onclick='style(\"c\");' value='c' checked> <img src='../img/c.png'><br><input type='radio' name='style' onclick='style(\"w\");' value='w'> e"+style_var+"<img src='../img/w.png'><br><input type='radio' name='style' onclick='style(\"b\");' value='b' checked> <img src='../img/b.png'>";
  130. else if (style_var == "w")
  131. {
  132. d = "<input type='radio' name='style' onclick='style(\"c\");' value='c'> <img src='../img/c.png'><br><input type='radio' name='style' onclick='style(\"w\");' value='w' checked> e"+style_var+"<img src='../img/w.png'><br><input type='radio' name='style' onclick='style(\"b\");' value='b' checked> <img src='../img/b.png'>";
  133. }
  134. else
  135. {
  136.  
  137. d = "<input type='radio' name='style' onclick='style(\"c\");' value='c'> <img src='../img/c.png'><br><input type='radio' name='style' onclick='style(\"w\");' value='w'> e"+style_var+"<img src='../img/w.png'><br><input type='radio' name='style' onclick='style(\"b\");' value='b' checked> <img src='../img/b.png' checked>";
  138. }      
  139. */ 
  140.  
  141.  
  142.    var show  = "";        
  143.        show  = System.Gadget.Settings.read("name");
  144.        show  = show.toString();
  145.    var hello = "";
  146.        if(show == ''){hello = lang.hello;document.getElementById("paypal_btn").style.display="none";}else{hello = lang.hello2;}
  147.    
  148. //document.getElementById("txt1").innerHTML += '<div><div id="CF">'+e+'</div><div id="style">'+d+'</div><div id="search"><img onclick="search();" src="../img/search.png"></div><div><input id="show" class="box" type="text" name="show" value="'+show+'"></div><div id="erg">'+hello+'</div><div id="erg2"></div><!--<div id="dlbtn"><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=4149245"><img border="0" src="../img/btn_spenden.png"></a></div>--><!--<div class="topic" style="padding-top: 15px;">Mein Wetter Pro</div><div style="padding-top: 0px;">ò Weltweites Wetter<br />ò 3-Tages-Vorschau<br />ò Exklusive Previews</div></div>-->';
  149.  
  150.  
  151.  
  152.  
  153. document.getElementById("txt1").innerHTML += '<div class="barname bar1">'+lang.bar1+'</div>';
  154. document.getElementById("txt1").innerHTML += '<div class="barname bar2">'+lang.bar2+'</div>';
  155. document.getElementById("txt1").innerHTML += '<div class="barname bar3">'+lang.bar3+'</div>';
  156. document.getElementById("txt1").innerHTML += '<div id="barchose1"><img src="../img/bar_chose.png"></div>';
  157. document.getElementById("txt1").innerHTML += '<div id="barchose2"><img src="../img/bar_chose.png"></div>';
  158. document.getElementById("txt1").innerHTML += '<div id="barchose3"><img src="../img/bar_chose.png"></div>';
  159. document.getElementById("txt1").innerHTML += '<div class="chose1" onclick="c(\'1\');"><img src="../img/blank.png" width="73" height="32"></div>';
  160. document.getElementById("txt1").innerHTML += '<div class="chose2" onclick="c(\'2\');"><img src="../img/blank.png" width="73" height="32"></div>';
  161. document.getElementById("txt1").innerHTML += '<div class="chose3" onclick="c(\'3\');"><img src="../img/blank.png" width="73" height="32"></div>';
  162. document.getElementById("txt1").innerHTML += '<div id="bar"><img src="../img/bar.png"></div>';
  163.  
  164. document.getElementById("txt1").innerHTML += '<div id="con1"><div id="search"><img onclick="search();" src="../img/search.png"></div><div><input id="show" class="box" type="text" name="show" value="'+show+'"></div><div id="erg">'+hello+'</div><div id="erg2"></div></div>';
  165. document.getElementById("txt1").innerHTML += '<div id="con2">'+d+''+s+''+tari+'</div>';
  166. document.getElementById("txt1").innerHTML += '<div id="con3">'+e+''+gg+''+tar+'</div>';
  167.  
  168.  
  169.    var bar  = "";
  170.        bar  = System.Gadget.Settings.read("bar");
  171.        if(bar == ''){bar=1;}
  172.        c(bar)
  173.  
  174. document.getElementById("topic1").innerHTML = "";
  175. }
  176.  
  177. function c(id)
  178. {
  179. System.Gadget.Settings.write("bar", id);
  180. document.getElementById("barchose1").style.display = "none";
  181. document.getElementById("barchose2").style.display = "none";
  182. document.getElementById("barchose3").style.display = "none";
  183. document.getElementById("con1").style.display = "none";
  184. document.getElementById("con2").style.display = "none";
  185. document.getElementById("con3").style.display = "none";
  186. document.getElementById("barchose"+id).style.display = "block";
  187. document.getElementById("con"+id).style.display = "block";
  188. }
  189. function navigation(id)
  190. {
  191.    document.getElementById('nav1').className = "deaktiv";
  192.    document.getElementById('nav2').className = "deaktiv";
  193.    document.getElementById('nav3').className = "deaktiv";
  194.    document.getElementById('nav'+id).className = "aktiv";
  195.    document.getElementById('content1').style.display   = "none";
  196.    document.getElementById('content2').style.display   = "none";
  197.    document.getElementById('content3').style.display   = "none";
  198.    document.getElementById('content'+id).style.display = "block";
  199. }
  200.  
  201.  
  202. function search()
  203. {
  204.  
  205. document.getElementById('erg').innerHTML = "<div style='padding-top:5px;'>"+lang.wait+"</div>";
  206. var rssDoc2 = new ActiveXObject("MSXML2.DOMDocument.3.0");
  207. rssDoc2.onreadystatechange = popData2;
  208. var search=document.getElementById('show').value;
  209. search = encodeURI(search);
  210. if(search == ''){search="New York";}
  211.  
  212. rssDoc2.load("http://weather.service.msn.com/data.aspx?src=vista&weasearchstr="+search+"&weadegreetype=C&culture=de-DE");
  213.  
  214. function popData2()
  215. {
  216. if(rssDoc2.readyState!=4)return;
  217. var c2 = 0;
  218. var rssItems2 = rssDoc2.selectNodes("/weatherdata/weather");
  219. var max = 3;
  220. if(rssItems2.length < max){max = rssItems2.length;}
  221. document.getElementById('erg').innerHTML = "";
  222. if(rssItems2.length == 0){document.getElementById('erg').innerHTML = "<div style='padding-top:5px;'>"+wait2+"</div>";}
  223. for(var i=0;i<max;i++)
  224. {
  225. var icode  = rssItems2[i].selectSingleNode("./@weatherlocationcode").text;
  226. var iname  = rssItems2[i].selectSingleNode("./@weatherlocationname").text;
  227.  
  228. document.getElementById('erg').innerHTML += "<input type='radio' name='i' onclick='save(\""+icode+"\", \""+iname+"\");' value='"+icode+"'> "+iname+"<br>";
  229.  
  230. document.getElementById("paypal_btn").style.display="block";
  231. }
  232. }
  233. }
  234.  
  235.  
  236. function save(code,name)
  237. {
  238. System.Gadget.Settings.write("show", code);
  239. System.Gadget.Settings.write("name", name);
  240. }
  241. function CF(CF)
  242. {
  243. System.Gadget.Settings.write("CF", CF);
  244. }
  245. function st(CF)
  246. {
  247. System.Gadget.Settings.write("style", CF);
  248. }
  249. function styley(CF)
  250. {
  251. System.Gadget.Settings.write("styley", CF);
  252. }
  253. function txtcolory(CF)
  254. {
  255. System.Gadget.Settings.write("txtcolor", CF);
  256. }
  257.  
  258.  
  259.  
  260.  
  261. function close() {
  262.    closeAction();
  263. }
  264.  
  265. System.Gadget.onSettingsClosing = SettingsClosing;
  266. function SettingsClosing(event)
  267.    {
  268.       if (event.closeAction == event.Action.commit)
  269.          {
  270.              var id = ""; 
  271.                  id = id.toString(); 
  272.                  //id = document.getElementById('show').value;
  273.                  id = document.getElementsByName('i').value;
  274.              //System.Gadget.Settings.write("show", id);  
  275.              var win        = System.Gadget.Settings.read("win"); 
  276.              if(win=='vista'){
  277.              var userAgenty = document.getElementById('userAgenty').checked;
  278.              System.Gadget.Settings.write("userAgenty", userAgenty);             
  279.              }
  280.                                      
  281.              var confirmy = document.getElementById('confirmy').checked;
  282.              System.Gadget.Settings.write("confirmy", confirmy);
  283.              
  284.          }
  285.       event.cancel = false;
  286.    }