Difference between revisions of "Widget:WikiDiagram"

From Audacity Wiki
Jump to: navigation, search
(remote.)
(Simpler?)
Line 4: Line 4:
 
</noinclude><includeonly>
 
</noinclude><includeonly>
 
<!--{if not $item}-->
 
<!--{if not $item}-->
GAA
+
<script data-cfasync="false" src="https://wit.audacityteam.org/js/wikidiagrams.js?time=1123"></script>
<!--{else}-->
 
BUNG
 
 
<!--{/if}-->
 
<!--{/if}-->
<script data-cfasync="false" src="https://wit.audacityteam.org/js/wikidiagrams.js?time=1123"></script>
 
  
<script>
+
ITEM:<!--{$item}-->
  
 +
<div id="content_here" style="text-align:center;">
 +
</div>
 +
<div id="atitle" style="text-align:center;">
 +
    <em>No Hotspot Zones Loaded (Yet)</em>
 +
</div>
 +
<div id="tabular_contents"></div>
 +
<div id="spec" style="margin-left:10px"></div>
  
  
function receiveReply(event) {
+
<script>
  var source = event.source;
 
  console.log("Got Reply:" + event.data );
 
  var result = document.getElementById("result");
 
  resetHotspots();
 
  loadNewDetails( event.data );
 
}
 
  
function loaded(win){
+
function loaded(){
  window.addEventListener("message", receiveReply, false);
+
  window.addEventListener("message", receiveReply, false);
  
 
   //alert("page loaded");
 
   //alert("page loaded");
Line 34: Line 32:
  
 
   loadDiagram( A.page, "remote" );
 
   loadDiagram( A.page, "remote" );
  //var trampoline = document.getElementById("trampoline").contentWindow;
 
  // Don't care who receiver is, if they give us back a spec
 
  //trampoline.postMessage( A.page,"*");
 
 
   setInterval(timerCallback, 30);
 
   setInterval(timerCallback, 30);
 
}
 
}
  
 +
loaded();
 
</script>
 
</script>
<iframe id="trampoline" onload="loaded(this)" src="https://wit.audacityteam.org/trampoline.htm" style="display:none"></iframe><br>
+
 
ITEM:<!--{$item}-->
 
<div id="content_here" style="text-align:center;">
 
</div>
 
<div id="atitle" style="text-align:center;">
 
    <em>No Hotspot Zones Loaded (Yet)</em>
 
</div>
 
<div id="tabular_contents"></div>
 
<div id="spec" style="margin-left:10px"></div>
 
 
<includeonly>
 
<includeonly>

Revision as of 22:19, 5 December 2019

This runs a script on loading complete