"use strict";
/*
Testcase to illustrate problem I have in Opera.
steps to reproduce:
1. click on button primary. Notice that a foreignObject is filled with "primary".
2. hover over button secondary. Notice that the color of the button changes.
3. a new foreignObject is filled with text "secondary", as can be seen in the HTML.
Expected result:
a new foreignObject is not displayed.
Actual result:
the foreignObject is not displayed.
*/
var svgns = "http://www.w3.org/2000/svg"
, xlinkns = "http://www.w3.org/1999/xlink"
, hlt = hlt || new Object()
, fo_allowed
, focusX = 550
, focusY = 100
, button_face
, button_label
;
hlt.enums = {
STATE: {
HOME: {name: 'home'}
, Primary: {name: 'primary'}
}
};
hlt.state = hlt.enums.STATE.HOME; // initial state
// ==================== generic
/* JQuery-ish */
function $(id) {
return document.getElementById(id);
}
// ==================== Button
/*
If a button has an action associated (via its configuration) that
action is triggered on mouseup. If a hover action is provided,
this is called both on mouseenter and on mouseleave of the button.
The first argument is a boolean indicating if mouseenter was the trigger.
A button can be set to be (not) hot. This is useful for navigation buttons
where the hot button designates the current location (e.g. page).
This means that you can see which button lead to the current location.
By default a hot button has a larger label with bright yellow text.
*/
var button_colour_schemes = {// off, hover, disabled, text_off, text_hover, text_disabled, text_hot
basic: ['#f00', '#0f0', '#a00', '#ffd', '#fff', '#aaa', '#ffd']
, diagram: ['#f00', '#fd2', '#a04', '#ffd', '#fff', '#aaa']
// , patch: ['#aaf', '#bbf', '#669', '#eef', '#fff', '#aaa']
, patch: ['#68a', '#bbf', '#558', '#ddf', '#fff', '#aaa']
};
var all_buttons = []; // we need this, because redrawing text after all buttons
function Button(hash) {
//...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Fiddle Pages
Your fiddles accessible under a custom domain and a vanity path - the simplest hosting for your personal project.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Get Fiddle Pages with PRO
Your fiddles accessible under a custom domain and a vanity path - the simplest hosting for your personal project.