This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
// Open external links in a new window, except AddThis | |
$("a[href^='http']") | |
.not("[href^=#]") | |
.not("[href^=mailto]") | |
.not("href*=example.com") | |
.not("href*=addthis.com") | |
.addClass("link-external") | |
.attr('target', '_blank'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implements theme_search_theme_form() | |
*/ | |
function p6_search_theme_form($form) { | |
$form['search_theme_form']['#title'] = t('Search this site'); | |
$form['search_theme_form']['#default_value'] = ''; | |
$form['search_theme_form']['#attributes']['title'] = t('Enter the terms you wish to search for.'); | |
$form['search_theme_form']['#description'] = t('Enter the terms you wish to search for.'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* String overrides: | |
* | |
* To override specific strings on your site with or without enabling locale | |
* module, add an entry to this list. This functionality allows you to change | |
* a small number of your site's default English language interface strings. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Disable access to 'Permissions' page. | |
* | |
* Even the role has 'administer permissions' enabled, users will not be able to | |
* access to 'Permissions' page, but be able to use all other functionality | |
* this permission grants them. i.e. (de-)assigning roles to selected users. | |
*/ | |
function hook_menu_alter(&$items) { | |
global $user; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Sitemap */ | |
#ui-content .ui-block-menu_block { | |
font-size: 13px; | |
} | |
#ui-content .ui-block-menu_block ul { | |
line-height: 1; | |
margin: 0; | |
float: left; | |
padding: 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implements hook_entity_info_alter(). | |
*/ | |
function MYMODULE_entity_info_alter(&$info) { | |
$info['node']['view_modes'] += array( | |
'node_feature' => array( | |
'label' => t('Featured'), | |
'custom settings' => TRUE, | |
), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function () { | |
$('<div id="WINDOW_SIZE">' + $(window).width() + 'x' + $(window).height() + '</div>') | |
.attr('unselectable', 'on') | |
.css({ | |
'position' : 'fixed', | |
'bottom' : 0, | |
'right' : 0, | |
'background' : '#000000', | |
'color' : '#FFFFFF', | |
'font' : '16px/1 sans-serif', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset=utf-8 /> | |
<title>404 - Page not found!</title> | |
<style> | |
html, body { | |
background: #222; | |
color: #EEE; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Sends a simple email. | |
* [or] Tested on 2012-05-31 using Drupal 7.12 | |
* | |
* Usage: | |
* 1) Paste all the below code into your module or include | |
* 2) Configure the two @FIXME's. | |
* 3) Visit /_custom_simple_mail to get an email. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Load JavaScript Asynchronously | |
* | |
* usage: _async('//example.com/script.js', 'dom-id'); | |
*/ | |
function _async(src, id) { | |
setTimeout( | |
function(d, s, id) { | |
var js, fjs = d.getElementsByTagName(s)[0]; | |
if (d.getElementById(id)) { |
OlderNewer