Difference between revisions of ":Colours"

From Ingmar de Boer
Jump to: navigation, search
(Created page with "<noinclude> This widget allows you to add a [https://developers.google.com/youtube/player_parameters YouTube video player] to your wiki page. == Using this widget == For info...")
 
Line 1: Line 1:
<noinclude>
+
<includeonly>
This widget allows you to add a [https://developers.google.com/youtube/player_parameters YouTube video player] to your wiki page.
+
<script language="javascript">
  
== Using this widget ==
+
var colorhex="#FF0000"
For information on how to use this widget, see the [http://www.mediawikiwidgets.org/YouTube widget description page on MediaWikiWidgets.org].
+
function mouseOverColor(hex)
 +
{
 +
document.getElementById("divpreview").style.backgroundColor=hex;
 +
document.getElementById("divpreviewtxt").innerHTML=hex;
 +
document.body.style.cursor="pointer";
 +
}
  
== Copy to your site ==
+
function clickColor(hex,seltop,selleft)
To use this widget on your site, just install the [https://www.mediawiki.org/wiki/Extension:Widgets MediaWiki Widgets extension] and the copy [{{fullurl:{{FULLPAGENAME}}|action=edit}} full source code] of this page to your wiki, as an article called '''{{FULLPAGENAME}}'''.
+
{
</noinclude><includeonly><iframe width="<!--{$width|escape:'html'|default:'425'}-->" height="<!--{$height|escape:'html'|default:355}-->" src="https://www.youtube.com/embed/<!--{if isset($playlist)}-->?listType=playlist&list=<!--{$playlist|escape:'urlpathinfo'}--><!--{else}--><!--{$id|escape:'urlpathinfo'}--><!--{/if}-->" frameborder="0" allowfullscreen></iframe></includeonly>
+
var xhttp,c
 +
if (hex==0)
 +
{
 +
c=document.getElementById("colorhex").value;
 +
}
 +
else
 +
{
 +
c=hex;
 +
}
 +
if (c.substr(0,1)=="#")
 +
{
 +
c=c.substr(1);
 +
}
 +
colorhex="#" + c;
 +
colorhex=colorhex.substr(0,10);
 +
document.getElementById("colorhex").value=colorhex;
 +
if (window.XMLHttpRequest)
 +
  {
 +
  xhttp=new XMLHttpRequest();
 +
  }
 +
else
 +
  {
 +
  xhttp=new ActiveXObject("Microsoft.XMLHTTP");
 +
  }
 +
xhttp.open("GET","http_colorshades.asp?colorhex=" + c + "&r=" + Math.random(),false);
 +
xhttp.send("");
 +
document.getElementById("colorshades").innerHTML=xhttp.responseText;
 +
if (seltop>-1 && selleft>-1)
 +
{
 +
document.getElementById("selectedColor").style.top=seltop + "px";
 +
document.getElementById("selectedColor").style.left=selleft + "px";
 +
document.getElementById("selectedColor").style.visibility="visible";
 +
}
 +
else
 +
{
 +
document.getElementById("divpreview").style.backgroundColor=colorhex;
 +
document.getElementById("divpreviewtxt").innerHTML=colorhex;
 +
document.getElementById("selectedColor").style.visibility="hidden";
 +
}
 +
//refreshleader()
 +
}
 +
 
 +
</script>
 +
</includeonly>

Revision as of 16:59, 2 April 2016