Skip to content

Instantly share code, notes, and snippets.

View jodyHamilton's full-sized avatar

Jody Hamilton jodyHamilton

View GitHub Profile
@jodyHamilton
jodyHamilton / Drupal-8-Date-Help-Text-JS
Created May 4, 2017 14:28
Drupal 8 Date widget help text for browsers that dont support html5 date input.
// HTML5 date elements use the user's browser date format,
// but browsers that don't support it have a more confusing interface
// requiring help text.
Drupal.behaviors.DateHelp = {
attach: function (context, settings) {
if (Modernizr.inputtypes.date === false) {
// If there is no help text div, first add one.
$('div.field--widget-datetime-default:not(:has(.description))').each(function() {
$(this).find('input').after('<div class="description"></div>');
});
@jodyHamilton
jodyHamilton / Drupal 8 inline_form_errors with field_group
Last active May 1, 2017 21:56
Drupal 8 inline_form_errors with field_group
// Inline_form_errors module gives links to elements with errors.
// When using field_group module (this is for vertical tabs) you need to first open the right vertical tab
// and then scroll to the element with the error.
$('.messages__list a', context).on('click', function(e) {
var url = $(this).attr('href');
var hash = url.substring(url.indexOf('#'));
var index = $(hash).parents('.vertical-tabs__pane').index() - 1;
if (index >= 0) {
$('ul.vertical-tabs__menu li').eq(index).find('a').click();
}
@jodyHamilton
jodyHamilton / .probo.yml
Last active April 14, 2017 19:11
A Wordpress Probo Config
assets:
- aap.sql
steps:
- name: Set up site with WordPress plugin
plugin: WordPressApp
devDomain: 'http://allagesproductions.com'
devHome: 'http://allagesproductions.com/'
database: 'aap.sql'
databaseName: 'aap'
databaseGzipped: false
steps:
- name: Run behat tests
command: 'cd /var/www/html/tests ; composer install ; ./bin/behat --profile probo --tags "~@javascript"'
- name: Run behat js tests
command: 'wget http://selenium-release.storage.googleapis.com/2.48/selenium-server-standalone-2.48.2.jar ; apt-get install xvfb -y ; xvfb-run java -jar selenium-server-standalone-2.48.2.jar & ; ./bin/behat --profile probo --tags "@javascript" ; disown'
<?php
define('WP_CACHE', false); // Added by W3 Total Cache
define('WP_HOME', $_SERVER['REQUEST_SCHEME'] . '://' . $_SERVER['HTTP_HOST']);
define('WP_SITEURL', $_SERVER['REQUEST_SCHEME'] . '://' . $_SERVER['HTTP_HOST']);
assets:
- zivtech8x.sql.gz
steps:
- name: Setup working directory
command: "drush fec --json-config='{\"settings_php.snippets\": []}' --local-environment=probo zivtech 7 "
- name: Import the database
command: 'gunzip -c $ASSET_DIR/zivtech8x.sql.gz | `drush --root=/var/www/zivtech/webroot sql-connect` ; rm $ASSET_DIR/zivtech8x.sql.gz'
- name: Move code in place
command: 'rm -rf /var/www/zivtech/code ; mv $SRC_DIR /var/www/zivtech/code'
- name: Rewrite settings.php file and repair symlinks
@jodyHamilton
jodyHamilton / bear_skin.info.yaml
Created October 2, 2015 20:52
Bear Skin yaml
name: Bear Skin type: theme
description: 'Bear Skin Starter Theme.'
package:
Custom core: 8.x
engine: twig
screenshot: screenshot.png
stylesheets-remove:
- core/modules/system/css/components/messages.theme.css
- core/modules/system/css/components/menu.theme.css
asfdasdf
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index 728e4ec..394d746 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -215,7 +215,9 @@ define('LANGUAGE_RTL', 1);
* @see http://php.net/manual/reserved.variables.server.php
* @see http://php.net/manual/function.time.php
*/
-define('REQUEST_TIME', (int) $_SERVER['REQUEST_TIME']);
+ // Moved to a phase of drupal_bootstrap so that we can pull this from a