Commit f1f760e8 authored by bgm's avatar bgm Committed by Aegir user

Merge remote-tracking branch 'co/master'

parents 06f82801 410c4472
Themes allow you to change the look and feel of your Drupal site. You can use
themes contributed by others or create your own.
WHAT TO PLACE IN THIS DIRECTORY?
--------------------------------
Placing downloaded and custom themes in this directory separates downloaded and
custom themes from Drupal core's themes. This allows Drupal core to be updated
without overwriting these files.
DOWNLOAD ADDITIONAL THEMES
--------------------------
Contributed themes from the Drupal community may be downloaded at
https://www.drupal.org/project/project_theme.
MULTISITE CONFIGURATION
-----------------------
In multisite configurations, themes found in this directory are available to
all sites. Alternatively, the sites/your_site_name/themes directory pattern
may be used to restrict themes to a specific site instance.
MORE INFORMATION
-----------------
Refer to the "Appearance" section of the README.txt in the Drupal root directory
for further information on customizing the appearance of Drupal with custom
themes.
var exec = require('sync-exec');
var exit = 0;
var glob = require("glob");
var globOptions = {
ignore: [
'bower_components/**/*',
'node_modules/**/*'
]
};
var pkg = require('../../package');
// Change to \{{ hook }} once that variable is available.
// @see https://github.com/wecodemore/grunt-githooks/pull/40
var hooks = pkg.githooks && pkg.githooks['{{ task }}'];
if (hooks) {
var ret, hook, files, commands, staged, matchAll;
var filesMatched = [];
// Iterate over all hook definitions.
for (var h in hooks) {
hook = hooks[h];
commands = hook.commands || [];
staged = hook.staged === void 0 ? false : !!hook.staged;
matchAll = hook.matchAll === void 0 ? true : !!hook.matchAll;
// Iterate over all files in a hook definition.
if (hook.files) {
// Expand all file paths using glob (for pattern matching).
if (typeof hook.files === 'string') {
files = glob.sync(hook.files, globOptions) || [];
}
if (Array.isArray(hook.files)) {
files = [];
for (var f = 0; f < hook.files.length; f++) {
files = [].concat(files, glob.sync(hook.files[f], globOptions) || []);
}
}
// All files must either be staged or modified for the entire
// hook definition command(s) to be executed.
for (f in files) {
var file = files[f];
if (file) {
// Only continue if file has been staged or modified.
ret = exec((staged ? 'git diff --name-only --cached ' + file : 'git diff HEAD@{1} --stat -- ' + file));
exit = ret.status;
if (exit === 0 && ret.stdout !== '') {
filesMatched.push(file);
}
else if (matchAll && (exit > 0 || ret.stdout === '')) {
console.log(ret.stdout);
filesMatched = [];
break;
}
}
}
}
// Iterate over all commands that should be executed for matched files.
if (filesMatched.length) {
if (typeof commands === 'string') {
commands = [commands];
}
for (var c in commands) {
var command = commands[c];
console.log("\033[4;35mgit: {{ task }}\033[0;35m\n>> " + command + "\033[0m\n");
ret = exec(command);
console.log(ret.stdout);
exit = ret.status;
if (exit > 0) {
break;
}
}
}
// Display any errors.
if (exit > 0 && ret && ret.stderr) {
console.log(ret.stderr);
}
}
}
process.exit(exit);
# OS
.DS_Store
# Applications & Tools
.idea
bower_components
config.codekit
node_modules
npm-debug.log
# Project Specific
.libraries
lib
starterkits/*/bootstrap
var path = require('path');
module.exports = function (grunt) {
// Record grunt task execution times. Must be first.
require('time-grunt')(grunt);
// Register the "default" task.
grunt.registerTask('default', ['compile']);
// Register the "install" task.
grunt.registerTask('install', 'Installs or re-installs this grunt project. Read more in: docs/project/grunt.md.', ['githooks', 'sync', 'clean-vendor-dirs']);
// Load custom tasks.
grunt.task.loadTasks('grunt');
// Load npm installed 'grunt-*' tasks and configurations.
require('load-grunt-config')(grunt, {
configPath: path.join(process.cwd(), 'grunt', 'config')
});
};
This diff is collapsed.
<!-- @file Project Page -->
# Bootstrap
> Sleek, intuitive, and powerful mobile first front-end framework for faster and
> easier web development. Bootstrap has become one of the most popular front-end
> frameworks and open source projects in the world.
This base theme bridges the gap between Drupal and the [Bootstrap Framework].
### Features
- [jsDelivr CDN](http://www.jsdelivr.com) for "out-of-the-box" styling and
faster page load times.
- [Bootswatch](http://bootswatch.com) theme support, if using the CDN.
- Glyphicons support via [Icon API](https://www.drupal.org/project/icon).
- Extensive integration and template/preprocessor overrides for most of the
[Bootstrap Framework] CSS, Components and JavaScript
- Theme settings to further enhance the Drupal Bootstrap integration:
- [Breadcrumbs](http://getbootstrap.com/components/#breadcrumbs)
- [Navbar](http://getbootstrap.com/components/#navbar)
- [Popovers](http://getbootstrap.com/javascript/#popovers)
- [Tooltips](http://getbootstrap.com/javascript/#tooltips)
- [Wells](http://getbootstrap.com/components/#wells) (per region)
### Documentation
Visit the project's [official documentation site](http://drupal-bootstrap.org)
or the markdown files inside the `./docs` folder.
[Bootstrap Framework]: http://getbootstrap.com
<?php
/**
* @file
* List of available hook and alter APIs for use in your sub-theme.
*/
/**
* @defgroup api APIs
*
* List of available hook and alter APIs for use in your sub-theme.
*
* @{
*/
/**
* Allows sub-themes to alter the array used for colorizing text.
*
* @param array $texts
* An associative array containing the text and classes to be matched, passed
* by reference.
*
* @see _bootstrap_colorize_text()
*/
function hook_bootstrap_colorize_text_alter(&$texts) {
// This matches the exact string: "My Unique Button Text".
$texts['matches'][t('My Unique Button Text')] = 'primary';
// This would also match the string above, however the class returned would
// also be the one above; "matches" takes precedence over "contains".
$texts['contains'][t('Unique')] = 'notice';
// Remove matching for strings that contain "apply":
unset($texts['contains'][t('Apply')]);
// Change the class that matches "Rebuild" (originally "warning"):
$texts['contains'][t('Rebuild')] = 'success';
}
/**
* Allows sub-themes to alter the array used for associating an icon with text.
*
* @param array $texts
* An associative array containing the text and icons to be matched, passed
* by reference.
*
* @see _bootstrap_iconize_text()
*/
function hook_bootstrap_iconize_text_alter(&$texts) {
// This matches the exact string: "My Unique Button Text".
$texts['matches'][t('My Unique Button Text')] = 'heart';
// This would also match the string above, however the class returned would
// also be the one above; "matches" takes precedence over "contains".
$texts['contains'][t('Unique')] = 'bullhorn';
// Remove matching for strings that contain "filter":
unset($texts['contains'][t('Filter')]);
// Change the icon that matches "Upload" (originally "upload"):
$texts['contains'][t('Upload')] = 'ok';
}
/**
* This hook allows sub-themes to process all form elements.
*
* For this hook to be recognized, it must reside directly inside the
* template.php file or via a file that is directly included into template.php.
*
* Any time a hook is added or removed, the Drupal cache must be completely
* cleared and rebuilt for the changes to take effect.
*
* Implementations of this hook should check to see if the element has a
* property named #bootstrap_ignore_process and check if it is set to TRUE.
* If it is, the hook should immediately return with the unaltered element.
*
* @param array $element
* The element array, this is NOT passed by reference and must return the
* altered element instead.
* @param array $form_state
* The form state array, passed by reference.
* @param array $form
* The complete form array, passed by reference.
*
* @return array
* The altered element array.
*
* @see bootstrap_element_info_alter()
* @see form_builder()
* @see drupal_process_form()
*/
function hook_form_process($element, &$form_state, &$form) {
return $element;
}
/**
* This hook allows sub-themes to process a specific form element type.
*
* For this hook to be recognized, it must reside directly inside the
* template.php file or via a file that is directly included into template.php.
*
* Any time a hook is added or removed, the Drupal cache must be completely
* cleared and rebuilt for the changes to take effect.
*
* If there is a matching "form_process_HOOK" function already defined
* (provided by core), it will be replaced. The theme replacing it will be
* responsible for fully processing the element as it was prior.
*
* Implementations of this hook should check to see if the element has a
* property named #bootstrap_ignore_process and check if it is set to TRUE.
* If it is, the hook should immediately return with the unaltered element.
*
* @param array $element
* The element array, this is NOT passed by reference and must return the
* altered element instead.
* @param array $form_state
* The form state array, passed by reference.
* @param array $form
* The complete form array, passed by reference.
*
* @return array
* The altered element array.
*
* @see bootstrap_element_info_alter()
* @see form_builder()
* @see drupal_process_form()
*/
function hook_form_process_HOOK($element, &$form_state, &$form) {
return $element;
}
/**
* This hook allows sub-themes to alter all elements before it's rendered.
*
* For this hook to be recognized, it must reside directly inside the
* template.php file or via a file that is directly included into template.php.
*
* Any time a hook is added or removed, the Drupal cache must be completely
* cleared and rebuilt for the changes to take effect.
*
* Implementations of this hook should check to see if the element has a
* property named #bootstrap_ignore_pre_render and check if it is set to TRUE.
* If it is, the hook should immediately return with the unaltered element.
*
* @param array $element
* The element array, this is NOT passed by reference and must return the
* altered element instead.
*
* @return array
* The altered element array.
*
* @see bootstrap_element_info_alter()
*/
function hook_pre_render($element) {
return $element;
}
/**
* This hook allows sub-themes to alter a specific element before it's rendered.
*
* For this hook to be recognized, it must reside directly inside the
* template.php file or via a file that is directly included into template.php.
*
* Any time a hook is added or removed, the Drupal cache must be completely
* cleared and rebuilt for the changes to take effect.
*
* If there is a matching "form_pre_render_HOOK" function already defined
* (provided by core), it will be replaced. The theme replacing it will be
* responsible for fully processing the element as it was prior.
*
* Implementations of this hook should check to see if the element has a
* property named #bootstrap_ignore_pre_render and check if it is set to TRUE.
* If it is, the hook should immediately return with the unaltered element.
*
* @param array $element
* The element array, this is NOT passed by reference and must return the
* altered element instead.