| <?php | |
| drupal_add_js('misc/ajax.js'); | |
| ctools_add_js('modal'); | |
| ctools_add_css('modal'); | |
| // Add your modal style to the settings. You find the defaults in modal.js near the top: | |
| drupal_add_js(array( | |
| 'my-modal-style' => array( | |
| 'modalSize' => array( |
| //This input should be from somewhere else, hard-coded in this example | |
| $file_name = '2013-07-16.dump.gz'; | |
| // Raising this value may increase performance | |
| $buffer_size = 4096; // read 4kb at a time | |
| $out_file_name = str_replace('.gz', '', $file_name); | |
| // Open our files (in binary mode) | |
| $file = gzopen($file_name, 'rb'); | |
| $out_file = fopen($out_file_name, 'wb'); | |
| // Keep repeating until the end of the input file | |
| while(!gzeof($file)) { |
| name: 'Ajax Example' | |
| description: 'Just an Ajax Example' | |
| core: 8.x | |
| type: module |
2015-01-29 Unofficial Relay FAQ
Compilation of questions and answers about Relay from React.js Conf.
Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.
Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).
| /** | |
| * @file | |
| * | |
| * Overrides the default Ajax progress indicator to do things like change the | |
| * styling and positioning. | |
| */ | |
| (function ($) { | |
| // Drupal's core beforeSend function | |
| var beforeSend = Drupal.ajax.prototype.beforeSend; |
| // Get image settings array from a field on the node | |
| $image = field_get_items('node', $node, 'INSERT_IMAGE_FIELD_MACHINE_NAME'); | |
| // Picture settings | |
| $picture_mapping = picture_mapping_load('INSERT_PICTURE_MAPPING_MACHINE_NAME'); | |
| $fallback = 'INSERT_IMAGE_STYLE_MACHINE_NAME'; | |
| $breakpoints = picture_get_mapping_breakpoints($picture_mapping, $fallback); | |
| // Create a new variable to pass through to the node template | |
| $variables['INSERT_NEW_VARIABLE_NAME_TO_PASS_TO_NODE_TEMPLATE'] = theme('picture', array('uri' => $image[0]['uri'], 'style_name' => $fallback, 'breakpoints' => $breakpoints)); |
Note The extension Imagick is now included in Ondrej's PPA. All you need to do now is
$ sudo apt-get install php-imagick, and you're done. I'll keep the guide here because a lot of it is still true for other extensions
======
I've installed PHP7 via Ondrej's PPA. He maintains these PPA's on his free time, consider donating
| input.form-submit.button-small { | |
| padding: 4px 8px; | |
| font-weight: bold; | |
| } | |
| .container-inline input.form-submit.button-small + .ajax-progress.ajax-progress-throbber .throbber { | |
| position: absolute; | |
| left: 19px; | |
| margin-top: 7px; | |
| } |