Skip to content

Instantly share code, notes, and snippets.

View bratsun's full-sized avatar

Max Bratsun bratsun

View GitHub Profile
admin_menu adminimal_admin_menu backup_migrate bean block_class block_views blockreference browserclass cck_blocks ckeditor computed_field ctools custom_formatters date devel eck empty_fields entity entityreference entity_operations features field_collection field_formatter_class field_formatter_css_class field_formatter_settings field_group field_group_link field_group_background_image filefield_sources fontyourface google_analytics honeypot imageapi imagecache_actions imce inline_messages inline_entity_form jquery_ui jquery_update labjs libraries link menu_attributes menu_block menu_editor menu_trail_by_path metatag minify multiple_selects node_clone pathauto retina_images revision_all security_review simpletest superfish token transliteration token_formatters views views_php webform webform_ajax webform_hints xautoload xmlsitemap
$button = field_view_field('node', $node, 'field_author');
$button['#title'] = '';
print render($button);
$block = module_invoke('module', 'block_view', 'delta');
print render($block['content']);
-moz-transition: all 0.3s;
-ms-transition: all 0.3s;
-webkit-transition: all 0.3s;
-o-transition: all 0.3;
transition: all 0.3s;
background: -webkit-gradient(linear, left top, right top, from(#000000), to(#000000));
background: -webkit-linear-gradient(top, #000000, #000000);
background: -moz-linear-gradient(top, #000000, #000000);
background: -o-linear-gradient(top, #000000, #000000);
background: -ms-linear-gradient(top, #000000, #000000);
background: linear-gradient(top, #000000, #000000);
background-color: #000000;
@bratsun
bratsun / Get image URL from URI.php
Created October 5, 2013 07:35
Print image / image URL
file_create_url($image[0]['uri']);
@bratsun
bratsun / callbacks-views.js
Created October 18, 2013 23:23
AJAX callbacks
Drupal.behaviors.AjaxChecker = {
attach: function(context, settings) {
$('#views-exposed-form-prods-page').ajaxComplete(function(event, xhr, settings) {
$('.loader').hide(0);
});
}
}
@bratsun
bratsun / messages.php
Created October 19, 2013 00:38
Messages hook - one message is also a list (ul)
function theme_status_messages($variables) {
$display = $variables['display'];
$output = '';
$status_heading = array(
'status' => t('Status message'),
'error' => t('Error message'),
'warning' => t('Warning message'),
);
foreach (drupal_get_messages($display) as $type => $messages) {
@bratsun
bratsun / webformSelect.js
Created October 19, 2013 01:29
Alter selects to grey out on default value and to light up on change
function webformSelect() {
$('.webform-component-select').each(function() {
var t = $(this);
var text = t.find('label').text().replace(' *','');
t.find('option:first').addClass('first').text('Select ' + text);
t.find('select').live('change', function () {
if($(this).find('option:selected').hasClass('first')) $(this).addClass('idle');
else $(this).removeClass('idle');
});
t.find('select').change();
@bratsun
bratsun / seven_format_type.css
Created October 24, 2013 16:45
Hide annoying text format tips and ckeditor switch link.
.ckeditor_links,
.filter-guidelines,
.filter-help,
.filter-wrapper .form-type-select label {
display: none !important;
}