Advertisement
plirof2

pack_codeorg_playlab_v231101.html

Nov 6th, 2023 (edited)
716
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  2. <title>pack-codeorg-PlayLab v231101 links  el-GR Replace HREF with Button newtab links</title>
  3.  
  4. <script src="pack_js_header.js" type="text/javascript"></script>
  5.  
  6. </head>
  7. <body  onload="init_links()">
  8. <!--
  9.     v221128c  el-GR Replace HREF with Button ( to always use GREEK version of code.org )
  10.     v20190313 - added probeserver url option
  11.  
  12. -->
  13. <TABLE BORDER="2" CELLPADDING="2" CELLSPACING="2"  style="table-layout: fixed;" WIDTH="100%" height=100%>
  14. <tbody><tr style="vertical-align:top" valign="top">
  15. <!-- <td style="width: 120px;word-wrap:break-word;" valign="top"> -->
  16.     <td style="word-wrap:break-word;" valign="top">
  17.  
  18. <b>Eπιλέξτε:</b>
  19. <div style="height: 600px; overflow: auto">
  20. <ul>
  21. <div style="height: 600px; overflow: auto">
  22.     <!-- Code.org Add On START  ----------------------------  -->
  23. <form id="frm" action="https://studio.code.org/locale" method="post" target="newtab2" >
  24.  
  25.  
  26. <input type = "hidden" name = "user_return_to" id = "user_return_to" value = "https://studio.code.org/s/course1/lessons/13/levels/1" / >
  27. <input type = "hidden" name = "locale" value = "el-GR"  >
  28.     <!-- Code.org Add On END ----------------------------   -->
  29. <!--   MAIN MENU LINKS ############################### -->
  30. <hr><div id="probeserver"></div><hr>        
  31. pack_codeorg_themes Playlab: <BR>Penguin,Gumball,Iceage ,Encryption  <HR>
  32.  
  33. <div id="div1" onClick="showItTimer(); return true;" >
  34. <li><a href="https://studio.code.org/s/playlab/reset" target="newtab2">πιγκουίνος /tennis και αλλοι χαρακτήρες (GREEK) !!!</a></li>
  35. <hr><hr>
  36.  
  37. </div>
  38. <div id="div2" >
  39. <li><a href="https://studio.code.org/s/gumball/reset?lang=el-GR" target="newtab2">gumball χατακτήρες (GREEK) </a></li>
  40. <hr><hr>
  41. </div>
  42. <div id="div3" >
  43. <li><a href="https://studio.code.org/s/iceage/reset"  target="newtab2">iceage (ENGLISH with Greek Blocks)</a></li><hr>
  44. </div>
  45. <div id="div4" >
  46. <li><a href="https://studio.code.org/s/hoc-encryption/reset" target="newtab2">Shift Letter Encyption ENGLISH καλη μόνο stage 1</a></li><hr>
  47. <li><a href="https://studio.code.org/s/text-compression/reset" target="newtab2">Συμπίεση Κειμένου ENGLISH (some Greek) καλη μόνο stage 1)</a></li><hr>
  48.  
  49. </div>
  50. <div id="div5" >
  51. <li><a href="https://studio.code.org/s/dance/reset" target="newtab2">Dance party Ελληνικά </a></li><hr>
  52.  
  53.  
  54.  
  55.  
  56.  
  57. </div>
  58. <div id="div6" >
  59. <hr>
  60.  
  61. <hr>
  62.  
  63. <li><a href="http://studio.code.org/s/course1/lessons/14/levels/1" target="newtab2">14. Μέλισσα: Επαναλήψεις lessons/14/levels/1</a></li><hr>
  64.  
  65. <li><a href="https://studio.code.org/s/starwarsblocks/reset" target="newtab2">HourOfCode Star Wars</a></li>
  66.  
  67. <li><a href="./pack_A02_ruffle.html" target="newtab2">pack_A02 ruffle</a></li><hr> 
  68.  
  69.  
  70.    
  71. </div>
  72. <div id="div7" ></div>
  73.  
  74. <!--   MAIN MENU LINKS ############################### -->          
  75. </form>
  76. </ul>
  77. </div>
  78. </TD>
  79.  
  80. <TD style="vertical-align:top;height:100%"  valign="top">
  81. <iframe name="sideframe" src="" allowfullscreen="" height="98%" frameborder="0" width="98%"></iframe>
  82.  
  83. </TD>
  84. </TR>
  85.  
  86. </TABLE>
  87.  
  88. <!-- FUNCTIONS #################### -->
  89. <script src="pack_js_footer.js" type="text/javascript"></script>
  90.  
  91.  
  92.  
  93.     <!-- Code.org Add On START  ----------------------------  -->
  94. <script type="text/javascript">
  95. // Replace all HREF with buttons (angry birds add on)
  96.  
  97.     var links = document.querySelectorAll("a");
  98.     function get_hrefs(links){
  99.         var links_array = links.forEach(function(elem){ return elem.getAttribute("href"); });
  100.         return links_array;
  101. }
  102. console.log(get_hrefs(links));
  103. console.log((links));
  104.  
  105.  
  106.  
  107. function href_replace(links){
  108.     var i=0;
  109.     var links_array =
  110.    
  111.     links.forEach(function(elem)
  112.         {
  113.             console.log(i);
  114.         // Create a new element
  115.         var newNode = document.createElement('div5'+i);
  116.         // Add ID and content
  117.         newNode.id = 'replacehrefwithbutton';
  118.         var text=elem.textContent.trim();
  119.         var url=elem.getAttribute("href");
  120.         newNode.innerHTML =
  121.         text+'<BR><input type = "submit" name = "user_return_to" id = "user_return_to" value ='+url+' >'+'<a href='+url+' target="newtab2" >ORIG. URL</a>';
  122.  
  123.         /*'<h1>'+elem.getAttribute("href")+'</h1>' +
  124.         '<p>The sun is'+
  125.             '<input type = "submit" name = "user_return_to" id = "user_return_to" value =http://studio.code.org/s/course1/lessons/18/levels/1 >'
  126.             +'      always shining!</p>';
  127.  
  128.            
  129.             */
  130.             elem.replaceWith(newNode);
  131.             i++;
  132.             return elem.getAttribute("href");
  133.  
  134.            
  135.         });
  136.  
  137.  
  138.  
  139.     // Replace the current node with the new node
  140.     //currentNode.replaceWith(newNode);
  141.     //links.forEach(function(elem){ return elem.replaceWith(newNode); });
  142.  
  143.  
  144.     return links_array;
  145. }
  146. href_replace(links);
  147. </script>
  148.     <!-- Code.org Add On END  ----------------------------  -->
  149.  
  150. </body></html>
  151.  
  152.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement