Skip to content

Instantly share code, notes, and snippets.

View elson's full-sized avatar

Stephen Elson elson

View GitHub Profile
CREATE (n{name:'cypher'})-[r:LIKES { weight:4 }]->({name:'icecream'})
RETURN n.name, r
@elson
elson / designer.html
Last active August 29, 2015 14:07
designer
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../paper-icon-button/paper-icon-button.html">
<link rel="import" href="../paper-tabs/paper-tabs.html">
<link rel="import" href="../paper-tabs/paper-tab.html">
<polymer-element name="my-element">
<template>
@elson
elson / designer.html
Created October 3, 2014 16:06
designer
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-scroll-header-panel/core-scroll-header-panel.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
@elson
elson / designer.html
Last active August 29, 2015 14:07
designer
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<polymer-element name="my-element">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xml:lang="en-GB" xmlns="http://www.w3.org/1999/xhtml" lang="en-GB">
<head>
<title>Glow Panel and Mask with Context</title>
--- core/src/widgets/overlay/overlay.js 2008-10-29 14:29:42.000000000 +0000
+++ trunk/src/widgets/overlay/overlay.js 2008-11-19 16:27:48.000000000 +0000
@@ -235,6 +235,9 @@
@param {glow.widgets.Mask} [opts.mask] Mask to use for modal overlays
used to indicate to the user that the overlay is modal. If provided then the modal property is set to true.
@param {Boolean} [opts.closeOnMaskClick="true"] if true then listens for a click event on the mask and hides when it fires
+ @param {selector|DOMElement|NodeList} [opts.context] Context for overlay positioning.
+ The overlay will be positioned so that it is centred over the specified element.
+ If the panel is modal, its Mask will inherit the context and so will only cover the context element.
@param {String|Function} [opts.anim="null"] A transition for showing / hiding the panel
We couldn’t find that file to show.
--- core/src/widgets/overlay/overlay.js 2008-10-29 14:29:42.000000000 +0000
+++ trunk/src/widgets/overlay/overlay.js 2008-11-19 16:27:48.000000000 +0000
@@ -235,6 +235,9 @@
@param {glow.widgets.Mask} [opts.mask] Mask to use for modal overlays
used to indicate to the user that the overlay is modal. If provided then the modal property is set to true.
@param {Boolean} [opts.closeOnMaskClick="true"] if true then listens for a click event on the mask and hides when it fires
+ @param {selector|DOMElement|NodeList} [opts.context] Context for overlay positioning.
+ The overlay will be positioned so that it is centred over the specified element.
+ If the panel is modal, its Mask will inherit the context and so will only cover the context element.
@param {String|Function} [opts.anim="null"] A transition for showing / hiding the panel
--- core/src/widgets/mask/mask.js 2008-09-22 11:27:44.000000000 +0100
+++ trunk/src/widgets/mask/mask.js 2008-11-17 11:13:51.000000000 +0000
@@ -65,6 +65,15 @@
zIndex: 9900,
disableScroll: false
}, opts || {});
+
+ /*
+ Property: context
+ If context is specified, the mask is restricted in size
@elson
elson / gist:146004
Created July 13, 2009 08:53
Glow optional email validation
myGlowForm.addTests(
"email",
["custom", {
arg: function(values, opts, callback, formData) {
var message = "Must be a valid email address.";
if (values[0] !== "" && !/^[A-Za-z0-9](([_\.\-]*[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\.\-]?[a-zA-Z0-9]+)*)\.([A-Za-z]{2,})$/.test(values[0])) {
callback(glow.forms.FAIL, message);
return;
}