function TimeSpanUpdater(id, interval) {
var updater = function () {
var _this = this;
this.interval = interval ? interval : 20000;
this.registeredItemsArr = [];
this.registerItem = function (element) {
if (element && element.attr('data-timespan')) {
var processText = function (text) {
var txt = (text || '').replace(/(http(s)?:\/\/[^\s]+)/gi, '<a class="link" href="$1" target="_blank">$1</a>').replace(/\r\n/g, '<br />').replace(/\n/g, '<br />');
return txt;
};
### Usage
processText(document.body)
var isEventSupported = function (eventName) {
var TAGNAMES = { 'select': 'input', 'change': 'input', 'submit': 'form', 'reset': 'form', 'error': 'img', 'load': 'img', 'abort': 'img' }
var el = document.createElement(TAGNAMES[eventName] || 'div');
eventName = 'on' + eventName;
var isSupported = (eventName in el);
if (!isSupported) {
el.setAttribute(eventName, 'return');
isSupported = typeof el[eventName] == 'function';
var browserInfo = function () {
var ua = navigator.userAgent.toLowerCase();
var matchs = ua.match(/(opera)\/([\d\.]+)/i) || ua.match(/(msie) ([\d\.]+)/i) || ua.match(/(firefox)\/([\d\.]+)/i) || ua.match(/(chrome)\/([\d\.]+)/i) || ua.match(/(safari)\/([\d\.]+)/i) || [];
return {
name: matchs[1] || 'unknown',
version: matchs[2] || 'unknown',
isTouch: 'ontouchend' in document
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
/** | |
* prepareTransition | |
* | |
* jQuery Plugin for ensuring transitions with display:none or visibility:hidden | |
* are in the right state until the end of the transition | |
* | |
* By John W. Long (http://wiseheartdesign.com) | |
* April 18, 2013 | |
* | |
* Based on the prepareTransition plugin by Jonathan Snook (http://snook.ca). This version |
(function($){
$.fn.getBackgroundColor = function() {
var self = $(this);
var bgColor = "";
while(self.prop("tagName").toLowerCase() != "html") {
bgColor = self.css("background-color");
if(bgColor != "rgba(0, 0, 0, 0)" && bgColor != "transparent") {