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
/** | |
* Implements hook_wysiwyg_editor_settings_alter(). | |
*/ | |
function hook_wysiwyg_editor_settings_alter(&$settings, $context) { | |
if ($context['profile']->editor == 'tinymce') { | |
// Add custom styles for the styleselect plugin. | |
if (!isset($settings['style_formats'])) { | |
$settings['style_formats'] = array(); | |
} | |
$settings['style_formats'][] = array('title' => t('Image left aligned'), 'selector' => 'img', 'classes' => 'image-align-left'); |
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
/** | |
* Controlling Undo with doScript | |
* | |
* InDesign gives you the ability to undo almost every action, but this comes at a price: for almost every | |
* action you make, InDesign writes to disk. For normal work you using the tools presented by the user | |
* interface, this does not present any problem. For scripts, which can perform thousands of actions in the | |
* time a human being can blink, the constant disk access can be a serious drag on performance. | |
* The doScript method offers a way around this performance bottleneck by providing two parameters that | |
* control the way that scripts are executed relative to InDesign’s Undo behavior. These parameters are | |
* shown in the following examples: |
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
Search: | |
^(\s*)\$\w+\[(['"][^'"]+['"])\]\s*=\s*(.+);$ | |
Replace: | |
$1$2 => $3, |