Skip to content

Instantly share code, notes, and snippets.

View jamesjacobs's full-sized avatar

James Jacobs jamesjacobs

  • West Yorkshire, UK
View GitHub Profile
@jamesjacobs
jamesjacobs / text-help-with-help-and-error-output-latest.html.twig
Created May 16, 2018 11:02
Example output of form.text helper with help and error text including Pulsar updates
<div class="form__group has-error">
<label for="name" class="control__label">Name</label>
<div class="controls">
<input id="name" name="name" type="text" aria-describedby="guid-836139621 guid-677110833" aria-invalid="true" class="form__control">
<span class="help-block is-error" role="alert" id="guid-836139621"><i aria-hidden="true" class="icon-warning-sign"></i> Please enter your full name</span>
<span class="help-block" id="guid-677110833">Your full name, including any middle names</span>
</div>
</div>
@jamesjacobs
jamesjacobs / text-help-with-help-and-error-output.html.twig
Created May 16, 2018 10:58
Example output of form.text helper with help and error text
<div class="form__group has-error">
<label for="name" class="control__label">Name</label>
<div class="controls">
<input id="name" name="name" type="text" class="form__control">
<span class="help-block is-error">
<i aria-hidden="true" class="icon-warning-sign"></i>
Please enter your full name
</span>
<span class="help-block">
Your full name, including any middle names
@jamesjacobs
jamesjacobs / text-help-with-help-and-error.html.twig
Created May 16, 2018 10:38
Example of form.text helper with help and error text
{{
form.text({
'id': 'name',
'name': 'name',
'label': 'Name',
'help': 'Your full name, including any middle names',
'error': 'Please enter your full name'
})
}}
@jamesjacobs
jamesjacobs / gist:636265262a5e444aef19620961b898ef
Created May 16, 2018 10:37
form.text helper with help and error
{{
form.text({
'id': 'name',
'name': 'name',
'label': 'Name',
'help': 'Your full name, including any middle names',
'error': 'Please enter your full name'
})
}}
@jamesjacobs
jamesjacobs / SassMeister-input-HTML.html
Created April 17, 2015 06:46
Generated by SassMeister.com.
<p><a href="http://www.skysports.com/">An ordinary link</a></p>
<p><a href="http://www.skysports.com/" class="button button--primary">Primary Button</a></p>
<p><a href="#" class="button button--disabled">Disabled button</a></p>
@jamesjacobs
jamesjacobs / gist:8283018
Created January 6, 2014 13:40
Changes to HTML to use local-storage.js
<script src="js/local-storage.js"></script>
@jamesjacobs
jamesjacobs / app.js
Created January 6, 2014 13:35
Changes needed to app.js to use local-storage.js
initialize: function() {
// Create a new store
// this.store = new WebSqlDB();
this.store = new LocalStorageDB();
@jamesjacobs
jamesjacobs / local-storage.js
Last active January 2, 2016 09:19
Simple HTML5 ToDo app - using jQuery mobile and Localstorage
var LocalStorageDB = function(successCallback, errorCallback) {
// Used to simulate async calls. This is done to provide a consistent interface with storage methods like WebSQL and serverside ajax calls
var callDelay = function(callback, data) {
if (callback) {
setTimeout(function() {
callback(data);
}, 100);
}
}
@jamesjacobs
jamesjacobs / app.js
Created October 28, 2013 19:42
Simple HTML5 ToDo app - jQuery Mobile Part 3 - app.js
// serializeObject jQuery plugin
$.fn.serializeObject = function()
{
var o = {};
var a = this.serializeArray();
$.each(a, function() {
if (o[this.name] !== undefined) {
if (!o[this.name].push) {
o[this.name] = [o[this.name]];
}
@jamesjacobs
jamesjacobs / app.js
Created October 28, 2013 19:41
Simple HTML5 ToDo app - jQuery Mobile Part 3 - app.js
app.initialize();