This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //lsauer.com, 2015 | |
| var thousandSeparator = ','; | |
| var inputNumber = 234234; | |
| var fixedLength = 2 | |
| parseFloat(inputNumber) | |
| .toFixed(fixedLength) | |
| .toString() | |
| .split(/(.{3})/gm) | |
| .filter(Boolean) | |
| .join(thousandSeparator) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "use strict"; | |
| if(!this.hasOwnProperty('globalScope')){ | |
| var globalScope; | |
| try { | |
| globalScope = Function('return this')(); | |
| }catch(ex){ | |
| //extend else-if cases for other globalObject-names as needed... | |
| if(this && this.hasOwnProperty && this.hasOwnProperty('window')){ | |
| globalScope = window; | |
| }else{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* lsauer.com, 2015 */ | |
| .left-flexible-right-fixed .container { | |
| height: auto; | |
| overflow: hidden; | |
| } | |
| .left-flexible-right-fixed .left-inner{ | |
| width: 100%; | |
| } | |
| .left-flexible-right-fixed .right { | |
| width: 180px; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var htmlColorsMap = (function(scope){ | |
| var htmlColorsMap = {}; | |
| var _colorAliases = [ | |
| '#F0F8FF aliceblue' | |
| , '#FAEBD7 antiquewhite' | |
| , '#00FFFF aqua' | |
| , '#7FFFD4 aquamarine' | |
| , '#F0FFFF azure' | |
| , '#F5F5DC beige' | |
| , '#FFE4C4 bisque' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * lsauer, 2013 | |
| * Lean handler for exception reporting; stdout is set by default to console.log | |
| * @param {exc} exc an Exception instance of Error, containing a message and stack property | |
| * @param {exc} stdOut A variadic function for error reporting. By default: console.log | |
| * @return undefined | |
| */ | |
| var exceptionHandler = function(exc, stdOut){ | |
| var stdOut = stdOut || function() { console.log.apply(console, arguments) }; | |
| if(stdOut instanceof Function){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //lsauer.com, 2012 lo sauer | |
| //description: intervalCallNtimes; counter after nth time clearinterval; bind a function to a certain scope using 'intervalCall' | |
| //requires: intervalCall, see: https://gist.github.com/lsauer/cf70e65c208cc311ce97 | |
| //@param fntimes: an integer-Number or function to control the number of invocations of the callback-counter-function:'fntimes' | |
| // fntimes is passed an integer Number-counter, starting at 1; | |
| //@param fn: the function to be invoked | |
| //@param tm: timeout in milliseconds | |
| //@param scope: scope in which the function should be invoked | |
| //-> examples are provided below | |
| function intervalCallNtimes(fntimes, fn, tm, scope){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //lsauer.com, 2012; rev. 2014 by lo sauer | |
| //see also: http://stackoverflow.com/questions/596481/simulate-javascript-key-events/19883789#19883789 | |
| //description: trigger handlers attached to DOM elements, which listen to the type 'KeyboardEvent' | |
| //@param s: A single keyboard-character passed as a string e.g. "\n", "a",... | |
| //[@param fncb]:callback function which is passed a boolean event-state (OK=true/Cancelled=false) | |
| var doKeyEvent = function(s /*single char*/, fncb /*callback function, with handler state*/) { | |
| var evt = document.createEvent('KeyboardEvent'); | |
| evt.initKeyEvent ('keypress', true, true, window,0, 0, 0, 0, 0, s.charCodeAt(0)) | |
| var cncld = !document.getElementsByTagName('body')[0].dispatchEvent(evt); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //lsauer.com, 2012; rev. 2014 by lo sauer | |
| //description: transformTag fully replaces a node by a different Tag, and re-attaches all children to the newly formed Tag | |
| // Any desired EventHandlers must be re-attached manually | |
| //@param tagIdOrElem: an HTMLElement Id-Name or an instance of any HTMLElement | |
| //[@param tagType]: the HTML Tag Type. Default is 'span' (HTMLSpanElement) | |
| function transformTag(tagIdOrElem, tagType){ | |
| var elem = (tagIdOrElem instanceof HTMLElement) ? tagIdOrElem : document.getElementById(tagIdOrElem); | |
| if(!elem || !(elem instanceof HTMLElement))return; | |
| var children = elem.childNodes; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //lsauer.com, 2012 lo sauer | |
| //description: intervalCall binds a function to a declared scope and invokes it after 'tm' milliseconds | |
| //@param scope: scope in which the function should be invoked | |
| //@param fn: the function to be invoked | |
| //@param tm: timeout in milliseconds | |
| //[@param fntimes]: Optional. A function to control the number of invocations of 'fn', i.e. to declare events / triggers based on the invocation-count | |
| // fntimes is passed an integer Number-counter, starting at 1; | |
| function intervalCall(scope, fn, tm, fntimes) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "B": "Burgenland", | |
| "K": "Kärnten", | |
| "N": "Niederösterreich", | |
| "O": "Oberöstereich", | |
| "S": "Salzburg", | |
| "St": "Steiermark", | |
| "T": "Tirol", | |
| "V": "Vorarlberg", | |
| "W": "Wien" |