MOM.modal.openSessionModal(options);
title: 'Your session is about to expire',
message: 'You will be logged out in <strong>{time}</strong> seconds. Do you want to stay logged in?',
confirm_action: 'javascript:fnConfirmSessionExtend()',
| function toNestedArray (data, rootLevel = 0, parentNode) { | |
| let output = [] | |
| for (var i = 0; i < data.length; i++) { | |
| var count = data[i].count | |
| var items = data[i].name.split('/') | |
| var hasParent = items.length > rootLevel | |
| if (hasParent) { | |
| let parent = rootLevel | |
| ? items.length === rootLevel | |
| ? null |
| from autobahn.twisted.websocket import WebSocketServerProtocol, WebSocketServerFactory, listenWS | |
| from twisted.python import log | |
| from autobahn.util import newid, utcnow | |
| import Cookie | |
| from chatterbot import ChatBot | |
| from chatterbot.trainers import ChatterBotCorpusTrainer | |
| from chatterbot.conversation import Statement | |
| from users import Users | |
| import sys |
| // Create transport if the browser can provide an xhr | |
| if ( xhrSupported ) { | |
| jQuery.ajaxTransport(function( options ) { | |
| // Cross domain only allowed if supported through XMLHttpRequest | |
| if ( !options.crossDomain || support.cors ) { | |
| var callback; | |
| return { |
| <blockquote> | |
| <p>Written with <a href="https://stackedit.io/">StackEdit</a>.</p> | |
| </blockquote> |
| $pattern = '/(?(?=<\S*>)<\S*>|)\s*(\[[a-z|A-Z|-|\/|\s|\"|\=]*\])\s*(?(?=<\/\S*>)<\/\S*>|)/'; | |
| $html = '<p> | |
| [highlight type="note"]You and your confinement nanny are bound by the basic Work Permit conditions. For example, the nanny cannot work for other employers in an occupation other than that stated in the Work Permit.[/highlight]</p>'; | |
| $filtered = preg_replace($pattern, '$1', $html); | |
| // Returns | |
| /* |
The BBC has a server-side image service which provides developers with multiple sized versions of any image they request. It works in a similar fashion to http://placehold.it/ but it also handles the image ratios returned (where as placehold.it doesn't).
The original BBC News process (and my re-working of the script) follows roughly these steps...
divs within the page (which have a class of delayed-image-load) into a transparent GIF using a Base64 encoded string.
width & height HTML attributes of the image to the required sizediv has custom data-attr set server-side to the size of the imageimage-replace onto each newly created transparent imagesetTimeout to unblock the UI thread and which calls a function resizeImages which enhances the image-replace images so their source is now set to a URL whe| <!DOCTYPE html> | |
| <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> | |
| <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]--> | |
| <!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]--> | |
| <!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]--> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
| <title></title> | |
| <meta name="description" content=""> |
| $window = $(window); | |
| $('section').each(function(){ | |
| var $this = $(this); // assigning the object | |
| var off = $this.offset().top; | |
| $this.data("top", off); | |
| $(window).bind('resize scroll', function() { |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Simple Gauge · CodePen</title> | |
| <style> |