Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <title>pack-codeorg-PlayLab v231101 links el-GR Replace HREF with Button newtab links</title>
- <script src="pack_js_header.js" type="text/javascript"></script>
- </head>
- <body onload="init_links()">
- <!--
- v221128c el-GR Replace HREF with Button ( to always use GREEK version of code.org )
- v20190313 - added probeserver url option
- -->
- <TABLE BORDER="2" CELLPADDING="2" CELLSPACING="2" style="table-layout: fixed;" WIDTH="100%" height=100%>
- <tbody><tr style="vertical-align:top" valign="top">
- <!-- <td style="width: 120px;word-wrap:break-word;" valign="top"> -->
- <td style="word-wrap:break-word;" valign="top">
- <b>Eπιλέξτε:</b>
- <div style="height: 600px; overflow: auto">
- <ul>
- <div style="height: 600px; overflow: auto">
- <!-- Code.org Add On START ---------------------------- -->
- <form id="frm" action="https://studio.code.org/locale" method="post" target="newtab2" >
- <input type = "hidden" name = "user_return_to" id = "user_return_to" value = "https://studio.code.org/s/course1/lessons/13/levels/1" / >
- <input type = "hidden" name = "locale" value = "el-GR" >
- <!-- Code.org Add On END ---------------------------- -->
- <!-- MAIN MENU LINKS ############################### -->
- <hr><div id="probeserver"></div><hr>
- pack_codeorg_themes Playlab: <BR>Penguin,Gumball,Iceage ,Encryption <HR>
- <div id="div1" onClick="showItTimer(); return true;" >
- <li><a href="https://studio.code.org/s/playlab/reset" target="newtab2">πιγκουίνος /tennis και αλλοι χαρακτήρες (GREEK) !!!</a></li>
- <hr><hr>
- </div>
- <div id="div2" >
- <li><a href="https://studio.code.org/s/gumball/reset?lang=el-GR" target="newtab2">gumball χατακτήρες (GREEK) </a></li>
- <hr><hr>
- </div>
- <div id="div3" >
- <li><a href="https://studio.code.org/s/iceage/reset" target="newtab2">iceage (ENGLISH with Greek Blocks)</a></li><hr>
- </div>
- <div id="div4" >
- <li><a href="https://studio.code.org/s/hoc-encryption/reset" target="newtab2">Shift Letter Encyption ENGLISH καλη μόνο stage 1</a></li><hr>
- <li><a href="https://studio.code.org/s/text-compression/reset" target="newtab2">Συμπίεση Κειμένου ENGLISH (some Greek) καλη μόνο stage 1)</a></li><hr>
- </div>
- <div id="div5" >
- <li><a href="https://studio.code.org/s/dance/reset" target="newtab2">Dance party Ελληνικά </a></li><hr>
- </div>
- <div id="div6" >
- <hr>
- <hr>
- <li><a href="http://studio.code.org/s/course1/lessons/14/levels/1" target="newtab2">14. Μέλισσα: Επαναλήψεις lessons/14/levels/1</a></li><hr>
- <li><a href="https://studio.code.org/s/starwarsblocks/reset" target="newtab2">HourOfCode Star Wars</a></li>
- <li><a href="./pack_A02_ruffle.html" target="newtab2">pack_A02 ruffle</a></li><hr>
- </div>
- <div id="div7" ></div>
- <!-- MAIN MENU LINKS ############################### -->
- </form>
- </ul>
- </div>
- </TD>
- <TD style="vertical-align:top;height:100%" valign="top">
- <iframe name="sideframe" src="" allowfullscreen="" height="98%" frameborder="0" width="98%"></iframe>
- </TD>
- </TR>
- </TABLE>
- <!-- FUNCTIONS #################### -->
- <script src="pack_js_footer.js" type="text/javascript"></script>
- <!-- Code.org Add On START ---------------------------- -->
- <script type="text/javascript">
- // Replace all HREF with buttons (angry birds add on)
- var links = document.querySelectorAll("a");
- function get_hrefs(links){
- var links_array = links.forEach(function(elem){ return elem.getAttribute("href"); });
- return links_array;
- }
- console.log(get_hrefs(links));
- console.log((links));
- function href_replace(links){
- var i=0;
- var links_array =
- links.forEach(function(elem)
- {
- console.log(i);
- // Create a new element
- var newNode = document.createElement('div5'+i);
- // Add ID and content
- newNode.id = 'replacehrefwithbutton';
- var text=elem.textContent.trim();
- var url=elem.getAttribute("href");
- newNode.innerHTML =
- text+'<BR><input type = "submit" name = "user_return_to" id = "user_return_to" value ='+url+' >'+'<a href='+url+' target="newtab2" >ORIG. URL</a>';
- /*'<h1>'+elem.getAttribute("href")+'</h1>' +
- '<p>The sun is'+
- '<input type = "submit" name = "user_return_to" id = "user_return_to" value =http://studio.code.org/s/course1/lessons/18/levels/1 >'
- +' always shining!</p>';
- */
- elem.replaceWith(newNode);
- i++;
- return elem.getAttribute("href");
- });
- // Replace the current node with the new node
- //currentNode.replaceWith(newNode);
- //links.forEach(function(elem){ return elem.replaceWith(newNode); });
- return links_array;
- }
- href_replace(links);
- </script>
- <!-- Code.org Add On END ---------------------------- -->
- </body></html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement