diff --git a/sites/all/modules/block_class/README.txt b/sites/all/modules/block_class/README.txt index 516845f..56730da 100644 --- a/sites/all/modules/block_class/README.txt +++ b/sites/all/modules/block_class/README.txt @@ -2,7 +2,8 @@ Block Class http://drupal.org/project/block_class ----- -Block Class was developed and is maintained by Four Kitchens . +Block Class was developed and is maintained by Four Kitchens +. ===== @@ -10,4 +11,5 @@ Installation ----- 1. Enable the module -2. To add a class to a block, simply visit that block's configuration page at Administration > Structure > Blocks +2. To add a class to a block, simply visit that block's configuration page at +Administration > Structure > Blocks diff --git a/sites/all/modules/block_class/block_class.features.inc b/sites/all/modules/block_class/block_class.features.inc deleted file mode 100644 index 142493b..0000000 --- a/sites/all/modules/block_class/block_class.features.inc +++ /dev/null @@ -1,74 +0,0 @@ -addExpression("CONCAT(bc.module, ':', bc.delta)"); - $blocks = $query->execute()->fetchAllKeyed(0, 0); - - natcasesort($blocks); - return $blocks; -} - -/** - * Implements hook_features_export(). - */ -function block_class_features_export($data, &$export, $module_name = '') { - $pipe = array(); - - $export['dependencies']['features'] = 'features'; - $export['dependencies']['block_class'] = 'block_class'; - - foreach ($data as $component) { - $export['features']['block_class'][$component] = $component; - } - - return $pipe; -} - -/** - * Implements hook_features_export_render(). - */ -function block_class_features_export_render($module, $data) { - $query = db_select('block_class', 'bc'); - $query->addExpression("CONCAT(bc.module, ':', bc.delta)", 'id'); - $query->addField('bc', 'css_class'); - $classes = $query->execute()->fetchAllKeyed(1, 0); - - $code = array(); - foreach ($data as $id) { - if (isset($classes[$id])) { - list($module, $delta) = explode(':', $id); - $css_classes = $classes[$id]; - $code[$id] = compact('module', 'delta', 'css_classes'); - } - } - - $code = " return ". features_var_export($code, ' ') .";"; - - return array('block_class_features_default_class' => $code); -} - -/** - * Implements hook_features_revert(). - */ -function block_class_features_revert($module) { - block_class_features_rebuild($module); -} - -/** - * Implements hook_features_rebuild(). - */ -function block_class_features_rebuild($module) { - $blocks = module_invoke($module, 'block_class_features_default_class'); - if ($blocks) { - foreach($blocks as $block) { - db_delete('block_class')->condition('module', $block['module'])->condition('delta', $block['delta'])->execute(); - if (!empty($block['css_classes'])) { - $id = db_insert('block_class')->fields(array('module' => $block['module'], 'delta' => $block['delta'], 'css_class' => $block['css_classes']))->execute(); - } - } - } -} diff --git a/sites/all/modules/block_class/block_class.info b/sites/all/modules/block_class/block_class.info index 39aa031..2479fc9 100644 --- a/sites/all/modules/block_class/block_class.info +++ b/sites/all/modules/block_class/block_class.info @@ -2,12 +2,15 @@ name = Block Class description = Allows assigning CSS classes to blocks. core = 7.x -files[] = block_class.install -files[] = block_class.module +dependencies[] = block +files[] = block_class.test +test_dependencies[] = context +test_dependencies[] = features (2.x) +test_dependencies[] = features_extra -; Information added by drupal.org packaging script on 2012-10-04 -version = "7.x-1.2+3-dev" +; Information added by Drupal.org packaging script on 2015-12-18 +version = "7.x-2.3" core = "7.x" project = "block_class" -datestamp = "1349309175" +datestamp = "1450415951" diff --git a/sites/all/modules/block_class/block_class.install b/sites/all/modules/block_class/block_class.install index 0582d45..adedd98 100644 --- a/sites/all/modules/block_class/block_class.install +++ b/sites/all/modules/block_class/block_class.install @@ -6,102 +6,146 @@ */ /** - * Implementation of hook_schema(). + * Implements hook_install(). */ -function block_class_schema() { - $schema['block_class'] = array( - 'fields' => array( - 'module' => array( - 'type' => 'varchar', - 'length' => 64, - 'not null' => TRUE, - 'default' => '', - 'description' => 'The module to which the block belongs.', - ), - 'delta' => array( - 'type' => 'varchar', - 'length' => 32, - 'not null' => TRUE, - 'default' => '', - 'description' => "The ID of the module's block.", - ), - 'css_class' => array( - 'type' => 'varchar', - 'length' => 255, - 'not null' => TRUE, - 'default' => '', - 'description' => 'String containing the classes for the block.', - ), - ), - 'primary key' => array('module', 'delta'), - ); +function block_class_install() { + $schema['block'] = array(); + block_class_schema_alter($schema); + foreach ($schema['block']['fields'] as $field => $spec) { + if (db_field_exists('block', $field)) { + watchdog('system', 'Module install: Attempt to recreate field: "%field", when it already exists.', array('%field' => $field), WATCHDOG_WARNING); + } + else { + db_add_field('block', $field, $spec); + } + } +} - return $schema; +/** + * Implements hook_uninstall(). + */ +function block_class_uninstall() { + $schema['block'] = array(); + block_class_schema_alter($schema); + foreach ($schema['block']['fields'] as $field => $specs) { + db_drop_field('block', $field); + } +} + +/** + * Implements hook_schema_alter(). + * + * Other modules, such as i18n_block also modify the block database table. + */ +function block_class_schema_alter(&$schema) { + if (isset($schema['block'])) { + $schema['block']['fields']['css_class'] = array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + 'description' => 'String containing the classes for the block.', + ); + } } /** * Alters the structure of {block_class} schema. */ function block_class_update_7100() { - // Update the schema. - db_drop_primary_key('block_class'); + // Check if the block_class table exists to prevent installation profiles + // from running this update for versions without the block_class table. + if (db_table_exists('block_class')) { + // Update the schema. + db_drop_primary_key('block_class'); - db_change_field('block_class', 'module', 'module', - array( - 'type' => 'varchar', - 'length' => '255', - 'not null' => TRUE, - 'default' => '', - 'description' => 'The module to which the block belongs.', - ) - ); + db_change_field('block_class', 'module', 'module', + array( + 'type' => 'varchar', + 'length' => '64', + 'not null' => TRUE, + 'default' => '', + 'description' => 'The module to which the block belongs.', + ) + ); - db_change_field('block_class', 'delta', 'delta', - array( - 'type' => 'varchar', - 'length' => '255', - 'not null' => TRUE, - 'default' => '', - 'description' => "The ID of the module's block.", - ) - ); + db_change_field('block_class', 'delta', 'delta', + array( + 'type' => 'varchar', + 'length' => '32', + 'not null' => TRUE, + 'default' => '', + 'description' => "The ID of the module's block.", + ) + ); - db_change_field('block_class', 'css_class', 'css_class', - array( - 'type' => 'varchar', - 'length' => '255', - 'not null' => TRUE, - 'default' => '', - 'description' => 'String containing the classes for the block.', - ) - ); + db_change_field('block_class', 'css_class', 'css_class', + array( + 'type' => 'varchar', + 'length' => '255', + 'not null' => TRUE, + 'default' => '', + 'description' => 'String containing the classes for the block.', + ) + ); - // Restore the primary key. - db_add_primary_key('block_class', array('module', 'delta')); + // Restore the primary key. + db_add_primary_key('block_class', array('module', 'delta')); + } } /** * Fix too long primary key length in {block_class}. */ function block_class_update_7101() { - // Drop current primary key. - db_drop_primary_key('block_class'); + // Ensure the block_class table exists, which is not true for all versions. + if (db_table_exists('block_class')) { + // Drop current primary key. + db_drop_primary_key('block_class'); - db_change_field('block_class', 'module', 'module', array( - 'type' => 'varchar', - 'length' => 64, - 'not null' => TRUE, - 'default' => '', - 'description' => 'The module to which the block belongs.', - )); - db_change_field('block_class', 'delta', 'delta', array( - 'type' => 'varchar', - 'length' => 32, - 'not null' => TRUE, - 'default' => '', - 'description' => "The ID of the module's block.", - )); + db_change_field('block_class', 'module', 'module', array( + 'type' => 'varchar', + 'length' => 64, + 'not null' => TRUE, + 'default' => '', + 'description' => 'The module to which the block belongs.', + )); + db_change_field('block_class', 'delta', 'delta', array( + 'type' => 'varchar', + 'length' => 32, + 'not null' => TRUE, + 'default' => '', + 'description' => "The ID of the module's block.", + )); - // Create new primary key. - db_add_primary_key('block_class', array('module', 'delta')); + // Create new primary key. + db_add_primary_key('block_class', array('module', 'delta')); + } +} + +/** + * Migration from block_class table to new field css_class in core block table. + */ +function block_class_update_7103() { + if (!db_field_exists('block', 'block_class')) { + $schema['block'] = array(); + block_class_schema_alter($schema); + foreach ($schema['block']['fields'] as $field => $specs) { + db_add_field('block', $field, $specs); + } + } + + if (db_table_exists('block_class')) { + // Migrate all existing records from block_class table to block table. + $result = db_query('SELECT css_class, module, delta FROM {block_class}'); + while ($record = $result->fetchObject()) { + db_update('block') + ->fields(array('css_class' => $record->css_class)) + ->condition('module', $record->module) + ->condition('delta', $record->delta) + ->execute(); + } + // Remove the block_class table. + db_drop_table('block_class'); + } } diff --git a/sites/all/modules/block_class/block_class.module b/sites/all/modules/block_class/block_class.module index 9dc7386..f3eaadb 100644 --- a/sites/all/modules/block_class/block_class.module +++ b/sites/all/modules/block_class/block_class.module @@ -1,5 +1,15 @@ fetchObject()) { - $_block_class_blocks_classes[$record->module][$record->delta] = $record->css_class; + if (!empty($block->css_class)) { + $classes_array = explode(' ', $block->css_class); + foreach ($classes_array as $class) { + $vars['classes_array'][] = drupal_clean_css_identifier($class, array()); } } - - if (isset($_block_class_blocks_classes[$block->module][$block->delta])) { - $classes = $_block_class_blocks_classes[$block->module][$block->delta]; - $vars['classes_array'] = array_merge($vars['classes_array'], explode(' ', $classes)); - } } - -/* +/** + * Implements hook_preprocess_HOOK(). + * * Extend panel block's classes with any user defined classes. - * Implements hook_preprocess_hook() */ function block_class_preprocess_panels_pane(&$vars) { if ($vars['pane']->type != 'block') { @@ -52,42 +50,32 @@ function block_class_preprocess_panels_pane(&$vars) { $block_parts = explode('-', $vars['pane']->subtype); // Load the block based on the block parts. $block = block_load($block_parts[0], $block_parts[1]); - // Return block_class classes as string. - $css_class = block_class($block); // Add a generic 'module type' pane class. $vars['classes_array'][] = drupal_html_class('pane-' . $block->module); // Add $css_class to the $classes_array. - $vars['classes_array'][] = $css_class; + if (!empty($block->css_class)) { + $classes_array = explode(' ', $block->css_class); + foreach ($classes_array as $class) { + $vars['classes_array'][] = drupal_clean_css_identifier($class, array()); + } + } } - /** - * Return classes as string - */ -function block_class($block) { - $ret = db_query('SELECT css_class FROM {block_class} WHERE module = :module AND delta = :delta', array(':module' => $block->module, ':delta' => $block->delta))->fetchField(); - return $ret ? check_plain ($ret) : ''; -} - - -/** - * Alter block edit form + * Implements hook_form_alter(). + * + * Alter block edit form to add configuration field. */ function block_class_form_alter(&$form, &$form_state, $form_id) { - if (user_access('administer block classes') && $form_id == 'block_admin_configure' || $form_id == 'block_add_block_form') { - $block = new stdClass; - $block->module = $form['module']['#value']; - $block->delta = $form['delta']['#value']; - $css_class = block_class($block); - - // Create a more technical description for users with administer blocks permission. - $description = t('Customize the styling of this block by adding CSS classes. Separate multiple classes by spaces.'); + if (user_access('administer block classes') && ($form_id == 'block_admin_configure' || $form_id == 'block_add_block_form')) { + // Load statically cached block object used to display the form. + $block = block_load($form['module']['#value'], $form['delta']['#value']); $form['settings']['css_class'] = array( '#type' => 'textfield', '#title' => t('CSS class(es)'), - '#default_value' => $css_class, - '#description' => t('Separate classes with a space.'), + '#default_value' => isset($block->css_class) ? $block->css_class : '', + '#description' => t('Customize the styling of this block by adding CSS classes. Separate multiple classes by spaces.'), '#maxlength' => 255, ); @@ -95,34 +83,24 @@ function block_class_form_alter(&$form, &$form_state, $form_id) { } } - /** - * Save supplied class. + * Helper function: additional submit callback for block configuration pages. + * + * Save supplied CSS classes. */ function block_class_form_submit($form, &$form_state) { if ($form_state['values']['form_id'] == 'block_admin_configure' || $form_state['values']['form_id'] == 'block_add_block_form') { - if (isset($form_state['values']['css_class']) && user_access('administer blocks')) { - $module = $form_state['values']['module']; - $delta = $form_state['values']['delta']; - $class = $form_state['values']['css_class']; - db_delete('block_class')->condition('module', $module)->condition('delta', $delta)->execute(); - if (!empty($class)) { - $id = db_insert('block_class')->fields(array('module' => $module, 'delta' => $delta, 'css_class' => $class))->execute(); + // Only save if value has changed. + if (isset($form_state['values']['css_class']) && $form['settings']['css_class']['#default_value'] != $form_state['values']['css_class'] && user_access('administer blocks')) { + db_update('block') + ->fields(array('css_class' => $form_state['values']['css_class'])) + ->condition('module', $form_state['values']['module']) + ->condition('delta', $form_state['values']['delta']) + ->execute(); + // Flush all context module cache to use the updated css_class. + if (module_exists('context')) { + cache_clear_all('context', 'cache', TRUE); } } } } - -/** - * Implements hook_features_api(). - */ -function block_class_features_api() { - return array( - 'block_class' => array( - 'name' => t('Block class'), - 'feature_source' => TRUE, - 'default_hook' => 'block_class_features_default_class', - 'file' => drupal_get_path('module', 'block_class') . '/block_class.features.inc', - ), - ); -} diff --git a/sites/all/modules/block_class/block_class.test b/sites/all/modules/block_class/block_class.test new file mode 100644 index 0000000..ce8d3fa --- /dev/null +++ b/sites/all/modules/block_class/block_class.test @@ -0,0 +1,329 @@ +privilegedUser = $this->drupalCreateUser($this->permissions); + $this->drupalLogin($this->privilegedUser); + } + + /** + * Update Block CSS class and assert whether it is found when displayed. + * + * @param bool $anon + * (optional) Set to TRUE to view block with anon user, defaults to TRUE. + * @param string $module + * (optional) Machine name of the module Defaults to + * $this->module if set to NULL. + * @param string $delta + * (optional) Block delta as provided by its module. Defaults to + * $this->delta if set to NULL. + */ + public function assertUpdateBlockClass($anon = FALSE, $module = NULL, $delta = NULL) { + // Initialize $module and $delta by default if no value is provided. + if (!isset($module)) { + $module = $this->module; + } + if (!isset($delta)) { + $delta = $this->delta; + } + // Test with three random class names. + $css_classes = implode(' ', array( + $this->randomName(8), + $this->randomName(8), + $this->randomName(8), + )); + // Update Block CSS class field. + $this->drupalPost("admin/structure/block/manage/$module/$delta/configure", array('css_class' => $css_classes), t('Save block')); + // Check Block configuration was saved successfully. + $this->assertText(t('The block configuration has been saved.')); + // Browse to the homepage. + $this->drupalGet(''); + // Log out if the test is for anonymous user. + if ($anon) { + $this->drupalLogout(); + // Browse back to the homepage. + $this->drupalGet(''); + } + // Check if the Block CSS classes could be found. + $this->assertPattern('/class=\"(.*?)' . $css_classes . '(.*?)\"/', format_string('The CSS classes were found: @css_classes', array('@css_classes' => $css_classes))); + // Login again after testing with the anonumous user. + if ($anon) { + $this->drupalLogin($this->privilegedUser); + } + } +} + +/** + * Test the update and display of the CSS class for a Block. + */ +class BlockClassUpdateDisplayTestCase extends BlockClassTestCase { + + /** + * Implements DrupalWebTestCase::getInfo(). + */ + public static function getInfo() { + return array( + 'name' => 'Block CSS class update and display', + 'description' => 'Test the update of a Block CSS class field and the display for the Main Page Content Block.', + 'group' => 'Block Class', + ); + } + + /** + * Update and display a Block multiple times to ensure CSS class is found. + * + * A Block is updated and displayed several times and with logged in or + * anonymous user, with Block cache turned enabled or disabled. + */ + public function testUpdateDisplayClass() { + // Edit the block, change the class and check if the CSS classes are found. + $this->assertUpdateBlockClass(); + + // Now, turn on caching programmatically and set it to 15 min expiry. + variable_set('block_cache', TRUE); + variable_set('cache_lifetime', 900); + variable_set('page_cache_maximum_age', 900); + + // Edit the block, change the class and check with the anonymous user. + $this->assertUpdateBlockClass(TRUE); + + // Edit the block, change the class and check with the anonymous user. + $this->assertUpdateBlockClass(TRUE); + } +} + +/** + * Test Block Class permissions. + */ +class BlockClassPermissionTestCase extends BlockClassTestCase { + + /** + * Implements DrupalWebTestCase::getInfo(). + */ + public static function getInfo() { + return array( + 'name' => 'Administer block classes permission', + 'description' => 'Test the permission added by the module to administer block classes.', + 'group' => 'Block Class', + ); + } + + /** + * Enable modules and create user with specific permissions. + */ + public function setUp() { + // Remove the 'administer block classes' permission from the base class. + $this->permissions = array('administer blocks'); + parent::setUp(); + } + + /** + * Ensure Block CSS classes field is only visible with the right permissions. + * + * Test if a user without 'administer block classes' permission has access to + * the Block CSS classes field on the block configuration page. + */ + public function testPermission() { + // Browse to the "Main page content" block editing form page. + $this->drupalGet("admin/structure/block/manage/{$this->module}/{$this->delta}/configure"); + // Check that the css_class field couldn't be found. + // If the field is not found, it can't be submitted through drupalPost. + $this->assertNoFieldById('css_class', 'The Css classes field was not found on the page.'); + } +} + +/** + * Test Block Class integration with Context. + */ +class BlockClassContextTestCase extends BlockClassUpdateDisplayTestCase { + + /** + * Implements DrupalWebTestCase::getInfo(). + */ + public static function getInfo() { + return array( + 'name' => 'Integration with Context', + 'description' => 'Test the integration of Block Class with the Context module and the update/display of a Block CSS class.', + // Include required contributed modules context and ctools for the test. + 'dependencies' => array('context', 'ctools'), + 'group' => 'Block Class', + ); + } + + /** + * Enable modules and create user with specific permissions. + */ + public function setUp() { + // Override default module and delta to test with the "Who's online" block. + $this->module = 'user'; + $this->delta = 'online'; + // Include the Context module and its dependencies to be loaded. + parent::setUp('context'); + // Initialize a test context with the test block. + $this->initializeContext(); + } + + /** + * Helper function to initialize a test Context with a test block. + */ + public function initializeContext() { + // Import a basic context exported through the admin interface. + $context = new stdClass(); + $context->disabled = FALSE; + $context->api_version = 3; + $context->name = 'front'; + $context->description = 'Frontpage Context'; + $context->tag = ''; + $context->conditions = array( + 'path' => array( + 'values' => array( + '' => '', + ), + ), + ); + $context->reactions = array( + 'block' => array( + 'blocks' => array( + $this->module . '-' . $this->delta => array( + 'module' => $this->module, + 'delta' => $this->delta, + 'region' => 'content', + 'weight' => '-10', + ), + ), + ), + ); + $context->condition_mode = 0; + + // Translatables + // Included for use with string extractors like potx. + t('Frontpage Context'); + + // Save the context. + context_save($context); + } +} + +/** + * Test Block Class integration with Features through FE Block. + */ +class BlockClassFeaturesTestCase extends BlockClassTestCase { + + /** + * Implements DrupalWebTestCase::getInfo(). + */ + public static function getInfo() { + return array( + 'name' => 'Integration with Features', + 'description' => 'Test the integration of Block Class with Features through the FE Block module and the update/display of a Block CSS class.', + // Include Features related modules required for this Test Case. + 'dependencies' => array('features', 'ctools', 'fe_block'), + 'group' => 'Block Class', + ); + } + + /** + * Enable modules and create user with specific permissions. + */ + public function setUp() { + // Override default module and delta to test with the "Who's online" block. + $this->module = 'user'; + $this->delta = 'online'; + // Include all Features related modules and Test Helper feature. + parent::setUp('block_class_fe_block_test'); + } + + /** + * Test how Block Class reacts when exported to a Feature with FE Block. + * + * Helper Feature's Block configuration settings are imported, updated and + * the display is tested several times, before reverting the feature. + */ + public function testFeatureDisplayClass() { + // Block classes exported to the Test Feature module. + $test_classes = 'fe_block-class1 fe_block-class2 fe_block-class3'; + // Test helper feature machine name. + $test_feature = 'block_class_fe_block_test'; + + // Browse to the front page and check Block's CSS classes configuration. + $this->drupalGet(''); + // Check if feature's Block CSS classes could be found. + $this->assertPattern('/class=\"(.*?)' . $test_classes . '(.*?)\"/', format_string('The CSS classes from exported feature were found: @css_classes', array('@css_classes' => $test_classes))); + + // Check Block's configuration form css_class field value. + $this->drupalGet("admin/structure/block/manage/{$this->module}/{$this->delta}/configure"); + $this->assertFieldByName('css_class', $test_classes, format_string('The CSS classes from exported feature were found for the field css_class in the Block\'s configuration page: @css_classes', array('@css_classes' => $test_classes))); + + // Run a standard Update/Display Test check with Anon. + $this->assertUpdateBlockClass(TRUE); + + // Ensure Feature's state is overriden for 'fe_block_settings' component. + module_load_include('inc', 'features', 'features.export'); + $test_feature_state = features_get_storage($test_feature); + $this->assertFalse(empty($test_feature_state), 'The state of the Block Class FE Block Integration Test Helper feature is Overridden.'); + $test_feature_states = features_get_component_states(array($test_feature)); + $this->assertFalse(empty($test_feature_states[$test_feature]['fe_block_settings']), 'The state of the fe_block_settings component of the Block Class FE Block Integration Test Helper feature is Overridden.'); + + // Revert feature and check again. + features_revert_module($test_feature); + + // Browse to the front page and check Block's CSS classes configuration. + $this->drupalGet(''); + // Check if feature's Block CSS classes could be found. + $this->assertPattern('/class=\"(.*?)' . $test_classes . '(.*?)\"/', format_string('After reverting the feature, the CSS classes from exported feature were found: @css_classes', array('@css_classes' => $test_classes))); + + // Check Block's configuration form css_class field value. + $this->drupalGet("admin/structure/block/manage/{$this->module}/{$this->delta}/configure"); + $this->assertFieldByName('css_class', $test_classes, format_string('After reverting the feature, the CSS classes from exported feature were found for the field css_class in the Block\'s configuration page: @css_classes', array('@css_classes' => $test_classes))); + } +} diff --git a/sites/all/modules/block_class/tests/block_class_fe_block_test.features.fe_block_settings.inc b/sites/all/modules/block_class/tests/block_class_fe_block_test.features.fe_block_settings.inc new file mode 100644 index 0000000..86fec18 --- /dev/null +++ b/sites/all/modules/block_class/tests/block_class_fe_block_test.features.fe_block_settings.inc @@ -0,0 +1,37 @@ + -1, + 'css_class' => 'fe_block-class1 fe_block-class2 fe_block-class3', + 'custom' => 0, + 'delta' => 'online', + 'module' => 'user', + 'node_types' => array(), + 'pages' => '', + 'roles' => array(), + 'themes' => array( + 'bartik' => array( + 'region' => 'content', + 'status' => 1, + 'theme' => 'bartik', + 'weight' => -7, + ), + ), + 'title' => 'Block Class Test Who\'s Online with FE Block', + 'visibility' => 1, + ); + + return $export; +} diff --git a/sites/all/modules/block_class/tests/block_class_fe_block_test.info b/sites/all/modules/block_class/tests/block_class_fe_block_test.info new file mode 100644 index 0000000..1f4fe1a --- /dev/null +++ b/sites/all/modules/block_class/tests/block_class_fe_block_test.info @@ -0,0 +1,15 @@ +name = Block Class FE Block Integration Test Helper +description = Helper module for testing the integration of Block Class with Features through the FE Block module. +core = 7.x +package = Features +dependencies[] = fe_block +features[fe_block_settings][] = user-online +features[features_api][] = api:2 +hidden = TRUE + +; Information added by Drupal.org packaging script on 2015-12-18 +version = "7.x-2.3" +core = "7.x" +project = "block_class" +datestamp = "1450415951" + diff --git a/sites/all/modules/block_class/tests/block_class_fe_block_test.module b/sites/all/modules/block_class/tests/block_class_fe_block_test.module new file mode 100644 index 0000000..44788b0 --- /dev/null +++ b/sites/all/modules/block_class/tests/block_class_fe_block_test.module @@ -0,0 +1,5 @@ + tag. * - __title__: The Title text, intended for use in the tag. * - __description__: A description of the image, sometimes used as a caption. + * - __filename__: The file name. + * - __[token]_or_filename__: Any of the above tokens if available, otherwise + * use the file's name. i.e. __title_or_filename__. */ ?> -__alt__ \ No newline at end of file + + width="" height="" alt="__alt__" title="__title__" class="" /> + diff --git a/sites/all/modules/colorbox/colorbox.admin.inc b/sites/all/modules/colorbox/colorbox.admin.inc index 8b5fc20..44b030a 100644 --- a/sites/all/modules/colorbox/colorbox.admin.inc +++ b/sites/all/modules/colorbox/colorbox.admin.inc @@ -44,7 +44,7 @@ function colorbox_admin_settings() { '#type' => 'checkbox', '#title' => t('Enable Colorbox load'), '#default_value' => variable_get('colorbox_load', 0), - '#description' => t('This enables custom links that can open forms and paths in a Colorbox. Add the class "colorbox-load" to the link and build the url like this for forms "/colorbox/form/[form_id]?destination=some_path&width=500&height=500" and like this for paths "[path]?width=500&height=500&iframe=true" or "[path]?width=500&height=500" if you don\'t want an iframe. Other modules may activate this for easy Colorbox integration.'), + '#description' => t('This enables custom links that can open forms and paths in a Colorbox. Add the class "colorbox-load" to the link and build the url like this for paths "[path]?width=500&height=500&iframe=true" or "[path]?width=500&height=500" if you don\'t want an iframe. Other modules may activate this for easy Colorbox integration.'), ); $form['colorbox_extra_features']['colorbox_inline'] = array( '#type' => 'checkbox', @@ -143,7 +143,7 @@ function colorbox_admin_settings() { '#type' => 'checkbox', '#title' => t('Overlay close'), '#default_value' => variable_get('colorbox_overlayclose', 1), - '#description' => t('Enable closing ColorBox by clicking on the background overlay.'), + '#description' => t('Enable closing Colorbox by clicking on the background overlay.'), ); $form['colorbox_custom_settings']['colorbox_maxwidth'] = array( '#type' => 'textfield', @@ -177,7 +177,7 @@ function colorbox_admin_settings() { '#type' => 'checkbox', '#title' => t('Fixed'), '#default_value' => variable_get('colorbox_fixed', 1), - '#description' => t('If the ColorBox should be displayed in a fixed position within the visitor\'s viewport or relative to the document.'), + '#description' => t('If the Colorbox should be displayed in a fixed position within the visitor\'s viewport or relative to the document.'), ); $form['colorbox_custom_settings']['colorbox_slideshow_settings'] = array( @@ -198,7 +198,7 @@ function colorbox_admin_settings() { $form['colorbox_custom_settings']['colorbox_scrolling'] = array( '#type' => 'radios', '#title' => t('Scrollbars'), - '#options' => array(0 => t('Off'), 1 => t('On')), + '#options' => array(1 => t('On'), 0 => t('Off')), '#default_value' => variable_get('colorbox_scrolling', 1), '#description' => t('If false, Colorbox will hide scrollbars for overflowing content. This could be used on conjunction with the resize method for a smoother transition if you are appending content to an already open instance of Colorbox.'), ); @@ -250,6 +250,32 @@ function colorbox_admin_settings() { '#collapsible' => TRUE, '#collapsed' => TRUE, ); + $form['colorbox_advanced_settings']['colorbox_unique_token'] = array( + '#type' => 'radios', + '#title' => t('Unique per-request gallery token'), + '#options' => array(1 => t('On'), 0 => t('Off')), + '#default_value' => variable_get('colorbox_unique_token', 1), + '#description' => t('If On (default), Colorbox will add a unique per-request token to the gallery id to avoid images being added manually to galleries. The token was added as a security fix but some see the old behavoiur as an feature and this settings makes it possible to remove the token.'), + ); + $form['colorbox_advanced_settings']['colorbox_mobile_detect'] = array( + '#type' => 'radios', + '#title' => t('Mobile detection'), + '#options' => array(1 => t('On'), 0 => t('Off')), + '#default_value' => variable_get('colorbox_mobile_detect', 1), + '#description' => t('If On (default), Colorbox will not be active for devices with the max width set below.'), + ); + $form['colorbox_advanced_settings']['colorbox_mobile_device_width'] = array( + '#type' => 'textfield', + '#title' => t('Device with'), + '#default_value' => variable_get('colorbox_mobile_device_width', '480px'), + '#size' => 30, + '#description' => t('Set the mobile device max with. Default: 480px.'), + '#states' => array( + 'visible' => array( + ':input[name="colorbox_mobile_detect"]' => array('value' => '1'), + ), + ), + ); $form['colorbox_advanced_settings']['colorbox_caption_trim'] = array( '#type' => 'radios', '#title' => t('Caption shortening'), diff --git a/sites/all/modules/colorbox/colorbox.api.php b/sites/all/modules/colorbox/colorbox.api.php index 83ead10..9dbf4cd 100644 --- a/sites/all/modules/colorbox/colorbox.api.php +++ b/sites/all/modules/colorbox/colorbox.api.php @@ -10,11 +10,11 @@ * * Implements hook_colorbox_settings_alter(). * - * @param $settings + * @param array $settings * An associative array of Colorbox settings. See the * @link http://colorpowered.com/colorbox/ Colorbox documentation @endlink * for the full list of supported parameters. - * @param $style + * @param string $style * The name of the active style plugin. If $style is 'none', no Colorbox * theme will be loaded. */ @@ -27,3 +27,18 @@ function hook_colorbox_settings_alter(&$settings, &$style) { $style = 'mystyle'; } } + +/** + * Allows to override activation of Colorbox for the current URL. + * + * @param bool $active + * A boolean indicating whether colorbox should be active for the current + * URL or not. + */ +function hook_colorbox_active_alter(&$active) { + $path = drupal_get_path_alias($_GET['q']); + if (drupal_match_path($path, 'admin/config/colorbox_test')) { + // Enable colorbox for this URL. + $active = TRUE; + } +} diff --git a/sites/all/modules/colorbox/colorbox.info b/sites/all/modules/colorbox/colorbox.info index f33809e..23b153d 100644 --- a/sites/all/modules/colorbox/colorbox.info +++ b/sites/all/modules/colorbox/colorbox.info @@ -1,14 +1,14 @@ name = Colorbox description = A light-weight, customizable lightbox plugin for jQuery 1.4.3+. -dependencies[] = libraries (2.x) +dependencies[] = libraries (>=2.x) core = 7.x configure = admin/config/media/colorbox files[] = views/colorbox_handler_field_colorbox.inc -; Information added by drupal.org packaging script on 2013-02-13 -version = "7.x-2.3+2-dev" +; Information added by Drupal.org packaging script on 2016-06-06 +version = "7.x-2.12" core = "7.x" project = "colorbox" -datestamp = "1360716175" +datestamp = "1465255741" diff --git a/sites/all/modules/colorbox/colorbox.install b/sites/all/modules/colorbox/colorbox.install index 9668968..e1c8adf 100644 --- a/sites/all/modules/colorbox/colorbox.install +++ b/sites/all/modules/colorbox/colorbox.install @@ -14,13 +14,15 @@ function colorbox_requirements($phase) { if ($phase == 'runtime') { $t = get_t(); $library = libraries_detect('colorbox'); + $error_type = isset($library['error']) ? drupal_ucfirst($library['error']) : ''; + $error_message = isset($library['error message']) ? $library['error message'] : ''; if (empty($library['installed'])) { $requirements['colorbox_plugin'] = array( 'title' => $t('Colorbox plugin'), - 'value' => $t('At least @a', array('@a' => COLORBOX_MIN_PLUGIN_VERSION)), + 'value' => $t('@e: At least @a', array('@e' => $error_type, '@a' => COLORBOX_MIN_PLUGIN_VERSION)), 'severity' => REQUIREMENT_ERROR, - 'description' => $t('You need to download the !colorbox, extract the archive and place the colorbox directory in the %path directory on your server.', array('!colorbox' => l($t('Colorbox plugin'), $library['download url']), '%path' => 'sites/all/libraries')), + 'description' => $t('!error You need to download the !colorbox, extract the archive and place the colorbox directory in the %path directory on your server.', array('!error' => $error_message, '!colorbox' => l($t('Colorbox plugin'), $library['download url']), '%path' => 'sites/all/libraries')), ); } elseif (version_compare($library['version'], COLORBOX_MIN_PLUGIN_VERSION, '>=')) { @@ -47,7 +49,7 @@ function colorbox_requirements($phase) { * Implements hook_uninstall(). */ function colorbox_uninstall() { - db_query("DELETE FROM {variable} WHERE name LIKE 'colorbox_%'"); + db_delete('variable')->condition('name', db_like('colorbox_') . '%', 'LIKE')->execute(); } /** diff --git a/sites/all/modules/colorbox/colorbox.make b/sites/all/modules/colorbox/colorbox.make new file mode 100644 index 0000000..66b47fa --- /dev/null +++ b/sites/all/modules/colorbox/colorbox.make @@ -0,0 +1,8 @@ +core = 7.x +api = 2 + +libraries[colorbox][type] = "libraries" +libraries[colorbox][download][type] = "file" +libraries[colorbox][download][url] = "https://github.com/jackmoore/colorbox/archive/1.x.zip" +libraries[colorbox][directory_name] = "colorbox" +libraries[colorbox][destination] = "libraries" diff --git a/sites/all/modules/colorbox/colorbox.make.example b/sites/all/modules/colorbox/colorbox.make.example deleted file mode 100644 index 1aa9e93..0000000 --- a/sites/all/modules/colorbox/colorbox.make.example +++ /dev/null @@ -1,9 +0,0 @@ -; $Id$ - -core = 7.x -api = 2 - -libraries[colorbox][download][type] = "get" -libraries[colorbox][download][url] = "http://colorpowered.com/colorbox/colorbox.zip" -libraries[colorbox][directory_name] = "colorbox" -libraries[colorbox][destination] = "libraries" diff --git a/sites/all/modules/colorbox/colorbox.module b/sites/all/modules/colorbox/colorbox.module index 6e96bfa..23e2a03 100644 --- a/sites/all/modules/colorbox/colorbox.module +++ b/sites/all/modules/colorbox/colorbox.module @@ -6,9 +6,9 @@ */ /** - * The default path to the Colorbox directory. + * The minimum required version of the Colorbox plugin. */ -define('COLORBOX_MIN_PLUGIN_VERSION', '1.3.21.1'); +define('COLORBOX_MIN_PLUGIN_VERSION', '1.6.1'); /** @@ -32,6 +32,7 @@ function colorbox_theme() { 'widget' => NULL, ), 'template' => 'colorbox-insert-image', + 'pattern' => 'colorbox_insert_image__[a-z0-9_]+', 'file' => 'colorbox.theme.inc', ), @@ -43,6 +44,7 @@ function colorbox_theme() { 'node' => NULL, // Left for legacy support. 'field' => array(), 'display_settings' => array(), + 'delta' => null, ), 'file' => 'colorbox.theme.inc', ), @@ -54,8 +56,8 @@ function colorbox_theme() { */ function colorbox_init() { // Do not load colorbox during the Drupal installation process, e.g. if part - // of installation profiles. - if (!drupal_installation_attempted()) { + // of installation profiles. Only add the JavaScript and CSS on specified paths. + if (!drupal_installation_attempted() && _colorbox_active()) { _colorbox_doheader(); } } @@ -77,10 +79,10 @@ function colorbox_libraries_info() { $libraries['colorbox'] = array( 'name' => 'Colorbox plugin', 'vendor url' => 'http://www.jacklmoore.com/colorbox', - 'download url' => 'http://www.jacklmoore.com/colorbox', + 'download url' => 'https://github.com/jackmoore/colorbox/archive/1.x.zip', 'version arguments' => array( 'file' => 'jquery.colorbox-min.js', - 'pattern' => '@ColorBox v([0-9\.a-z]+)@', + 'pattern' => '@(?i:Colorbox)\sv?([0-9\.a-z]+)@', 'lines' => 5, ), 'files' => array( @@ -130,7 +132,7 @@ function colorbox_menu() { /** * Check if Colorbox should be active for the current URL. * - * @return + * @return bool * TRUE if Colorbox should be active for the current page. */ function _colorbox_active() { @@ -140,7 +142,7 @@ function _colorbox_active() { return FALSE; } - // Code from the block_list funtion in block.module. + // Code from the block_list function in block.module. $path = drupal_get_path_alias($_GET['q']); $colorbox_pages = variable_get('colorbox_pages', "admin*\nimagebrowser*\nimg_assist*\nimce*\nnode/add/*\nnode/*/edit\nprint/*\nprintpdf/*\nsystem/ajax\nsystem/ajax/*"); // Compare with the internal and path alias (if any). @@ -150,6 +152,9 @@ function _colorbox_active() { } $page_match = variable_get('colorbox_visibility', 0) == 0 ? !$page_match : $page_match; + // Allow other modules to change the state of colorbox for the current URL. + drupal_alter('colorbox_active', $page_match); + return $page_match; } @@ -161,9 +166,6 @@ function _colorbox_doheader() { if ($already_added) { return; // Don't add the JavaScript and CSS multiple times. } - if (!_colorbox_active()) { - return; // Don't add the JavaScript and CSS on specified paths. - } // Insert options and translated strings as javascript settings. if (variable_get('colorbox_custom_settings_activate', 0)) { @@ -176,10 +178,10 @@ function _colorbox_doheader() { 'slideshowSpeed' => variable_get('colorbox_slideshowspeed', 2500), 'slideshowStart' => variable_get('colorbox_text_start', 'start slideshow'), 'slideshowStop' => variable_get('colorbox_text_stop', 'stop slideshow'), - 'current' => variable_get('colorbox_text_current', '{current} of {total}'), - 'previous' => variable_get('colorbox_text_previous', '« Prev'), - 'next' => variable_get('colorbox_text_next', 'Next »'), - 'close' => variable_get('colorbox_text_close', 'Close'), + 'current' => strip_tags(variable_get('colorbox_text_current', '{current} of {total}')), + 'previous' => strip_tags(variable_get('colorbox_text_previous', '« Prev')), + 'next' => strip_tags(variable_get('colorbox_text_next', 'Next »')), + 'close' => strip_tags(variable_get('colorbox_text_close', 'Close')), 'overlayClose' => variable_get('colorbox_overlayclose', 1) ? TRUE : FALSE, 'maxWidth' => variable_get('colorbox_maxwidth', '98%'), 'maxHeight' => variable_get('colorbox_maxheight', '98%'), @@ -187,6 +189,8 @@ function _colorbox_doheader() { 'initialHeight' => variable_get('colorbox_initialheight', '250'), 'fixed' => variable_get('colorbox_fixed', 1) ? TRUE : FALSE, 'scrolling' => variable_get('colorbox_scrolling', 1) ? TRUE : FALSE, + 'mobiledetect' => variable_get('colorbox_mobile_detect', 1) ? TRUE : FALSE, + 'mobiledevicewidth' => variable_get('colorbox_mobile_device_width', '480px'), ); } else { @@ -199,6 +203,8 @@ function _colorbox_doheader() { 'maxWidth' => '98%', 'maxHeight' => '98%', 'fixed' => TRUE, + 'mobiledetect' => variable_get('colorbox_mobile_detect', 1) ? TRUE : FALSE, + 'mobiledevicewidth' => variable_get('colorbox_mobile_device_width', '480px'), ); } @@ -213,7 +219,9 @@ function _colorbox_doheader() { // Add and initialise the Colorbox plugin. $variant = variable_get('colorbox_compression_type', 'minified'); - libraries_load('colorbox', $variant); + if (module_exists('libraries')) { + libraries_load('colorbox', $variant); + } drupal_add_js($path . '/js/colorbox.js'); // Add JS and CSS based on selected style. @@ -251,6 +259,7 @@ function colorbox_field_formatter_info() { 'field types' => array('image'), 'settings' => array( 'colorbox_node_style' => '', + 'colorbox_node_style_first' => '', 'colorbox_image_style' => '', 'colorbox_gallery' => 'post', 'colorbox_gallery_custom' => '', @@ -280,6 +289,14 @@ function colorbox_field_formatter_settings_form($field, $instance, $view_mode, $ '#options' => $image_styles_hide, '#description' => t('Image style to use in the content.'), ); + $element['colorbox_node_style_first'] = array( + '#title' => t('Content image style for first image'), + '#type' => 'select', + '#default_value' => $settings['colorbox_node_style_first'], + '#empty_option' => t('No special style.'), + '#options' => $image_styles, + '#description' => t('Image style to use in the content for the first image.'), + ); $element['colorbox_image_style'] = array( '#title' => t('Colorbox image style'), '#type' => 'select', @@ -306,15 +323,12 @@ function colorbox_field_formatter_settings_form($field, $instance, $view_mode, $ ); $element['colorbox_gallery_custom'] = array( '#title' => t('Custom gallery'), - '#type' => 'machine_name', + '#type' => 'textfield', '#maxlength' => 32, '#default_value' => $settings['colorbox_gallery_custom'], - '#description' => t('All images on a page with the same gallery value (rel attribute) will be grouped together. It must only contain lowercase letters, numbers, and underscores.'), + '#description' => t('All images on a page with the same gallery value (rel attribute) will be grouped together. It must only contain lowercase letters, numbers, hyphen and underscores.'), + '#element_validate' => array('colorbox_gallery_custom_validate'), '#required' => FALSE, - '#machine_name' => array( - 'exists' => 'colorbox_gallery_exists', - 'error' => t('The custom gallery field must only contain lowercase letters, numbers, and underscores.'), - ), '#states' => array( 'visible' => array( ':input[name$="[settings_edit_form][settings][colorbox_gallery]"]' => array('value' => 'custom'), @@ -335,7 +349,7 @@ function colorbox_field_formatter_settings_form($field, $instance, $view_mode, $ '#type' => 'select', '#default_value' => $settings['colorbox_caption'], '#options' => $caption, - '#description' => t('Automatic will use the first none empty value of the title, the alt text and the content title.'), + '#description' => t('Automatic will use the first non-empty value of the title, the alt text and the content title.'), ); $element['colorbox_caption_custom'] = array( '#title' => t('Custom caption'), @@ -354,7 +368,7 @@ function colorbox_field_formatter_settings_form($field, $instance, $view_mode, $ '#type' => 'fieldset', '#title' => t('Replacement patterns'), '#theme' => 'token_tree', - '#token_types' => array($instance['entity_type'], 'file'), + '#token_types' => array_merge(array_keys($field['bundles']),array('file')), '#recursion_limit' => $recursion_limit, '#dialog' => TRUE, '#states' => array( @@ -380,6 +394,15 @@ function colorbox_field_formatter_settings_form($field, $instance, $view_mode, $ return $element; } +/** + * Validate function for colorbox_gallery_custom. + */ +function colorbox_gallery_custom_validate($element, &$form_state) { + if (!empty($element['#value']) && !preg_match('!^[a-z0-9_-]+$!', $element['#value'])) { + form_error($element, t('%name must only contain lowercase letters, numbers, hyphen and underscores.', array('%name' => $element['#title']))); + } +} + /** * Implements hook_field_formatter_settings_summary(). */ @@ -404,6 +427,10 @@ function colorbox_field_formatter_settings_summary($field, $instance, $view_mode $summary[] = t('Content image style: Original image'); } + if (isset($image_styles[$settings['colorbox_node_style_first']])) { + $summary[] = t('Content image style of first image: @style', array('@style' => $image_styles[$settings['colorbox_node_style_first']])); + } + if (isset($image_styles[$settings['colorbox_image_style']])) { $summary[] = t('Colorbox image style: @style', array('@style' => $image_styles[$settings['colorbox_image_style']])); } @@ -455,6 +482,7 @@ function colorbox_field_formatter_view($entity_type, $entity, $field, $instance, '#node' => $entity, // Left for legacy support. '#field' => $field, '#display_settings' => $display['settings'], + '#delta' => $delta, ); } } @@ -464,11 +492,14 @@ function colorbox_field_formatter_view($entity_type, $entity, $field, $instance, /** * Implements hook_insert_styles(). + * + * @return array */ function colorbox_insert_styles() { $insert_styles = array(); foreach (image_styles() as $key => $style) { - $insert_styles['colorbox__' . $key] = array('label' => t('Colorbox @style', array('@style' => $style['name']))); + $label = isset($style['label']) ? $style['label'] : $style['name']; + $insert_styles['colorbox__' . $key] = array('label' => t('Colorbox @style', array('@style' => $label))); } return $insert_styles; @@ -479,13 +510,13 @@ function colorbox_insert_styles() { */ function colorbox_insert_content($item, $style, $widget) { list($item['module_name'], $item['style_name']) = explode('__', $style['name'], 2); - return theme('colorbox_insert_image', array('item' => $item, 'widget' => $widget)); + return theme(array('colorbox_insert_image__' . str_replace('-', '_', $item['style_name']), 'colorbox_insert_image'), array('item' => $item, 'widget' => $widget)); } /** * Machine names normally need to be unique but that does not apply to galleries. * - * @return + * @return false * Always FALSE */ function colorbox_gallery_exists() { diff --git a/sites/all/modules/colorbox/colorbox.theme.inc b/sites/all/modules/colorbox/colorbox.theme.inc index 8081645..76c4c0c 100644 --- a/sites/all/modules/colorbox/colorbox.theme.inc +++ b/sites/all/modules/colorbox/colorbox.theme.inc @@ -8,15 +8,19 @@ /** * Returns HTML for an Colorbox image field formatter. * - * @param $variables + * @param array $variables * An associative array containing: * - item: An array of image data. * - image_style: An optional image style. * - path: An array containing the link 'path' and link 'options'. * + * @return string + * An HTML string representing the themed output. + * * @ingroup themeable */ function theme_colorbox_image_formatter($variables) { + static $gallery_token = NULL; $item = $variables['item']; $entity_type = $variables['entity_type']; $entity = $variables['entity']; @@ -25,16 +29,40 @@ function theme_colorbox_image_formatter($variables) { $image = array( 'path' => $item['uri'], - 'alt' => $item['alt'], - 'title' => $item['title'], + 'alt' => isset($item['alt']) ? $item['alt'] : '', + 'title' => isset($item['title']) ? $item['title'] : '', 'style_name' => $settings['colorbox_node_style'], ); + if ($variables['delta'] == 0 && !empty($settings['colorbox_node_style_first'])) { + $image['style_name'] = $settings['colorbox_node_style_first']; + } + if (isset($item['width']) && isset($item['height'])) { $image['width'] = $item['width']; $image['height'] = $item['height']; } + if (isset($item['attributes'])) { + $image['attributes'] = $item['attributes']; + } + + // Allow image attributes to be overridden. + if (isset($variables['item']['override']['attributes'])) { + foreach (array('width', 'height', 'alt', 'title') as $key) { + if (isset($variables['item']['override']['attributes'][$key])) { + $image[$key] = $variables['item']['override']['attributes'][$key]; + unset($variables['item']['override']['attributes'][$key]); + } + } + if (isset($image['attributes'])) { + $image['attributes'] = $variables['item']['override']['attributes'] + $image['attributes']; + } + else { + $image['attributes'] = $variables['item']['override']['attributes']; + } + } + $entity_title = entity_label($entity_type, $entity); switch ($settings['colorbox_caption']) { @@ -99,6 +127,16 @@ function theme_colorbox_image_formatter($variables) { $gallery_id = ''; } + // If gallery id is not empty add unique per-request token to avoid images being added manually to galleries. + if (!empty($gallery_id) && variable_get('colorbox_unique_token', 1)) { + // Check if gallery token has already been set, we need to reuse the token for the whole request. + if (is_null($gallery_token)) { + // We use a short token since randomness is not critical. + $gallery_token = drupal_random_key(8); + } + $gallery_id = $gallery_id . '-' . $gallery_token; + } + if ($style_name = $settings['colorbox_image_style']) { $path = image_style_url($style_name, $image['path']); } @@ -112,13 +150,16 @@ function theme_colorbox_image_formatter($variables) { /** * Returns HTML for an image using a specific Colorbox image style. * - * @param $variables + * @param array $variables * An associative array containing: * - image: image item as array. * - path: The path of the image that should be displayed in the Colorbox. * - title: The title text that will be used as a caption in the Colorbox. * - gid: Gallery id for Colorbox image grouping. * + * @return string + * An HTML string containing a link to the given path. + * * @ingroup themeable */ function theme_colorbox_imagefield($variables) { @@ -135,45 +176,63 @@ function theme_colorbox_imagefield($variables) { $image = theme('image', $variables['image']); } - $options = array( + $options = drupal_parse_url($variables['path']); + $options += array( 'html' => TRUE, 'attributes' => array( 'title' => $variables['title'], 'class' => $class, - 'rel' => $variables['gid'], - ) + 'data-colorbox-gallery' => $variables['gid'], + ), ); - return l($image, $variables['path'], $options); + return l($image, $options['path'], $options); } /** * Preprocess variables for the colorbox-insert-image.tpl.php file. + * + * @param array $variables */ function template_preprocess_colorbox_insert_image(&$variables) { - $class = array(); - $file = file_load($variables['item']['fid']); + $item = $variables['item']; + $variables['file'] = file_load($item['fid']); + $variables['style_name'] = $item['style_name']; + $variables['width'] = isset($item['width']) ? $item['width'] : NULL; + $variables['height'] = isset($item['height']) ? $item['height'] : NULL; + // Determine dimensions of the image after the image style transformations. + image_style_transform_dimensions($variables['style_name'], $variables); + + $class = array(); if (!empty($variables['widget']['settings']['insert_class'])) { $class = explode(' ', $variables['widget']['settings']['insert_class']); } - $class[] = 'image-' . $variables['item']['style_name']; + $class[] = 'image-' . $variables['style_name']; foreach ($class as $key => $value) { $class[$key] = drupal_html_class($value); } - $variables['image_path'] = image_style_url($variables['item']['style_name'], $file->uri); + $variables['class'] = implode(' ', $class); + + $variables['uri'] = image_style_path($variables['style_name'], $variables['file']->uri); + $absolute = isset($variables['widget']['settings']['insert_absolute']) ? $variables['widget']['settings']['insert_absolute'] : NULL; + $variables['url'] = insert_create_url($variables['uri'], $absolute, variable_get('clean_url')); + + // http://drupal.org/node/1923336 + if (function_exists('image_style_path_token')) { + $token_query = array(IMAGE_DERIVATIVE_TOKEN => image_style_path_token($variables['style_name'], $variables['file']->uri)); + $variables['url'] .= (strpos($variables['url'], '?') !== FALSE ? '&' : '?') . drupal_http_build_query($token_query); + } if ($style_name = variable_get('colorbox_image_style', '')) { - $variables['link_path'] = image_style_url($style_name, $file->uri); + $variables['path'] = image_style_url($style_name, $variables['file']->uri); } else { - $variables['link_path'] = file_create_url($file->uri); + $variables['path'] = file_create_url($variables['file']->uri); } - $variables['class'] = implode(' ', $class); - $variables['gallery_id'] = ''; switch (variable_get('colorbox_insert_gallery', 0)) { case 0: diff --git a/sites/all/modules/colorbox/drush/colorbox.drush.inc b/sites/all/modules/colorbox/drush/colorbox.drush.inc index b799e60..2ff3442 100644 --- a/sites/all/modules/colorbox/drush/colorbox.drush.inc +++ b/sites/all/modules/colorbox/drush/colorbox.drush.inc @@ -23,7 +23,7 @@ define('COLORBOX_DOWNLOAD_PREFIX', 'colorbox-'); * * See `drush topic docs-commands` for a list of recognized keys. * - * @return + * @return array * An associative array describing your command(s). */ function colorbox_drush_command() { @@ -49,10 +49,10 @@ function colorbox_drush_command() { * This function is called whenever a drush user calls * 'drush help ' * - * @param + * @param string $section * A string with the help section (prepend with 'drush:') * - * @return + * @return string * A string with the help text for your command. */ function colorbox_drush_help($section) { @@ -63,14 +63,14 @@ function colorbox_drush_help($section) { } /** - * Implements drush_MODULE_post_pm_enable(). + * Implements drush_MODULE_pre_pm_enable(). */ -// function drush_colorbox_post_pm_enable() { -// $modules = func_get_args(); -// if (in_array('colorbox', $modules)) { -// drush_colorbox_plugin(); -// } -// } +function drush_colorbox_pre_pm_enable() { + $modules = drush_get_context('PM_ENABLE_MODULES'); + if (in_array('colorbox', $modules) && !drush_get_option('skip')) { + drush_colorbox_plugin(); + } +} /** * Command to download the Colorbox plugin. @@ -99,7 +99,7 @@ function drush_colorbox_plugin() { $filename = basename($filepath); $dirname = COLORBOX_DOWNLOAD_PREFIX . basename($filepath, '.zip'); - // Remove any existing Colorbox plugin directory + // Remove any existing Colorbox plugin directory if (is_dir($dirname) || is_dir('colorbox')) { drush_delete_dir($dirname, TRUE); drush_delete_dir('colorbox', TRUE); diff --git a/sites/all/modules/colorbox/js/colorbox.js b/sites/all/modules/colorbox/js/colorbox.js index 99d4c0c..d17133b 100644 --- a/sites/all/modules/colorbox/js/colorbox.js +++ b/sites/all/modules/colorbox/js/colorbox.js @@ -2,19 +2,36 @@ Drupal.behaviors.initColorbox = { attach: function (context, settings) { - if (!$.isFunction($.colorbox)) { + if (!$.isFunction($.colorbox) || typeof settings.colorbox === 'undefined') { return; } + + if (settings.colorbox.mobiledetect && window.matchMedia) { + // Disable Colorbox for small screens. + var mq = window.matchMedia("(max-device-width: " + settings.colorbox.mobiledevicewidth + ")"); + if (mq.matches) { + return; + } + } + + // Use "data-colorbox-gallery" if set otherwise use "rel". + settings.colorbox.rel = function () { + if ($(this).data('colorbox-gallery')) { + return $(this).data('colorbox-gallery'); + } + else { + return $(this).attr('rel'); + } + }; + $('.colorbox', context) .once('init-colorbox') .colorbox(settings.colorbox); + + $(context).bind('cbox_complete', function () { + Drupal.attachBehaviors('#cboxLoadedContent'); + }); } }; -{ - $(document).bind('cbox_complete', function () { - Drupal.attachBehaviors('#cboxLoadedContent'); - }); -} - })(jQuery); diff --git a/sites/all/modules/colorbox/js/colorbox_inline.js b/sites/all/modules/colorbox/js/colorbox_inline.js index f515036..2354ef8 100644 --- a/sites/all/modules/colorbox/js/colorbox_inline.js +++ b/sites/all/modules/colorbox/js/colorbox_inline.js @@ -2,9 +2,18 @@ Drupal.behaviors.initColorboxInline = { attach: function (context, settings) { - if (!$.isFunction($.colorbox)) { + if (!$.isFunction($.colorbox) || typeof settings.colorbox === 'undefined') { return; } + + if (settings.colorbox.mobiledetect && window.matchMedia) { + // Disable Colorbox for small screens. + var mq = window.matchMedia("(max-device-width: " + settings.colorbox.mobiledevicewidth + ")"); + if (mq.matches) { + return; + } + } + $.urlParam = function(name, url){ if (name == 'fragment') { var results = new RegExp('(#[^&#]*)').exec(url); diff --git a/sites/all/modules/colorbox/js/colorbox_load.js b/sites/all/modules/colorbox/js/colorbox_load.js index e63043e..6d3c676 100644 --- a/sites/all/modules/colorbox/js/colorbox_load.js +++ b/sites/all/modules/colorbox/js/colorbox_load.js @@ -2,9 +2,18 @@ Drupal.behaviors.initColorboxLoad = { attach: function (context, settings) { - if (!$.isFunction($.colorbox)) { + if (!$.isFunction($.colorbox) || typeof settings.colorbox === 'undefined') { return; } + + if (settings.colorbox.mobiledetect && window.matchMedia) { + // Disable Colorbox for small screens. + var mq = window.matchMedia("(max-device-width: " + settings.colorbox.mobiledevicewidth + ")"); + if (mq.matches) { + return; + } + } + $.urlParams = function (url) { var p = {}, e, diff --git a/sites/all/modules/colorbox/styles/default/colorbox_style.css b/sites/all/modules/colorbox/styles/default/colorbox_style.css index 9fe435f..2517c7f 100644 --- a/sites/all/modules/colorbox/styles/default/colorbox_style.css +++ b/sites/all/modules/colorbox/styles/default/colorbox_style.css @@ -1,5 +1,5 @@ /** - * ColorBox Core Style: + * Colorbox Core Style: * The following CSS is consistent between example themes and should not be altered. */ #colorbox, #cboxOverlay, #cboxWrapper { @@ -22,6 +22,7 @@ } #cboxLoadedContent { overflow: auto; + -webkit-overflow-scrolling: touch; } #cboxTitle { margin: 0; @@ -33,9 +34,26 @@ width: 100%; height: 100%; } +/** + * These elements are buttons, and may need to have additional + * styles reset to avoid unwanted base styles. + */ #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow { + border: 0; + padding: 0; + margin: 0; + overflow: visible; + width: auto; + background: none; cursor: pointer; } +/** + * Avoid outlines on :active (mouseclick), + * but preserve outlines on :focus (tabbed navigating) + */ +#cboxPrevious:active, #cboxNext:active, #cboxClose:active, #cboxSlideshow:active { + outline: 0; +} .cboxPhoto { float: left; margin: auto; @@ -49,8 +67,10 @@ display: block; border: 0; } +/* Reset box sizing to content-box if theme is using border-box. */ #colorbox, #cboxContent, #cboxLoadedContent { -moz-box-sizing: content-box; + -webkit-box-sizing: content-box; box-sizing: content-box; } @@ -62,8 +82,9 @@ #cboxOverlay { background: #000; } - -#colorBox {} +#colorbox { + outline: 0; +} #cboxWrapper { background: #fff; -moz-border-radius: 5px; @@ -101,7 +122,6 @@ #cboxContent { background: #fff; overflow: hidden; - font: 12px "Lucida Grande", Verdana, Arial, sans-serif; } #cboxError { padding: 50px; @@ -118,6 +138,8 @@ color: #535353; width: 100%; padding: 4px 6px; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; box-sizing: border-box; } #cboxCurrent { @@ -130,7 +152,7 @@ position: absolute; bottom: 0px; right: 30px; - background: url(images/controls.png) -75px -50px no-repeat; + background: url(images/controls.png) no-repeat -75px -50px; width: 25px; height: 25px; text-indent: -9999px; @@ -142,19 +164,19 @@ position: absolute; bottom: 0px; right: 30px; - background: url(images/controls.png) -49px -50px no-repeat; + background: url(images/controls.png) no-repeat -25px -50px; width: 25px; height: 25px; text-indent: -9999px; } .cboxSlideshow_off #cboxSlideshow:hover { - background-position: -25px -50px; + background-position: -49px -50px; } #cboxPrevious { position: absolute; bottom: 0; left: 0; - background: url(images/controls.png) -75px 0px no-repeat; + background: url(images/controls.png) no-repeat -75px 0px; width: 25px; height: 25px; text-indent: -9999px; @@ -166,7 +188,7 @@ position: absolute; bottom: 0; left: 27px; - background: url(images/controls.png) -50px 0px no-repeat; + background: url(images/controls.png) no-repeat -50px 0px; width: 25px; height: 25px; text-indent: -9999px; @@ -178,13 +200,13 @@ background: #fff; } #cboxLoadingGraphic { - background: url(images/loading_animation.gif) center center no-repeat; + background: url(images/loading_animation.gif) no-repeat center center; } #cboxClose { position: absolute; bottom: 0; right: 0; - background: url(images/controls.png) -25px 0px no-repeat; + background: url(images/controls.png) no-repeat -25px 0px; width: 25px; height: 25px; text-indent: -9999px; diff --git a/sites/all/modules/colorbox/styles/default/colorbox_style.js b/sites/all/modules/colorbox/styles/default/colorbox_style.js index 8b77b09..47875ff 100644 --- a/sites/all/modules/colorbox/styles/default/colorbox_style.js +++ b/sites/all/modules/colorbox/styles/default/colorbox_style.js @@ -2,10 +2,9 @@ Drupal.behaviors.initColorboxDefaultStyle = { attach: function (context, settings) { - $(document).bind('cbox_complete', function () { + $(context).bind('cbox_complete', function () { // Only run if there is a title. if ($('#cboxTitle:empty', context).length == false) { - setTimeout(function () { $('#cboxTitle', context).slideUp() }, 1500); $('#cboxLoadedContent img', context).bind('mouseover', function () { $('#cboxTitle', context).slideDown(); }); diff --git a/sites/all/modules/colorbox/styles/plain/colorbox_style.css b/sites/all/modules/colorbox/styles/plain/colorbox_style.css index ae8d13d..0b500da 100644 --- a/sites/all/modules/colorbox/styles/plain/colorbox_style.css +++ b/sites/all/modules/colorbox/styles/plain/colorbox_style.css @@ -1,5 +1,5 @@ /** - * ColorBox Core Style: + * Colorbox Core Style: * The following CSS is consistent between example themes and should not be altered. */ #colorbox, #cboxOverlay, #cboxWrapper { @@ -22,6 +22,7 @@ } #cboxLoadedContent { overflow: auto; + -webkit-overflow-scrolling: touch; } #cboxTitle { margin: 0; @@ -33,9 +34,26 @@ width: 100%; height: 100%; } +/** + * These elements are buttons, and may need to have additional + * styles reset to avoid unwanted base styles. + */ #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow { + border: 0; + padding: 0; + margin: 0; + overflow: visible; + width: auto; + background: none; cursor: pointer; } +/** + * Avoid outlines on :active (mouseclick), + * but preserve outlines on :focus (tabbed navigating) + */ +#cboxPrevious:active, #cboxNext:active, #cboxClose:active, #cboxSlideshow:active { + outline: 0; +} .cboxPhoto { float: left; margin: auto; @@ -49,8 +67,10 @@ display: block; border: 0; } +/* Reset box sizing to content-box if theme is using border-box. */ #colorbox, #cboxContent, #cboxLoadedContent { -moz-box-sizing: content-box; + -webkit-box-sizing: content-box; box-sizing: content-box; } @@ -62,12 +82,12 @@ #cboxOverlay { background: #000; } - -#colorBox {} +#colorbox { + outline: 0; +} #cboxWrapper {} #cboxContent { overflow: hidden; - font: 12px "Lucida Grande", Verdana, Arial, sans-serif; } #cboxContent, .cboxPhoto { -webkit-border-radius: 5px; @@ -87,6 +107,7 @@ width: 100%; padding: 4px 6px; -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; box-sizing: border-box; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px; @@ -100,12 +121,12 @@ background: #fff; } #cboxLoadingGraphic { - background: url(images/loading_animation.gif) center center no-repeat; + background: url(images/loading_animation.gif) no-repeat center center; } - .cbox-close-plain { + #cboxClose.cbox-close-plain { position: absolute; font-size: 20px; - line-height: 18px;; + line-height: 18px; text-align: center; color: rgba(255, 255, 255, 0.7); background: rgba(0, 0, 0, 0.5); diff --git a/sites/all/modules/colorbox/styles/plain/colorbox_style.js b/sites/all/modules/colorbox/styles/plain/colorbox_style.js index 02c4de0..19d8e66 100644 --- a/sites/all/modules/colorbox/styles/plain/colorbox_style.js +++ b/sites/all/modules/colorbox/styles/plain/colorbox_style.js @@ -2,7 +2,7 @@ Drupal.behaviors.initColorboxPlainStyle = { attach: function (context, settings) { - $(document).bind('cbox_complete', function () { + $(context).bind('cbox_complete', function () { // Make all the controls invisible. $('#cboxCurrent, #cboxSlideshow, #cboxPrevious, #cboxNext', context).addClass('element-invisible'); // Replace "Close" with "×" and show. @@ -24,7 +24,7 @@ Drupal.behaviors.initColorboxPlainStyle = { } }); }); - $(document).bind('cbox_closed', function () { + $(context).bind('cbox_closed', function () { $('#cboxClose', context).removeClass('cbox-close-plain'); }); } diff --git a/sites/all/modules/colorbox/styles/stockholmsyndrome/colorbox_style.css b/sites/all/modules/colorbox/styles/stockholmsyndrome/colorbox_style.css index 4a85918..6cdfa33 100644 --- a/sites/all/modules/colorbox/styles/stockholmsyndrome/colorbox_style.css +++ b/sites/all/modules/colorbox/styles/stockholmsyndrome/colorbox_style.css @@ -1,5 +1,5 @@ /** - * ColorBox Core Style: + * Colorbox Core Style: * The following CSS is consistent between example themes and should not be altered. */ #colorbox, #cboxOverlay, #cboxWrapper { @@ -22,6 +22,7 @@ } #cboxLoadedContent { overflow: auto; + -webkit-overflow-scrolling: touch; } #cboxTitle { margin: 0; @@ -33,9 +34,26 @@ width: 100%; height: 100%; } +/** + * These elements are buttons, and may need to have additional + * styles reset to avoid unwanted base styles. + */ #cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow { + border: 0; + padding: 0; + margin: 0; + overflow: visible; + width: auto; + background: none; cursor: pointer; } +/** + * Avoid outlines on :active (mouseclick), + * but preserve outlines on :focus (tabbed navigating) + */ +#cboxPrevious:active, #cboxNext:active, #cboxClose:active, #cboxSlideshow:active { + outline: 0; +} .cboxPhoto { float: left; margin: auto; @@ -49,8 +67,10 @@ display: block; border: 0; } +/* Reset box sizing to content-box if theme is using border-box. */ #colorbox, #cboxContent, #cboxLoadedContent { -moz-box-sizing: content-box; + -webkit-box-sizing: content-box; box-sizing: content-box; } @@ -61,7 +81,6 @@ */ #cboxOverlay { background: #000; - opacity: 0.4 !important; } #colorbox { @@ -75,6 +94,7 @@ -webkit-border-bottom-right-radius: 9px; border-bottom-left-radius: 9px; border-bottom-right-radius: 9px; + outline: 0; } #colorbox, #colorbox div { overflow: visible; /* Required by the close button. */ @@ -118,7 +138,6 @@ #cboxContent { background: #fff; overflow: hidden; - font: 11px Arial, sans-serif; margin-bottom: 28px; } #cboxError { @@ -132,8 +151,9 @@ height: 38px; color: #313131; padding: 0 140px 0 15px; - display: table-cell; + display: table-cell !important; vertical-align: middle; + float: none !important; } #cboxCurrent { position: absolute; @@ -158,7 +178,7 @@ position: absolute; bottom: -26px; right: 45px; - background: url(images/controls.png) 0 -48px no-repeat; + background: url(images/controls.png) no-repeat 0 -48px; width: 21px; height: 15px; text-indent: -9999px; @@ -170,7 +190,7 @@ position: absolute; bottom: -26px; right: 15px; - background: url(images/controls.png) 0 -29px no-repeat; + background: url(images/controls.png) no-repeat 0 -29px; width: 21px; height: 15px; text-indent: -9999px; @@ -182,13 +202,13 @@ background: #e6e6e6; } #cboxLoadingGraphic { - background: url(images/loading_animation.gif) center center no-repeat; + background: url(images/loading_animation.gif) no-repeat center center; } #cboxClose { position: absolute; top: -10px; right: -10px; - background: url(images/controls.png) 0px 0px no-repeat; + background: url(images/controls.png) no-repeat 0px 0px; width: 25px; height: 25px; text-indent: -9999px; diff --git a/sites/all/modules/colorbox/styles/stockholmsyndrome/colorbox_style.js b/sites/all/modules/colorbox/styles/stockholmsyndrome/colorbox_style.js index afe2c0f..db3ab3e 100644 --- a/sites/all/modules/colorbox/styles/stockholmsyndrome/colorbox_style.js +++ b/sites/all/modules/colorbox/styles/stockholmsyndrome/colorbox_style.js @@ -2,15 +2,15 @@ Drupal.behaviors.initColorboxStockholmsyndromeStyle = { attach: function (context, settings) { - $(document).bind('cbox_open', function () { + $(context).bind('cbox_open', function () { // Hide close button initially. $('#cboxClose', context).css('opacity', 0); }); - $(document).bind('cbox_load', function () { + $(context).bind('cbox_load', function () { // Hide close button. (It doesn't handle the load animation well.) $('#cboxClose', context).css('opacity', 0); }); - $(document).bind('cbox_complete', function () { + $(context).bind('cbox_complete', function () { // Show close button with a delay. $('#cboxClose', context).fadeTo('fast', 0, function () {$(this).css('opacity', 1)}); }); diff --git a/sites/all/modules/colorbox/views/colorbox_handler_field_colorbox.inc b/sites/all/modules/colorbox/views/colorbox_handler_field_colorbox.inc index 6b5a107..205d099 100644 --- a/sites/all/modules/colorbox/views/colorbox_handler_field_colorbox.inc +++ b/sites/all/modules/colorbox/views/colorbox_handler_field_colorbox.inc @@ -109,7 +109,7 @@ If you would like to have the characters %5B and %5D please use the html entity $form['custom_gid'] = array( '#type' => 'textfield', '#title' => t('Custom Colorbox gallery'), - '#description' => t('Enable Colorbox gallery with a given string as gallery. Overrides the automatically generated gallery id above.'), + '#description' => t('Enable Colorbox gallery with a given string as gallery. Overrides the automatically generated gallery id above. You may enter data from this view as per the "Replacement patterns" below.'), '#default_value' => $this->options['custom_gid'], '#weight' => -8, ); @@ -162,12 +162,19 @@ If you would like to have the characters %5B and %5D please use the html entity $tokens = $this->get_render_tokens($this->options['alter']); $popup = filter_xss_admin($this->options['popup']); $caption = filter_xss_admin($this->options['caption']); + $gallery = filter_xss_admin($this->options['custom_gid']); $popup = strtr($popup, $tokens); $caption = strtr($caption, $tokens); + $gallery = drupal_html_class(strtr($gallery, $tokens)); + + // Return nothing if popup is empty. + if (empty($popup)) { + return; + } $width = $this->options['width'] ? $this->options['width'] : ''; $height = $this->options['height'] ? $this->options['height'] : ''; - $gallery_id = !empty($this->options['custom_gid']) ? $this->options['custom_gid'] : ($this->options['gid'] ? 'gallery-' . $this->view->name : ''); + $gallery_id = !empty($gallery) ? $gallery : ($this->options['gid'] ? 'gallery-' . $this->view->name : ''); $link_text = $tokens["[{$this->options['trigger_field']}]"]; $link_options = array( 'html' => TRUE, diff --git a/sites/all/modules/ctools/bulk_export/bulk_export.info b/sites/all/modules/ctools/bulk_export/bulk_export.info index fd35545..c13c520 100644 --- a/sites/all/modules/ctools/bulk_export/bulk_export.info +++ b/sites/all/modules/ctools/bulk_export/bulk_export.info @@ -6,9 +6,9 @@ package = Chaos tool suite version = CTOOLS_MODULE_VERSION -; Information added by Drupal.org packaging script on 2015-03-18 -version = "7.x-1.7" +; Information added by Drupal.org packaging script on 2016-08-17 +version = "7.x-1.10" core = "7.x" project = "ctools" -datestamp = "1426696183" +datestamp = "1471454104" diff --git a/sites/all/modules/ctools/ctools.info b/sites/all/modules/ctools/ctools.info index 3283454..a00e903 100644 --- a/sites/all/modules/ctools/ctools.info +++ b/sites/all/modules/ctools/ctools.info @@ -2,16 +2,15 @@ name = Chaos tools description = A library of helpful tools by Merlin of Chaos. core = 7.x package = Chaos tool suite -version = CTOOLS_MODULE_VERSION files[] = includes/context.inc files[] = includes/css-cache.inc files[] = includes/math-expr.inc files[] = includes/stylizer.inc files[] = tests/css_cache.test -; Information added by Drupal.org packaging script on 2015-03-18 -version = "7.x-1.7" +; Information added by Drupal.org packaging script on 2016-08-17 +version = "7.x-1.10" core = "7.x" project = "ctools" -datestamp = "1426696183" +datestamp = "1471454104" diff --git a/sites/all/modules/ctools/ctools.module b/sites/all/modules/ctools/ctools.module index 3e8cc88..778a220 100644 --- a/sites/all/modules/ctools/ctools.module +++ b/sites/all/modules/ctools/ctools.module @@ -23,7 +23,7 @@ define('CTOOLS_API_VERSION', '2.0.8'); * ; Requires CTools v7.x-1.4 or newer. * dependencies[] = ctools (>=1.4) */ -define('CTOOLS_MODULE_VERSION', '7.x-1.7'); +define('CTOOLS_MODULE_VERSION', '7.x-1.10'); /** * Test the CTools API version. @@ -617,6 +617,27 @@ function ctools_registry_files_alter(&$files, $indexed_modules) { return _ctools_registry_files_alter($files, $indexed_modules); } +// ----------------------------------------------------------------------- +// FAPI hooks that must be in the .module file. + +/** + * Alter the comment form to get a little more control over it. + */ +function ctools_form_comment_form_alter(&$form, &$form_state) { + if (!empty($form_state['ctools comment alter'])) { + // Force the form to post back to wherever we are. + $form['#action'] = url($_GET['q'], array('fragment' => 'comment-form')); + if (empty($form['#submit'])) { + $form['#submit'] = array('comment_form_submit'); + } + $form['#submit'][] = 'ctools_node_comment_form_submit'; + } +} + +function ctools_node_comment_form_submit(&$form, &$form_state) { + $form_state['redirect'][0] = $_GET['q']; +} + // ----------------------------------------------------------------------- // CTools hook implementations. @@ -737,6 +758,12 @@ function ctools_process(&$variables, $hook) { $variables['classes_array'] = array_diff($variables['classes_array'], $remove_classes); } + // Update the classes within the attributes array to match the classes array + if (isset($variables['attributes_array']['class'])) { + $variables['attributes_array']['class'] = $variables['classes_array']; + $variables['attributes'] = $variables['attributes_array'] ? drupal_attributes($variables['attributes_array']) : ''; + } + // Since this runs after template_process(), we need to re-implode the // classes array. $variables['classes'] = implode(' ', $variables['classes_array']); @@ -1018,3 +1045,50 @@ function ctools_ctools_entity_context_alter(&$plugin, &$entity, $plugin_id) { } } } + +/** + * Implements hook_field_create_field(). + */ +function ctools_field_create_field($field) { + ctools_flush_field_caches(); +} + +/** + * Implements hook_field_create_instance(). + */ +function ctools_field_create_instance($instance) { + ctools_flush_field_caches(); +} +/** + * Implements hook_field_delete_field(). + */ +function ctools_field_delete_field($field) { + ctools_flush_field_caches(); +} +/** + * Implements hook_field_delete_instance(). + */ +function ctools_field_delete_instance($instance) { + ctools_flush_field_caches(); +} +/** + * Implements hook_field_update_field(). + */ +function ctools_field_update_field($field, $prior_field, $has_data) { + ctools_flush_field_caches(); +} + +/** + * Implements hook_field_update_instance(). + */ +function ctools_field_update_instance($instance, $prior_instance) { + ctools_flush_field_caches(); +} + +/** + * Clear field related caches. + */ +function ctools_flush_field_caches() { + // Clear caches of 'Entity field' content type plugin. + cache_clear_all('ctools_entity_field_content_type_content_types', 'cache'); +} diff --git a/sites/all/modules/ctools/ctools_access_ruleset/ctools_access_ruleset.info b/sites/all/modules/ctools/ctools_access_ruleset/ctools_access_ruleset.info index d7ec175..ea78aff 100644 --- a/sites/all/modules/ctools/ctools_access_ruleset/ctools_access_ruleset.info +++ b/sites/all/modules/ctools/ctools_access_ruleset/ctools_access_ruleset.info @@ -5,9 +5,9 @@ package = Chaos tool suite version = CTOOLS_MODULE_VERSION dependencies[] = ctools -; Information added by Drupal.org packaging script on 2015-03-18 -version = "7.x-1.7" +; Information added by Drupal.org packaging script on 2016-08-17 +version = "7.x-1.10" core = "7.x" project = "ctools" -datestamp = "1426696183" +datestamp = "1471454104" diff --git a/sites/all/modules/ctools/ctools_ajax_sample/ctools_ajax_sample.info b/sites/all/modules/ctools/ctools_ajax_sample/ctools_ajax_sample.info index bc1a213..8ca999e 100644 --- a/sites/all/modules/ctools/ctools_ajax_sample/ctools_ajax_sample.info +++ b/sites/all/modules/ctools/ctools_ajax_sample/ctools_ajax_sample.info @@ -5,9 +5,9 @@ version = CTOOLS_MODULE_VERSION dependencies[] = ctools core = 7.x -; Information added by Drupal.org packaging script on 2015-03-18 -version = "7.x-1.7" +; Information added by Drupal.org packaging script on 2016-08-17 +version = "7.x-1.10" core = "7.x" project = "ctools" -datestamp = "1426696183" +datestamp = "1471454104" diff --git a/sites/all/modules/ctools/ctools_ajax_sample/ctools_ajax_sample.module b/sites/all/modules/ctools/ctools_ajax_sample/ctools_ajax_sample.module index 2a30c2a..4638ac3 100644 --- a/sites/all/modules/ctools/ctools_ajax_sample/ctools_ajax_sample.module +++ b/sites/all/modules/ctools/ctools_ajax_sample/ctools_ajax_sample.module @@ -524,7 +524,7 @@ function ctools_ajax_sample_wizard_next(&$form_state) { } /** - * Handle the 'finish' click on teh add/edit pane form wizard. + * Handle the 'finish' click on the add/edit pane form wizard. * * All we need to do is set a flag so the return can handle adding * the pane. diff --git a/sites/all/modules/ctools/ctools_custom_content/ctools_custom_content.info b/sites/all/modules/ctools/ctools_custom_content/ctools_custom_content.info index 2b2d04b..6065e89 100644 --- a/sites/all/modules/ctools/ctools_custom_content/ctools_custom_content.info +++ b/sites/all/modules/ctools/ctools_custom_content/ctools_custom_content.info @@ -5,9 +5,9 @@ package = Chaos tool suite version = CTOOLS_MODULE_VERSION dependencies[] = ctools -; Information added by Drupal.org packaging script on 2015-03-18 -version = "7.x-1.7" +; Information added by Drupal.org packaging script on 2016-08-17 +version = "7.x-1.10" core = "7.x" project = "ctools" -datestamp = "1426696183" +datestamp = "1471454104" diff --git a/sites/all/modules/ctools/ctools_custom_content/plugins/export_ui/ctools_custom_content_ui.class.php b/sites/all/modules/ctools/ctools_custom_content/plugins/export_ui/ctools_custom_content_ui.class.php index 56fe4b2..b22b061 100644 --- a/sites/all/modules/ctools/ctools_custom_content/plugins/export_ui/ctools_custom_content_ui.class.php +++ b/sites/all/modules/ctools/ctools_custom_content/plugins/export_ui/ctools_custom_content_ui.class.php @@ -23,6 +23,22 @@ class ctools_custom_content_ui extends ctools_export_ui { '#title' => t('Title'), ); + $form['title_heading'] = array( + '#title' => t('Title heading'), + '#type' => 'select', + '#default_value' => isset($form_state['item']->settings['title_heading']) ? $form_state['item']->settings['title_heading'] : 'h2', + '#options' => array( + 'h1' => t('h1'), + 'h2' => t('h2'), + 'h3' => t('h3'), + 'h4' => t('h4'), + 'h5' => t('h5'), + 'h6' => t('h6'), + 'div' => t('div'), + 'span' => t('span'), + ), + ); + $form['body'] = array( '#type' => 'text_format', '#title' => t('Body'), @@ -43,6 +59,7 @@ class ctools_custom_content_ui extends ctools_export_ui { // Since items in our settings are not in the schema, we have to do these manually: $form_state['item']->settings['title'] = $form_state['values']['title']; + $form_state['item']->settings['title_heading'] = $form_state['values']['title_heading']; $form_state['item']->settings['body'] = $form_state['values']['body']['value']; $form_state['item']->settings['format'] = $form_state['values']['body']['format']; $form_state['item']->settings['substitute'] = $form_state['values']['substitute']; diff --git a/sites/all/modules/ctools/ctools_plugin_example/ctools_plugin_example.info b/sites/all/modules/ctools/ctools_plugin_example/ctools_plugin_example.info index f915876..4056220 100644 --- a/sites/all/modules/ctools/ctools_plugin_example/ctools_plugin_example.info +++ b/sites/all/modules/ctools/ctools_plugin_example/ctools_plugin_example.info @@ -8,9 +8,9 @@ dependencies[] = page_manager dependencies[] = advanced_help core = 7.x -; Information added by Drupal.org packaging script on 2015-03-18 -version = "7.x-1.7" +; Information added by Drupal.org packaging script on 2016-08-17 +version = "7.x-1.10" core = "7.x" project = "ctools" -datestamp = "1426696183" +datestamp = "1471454104" diff --git a/sites/all/modules/ctools/includes/content.inc b/sites/all/modules/ctools/includes/content.inc index b4660b4..ae1c607 100644 --- a/sites/all/modules/ctools/includes/content.inc +++ b/sites/all/modules/ctools/includes/content.inc @@ -341,7 +341,16 @@ function ctools_content_editable($type, $subtype, $conf) { return FALSE; } - if ($function = ctools_plugin_get_function($subtype, 'check editable')) { + $function = FALSE; + + if (!empty($subtype['check editable'])) { + $function = ctools_plugin_get_function($subtype, 'check editable'); + } + elseif (!empty($type['check editable'])) { + $function = ctools_plugin_get_function($type, 'check editable'); + } + + if ($function) { return $function($type, $subtype, $conf); } diff --git a/sites/all/modules/ctools/includes/context-admin.inc b/sites/all/modules/ctools/includes/context-admin.inc index 1120547..821a5b3 100644 --- a/sites/all/modules/ctools/includes/context-admin.inc +++ b/sites/all/modules/ctools/includes/context-admin.inc @@ -736,6 +736,15 @@ function ctools_edit_context_form_defaults($form, &$form_state) { '#default_value' => $conf['keyword'], ); + if ($type_info['key'] == 'requiredcontexts') { + $form['optional'] = array( + '#type' => 'checkbox', + '#title' => t('Context is optional'), + '#default_value' => !empty($form_state['conf']['optional']), + '#description' => t('This context need not be present for the component to function.'), + ); + } + $form['#submit'][] = 'ctools_edit_context_form_defaults_submit'; return $form; @@ -752,6 +761,9 @@ function ctools_edit_context_form_defaults_submit(&$form, &$form_state) { $form_state['conf']['default'] = $form_state['values']['default']; $form_state['conf']['title'] = $form_state['values']['title']; } + if ($form_state['type info']['key'] == 'requiredcontexts') { + $form_state['conf']['optional'] = $form_state['values']['optional']; + } $form_state['conf']['identifier'] = $form_state['values']['identifier']; $form_state['conf']['keyword'] = $form_state['values']['keyword']; diff --git a/sites/all/modules/ctools/includes/context.inc b/sites/all/modules/ctools/includes/context.inc index 6628b5f..8b6d603 100644 --- a/sites/all/modules/ctools/includes/context.inc +++ b/sites/all/modules/ctools/includes/context.inc @@ -42,7 +42,7 @@ class ctools_context { var $restrictions = array(); var $empty = FALSE; - function ctools_context($type = 'none', $data = NULL) { + function __construct($type = 'none', $data = NULL) { $this->type = $type; $this->data = $data; $this->title = t('Unknown context'); @@ -119,7 +119,7 @@ class ctools_context_required { * @param ... * One or more keywords to use for matching which contexts are allowed. */ - function ctools_context_required($title) { + function __construct($title) { $args = func_get_args(); $this->title = array_shift($args); @@ -204,10 +204,6 @@ class ctools_context_required { */ class ctools_context_optional extends ctools_context_required { var $required = FALSE; - function ctools_context_optional() { - $args = func_get_args(); - call_user_func_array(array($this, 'ctools_context_required'), $args); - } /** * Add the 'empty' context which is possible for optional @@ -216,7 +212,7 @@ class ctools_context_optional extends ctools_context_required { $context = new ctools_context('any'); $context->title = t('No context'); $context->identifier = t('No context'); - $contexts = array_merge(array('empty' => $context), $contexts); + $contexts['empty'] = $context; } function filter($contexts) { @@ -1163,7 +1159,7 @@ function ctools_context_match_required_contexts($required, $contexts) { } foreach ($required as $r) { - $context = clone(array_shift($contexts)); + $context = clone array_shift($contexts); $context->identifier = $r['identifier']; $context->page_title = isset($r['title']) ? $r['title'] : ''; $context->keyword = $r['keyword']; @@ -1505,7 +1501,7 @@ function ctools_access($settings, $contexts = array()) { return TRUE; } else if (!$pass && $settings['logic'] == 'and') { - // Fail if 'and' and htis rule failed. + // Fail if 'and' and this rule failed. return FALSE; } } diff --git a/sites/all/modules/ctools/includes/css.inc b/sites/all/modules/ctools/includes/css.inc index 9813a87..8cf5ed4 100644 --- a/sites/all/modules/ctools/includes/css.inc +++ b/sites/all/modules/ctools/includes/css.inc @@ -172,10 +172,12 @@ function ctools_css_cache($css, $filter = TRUE) { // @todo Is this slow? Does it matter if it is? $filename = $path . '/' . md5($css) . '.css'; - // This will do renames if the file already exists, ensuring we don't - // accidentally overwrite other files who share the same md5. Yes this - // is a very miniscule chance but it's safe. - $filename = file_unmanaged_save_data($css, $filename); + // Generally md5 is considered unique enough to sign file downloads. + // So this replaces already existing files based on the assumption that two + // files with the same hash are identical content wise. + // If we rename, the cache folder can potentially fill up with thousands of + // files with the same content. + $filename = file_unmanaged_save_data($css, $filename, FILE_EXISTS_REPLACE); return $filename; } diff --git a/sites/all/modules/ctools/includes/export.inc b/sites/all/modules/ctools/includes/export.inc index 0b85c2e..a568908 100644 --- a/sites/all/modules/ctools/includes/export.inc +++ b/sites/all/modules/ctools/includes/export.inc @@ -1227,7 +1227,7 @@ function ctools_export_default_to_hook_code($schema, $table, $names, $name) { $output .= " \${$export['identifier']}s = array();\n\n"; foreach ($objects as $object) { $output .= ctools_export_crud_export($table, $object, ' '); - $output .= " \${$export['identifier']}s['" . check_plain($object->$export['key']) . "'] = \${$export['identifier']};\n\n"; + $output .= " \${$export['identifier']}s['" . check_plain($object->{$export['key']}) . "'] = \${$export['identifier']};\n\n"; } $output .= " return \${$export['identifier']}s;\n"; $output .= "}\n"; diff --git a/sites/all/modules/ctools/includes/fields.inc b/sites/all/modules/ctools/includes/fields.inc index f379f5e..cbc2dac 100644 --- a/sites/all/modules/ctools/includes/fields.inc +++ b/sites/all/modules/ctools/includes/fields.inc @@ -137,7 +137,7 @@ function ctools_fields_get_field_formatter_settings_form($field, $formatter_type */ function ctools_fields_get_field_formatter_info($fields) { $info = array(); - $field_info = module_invoke_all('field_formatter_info'); + $field_info = field_info_formatter_types(); foreach ($fields as $field) { foreach ($field_info as $format_name => $formatter_info) { if (in_array($field['type'], $formatter_info['field types'])) { @@ -145,7 +145,6 @@ function ctools_fields_get_field_formatter_info($fields) { } } } - drupal_alter('field_formatter_info', $info); return $info; } diff --git a/sites/all/modules/ctools/includes/jump-menu.inc b/sites/all/modules/ctools/includes/jump-menu.inc index a5f99aa..51f4598 100644 --- a/sites/all/modules/ctools/includes/jump-menu.inc +++ b/sites/all/modules/ctools/includes/jump-menu.inc @@ -51,7 +51,7 @@ function ctools_jump_menu($form, &$form_state, $select, $options = array()) { 'hide' => TRUE, ); - ctools_add_js('jump-menu'); + $form['#attached']['js'][] = ctools_attach_js('jump-menu'); if (!empty($options['choose'])) { $select = array('' => $options['choose']) + $select; diff --git a/sites/all/modules/ctools/includes/math-expr.inc b/sites/all/modules/ctools/includes/math-expr.inc index beffb93..3105ec5 100644 --- a/sites/all/modules/ctools/includes/math-expr.inc +++ b/sites/all/modules/ctools/includes/math-expr.inc @@ -99,7 +99,7 @@ class ctools_math_expr { 'sqrt','abs','ln','log', 'time', 'ceil', 'floor', 'min', 'max', 'round'); - function ctools_math_expr() { + function __construct() { // make the variables a little more accurate $this->v['pi'] = pi(); $this->v['e'] = exp(1); @@ -271,7 +271,7 @@ class ctools_math_expr { } elseif (in_array($op, $ops) and !$expecting_op) { return $this->trigger("unexpected operator '$op'"); } else { // I don't even want to know what you did to get here - return $this->trigger("an unexpected error occured"); + return $this->trigger("an unexpected error occurred"); } if ($index == strlen($expr)) { if (in_array($op, $ops)) { // did we end with an operator? bad. diff --git a/sites/all/modules/ctools/includes/modal.inc b/sites/all/modules/ctools/includes/modal.inc index ee969ab..fc99015 100644 --- a/sites/all/modules/ctools/includes/modal.inc +++ b/sites/all/modules/ctools/includes/modal.inc @@ -66,6 +66,7 @@ function ctools_modal_add_js() { drupal_add_library('system', 'jquery.form'); drupal_add_library('system', 'drupal.progress'); drupal_add_library('system', 'drupal.ajax'); + drupal_add_library('system', 'ui'); ctools_add_js('modal'); ctools_add_css('modal'); diff --git a/sites/all/modules/ctools/includes/plugins.inc b/sites/all/modules/ctools/includes/plugins.inc index eadb68f..65f3662 100644 --- a/sites/all/modules/ctools/includes/plugins.inc +++ b/sites/all/modules/ctools/includes/plugins.inc @@ -79,7 +79,9 @@ function ctools_plugin_api_info($owner, $api, $minimum_version, $current_version } // Only process if version is between minimum and current, inclusive. - if (version_compare($version, $minimum_version, '>=') && version_compare($version, $current_version, '<=')) { + if (($version == $minimum_version) || ($version == $current_version) + || (version_compare($version, $minimum_version, '>=') + && version_compare($version, $current_version, '<='))) { if (!isset($info['path'])) { $info['path'] = drupal_get_path('module', $module); } @@ -110,7 +112,7 @@ function ctools_plugin_api_info($owner, $api, $minimum_version, $current_version } // Allow other modules to hook in. - drupal_alter($hook, $cache[$owner][$api]); + drupal_alter($hook, $cache[$owner][$api], $owner, $api); } return $cache[$owner][$api]; @@ -213,7 +215,7 @@ function ctools_plugin_api_get_hook($owner, $api) { */ function ctools_get_plugins($module, $type, $id = NULL) { // Store local caches of plugins and plugin info so we don't have to do full - // lookups everytime. + // lookups every time. static $drupal_static_fast; if (!isset($drupal_static_fast)) { $drupal_static_fast['plugins'] = &drupal_static('ctools_plugins', array()); @@ -472,7 +474,7 @@ function ctools_plugin_load_includes($info, $filename = NULL) { } else { - require_once DRUPAL_ROOT . '/' . $file->uri; + include_once DRUPAL_ROOT . '/' . $file->uri; // .inc files have a special format for the hook identifier. // For example, 'foo.inc' in the module 'mogul' using the plugin // whose hook is named 'borg_type' should have a function named (deep breath) diff --git a/sites/all/modules/ctools/includes/stylizer.inc b/sites/all/modules/ctools/includes/stylizer.inc index 9fdc81d..5bc8450 100644 --- a/sites/all/modules/ctools/includes/stylizer.inc +++ b/sites/all/modules/ctools/includes/stylizer.inc @@ -500,7 +500,7 @@ class ctools_stylizer_image_processor { $palette[$luminosity_input]['green'] = $green; $palette[$luminosity_input]['blue'] = $blue; - // Now we complete the palette, first we'll do it tothe black, and then to + // Now we complete the palette, first we'll do it to the black, and then to // the white. // From input to black diff --git a/sites/all/modules/ctools/includes/uuid.inc b/sites/all/modules/ctools/includes/uuid.inc index b0567d3..6e4c42c 100644 --- a/sites/all/modules/ctools/includes/uuid.inc +++ b/sites/all/modules/ctools/includes/uuid.inc @@ -25,7 +25,8 @@ function _ctools_uuid_generate_com() { * Generates an universally unique identifier using the PECL extension. */ function _ctools_uuid_generate_pecl() { - return uuid_create(UUID_TYPE_DEFAULT); + $uuid_type = UUID_TYPE_DEFAULT; + return uuid_create($uuid_type); } /** diff --git a/sites/all/modules/ctools/js/dependent.js b/sites/all/modules/ctools/js/dependent.js index f74ec81..a60fc12 100644 --- a/sites/all/modules/ctools/js/dependent.js +++ b/sites/all/modules/ctools/js/dependent.js @@ -97,7 +97,13 @@ else { switch ($(trigger).attr('type')) { case 'checkbox': - var val = $(trigger).attr('checked') ? true : false; + // **This check determines if using a jQuery version 1.7 or newer which requires the use of the prop function instead of the attr function when not called on an attribute + if ($().prop) { + var val = $(trigger).prop('checked') ? true : false; + } + else { + var val = $(trigger).attr('checked') ? true : false; + } if (val) { $(trigger).siblings('label').removeClass('hidden-options').addClass('expanded-options'); @@ -148,34 +154,41 @@ len++; } - var object = $('#' + id + '-wrapper'); - if (!object.size()) { - // Some elements can't use the parent() method or they can - // damage things. They are guaranteed to have wrappers but - // only if dependent.inc provided them. This check prevents - // problems when multiple AJAX calls cause settings to build - // up. - var $original = $('#' + id); - if ($original.is('fieldset') || $original.is('textarea')) { - continue; - } - - object = $('#' + id).parent(); + var $original = $('#' + id); + if ($original.is('fieldset') || $original.is('textarea')) { + continue; } + var object = $original.parent(); + if (Drupal.settings.CTools.dependent[id].type == 'disable') { if (Drupal.settings.CTools.dependent[id].num <= len) { // Show if the element if criteria is matched - object.attr('disabled', false); - object.addClass('dependent-options'); - object.children().attr('disabled', false); + // **This check determines if using a jQuery version 1.7 or newer which requires the use of the prop function instead of the attr function when not called on an attribute + if (typeof $().prop == 'function') { + object.prop('disabled', false); + object.addClass('dependent-options'); + object.children().prop('disabled', false); + } + else { + object.attr('disabled', false); + object.addClass('dependent-options'); + object.children().attr('disabled', false); + } } else { // Otherwise hide. Use css rather than hide() because hide() // does not work if the item is already hidden, for example, // in a collapsed fieldset. - object.attr('disabled', true); - object.children().attr('disabled', true); + // **This check determines if using a jQuery version 1.7 or newer which requires the use of the prop function instead of the attr function when not called on an attribute + if (typeof $().prop == 'function') { + object.prop('disabled', true); + object.children().prop('disabled', true); + } + else { + object.attr('disabled', true); + object.children().attr('disabled', true); + } } } else { diff --git a/sites/all/modules/ctools/js/modal.js b/sites/all/modules/ctools/js/modal.js index 37908cf..634595f 100644 --- a/sites/all/modules/ctools/js/modal.js +++ b/sites/all/modules/ctools/js/modal.js @@ -48,7 +48,8 @@ modalOptions: { opacity: .55, background: '#fff' - } + }, + modalClass: 'default' }; var settings = {}; @@ -97,8 +98,8 @@ resize(); $('span.modal-title', Drupal.CTools.Modal.modal).html(Drupal.CTools.Modal.currentSettings.loadingText); - Drupal.CTools.Modal.modalContent(Drupal.CTools.Modal.modal, settings.modalOptions, settings.animation, settings.animationSpeed); - $('#modalContent .modal-content').html(Drupal.theme(settings.throbberTheme)); + Drupal.CTools.Modal.modalContent(Drupal.CTools.Modal.modal, settings.modalOptions, settings.animation, settings.animationSpeed, settings.modalClass); + $('#modalContent .modal-content').html(Drupal.theme(settings.throbberTheme)).addClass('ctools-modal-loading'); // Position autocomplete results based on the scroll position of the modal. $('#modalContent .modal-content').delegate('input.form-autocomplete', 'keyup', function() { @@ -120,18 +121,18 @@ */ Drupal.theme.prototype.CToolsModalDialog = function () { var html = '' - html += '
' - html += '
' // panels-modal-content - html += ' '; - html += ' '; + html += '
' + html += '
' // panels-modal-content + html += ' '; + html += ' '; html += '
'; + html += '
'; return html; } @@ -141,11 +142,11 @@ */ Drupal.theme.prototype.CToolsModalThrobber = function () { var html = ''; - html += ' "+(i[0]>0&&E==i[1]-1?'
':""):"");M+=x}I+=M}I+=e+(d.browser.msie&&parseInt(d.browser.version,10)<7&&!a.inline?'':"");a._keyEvent=false;return I},_generateMonthYearHeader:function(a,b,c,e,f,h,i,g){var j=this._get(a,"changeMonth"),l=this._get(a,"changeYear"),u=this._get(a,"showMonthAfterYear"),k='
', -o="";if(h||!j)o+=''+i[b]+"";else{i=e&&e.getFullYear()==c;var m=f&&f.getFullYear()==c;o+='"}u||(k+=o+(h||!(j&& -l)?" ":""));a.yearshtml="";if(h||!l)k+=''+c+"";else{g=this._get(a,"yearRange").split(":");var r=(new Date).getFullYear();i=function(s){s=s.match(/c[+-].*/)?c+parseInt(s.substring(1),10):s.match(/[+-].*/)?r+parseInt(s,10):parseInt(s,10);return isNaN(s)?r:s};b=i(g[0]);g=Math.max(b,i(g[1]||""));b=e?Math.max(b,e.getFullYear()):b;g=f?Math.min(g,f.getFullYear()):g;for(a.yearshtml+='";if(d.browser.mozilla)k+='";else{k+=a.yearshtml;a.yearshtml=null}}k+=this._get(a,"yearSuffix");if(u)k+=(h||!(j&&l)?" ":"")+o;k+="
";return k},_adjustInstDate:function(a,b,c){var e= -a.drawYear+(c=="Y"?b:0),f=a.drawMonth+(c=="M"?b:0);b=Math.min(a.selectedDay,this._getDaysInMonth(e,f))+(c=="D"?b:0);e=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(e,f,b)));a.selectedDay=e.getDate();a.drawMonth=a.selectedMonth=e.getMonth();a.drawYear=a.selectedYear=e.getFullYear();if(c=="M"||c=="Y")this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");b=c&&ba?a:b},_notifyChange:function(a){var b=this._get(a, -"onChangeMonthYear");if(b)b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){a=this._get(a,"numberOfMonths");return a==null?[1,1]:typeof a=="number"?[1,a]:a},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,e){var f=this._getNumberOfMonths(a); -c=this._daylightSavingAdjust(new Date(c,e+(b<0?b:f[0]*f[1]),1));b<0&&c.setDate(this._getDaysInMonth(c.getFullYear(),c.getMonth()));return this._isInRange(a,c)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!a||b.getTime()<=a.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a, -"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,e){if(!b){a.currentDay=a.selectedDay;a.currentMonth=a.selectedMonth;a.currentYear=a.selectedYear}b=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(e,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),b,this._getFormatConfig(a))}});d.fn.datepicker= -function(a){if(!this.length)return this;if(!d.datepicker.initialized){d(document).mousedown(d.datepicker._checkExternalClick).find("body").append(d.datepicker.dpDiv);d.datepicker.initialized=true}var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker, -[this[0]].concat(b));return this.each(function(){typeof a=="string"?d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this].concat(b)):d.datepicker._attachDatepicker(this,a)})};d.datepicker=new K;d.datepicker.initialized=false;d.datepicker.uuid=(new Date).getTime();d.datepicker.version="1.8.11";window["DP_jQuery_"+y]=d})(jQuery); +/*! jQuery UI - v1.10.2 - 2013-03-14 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ +(function(t,e){function i(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},t.extend(this._defaults,this.regional[""]),this.dpDiv=s(t("
"))}function s(e){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return e.delegate(i,"mouseout",function(){t(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).removeClass("ui-datepicker-next-hover")}).delegate(i,"mouseover",function(){t.datepicker._isDisabledDatepicker(a.inline?e.parent()[0]:a.input[0])||(t(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),t(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).addClass("ui-datepicker-next-hover"))})}function n(e,i){t.extend(e,i);for(var s in i)null==i[s]&&(e[s]=i[s]);return e}t.extend(t.ui,{datepicker:{version:"1.10.2"}});var a,r="datepicker",o=(new Date).getTime();t.extend(i.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(t){return n(this._defaults,t||{}),this},_attachDatepicker:function(e,i){var s,n,a;s=e.nodeName.toLowerCase(),n="div"===s||"span"===s,e.id||(this.uuid+=1,e.id="dp"+this.uuid),a=this._newInst(t(e),n),a.settings=t.extend({},i||{}),"input"===s?this._connectDatepicker(e,a):n&&this._inlineDatepicker(e,a)},_newInst:function(e,i){var n=e[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:n,input:e,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?s(t("
")):this.dpDiv}},_connectDatepicker:function(e,i){var s=t(e);i.append=t([]),i.trigger=t([]),s.hasClass(this.markerClassName)||(this._attachments(s,i),s.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp),this._autoSize(i),t.data(e,r,i),i.settings.disabled&&this._disableDatepicker(e))},_attachments:function(e,i){var s,n,a,r=this._get(i,"appendText"),o=this._get(i,"isRTL");i.append&&i.append.remove(),r&&(i.append=t(""+r+""),e[o?"before":"after"](i.append)),e.unbind("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),s=this._get(i,"showOn"),("focus"===s||"both"===s)&&e.focus(this._showDatepicker),("button"===s||"both"===s)&&(n=this._get(i,"buttonText"),a=this._get(i,"buttonImage"),i.trigger=t(this._get(i,"buttonImageOnly")?t("").addClass(this._triggerClass).attr({src:a,alt:n,title:n}):t("").addClass(this._triggerClass).html(a?t("").attr({src:a,alt:n,title:n}):n)),e[o?"before":"after"](i.trigger),i.trigger.click(function(){return t.datepicker._datepickerShowing&&t.datepicker._lastInput===e[0]?t.datepicker._hideDatepicker():t.datepicker._datepickerShowing&&t.datepicker._lastInput!==e[0]?(t.datepicker._hideDatepicker(),t.datepicker._showDatepicker(e[0])):t.datepicker._showDatepicker(e[0]),!1}))},_autoSize:function(t){if(this._get(t,"autoSize")&&!t.inline){var e,i,s,n,a=new Date(2009,11,20),r=this._get(t,"dateFormat");r.match(/[DM]/)&&(e=function(t){for(i=0,s=0,n=0;t.length>n;n++)t[n].length>i&&(i=t[n].length,s=n);return s},a.setMonth(e(this._get(t,r.match(/MM/)?"monthNames":"monthNamesShort"))),a.setDate(e(this._get(t,r.match(/DD/)?"dayNames":"dayNamesShort"))+20-a.getDay())),t.input.attr("size",this._formatDate(t,a).length)}},_inlineDatepicker:function(e,i){var s=t(e);s.hasClass(this.markerClassName)||(s.addClass(this.markerClassName).append(i.dpDiv),t.data(e,r,i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(e),i.dpDiv.css("display","block"))},_dialogDatepicker:function(e,i,s,a,o){var h,l,c,u,d,p=this._dialogInst;return p||(this.uuid+=1,h="dp"+this.uuid,this._dialogInput=t(""),this._dialogInput.keydown(this._doKeyDown),t("body").append(this._dialogInput),p=this._dialogInst=this._newInst(this._dialogInput,!1),p.settings={},t.data(this._dialogInput[0],r,p)),n(p.settings,a||{}),i=i&&i.constructor===Date?this._formatDate(p,i):i,this._dialogInput.val(i),this._pos=o?o.length?o:[o.pageX,o.pageY]:null,this._pos||(l=document.documentElement.clientWidth,c=document.documentElement.clientHeight,u=document.documentElement.scrollLeft||document.body.scrollLeft,d=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[l/2-100+u,c/2-150+d]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),p.settings.onSelect=s,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),t.blockUI&&t.blockUI(this.dpDiv),t.data(this._dialogInput[0],r,p),this},_destroyDatepicker:function(e){var i,s=t(e),n=t.data(e,r);s.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),t.removeData(e,r),"input"===i?(n.append.remove(),n.trigger.remove(),s.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):("div"===i||"span"===i)&&s.removeClass(this.markerClassName).empty())},_enableDatepicker:function(e){var i,s,n=t(e),a=t.data(e,r);n.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),"input"===i?(e.disabled=!1,a.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().removeClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=t.map(this._disabledInputs,function(t){return t===e?null:t}))},_disableDatepicker:function(e){var i,s,n=t(e),a=t.data(e,r);n.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),"input"===i?(e.disabled=!0,a.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().addClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=t.map(this._disabledInputs,function(t){return t===e?null:t}),this._disabledInputs[this._disabledInputs.length]=e)},_isDisabledDatepicker:function(t){if(!t)return!1;for(var e=0;this._disabledInputs.length>e;e++)if(this._disabledInputs[e]===t)return!0;return!1},_getInst:function(e){try{return t.data(e,r)}catch(i){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(i,s,a){var r,o,h,l,c=this._getInst(i);return 2===arguments.length&&"string"==typeof s?"defaults"===s?t.extend({},t.datepicker._defaults):c?"all"===s?t.extend({},c.settings):this._get(c,s):null:(r=s||{},"string"==typeof s&&(r={},r[s]=a),c&&(this._curInst===c&&this._hideDatepicker(),o=this._getDateDatepicker(i,!0),h=this._getMinMaxDate(c,"min"),l=this._getMinMaxDate(c,"max"),n(c.settings,r),null!==h&&r.dateFormat!==e&&r.minDate===e&&(c.settings.minDate=this._formatDate(c,h)),null!==l&&r.dateFormat!==e&&r.maxDate===e&&(c.settings.maxDate=this._formatDate(c,l)),"disabled"in r&&(r.disabled?this._disableDatepicker(i):this._enableDatepicker(i)),this._attachments(t(i),c),this._autoSize(c),this._setDate(c,o),this._updateAlternate(c),this._updateDatepicker(c)),e)},_changeDatepicker:function(t,e,i){this._optionDatepicker(t,e,i)},_refreshDatepicker:function(t){var e=this._getInst(t);e&&this._updateDatepicker(e)},_setDateDatepicker:function(t,e){var i=this._getInst(t);i&&(this._setDate(i,e),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(t,e){var i=this._getInst(t);return i&&!i.inline&&this._setDateFromField(i,e),i?this._getDate(i):null},_doKeyDown:function(e){var i,s,n,a=t.datepicker._getInst(e.target),r=!0,o=a.dpDiv.is(".ui-datepicker-rtl");if(a._keyEvent=!0,t.datepicker._datepickerShowing)switch(e.keyCode){case 9:t.datepicker._hideDatepicker(),r=!1;break;case 13:return n=t("td."+t.datepicker._dayOverClass+":not(."+t.datepicker._currentClass+")",a.dpDiv),n[0]&&t.datepicker._selectDay(e.target,a.selectedMonth,a.selectedYear,n[0]),i=t.datepicker._get(a,"onSelect"),i?(s=t.datepicker._formatDate(a),i.apply(a.input?a.input[0]:null,[s,a])):t.datepicker._hideDatepicker(),!1;case 27:t.datepicker._hideDatepicker();break;case 33:t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(a,"stepBigMonths"):-t.datepicker._get(a,"stepMonths"),"M");break;case 34:t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(a,"stepBigMonths"):+t.datepicker._get(a,"stepMonths"),"M");break;case 35:(e.ctrlKey||e.metaKey)&&t.datepicker._clearDate(e.target),r=e.ctrlKey||e.metaKey;break;case 36:(e.ctrlKey||e.metaKey)&&t.datepicker._gotoToday(e.target),r=e.ctrlKey||e.metaKey;break;case 37:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,o?1:-1,"D"),r=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(a,"stepBigMonths"):-t.datepicker._get(a,"stepMonths"),"M");break;case 38:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,-7,"D"),r=e.ctrlKey||e.metaKey;break;case 39:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,o?-1:1,"D"),r=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(a,"stepBigMonths"):+t.datepicker._get(a,"stepMonths"),"M");break;case 40:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,7,"D"),r=e.ctrlKey||e.metaKey;break;default:r=!1}else 36===e.keyCode&&e.ctrlKey?t.datepicker._showDatepicker(this):r=!1;r&&(e.preventDefault(),e.stopPropagation())},_doKeyPress:function(i){var s,n,a=t.datepicker._getInst(i.target);return t.datepicker._get(a,"constrainInput")?(s=t.datepicker._possibleChars(t.datepicker._get(a,"dateFormat")),n=String.fromCharCode(null==i.charCode?i.keyCode:i.charCode),i.ctrlKey||i.metaKey||" ">n||!s||s.indexOf(n)>-1):e},_doKeyUp:function(e){var i,s=t.datepicker._getInst(e.target);if(s.input.val()!==s.lastVal)try{i=t.datepicker.parseDate(t.datepicker._get(s,"dateFormat"),s.input?s.input.val():null,t.datepicker._getFormatConfig(s)),i&&(t.datepicker._setDateFromField(s),t.datepicker._updateAlternate(s),t.datepicker._updateDatepicker(s))}catch(n){}return!0},_showDatepicker:function(e){if(e=e.target||e,"input"!==e.nodeName.toLowerCase()&&(e=t("input",e.parentNode)[0]),!t.datepicker._isDisabledDatepicker(e)&&t.datepicker._lastInput!==e){var i,s,a,r,o,h,l;i=t.datepicker._getInst(e),t.datepicker._curInst&&t.datepicker._curInst!==i&&(t.datepicker._curInst.dpDiv.stop(!0,!0),i&&t.datepicker._datepickerShowing&&t.datepicker._hideDatepicker(t.datepicker._curInst.input[0])),s=t.datepicker._get(i,"beforeShow"),a=s?s.apply(e,[e,i]):{},a!==!1&&(n(i.settings,a),i.lastVal=null,t.datepicker._lastInput=e,t.datepicker._setDateFromField(i),t.datepicker._inDialog&&(e.value=""),t.datepicker._pos||(t.datepicker._pos=t.datepicker._findPos(e),t.datepicker._pos[1]+=e.offsetHeight),r=!1,t(e).parents().each(function(){return r|="fixed"===t(this).css("position"),!r}),o={left:t.datepicker._pos[0],top:t.datepicker._pos[1]},t.datepicker._pos=null,i.dpDiv.empty(),i.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),t.datepicker._updateDatepicker(i),o=t.datepicker._checkOffset(i,o,r),i.dpDiv.css({position:t.datepicker._inDialog&&t.blockUI?"static":r?"fixed":"absolute",display:"none",left:o.left+"px",top:o.top+"px"}),i.inline||(h=t.datepicker._get(i,"showAnim"),l=t.datepicker._get(i,"duration"),i.dpDiv.zIndex(t(e).zIndex()+1),t.datepicker._datepickerShowing=!0,t.effects&&t.effects.effect[h]?i.dpDiv.show(h,t.datepicker._get(i,"showOptions"),l):i.dpDiv[h||"show"](h?l:null),i.input.is(":visible")&&!i.input.is(":disabled")&&i.input.focus(),t.datepicker._curInst=i))}},_updateDatepicker:function(e){this.maxRows=4,a=e,e.dpDiv.empty().append(this._generateHTML(e)),this._attachHandlers(e),e.dpDiv.find("."+this._dayOverClass+" a").mouseover();var i,s=this._getNumberOfMonths(e),n=s[1],r=17;e.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),n>1&&e.dpDiv.addClass("ui-datepicker-multi-"+n).css("width",r*n+"em"),e.dpDiv[(1!==s[0]||1!==s[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),e.dpDiv[(this._get(e,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),e===t.datepicker._curInst&&t.datepicker._datepickerShowing&&e.input&&e.input.is(":visible")&&!e.input.is(":disabled")&&e.input[0]!==document.activeElement&&e.input.focus(),e.yearshtml&&(i=e.yearshtml,setTimeout(function(){i===e.yearshtml&&e.yearshtml&&e.dpDiv.find("select.ui-datepicker-year:first").replaceWith(e.yearshtml),i=e.yearshtml=null},0))},_getBorders:function(t){var e=function(t){return{thin:1,medium:2,thick:3}[t]||t};return[parseFloat(e(t.css("border-left-width"))),parseFloat(e(t.css("border-top-width")))]},_checkOffset:function(e,i,s){var n=e.dpDiv.outerWidth(),a=e.dpDiv.outerHeight(),r=e.input?e.input.outerWidth():0,o=e.input?e.input.outerHeight():0,h=document.documentElement.clientWidth+(s?0:t(document).scrollLeft()),l=document.documentElement.clientHeight+(s?0:t(document).scrollTop());return i.left-=this._get(e,"isRTL")?n-r:0,i.left-=s&&i.left===e.input.offset().left?t(document).scrollLeft():0,i.top-=s&&i.top===e.input.offset().top+o?t(document).scrollTop():0,i.left-=Math.min(i.left,i.left+n>h&&h>n?Math.abs(i.left+n-h):0),i.top-=Math.min(i.top,i.top+a>l&&l>a?Math.abs(a+o):0),i},_findPos:function(e){for(var i,s=this._getInst(e),n=this._get(s,"isRTL");e&&("hidden"===e.type||1!==e.nodeType||t.expr.filters.hidden(e));)e=e[n?"previousSibling":"nextSibling"];return i=t(e).offset(),[i.left,i.top]},_hideDatepicker:function(e){var i,s,n,a,o=this._curInst;!o||e&&o!==t.data(e,r)||this._datepickerShowing&&(i=this._get(o,"showAnim"),s=this._get(o,"duration"),n=function(){t.datepicker._tidyDialog(o)},t.effects&&(t.effects.effect[i]||t.effects[i])?o.dpDiv.hide(i,t.datepicker._get(o,"showOptions"),s,n):o.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?s:null,n),i||n(),this._datepickerShowing=!1,a=this._get(o,"onClose"),a&&a.apply(o.input?o.input[0]:null,[o.input?o.input.val():"",o]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),t.blockUI&&(t.unblockUI(),t("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(t){t.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(e){if(t.datepicker._curInst){var i=t(e.target),s=t.datepicker._getInst(i[0]);(i[0].id!==t.datepicker._mainDivId&&0===i.parents("#"+t.datepicker._mainDivId).length&&!i.hasClass(t.datepicker.markerClassName)&&!i.closest("."+t.datepicker._triggerClass).length&&t.datepicker._datepickerShowing&&(!t.datepicker._inDialog||!t.blockUI)||i.hasClass(t.datepicker.markerClassName)&&t.datepicker._curInst!==s)&&t.datepicker._hideDatepicker()}},_adjustDate:function(e,i,s){var n=t(e),a=this._getInst(n[0]);this._isDisabledDatepicker(n[0])||(this._adjustInstDate(a,i+("M"===s?this._get(a,"showCurrentAtPos"):0),s),this._updateDatepicker(a))},_gotoToday:function(e){var i,s=t(e),n=this._getInst(s[0]);this._get(n,"gotoCurrent")&&n.currentDay?(n.selectedDay=n.currentDay,n.drawMonth=n.selectedMonth=n.currentMonth,n.drawYear=n.selectedYear=n.currentYear):(i=new Date,n.selectedDay=i.getDate(),n.drawMonth=n.selectedMonth=i.getMonth(),n.drawYear=n.selectedYear=i.getFullYear()),this._notifyChange(n),this._adjustDate(s)},_selectMonthYear:function(e,i,s){var n=t(e),a=this._getInst(n[0]);a["selected"+("M"===s?"Month":"Year")]=a["draw"+("M"===s?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(a),this._adjustDate(n)},_selectDay:function(e,i,s,n){var a,r=t(e);t(n).hasClass(this._unselectableClass)||this._isDisabledDatepicker(r[0])||(a=this._getInst(r[0]),a.selectedDay=a.currentDay=t("a",n).html(),a.selectedMonth=a.currentMonth=i,a.selectedYear=a.currentYear=s,this._selectDate(e,this._formatDate(a,a.currentDay,a.currentMonth,a.currentYear)))},_clearDate:function(e){var i=t(e);this._selectDate(i,"")},_selectDate:function(e,i){var s,n=t(e),a=this._getInst(n[0]);i=null!=i?i:this._formatDate(a),a.input&&a.input.val(i),this._updateAlternate(a),s=this._get(a,"onSelect"),s?s.apply(a.input?a.input[0]:null,[i,a]):a.input&&a.input.trigger("change"),a.inline?this._updateDatepicker(a):(this._hideDatepicker(),this._lastInput=a.input[0],"object"!=typeof a.input[0]&&a.input.focus(),this._lastInput=null)},_updateAlternate:function(e){var i,s,n,a=this._get(e,"altField");a&&(i=this._get(e,"altFormat")||this._get(e,"dateFormat"),s=this._getDate(e),n=this.formatDate(i,s,this._getFormatConfig(e)),t(a).each(function(){t(this).val(n)}))},noWeekends:function(t){var e=t.getDay();return[e>0&&6>e,""]},iso8601Week:function(t){var e,i=new Date(t.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),e=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((e-i)/864e5)/7)+1},parseDate:function(i,s,n){if(null==i||null==s)throw"Invalid arguments";if(s="object"==typeof s?""+s:s+"",""===s)return null;var a,r,o,h,l=0,c=(n?n.shortYearCutoff:null)||this._defaults.shortYearCutoff,u="string"!=typeof c?c:(new Date).getFullYear()%100+parseInt(c,10),d=(n?n.dayNamesShort:null)||this._defaults.dayNamesShort,p=(n?n.dayNames:null)||this._defaults.dayNames,f=(n?n.monthNamesShort:null)||this._defaults.monthNamesShort,m=(n?n.monthNames:null)||this._defaults.monthNames,g=-1,v=-1,_=-1,b=-1,y=!1,w=function(t){var e=i.length>a+1&&i.charAt(a+1)===t;return e&&a++,e},k=function(t){var e=w(t),i="@"===t?14:"!"===t?20:"y"===t&&e?4:"o"===t?3:2,n=RegExp("^\\d{1,"+i+"}"),a=s.substring(l).match(n);if(!a)throw"Missing number at position "+l;return l+=a[0].length,parseInt(a[0],10)},x=function(i,n,a){var r=-1,o=t.map(w(i)?a:n,function(t,e){return[[e,t]]}).sort(function(t,e){return-(t[1].length-e[1].length)});if(t.each(o,function(t,i){var n=i[1];return s.substr(l,n.length).toLowerCase()===n.toLowerCase()?(r=i[0],l+=n.length,!1):e}),-1!==r)return r+1;throw"Unknown name at position "+l},D=function(){if(s.charAt(l)!==i.charAt(a))throw"Unexpected literal at position "+l;l++};for(a=0;i.length>a;a++)if(y)"'"!==i.charAt(a)||w("'")?D():y=!1;else switch(i.charAt(a)){case"d":_=k("d");break;case"D":x("D",d,p);break;case"o":b=k("o");break;case"m":v=k("m");break;case"M":v=x("M",f,m);break;case"y":g=k("y");break;case"@":h=new Date(k("@")),g=h.getFullYear(),v=h.getMonth()+1,_=h.getDate();break;case"!":h=new Date((k("!")-this._ticksTo1970)/1e4),g=h.getFullYear(),v=h.getMonth()+1,_=h.getDate();break;case"'":w("'")?D():y=!0;break;default:D()}if(s.length>l&&(o=s.substr(l),!/^\s+/.test(o)))throw"Extra/unparsed characters found in date: "+o;if(-1===g?g=(new Date).getFullYear():100>g&&(g+=(new Date).getFullYear()-(new Date).getFullYear()%100+(u>=g?0:-100)),b>-1)for(v=1,_=b;;){if(r=this._getDaysInMonth(g,v-1),r>=_)break;v++,_-=r}if(h=this._daylightSavingAdjust(new Date(g,v-1,_)),h.getFullYear()!==g||h.getMonth()+1!==v||h.getDate()!==_)throw"Invalid date";return h},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:1e7*60*60*24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(t,e,i){if(!e)return"";var s,n=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,a=(i?i.dayNames:null)||this._defaults.dayNames,r=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,o=(i?i.monthNames:null)||this._defaults.monthNames,h=function(e){var i=t.length>s+1&&t.charAt(s+1)===e;return i&&s++,i},l=function(t,e,i){var s=""+e;if(h(t))for(;i>s.length;)s="0"+s;return s},c=function(t,e,i,s){return h(t)?s[e]:i[e]},u="",d=!1;if(e)for(s=0;t.length>s;s++)if(d)"'"!==t.charAt(s)||h("'")?u+=t.charAt(s):d=!1;else switch(t.charAt(s)){case"d":u+=l("d",e.getDate(),2);break;case"D":u+=c("D",e.getDay(),n,a);break;case"o":u+=l("o",Math.round((new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()-new Date(e.getFullYear(),0,0).getTime())/864e5),3);break;case"m":u+=l("m",e.getMonth()+1,2);break;case"M":u+=c("M",e.getMonth(),r,o);break;case"y":u+=h("y")?e.getFullYear():(10>e.getYear()%100?"0":"")+e.getYear()%100;break;case"@":u+=e.getTime();break;case"!":u+=1e4*e.getTime()+this._ticksTo1970;break;case"'":h("'")?u+="'":d=!0;break;default:u+=t.charAt(s)}return u},_possibleChars:function(t){var e,i="",s=!1,n=function(i){var s=t.length>e+1&&t.charAt(e+1)===i;return s&&e++,s};for(e=0;t.length>e;e++)if(s)"'"!==t.charAt(e)||n("'")?i+=t.charAt(e):s=!1;else switch(t.charAt(e)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":n("'")?i+="'":s=!0;break;default:i+=t.charAt(e)}return i},_get:function(t,i){return t.settings[i]!==e?t.settings[i]:this._defaults[i]},_setDateFromField:function(t,e){if(t.input.val()!==t.lastVal){var i=this._get(t,"dateFormat"),s=t.lastVal=t.input?t.input.val():null,n=this._getDefaultDate(t),a=n,r=this._getFormatConfig(t);try{a=this.parseDate(i,s,r)||n}catch(o){s=e?"":s}t.selectedDay=a.getDate(),t.drawMonth=t.selectedMonth=a.getMonth(),t.drawYear=t.selectedYear=a.getFullYear(),t.currentDay=s?a.getDate():0,t.currentMonth=s?a.getMonth():0,t.currentYear=s?a.getFullYear():0,this._adjustInstDate(t)}},_getDefaultDate:function(t){return this._restrictMinMax(t,this._determineDate(t,this._get(t,"defaultDate"),new Date))},_determineDate:function(e,i,s){var n=function(t){var e=new Date;return e.setDate(e.getDate()+t),e},a=function(i){try{return t.datepicker.parseDate(t.datepicker._get(e,"dateFormat"),i,t.datepicker._getFormatConfig(e))}catch(s){}for(var n=(i.toLowerCase().match(/^c/)?t.datepicker._getDate(e):null)||new Date,a=n.getFullYear(),r=n.getMonth(),o=n.getDate(),h=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,l=h.exec(i);l;){switch(l[2]||"d"){case"d":case"D":o+=parseInt(l[1],10);break;case"w":case"W":o+=7*parseInt(l[1],10);break;case"m":case"M":r+=parseInt(l[1],10),o=Math.min(o,t.datepicker._getDaysInMonth(a,r));break;case"y":case"Y":a+=parseInt(l[1],10),o=Math.min(o,t.datepicker._getDaysInMonth(a,r))}l=h.exec(i)}return new Date(a,r,o)},r=null==i||""===i?s:"string"==typeof i?a(i):"number"==typeof i?isNaN(i)?s:n(i):new Date(i.getTime());return r=r&&"Invalid Date"==""+r?s:r,r&&(r.setHours(0),r.setMinutes(0),r.setSeconds(0),r.setMilliseconds(0)),this._daylightSavingAdjust(r)},_daylightSavingAdjust:function(t){return t?(t.setHours(t.getHours()>12?t.getHours()+2:0),t):null},_setDate:function(t,e,i){var s=!e,n=t.selectedMonth,a=t.selectedYear,r=this._restrictMinMax(t,this._determineDate(t,e,new Date));t.selectedDay=t.currentDay=r.getDate(),t.drawMonth=t.selectedMonth=t.currentMonth=r.getMonth(),t.drawYear=t.selectedYear=t.currentYear=r.getFullYear(),n===t.selectedMonth&&a===t.selectedYear||i||this._notifyChange(t),this._adjustInstDate(t),t.input&&t.input.val(s?"":this._formatDate(t))},_getDate:function(t){var e=!t.currentYear||t.input&&""===t.input.val()?null:this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return e},_attachHandlers:function(e){var i=this._get(e,"stepMonths"),s="#"+e.id.replace(/\\\\/g,"\\");e.dpDiv.find("[data-handler]").map(function(){var e={prev:function(){window["DP_jQuery_"+o].datepicker._adjustDate(s,-i,"M")},next:function(){window["DP_jQuery_"+o].datepicker._adjustDate(s,+i,"M")},hide:function(){window["DP_jQuery_"+o].datepicker._hideDatepicker()},today:function(){window["DP_jQuery_"+o].datepicker._gotoToday(s)},selectDay:function(){return window["DP_jQuery_"+o].datepicker._selectDay(s,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return window["DP_jQuery_"+o].datepicker._selectMonthYear(s,this,"M"),!1},selectYear:function(){return window["DP_jQuery_"+o].datepicker._selectMonthYear(s,this,"Y"),!1}};t(this).bind(this.getAttribute("data-event"),e[this.getAttribute("data-handler")])})},_generateHTML:function(t){var e,i,s,n,a,r,o,h,l,c,u,d,p,f,m,g,v,_,b,y,w,k,x,D,T,C,S,M,N,I,P,A,z,H,E,F,O,W,j,R=new Date,L=this._daylightSavingAdjust(new Date(R.getFullYear(),R.getMonth(),R.getDate())),Y=this._get(t,"isRTL"),B=this._get(t,"showButtonPanel"),J=this._get(t,"hideIfNoPrevNext"),Q=this._get(t,"navigationAsDateFormat"),K=this._getNumberOfMonths(t),V=this._get(t,"showCurrentAtPos"),U=this._get(t,"stepMonths"),q=1!==K[0]||1!==K[1],X=this._daylightSavingAdjust(t.currentDay?new Date(t.currentYear,t.currentMonth,t.currentDay):new Date(9999,9,9)),G=this._getMinMaxDate(t,"min"),$=this._getMinMaxDate(t,"max"),Z=t.drawMonth-V,te=t.drawYear;if(0>Z&&(Z+=12,te--),$)for(e=this._daylightSavingAdjust(new Date($.getFullYear(),$.getMonth()-K[0]*K[1]+1,$.getDate())),e=G&&G>e?G:e;this._daylightSavingAdjust(new Date(te,Z,1))>e;)Z--,0>Z&&(Z=11,te--);for(t.drawMonth=Z,t.drawYear=te,i=this._get(t,"prevText"),i=Q?this.formatDate(i,this._daylightSavingAdjust(new Date(te,Z-U,1)),this._getFormatConfig(t)):i,s=this._canAdjustMonth(t,-1,te,Z)?""+i+"":J?"":""+i+"",n=this._get(t,"nextText"),n=Q?this.formatDate(n,this._daylightSavingAdjust(new Date(te,Z+U,1)),this._getFormatConfig(t)):n,a=this._canAdjustMonth(t,1,te,Z)?""+n+"":J?"":""+n+"",r=this._get(t,"currentText"),o=this._get(t,"gotoCurrent")&&t.currentDay?X:L,r=Q?this.formatDate(r,o,this._getFormatConfig(t)):r,h=t.inline?"":"",l=B?"
"+(Y?h:"")+(this._isInRange(t,o)?"":"")+(Y?"":h)+"
":"",c=parseInt(this._get(t,"firstDay"),10),c=isNaN(c)?0:c,u=this._get(t,"showWeek"),d=this._get(t,"dayNames"),p=this._get(t,"dayNamesMin"),f=this._get(t,"monthNames"),m=this._get(t,"monthNamesShort"),g=this._get(t,"beforeShowDay"),v=this._get(t,"showOtherMonths"),_=this._get(t,"selectOtherMonths"),b=this._getDefaultDate(t),y="",k=0;K[0]>k;k++){for(x="",this.maxRows=4,D=0;K[1]>D;D++){if(T=this._daylightSavingAdjust(new Date(te,Z,t.selectedDay)),C=" ui-corner-all",S="",q){if(S+="
"}for(S+="
"+(/all|left/.test(C)&&0===k?Y?a:s:"")+(/all|right/.test(C)&&0===k?Y?s:a:"")+this._generateMonthYearHeader(t,Z,te,G,$,k>0||D>0,f,m)+"
"+"",M=u?"":"",w=0;7>w;w++)N=(w+c)%7,M+="=5?" class='ui-datepicker-week-end'":"")+">"+""+p[N]+"";for(S+=M+"",I=this._getDaysInMonth(te,Z),te===t.selectedYear&&Z===t.selectedMonth&&(t.selectedDay=Math.min(t.selectedDay,I)),P=(this._getFirstDayOfMonth(te,Z)-c+7)%7,A=Math.ceil((P+I)/7),z=q?this.maxRows>A?this.maxRows:A:A,this.maxRows=z,H=this._daylightSavingAdjust(new Date(te,Z,1-P)),E=0;z>E;E++){for(S+="",F=u?"":"",w=0;7>w;w++)O=g?g.apply(t.input?t.input[0]:null,[H]):[!0,""],W=H.getMonth()!==Z,j=W&&!_||!O[0]||G&&G>H||$&&H>$,F+="",H.setDate(H.getDate()+1),H=this._daylightSavingAdjust(H);S+=F+""}Z++,Z>11&&(Z=0,te++),S+="
"+this._get(t,"weekHeader")+"
"+this._get(t,"calculateWeek")(H)+""+(W&&!v?" ":j?""+H.getDate()+"":""+H.getDate()+"")+"
"+(q?"
"+(K[0]>0&&D===K[1]-1?"
":""):""),x+=S}y+=x}return y+=l,t._keyEvent=!1,y},_generateMonthYearHeader:function(t,e,i,s,n,a,r,o){var h,l,c,u,d,p,f,m,g=this._get(t,"changeMonth"),v=this._get(t,"changeYear"),_=this._get(t,"showMonthAfterYear"),b="
",y="";if(a||!g)y+=""+r[e]+"";else{for(h=s&&s.getFullYear()===i,l=n&&n.getFullYear()===i,y+=""}if(_||(b+=y+(!a&&g&&v?"":" ")),!t.yearshtml)if(t.yearshtml="",a||!v)b+=""+i+"";else{for(u=this._get(t,"yearRange").split(":"),d=(new Date).getFullYear(),p=function(t){var e=t.match(/c[+\-].*/)?i+parseInt(t.substring(1),10):t.match(/[+\-].*/)?d+parseInt(t,10):parseInt(t,10);return isNaN(e)?d:e},f=p(u[0]),m=Math.max(f,p(u[1]||"")),f=s?Math.max(f,s.getFullYear()):f,m=n?Math.min(m,n.getFullYear()):m,t.yearshtml+="",b+=t.yearshtml,t.yearshtml=null}return b+=this._get(t,"yearSuffix"),_&&(b+=(!a&&g&&v?"":" ")+y),b+="
"},_adjustInstDate:function(t,e,i){var s=t.drawYear+("Y"===i?e:0),n=t.drawMonth+("M"===i?e:0),a=Math.min(t.selectedDay,this._getDaysInMonth(s,n))+("D"===i?e:0),r=this._restrictMinMax(t,this._daylightSavingAdjust(new Date(s,n,a)));t.selectedDay=r.getDate(),t.drawMonth=t.selectedMonth=r.getMonth(),t.drawYear=t.selectedYear=r.getFullYear(),("M"===i||"Y"===i)&&this._notifyChange(t)},_restrictMinMax:function(t,e){var i=this._getMinMaxDate(t,"min"),s=this._getMinMaxDate(t,"max"),n=i&&i>e?i:e;return s&&n>s?s:n},_notifyChange:function(t){var e=this._get(t,"onChangeMonthYear");e&&e.apply(t.input?t.input[0]:null,[t.selectedYear,t.selectedMonth+1,t])},_getNumberOfMonths:function(t){var e=this._get(t,"numberOfMonths");return null==e?[1,1]:"number"==typeof e?[1,e]:e},_getMinMaxDate:function(t,e){return this._determineDate(t,this._get(t,e+"Date"),null)},_getDaysInMonth:function(t,e){return 32-this._daylightSavingAdjust(new Date(t,e,32)).getDate()},_getFirstDayOfMonth:function(t,e){return new Date(t,e,1).getDay()},_canAdjustMonth:function(t,e,i,s){var n=this._getNumberOfMonths(t),a=this._daylightSavingAdjust(new Date(i,s+(0>e?e:n[0]*n[1]),1));return 0>e&&a.setDate(this._getDaysInMonth(a.getFullYear(),a.getMonth())),this._isInRange(t,a)},_isInRange:function(t,e){var i,s,n=this._getMinMaxDate(t,"min"),a=this._getMinMaxDate(t,"max"),r=null,o=null,h=this._get(t,"yearRange");return h&&(i=h.split(":"),s=(new Date).getFullYear(),r=parseInt(i[0],10),o=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(r+=s),i[1].match(/[+\-].*/)&&(o+=s)),(!n||e.getTime()>=n.getTime())&&(!a||e.getTime()<=a.getTime())&&(!r||e.getFullYear()>=r)&&(!o||o>=e.getFullYear())},_getFormatConfig:function(t){var e=this._get(t,"shortYearCutoff");return e="string"!=typeof e?e:(new Date).getFullYear()%100+parseInt(e,10),{shortYearCutoff:e,dayNamesShort:this._get(t,"dayNamesShort"),dayNames:this._get(t,"dayNames"),monthNamesShort:this._get(t,"monthNamesShort"),monthNames:this._get(t,"monthNames")}},_formatDate:function(t,e,i,s){e||(t.currentDay=t.selectedDay,t.currentMonth=t.selectedMonth,t.currentYear=t.selectedYear);var n=e?"object"==typeof e?e:this._daylightSavingAdjust(new Date(s,i,e)):this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return this.formatDate(this._get(t,"dateFormat"),n,this._getFormatConfig(t))}}),t.fn.datepicker=function(e){if(!this.length)return this;t.datepicker.initialized||(t(document).mousedown(t.datepicker._checkExternalClick),t.datepicker.initialized=!0),0===t("#"+t.datepicker._mainDivId).length&&t("body").append(t.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof e||"isDisabled"!==e&&"getDate"!==e&&"widget"!==e?"option"===e&&2===arguments.length&&"string"==typeof arguments[1]?t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof e?t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this].concat(i)):t.datepicker._attachDatepicker(this,e)}):t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this[0]].concat(i))},t.datepicker=new i,t.datepicker.initialized=!1,t.datepicker.uuid=(new Date).getTime(),t.datepicker.version="1.10.2",window["DP_jQuery_"+o]=t})(jQuery); \ No newline at end of file diff --git a/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.dialog.min.js b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.dialog.min.js index 1f47be0..e563533 100644 --- a/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.dialog.min.js +++ b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.dialog.min.js @@ -1,40 +1,4 @@ -/* - * jQuery UI Dialog 1.8.11 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Dialog - * - * Depends: - * jquery.ui.core.js - * jquery.ui.widget.js - * jquery.ui.button.js - * jquery.ui.draggable.js - * jquery.ui.mouse.js - * jquery.ui.position.js - * jquery.ui.resizable.js - */ -(function(c,j){var k={buttons:true,height:true,maxHeight:true,maxWidth:true,minHeight:true,minWidth:true,width:true},l={maxHeight:true,maxWidth:true,minHeight:true,minWidth:true};c.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:{my:"center",at:"center",collision:"fit",using:function(a){var b=c(this).css(a).offset().top;b<0&& -c(this).css("top",a.top-b)}},resizable:true,show:null,stack:true,title:"",width:300,zIndex:1E3},_create:function(){this.originalTitle=this.element.attr("title");if(typeof this.originalTitle!=="string")this.originalTitle="";this.options.title=this.options.title||this.originalTitle;var a=this,b=a.options,d=b.title||" ",e=c.ui.dialog.getTitleId(a.element),g=(a.uiDialog=c("
")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+b.dialogClass).css({zIndex:b.zIndex}).attr("tabIndex", --1).css("outline",0).keydown(function(i){if(b.closeOnEscape&&i.keyCode&&i.keyCode===c.ui.keyCode.ESCAPE){a.close(i);i.preventDefault()}}).attr({role:"dialog","aria-labelledby":e}).mousedown(function(i){a.moveToTop(false,i)});a.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g);var f=(a.uiDialogTitlebar=c("
")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(g),h=c('').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role", -"button").hover(function(){h.addClass("ui-state-hover")},function(){h.removeClass("ui-state-hover")}).focus(function(){h.addClass("ui-state-focus")}).blur(function(){h.removeClass("ui-state-focus")}).click(function(i){a.close(i);return false}).appendTo(f);(a.uiDialogTitlebarCloseText=c("")).addClass("ui-icon ui-icon-closethick").text(b.closeText).appendTo(h);c("").addClass("ui-dialog-title").attr("id",e).html(d).prependTo(f);if(c.isFunction(b.beforeclose)&&!c.isFunction(b.beforeClose))b.beforeClose= -b.beforeclose;f.find("*").add(f).disableSelection();b.draggable&&c.fn.draggable&&a._makeDraggable();b.resizable&&c.fn.resizable&&a._makeResizable();a._createButtons(b.buttons);a._isOpen=false;c.fn.bgiframe&&g.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var a=this;a.overlay&&a.overlay.destroy();a.uiDialog.hide();a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");a.uiDialog.remove();a.originalTitle&& -a.element.attr("title",a.originalTitle);return a},widget:function(){return this.uiDialog},close:function(a){var b=this,d,e;if(false!==b._trigger("beforeClose",a)){b.overlay&&b.overlay.destroy();b.uiDialog.unbind("keypress.ui-dialog");b._isOpen=false;if(b.options.hide)b.uiDialog.hide(b.options.hide,function(){b._trigger("close",a)});else{b.uiDialog.hide();b._trigger("close",a)}c.ui.dialog.overlay.resize();if(b.options.modal){d=0;c(".ui-dialog").each(function(){if(this!==b.uiDialog[0]){e=c(this).css("z-index"); -isNaN(e)||(d=Math.max(d,e))}});c.ui.dialog.maxZ=d}return b}},isOpen:function(){return this._isOpen},moveToTop:function(a,b){var d=this,e=d.options;if(e.modal&&!a||!e.stack&&!e.modal)return d._trigger("focus",b);if(e.zIndex>c.ui.dialog.maxZ)c.ui.dialog.maxZ=e.zIndex;if(d.overlay){c.ui.dialog.maxZ+=1;d.overlay.$el.css("z-index",c.ui.dialog.overlay.maxZ=c.ui.dialog.maxZ)}a={scrollTop:d.element.attr("scrollTop"),scrollLeft:d.element.attr("scrollLeft")};c.ui.dialog.maxZ+=1;d.uiDialog.css("z-index",c.ui.dialog.maxZ); -d.element.attr(a);d._trigger("focus",b);return d},open:function(){if(!this._isOpen){var a=this,b=a.options,d=a.uiDialog;a.overlay=b.modal?new c.ui.dialog.overlay(a):null;a._size();a._position(b.position);d.show(b.show);a.moveToTop(true);b.modal&&d.bind("keypress.ui-dialog",function(e){if(e.keyCode===c.ui.keyCode.TAB){var g=c(":tabbable",this),f=g.filter(":first");g=g.filter(":last");if(e.target===g[0]&&!e.shiftKey){f.focus(1);return false}else if(e.target===f[0]&&e.shiftKey){g.focus(1);return false}}}); -c(a.element.find(":tabbable").get().concat(d.find(".ui-dialog-buttonpane :tabbable").get().concat(d.get()))).eq(0).focus();a._isOpen=true;a._trigger("open");return a}},_createButtons:function(a){var b=this,d=false,e=c("
").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),g=c("
").addClass("ui-dialog-buttonset").appendTo(e);b.uiDialog.find(".ui-dialog-buttonpane").remove();typeof a==="object"&&a!==null&&c.each(a,function(){return!(d=true)});if(d){c.each(a,function(f, -h){h=c.isFunction(h)?{click:h,text:f}:h;f=c('').attr(h,true).unbind("click").click(function(){h.click.apply(b.element[0],arguments)}).appendTo(g);c.fn.button&&f.button()});e.appendTo(b.uiDialog)}},_makeDraggable:function(){function a(f){return{position:f.position,offset:f.offset}}var b=this,d=b.options,e=c(document),g;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(f,h){g= -d.height==="auto"?"auto":c(this).height();c(this).height(c(this).height()).addClass("ui-dialog-dragging");b._trigger("dragStart",f,a(h))},drag:function(f,h){b._trigger("drag",f,a(h))},stop:function(f,h){d.position=[h.position.left-e.scrollLeft(),h.position.top-e.scrollTop()];c(this).removeClass("ui-dialog-dragging").height(g);b._trigger("dragStop",f,a(h));c.ui.dialog.overlay.resize()}})},_makeResizable:function(a){function b(f){return{originalPosition:f.originalPosition,originalSize:f.originalSize, -position:f.position,size:f.size}}a=a===j?this.options.resizable:a;var d=this,e=d.options,g=d.uiDialog.css("position");a=typeof a==="string"?a:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:e.maxWidth,maxHeight:e.maxHeight,minWidth:e.minWidth,minHeight:d._minHeight(),handles:a,start:function(f,h){c(this).addClass("ui-dialog-resizing");d._trigger("resizeStart",f,b(h))},resize:function(f,h){d._trigger("resize",f,b(h))},stop:function(f, -h){c(this).removeClass("ui-dialog-resizing");e.height=c(this).height();e.width=c(this).width();d._trigger("resizeStop",f,b(h));c.ui.dialog.overlay.resize()}}).css("position",g).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;return a.height==="auto"?a.minHeight:Math.min(a.minHeight,a.height)},_position:function(a){var b=[],d=[0,0],e;if(a){if(typeof a==="string"||typeof a==="object"&&"0"in a){b=a.split?a.split(" "):[a[0],a[1]];if(b.length=== -1)b[1]=b[0];c.each(["left","top"],function(g,f){if(+b[g]===b[g]){d[g]=b[g];b[g]=f}});a={my:b.join(" "),at:b.join(" "),offset:d.join(" ")}}a=c.extend({},c.ui.dialog.prototype.options.position,a)}else a=c.ui.dialog.prototype.options.position;(e=this.uiDialog.is(":visible"))||this.uiDialog.show();this.uiDialog.css({top:0,left:0}).position(c.extend({of:window},a));e||this.uiDialog.hide()},_setOptions:function(a){var b=this,d={},e=false;c.each(a,function(g,f){b._setOption(g,f);if(g in k)e=true;if(g in -l)d[g]=f});e&&this._size();this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",d)},_setOption:function(a,b){var d=this,e=d.uiDialog;switch(a){case "beforeclose":a="beforeClose";break;case "buttons":d._createButtons(b);break;case "closeText":d.uiDialogTitlebarCloseText.text(""+b);break;case "dialogClass":e.removeClass(d.options.dialogClass).addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+b);break;case "disabled":b?e.addClass("ui-dialog-disabled"):e.removeClass("ui-dialog-disabled"); -break;case "draggable":var g=e.is(":data(draggable)");g&&!b&&e.draggable("destroy");!g&&b&&d._makeDraggable();break;case "position":d._position(b);break;case "resizable":(g=e.is(":data(resizable)"))&&!b&&e.resizable("destroy");g&&typeof b==="string"&&e.resizable("option","handles",b);!g&&b!==false&&d._makeResizable(b);break;case "title":c(".ui-dialog-title",d.uiDialogTitlebar).html(""+(b||" "));break}c.Widget.prototype._setOption.apply(d,arguments)},_size:function(){var a=this.options,b,d,e= -this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0});if(a.minWidth>a.width)a.width=a.minWidth;b=this.uiDialog.css({height:"auto",width:a.width}).height();d=Math.max(0,a.minHeight-b);if(a.height==="auto")if(c.support.minHeight)this.element.css({minHeight:d,height:"auto"});else{this.uiDialog.show();a=this.element.css("height","auto").height();e||this.uiDialog.hide();this.element.height(Math.max(a,d))}else this.element.height(Math.max(a.height-b,0));this.uiDialog.is(":data(resizable)")&& -this.uiDialog.resizable("option","minHeight",this._minHeight())}});c.extend(c.ui.dialog,{version:"1.8.11",uuid:0,maxZ:0,getTitleId:function(a){a=a.attr("id");if(!a){this.uuid+=1;a=this.uuid}return"ui-dialog-title-"+a},overlay:function(a){this.$el=c.ui.dialog.overlay.create(a)}});c.extend(c.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:c.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "),create:function(a){if(this.instances.length=== -0){setTimeout(function(){c.ui.dialog.overlay.instances.length&&c(document).bind(c.ui.dialog.overlay.events,function(d){if(c(d.target).zIndex()
").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(), -height:this.height()});c.fn.bgiframe&&b.bgiframe();this.instances.push(b);return b},destroy:function(a){var b=c.inArray(a,this.instances);b!=-1&&this.oldInstances.push(this.instances.splice(b,1)[0]);this.instances.length===0&&c([document,window]).unbind(".dialog-overlay");a.remove();var d=0;c.each(this.instances,function(){d=Math.max(d,this.css("z-index"))});this.maxZ=d},height:function(){var a,b;if(c.browser.msie&&c.browser.version<7){a=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight); -b=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return ai&&t(this).css("top",e.top-i)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),this.options.title=this.options.title||this.originalTitle,this._createWrapper(),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(this.uiDialog),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&t.fn.draggable&&this._makeDraggable(),this.options.resizable&&t.fn.resizable&&this._makeResizable(),this._isOpen=!1},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var e=this.options.appendTo;return e&&(e.jquery||e.nodeType)?t(e):this.document.find(e||"body").eq(0)},_destroy:function(){var t,e=this.originalPosition;this._destroyOverlay(),this.element.removeUniqueId().removeClass("ui-dialog-content ui-widget-content").css(this.originalCss).detach(),this.uiDialog.stop(!0,!0).remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),t=e.parent.children().eq(e.index),t.length&&t[0]!==this.element[0]?t.before(this.element):e.parent.append(this.element)},widget:function(){return this.uiDialog},disable:t.noop,enable:t.noop,close:function(e){var i=this;this._isOpen&&this._trigger("beforeClose",e)!==!1&&(this._isOpen=!1,this._destroyOverlay(),this.opener.filter(":focusable").focus().length||t(this.document[0].activeElement).blur(),this._hide(this.uiDialog,this.options.hide,function(){i._trigger("close",e)}))},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(t,e){var i=!!this.uiDialog.nextAll(":visible").insertBefore(this.uiDialog).length;return i&&!e&&this._trigger("focus",t),i},open:function(){var e=this;return this._isOpen?(this._moveToTop()&&this._focusTabbable(),undefined):(this._isOpen=!0,this.opener=t(this.document[0].activeElement),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this._show(this.uiDialog,this.options.show,function(){e._focusTabbable(),e._trigger("focus")}),this._trigger("open"),undefined)},_focusTabbable:function(){var t=this.element.find("[autofocus]");t.length||(t=this.element.find(":tabbable")),t.length||(t=this.uiDialogButtonPane.find(":tabbable")),t.length||(t=this.uiDialogTitlebarClose.filter(":tabbable")),t.length||(t=this.uiDialog),t.eq(0).focus()},_keepFocus:function(e){function i(){var e=this.document[0].activeElement,i=this.uiDialog[0]===e||t.contains(this.uiDialog[0],e);i||this._focusTabbable()}e.preventDefault(),i.call(this),this._delay(i)},_createWrapper:function(){this.uiDialog=t("
").addClass("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front "+this.options.dialogClass).hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._on(this.uiDialog,{keydown:function(e){if(this.options.closeOnEscape&&!e.isDefaultPrevented()&&e.keyCode&&e.keyCode===t.ui.keyCode.ESCAPE)return e.preventDefault(),this.close(e),undefined;if(e.keyCode===t.ui.keyCode.TAB){var i=this.uiDialog.find(":tabbable"),s=i.filter(":first"),n=i.filter(":last");e.target!==n[0]&&e.target!==this.uiDialog[0]||e.shiftKey?e.target!==s[0]&&e.target!==this.uiDialog[0]||!e.shiftKey||(n.focus(1),e.preventDefault()):(s.focus(1),e.preventDefault())}},mousedown:function(t){this._moveToTop(t)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var e;this.uiDialogTitlebar=t("
").addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(this.uiDialog),this._on(this.uiDialogTitlebar,{mousedown:function(e){t(e.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.focus()}}),this.uiDialogTitlebarClose=t("").button({label:this.options.closeText,icons:{primary:"ui-icon-closethick"},text:!1}).addClass("ui-dialog-titlebar-close").appendTo(this.uiDialogTitlebar),this._on(this.uiDialogTitlebarClose,{click:function(t){t.preventDefault(),this.close(t)}}),e=t("").uniqueId().addClass("ui-dialog-title").prependTo(this.uiDialogTitlebar),this._title(e),this.uiDialog.attr({"aria-labelledby":e.attr("id")})},_title:function(t){this.options.title||t.html(" "),t.text(this.options.title)},_createButtonPane:function(){this.uiDialogButtonPane=t("
").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),this.uiButtonSet=t("
").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane),this._createButtons()},_createButtons:function(){var e=this,i=this.options.buttons;return this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),t.isEmptyObject(i)||t.isArray(i)&&!i.length?(this.uiDialog.removeClass("ui-dialog-buttons"),undefined):(t.each(i,function(i,s){var n,a;s=t.isFunction(s)?{click:s,text:i}:s,s=t.extend({type:"button"},s),n=s.click,s.click=function(){n.apply(e.element[0],arguments)},a={icons:s.icons,text:s.showText},delete s.icons,delete s.showText,t("",s).button(a).appendTo(e.uiButtonSet)}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog),undefined)},_makeDraggable:function(){function e(t){return{position:t.position,offset:t.offset}}var i=this,s=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(s,n){t(this).addClass("ui-dialog-dragging"),i._blockFrames(),i._trigger("dragStart",s,e(n))},drag:function(t,s){i._trigger("drag",t,e(s))},stop:function(n,a){s.position=[a.position.left-i.document.scrollLeft(),a.position.top-i.document.scrollTop()],t(this).removeClass("ui-dialog-dragging"),i._unblockFrames(),i._trigger("dragStop",n,e(a))}})},_makeResizable:function(){function e(t){return{originalPosition:t.originalPosition,originalSize:t.originalSize,position:t.position,size:t.size}}var i=this,s=this.options,n=s.resizable,a=this.uiDialog.css("position"),o="string"==typeof n?n:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:s.maxWidth,maxHeight:s.maxHeight,minWidth:s.minWidth,minHeight:this._minHeight(),handles:o,start:function(s,n){t(this).addClass("ui-dialog-resizing"),i._blockFrames(),i._trigger("resizeStart",s,e(n))},resize:function(t,s){i._trigger("resize",t,e(s))},stop:function(n,a){s.height=t(this).height(),s.width=t(this).width(),t(this).removeClass("ui-dialog-resizing"),i._unblockFrames(),i._trigger("resizeStop",n,e(a))}}).css("position",a)},_minHeight:function(){var t=this.options;return"auto"===t.height?t.minHeight:Math.min(t.minHeight,t.height)},_position:function(){var t=this.uiDialog.is(":visible");t||this.uiDialog.show(),this.uiDialog.position(this.options.position),t||this.uiDialog.hide()},_setOptions:function(s){var n=this,a=!1,o={};t.each(s,function(t,s){n._setOption(t,s),t in e&&(a=!0),t in i&&(o[t]=s)}),a&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",o)},_setOption:function(t,e){var i,s,n=this.uiDialog;"dialogClass"===t&&n.removeClass(this.options.dialogClass).addClass(e),"disabled"!==t&&(this._super(t,e),"appendTo"===t&&this.uiDialog.appendTo(this._appendTo()),"buttons"===t&&this._createButtons(),"closeText"===t&&this.uiDialogTitlebarClose.button({label:""+e}),"draggable"===t&&(i=n.is(":data(ui-draggable)"),i&&!e&&n.draggable("destroy"),!i&&e&&this._makeDraggable()),"position"===t&&this._position(),"resizable"===t&&(s=n.is(":data(ui-resizable)"),s&&!e&&n.resizable("destroy"),s&&"string"==typeof e&&n.resizable("option","handles",e),s||e===!1||this._makeResizable()),"title"===t&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var t,e,i,s=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),s.minWidth>s.width&&(s.width=s.minWidth),t=this.uiDialog.css({height:"auto",width:s.width}).outerHeight(),e=Math.max(0,s.minHeight-t),i="number"==typeof s.maxHeight?Math.max(0,s.maxHeight-t):"none","auto"===s.height?this.element.css({minHeight:e,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,s.height-t)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var e=t(this);return t("
").css({position:"absolute",width:e.outerWidth(),height:e.outerHeight()}).appendTo(e.parent()).offset(e.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(e){return t(e.target).closest(".ui-dialog").length?!0:!!t(e.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var e=this,i=this.widgetFullName;t.ui.dialog.overlayInstances||this._delay(function(){t.ui.dialog.overlayInstances&&this.document.bind("focusin.dialog",function(s){e._allowInteraction(s)||(s.preventDefault(),t(".ui-dialog:visible:last .ui-dialog-content").data(i)._focusTabbable())})}),this.overlay=t("
").addClass("ui-widget-overlay ui-front").appendTo(this._appendTo()),this._on(this.overlay,{mousedown:"_keepFocus"}),t.ui.dialog.overlayInstances++}},_destroyOverlay:function(){this.options.modal&&this.overlay&&(t.ui.dialog.overlayInstances--,t.ui.dialog.overlayInstances||this.document.unbind("focusin.dialog"),this.overlay.remove(),this.overlay=null)}}),t.ui.dialog.overlayInstances=0,t.uiBackCompat!==!1&&t.widget("ui.dialog",t.ui.dialog,{_position:function(){var e,i=this.options.position,s=[],n=[0,0];i?(("string"==typeof i||"object"==typeof i&&"0"in i)&&(s=i.split?i.split(" "):[i[0],i[1]],1===s.length&&(s[1]=s[0]),t.each(["left","top"],function(t,e){+s[t]===s[t]&&(n[t]=s[t],s[t]=e)}),i={my:s[0]+(0>n[0]?n[0]:"+"+n[0])+" "+s[1]+(0>n[1]?n[1]:"+"+n[1]),at:s.join(" ")}),i=t.extend({},t.ui.dialog.prototype.options.position,i)):i=t.ui.dialog.prototype.options.position,e=this.uiDialog.is(":visible"),e||this.uiDialog.show(),this.uiDialog.position(i),e||this.uiDialog.hide()}})})(jQuery); \ No newline at end of file diff --git a/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.draggable.min.js b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.draggable.min.js index 3012e9d..7b9eff8 100644 --- a/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.draggable.min.js +++ b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.draggable.min.js @@ -1,50 +1,4 @@ -/* - * jQuery UI Draggable 1.8.11 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Draggables - * - * Depends: - * jquery.ui.core.js - * jquery.ui.mouse.js - * jquery.ui.widget.js - */ -(function(d){d.widget("ui.draggable",d.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper== -"original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(a){var b= -this.options;if(this.helper||b.disabled||d(a.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(a);if(!this.handle)return false;return true},_mouseStart:function(a){var b=this.options;this.helper=this._createHelper(a);this._cacheHelperProportions();if(d.ui.ddmanager)d.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top- -this.margins.top,left:this.offset.left-this.margins.left};d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this.position=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);b.containment&&this._setContainment();if(this._trigger("start",a)===false){this._clear();return false}this._cacheHelperProportions(); -d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(a,true);return true},_mouseDrag:function(a,b){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!b){b=this._uiHash();if(this._trigger("drag",a,b)===false){this._mouseUp({});return false}this.position=b.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis|| -this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);return false},_mouseStop:function(a){var b=false;if(d.ui.ddmanager&&!this.options.dropBehaviour)b=d.ui.ddmanager.drop(this,a);if(this.dropped){b=this.dropped;this.dropped=false}if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return false;if(this.options.revert=="invalid"&&!b||this.options.revert=="valid"&&b||this.options.revert===true||d.isFunction(this.options.revert)&& -this.options.revert.call(this.element,b)){var c=this;d(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){c._trigger("stop",a)!==false&&c._clear()})}else this._trigger("stop",a)!==false&&this._clear();return false},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(a){var b=!this.options.handle||!d(this.options.handle,this.element).length?true:false;d(this.options.handle,this.element).find("*").andSelf().each(function(){if(this== -a.target)b=true});return b},_createHelper:function(a){var b=this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a])):b.helper=="clone"?this.element.clone():this.element;a.parents("body").length||a.appendTo(b.appendTo=="parent"?this.element[0].parentNode:b.appendTo);a[0]!=this.element[0]&&!/(fixed|absolute)/.test(a.css("position"))&&a.css("position","absolute");return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]|| -0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0], -this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top- -(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(), -height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;if(a.containment=="parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[(a.containment=="document"?0:d(window).scrollLeft())-this.offset.relative.left-this.offset.parent.left,(a.containment=="document"?0:d(window).scrollTop())-this.offset.relative.top-this.offset.parent.top,(a.containment=="document"?0:d(window).scrollLeft())+d(a.containment=="document"? -document:window).width()-this.helperProportions.width-this.margins.left,(a.containment=="document"?0:d(window).scrollTop())+(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)&&a.containment.constructor!=Array){var b=d(a.containment)[0];if(b){a=d(a.containment).offset();var c=d(b).css("overflow")!="hidden";this.containment=[a.left+(parseInt(d(b).css("borderLeftWidth"), -10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0),a.top+(parseInt(d(b).css("borderTopWidth"),10)||0)+(parseInt(d(b).css("paddingTop"),10)||0),a.left+(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,a.top+(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"),10)||0)-(parseInt(d(b).css("paddingBottom"), -10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom]}}else if(a.containment.constructor==Array)this.containment=a.containment},_convertPositionTo:function(a,b){if(!b)b=this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName);return{top:b.top+this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&& -d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0], -this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName),e=a.pageX,g=a.pageY;if(this.originalPosition){if(this.containment){if(a.pageX-this.offset.click.leftthis.containment[2])e=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g= -this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g-this.originalPageY)/b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.topthis.containment[3])?g:!(g-this.offset.click.topthis.containment[2])? -e:!(e-this.offset.click.left
').css({width:this.offsetWidth+ -"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(d(this).offset()).appendTo("body")})},stop:function(){d("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});d.ui.plugin.add("draggable","opacity",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options;if(a.css("opacity"))b._opacity=a.css("opacity");a.css("opacity",b.opacity)},stop:function(a,b){a=d(this).data("draggable").options;a._opacity&&d(b.helper).css("opacity", -a._opacity)}});d.ui.plugin.add("draggable","scroll",{start:function(){var a=d(this).data("draggable");if(a.scrollParent[0]!=document&&a.scrollParent[0].tagName!="HTML")a.overflowOffset=a.scrollParent.offset()},drag:function(a){var b=d(this).data("draggable"),c=b.options,f=false;if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!="HTML"){if(!c.axis||c.axis!="x")if(b.overflowOffset.top+b.scrollParent[0].offsetHeight-a.pageY=0;h--){var i=c.snapElements[h].left,k=i+c.snapElements[h].width,j=c.snapElements[h].top,l=j+c.snapElements[h].height;if(i-e0?!1:(this.handle=this._getHandle(t),this.handle?(e(i.iframeFix===!0?"iframe":i.iframeFix).each(function(){e("
").css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(e(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(t){var i=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),i.containment&&this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_mouseDrag:function(t,i){if(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(this._trigger("drag",t,s)===!1)return this._mouseUp({}),!1;this.position=s.position}return this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var i,s=this,n=!1,a=!1;for(e.ui.ddmanager&&!this.options.dropBehaviour&&(a=e.ui.ddmanager.drop(this,t)),this.dropped&&(a=this.dropped,this.dropped=!1),i=this.element[0];i&&(i=i.parentNode);)i===document&&(n=!0);return n||"original"!==this.options.helper?("invalid"===this.options.revert&&!a||"valid"===this.options.revert&&a||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,a)?e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){s._trigger("stop",t)!==!1&&s._clear()}):this._trigger("stop",t)!==!1&&this._clear(),!1):!1},_mouseUp:function(t){return e("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(t){return this.options.handle?!!e(t.target).closest(this.element.find(this.options.handle)).length:!0},_createHelper:function(t){var i=this.options,s=e.isFunction(i.helper)?e(i.helper.apply(this.element[0],[t])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return s.parents("body").length||s.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s[0]===this.element[0]||/(fixed|absolute)/.test(s.css("position"))||s.css("position","absolute"),s},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&e.ui.ie)&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var e=this.element.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,s,n=this.options;if("parent"===n.containment&&(n.containment=this.helper[0].parentNode),("document"===n.containment||"window"===n.containment)&&(this.containment=["document"===n.containment?0:e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,"document"===n.containment?0:e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,("document"===n.containment?0:e(window).scrollLeft())+e("document"===n.containment?document:window).width()-this.helperProportions.width-this.margins.left,("document"===n.containment?0:e(window).scrollTop())+(e("document"===n.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||n.containment.constructor===Array)n.containment.constructor===Array&&(this.containment=n.containment);else{if(i=e(n.containment),s=i[0],!s)return;t="hidden"!==e(s).css("overflow"),this.containment=[(parseInt(e(s).css("borderLeftWidth"),10)||0)+(parseInt(e(s).css("paddingLeft"),10)||0),(parseInt(e(s).css("borderTopWidth"),10)||0)+(parseInt(e(s).css("paddingTop"),10)||0),(t?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(e(s).css("borderRightWidth"),10)||0)-(parseInt(e(s).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(e(s).css("borderBottomWidth"),10)||0)-(parseInt(e(s).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=i}},_convertPositionTo:function(t,i){i||(i=this.position);var s="absolute"===t?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,a=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():a?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():a?0:n.scrollLeft())*s}},_generatePosition:function(t){var i,s,n,a,o=this.options,r="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=/(html|body)/i.test(r[0].tagName),l=t.pageX,u=t.pageY;return this.originalPosition&&(this.containment&&(this.relative_container?(s=this.relative_container.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,t.pageX-this.offset.click.lefti[2]&&(l=i[2]+this.offset.click.left),t.pageY-this.offset.click.top>i[3]&&(u=i[3]+this.offset.click.top)),o.grid&&(n=o.grid[1]?this.originalPageY+Math.round((u-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY,u=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-o.grid[1]:n+o.grid[1]:n,a=o.grid[0]?this.originalPageX+Math.round((l-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX,l=i?a-this.offset.click.left>=i[0]||a-this.offset.click.left>i[2]?a:a-this.offset.click.left>=i[0]?a-o.grid[0]:a+o.grid[0]:a)),{top:u-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():h?0:r.scrollTop()),left:l-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():h?0:r.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(t,i,s){return s=s||this._uiHash(),e.ui.plugin.call(this,t,[i,s]),"drag"===t&&(this.positionAbs=this._convertPositionTo("absolute")),e.Widget.prototype._trigger.call(this,t,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,i){var s=e(this).data("ui-draggable"),n=s.options,a=e.extend({},i,{item:s.element});s.sortables=[],e(n.connectToSortable).each(function(){var i=e.data(this,"ui-sortable");i&&!i.options.disabled&&(s.sortables.push({instance:i,shouldRevert:i.options.revert}),i.refreshPositions(),i._trigger("activate",t,a))})},stop:function(t,i){var s=e(this).data("ui-draggable"),n=e.extend({},i,{item:s.element});e.each(s.sortables,function(){this.instance.isOver?(this.instance.isOver=0,s.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=this.shouldRevert),this.instance._mouseStop(t),this.instance.options.helper=this.instance.options._helper,"original"===s.options.helper&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",t,n))})},drag:function(t,i){var s=e(this).data("ui-draggable"),n=this;e.each(s.sortables,function(){var a=!1,o=this;this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this.instance._intersectsWith(this.instance.containerCache)&&(a=!0,e.each(s.sortables,function(){return this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this!==o&&this.instance._intersectsWith(this.instance.containerCache)&&e.contains(o.instance.element[0],this.instance.element[0])&&(a=!1),a})),a?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=e(n).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return i.helper[0]},t.target=this.instance.currentItem[0],this.instance._mouseCapture(t,!0),this.instance._mouseStart(t,!0,!0),this.instance.offset.click.top=s.offset.click.top,this.instance.offset.click.left=s.offset.click.left,this.instance.offset.parent.left-=s.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=s.offset.parent.top-this.instance.offset.parent.top,s._trigger("toSortable",t),s.dropped=this.instance.element,s.currentItem=s.element,this.instance.fromOutside=s),this.instance.currentItem&&this.instance._mouseDrag(t)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",t,this.instance._uiHash(this.instance)),this.instance._mouseStop(t,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),s._trigger("fromSortable",t),s.dropped=!1)})}}),e.ui.plugin.add("draggable","cursor",{start:function(){var t=e("body"),i=e(this).data("ui-draggable").options;t.css("cursor")&&(i._cursor=t.css("cursor")),t.css("cursor",i.cursor)},stop:function(){var t=e(this).data("ui-draggable").options;t._cursor&&e("body").css("cursor",t._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,i){var s=e(i.helper),n=e(this).data("ui-draggable").options;s.css("opacity")&&(n._opacity=s.css("opacity")),s.css("opacity",n.opacity)},stop:function(t,i){var s=e(this).data("ui-draggable").options;s._opacity&&e(i.helper).css("opacity",s._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(){var t=e(this).data("ui-draggable");t.scrollParent[0]!==document&&"HTML"!==t.scrollParent[0].tagName&&(t.overflowOffset=t.scrollParent.offset())},drag:function(t){var i=e(this).data("ui-draggable"),s=i.options,n=!1;i.scrollParent[0]!==document&&"HTML"!==i.scrollParent[0].tagName?(s.axis&&"x"===s.axis||(i.overflowOffset.top+i.scrollParent[0].offsetHeight-t.pageY=0;c--)r=p.snapElements[c].left,h=r+p.snapElements[c].width,l=p.snapElements[c].top,u=l+p.snapElements[c].height,g>r-m&&h+m>g&&y>l-m&&u+m>y||g>r-m&&h+m>g&&b>l-m&&u+m>b||v>r-m&&h+m>v&&y>l-m&&u+m>y||v>r-m&&h+m>v&&b>l-m&&u+m>b?("inner"!==f.snapMode&&(s=m>=Math.abs(l-b),n=m>=Math.abs(u-y),a=m>=Math.abs(r-v),o=m>=Math.abs(h-g),s&&(i.position.top=p._convertPositionTo("relative",{top:l-p.helperProportions.height,left:0}).top-p.margins.top),n&&(i.position.top=p._convertPositionTo("relative",{top:u,left:0}).top-p.margins.top),a&&(i.position.left=p._convertPositionTo("relative",{top:0,left:r-p.helperProportions.width}).left-p.margins.left),o&&(i.position.left=p._convertPositionTo("relative",{top:0,left:h}).left-p.margins.left)),d=s||n||a||o,"outer"!==f.snapMode&&(s=m>=Math.abs(l-y),n=m>=Math.abs(u-b),a=m>=Math.abs(r-g),o=m>=Math.abs(h-v),s&&(i.position.top=p._convertPositionTo("relative",{top:l,left:0}).top-p.margins.top),n&&(i.position.top=p._convertPositionTo("relative",{top:u-p.helperProportions.height,left:0}).top-p.margins.top),a&&(i.position.left=p._convertPositionTo("relative",{top:0,left:r}).left-p.margins.left),o&&(i.position.left=p._convertPositionTo("relative",{top:0,left:h-p.helperProportions.width}).left-p.margins.left)),!p.snapElements[c].snapping&&(s||n||a||o||d)&&p.options.snap.snap&&p.options.snap.snap.call(p.element,t,e.extend(p._uiHash(),{snapItem:p.snapElements[c].item})),p.snapElements[c].snapping=s||n||a||o||d):(p.snapElements[c].snapping&&p.options.snap.release&&p.options.snap.release.call(p.element,t,e.extend(p._uiHash(),{snapItem:p.snapElements[c].item})),p.snapElements[c].snapping=!1)}}),e.ui.plugin.add("draggable","stack",{start:function(){var t,i=this.data("ui-draggable").options,s=e.makeArray(e(i.stack)).sort(function(t,i){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(i).css("zIndex"),10)||0)});s.length&&(t=parseInt(e(s[0]).css("zIndex"),10)||0,e(s).each(function(i){e(this).css("zIndex",t+i)}),this.css("zIndex",t+s.length))}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,i){var s=e(i.helper),n=e(this).data("ui-draggable").options;s.css("zIndex")&&(n._zIndex=s.css("zIndex")),s.css("zIndex",n.zIndex)},stop:function(t,i){var s=e(this).data("ui-draggable").options;s._zIndex&&e(i.helper).css("zIndex",s._zIndex)}})})(jQuery); \ No newline at end of file diff --git a/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.droppable.min.js b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.droppable.min.js index 0e40fa5..4e50774 100644 --- a/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.droppable.min.js +++ b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.droppable.min.js @@ -1,26 +1,4 @@ -/* - * jQuery UI Droppable 1.8.11 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Droppables - * - * Depends: - * jquery.ui.core.js - * jquery.ui.widget.js - * jquery.ui.mouse.js - * jquery.ui.draggable.js - */ -(function(d){d.widget("ui.droppable",{widgetEventPrefix:"drop",options:{accept:"*",activeClass:false,addClasses:true,greedy:false,hoverClass:false,scope:"default",tolerance:"intersect"},_create:function(){var a=this.options,b=a.accept;this.isover=0;this.isout=1;this.accept=d.isFunction(b)?b:function(c){return c.is(b)};this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};d.ui.ddmanager.droppables[a.scope]=d.ui.ddmanager.droppables[a.scope]||[];d.ui.ddmanager.droppables[a.scope].push(this); -a.addClasses&&this.element.addClass("ui-droppable")},destroy:function(){for(var a=d.ui.ddmanager.droppables[this.options.scope],b=0;b=j&&f<=l||h>=j&&h<=l||fl)&&(e>= -i&&e<=k||g>=i&&g<=k||ek);default:return false}};d.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(a,b){var c=d.ui.ddmanager.droppables[a.options.scope]||[],e=b?b.type:null,g=(a.currentItem||a.element).find(":data(droppable)").andSelf(),f=0;a:for(;ft&&t+i>e}e.widget("ui.droppable",{version:"1.10.2",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t=this.options,i=t.accept;this.isover=!1,this.isout=!0,this.accept=e.isFunction(i)?i:function(e){return e.is(i)},this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight},e.ui.ddmanager.droppables[t.scope]=e.ui.ddmanager.droppables[t.scope]||[],e.ui.ddmanager.droppables[t.scope].push(this),t.addClasses&&this.element.addClass("ui-droppable")},_destroy:function(){for(var t=0,i=e.ui.ddmanager.droppables[this.options.scope];i.length>t;t++)i[t]===this&&i.splice(t,1);this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(t,i){"accept"===t&&(this.accept=e.isFunction(i)?i:function(e){return e.is(i)}),e.Widget.prototype._setOption.apply(this,arguments)},_activate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),i&&this._trigger("activate",t,this.ui(i))},_deactivate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),i&&this._trigger("deactivate",t,this.ui(i))},_over:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",t,this.ui(i)))},_out:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",t,this.ui(i)))},_drop:function(t,i){var s=i||e.ui.ddmanager.current,n=!1;return s&&(s.currentItem||s.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var t=e.data(this,"ui-droppable");return t.options.greedy&&!t.options.disabled&&t.options.scope===s.options.scope&&t.accept.call(t.element[0],s.currentItem||s.element)&&e.ui.intersect(s,e.extend(t,{offset:t.element.offset()}),t.options.tolerance)?(n=!0,!1):undefined}),n?!1:this.accept.call(this.element[0],s.currentItem||s.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",t,this.ui(s)),this.element):!1):!1},ui:function(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}}}),e.ui.intersect=function(e,i,s){if(!i.offset)return!1;var n,a,o=(e.positionAbs||e.position.absolute).left,r=o+e.helperProportions.width,h=(e.positionAbs||e.position.absolute).top,l=h+e.helperProportions.height,u=i.offset.left,c=u+i.proportions.width,d=i.offset.top,p=d+i.proportions.height;switch(s){case"fit":return o>=u&&c>=r&&h>=d&&p>=l;case"intersect":return o+e.helperProportions.width/2>u&&c>r-e.helperProportions.width/2&&h+e.helperProportions.height/2>d&&p>l-e.helperProportions.height/2;case"pointer":return n=(e.positionAbs||e.position.absolute).left+(e.clickOffset||e.offset.click).left,a=(e.positionAbs||e.position.absolute).top+(e.clickOffset||e.offset.click).top,t(a,d,i.proportions.height)&&t(n,u,i.proportions.width);case"touch":return(h>=d&&p>=h||l>=d&&p>=l||d>h&&l>p)&&(o>=u&&c>=o||r>=u&&c>=r||u>o&&r>c);default:return!1}},e.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,i){var s,n,a=e.ui.ddmanager.droppables[t.options.scope]||[],o=i?i.type:null,r=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();e:for(s=0;a.length>s;s++)if(!(a[s].options.disabled||t&&!a[s].accept.call(a[s].element[0],t.currentItem||t.element))){for(n=0;r.length>n;n++)if(r[n]===a[s].element[0]){a[s].proportions.height=0;continue e}a[s].visible="none"!==a[s].element.css("display"),a[s].visible&&("mousedown"===o&&a[s]._activate.call(a[s],i),a[s].offset=a[s].element.offset(),a[s].proportions={width:a[s].element[0].offsetWidth,height:a[s].element[0].offsetHeight})}},drop:function(t,i){var s=!1;return e.each((e.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&e.ui.intersect(t,this,this.options.tolerance)&&(s=this._drop.call(this,i)||s),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),s},dragStart:function(t,i){t.element.parentsUntil("body").bind("scroll.droppable",function(){t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)})},drag:function(t,i){t.options.refreshPositions&&e.ui.ddmanager.prepareOffsets(t,i),e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var s,n,a,o=e.ui.intersect(t,this,this.options.tolerance),r=!o&&this.isover?"isout":o&&!this.isover?"isover":null;r&&(this.options.greedy&&(n=this.options.scope,a=this.element.parents(":data(ui-droppable)").filter(function(){return e.data(this,"ui-droppable").options.scope===n}),a.length&&(s=e.data(a[0],"ui-droppable"),s.greedyChild="isover"===r)),s&&"isover"===r&&(s.isover=!1,s.isout=!0,s._out.call(s,i)),this[r]=!0,this["isout"===r?"isover":"isout"]=!1,this["isover"===r?"_over":"_out"].call(this,i),s&&"isout"===r&&(s.isout=!1,s.isover=!0,s._over.call(s,i)))}})},dragStop:function(t,i){t.element.parentsUntil("body").unbind("scroll.droppable"),t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)}}})(jQuery); \ No newline at end of file diff --git a/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.effect-blind.min.js b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.effect-blind.min.js new file mode 100644 index 0000000..4a6b400 --- /dev/null +++ b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.effect-blind.min.js @@ -0,0 +1,4 @@ +/*! jQuery UI - v1.10.2 - 2013-03-14 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ +(function(t){var e=/up|down|vertical/,i=/up|left|vertical|horizontal/;t.effects.effect.blind=function(s,n){var a,o,r,h=t(this),l=["position","top","bottom","left","right","height","width"],c=t.effects.setMode(h,s.mode||"hide"),u=s.direction||"up",d=e.test(u),p=d?"height":"width",f=d?"top":"left",m=i.test(u),g={},v="show"===c;h.parent().is(".ui-effects-wrapper")?t.effects.save(h.parent(),l):t.effects.save(h,l),h.show(),a=t.effects.createWrapper(h).css({overflow:"hidden"}),o=a[p](),r=parseFloat(a.css(f))||0,g[p]=v?o:0,m||(h.css(d?"bottom":"right",0).css(d?"top":"left","auto").css({position:"absolute"}),g[f]=v?r:o+r),v&&(a.css(p,0),m||a.css(f,r+o)),a.animate(g,{duration:s.duration,easing:s.easing,queue:!1,complete:function(){"hide"===c&&h.hide(),t.effects.restore(h,l),t.effects.removeWrapper(h),n()}})}})(jQuery); \ No newline at end of file diff --git a/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.effect-bounce.min.js b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.effect-bounce.min.js new file mode 100644 index 0000000..69aa006 --- /dev/null +++ b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.effect-bounce.min.js @@ -0,0 +1,4 @@ +/*! jQuery UI - v1.10.2 - 2013-03-14 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ +(function(t){t.effects.effect.bounce=function(e,i){var s,n,a,o=t(this),r=["position","top","bottom","left","right","height","width"],h=t.effects.setMode(o,e.mode||"effect"),l="hide"===h,c="show"===h,u=e.direction||"up",d=e.distance,p=e.times||5,f=2*p+(c||l?1:0),m=e.duration/f,g=e.easing,v="up"===u||"down"===u?"top":"left",_="up"===u||"left"===u,b=o.queue(),y=b.length;for((c||l)&&r.push("opacity"),t.effects.save(o,r),o.show(),t.effects.createWrapper(o),d||(d=o["top"===v?"outerHeight":"outerWidth"]()/3),c&&(a={opacity:1},a[v]=0,o.css("opacity",0).css(v,_?2*-d:2*d).animate(a,m,g)),l&&(d/=Math.pow(2,p-1)),a={},a[v]=0,s=0;p>s;s++)n={},n[v]=(_?"-=":"+=")+d,o.animate(n,m,g).animate(a,m,g),d=l?2*d:d/2;l&&(n={opacity:0},n[v]=(_?"-=":"+=")+d,o.animate(n,m,g)),o.queue(function(){l&&o.hide(),t.effects.restore(o,r),t.effects.removeWrapper(o),i()}),y>1&&b.splice.apply(b,[1,0].concat(b.splice(y,f+1))),o.dequeue()}})(jQuery); \ No newline at end of file diff --git a/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.effect-clip.min.js b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.effect-clip.min.js new file mode 100644 index 0000000..f0ec8b8 --- /dev/null +++ b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.effect-clip.min.js @@ -0,0 +1,4 @@ +/*! jQuery UI - v1.10.2 - 2013-03-14 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ +(function(t){t.effects.effect.clip=function(e,i){var s,n,a,o=t(this),r=["position","top","bottom","left","right","height","width"],h=t.effects.setMode(o,e.mode||"hide"),l="show"===h,c=e.direction||"vertical",u="vertical"===c,d=u?"height":"width",p=u?"top":"left",f={};t.effects.save(o,r),o.show(),s=t.effects.createWrapper(o).css({overflow:"hidden"}),n="IMG"===o[0].tagName?s:o,a=n[d](),l&&(n.css(d,0),n.css(p,a/2)),f[d]=l?a:0,f[p]=l?0:a/2,n.animate(f,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){l||o.hide(),t.effects.restore(o,r),t.effects.removeWrapper(o),i()}})}})(jQuery); \ No newline at end of file diff --git a/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.effect-drop.min.js b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.effect-drop.min.js new file mode 100644 index 0000000..6c5a002 --- /dev/null +++ b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.effect-drop.min.js @@ -0,0 +1,4 @@ +/*! jQuery UI - v1.10.2 - 2013-03-14 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ +(function(t){t.effects.effect.drop=function(e,i){var s,n=t(this),a=["position","top","bottom","left","right","opacity","height","width"],o=t.effects.setMode(n,e.mode||"hide"),r="show"===o,h=e.direction||"left",l="up"===h||"down"===h?"top":"left",c="up"===h||"left"===h?"pos":"neg",u={opacity:r?1:0};t.effects.save(n,a),n.show(),t.effects.createWrapper(n),s=e.distance||n["top"===l?"outerHeight":"outerWidth"](!0)/2,r&&n.css("opacity",0).css(l,"pos"===c?-s:s),u[l]=(r?"pos"===c?"+=":"-=":"pos"===c?"-=":"+=")+s,n.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===o&&n.hide(),t.effects.restore(n,a),t.effects.removeWrapper(n),i()}})}})(jQuery); \ No newline at end of file diff --git a/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.effect-explode.min.js b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.effect-explode.min.js new file mode 100644 index 0000000..b6b3be8 --- /dev/null +++ b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.effect-explode.min.js @@ -0,0 +1,4 @@ +/*! jQuery UI - v1.10.2 - 2013-03-14 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ +(function(t){t.effects.effect.explode=function(e,i){function s(){b.push(this),b.length===u*d&&n()}function n(){p.css({visibility:"visible"}),t(b).remove(),m||p.hide(),i()}var a,o,r,h,l,c,u=e.pieces?Math.round(Math.sqrt(e.pieces)):3,d=u,p=t(this),f=t.effects.setMode(p,e.mode||"hide"),m="show"===f,g=p.show().css("visibility","hidden").offset(),v=Math.ceil(p.outerWidth()/d),_=Math.ceil(p.outerHeight()/u),b=[];for(a=0;u>a;a++)for(h=g.top+a*_,c=a-(u-1)/2,o=0;d>o;o++)r=g.left+o*v,l=o-(d-1)/2,p.clone().appendTo("body").wrap("
").css({position:"absolute",visibility:"visible",left:-o*v,top:-a*_}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:v,height:_,left:r+(m?l*v:0),top:h+(m?c*_:0),opacity:m?0:1}).animate({left:r+(m?0:l*v),top:h+(m?0:c*_),opacity:m?1:0},e.duration||500,e.easing,s)}})(jQuery); \ No newline at end of file diff --git a/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.effect-fade.min.js b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.effect-fade.min.js new file mode 100644 index 0000000..2a2d1e2 --- /dev/null +++ b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.effect-fade.min.js @@ -0,0 +1,4 @@ +/*! jQuery UI - v1.10.2 - 2013-03-14 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ +(function(t){t.effects.effect.fade=function(e,i){var s=t(this),n=t.effects.setMode(s,e.mode||"toggle");s.animate({opacity:n},{queue:!1,duration:e.duration,easing:e.easing,complete:i})}})(jQuery); \ No newline at end of file diff --git a/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.effect-fold.min.js b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.effect-fold.min.js new file mode 100644 index 0000000..b55ec6a --- /dev/null +++ b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.effect-fold.min.js @@ -0,0 +1,4 @@ +/*! jQuery UI - v1.10.2 - 2013-03-14 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ +(function(t){t.effects.effect.fold=function(e,i){var s,n,a=t(this),o=["position","top","bottom","left","right","height","width"],r=t.effects.setMode(a,e.mode||"hide"),h="show"===r,l="hide"===r,c=e.size||15,u=/([0-9]+)%/.exec(c),d=!!e.horizFirst,p=h!==d,f=p?["width","height"]:["height","width"],m=e.duration/2,g={},v={};t.effects.save(a,o),a.show(),s=t.effects.createWrapper(a).css({overflow:"hidden"}),n=p?[s.width(),s.height()]:[s.height(),s.width()],u&&(c=parseInt(u[1],10)/100*n[l?0:1]),h&&s.css(d?{height:0,width:c}:{height:c,width:0}),g[f[0]]=h?n[0]:c,v[f[1]]=h?n[1]:0,s.animate(g,m,e.easing).animate(v,m,e.easing,function(){l&&a.hide(),t.effects.restore(a,o),t.effects.removeWrapper(a),i()})}})(jQuery); \ No newline at end of file diff --git a/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.effect-highlight.min.js b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.effect-highlight.min.js new file mode 100644 index 0000000..500f99c --- /dev/null +++ b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.effect-highlight.min.js @@ -0,0 +1,4 @@ +/*! jQuery UI - v1.10.2 - 2013-03-14 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ +(function(t){t.effects.effect.highlight=function(e,i){var s=t(this),n=["backgroundImage","backgroundColor","opacity"],a=t.effects.setMode(s,e.mode||"show"),o={backgroundColor:s.css("backgroundColor")};"hide"===a&&(o.opacity=0),t.effects.save(s,n),s.show().css({backgroundImage:"none",backgroundColor:e.color||"#ffff99"}).animate(o,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===a&&s.hide(),t.effects.restore(s,n),i()}})}})(jQuery); \ No newline at end of file diff --git a/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.effect-pulsate.min.js b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.effect-pulsate.min.js new file mode 100644 index 0000000..da7b9a4 --- /dev/null +++ b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.effect-pulsate.min.js @@ -0,0 +1,4 @@ +/*! jQuery UI - v1.10.2 - 2013-03-14 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ +(function(t){t.effects.effect.pulsate=function(e,i){var s,n=t(this),a=t.effects.setMode(n,e.mode||"show"),o="show"===a,r="hide"===a,h=o||"hide"===a,l=2*(e.times||5)+(h?1:0),c=e.duration/l,u=0,d=n.queue(),p=d.length;for((o||!n.is(":visible"))&&(n.css("opacity",0).show(),u=1),s=1;l>s;s++)n.animate({opacity:u},c,e.easing),u=1-u;n.animate({opacity:u},c,e.easing),n.queue(function(){r&&n.hide(),i()}),p>1&&d.splice.apply(d,[1,0].concat(d.splice(p,l+1))),n.dequeue()}})(jQuery); \ No newline at end of file diff --git a/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.effect-scale.min.js b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.effect-scale.min.js new file mode 100644 index 0000000..f18ff0f --- /dev/null +++ b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.effect-scale.min.js @@ -0,0 +1,4 @@ +/*! jQuery UI - v1.10.2 - 2013-03-14 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ +(function(t){t.effects.effect.puff=function(e,i){var s=t(this),n=t.effects.setMode(s,e.mode||"hide"),a="hide"===n,o=parseInt(e.percent,10)||150,r=o/100,h={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()};t.extend(e,{effect:"scale",queue:!1,fade:!0,mode:n,complete:i,percent:a?o:100,from:a?h:{height:h.height*r,width:h.width*r,outerHeight:h.outerHeight*r,outerWidth:h.outerWidth*r}}),s.effect(e)},t.effects.effect.scale=function(e,i){var s=t(this),n=t.extend(!0,{},e),a=t.effects.setMode(s,e.mode||"effect"),o=parseInt(e.percent,10)||(0===parseInt(e.percent,10)?0:"hide"===a?0:100),r=e.direction||"both",h=e.origin,l={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()},c={y:"horizontal"!==r?o/100:1,x:"vertical"!==r?o/100:1};n.effect="size",n.queue=!1,n.complete=i,"effect"!==a&&(n.origin=h||["middle","center"],n.restore=!0),n.from=e.from||("show"===a?{height:0,width:0,outerHeight:0,outerWidth:0}:l),n.to={height:l.height*c.y,width:l.width*c.x,outerHeight:l.outerHeight*c.y,outerWidth:l.outerWidth*c.x},n.fade&&("show"===a&&(n.from.opacity=0,n.to.opacity=1),"hide"===a&&(n.from.opacity=1,n.to.opacity=0)),s.effect(n)},t.effects.effect.size=function(e,i){var s,n,a,o=t(this),r=["position","top","bottom","left","right","width","height","overflow","opacity"],h=["position","top","bottom","left","right","overflow","opacity"],l=["width","height","overflow"],c=["fontSize"],u=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],d=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],p=t.effects.setMode(o,e.mode||"effect"),f=e.restore||"effect"!==p,m=e.scale||"both",g=e.origin||["middle","center"],v=o.css("position"),_=f?r:h,b={height:0,width:0,outerHeight:0,outerWidth:0};"show"===p&&o.show(),s={height:o.height(),width:o.width(),outerHeight:o.outerHeight(),outerWidth:o.outerWidth()},"toggle"===e.mode&&"show"===p?(o.from=e.to||b,o.to=e.from||s):(o.from=e.from||("show"===p?b:s),o.to=e.to||("hide"===p?b:s)),a={from:{y:o.from.height/s.height,x:o.from.width/s.width},to:{y:o.to.height/s.height,x:o.to.width/s.width}},("box"===m||"both"===m)&&(a.from.y!==a.to.y&&(_=_.concat(u),o.from=t.effects.setTransition(o,u,a.from.y,o.from),o.to=t.effects.setTransition(o,u,a.to.y,o.to)),a.from.x!==a.to.x&&(_=_.concat(d),o.from=t.effects.setTransition(o,d,a.from.x,o.from),o.to=t.effects.setTransition(o,d,a.to.x,o.to))),("content"===m||"both"===m)&&a.from.y!==a.to.y&&(_=_.concat(c).concat(l),o.from=t.effects.setTransition(o,c,a.from.y,o.from),o.to=t.effects.setTransition(o,c,a.to.y,o.to)),t.effects.save(o,_),o.show(),t.effects.createWrapper(o),o.css("overflow","hidden").css(o.from),g&&(n=t.effects.getBaseline(g,s),o.from.top=(s.outerHeight-o.outerHeight())*n.y,o.from.left=(s.outerWidth-o.outerWidth())*n.x,o.to.top=(s.outerHeight-o.to.outerHeight)*n.y,o.to.left=(s.outerWidth-o.to.outerWidth)*n.x),o.css(o.from),("content"===m||"both"===m)&&(u=u.concat(["marginTop","marginBottom"]).concat(c),d=d.concat(["marginLeft","marginRight"]),l=r.concat(u).concat(d),o.find("*[width]").each(function(){var i=t(this),s={height:i.height(),width:i.width(),outerHeight:i.outerHeight(),outerWidth:i.outerWidth()};f&&t.effects.save(i,l),i.from={height:s.height*a.from.y,width:s.width*a.from.x,outerHeight:s.outerHeight*a.from.y,outerWidth:s.outerWidth*a.from.x},i.to={height:s.height*a.to.y,width:s.width*a.to.x,outerHeight:s.height*a.to.y,outerWidth:s.width*a.to.x},a.from.y!==a.to.y&&(i.from=t.effects.setTransition(i,u,a.from.y,i.from),i.to=t.effects.setTransition(i,u,a.to.y,i.to)),a.from.x!==a.to.x&&(i.from=t.effects.setTransition(i,d,a.from.x,i.from),i.to=t.effects.setTransition(i,d,a.to.x,i.to)),i.css(i.from),i.animate(i.to,e.duration,e.easing,function(){f&&t.effects.restore(i,l)})})),o.animate(o.to,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){0===o.to.opacity&&o.css("opacity",o.from.opacity),"hide"===p&&o.hide(),t.effects.restore(o,_),f||("static"===v?o.css({position:"relative",top:o.to.top,left:o.to.left}):t.each(["top","left"],function(t,e){o.css(e,function(e,i){var s=parseInt(i,10),n=t?o.to.left:o.to.top;return"auto"===i?n+"px":s+n+"px"})})),t.effects.removeWrapper(o),i()}})}})(jQuery); \ No newline at end of file diff --git a/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.effect-shake.min.js b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.effect-shake.min.js new file mode 100644 index 0000000..8919d0a --- /dev/null +++ b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.effect-shake.min.js @@ -0,0 +1,4 @@ +/*! jQuery UI - v1.10.2 - 2013-03-14 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ +(function(t){t.effects.effect.shake=function(e,i){var s,n=t(this),a=["position","top","bottom","left","right","height","width"],o=t.effects.setMode(n,e.mode||"effect"),r=e.direction||"left",h=e.distance||20,l=e.times||3,c=2*l+1,u=Math.round(e.duration/c),d="up"===r||"down"===r?"top":"left",p="up"===r||"left"===r,f={},m={},g={},v=n.queue(),_=v.length;for(t.effects.save(n,a),n.show(),t.effects.createWrapper(n),f[d]=(p?"-=":"+=")+h,m[d]=(p?"+=":"-=")+2*h,g[d]=(p?"-=":"+=")+2*h,n.animate(f,u,e.easing),s=1;l>s;s++)n.animate(m,u,e.easing).animate(g,u,e.easing);n.animate(m,u,e.easing).animate(f,u/2,e.easing).queue(function(){"hide"===o&&n.hide(),t.effects.restore(n,a),t.effects.removeWrapper(n),i()}),_>1&&v.splice.apply(v,[1,0].concat(v.splice(_,c+1))),n.dequeue()}})(jQuery); \ No newline at end of file diff --git a/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.effect-slide.min.js b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.effect-slide.min.js new file mode 100644 index 0000000..82a0767 --- /dev/null +++ b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.effect-slide.min.js @@ -0,0 +1,4 @@ +/*! jQuery UI - v1.10.2 - 2013-03-14 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ +(function(t){t.effects.effect.slide=function(e,i){var s,n=t(this),a=["position","top","bottom","left","right","width","height"],o=t.effects.setMode(n,e.mode||"show"),r="show"===o,h=e.direction||"left",l="up"===h||"down"===h?"top":"left",c="up"===h||"left"===h,u={};t.effects.save(n,a),n.show(),s=e.distance||n["top"===l?"outerHeight":"outerWidth"](!0),t.effects.createWrapper(n).css({overflow:"hidden"}),r&&n.css(l,c?isNaN(s)?"-"+s:-s:s),u[l]=(r?c?"+=":"-=":c?"-=":"+=")+s,n.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===o&&n.hide(),t.effects.restore(n,a),t.effects.removeWrapper(n),i()}})}})(jQuery); \ No newline at end of file diff --git a/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.effect-transfer.min.js b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.effect-transfer.min.js new file mode 100644 index 0000000..0dd1718 --- /dev/null +++ b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.effect-transfer.min.js @@ -0,0 +1,4 @@ +/*! jQuery UI - v1.10.2 - 2013-03-14 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ +(function(t){t.effects.effect.transfer=function(e,i){var s=t(this),n=t(e.to),a="fixed"===n.css("position"),o=t("body"),r=a?o.scrollTop():0,h=a?o.scrollLeft():0,l=n.offset(),c={top:l.top-r,left:l.left-h,height:n.innerHeight(),width:n.innerWidth()},u=s.offset(),d=t("
").appendTo(document.body).addClass(e.className).css({top:u.top-r,left:u.left-h,height:s.innerHeight(),width:s.innerWidth(),position:a?"fixed":"absolute"}).animate(c,e.duration,e.easing,function(){d.remove(),i()})}})(jQuery); \ No newline at end of file diff --git a/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.effect.min.js b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.effect.min.js new file mode 100644 index 0000000..1c5e52a --- /dev/null +++ b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.effect.min.js @@ -0,0 +1,4 @@ +/*! jQuery UI - v1.10.2 - 2013-03-14 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ +(function(t,e){var i="ui-effects-";t.effects={effect:{}},function(t,e){function i(t,e,i){var s=u[e.type]||{};return null==t?i||!e.def?null:e.def:(t=s.floor?~~t:parseFloat(t),isNaN(t)?e.def:s.mod?(t+s.mod)%s.mod:0>t?0:t>s.max?s.max:t)}function s(i){var s=l(),n=s._rgba=[];return i=i.toLowerCase(),f(h,function(t,a){var o,r=a.re.exec(i),h=r&&a.parse(r),l=a.space||"rgba";return h?(o=s[l](h),s[c[l].cache]=o[c[l].cache],n=s._rgba=o._rgba,!1):e}),n.length?("0,0,0,0"===n.join()&&t.extend(n,a.transparent),s):a[i]}function n(t,e,i){return i=(i+1)%1,1>6*i?t+6*(e-t)*i:1>2*i?e:2>3*i?t+6*(e-t)*(2/3-i):t}var a,o="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",r=/^([\-+])=\s*(\d+\.?\d*)/,h=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(t){return[t[1],t[2]/100,t[3]/100,t[4]]}}],l=t.Color=function(e,i,s,n){return new t.Color.fn.parse(e,i,s,n)},c={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},u={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},d=l.support={},p=t("

")[0],f=t.each;p.style.cssText="background-color:rgba(1,1,1,.5)",d.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(c,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),l.fn=t.extend(l.prototype,{parse:function(n,o,r,h){if(n===e)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=t(n).css(o),o=e);var u=this,d=t.type(n),p=this._rgba=[];return o!==e&&(n=[n,o,r,h],d="array"),"string"===d?this.parse(s(n)||a._default):"array"===d?(f(c.rgba.props,function(t,e){p[e.idx]=i(n[e.idx],e)}),this):"object"===d?(n instanceof l?f(c,function(t,e){n[e.cache]&&(u[e.cache]=n[e.cache].slice())}):f(c,function(e,s){var a=s.cache;f(s.props,function(t,e){if(!u[a]&&s.to){if("alpha"===t||null==n[t])return;u[a]=s.to(u._rgba)}u[a][e.idx]=i(n[t],e,!0)}),u[a]&&0>t.inArray(null,u[a].slice(0,3))&&(u[a][3]=1,s.from&&(u._rgba=s.from(u[a])))}),this):e},is:function(t){var i=l(t),s=!0,n=this;return f(c,function(t,a){var o,r=i[a.cache];return r&&(o=n[a.cache]||a.to&&a.to(n._rgba)||[],f(a.props,function(t,i){return null!=r[i.idx]?s=r[i.idx]===o[i.idx]:e})),s}),s},_space:function(){var t=[],e=this;return f(c,function(i,s){e[s.cache]&&t.push(i)}),t.pop()},transition:function(t,e){var s=l(t),n=s._space(),a=c[n],o=0===this.alpha()?l("transparent"):this,r=o[a.cache]||a.to(o._rgba),h=r.slice();return s=s[a.cache],f(a.props,function(t,n){var a=n.idx,o=r[a],l=s[a],c=u[n.type]||{};null!==l&&(null===o?h[a]=l:(c.mod&&(l-o>c.mod/2?o+=c.mod:o-l>c.mod/2&&(o-=c.mod)),h[a]=i((l-o)*e+o,n)))}),this[n](h)},blend:function(e){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=l(e)._rgba;return l(t.map(i,function(t,e){return(1-s)*n[e]+s*t}))},toRgbaString:function(){var e="rgba(",i=t.map(this._rgba,function(t,e){return null==t?e>2?1:0:t});return 1===i[3]&&(i.pop(),e="rgb("),e+i.join()+")"},toHslaString:function(){var e="hsla(",i=t.map(this.hsla(),function(t,e){return null==t&&(t=e>2?1:0),e&&3>e&&(t=Math.round(100*t)+"%"),t});return 1===i[3]&&(i.pop(),e="hsl("),e+i.join()+")"},toHexString:function(e){var i=this._rgba.slice(),s=i.pop();return e&&i.push(~~(255*s)),"#"+t.map(i,function(t){return t=(t||0).toString(16),1===t.length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),l.fn.parse.prototype=l.fn,c.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e,i,s=t[0]/255,n=t[1]/255,a=t[2]/255,o=t[3],r=Math.max(s,n,a),h=Math.min(s,n,a),l=r-h,c=r+h,u=.5*c;return e=h===r?0:s===r?60*(n-a)/l+360:n===r?60*(a-s)/l+120:60*(s-n)/l+240,i=0===l?0:.5>=u?l/c:l/(2-c),[Math.round(e)%360,i,u,null==o?1:o]},c.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/360,i=t[1],s=t[2],a=t[3],o=.5>=s?s*(1+i):s+i-s*i,r=2*s-o;return[Math.round(255*n(r,o,e+1/3)),Math.round(255*n(r,o,e)),Math.round(255*n(r,o,e-1/3)),a]},f(c,function(s,n){var a=n.props,o=n.cache,h=n.to,c=n.from;l.fn[s]=function(s){if(h&&!this[o]&&(this[o]=h(this._rgba)),s===e)return this[o].slice();var n,r=t.type(s),u="array"===r||"object"===r?s:arguments,d=this[o].slice();return f(a,function(t,e){var s=u["object"===r?t:e.idx];null==s&&(s=d[e.idx]),d[e.idx]=i(s,e)}),c?(n=l(c(d)),n[o]=d,n):l(d)},f(a,function(e,i){l.fn[e]||(l.fn[e]=function(n){var a,o=t.type(n),h="alpha"===e?this._hsla?"hsla":"rgba":s,l=this[h](),c=l[i.idx];return"undefined"===o?c:("function"===o&&(n=n.call(this,c),o=t.type(n)),null==n&&i.empty?this:("string"===o&&(a=r.exec(n),a&&(n=c+parseFloat(a[2])*("+"===a[1]?1:-1))),l[i.idx]=n,this[h](l)))})})}),l.hook=function(e){var i=e.split(" ");f(i,function(e,i){t.cssHooks[i]={set:function(e,n){var a,o,r="";if("transparent"!==n&&("string"!==t.type(n)||(a=s(n)))){if(n=l(a||n),!d.rgba&&1!==n._rgba[3]){for(o="backgroundColor"===i?e.parentNode:e;(""===r||"transparent"===r)&&o&&o.style;)try{r=t.css(o,"backgroundColor"),o=o.parentNode}catch(h){}n=n.blend(r&&"transparent"!==r?r:"_default")}n=n.toRgbaString()}try{e.style[i]=n}catch(h){}}},t.fx.step[i]=function(e){e.colorInit||(e.start=l(e.elem,i),e.end=l(e.end),e.colorInit=!0),t.cssHooks[i].set(e.elem,e.start.transition(e.end,e.pos))}})},l.hook(o),t.cssHooks.borderColor={expand:function(t){var e={};return f(["Top","Right","Bottom","Left"],function(i,s){e["border"+s+"Color"]=t}),e}},a=t.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(jQuery),function(){function i(e){var i,s,n=e.ownerDocument.defaultView?e.ownerDocument.defaultView.getComputedStyle(e,null):e.currentStyle,a={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)i=n[s],"string"==typeof n[i]&&(a[t.camelCase(i)]=n[i]);else for(i in n)"string"==typeof n[i]&&(a[i]=n[i]);return a}function s(e,i){var s,n,o={};for(s in i)n=i[s],e[s]!==n&&(a[s]||(t.fx.step[s]||!isNaN(parseFloat(n)))&&(o[s]=n));return o}var n=["add","remove","toggle"],a={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};t.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(e,i){t.fx.step[i]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(jQuery.style(t.elem,i,t.end),t.setAttr=!0)}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.effects.animateClass=function(e,a,o,r){var h=t.speed(a,o,r);return this.queue(function(){var a,o=t(this),r=o.attr("class")||"",l=h.children?o.find("*").addBack():o;l=l.map(function(){var e=t(this);return{el:e,start:i(this)}}),a=function(){t.each(n,function(t,i){e[i]&&o[i+"Class"](e[i])})},a(),l=l.map(function(){return this.end=i(this.el[0]),this.diff=s(this.start,this.end),this}),o.attr("class",r),l=l.map(function(){var e=this,i=t.Deferred(),s=t.extend({},h,{queue:!1,complete:function(){i.resolve(e)}});return this.el.animate(this.diff,s),i.promise()}),t.when.apply(t,l.get()).done(function(){a(),t.each(arguments,function(){var e=this.el;t.each(this.diff,function(t){e.css(t,"")})}),h.complete.call(o[0])})})},t.fn.extend({addClass:function(e){return function(i,s,n,a){return s?t.effects.animateClass.call(this,{add:i},s,n,a):e.apply(this,arguments)}}(t.fn.addClass),removeClass:function(e){return function(i,s,n,a){return arguments.length>1?t.effects.animateClass.call(this,{remove:i},s,n,a):e.apply(this,arguments)}}(t.fn.removeClass),toggleClass:function(i){return function(s,n,a,o,r){return"boolean"==typeof n||n===e?a?t.effects.animateClass.call(this,n?{add:s}:{remove:s},a,o,r):i.apply(this,arguments):t.effects.animateClass.call(this,{toggle:s},n,a,o)}}(t.fn.toggleClass),switchClass:function(e,i,s,n,a){return t.effects.animateClass.call(this,{add:i,remove:e},s,n,a)}})}(),function(){function s(e,i,s,n){return t.isPlainObject(e)&&(i=e,e=e.effect),e={effect:e},null==i&&(i={}),t.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||t.fx.speeds[i])&&(n=s,s=i,i={}),t.isFunction(s)&&(n=s,s=null),i&&t.extend(e,i),s=s||i.duration,e.duration=t.fx.off?0:"number"==typeof s?s:s in t.fx.speeds?t.fx.speeds[s]:t.fx.speeds._default,e.complete=n||i.complete,e}function n(e){return!e||"number"==typeof e||t.fx.speeds[e]?!0:"string"!=typeof e||t.effects.effect[e]?t.isFunction(e)?!0:"object"!=typeof e||e.effect?!1:!0:!0}t.extend(t.effects,{version:"1.10.2",save:function(t,e){for(var s=0;e.length>s;s++)null!==e[s]&&t.data(i+e[s],t[0].style[e[s]])},restore:function(t,s){var n,a;for(a=0;s.length>a;a++)null!==s[a]&&(n=t.data(i+s[a]),n===e&&(n=""),t.css(s[a],n))},setMode:function(t,e){return"toggle"===e&&(e=t.is(":hidden")?"show":"hide"),e},getBaseline:function(t,e){var i,s;switch(t[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=t[0]/e.height}switch(t[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=t[1]/e.width}return{x:s,y:i}},createWrapper:function(e){if(e.parent().is(".ui-effects-wrapper"))return e.parent();var i={width:e.outerWidth(!0),height:e.outerHeight(!0),"float":e.css("float")},s=t("

").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:e.width(),height:e.height()},a=document.activeElement;try{a.id}catch(o){a=document.body}return e.wrap(s),(e[0]===a||t.contains(e[0],a))&&t(a).focus(),s=e.parent(),"static"===e.css("position")?(s.css({position:"relative"}),e.css({position:"relative"})):(t.extend(i,{position:e.css("position"),zIndex:e.css("z-index")}),t.each(["top","left","bottom","right"],function(t,s){i[s]=e.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),e.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),e.css(n),s.css(i).show()},removeWrapper:function(e){var i=document.activeElement;return e.parent().is(".ui-effects-wrapper")&&(e.parent().replaceWith(e),(e[0]===i||t.contains(e[0],i))&&t(i).focus()),e},setTransition:function(e,i,s,n){return n=n||{},t.each(i,function(t,i){var a=e.cssUnit(i);a[0]>0&&(n[i]=a[0]*s+a[1])}),n}}),t.fn.extend({effect:function(){function e(e){function s(){t.isFunction(a)&&a.call(n[0]),t.isFunction(e)&&e()}var n=t(this),a=i.complete,r=i.mode;(n.is(":hidden")?"hide"===r:"show"===r)?(n[r](),s()):o.call(n[0],i,s)}var i=s.apply(this,arguments),n=i.mode,a=i.queue,o=t.effects.effect[i.effect];return t.fx.off||!o?n?this[n](i.duration,i.complete):this.each(function(){i.complete&&i.complete.call(this)}):a===!1?this.each(e):this.queue(a||"fx",e)},show:function(t){return function(e){if(n(e))return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="show",this.effect.call(this,i)}}(t.fn.show),hide:function(t){return function(e){if(n(e))return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="hide",this.effect.call(this,i)}}(t.fn.hide),toggle:function(t){return function(e){if(n(e)||"boolean"==typeof e)return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="toggle",this.effect.call(this,i)}}(t.fn.toggle),cssUnit:function(e){var i=this.css(e),s=[];return t.each(["em","px","%","pt"],function(t,e){i.indexOf(e)>0&&(s=[parseFloat(i),e])}),s}})}(),function(){var e={};t.each(["Quad","Cubic","Quart","Quint","Expo"],function(t,i){e[i]=function(e){return Math.pow(e,t+2)}}),t.extend(e,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,i=4;((e=Math.pow(2,--i))-1)/11>t;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),t.each(e,function(e,i){t.easing["easeIn"+e]=i,t.easing["easeOut"+e]=function(t){return 1-i(1-t)},t.easing["easeInOut"+e]=function(t){return.5>t?i(2*t)/2:1-i(-2*t+2)/2}})}()})(jQuery); \ No newline at end of file diff --git a/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.menu.min.js b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.menu.min.js new file mode 100644 index 0000000..3977e1b --- /dev/null +++ b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.menu.min.js @@ -0,0 +1,4 @@ +/*! jQuery UI - v1.10.2 - 2013-03-14 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ +(function(t){t.widget("ui.menu",{version:"1.10.2",defaultElement:"
    ",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content ui-corner-all").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}).bind("click"+this.eventNamespace,t.proxy(function(t){this.options.disabled&&t.preventDefault()},this)),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item > a":function(t){t.preventDefault()},"click .ui-state-disabled > a":function(t){t.preventDefault()},"click .ui-menu-item:has(a)":function(e){var i=t(e.target).closest(".ui-menu-item");!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.mouseHandled=!0,this.select(e),i.has(".ui-menu").length?this.expand(e):this.element.is(":focus")||(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(e){var i=t(e.currentTarget);i.siblings().children(".ui-state-active").removeClass("ui-state-active"),this.focus(e,i)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var i=this.active||this.element.children(".ui-menu-item").eq(0);e||this.focus(t,i)},blur:function(e){this._delay(function(){t.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(e)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){t(e.target).closest(".ui-menu").length||this.collapseAll(e),this.mouseHandled=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").children("a").removeUniqueId().removeClass("ui-corner-all ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var e=t(this);e.data("ui-menu-submenu-carat")&&e.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(e){function i(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var s,n,a,o,r,h=!0;switch(e.keyCode){case t.ui.keyCode.PAGE_UP:this.previousPage(e);break;case t.ui.keyCode.PAGE_DOWN:this.nextPage(e);break;case t.ui.keyCode.HOME:this._move("first","first",e);break;case t.ui.keyCode.END:this._move("last","last",e);break;case t.ui.keyCode.UP:this.previous(e);break;case t.ui.keyCode.DOWN:this.next(e);break;case t.ui.keyCode.LEFT:this.collapse(e);break;case t.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(e);break;case t.ui.keyCode.ENTER:case t.ui.keyCode.SPACE:this._activate(e);break;case t.ui.keyCode.ESCAPE:this.collapse(e);break;default:h=!1,n=this.previousFilter||"",a=String.fromCharCode(e.keyCode),o=!1,clearTimeout(this.filterTimer),a===n?o=!0:a=n+a,r=RegExp("^"+i(a),"i"),s=this.activeMenu.children(".ui-menu-item").filter(function(){return r.test(t(this).children("a").text())}),s=o&&-1!==s.index(this.active.next())?this.active.nextAll(".ui-menu-item"):s,s.length||(a=String.fromCharCode(e.keyCode),r=RegExp("^"+i(a),"i"),s=this.activeMenu.children(".ui-menu-item").filter(function(){return r.test(t(this).children("a").text())})),s.length?(this.focus(e,s),s.length>1?(this.previousFilter=a,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter):delete this.previousFilter}h&&e.preventDefault()},_activate:function(t){this.active.is(".ui-state-disabled")||(this.active.children("a[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var e,i=this.options.icons.submenu,s=this.element.find(this.options.menus);s.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-corner-all").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var e=t(this),s=e.prev("a"),n=t("").addClass("ui-menu-icon ui-icon "+i).data("ui-menu-submenu-carat",!0);s.attr("aria-haspopup","true").prepend(n),e.attr("aria-labelledby",s.attr("id"))}),e=s.add(this.element),e.children(":not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","presentation").children("a").uniqueId().addClass("ui-corner-all").attr({tabIndex:-1,role:this._itemRole()}),e.children(":not(.ui-menu-item)").each(function(){var e=t(this);/[^\-\u2014\u2013\s]/.test(e.text())||e.addClass("ui-widget-content ui-menu-divider")}),e.children(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!t.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){"icons"===t&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(e.submenu),this._super(t,e)},focus:function(t,e){var i,s;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),s=this.active.children("a").addClass("ui-state-focus"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=e.children(".ui-menu"),i.length&&/^mouse/.test(t.type)&&this._startOpening(i),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(e){var i,s,n,a,o,r;this._hasScroll()&&(i=parseFloat(t.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(t.css(this.activeMenu[0],"paddingTop"))||0,n=e.offset().top-this.activeMenu.offset().top-i-s,a=this.activeMenu.scrollTop(),o=this.activeMenu.height(),r=e.height(),0>n?this.activeMenu.scrollTop(a+n):n+r>o&&this.activeMenu.scrollTop(a+n-o+r))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this.active.children("a").removeClass("ui-state-focus"),this.active=null,this._trigger("blur",t,{item:this.active}))},_startOpening:function(t){clearTimeout(this.timer),"true"===t.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(t)},this.delay))},_open:function(e){var i=t.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(e.parents(".ui-menu")).hide().attr("aria-hidden","true"),e.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(e,i){clearTimeout(this.timer),this.timer=this._delay(function(){var s=i?this.element:t(e&&e.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(e),this.activeMenu=s},this.delay)},_close:function(t){t||(t=this.active?this.active.parent():this.element),t.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find("a.ui-state-active").removeClass("ui-state-active")},collapse:function(t){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element);e&&e.length&&(this._close(),this.focus(t,e))},expand:function(t){var e=this.active&&this.active.children(".ui-menu ").children(".ui-menu-item").first();e&&e.length&&(this._open(e.parent()),this._delay(function(){this.focus(t,e)}))},next:function(t){this._move("next","first",t)},previous:function(t){this._move("prev","last",t)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(t,e,i){var s;this.active&&(s="first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[t+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.children(".ui-menu-item")[e]()),this.focus(i,s)},nextPage:function(e){var i,s,n;return this.active?(this.isLastItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=t(this),0>i.offset().top-s-n}),this.focus(e,i)):this.focus(e,this.activeMenu.children(".ui-menu-item")[this.active?"last":"first"]())),undefined):(this.next(e),undefined)},previousPage:function(e){var i,s,n;return this.active?(this.isFirstItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=t(this),i.offset().top-s+n>0}),this.focus(e,i)):this.focus(e,this.activeMenu.children(".ui-menu-item").first())),undefined):(this.next(e),undefined)},_hasScroll:function(){return this.element.outerHeight()=9)&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a);return a.preventDefault()}if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate); -if(this._mouseStarted){this._mouseStarted=false;a.target==this._mouseDownEvent.target&&b.data(a.target,this.widgetName+".preventClickEvent",true);this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery); +/*! jQuery UI - v1.10.2 - 2013-03-14 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ +(function(e){var t=!1;e(document).mouseup(function(){t=!1}),e.widget("ui.mouse",{version:"1.10.2",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(i){return!0===e.data(i.target,t.widgetName+".preventClickEvent")?(e.removeData(i.target,t.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):undefined}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(i){if(!t){this._mouseStarted&&this._mouseUp(i),this._mouseDownEvent=i;var s=this,n=1===i.which,a="string"==typeof this.options.cancel&&i.target.nodeName?e(i.target).closest(this.options.cancel).length:!1;return n&&!a&&this._mouseCapture(i)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){s.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(i)&&this._mouseDelayMet(i)&&(this._mouseStarted=this._mouseStart(i)!==!1,!this._mouseStarted)?(i.preventDefault(),!0):(!0===e.data(i.target,this.widgetName+".preventClickEvent")&&e.removeData(i.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return s._mouseMove(e)},this._mouseUpDelegate=function(e){return s._mouseUp(e)},e(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),i.preventDefault(),t=!0,!0)):!0}},_mouseMove:function(t){return e.ui.ie&&(!document.documentMode||9>document.documentMode)&&!t.button?this._mouseUp(t):this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){return e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})})(jQuery); \ No newline at end of file diff --git a/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.position.min.js b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.position.min.js index 8a5de73..0451d53 100644 --- a/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.position.min.js +++ b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.position.min.js @@ -1,16 +1,4 @@ -/* - * jQuery UI Position 1.8.11 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Position - */ -(function(c){c.ui=c.ui||{};var n=/left|center|right/,o=/top|center|bottom/,t=c.fn.position,u=c.fn.offset;c.fn.position=function(b){if(!b||!b.of)return t.apply(this,arguments);b=c.extend({},b);var a=c(b.of),d=a[0],g=(b.collision||"flip").split(" "),e=b.offset?b.offset.split(" "):[0,0],h,k,j;if(d.nodeType===9){h=a.width();k=a.height();j={top:0,left:0}}else if(d.setTimeout){h=a.width();k=a.height();j={top:a.scrollTop(),left:a.scrollLeft()}}else if(d.preventDefault){b.at="left top";h=k=0;j={top:b.of.pageY, -left:b.of.pageX}}else{h=a.outerWidth();k=a.outerHeight();j=a.offset()}c.each(["my","at"],function(){var f=(b[this]||"").split(" ");if(f.length===1)f=n.test(f[0])?f.concat(["center"]):o.test(f[0])?["center"].concat(f):["center","center"];f[0]=n.test(f[0])?f[0]:"center";f[1]=o.test(f[1])?f[1]:"center";b[this]=f});if(g.length===1)g[1]=g[0];e[0]=parseInt(e[0],10)||0;if(e.length===1)e[1]=e[0];e[1]=parseInt(e[1],10)||0;if(b.at[0]==="right")j.left+=h;else if(b.at[0]==="center")j.left+=h/2;if(b.at[1]==="bottom")j.top+= -k;else if(b.at[1]==="center")j.top+=k/2;j.left+=e[0];j.top+=e[1];return this.each(function(){var f=c(this),l=f.outerWidth(),m=f.outerHeight(),p=parseInt(c.curCSS(this,"marginLeft",true))||0,q=parseInt(c.curCSS(this,"marginTop",true))||0,v=l+p+(parseInt(c.curCSS(this,"marginRight",true))||0),w=m+q+(parseInt(c.curCSS(this,"marginBottom",true))||0),i=c.extend({},j),r;if(b.my[0]==="right")i.left-=l;else if(b.my[0]==="center")i.left-=l/2;if(b.my[1]==="bottom")i.top-=m;else if(b.my[1]==="center")i.top-= -m/2;i.left=Math.round(i.left);i.top=Math.round(i.top);r={left:i.left-p,top:i.top-q};c.each(["left","top"],function(s,x){c.ui.position[g[s]]&&c.ui.position[g[s]][x](i,{targetWidth:h,targetHeight:k,elemWidth:l,elemHeight:m,collisionPosition:r,collisionWidth:v,collisionHeight:w,offset:e,my:b.my,at:b.at})});c.fn.bgiframe&&f.bgiframe();f.offset(c.extend(i,{using:b.using}))})};c.ui.position={fit:{left:function(b,a){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();b.left= -d>0?b.left-d:Math.max(b.left-a.collisionPosition.left,b.left)},top:function(b,a){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();b.top=d>0?b.top-d:Math.max(b.top-a.collisionPosition.top,b.top)}},flip:{left:function(b,a){if(a.at[0]!=="center"){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();var g=a.my[0]==="left"?-a.elemWidth:a.my[0]==="right"?a.elemWidth:0,e=a.at[0]==="left"?a.targetWidth:-a.targetWidth,h=-2*a.offset[0];b.left+= -a.collisionPosition.left<0?g+e+h:d>0?g+e+h:0}},top:function(b,a){if(a.at[1]!=="center"){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();var g=a.my[1]==="top"?-a.elemHeight:a.my[1]==="bottom"?a.elemHeight:0,e=a.at[1]==="top"?a.targetHeight:-a.targetHeight,h=-2*a.offset[1];b.top+=a.collisionPosition.top<0?g+e+h:d>0?g+e+h:0}}}};if(!c.offset.setOffset){c.offset.setOffset=function(b,a){if(/static/.test(c.curCSS(b,"position")))b.style.position="relative";var d=c(b), -g=d.offset(),e=parseInt(c.curCSS(b,"top",true),10)||0,h=parseInt(c.curCSS(b,"left",true),10)||0;g={top:a.top-g.top+e,left:a.left-g.left+h};"using"in a?a.using.call(b,g):d.css(g)};c.fn.offset=function(b){var a=this[0];if(!a||!a.ownerDocument)return null;if(b)return this.each(function(){c.offset.setOffset(this,b)});return u.call(this)}}})(jQuery); +/*! jQuery UI - v1.10.2 - 2013-03-14 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ +(function(t,e){function i(t,e,i){return[parseFloat(t[0])*(p.test(t[0])?e/100:1),parseFloat(t[1])*(p.test(t[1])?i/100:1)]}function s(e,i){return parseInt(t.css(e,i),10)||0}function n(e){var i=e[0];return 9===i.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(i)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}t.ui=t.ui||{};var a,o=Math.max,r=Math.abs,h=Math.round,l=/left|center|right/,c=/top|center|bottom/,u=/[\+\-]\d+(\.[\d]+)?%?/,d=/^\w+/,p=/%$/,f=t.fn.position;t.position={scrollbarWidth:function(){if(a!==e)return a;var i,s,n=t("
    "),o=n.children()[0];return t("body").append(n),i=o.offsetWidth,n.css("overflow","scroll"),s=o.offsetWidth,i===s&&(s=n[0].clientWidth),n.remove(),a=i-s},getScrollInfo:function(e){var i=e.isWindow?"":e.element.css("overflow-x"),s=e.isWindow?"":e.element.css("overflow-y"),n="scroll"===i||"auto"===i&&e.widths?"left":i>0?"right":"center",vertical:0>a?"top":n>0?"bottom":"middle"};u>p&&p>r(i+s)&&(h.horizontal="center"),d>m&&m>r(n+a)&&(h.vertical="middle"),h.important=o(r(i),r(s))>o(r(n),r(a))?"horizontal":"vertical",e.using.call(this,t,h)}),c.offset(t.extend(C,{using:l}))})},t.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=t.left-e.collisionPosition.marginLeft,h=n-r,l=r+e.collisionWidth-a-n;e.collisionWidth>a?h>0&&0>=l?(i=t.left+h+e.collisionWidth-a-n,t.left+=h-i):t.left=l>0&&0>=h?n:h>l?n+a-e.collisionWidth:n:h>0?t.left+=h:l>0?t.left-=l:t.left=o(t.left-r,t.left)},top:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollTop:s.offset.top,a=e.within.height,r=t.top-e.collisionPosition.marginTop,h=n-r,l=r+e.collisionHeight-a-n;e.collisionHeight>a?h>0&&0>=l?(i=t.top+h+e.collisionHeight-a-n,t.top+=h-i):t.top=l>0&&0>=h?n:h>l?n+a-e.collisionHeight:n:h>0?t.top+=h:l>0?t.top-=l:t.top=o(t.top-r,t.top)}},flip:{left:function(t,e){var i,s,n=e.within,a=n.offset.left+n.scrollLeft,o=n.width,h=n.isWindow?n.scrollLeft:n.offset.left,l=t.left-e.collisionPosition.marginLeft,c=l-h,u=l+e.collisionWidth-o-h,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,p="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];0>c?(i=t.left+d+p+f+e.collisionWidth-o-a,(0>i||r(c)>i)&&(t.left+=d+p+f)):u>0&&(s=t.left-e.collisionPosition.marginLeft+d+p+f-h,(s>0||u>r(s))&&(t.left+=d+p+f))},top:function(t,e){var i,s,n=e.within,a=n.offset.top+n.scrollTop,o=n.height,h=n.isWindow?n.scrollTop:n.offset.top,l=t.top-e.collisionPosition.marginTop,c=l-h,u=l+e.collisionHeight-o-h,d="top"===e.my[1],p=d?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,f="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,m=-2*e.offset[1];0>c?(s=t.top+p+f+m+e.collisionHeight-o-a,t.top+p+f+m>c&&(0>s||r(c)>s)&&(t.top+=p+f+m)):u>0&&(i=t.top-e.collisionPosition.marginTop+p+f+m-h,t.top+p+f+m>u&&(i>0||u>r(i))&&(t.top+=p+f+m))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}},function(){var e,i,s,n,a,o=document.getElementsByTagName("body")[0],r=document.createElement("div");e=document.createElement(o?"div":"body"),s={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},o&&t.extend(s,{position:"absolute",left:"-1000px",top:"-1000px"});for(a in s)e.style[a]=s[a];e.appendChild(r),i=o||document.documentElement,i.insertBefore(e,i.firstChild),r.style.cssText="position: absolute; left: 10.7432222px;",n=t(r).offset().left,t.support.offsetFractions=n>10&&11>n,e.innerHTML="",i.removeChild(e)}()})(jQuery); \ No newline at end of file diff --git a/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.progressbar.min.js b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.progressbar.min.js index cd29ff0..4abf2d9 100644 --- a/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.progressbar.min.js +++ b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.progressbar.min.js @@ -1,16 +1,4 @@ -/* - * jQuery UI Progressbar 1.8.11 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Progressbar - * - * Depends: - * jquery.ui.core.js - * jquery.ui.widget.js - */ -(function(b,d){b.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()});this.valueDiv=b("
    ").appendTo(this.element);this.oldValue=this._value();this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"); -this.valueDiv.remove();b.Widget.prototype.destroy.apply(this,arguments)},value:function(a){if(a===d)return this._value();this._setOption("value",a);return this},_setOption:function(a,c){if(a==="value"){this.options.value=c;this._refreshValue();this._value()===this.options.max&&this._trigger("complete")}b.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;if(typeof a!=="number")a=0;return Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100* -this._value()/this.options.max},_refreshValue:function(){var a=this.value(),c=this._percentage();if(this.oldValue!==a){this.oldValue=a;this._trigger("change")}this.valueDiv.toggleClass("ui-corner-right",a===this.options.max).width(c.toFixed(0)+"%");this.element.attr("aria-valuenow",a)}});b.extend(b.ui.progressbar,{version:"1.8.11"})})(jQuery); +/*! jQuery UI - v1.10.2 - 2013-03-14 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ +(function(t,e){t.widget("ui.progressbar",{version:"1.10.2",options:{max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min}),this.valueDiv=t("
    ").appendTo(this.element),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(t){return t===e?this.options.value:(this.options.value=this._constrainedValue(t),this._refreshValue(),e)},_constrainedValue:function(t){return t===e&&(t=this.options.value),this.indeterminate=t===!1,"number"!=typeof t&&(t=0),this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,t))},_setOptions:function(t){var e=t.value;delete t.value,this._super(t),this.options.value=this._constrainedValue(e),this._refreshValue()},_setOption:function(t,e){"max"===t&&(e=Math.max(this.min,e)),this._super(t,e)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var e=this.options.value,i=this._percentage();this.valueDiv.toggle(this.indeterminate||e>this.min).toggleClass("ui-corner-right",e===this.options.max).width(i.toFixed(0)+"%"),this.element.toggleClass("ui-progressbar-indeterminate",this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=t("
    ").appendTo(this.valueDiv))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":e}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==e&&(this.oldValue=e,this._trigger("change")),e===this.options.max&&this._trigger("complete")}})})(jQuery); \ No newline at end of file diff --git a/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.resizable.min.js b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.resizable.min.js index bb6f85f..a071199 100644 --- a/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.resizable.min.js +++ b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.resizable.min.js @@ -1,47 +1,4 @@ -/* - * jQuery UI Resizable 1.8.11 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Resizables - * - * Depends: - * jquery.ui.core.js - * jquery.ui.mouse.js - * jquery.ui.widget.js - */ -(function(e){e.widget("ui.resizable",e.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1E3},_create:function(){var b=this,a=this.options;this.element.addClass("ui-resizable");e.extend(this,{_aspectRatio:!!a.aspectRatio,aspectRatio:a.aspectRatio,originalElement:this.element, -_proportionallyResizeElements:[],_helper:a.helper||a.ghost||a.animate?a.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){/relative/.test(this.element.css("position"))&&e.browser.opera&&this.element.css({position:"relative",top:"auto",left:"auto"});this.element.wrap(e('
    ').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(), -top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle= -this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=a.handles||(!e(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne", -nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all")this.handles="n,e,s,w,se,sw,ne,nw";var c=this.handles.split(",");this.handles={};for(var d=0;d
');/sw|se|ne|nw/.test(f)&&g.css({zIndex:++a.zIndex});"se"==f&&g.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[f]=".ui-resizable-"+f;this.element.append(g)}}this._renderAxis=function(h){h=h||this.element;for(var i in this.handles){if(this.handles[i].constructor== -String)this.handles[i]=e(this.handles[i],this.element).show();if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var j=e(this.handles[i],this.element),k=0;k=/sw|ne|nw|se|n|s/.test(i)?j.outerHeight():j.outerWidth();j=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join("");h.css(j,k);this._proportionallyResize()}e(this.handles[i])}};this._renderAxis(this.element);this._handles=e(".ui-resizable-handle",this.element).disableSelection(); -this._handles.mouseover(function(){if(!b.resizing){if(this.className)var h=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=h&&h[1]?h[1]:"se"}});if(a.autoHide){this._handles.hide();e(this.element).addClass("ui-resizable-autohide").hover(function(){e(this).removeClass("ui-resizable-autohide");b._handles.show()},function(){if(!b.resizing){e(this).addClass("ui-resizable-autohide");b._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var b=function(c){e(c).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()}; -if(this.elementIsWrapper){b(this.element);var a=this.element;a.after(this.originalElement.css({position:a.css("position"),width:a.outerWidth(),height:a.outerHeight(),top:a.css("top"),left:a.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);b(this.originalElement);return this},_mouseCapture:function(b){var a=false;for(var c in this.handles)if(e(this.handles[c])[0]==b.target)a=true;return!this.options.disabled&&a},_mouseStart:function(b){var a=this.options,c=this.element.position(), -d=this.element;this.resizing=true;this.documentScroll={top:e(document).scrollTop(),left:e(document).scrollLeft()};if(d.is(".ui-draggable")||/absolute/.test(d.css("position")))d.css({position:"absolute",top:c.top,left:c.left});e.browser.opera&&/relative/.test(d.css("position"))&&d.css({position:"relative",top:"auto",left:"auto"});this._renderProxy();c=m(this.helper.css("left"));var f=m(this.helper.css("top"));if(a.containment){c+=e(a.containment).scrollLeft()||0;f+=e(a.containment).scrollTop()||0}this.offset= -this.helper.offset();this.position={left:c,top:f};this.size=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalSize=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalPosition={left:c,top:f};this.sizeDiff={width:d.outerWidth()-d.width(),height:d.outerHeight()-d.height()};this.originalMousePosition={left:b.pageX,top:b.pageY};this.aspectRatio=typeof a.aspectRatio=="number"?a.aspectRatio: -this.originalSize.width/this.originalSize.height||1;a=e(".ui-resizable-"+this.axis).css("cursor");e("body").css("cursor",a=="auto"?this.axis+"-resize":a);d.addClass("ui-resizable-resizing");this._propagate("start",b);return true},_mouseDrag:function(b){var a=this.helper,c=this.originalMousePosition,d=this._change[this.axis];if(!d)return false;c=d.apply(this,[b,b.pageX-c.left||0,b.pageY-c.top||0]);if(this._aspectRatio||b.shiftKey)c=this._updateRatio(c,b);c=this._respectSize(c,b);this._propagate("resize", -b);a.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize();this._updateCache(c);this._trigger("resize",b,this.ui());return false},_mouseStop:function(b){this.resizing=false;var a=this.options,c=this;if(this._helper){var d=this._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName);d=f&&e.ui.hasScroll(d[0],"left")?0:c.sizeDiff.height; -f=f?0:c.sizeDiff.width;f={width:c.helper.width()-f,height:c.helper.height()-d};d=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null;var g=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null;a.animate||this.element.css(e.extend(f,{top:g,left:d}));c.helper.height(c.size.height);c.helper.width(c.size.width);this._helper&&!a.animate&&this._proportionallyResize()}e("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing"); -this._propagate("stop",b);this._helper&&this.helper.remove();return false},_updateCache:function(b){this.offset=this.helper.offset();if(l(b.left))this.position.left=b.left;if(l(b.top))this.position.top=b.top;if(l(b.height))this.size.height=b.height;if(l(b.width))this.size.width=b.width},_updateRatio:function(b){var a=this.position,c=this.size,d=this.axis;if(b.height)b.width=c.height*this.aspectRatio;else if(b.width)b.height=c.width/this.aspectRatio;if(d=="sw"){b.left=a.left+(c.width-b.width);b.top= -null}if(d=="nw"){b.top=a.top+(c.height-b.height);b.left=a.left+(c.width-b.width)}return b},_respectSize:function(b){var a=this.options,c=this.axis,d=l(b.width)&&a.maxWidth&&a.maxWidthb.width,h=l(b.height)&&a.minHeight&&a.minHeight>b.height;if(g)b.width=a.minWidth;if(h)b.height=a.minHeight;if(d)b.width=a.maxWidth;if(f)b.height=a.maxHeight;var i=this.originalPosition.left+this.originalSize.width,j=this.position.top+ -this.size.height,k=/sw|nw|w/.test(c);c=/nw|ne|n/.test(c);if(g&&k)b.left=i-a.minWidth;if(d&&k)b.left=i-a.maxWidth;if(h&&c)b.top=j-a.minHeight;if(f&&c)b.top=j-a.maxHeight;if((a=!b.width&&!b.height)&&!b.left&&b.top)b.top=null;else if(a&&!b.top&&b.left)b.left=null;return b},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var b=this.helper||this.element,a=0;a
');var a=e.browser.msie&&e.browser.version<7,c=a?1:0;a=a?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+a,height:this.element.outerHeight()+a,position:"absolute",left:this.elementOffset.left-c+"px",top:this.elementOffset.top-c+"px",zIndex:++b.zIndex});this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(b, -a){return{width:this.originalSize.width+a}},w:function(b,a){return{left:this.originalPosition.left+a,width:this.originalSize.width-a}},n:function(b,a,c){return{top:this.originalPosition.top+c,height:this.originalSize.height-c}},s:function(b,a,c){return{height:this.originalSize.height+c}},se:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},sw:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,a, -c]))},ne:function(b,a,c){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},nw:function(b,a,c){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,a,c]))}},_propagate:function(b,a){e.ui.plugin.call(this,b,[a,this.ui()]);b!="resize"&&this._trigger(b,a,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize, -originalPosition:this.originalPosition}}});e.extend(e.ui.resizable,{version:"1.8.11"});e.ui.plugin.add("resizable","alsoResize",{start:function(){var b=e(this).data("resizable").options,a=function(c){e(c).each(function(){var d=e(this);d.data("resizable-alsoresize",{width:parseInt(d.width(),10),height:parseInt(d.height(),10),left:parseInt(d.css("left"),10),top:parseInt(d.css("top"),10),position:d.css("position")})})};if(typeof b.alsoResize=="object"&&!b.alsoResize.parentNode)if(b.alsoResize.length){b.alsoResize= -b.alsoResize[0];a(b.alsoResize)}else e.each(b.alsoResize,function(c){a(c)});else a(b.alsoResize)},resize:function(b,a){var c=e(this).data("resizable");b=c.options;var d=c.originalSize,f=c.originalPosition,g={height:c.size.height-d.height||0,width:c.size.width-d.width||0,top:c.position.top-f.top||0,left:c.position.left-f.left||0},h=function(i,j){e(i).each(function(){var k=e(this),q=e(this).data("resizable-alsoresize"),p={},r=j&&j.length?j:k.parents(a.originalElement[0]).length?["width","height"]:["width", -"height","top","left"];e.each(r,function(n,o){if((n=(q[o]||0)+(g[o]||0))&&n>=0)p[o]=n||null});if(e.browser.opera&&/relative/.test(k.css("position"))){c._revertToRelativePosition=true;k.css({position:"absolute",top:"auto",left:"auto"})}k.css(p)})};typeof b.alsoResize=="object"&&!b.alsoResize.nodeType?e.each(b.alsoResize,function(i,j){h(i,j)}):h(b.alsoResize)},stop:function(){var b=e(this).data("resizable"),a=b.options,c=function(d){e(d).each(function(){var f=e(this);f.css({position:f.data("resizable-alsoresize").position})})}; -if(b._revertToRelativePosition){b._revertToRelativePosition=false;typeof a.alsoResize=="object"&&!a.alsoResize.nodeType?e.each(a.alsoResize,function(d){c(d)}):c(a.alsoResize)}e(this).removeData("resizable-alsoresize")}});e.ui.plugin.add("resizable","animate",{stop:function(b){var a=e(this).data("resizable"),c=a.options,d=a._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName),g=f&&e.ui.hasScroll(d[0],"left")?0:a.sizeDiff.height;f={width:a.size.width-(f?0:a.sizeDiff.width),height:a.size.height- -g};g=parseInt(a.element.css("left"),10)+(a.position.left-a.originalPosition.left)||null;var h=parseInt(a.element.css("top"),10)+(a.position.top-a.originalPosition.top)||null;a.element.animate(e.extend(f,h&&g?{top:h,left:g}:{}),{duration:c.animateDuration,easing:c.animateEasing,step:function(){var i={width:parseInt(a.element.css("width"),10),height:parseInt(a.element.css("height"),10),top:parseInt(a.element.css("top"),10),left:parseInt(a.element.css("left"),10)};d&&d.length&&e(d[0]).css({width:i.width, -height:i.height});a._updateCache(i);a._propagate("resize",b)}})}});e.ui.plugin.add("resizable","containment",{start:function(){var b=e(this).data("resizable"),a=b.element,c=b.options.containment;if(a=c instanceof e?c.get(0):/parent/.test(c)?a.parent().get(0):c){b.containerElement=e(a);if(/document/.test(c)||c==document){b.containerOffset={left:0,top:0};b.containerPosition={left:0,top:0};b.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}}else{var d= -e(a),f=[];e(["Top","Right","Left","Bottom"]).each(function(i,j){f[i]=m(d.css("padding"+j))});b.containerOffset=d.offset();b.containerPosition=d.position();b.containerSize={height:d.innerHeight()-f[3],width:d.innerWidth()-f[1]};c=b.containerOffset;var g=b.containerSize.height,h=b.containerSize.width;h=e.ui.hasScroll(a,"left")?a.scrollWidth:h;g=e.ui.hasScroll(a)?a.scrollHeight:g;b.parentData={element:a,left:c.left,top:c.top,width:h,height:g}}}},resize:function(b){var a=e(this).data("resizable"),c=a.options, -d=a.containerOffset,f=a.position;b=a._aspectRatio||b.shiftKey;var g={top:0,left:0},h=a.containerElement;if(h[0]!=document&&/static/.test(h.css("position")))g=d;if(f.left<(a._helper?d.left:0)){a.size.width+=a._helper?a.position.left-d.left:a.position.left-g.left;if(b)a.size.height=a.size.width/c.aspectRatio;a.position.left=c.helper?d.left:0}if(f.top<(a._helper?d.top:0)){a.size.height+=a._helper?a.position.top-d.top:a.position.top;if(b)a.size.width=a.size.height*c.aspectRatio;a.position.top=a._helper? -d.top:0}a.offset.left=a.parentData.left+a.position.left;a.offset.top=a.parentData.top+a.position.top;c=Math.abs((a._helper?a.offset.left-g.left:a.offset.left-g.left)+a.sizeDiff.width);d=Math.abs((a._helper?a.offset.top-g.top:a.offset.top-d.top)+a.sizeDiff.height);f=a.containerElement.get(0)==a.element.parent().get(0);g=/relative|absolute/.test(a.containerElement.css("position"));if(f&&g)c-=a.parentData.left;if(c+a.size.width>=a.parentData.width){a.size.width=a.parentData.width-c;if(b)a.size.height= -a.size.width/a.aspectRatio}if(d+a.size.height>=a.parentData.height){a.size.height=a.parentData.height-d;if(b)a.size.width=a.size.height*a.aspectRatio}},stop:function(){var b=e(this).data("resizable"),a=b.options,c=b.containerOffset,d=b.containerPosition,f=b.containerElement,g=e(b.helper),h=g.offset(),i=g.outerWidth()-b.sizeDiff.width;g=g.outerHeight()-b.sizeDiff.height;b._helper&&!a.animate&&/relative/.test(f.css("position"))&&e(this).css({left:h.left-d.left-c.left,width:i,height:g});b._helper&&!a.animate&& -/static/.test(f.css("position"))&&e(this).css({left:h.left-d.left-c.left,width:i,height:g})}});e.ui.plugin.add("resizable","ghost",{start:function(){var b=e(this).data("resizable"),a=b.options,c=b.size;b.ghost=b.originalElement.clone();b.ghost.css({opacity:0.25,display:"block",position:"relative",height:c.height,width:c.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof a.ghost=="string"?a.ghost:"");b.ghost.appendTo(b.helper)},resize:function(){var b=e(this).data("resizable"); -b.ghost&&b.ghost.css({position:"relative",height:b.size.height,width:b.size.width})},stop:function(){var b=e(this).data("resizable");b.ghost&&b.helper&&b.helper.get(0).removeChild(b.ghost.get(0))}});e.ui.plugin.add("resizable","grid",{resize:function(){var b=e(this).data("resizable"),a=b.options,c=b.size,d=b.originalSize,f=b.originalPosition,g=b.axis;a.grid=typeof a.grid=="number"?[a.grid,a.grid]:a.grid;var h=Math.round((c.width-d.width)/(a.grid[0]||1))*(a.grid[0]||1);a=Math.round((c.height-d.height)/ -(a.grid[1]||1))*(a.grid[1]||1);if(/^(se|s|e)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a}else if(/^(ne)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}else{if(/^(sw)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a}else{b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}b.position.left=f.left-h}}});var m=function(b){return parseInt(b,10)||0},l=function(b){return!isNaN(parseInt(b,10))}})(jQuery); +/*! jQuery UI - v1.10.2 - 2013-03-14 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ +(function(e){function t(e){return parseInt(e,10)||0}function i(e){return!isNaN(parseInt(e,10))}e.widget("ui.resizable",e.ui.mouse,{version:"1.10.2",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_create:function(){var t,i,s,n,a,o=this,r=this.options;if(this.element.addClass("ui-resizable"),e.extend(this,{_aspectRatio:!!r.aspectRatio,aspectRatio:r.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:r.helper||r.ghost||r.animate?r.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(e("
").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.data("ui-resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=r.handles||(e(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),t=this.handles.split(","),this.handles={},i=0;t.length>i;i++)s=e.trim(t[i]),a="ui-resizable-"+s,n=e("
"),n.css({zIndex:r.zIndex}),"se"===s&&n.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[s]=".ui-resizable-"+s,this.element.append(n);this._renderAxis=function(t){var i,s,n,a;t=t||this.element;for(i in this.handles)this.handles[i].constructor===String&&(this.handles[i]=e(this.handles[i],this.element).show()),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)&&(s=e(this.handles[i],this.element),a=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),t.css(n,a),this._proportionallyResize()),e(this.handles[i]).length},this._renderAxis(this.element),this._handles=e(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){o.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),o.axis=n&&n[1]?n[1]:"se")}),r.autoHide&&(this._handles.hide(),e(this.element).addClass("ui-resizable-autohide").mouseenter(function(){r.disabled||(e(this).removeClass("ui-resizable-autohide"),o._handles.show())}).mouseleave(function(){r.disabled||o.resizing||(e(this).addClass("ui-resizable-autohide"),o._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var t,i=function(t){e(t).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),t=this.element,this.originalElement.css({position:t.css("position"),width:t.outerWidth(),height:t.outerHeight(),top:t.css("top"),left:t.css("left")}).insertAfter(t),t.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_mouseCapture:function(t){var i,s,n=!1;for(i in this.handles)s=e(this.handles[i])[0],(s===t.target||e.contains(s,t.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(i){var s,n,a,o=this.options,r=this.element.position(),h=this.element;return this.resizing=!0,/absolute/.test(h.css("position"))?h.css({position:"absolute",top:h.css("top"),left:h.css("left")}):h.is(".ui-draggable")&&h.css({position:"absolute",top:r.top,left:r.left}),this._renderProxy(),s=t(this.helper.css("left")),n=t(this.helper.css("top")),o.containment&&(s+=e(o.containment).scrollLeft()||0,n+=e(o.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:s,top:n},this.size=this._helper?{width:h.outerWidth(),height:h.outerHeight()}:{width:h.width(),height:h.height()},this.originalSize=this._helper?{width:h.outerWidth(),height:h.outerHeight()}:{width:h.width(),height:h.height()},this.originalPosition={left:s,top:n},this.sizeDiff={width:h.outerWidth()-h.width(),height:h.outerHeight()-h.height()},this.originalMousePosition={left:i.pageX,top:i.pageY},this.aspectRatio="number"==typeof o.aspectRatio?o.aspectRatio:this.originalSize.width/this.originalSize.height||1,a=e(".ui-resizable-"+this.axis).css("cursor"),e("body").css("cursor","auto"===a?this.axis+"-resize":a),h.addClass("ui-resizable-resizing"),this._propagate("start",i),!0},_mouseDrag:function(t){var i,s=this.helper,n={},a=this.originalMousePosition,o=this.axis,r=this.position.top,h=this.position.left,l=this.size.width,u=this.size.height,c=t.pageX-a.left||0,d=t.pageY-a.top||0,p=this._change[o];return p?(i=p.apply(this,[t,c,d]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(i=this._updateRatio(i,t)),i=this._respectSize(i,t),this._updateCache(i),this._propagate("resize",t),this.position.top!==r&&(n.top=this.position.top+"px"),this.position.left!==h&&(n.left=this.position.left+"px"),this.size.width!==l&&(n.width=this.size.width+"px"),this.size.height!==u&&(n.height=this.size.height+"px"),s.css(n),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),e.isEmptyObject(n)||this._trigger("resize",t,this.ui()),!1):!1},_mouseStop:function(t){this.resizing=!1;var i,s,n,a,o,r,h,l=this.options,u=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),n=s&&e.ui.hasScroll(i[0],"left")?0:u.sizeDiff.height,a=s?0:u.sizeDiff.width,o={width:u.helper.width()-a,height:u.helper.height()-n},r=parseInt(u.element.css("left"),10)+(u.position.left-u.originalPosition.left)||null,h=parseInt(u.element.css("top"),10)+(u.position.top-u.originalPosition.top)||null,l.animate||this.element.css(e.extend(o,{top:h,left:r})),u.helper.height(u.size.height),u.helper.width(u.size.width),this._helper&&!l.animate&&this._proportionallyResize()),e("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(e){var t,s,n,a,o,r=this.options;o={minWidth:i(r.minWidth)?r.minWidth:0,maxWidth:i(r.maxWidth)?r.maxWidth:1/0,minHeight:i(r.minHeight)?r.minHeight:0,maxHeight:i(r.maxHeight)?r.maxHeight:1/0},(this._aspectRatio||e)&&(t=o.minHeight*this.aspectRatio,n=o.minWidth/this.aspectRatio,s=o.maxHeight*this.aspectRatio,a=o.maxWidth/this.aspectRatio,t>o.minWidth&&(o.minWidth=t),n>o.minHeight&&(o.minHeight=n),o.maxWidth>s&&(o.maxWidth=s),o.maxHeight>a&&(o.maxHeight=a)),this._vBoundaries=o},_updateCache:function(e){this.offset=this.helper.offset(),i(e.left)&&(this.position.left=e.left),i(e.top)&&(this.position.top=e.top),i(e.height)&&(this.size.height=e.height),i(e.width)&&(this.size.width=e.width)},_updateRatio:function(e){var t=this.position,s=this.size,n=this.axis;return i(e.height)?e.width=e.height*this.aspectRatio:i(e.width)&&(e.height=e.width/this.aspectRatio),"sw"===n&&(e.left=t.left+(s.width-e.width),e.top=null),"nw"===n&&(e.top=t.top+(s.height-e.height),e.left=t.left+(s.width-e.width)),e},_respectSize:function(e){var t=this._vBoundaries,s=this.axis,n=i(e.width)&&t.maxWidth&&t.maxWidthe.width,r=i(e.height)&&t.minHeight&&t.minHeight>e.height,h=this.originalPosition.left+this.originalSize.width,l=this.position.top+this.size.height,u=/sw|nw|w/.test(s),c=/nw|ne|n/.test(s);return o&&(e.width=t.minWidth),r&&(e.height=t.minHeight),n&&(e.width=t.maxWidth),a&&(e.height=t.maxHeight),o&&u&&(e.left=h-t.minWidth),n&&u&&(e.left=h-t.maxWidth),r&&c&&(e.top=l-t.minHeight),a&&c&&(e.top=l-t.maxHeight),e.width||e.height||e.left||!e.top?e.width||e.height||e.top||!e.left||(e.left=null):e.top=null,e},_proportionallyResize:function(){if(this._proportionallyResizeElements.length){var e,t,i,s,n,a=this.helper||this.element;for(e=0;this._proportionallyResizeElements.length>e;e++){if(n=this._proportionallyResizeElements[e],!this.borderDif)for(this.borderDif=[],i=[n.css("borderTopWidth"),n.css("borderRightWidth"),n.css("borderBottomWidth"),n.css("borderLeftWidth")],s=[n.css("paddingTop"),n.css("paddingRight"),n.css("paddingBottom"),n.css("paddingLeft")],t=0;i.length>t;t++)this.borderDif[t]=(parseInt(i[t],10)||0)+(parseInt(s[t],10)||0);n.css({height:a.height()-this.borderDif[0]-this.borderDif[2]||0,width:a.width()-this.borderDif[1]-this.borderDif[3]||0})}}},_renderProxy:function(){var t=this.element,i=this.options;this.elementOffset=t.offset(),this._helper?(this.helper=this.helper||e("
"),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(e,t){return{width:this.originalSize.width+t}},w:function(e,t){var i=this.originalSize,s=this.originalPosition;return{left:s.left+t,width:i.width-t}},n:function(e,t,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+i,height:s.height-i}},s:function(e,t,i){return{height:this.originalSize.height+i}},se:function(t,i,s){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,i,s]))},sw:function(t,i,s){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,i,s]))},ne:function(t,i,s){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,i,s]))},nw:function(t,i,s){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,i,s]))}},_propagate:function(t,i){e.ui.plugin.call(this,t,[i,this.ui()]),"resize"!==t&&this._trigger(t,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),e.ui.plugin.add("resizable","animate",{stop:function(t){var i=e(this).data("ui-resizable"),s=i.options,n=i._proportionallyResizeElements,a=n.length&&/textarea/i.test(n[0].nodeName),o=a&&e.ui.hasScroll(n[0],"left")?0:i.sizeDiff.height,r=a?0:i.sizeDiff.width,h={width:i.size.width-r,height:i.size.height-o},l=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,u=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;i.element.animate(e.extend(h,u&&l?{top:u,left:l}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseInt(i.element.css("width"),10),height:parseInt(i.element.css("height"),10),top:parseInt(i.element.css("top"),10),left:parseInt(i.element.css("left"),10)};n&&n.length&&e(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",t)}})}}),e.ui.plugin.add("resizable","containment",{start:function(){var i,s,n,a,o,r,h,l=e(this).data("ui-resizable"),u=l.options,c=l.element,d=u.containment,p=d instanceof e?d.get(0):/parent/.test(d)?c.parent().get(0):d;p&&(l.containerElement=e(p),/document/.test(d)||d===document?(l.containerOffset={left:0,top:0},l.containerPosition={left:0,top:0},l.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}):(i=e(p),s=[],e(["Top","Right","Left","Bottom"]).each(function(e,n){s[e]=t(i.css("padding"+n))}),l.containerOffset=i.offset(),l.containerPosition=i.position(),l.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]},n=l.containerOffset,a=l.containerSize.height,o=l.containerSize.width,r=e.ui.hasScroll(p,"left")?p.scrollWidth:o,h=e.ui.hasScroll(p)?p.scrollHeight:a,l.parentData={element:p,left:n.left,top:n.top,width:r,height:h}))},resize:function(t){var i,s,n,a,o=e(this).data("ui-resizable"),r=o.options,h=o.containerOffset,l=o.position,u=o._aspectRatio||t.shiftKey,c={top:0,left:0},d=o.containerElement;d[0]!==document&&/static/.test(d.css("position"))&&(c=h),l.left<(o._helper?h.left:0)&&(o.size.width=o.size.width+(o._helper?o.position.left-h.left:o.position.left-c.left),u&&(o.size.height=o.size.width/o.aspectRatio),o.position.left=r.helper?h.left:0),l.top<(o._helper?h.top:0)&&(o.size.height=o.size.height+(o._helper?o.position.top-h.top:o.position.top),u&&(o.size.width=o.size.height*o.aspectRatio),o.position.top=o._helper?h.top:0),o.offset.left=o.parentData.left+o.position.left,o.offset.top=o.parentData.top+o.position.top,i=Math.abs((o._helper?o.offset.left-c.left:o.offset.left-c.left)+o.sizeDiff.width),s=Math.abs((o._helper?o.offset.top-c.top:o.offset.top-h.top)+o.sizeDiff.height),n=o.containerElement.get(0)===o.element.parent().get(0),a=/relative|absolute/.test(o.containerElement.css("position")),n&&a&&(i-=o.parentData.left),i+o.size.width>=o.parentData.width&&(o.size.width=o.parentData.width-i,u&&(o.size.height=o.size.width/o.aspectRatio)),s+o.size.height>=o.parentData.height&&(o.size.height=o.parentData.height-s,u&&(o.size.width=o.size.height*o.aspectRatio))},stop:function(){var t=e(this).data("ui-resizable"),i=t.options,s=t.containerOffset,n=t.containerPosition,a=t.containerElement,o=e(t.helper),r=o.offset(),h=o.outerWidth()-t.sizeDiff.width,l=o.outerHeight()-t.sizeDiff.height;t._helper&&!i.animate&&/relative/.test(a.css("position"))&&e(this).css({left:r.left-n.left-s.left,width:h,height:l}),t._helper&&!i.animate&&/static/.test(a.css("position"))&&e(this).css({left:r.left-n.left-s.left,width:h,height:l})}}),e.ui.plugin.add("resizable","alsoResize",{start:function(){var t=e(this).data("ui-resizable"),i=t.options,s=function(t){e(t).each(function(){var t=e(this);t.data("ui-resizable-alsoresize",{width:parseInt(t.width(),10),height:parseInt(t.height(),10),left:parseInt(t.css("left"),10),top:parseInt(t.css("top"),10)})})};"object"!=typeof i.alsoResize||i.alsoResize.parentNode?s(i.alsoResize):i.alsoResize.length?(i.alsoResize=i.alsoResize[0],s(i.alsoResize)):e.each(i.alsoResize,function(e){s(e)})},resize:function(t,i){var s=e(this).data("ui-resizable"),n=s.options,a=s.originalSize,o=s.originalPosition,r={height:s.size.height-a.height||0,width:s.size.width-a.width||0,top:s.position.top-o.top||0,left:s.position.left-o.left||0},h=function(t,s){e(t).each(function(){var t=e(this),n=e(this).data("ui-resizable-alsoresize"),a={},o=s&&s.length?s:t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(o,function(e,t){var i=(n[t]||0)+(r[t]||0);i&&i>=0&&(a[t]=i||null)}),t.css(a)})};"object"!=typeof n.alsoResize||n.alsoResize.nodeType?h(n.alsoResize):e.each(n.alsoResize,function(e,t){h(e,t)})},stop:function(){e(this).removeData("resizable-alsoresize")}}),e.ui.plugin.add("resizable","ghost",{start:function(){var t=e(this).data("ui-resizable"),i=t.options,s=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:s.height,width:s.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof i.ghost?i.ghost:""),t.ghost.appendTo(t.helper)},resize:function(){var t=e(this).data("ui-resizable");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=e(this).data("ui-resizable");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),e.ui.plugin.add("resizable","grid",{resize:function(){var t=e(this).data("ui-resizable"),i=t.options,s=t.size,n=t.originalSize,a=t.originalPosition,o=t.axis,r="number"==typeof i.grid?[i.grid,i.grid]:i.grid,h=r[0]||1,l=r[1]||1,u=Math.round((s.width-n.width)/h)*h,c=Math.round((s.height-n.height)/l)*l,d=n.width+u,p=n.height+c,f=i.maxWidth&&d>i.maxWidth,m=i.maxHeight&&p>i.maxHeight,g=i.minWidth&&i.minWidth>d,v=i.minHeight&&i.minHeight>p;i.grid=r,g&&(d+=h),v&&(p+=l),f&&(d-=h),m&&(p-=l),/^(se|s|e)$/.test(o)?(t.size.width=d,t.size.height=p):/^(ne)$/.test(o)?(t.size.width=d,t.size.height=p,t.position.top=a.top-c):/^(sw)$/.test(o)?(t.size.width=d,t.size.height=p,t.position.left=a.left-u):(t.size.width=d,t.size.height=p,t.position.top=a.top-c,t.position.left=a.left-u)}})})(jQuery); \ No newline at end of file diff --git a/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.selectable.min.js b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.selectable.min.js index 4b64a43..3f15284 100644 --- a/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.selectable.min.js +++ b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.selectable.min.js @@ -1,22 +1,4 @@ -/* - * jQuery UI Selectable 1.8.11 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Selectables - * - * Depends: - * jquery.ui.core.js - * jquery.ui.mouse.js - * jquery.ui.widget.js - */ -(function(e){e.widget("ui.selectable",e.ui.mouse,{options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch"},_create:function(){var c=this;this.element.addClass("ui-selectable");this.dragged=false;var f;this.refresh=function(){f=e(c.options.filter,c.element[0]);f.each(function(){var d=e(this),b=d.offset();e.data(this,"selectable-item",{element:this,$element:d,left:b.left,top:b.top,right:b.left+d.outerWidth(),bottom:b.top+d.outerHeight(),startselected:false,selected:d.hasClass("ui-selected"), -selecting:d.hasClass("ui-selecting"),unselecting:d.hasClass("ui-unselecting")})})};this.refresh();this.selectees=f.addClass("ui-selectee");this._mouseInit();this.helper=e("
")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item");this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy();return this},_mouseStart:function(c){var f=this;this.opos=[c.pageX, -c.pageY];if(!this.options.disabled){var d=this.options;this.selectees=e(d.filter,this.element[0]);this._trigger("start",c);e(d.appendTo).append(this.helper);this.helper.css({left:c.clientX,top:c.clientY,width:0,height:0});d.autoRefresh&&this.refresh();this.selectees.filter(".ui-selected").each(function(){var b=e.data(this,"selectable-item");b.startselected=true;if(!c.metaKey){b.$element.removeClass("ui-selected");b.selected=false;b.$element.addClass("ui-unselecting");b.unselecting=true;f._trigger("unselecting", -c,{unselecting:b.element})}});e(c.target).parents().andSelf().each(function(){var b=e.data(this,"selectable-item");if(b){var g=!c.metaKey||!b.$element.hasClass("ui-selected");b.$element.removeClass(g?"ui-unselecting":"ui-selected").addClass(g?"ui-selecting":"ui-unselecting");b.unselecting=!g;b.selecting=g;(b.selected=g)?f._trigger("selecting",c,{selecting:b.element}):f._trigger("unselecting",c,{unselecting:b.element});return false}})}},_mouseDrag:function(c){var f=this;this.dragged=true;if(!this.options.disabled){var d= -this.options,b=this.opos[0],g=this.opos[1],h=c.pageX,i=c.pageY;if(b>h){var j=h;h=b;b=j}if(g>i){j=i;i=g;g=j}this.helper.css({left:b,top:g,width:h-b,height:i-g});this.selectees.each(function(){var a=e.data(this,"selectable-item");if(!(!a||a.element==f.element[0])){var k=false;if(d.tolerance=="touch")k=!(a.left>h||a.righti||a.bottomb&&a.rightg&&a.bottom
")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(t){var i=this,s=this.options;this.opos=[t.pageX,t.pageY],this.options.disabled||(this.selectees=e(s.filter,this.element[0]),this._trigger("start",t),e(s.appendTo).append(this.helper),this.helper.css({left:t.pageX,top:t.pageY,width:0,height:0}),s.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var s=e.data(this,"selectable-item");s.startselected=!0,t.metaKey||t.ctrlKey||(s.$element.removeClass("ui-selected"),s.selected=!1,s.$element.addClass("ui-unselecting"),s.unselecting=!0,i._trigger("unselecting",t,{unselecting:s.element}))}),e(t.target).parents().addBack().each(function(){var s,n=e.data(this,"selectable-item");return n?(s=!t.metaKey&&!t.ctrlKey||!n.$element.hasClass("ui-selected"),n.$element.removeClass(s?"ui-unselecting":"ui-selected").addClass(s?"ui-selecting":"ui-unselecting"),n.unselecting=!s,n.selecting=s,n.selected=s,s?i._trigger("selecting",t,{selecting:n.element}):i._trigger("unselecting",t,{unselecting:n.element}),!1):undefined}))},_mouseDrag:function(t){if(this.dragged=!0,!this.options.disabled){var i,s=this,n=this.options,a=this.opos[0],o=this.opos[1],r=t.pageX,h=t.pageY;return a>r&&(i=r,r=a,a=i),o>h&&(i=h,h=o,o=i),this.helper.css({left:a,top:o,width:r-a,height:h-o}),this.selectees.each(function(){var i=e.data(this,"selectable-item"),l=!1;i&&i.element!==s.element[0]&&("touch"===n.tolerance?l=!(i.left>r||a>i.right||i.top>h||o>i.bottom):"fit"===n.tolerance&&(l=i.left>a&&r>i.right&&i.top>o&&h>i.bottom),l?(i.selected&&(i.$element.removeClass("ui-selected"),i.selected=!1),i.unselecting&&(i.$element.removeClass("ui-unselecting"),i.unselecting=!1),i.selecting||(i.$element.addClass("ui-selecting"),i.selecting=!0,s._trigger("selecting",t,{selecting:i.element}))):(i.selecting&&((t.metaKey||t.ctrlKey)&&i.startselected?(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.$element.addClass("ui-selected"),i.selected=!0):(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.startselected&&(i.$element.addClass("ui-unselecting"),i.unselecting=!0),s._trigger("unselecting",t,{unselecting:i.element}))),i.selected&&(t.metaKey||t.ctrlKey||i.startselected||(i.$element.removeClass("ui-selected"),i.selected=!1,i.$element.addClass("ui-unselecting"),i.unselecting=!0,s._trigger("unselecting",t,{unselecting:i.element})))))}),!1}},_mouseStop:function(t){var i=this;return this.dragged=!1,e(".ui-unselecting",this.element[0]).each(function(){var s=e.data(this,"selectable-item");s.$element.removeClass("ui-unselecting"),s.unselecting=!1,s.startselected=!1,i._trigger("unselected",t,{unselected:s.element})}),e(".ui-selecting",this.element[0]).each(function(){var s=e.data(this,"selectable-item");s.$element.removeClass("ui-selecting").addClass("ui-selected"),s.selecting=!1,s.selected=!0,s.startselected=!0,i._trigger("selected",t,{selected:s.element})}),this._trigger("stop",t),this.helper.remove(),!1}})})(jQuery); \ No newline at end of file diff --git a/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.slider.min.js b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.slider.min.js index 2714014..25cbc4b 100644 --- a/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.slider.min.js +++ b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.slider.min.js @@ -1,33 +1,4 @@ -/* - * jQuery UI Slider 1.8.11 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Slider - * - * Depends: - * jquery.ui.core.js - * jquery.ui.mouse.js - * jquery.ui.widget.js - */ -(function(d){d.widget("ui.slider",d.ui.mouse,{widgetEventPrefix:"slide",options:{animate:false,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null},_create:function(){var b=this,a=this.options;this._mouseSliding=this._keySliding=false;this._animateOff=true;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all");a.disabled&&this.element.addClass("ui-slider-disabled ui-disabled"); -this.range=d([]);if(a.range){if(a.range===true){this.range=d("
");if(!a.values)a.values=[this._valueMin(),this._valueMin()];if(a.values.length&&a.values.length!==2)a.values=[a.values[0],a.values[0]]}else this.range=d("
");this.range.appendTo(this.element).addClass("ui-slider-range");if(a.range==="min"||a.range==="max")this.range.addClass("ui-slider-range-"+a.range);this.range.addClass("ui-widget-header")}d(".ui-slider-handle",this.element).length===0&&d("").appendTo(this.element).addClass("ui-slider-handle"); -if(a.values&&a.values.length)for(;d(".ui-slider-handle",this.element).length").appendTo(this.element).addClass("ui-slider-handle");this.handles=d(".ui-slider-handle",this.element).addClass("ui-state-default ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(c){c.preventDefault()}).hover(function(){a.disabled||d(this).addClass("ui-state-hover")},function(){d(this).removeClass("ui-state-hover")}).focus(function(){if(a.disabled)d(this).blur(); -else{d(".ui-slider .ui-state-focus").removeClass("ui-state-focus");d(this).addClass("ui-state-focus")}}).blur(function(){d(this).removeClass("ui-state-focus")});this.handles.each(function(c){d(this).data("index.ui-slider-handle",c)});this.handles.keydown(function(c){var e=true,f=d(this).data("index.ui-slider-handle"),h,g,i;if(!b.options.disabled){switch(c.keyCode){case d.ui.keyCode.HOME:case d.ui.keyCode.END:case d.ui.keyCode.PAGE_UP:case d.ui.keyCode.PAGE_DOWN:case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:e= -false;if(!b._keySliding){b._keySliding=true;d(this).addClass("ui-state-active");h=b._start(c,f);if(h===false)return}break}i=b.options.step;h=b.options.values&&b.options.values.length?(g=b.values(f)):(g=b.value());switch(c.keyCode){case d.ui.keyCode.HOME:g=b._valueMin();break;case d.ui.keyCode.END:g=b._valueMax();break;case d.ui.keyCode.PAGE_UP:g=b._trimAlignValue(h+(b._valueMax()-b._valueMin())/5);break;case d.ui.keyCode.PAGE_DOWN:g=b._trimAlignValue(h-(b._valueMax()-b._valueMin())/5);break;case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:if(h=== -b._valueMax())return;g=b._trimAlignValue(h+i);break;case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:if(h===b._valueMin())return;g=b._trimAlignValue(h-i);break}b._slide(c,f,g);return e}}).keyup(function(c){var e=d(this).data("index.ui-slider-handle");if(b._keySliding){b._keySliding=false;b._stop(c,e);b._change(c,e);d(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider"); -this._mouseDestroy();return this},_mouseCapture:function(b){var a=this.options,c,e,f,h,g;if(a.disabled)return false;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();c=this._normValueFromMouse({x:b.pageX,y:b.pageY});e=this._valueMax()-this._valueMin()+1;h=this;this.handles.each(function(i){var j=Math.abs(c-h.values(i));if(e>j){e=j;f=d(this);g=i}});if(a.range===true&&this.values(1)===a.min){g+=1;f=d(this.handles[g])}if(this._start(b, -g)===false)return false;this._mouseSliding=true;h._handleIndex=g;f.addClass("ui-state-active").focus();a=f.offset();this._clickOffset=!d(b.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:b.pageX-a.left-f.width()/2,top:b.pageY-a.top-f.height()/2-(parseInt(f.css("borderTopWidth"),10)||0)-(parseInt(f.css("borderBottomWidth"),10)||0)+(parseInt(f.css("marginTop"),10)||0)};this.handles.hasClass("ui-state-hover")||this._slide(b,g,c);return this._animateOff=true},_mouseStart:function(){return true}, -_mouseDrag:function(b){var a=this._normValueFromMouse({x:b.pageX,y:b.pageY});this._slide(b,this._handleIndex,a);return false},_mouseStop:function(b){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(b,this._handleIndex);this._change(b,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(b){var a; -if(this.orientation==="horizontal"){a=this.elementSize.width;b=b.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{a=this.elementSize.height;b=b.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}a=b/a;if(a>1)a=1;if(a<0)a=0;if(this.orientation==="vertical")a=1-a;b=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+a*b)},_start:function(b,a){var c={handle:this.handles[a],value:this.value()};if(this.options.values&&this.options.values.length){c.value= -this.values(a);c.values=this.values()}return this._trigger("start",b,c)},_slide:function(b,a,c){var e;if(this.options.values&&this.options.values.length){e=this.values(a?0:1);if(this.options.values.length===2&&this.options.range===true&&(a===0&&c>e||a===1&&c1){this.options.values[b]=this._trimAlignValue(a);this._refreshValue();this._change(null,b)}if(arguments.length)if(d.isArray(arguments[0])){c=this.options.values;e=arguments[0];for(f=0;f=this._valueMax())return this._valueMax();var a=this.options.step>0?this.options.step:1,c=(b-this._valueMin())%a;alignValue=b-c;if(Math.abs(c)*2>=a)alignValue+=c>0?a:-a;return parseFloat(alignValue.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max}, -_refreshValue:function(){var b=this.options.range,a=this.options,c=this,e=!this._animateOff?a.animate:false,f,h={},g,i,j,l;if(this.options.values&&this.options.values.length)this.handles.each(function(k){f=(c.values(k)-c._valueMin())/(c._valueMax()-c._valueMin())*100;h[c.orientation==="horizontal"?"left":"bottom"]=f+"%";d(this).stop(1,1)[e?"animate":"css"](h,a.animate);if(c.options.range===true)if(c.orientation==="horizontal"){if(k===0)c.range.stop(1,1)[e?"animate":"css"]({left:f+"%"},a.animate); -if(k===1)c.range[e?"animate":"css"]({width:f-g+"%"},{queue:false,duration:a.animate})}else{if(k===0)c.range.stop(1,1)[e?"animate":"css"]({bottom:f+"%"},a.animate);if(k===1)c.range[e?"animate":"css"]({height:f-g+"%"},{queue:false,duration:a.animate})}g=f});else{i=this.value();j=this._valueMin();l=this._valueMax();f=l!==j?(i-j)/(l-j)*100:0;h[c.orientation==="horizontal"?"left":"bottom"]=f+"%";this.handle.stop(1,1)[e?"animate":"css"](h,a.animate);if(b==="min"&&this.orientation==="horizontal")this.range.stop(1, -1)[e?"animate":"css"]({width:f+"%"},a.animate);if(b==="max"&&this.orientation==="horizontal")this.range[e?"animate":"css"]({width:100-f+"%"},{queue:false,duration:a.animate});if(b==="min"&&this.orientation==="vertical")this.range.stop(1,1)[e?"animate":"css"]({height:f+"%"},a.animate);if(b==="max"&&this.orientation==="vertical")this.range[e?"animate":"css"]({height:100-f+"%"},{queue:false,duration:a.animate})}}});d.extend(d.ui.slider,{version:"1.8.11"})})(jQuery); +/*! jQuery UI - v1.10.2 - 2013-03-14 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ +(function(t){var e=5;t.widget("ui.slider",t.ui.mouse,{version:"1.10.2",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"),this._refresh(),this._setOption("disabled",this.options.disabled),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var e,i,s=this.options,n=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),a="",o=[];for(i=s.values&&s.values.length||1,n.length>i&&(n.slice(i).remove(),n=n.slice(0,i)),e=n.length;i>e;e++)o.push(a);this.handles=n.add(t(o.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.each(function(e){t(this).data("ui-slider-handle-index",e)})},_createRange:function(){var e=this.options,i="";e.range?(e.range===!0&&(e.values?e.values.length&&2!==e.values.length?e.values=[e.values[0],e.values[0]]:t.isArray(e.values)&&(e.values=e.values.slice(0)):e.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({left:"",bottom:""}):(this.range=t("
").appendTo(this.element),i="ui-slider-range ui-widget-header ui-corner-all"),this.range.addClass(i+("min"===e.range||"max"===e.range?" ui-slider-range-"+e.range:""))):this.range=t([])},_setupEvents:function(){var t=this.handles.add(this.range).filter("a");this._off(t),this._on(t,this._handleEvents),this._hoverable(t),this._focusable(t)},_destroy:function(){this.handles.remove(),this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(e){var i,s,n,a,o,r,h,l,u=this,c=this.options;return c.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:e.pageX,y:e.pageY},s=this._normValueFromMouse(i),n=this._valueMax()-this._valueMin()+1,this.handles.each(function(e){var i=Math.abs(s-u.values(e));(n>i||n===i&&(e===u._lastChangedValue||u.values(e)===c.min))&&(n=i,a=t(this),o=e)}),r=this._start(e,o),r===!1?!1:(this._mouseSliding=!0,this._handleIndex=o,a.addClass("ui-state-active").focus(),h=a.offset(),l=!t(e.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:e.pageX-h.left-a.width()/2,top:e.pageY-h.top-a.height()/2-(parseInt(a.css("borderTopWidth"),10)||0)-(parseInt(a.css("borderBottomWidth"),10)||0)+(parseInt(a.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(e,o,s),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},i=this._normValueFromMouse(e);return this._slide(t,this._handleIndex,i),!1},_mouseStop:function(t){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(t,this._handleIndex),this._change(t,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(t){var e,i,s,n,a;return"horizontal"===this.orientation?(e=this.elementSize.width,i=t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,i=t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),s=i/e,s>1&&(s=1),0>s&&(s=0),"vertical"===this.orientation&&(s=1-s),n=this._valueMax()-this._valueMin(),a=this._valueMin()+s*n,this._trimAlignValue(a)},_start:function(t,e){var i={handle:this.handles[e],value:this.value()};return this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("start",t,i)},_slide:function(t,e,i){var s,n,a;this.options.values&&this.options.values.length?(s=this.values(e?0:1),2===this.options.values.length&&this.options.range===!0&&(0===e&&i>s||1===e&&s>i)&&(i=s),i!==this.values(e)&&(n=this.values(),n[e]=i,a=this._trigger("slide",t,{handle:this.handles[e],value:i,values:n}),s=this.values(e?0:1),a!==!1&&this.values(e,i,!0))):i!==this.value()&&(a=this._trigger("slide",t,{handle:this.handles[e],value:i}),a!==!1&&this.value(i))},_stop:function(t,e){var i={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("stop",t,i)},_change:function(t,e){if(!this._keySliding&&!this._mouseSliding){var i={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._lastChangedValue=e,this._trigger("change",t,i)}},value:function(t){return arguments.length?(this.options.value=this._trimAlignValue(t),this._refreshValue(),this._change(null,0),undefined):this._value()},values:function(e,i){var s,n,a;if(arguments.length>1)return this.options.values[e]=this._trimAlignValue(i),this._refreshValue(),this._change(null,e),undefined;if(!arguments.length)return this._values();if(!t.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(e):this.value();for(s=this.options.values,n=arguments[0],a=0;s.length>a;a+=1)s[a]=this._trimAlignValue(n[a]),this._change(null,a);this._refreshValue()},_setOption:function(e,i){var s,n=0;switch("range"===e&&this.options.range===!0&&("min"===i?(this.options.value=this._values(0),this.options.values=null):"max"===i&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),t.isArray(this.options.values)&&(n=this.options.values.length),t.Widget.prototype._setOption.apply(this,arguments),e){case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),s=0;n>s;s+=1)this._change(null,s);this._animateOff=!1;break;case"min":case"max":this._animateOff=!0,this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_value:function(){var t=this.options.value;return t=this._trimAlignValue(t)},_values:function(t){var e,i,s;if(arguments.length)return e=this.options.values[t],e=this._trimAlignValue(e);if(this.options.values&&this.options.values.length){for(i=this.options.values.slice(),s=0;i.length>s;s+=1)i[s]=this._trimAlignValue(i[s]);return i}return[]},_trimAlignValue:function(t){if(this._valueMin()>=t)return this._valueMin();if(t>=this._valueMax())return this._valueMax();var e=this.options.step>0?this.options.step:1,i=(t-this._valueMin())%e,s=t-i;return 2*Math.abs(i)>=e&&(s+=i>0?e:-e),parseFloat(s.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var e,i,s,n,a,o=this.options.range,r=this.options,h=this,l=this._animateOff?!1:r.animate,u={};this.options.values&&this.options.values.length?this.handles.each(function(s){i=100*((h.values(s)-h._valueMin())/(h._valueMax()-h._valueMin())),u["horizontal"===h.orientation?"left":"bottom"]=i+"%",t(this).stop(1,1)[l?"animate":"css"](u,r.animate),h.options.range===!0&&("horizontal"===h.orientation?(0===s&&h.range.stop(1,1)[l?"animate":"css"]({left:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({width:i-e+"%"},{queue:!1,duration:r.animate})):(0===s&&h.range.stop(1,1)[l?"animate":"css"]({bottom:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({height:i-e+"%"},{queue:!1,duration:r.animate}))),e=i}):(s=this.value(),n=this._valueMin(),a=this._valueMax(),i=a!==n?100*((s-n)/(a-n)):0,u["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[l?"animate":"css"](u,r.animate),"min"===o&&"horizontal"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({width:i+"%"},r.animate),"max"===o&&"horizontal"===this.orientation&&this.range[l?"animate":"css"]({width:100-i+"%"},{queue:!1,duration:r.animate}),"min"===o&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:i+"%"},r.animate),"max"===o&&"vertical"===this.orientation&&this.range[l?"animate":"css"]({height:100-i+"%"},{queue:!1,duration:r.animate}))},_handleEvents:{keydown:function(i){var s,n,a,o,r=t(i.target).data("ui-slider-handle-index");switch(i.keyCode){case t.ui.keyCode.HOME:case t.ui.keyCode.END:case t.ui.keyCode.PAGE_UP:case t.ui.keyCode.PAGE_DOWN:case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(i.preventDefault(),!this._keySliding&&(this._keySliding=!0,t(i.target).addClass("ui-state-active"),s=this._start(i,r),s===!1))return}switch(o=this.options.step,n=a=this.options.values&&this.options.values.length?this.values(r):this.value(),i.keyCode){case t.ui.keyCode.HOME:a=this._valueMin();break;case t.ui.keyCode.END:a=this._valueMax();break;case t.ui.keyCode.PAGE_UP:a=this._trimAlignValue(n+(this._valueMax()-this._valueMin())/e);break;case t.ui.keyCode.PAGE_DOWN:a=this._trimAlignValue(n-(this._valueMax()-this._valueMin())/e);break;case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:if(n===this._valueMax())return;a=this._trimAlignValue(n+o);break;case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(n===this._valueMin())return;a=this._trimAlignValue(n-o)}this._slide(i,r,a)},click:function(t){t.preventDefault()},keyup:function(e){var i=t(e.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(e,i),this._change(e,i),t(e.target).removeClass("ui-state-active"))}}})})(jQuery); \ No newline at end of file diff --git a/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.sortable.min.js b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.sortable.min.js index d42ebaf..ee3388b 100644 --- a/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.sortable.min.js +++ b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.sortable.min.js @@ -1,60 +1,4 @@ -/* - * jQuery UI Sortable 1.8.11 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Sortables - * - * Depends: - * jquery.ui.core.js - * jquery.ui.mouse.js - * jquery.ui.widget.js - */ -(function(d){d.widget("ui.sortable",d.ui.mouse,{widgetEventPrefix:"sort",options:{appendTo:"parent",axis:false,connectWith:false,containment:false,cursor:"auto",cursorAt:false,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1E3},_create:function(){this.containerCache={};this.element.addClass("ui-sortable"); -this.refresh();this.floating=this.items.length?/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var a=this.items.length-1;a>=0;a--)this.items[a].item.removeData("sortable-item");return this},_setOption:function(a,b){if(a==="disabled"){this.options[a]= -b;this.widget()[b?"addClass":"removeClass"]("ui-sortable-disabled")}else d.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(a,b){if(this.reverting)return false;if(this.options.disabled||this.options.type=="static")return false;this._refreshItems(a);var c=null,e=this;d(a.target).parents().each(function(){if(d.data(this,"sortable-item")==e){c=d(this);return false}});if(d.data(a.target,"sortable-item")==e)c=d(a.target);if(!c)return false;if(this.options.handle&&!b){var f=false; -d(this.options.handle,c).find("*").andSelf().each(function(){if(this==a.target)f=true});if(!f)return false}this.currentItem=c;this._removeCurrentsFromItems();return true},_mouseStart:function(a,b,c){b=this.options;var e=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(a);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left- -this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]}; -this.helper[0]!=this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();b.containment&&this._setContainment();if(b.cursor){if(d("body").css("cursor"))this._storedCursor=d("body").css("cursor");d("body").css("cursor",b.cursor)}if(b.opacity){if(this.helper.css("opacity"))this._storedOpacity=this.helper.css("opacity");this.helper.css("opacity",b.opacity)}if(b.zIndex){if(this.helper.css("zIndex"))this._storedZIndex=this.helper.css("zIndex");this.helper.css("zIndex",b.zIndex)}if(this.scrollParent[0]!= -document&&this.scrollParent[0].tagName!="HTML")this.overflowOffset=this.scrollParent.offset();this._trigger("start",a,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!c)for(c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("activate",a,e._uiHash(this));if(d.ui.ddmanager)d.ui.ddmanager.current=this;d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(a); -return true},_mouseDrag:function(a){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs)this.lastPositionAbs=this.positionAbs;if(this.options.scroll){var b=this.options,c=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-a.pageY=0;b--){c=this.items[b];var e=c.item[0],f=this._intersectsWithPointer(c);if(f)if(e!=this.currentItem[0]&&this.placeholder[f==1?"next":"prev"]()[0]!=e&&!d.ui.contains(this.placeholder[0],e)&&(this.options.type=="semi-dynamic"?!d.ui.contains(this.element[0], -e):true)){this.direction=f==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(c))this._rearrange(a,c);else break;this._trigger("change",a,this._uiHash());break}}this._contactContainers(a);d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);this._trigger("sort",a,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(a,b){if(a){d.ui.ddmanager&&!this.options.dropBehaviour&&d.ui.ddmanager.drop(this,a);if(this.options.revert){var c=this;b=c.placeholder.offset(); -c.reverting=true;d(this.helper).animate({left:b.left-this.offset.parent.left-c.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:b.top-this.offset.parent.top-c.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){c._clear(a)})}else this._clear(a,b);return false}},cancel:function(){var a=this;if(this.dragging){this._mouseUp({target:null});this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"): -this.currentItem.show();for(var b=this.containers.length-1;b>=0;b--){this.containers[b]._trigger("deactivate",null,a._uiHash(this));if(this.containers[b].containerCache.over){this.containers[b]._trigger("out",null,a._uiHash(this));this.containers[b].containerCache.over=0}}}if(this.placeholder){this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove();d.extend(this,{helper:null, -dragging:false,reverting:false,_noFinalSort:null});this.domPosition.prev?d(this.domPosition.prev).after(this.currentItem):d(this.domPosition.parent).prepend(this.currentItem)}return this},serialize:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};d(b).each(function(){var e=(d(a.item||this).attr(a.attribute||"id")||"").match(a.expression||/(.+)[-=_](.+)/);if(e)c.push((a.key||e[1]+"[]")+"="+(a.key&&a.expression?e[1]:e[2]))});!c.length&&a.key&&c.push(a.key+"=");return c.join("&")}, -toArray:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};b.each(function(){c.push(d(a.item||this).attr(a.attribute||"id")||"")});return c},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,e=this.positionAbs.top,f=e+this.helperProportions.height,g=a.left,h=g+a.width,i=a.top,k=i+a.height,j=this.offset.click.top,l=this.offset.click.left;j=e+j>i&&e+jg&&b+la[this.floating?"width":"height"]?j:g0?"down":"up")},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){this._refreshItems(a);this.refreshPositions();return this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(a){var b=[],c=[],e=this._connectWith(); -if(e&&a)for(a=e.length-1;a>=0;a--)for(var f=d(e[a]),g=f.length-1;g>=0;g--){var h=d.data(f[g],"sortable");if(h&&h!=this&&!h.options.disabled)c.push([d.isFunction(h.options.items)?h.options.items.call(h.element):d(h.options.items,h.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),h])}c.push([d.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):d(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), -this]);for(a=c.length-1;a>=0;a--)c[a][0].each(function(){b.push(this)});return d(b)},_removeCurrentsFromItems:function(){for(var a=this.currentItem.find(":data(sortable-item)"),b=0;b=0;f--)for(var g=d(e[f]),h=g.length-1;h>=0;h--){var i=d.data(g[h],"sortable");if(i&&i!=this&&!i.options.disabled){c.push([d.isFunction(i.options.items)?i.options.items.call(i.element[0],a,{item:this.currentItem}):d(i.options.items,i.element),i]);this.containers.push(i)}}for(f=c.length-1;f>=0;f--){a=c[f][1];e=c[f][0];h=0;for(g=e.length;h=0;b--){var c=this.items[b],e=this.options.toleranceElement?d(this.options.toleranceElement,c.item):c.item;if(!a){c.width=e.outerWidth();c.height=e.outerHeight()}e=e.offset();c.left=e.left;c.top=e.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(b=this.containers.length-1;b>=0;b--){e=this.containers[b].element.offset();this.containers[b].containerCache.left= -e.left;this.containers[b].containerCache.top=e.top;this.containers[b].containerCache.width=this.containers[b].element.outerWidth();this.containers[b].containerCache.height=this.containers[b].element.outerHeight()}return this},_createPlaceholder:function(a){var b=a||this,c=b.options;if(!c.placeholder||c.placeholder.constructor==String){var e=c.placeholder;c.placeholder={element:function(){var f=d(document.createElement(b.currentItem[0].nodeName)).addClass(e||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0]; -if(!e)f.style.visibility="hidden";return f},update:function(f,g){if(!(e&&!c.forcePlaceholderSize)){g.height()||g.height(b.currentItem.innerHeight()-parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10));g.width()||g.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")||0,10))}}}}b.placeholder=d(c.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder); -c.placeholder.update(b,b.placeholder)},_contactContainers:function(a){for(var b=null,c=null,e=this.containers.length-1;e>=0;e--)if(!d.ui.contains(this.currentItem[0],this.containers[e].element[0]))if(this._intersectsWith(this.containers[e].containerCache)){if(!(b&&d.ui.contains(this.containers[e].element[0],b.element[0]))){b=this.containers[e];c=e}}else if(this.containers[e].containerCache.over){this.containers[e]._trigger("out",a,this._uiHash(this));this.containers[e].containerCache.over=0}if(b)if(this.containers.length=== -1){this.containers[c]._trigger("over",a,this._uiHash(this));this.containers[c].containerCache.over=1}else if(this.currentContainer!=this.containers[c]){b=1E4;e=null;for(var f=this.positionAbs[this.containers[c].floating?"left":"top"],g=this.items.length-1;g>=0;g--)if(d.ui.contains(this.containers[c].element[0],this.items[g].item[0])){var h=this.items[g][this.containers[c].floating?"left":"top"];if(Math.abs(h-f)this.containment[2])f=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g-this.originalPageY)/b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.top< -this.containment[1]||g-this.offset.click.top>this.containment[3])?g:!(g-this.offset.click.topthis.containment[2])?f:!(f-this.offset.click.left=0;e--)if(d.ui.contains(this.containers[e].element[0], -this.currentItem[0])&&!b){c.push(function(f){return function(g){f._trigger("receive",g,this._uiHash(this))}}.call(this,this.containers[e]));c.push(function(f){return function(g){f._trigger("update",g,this._uiHash(this))}}.call(this,this.containers[e]))}}for(e=this.containers.length-1;e>=0;e--){b||c.push(function(f){return function(g){f._trigger("deactivate",g,this._uiHash(this))}}.call(this,this.containers[e]));if(this.containers[e].containerCache.over){c.push(function(f){return function(g){f._trigger("out", -g,this._uiHash(this))}}.call(this,this.containers[e]));this.containers[e].containerCache.over=0}}this._storedCursor&&d("body").css("cursor",this._storedCursor);this._storedOpacity&&this.helper.css("opacity",this._storedOpacity);if(this._storedZIndex)this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex);this.dragging=false;if(this.cancelHelperRemoval){if(!b){this._trigger("beforeStop",a,this._uiHash());for(e=0;ee&&e+i>t}function i(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))}t.widget("ui.sortable",t.ui.mouse,{version:"1.10.2",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_create:function(){var t=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?"x"===t.axis||i(this.items[0].item):!1,this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_setOption:function(e,i){"disabled"===e?(this.options[e]=i,this.widget().toggleClass("ui-sortable-disabled",!!i)):t.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(e,i){var s=null,n=!1,a=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(e),t(e.target).parents().each(function(){return t.data(this,a.widgetName+"-item")===a?(s=t(this),!1):undefined}),t.data(e.target,a.widgetName+"-item")===a&&(s=t(e.target)),s?!this.options.handle||i||(t(this.options.handle,s).find("*").addBack().each(function(){this===e.target&&(n=!0)}),n)?(this.currentItem=s,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(e,i,s){var n,a,o=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(e),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),o.containment&&this._setContainment(),o.cursor&&"auto"!==o.cursor&&(a=this.document.find("body"),this.storedCursor=a.css("cursor"),a.css("cursor",o.cursor),this.storedStylesheet=t("").appendTo(a)),o.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",o.opacity)),o.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",o.zIndex)),this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(n=this.containers.length-1;n>=0;n--)this.containers[n]._trigger("activate",e,this._uiHash(this));return t.ui.ddmanager&&(t.ui.ddmanager.current=this),t.ui.ddmanager&&!o.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(e),!0},_mouseDrag:function(e){var i,s,n,a,o=this.options,r=!1;for(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY=0;i--)if(s=this.items[i],n=s.item[0],a=this._intersectsWithPointer(s),a&&s.instance===this.currentContainer&&n!==this.currentItem[0]&&this.placeholder[1===a?"next":"prev"]()[0]!==n&&!t.contains(this.placeholder[0],n)&&("semi-dynamic"===this.options.type?!t.contains(this.element[0],n):!0)){if(this.direction=1===a?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break;this._rearrange(e,s),this._trigger("change",e,this._uiHash());break}return this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,i){if(e){if(t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e),this.options.revert){var s=this,n=this.placeholder.offset(),a=this.options.axis,o={};a&&"x"!==a||(o.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollLeft)),a&&"y"!==a||(o.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,t(this.helper).animate(o,parseInt(this.options.revert,10)||500,function(){s._clear(e)})}else this._clear(e,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("deactivate",null,this._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",null,this._uiHash(this)),this.containers[e].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},t(i).each(function(){var i=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);i&&s.push((e.key||i[1]+"[]")+"="+(e.key&&e.expression?i[1]:i[2]))}),!s.length&&e.key&&s.push(e.key+"="),s.join("&")},toArray:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},i.each(function(){s.push(t(e.item||this).attr(e.attribute||"id")||"")}),s},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,a=t.left,o=a+t.width,r=t.top,h=r+t.height,l=this.offset.click.top,c=this.offset.click.left,u=s+l>r&&h>s+l&&e+c>a&&o>e+c;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?u:e+this.helperProportions.width/2>a&&o>i-this.helperProportions.width/2&&s+this.helperProportions.height/2>r&&h>n-this.helperProportions.height/2},_intersectsWithPointer:function(t){var i="x"===this.options.axis||e(this.positionAbs.top+this.offset.click.top,t.top,t.height),s="y"===this.options.axis||e(this.positionAbs.left+this.offset.click.left,t.left,t.width),n=i&&s,a=this._getDragVerticalDirection(),o=this._getDragHorizontalDirection();return n?this.floating?o&&"right"===o||"down"===a?2:1:a&&("down"===a?2:1):!1},_intersectsWithSides:function(t){var i=e(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),s=e(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),n=this._getDragVerticalDirection(),a=this._getDragHorizontalDirection();return this.floating&&a?"right"===a&&s||"left"===a&&!s:n&&("down"===n&&i||"up"===n&&!i)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!==t&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!==t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){var i,s,n,a,o=[],r=[],h=this._connectWith();if(h&&e)for(i=h.length-1;i>=0;i--)for(n=t(h[i]),s=n.length-1;s>=0;s--)a=t.data(n[s],this.widgetFullName),a&&a!==this&&!a.options.disabled&&r.push([t.isFunction(a.options.items)?a.options.items.call(a.element):t(a.options.items,a.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),a]);for(r.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),i=r.length-1;i>=0;i--)r[i][0].each(function(){o.push(this)});return t(o)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,function(t){for(var i=0;e.length>i;i++)if(e[i]===t.item[0])return!1;return!0})},_refreshItems:function(e){this.items=[],this.containers=[this];var i,s,n,a,o,r,h,l,c=this.items,u=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],d=this._connectWith();if(d&&this.ready)for(i=d.length-1;i>=0;i--)for(n=t(d[i]),s=n.length-1;s>=0;s--)a=t.data(n[s],this.widgetFullName),a&&a!==this&&!a.options.disabled&&(u.push([t.isFunction(a.options.items)?a.options.items.call(a.element[0],e,{item:this.currentItem}):t(a.options.items,a.element),a]),this.containers.push(a));for(i=u.length-1;i>=0;i--)for(o=u[i][1],r=u[i][0],s=0,l=r.length;l>s;s++)h=t(r[s]),h.data(this.widgetName+"-item",o),c.push({item:h,instance:o,width:0,height:0,left:0,top:0})},refreshPositions:function(e){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,s,n,a;for(i=this.items.length-1;i>=0;i--)s=this.items[i],s.instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]||(n=this.options.toleranceElement?t(this.options.toleranceElement,s.item):s.item,e||(s.width=n.outerWidth(),s.height=n.outerHeight()),a=n.offset(),s.left=a.left,s.top=a.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)a=this.containers[i].element.offset(),this.containers[i].containerCache.left=a.left,this.containers[i].containerCache.top=a.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(e){e=e||this;var i,s=e.options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=e.currentItem[0].nodeName.toLowerCase(),n=t(e.document[0].createElement(s)).addClass(i||e.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tr"===s?n.append(" "):"img"===s&&n.attr("src",e.currentItem.attr("src")),i||n.css("visibility","hidden"),n},update:function(t,n){(!i||s.forcePlaceholderSize)&&(n.height()||n.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10)))}}),e.placeholder=t(s.placeholder.element.call(e.element,e.currentItem)),e.currentItem.after(e.placeholder),s.placeholder.update(e,e.placeholder)},_contactContainers:function(s){var n,a,o,r,h,l,c,u,d,p,f=null,m=null;for(n=this.containers.length-1;n>=0;n--)if(!t.contains(this.currentItem[0],this.containers[n].element[0]))if(this._intersectsWith(this.containers[n].containerCache)){if(f&&t.contains(this.containers[n].element[0],f.element[0]))continue;f=this.containers[n],m=n}else this.containers[n].containerCache.over&&(this.containers[n]._trigger("out",s,this._uiHash(this)),this.containers[n].containerCache.over=0);if(f)if(1===this.containers.length)this.containers[m].containerCache.over||(this.containers[m]._trigger("over",s,this._uiHash(this)),this.containers[m].containerCache.over=1);else{for(o=1e4,r=null,p=f.floating||i(this.currentItem),h=p?"left":"top",l=p?"width":"height",c=this.positionAbs[h]+this.offset.click[h],a=this.items.length-1;a>=0;a--)t.contains(this.containers[m].element[0],this.items[a].item[0])&&this.items[a].item[0]!==this.currentItem[0]&&(!p||e(this.positionAbs.top+this.offset.click.top,this.items[a].top,this.items[a].height))&&(u=this.items[a].item.offset()[h],d=!1,Math.abs(u-c)>Math.abs(u+this.items[a][l]-c)&&(d=!0,u+=this.items[a][l]),o>Math.abs(u-c)&&(o=Math.abs(u-c),r=this.items[a],this.direction=d?"up":"down"));if(!r&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[m])return;r?this._rearrange(s,r,null,!0):this._rearrange(s,null,this.containers[m].element,!0),this._trigger("change",s,this._uiHash()),this.containers[m]._trigger("change",s,this._uiHash(this)),this.currentContainer=this.containers[m],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[m]._trigger("over",s,this._uiHash(this)),this.containers[m].containerCache.over=1}},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||t("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!s[0].style.width||i.forceHelperSize)&&s.width(this.currentItem.width()),(!s[0].style.height||i.forceHelperSize)&&s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options;"parent"===n.containment&&(n.containment=this.helper[0].parentNode),("document"===n.containment||"window"===n.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,t("document"===n.containment?document:window).width()-this.helperProportions.width-this.margins.left,(t("document"===n.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||(e=t(n.containment)[0],i=t(n.containment).offset(),s="hidden"!==t(e).css("overflow"),this.containment=[i.left+(parseInt(t(e).css("borderLeftWidth"),10)||0)+(parseInt(t(e).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(t(e).css("borderTopWidth"),10)||0)+(parseInt(t(e).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(t(e).css("borderLeftWidth"),10)||0)-(parseInt(t(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(t(e).css("borderTopWidth"),10)||0)-(parseInt(t(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"===e?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,a=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():a?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():a?0:n.scrollLeft())*s}},_generatePosition:function(e){var i,s,n=this.options,a=e.pageX,o=e.pageY,r="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=/(html|body)/i.test(r[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==document&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(e.pageX-this.offset.click.leftthis.containment[2]&&(a=this.containment[2]+this.offset.click.left),e.pageY-this.offset.click.top>this.containment[3]&&(o=this.containment[3]+this.offset.click.top)),n.grid&&(i=this.originalPageY+Math.round((o-this.originalPageY)/n.grid[1])*n.grid[1],o=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-n.grid[1]:i+n.grid[1]:i,s=this.originalPageX+Math.round((a-this.originalPageX)/n.grid[0])*n.grid[0],a=this.containment?s-this.offset.click.left>=this.containment[0]&&s-this.offset.click.left<=this.containment[2]?s:s-this.offset.click.left>=this.containment[0]?s-n.grid[0]:s+n.grid[0]:s)),{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():h?0:r.scrollTop()),left:a-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():h?0:r.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(t,e){this.reverting=!1;var i,s=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(i in this._storedCSS)("auto"===this._storedCSS[i]||"static"===this._storedCSS[i])&&(this._storedCSS[i]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!e&&s.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||s.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(e||(s.push(function(t){this._trigger("remove",t,this._uiHash())}),s.push(function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer)),s.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer)))),i=this.containers.length-1;i>=0;i--)e||s.push(function(t){return function(e){t._trigger("deactivate",e,this._uiHash(this))}}.call(this,this.containers[i])),this.containers[i].containerCache.over&&(s.push(function(t){return function(e){t._trigger("out",e,this._uiHash(this))}}.call(this,this.containers[i])),this.containers[i].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,this.cancelHelperRemoval){if(!e){for(this._trigger("beforeStop",t,this._uiHash()),i=0;s.length>i;i++)s[i].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!1}if(e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null,!e){for(i=0;s.length>i;i++)s[i].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){t.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(e){var i=e||this;return{helper:i.helper,placeholder:i.placeholder||t([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:e?e.element:null}}})})(jQuery); \ No newline at end of file diff --git a/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.spinner.min.js b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.spinner.min.js new file mode 100644 index 0000000..2b9e5d2 --- /dev/null +++ b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.spinner.min.js @@ -0,0 +1,4 @@ +/*! jQuery UI - v1.10.2 - 2013-03-14 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ +(function(t){function e(t){return function(){var e=this.element.val();t.apply(this,arguments),this._refresh(),e!==this.element.val()&&this._trigger("change")}}t.widget("ui.spinner",{version:"1.10.2",defaultElement:"",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var e={},i=this.element;return t.each(["min","max","step"],function(t,s){var n=i.attr(s);void 0!==n&&n.length&&(e[s]=n)}),e},_events:{keydown:function(t){this._start(t)&&this._keydown(t)&&t.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(t){return this.cancelBlur?(delete this.cancelBlur,void 0):(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",t),void 0)},mousewheel:function(t,e){if(e){if(!this.spinning&&!this._start(t))return!1;this._spin((e>0?1:-1)*this.options.step,t),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(t)},100),t.preventDefault()}},"mousedown .ui-spinner-button":function(e){function i(){var t=this.element[0]===this.document[0].activeElement;t||(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s}))}var s;s=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),e.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),this._start(e)!==!1&&this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(e){return t(e.currentTarget).hasClass("ui-state-active")?this._start(e)===!1?!1:(this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e),void 0):void 0},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var t=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton"),this.buttons=t.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(.5*t.height())&&t.height()>0&&t.height(t.height()),this.options.disabled&&this.disable()},_keydown:function(e){var i=this.options,s=t.ui.keyCode;switch(e.keyCode){case s.UP:return this._repeat(null,1,e),!0;case s.DOWN:return this._repeat(null,-1,e),!0;case s.PAGE_UP:return this._repeat(null,i.page,e),!0;case s.PAGE_DOWN:return this._repeat(null,-i.page,e),!0}return!1},_uiSpinnerHtml:function(){return""},_buttonHtml:function(){return""+""+""+""+""},_start:function(t){return this.spinning||this._trigger("start",t)!==!1?(this.counter||(this.counter=1),this.spinning=!0,!0):!1},_repeat:function(t,e,i){t=t||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,e,i)},t),this._spin(e*this.options.step,i)},_spin:function(t,e){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+t*this._increment(this.counter)),this.spinning&&this._trigger("spin",e,{value:i})===!1||(this._value(i),this.counter++)},_increment:function(e){var i=this.options.incremental;return i?t.isFunction(i)?i(e):Math.floor(e*e*e/5e4-e*e/500+17*e/200+1):1},_precision:function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=""+t,i=e.indexOf(".");return-1===i?0:e.length-i-1},_adjustValue:function(t){var e,i,s=this.options;return e=null!==s.min?s.min:0,i=t-e,i=Math.round(i/s.step)*s.step,t=e+i,t=parseFloat(t.toFixed(this._precision())),null!==s.max&&t>s.max?s.max:null!==s.min&&s.min>t?s.min:t},_stop:function(t){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",t))},_setOption:function(t,e){if("culture"===t||"numberFormat"===t){var i=this._parse(this.element.val());return this.options[t]=e,this.element.val(this._format(i)),void 0}("max"===t||"min"===t||"step"===t)&&"string"==typeof e&&(e=this._parse(e)),"icons"===t&&(this.buttons.first().find(".ui-icon").removeClass(this.options.icons.up).addClass(e.up),this.buttons.last().find(".ui-icon").removeClass(this.options.icons.down).addClass(e.down)),this._super(t,e),"disabled"===t&&(e?(this.element.prop("disabled",!0),this.buttons.button("disable")):(this.element.prop("disabled",!1),this.buttons.button("enable")))},_setOptions:e(function(t){this._super(t),this._value(this.element.val())}),_parse:function(t){return"string"==typeof t&&""!==t&&(t=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(t,10,this.options.culture):+t),""===t||isNaN(t)?null:t},_format:function(t){return""===t?"":window.Globalize&&this.options.numberFormat?Globalize.format(t,this.options.numberFormat,this.options.culture):t},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},_value:function(t,e){var i;""!==t&&(i=this._parse(t),null!==i&&(e||(i=this._adjustValue(i)),t=this._format(i))),this.element.val(t),this._refresh()},_destroy:function(){this.element.removeClass("ui-spinner-input").prop("disabled",!1).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:e(function(t){this._stepUp(t)}),_stepUp:function(t){this._start()&&(this._spin((t||1)*this.options.step),this._stop())},stepDown:e(function(t){this._stepDown(t)}),_stepDown:function(t){this._start()&&(this._spin((t||1)*-this.options.step),this._stop())},pageUp:e(function(t){this._stepUp((t||1)*this.options.page)}),pageDown:e(function(t){this._stepDown((t||1)*this.options.page)}),value:function(t){return arguments.length?(e(this._value).call(this,t),void 0):this._parse(this.element.val())},widget:function(){return this.uiSpinner}})})(jQuery); \ No newline at end of file diff --git a/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.tabs.min.js b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.tabs.min.js index 550eec8..ec8dd69 100644 --- a/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.tabs.min.js +++ b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.tabs.min.js @@ -1,35 +1,4 @@ -/* - * jQuery UI Tabs 1.8.11 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Tabs - * - * Depends: - * jquery.ui.core.js - * jquery.ui.widget.js - */ -(function(d,p){function u(){return++v}function w(){return++x}var v=0,x=0;d.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:false,cookie:null,collapsible:false,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"
",remove:null,select:null,show:null,spinner:"Loading…",tabTemplate:"
  • #{label}
  • "},_create:function(){this._tabify(true)},_setOption:function(b,e){if(b=="selected")this.options.collapsible&& -e==this.options.selected||this.select(e);else{this.options[b]=e;this._tabify()}},_tabId:function(b){return b.title&&b.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+u()},_sanitizeSelector:function(b){return b.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+w());return d.cookie.apply(null,[b].concat(d.makeArray(arguments)))},_ui:function(b,e){return{tab:b,panel:e,index:this.anchors.index(b)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b= -d(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(b){function e(g,f){g.css("display","");!d.support.opacity&&f.opacity&&g[0].style.removeAttribute("filter")}var a=this,c=this.options,h=/^#.+/;this.list=this.element.find("ol,ul").eq(0);this.lis=d(" > li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return d("a",this)[0]});this.panels=d([]);this.anchors.each(function(g,f){var i=d(f).attr("href"),l=i.split("#")[0],q;if(l&&(l===location.toString().split("#")[0]|| -(q=d("base")[0])&&l===q.href)){i=f.hash;f.href=i}if(h.test(i))a.panels=a.panels.add(a.element.find(a._sanitizeSelector(i)));else if(i&&i!=="#"){d.data(f,"href.tabs",i);d.data(f,"load.tabs",i.replace(/#.*$/,""));i=a._tabId(f);f.href="#"+i;f=a.element.find("#"+i);if(!f.length){f=d(c.panelTemplate).attr("id",i).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(a.panels[g-1]||a.list);f.data("destroy.tabs",true)}a.panels=a.panels.add(f)}else c.disabled.push(g)});if(b){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all"); -this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(c.selected===p){location.hash&&this.anchors.each(function(g,f){if(f.hash==location.hash){c.selected=g;return false}});if(typeof c.selected!=="number"&&c.cookie)c.selected=parseInt(a._cookie(),10);if(typeof c.selected!=="number"&&this.lis.filter(".ui-tabs-selected").length)c.selected= -this.lis.index(this.lis.filter(".ui-tabs-selected"));c.selected=c.selected||(this.lis.length?0:-1)}else if(c.selected===null)c.selected=-1;c.selected=c.selected>=0&&this.anchors[c.selected]||c.selected<0?c.selected:0;c.disabled=d.unique(c.disabled.concat(d.map(this.lis.filter(".ui-state-disabled"),function(g){return a.lis.index(g)}))).sort();d.inArray(c.selected,c.disabled)!=-1&&c.disabled.splice(d.inArray(c.selected,c.disabled),1);this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active"); -if(c.selected>=0&&this.anchors.length){a.element.find(a._sanitizeSelector(a.anchors[c.selected].hash)).removeClass("ui-tabs-hide");this.lis.eq(c.selected).addClass("ui-tabs-selected ui-state-active");a.element.queue("tabs",function(){a._trigger("show",null,a._ui(a.anchors[c.selected],a.element.find(a._sanitizeSelector(a.anchors[c.selected].hash))[0]))});this.load(c.selected)}d(window).bind("unload",function(){a.lis.add(a.anchors).unbind(".tabs");a.lis=a.anchors=a.panels=null})}else c.selected=this.lis.index(this.lis.filter(".ui-tabs-selected")); -this.element[c.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");c.cookie&&this._cookie(c.selected,c.cookie);b=0;for(var j;j=this.lis[b];b++)d(j)[d.inArray(b,c.disabled)!=-1&&!d(j).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");c.cache===false&&this.anchors.removeData("cache.tabs");this.lis.add(this.anchors).unbind(".tabs");if(c.event!=="mouseover"){var k=function(g,f){f.is(":not(.ui-state-disabled)")&&f.addClass("ui-state-"+g)},n=function(g,f){f.removeClass("ui-state-"+ -g)};this.lis.bind("mouseover.tabs",function(){k("hover",d(this))});this.lis.bind("mouseout.tabs",function(){n("hover",d(this))});this.anchors.bind("focus.tabs",function(){k("focus",d(this).closest("li"))});this.anchors.bind("blur.tabs",function(){n("focus",d(this).closest("li"))})}var m,o;if(c.fx)if(d.isArray(c.fx)){m=c.fx[0];o=c.fx[1]}else m=o=c.fx;var r=o?function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.hide().removeClass("ui-tabs-hide").animate(o,o.duration||"normal", -function(){e(f,o);a._trigger("show",null,a._ui(g,f[0]))})}:function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.removeClass("ui-tabs-hide");a._trigger("show",null,a._ui(g,f[0]))},s=m?function(g,f){f.animate(m,m.duration||"normal",function(){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");e(f,m);a.element.dequeue("tabs")})}:function(g,f){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");a.element.dequeue("tabs")}; -this.anchors.bind(c.event+".tabs",function(){var g=this,f=d(g).closest("li"),i=a.panels.filter(":not(.ui-tabs-hide)"),l=a.element.find(a._sanitizeSelector(g.hash));if(f.hasClass("ui-tabs-selected")&&!c.collapsible||f.hasClass("ui-state-disabled")||f.hasClass("ui-state-processing")||a.panels.filter(":animated").length||a._trigger("select",null,a._ui(this,l[0]))===false){this.blur();return false}c.selected=a.anchors.index(this);a.abort();if(c.collapsible)if(f.hasClass("ui-tabs-selected")){c.selected= --1;c.cookie&&a._cookie(c.selected,c.cookie);a.element.queue("tabs",function(){s(g,i)}).dequeue("tabs");this.blur();return false}else if(!i.length){c.cookie&&a._cookie(c.selected,c.cookie);a.element.queue("tabs",function(){r(g,l)});a.load(a.anchors.index(this));this.blur();return false}c.cookie&&a._cookie(c.selected,c.cookie);if(l.length){i.length&&a.element.queue("tabs",function(){s(g,i)});a.element.queue("tabs",function(){r(g,l)});a.load(a.anchors.index(this))}else throw"jQuery UI Tabs: Mismatching fragment identifier."; -d.browser.msie&&this.blur()});this.anchors.bind("click.tabs",function(){return false})},_getIndex:function(b){if(typeof b=="string")b=this.anchors.index(this.anchors.filter("[href$="+b+"]"));return b},destroy:function(){var b=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var e= -d.data(this,"href.tabs");if(e)this.href=e;var a=d(this).unbind(".tabs");d.each(["href","load","cache"],function(c,h){a.removeData(h+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){d.data(this,"destroy.tabs")?d(this).remove():d(this).removeClass("ui-state-default ui-corner-top ui-tabs-selected ui-state-active ui-state-hover ui-state-focus ui-state-disabled ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide")});b.cookie&&this._cookie(null,b.cookie);return this},add:function(b, -e,a){if(a===p)a=this.anchors.length;var c=this,h=this.options;e=d(h.tabTemplate.replace(/#\{href\}/g,b).replace(/#\{label\}/g,e));b=!b.indexOf("#")?b.replace("#",""):this._tabId(d("a",e)[0]);e.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var j=c.element.find("#"+b);j.length||(j=d(h.panelTemplate).attr("id",b).data("destroy.tabs",true));j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(a>=this.lis.length){e.appendTo(this.list);j.appendTo(this.list[0].parentNode)}else{e.insertBefore(this.lis[a]); -j.insertBefore(this.panels[a])}h.disabled=d.map(h.disabled,function(k){return k>=a?++k:k});this._tabify();if(this.anchors.length==1){h.selected=0;e.addClass("ui-tabs-selected ui-state-active");j.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){c._trigger("show",null,c._ui(c.anchors[0],c.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[a],this.panels[a]));return this},remove:function(b){b=this._getIndex(b);var e=this.options,a=this.lis.eq(b).remove(),c=this.panels.eq(b).remove(); -if(a.hasClass("ui-tabs-selected")&&this.anchors.length>1)this.select(b+(b+1=b?--h:h});this._tabify();this._trigger("remove",null,this._ui(a.find("a")[0],c[0]));return this},enable:function(b){b=this._getIndex(b);var e=this.options;if(d.inArray(b,e.disabled)!=-1){this.lis.eq(b).removeClass("ui-state-disabled");e.disabled=d.grep(e.disabled,function(a){return a!=b});this._trigger("enable",null, -this._ui(this.anchors[b],this.panels[b]));return this}},disable:function(b){b=this._getIndex(b);var e=this.options;if(b!=e.selected){this.lis.eq(b).addClass("ui-state-disabled");e.disabled.push(b);e.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[b],this.panels[b]))}return this},select:function(b){b=this._getIndex(b);if(b==-1)if(this.options.collapsible&&this.options.selected!=-1)b=this.options.selected;else return this;this.anchors.eq(b).trigger(this.options.event+".tabs");return this}, -load:function(b){b=this._getIndex(b);var e=this,a=this.options,c=this.anchors.eq(b)[0],h=d.data(c,"load.tabs");this.abort();if(!h||this.element.queue("tabs").length!==0&&d.data(c,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(b).addClass("ui-state-processing");if(a.spinner){var j=d("span",c);j.data("label.tabs",j.html()).html(a.spinner)}this.xhr=d.ajax(d.extend({},a.ajaxOptions,{url:h,success:function(k,n){e.element.find(e._sanitizeSelector(c.hash)).html(k);e._cleanup();a.cache&&d.data(c, -"cache.tabs",true);e._trigger("load",null,e._ui(e.anchors[b],e.panels[b]));try{a.ajaxOptions.success(k,n)}catch(m){}},error:function(k,n){e._cleanup();e._trigger("load",null,e._ui(e.anchors[b],e.panels[b]));try{a.ajaxOptions.error(k,n,b,c)}catch(m){}}}));e.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup();return this}, -url:function(b,e){this.anchors.eq(b).removeData("cache.tabs").data("load.tabs",e);return this},length:function(){return this.anchors.length}});d.extend(d.ui.tabs,{version:"1.8.11"});d.extend(d.ui.tabs.prototype,{rotation:null,rotate:function(b,e){var a=this,c=this.options,h=a._rotate||(a._rotate=function(j){clearTimeout(a.rotation);a.rotation=setTimeout(function(){var k=c.selected;a.select(++k1&&decodeURIComponent(t.href.replace(a,""))===decodeURIComponent(location.href.replace(a,""))}var n=0,a=/#.*$/;t.widget("ui.tabs",{version:"1.10.2",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_create:function(){var e=this,i=this.options;this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",i.collapsible).delegate(".ui-tabs-nav > li","mousedown"+this.eventNamespace,function(e){t(this).is(".ui-state-disabled")&&e.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){t(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this._processTabs(),i.active=this._initialActive(),t.isArray(i.disabled)&&(i.disabled=t.unique(i.disabled.concat(t.map(this.tabs.filter(".ui-state-disabled"),function(t){return e.tabs.index(t)}))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(i.active):t(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var i=this.options.active,s=this.options.collapsible,n=location.hash.substring(1);return null===i&&(n&&this.tabs.each(function(s,a){return t(a).attr("aria-controls")===n?(i=s,!1):e}),null===i&&(i=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===i||-1===i)&&(i=this.tabs.length?0:!1)),i!==!1&&(i=this.tabs.index(this.tabs.eq(i)),-1===i&&(i=s?!1:0)),!s&&i===!1&&this.anchors.length&&(i=0),i},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):t()}},_tabKeydown:function(i){var s=t(this.document[0].activeElement).closest("li"),n=this.tabs.index(s),a=!0;if(!this._handlePageNav(i)){switch(i.keyCode){case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:n++;break;case t.ui.keyCode.UP:case t.ui.keyCode.LEFT:a=!1,n--;break;case t.ui.keyCode.END:n=this.anchors.length-1;break;case t.ui.keyCode.HOME:n=0;break;case t.ui.keyCode.SPACE:return i.preventDefault(),clearTimeout(this.activating),this._activate(n),e;case t.ui.keyCode.ENTER:return i.preventDefault(),clearTimeout(this.activating),this._activate(n===this.options.active?!1:n),e;default:return}i.preventDefault(),clearTimeout(this.activating),n=this._focusNextTab(n,a),i.ctrlKey||(s.attr("aria-selected","false"),this.tabs.eq(n).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",n)},this.delay))}},_panelKeydown:function(e){this._handlePageNav(e)||e.ctrlKey&&e.keyCode===t.ui.keyCode.UP&&(e.preventDefault(),this.active.focus())},_handlePageNav:function(i){return i.altKey&&i.keyCode===t.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):i.altKey&&i.keyCode===t.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):e},_findNextTab:function(e,i){function s(){return e>n&&(e=0),0>e&&(e=n),e}for(var n=this.tabs.length-1;-1!==t.inArray(s(),this.options.disabled);)e=i?e+1:e-1;return e},_focusNextTab:function(t,e){return t=this._findNextTab(t,e),this.tabs.eq(t).focus(),t},_setOption:function(t,i){return"active"===t?(this._activate(i),e):"disabled"===t?(this._setupDisabled(i),e):(this._super(t,i),"collapsible"===t&&(this.element.toggleClass("ui-tabs-collapsible",i),i||this.options.active!==!1||this._activate(0)),"event"===t&&this._setupEvents(i),"heightStyle"===t&&this._setupHeightStyle(i),e)},_tabId:function(t){return t.attr("aria-controls")||"ui-tabs-"+i()},_sanitizeSelector:function(t){return t?t.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var e=this.options,i=this.tablist.children(":has(a[href])");e.disabled=t.map(i.filter(".ui-state-disabled"),function(t){return i.index(t)}),this._processTabs(),e.active!==!1&&this.anchors.length?this.active.length&&!t.contains(this.tablist[0],this.active[0])?this.tabs.length===e.disabled.length?(e.active=!1,this.active=t()):this._activate(this._findNextTab(Math.max(0,e.active-1),!1)):e.active=this.tabs.index(this.active):(e.active=!1,this.active=t()),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-expanded":"false","aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-expanded":"true","aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var e=this;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist"),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return t("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=t(),this.anchors.each(function(i,n){var a,o,r,h=t(n).uniqueId().attr("id"),l=t(n).closest("li"),u=l.attr("aria-controls");s(n)?(a=n.hash,o=e.element.find(e._sanitizeSelector(a))):(r=e._tabId(l),a="#"+r,o=e.element.find(a),o.length||(o=e._createPanel(r),o.insertAfter(e.panels[i-1]||e.tablist)),o.attr("aria-live","polite")),o.length&&(e.panels=e.panels.add(o)),u&&l.data("ui-tabs-aria-controls",u),l.attr({"aria-controls":a.substring(1),"aria-labelledby":h}),o.attr("aria-labelledby",h)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel")},_getList:function(){return this.element.find("ol,ul").eq(0)},_createPanel:function(e){return t("
    ").attr("id",e).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(e){t.isArray(e)&&(e.length?e.length===this.anchors.length&&(e=!0):e=!1);for(var i,s=0;i=this.tabs[s];s++)e===!0||-1!==t.inArray(s,e)?t(i).addClass("ui-state-disabled").attr("aria-disabled","true"):t(i).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=e},_setupEvents:function(e){var i={click:function(t){t.preventDefault()}};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(e){var i,s=this.element.parent();"fill"===e?(i=s.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var e=t(this),s=e.css("position");"absolute"!==s&&"fixed"!==s&&(i-=e.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=t(this).outerHeight(!0)}),this.panels.each(function(){t(this).height(Math.max(0,i-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===e&&(i=0,this.panels.each(function(){i=Math.max(i,t(this).height("").height())}).height(i))},_eventHandler:function(e){var i=this.options,s=this.active,n=t(e.currentTarget),a=n.closest("li"),o=a[0]===s[0],r=o&&i.collapsible,h=r?t():this._getPanelForTab(a),l=s.length?this._getPanelForTab(s):t(),u={oldTab:s,oldPanel:l,newTab:r?t():a,newPanel:h};e.preventDefault(),a.hasClass("ui-state-disabled")||a.hasClass("ui-tabs-loading")||this.running||o&&!i.collapsible||this._trigger("beforeActivate",e,u)===!1||(i.active=r?!1:this.tabs.index(a),this.active=o?t():a,this.xhr&&this.xhr.abort(),l.length||h.length||t.error("jQuery UI Tabs: Mismatching fragment identifier."),h.length&&this.load(this.tabs.index(a),e),this._toggle(e,u))},_toggle:function(e,i){function s(){a.running=!1,a._trigger("activate",e,i)}function n(){i.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),o.length&&a.options.show?a._show(o,a.options.show,s):(o.show(),s())}var a=this,o=i.newPanel,r=i.oldPanel;this.running=!0,r.length&&this.options.hide?this._hide(r,this.options.hide,function(){i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),n()}):(i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),r.hide(),n()),r.attr({"aria-expanded":"false","aria-hidden":"true"}),i.oldTab.attr("aria-selected","false"),o.length&&r.length?i.oldTab.attr("tabIndex",-1):o.length&&this.tabs.filter(function(){return 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),o.attr({"aria-expanded":"true","aria-hidden":"false"}),i.newTab.attr({"aria-selected":"true",tabIndex:0})},_activate:function(e){var i,s=this._findActive(e);s[0]!==this.active[0]&&(s.length||(s=this.active),i=s.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return e===!1?t():this.tabs.eq(e)},_getIndex:function(t){return"string"==typeof t&&(t=this.anchors.index(this.anchors.filter("[href$='"+t+"']"))),t},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){t.data(this,"ui-tabs-destroy")?t(this).remove():t(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var e=t(this),i=e.data("ui-tabs-aria-controls");i?e.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):e.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(i){var s=this.options.disabled;s!==!1&&(i===e?s=!1:(i=this._getIndex(i),s=t.isArray(s)?t.map(s,function(t){return t!==i?t:null}):t.map(this.tabs,function(t,e){return e!==i?e:null})),this._setupDisabled(s))},disable:function(i){var s=this.options.disabled;if(s!==!0){if(i===e)s=!0;else{if(i=this._getIndex(i),-1!==t.inArray(i,s))return;s=t.isArray(s)?t.merge([i],s).sort():[i]}this._setupDisabled(s)}},load:function(e,i){e=this._getIndex(e);var n=this,a=this.tabs.eq(e),o=a.find(".ui-tabs-anchor"),r=this._getPanelForTab(a),h={tab:a,panel:r};s(o[0])||(this.xhr=t.ajax(this._ajaxSettings(o,i,h)),this.xhr&&"canceled"!==this.xhr.statusText&&(a.addClass("ui-tabs-loading"),r.attr("aria-busy","true"),this.xhr.success(function(t){setTimeout(function(){r.html(t),n._trigger("load",i,h)},1)}).complete(function(t,e){setTimeout(function(){"abort"===e&&n.panels.stop(!1,!0),a.removeClass("ui-tabs-loading"),r.removeAttr("aria-busy"),t===n.xhr&&delete n.xhr},1)})))},_ajaxSettings:function(e,i,s){var n=this;return{url:e.attr("href"),beforeSend:function(e,a){return n._trigger("beforeLoad",i,t.extend({jqXHR:e,ajaxSettings:a},s))}}},_getPanelForTab:function(e){var i=t(e).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}})})(jQuery); \ No newline at end of file diff --git a/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.tooltip.min.js b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.tooltip.min.js new file mode 100644 index 0000000..b0db793 --- /dev/null +++ b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.tooltip.min.js @@ -0,0 +1,4 @@ +/*! jQuery UI - v1.10.2 - 2013-03-14 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ +(function(t){function e(e,i){var s=(e.attr("aria-describedby")||"").split(/\s+/);s.push(i),e.data("ui-tooltip-id",i).attr("aria-describedby",t.trim(s.join(" ")))}function i(e){var i=e.data("ui-tooltip-id"),s=(e.attr("aria-describedby")||"").split(/\s+/),n=t.inArray(i,s);-1!==n&&s.splice(n,1),e.removeData("ui-tooltip-id"),s=t.trim(s.join(" ")),s?e.attr("aria-describedby",s):e.removeAttr("aria-describedby")}var s=0;t.widget("ui.tooltip",{version:"1.10.2",options:{content:function(){var e=t(this).attr("title")||"";return t("").text(e).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,tooltipClass:null,track:!1,close:null,open:null},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.options.disabled&&this._disable()},_setOption:function(e,i){var s=this;return"disabled"===e?(this[i?"_disable":"_enable"](),this.options[e]=i,void 0):(this._super(e,i),"content"===e&&t.each(this.tooltips,function(t,e){s._updateContent(e)}),void 0)},_disable:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur");n.target=n.currentTarget=s[0],e.close(n,!0)}),this.element.find(this.options.items).addBack().each(function(){var e=t(this);e.is("[title]")&&e.data("ui-tooltip-title",e.attr("title")).attr("title","")})},_enable:function(){this.element.find(this.options.items).addBack().each(function(){var e=t(this);e.data("ui-tooltip-title")&&e.attr("title",e.data("ui-tooltip-title"))})},open:function(e){var i=this,s=t(e?e.target:this.element).closest(this.options.items);s.length&&!s.data("ui-tooltip-id")&&(s.attr("title")&&s.data("ui-tooltip-title",s.attr("title")),s.data("ui-tooltip-open",!0),e&&"mouseover"===e.type&&s.parents().each(function(){var e,s=t(this);s.data("ui-tooltip-open")&&(e=t.Event("blur"),e.target=e.currentTarget=this,i.close(e,!0)),s.attr("title")&&(s.uniqueId(),i.parents[this.id]={element:this,title:s.attr("title")},s.attr("title",""))}),this._updateContent(s,e))},_updateContent:function(t,e){var i,s=this.options.content,n=this,a=e?e.type:null;return"string"==typeof s?this._open(e,t,s):(i=s.call(t[0],function(i){t.data("ui-tooltip-open")&&n._delay(function(){e&&(e.type=a),this._open(e,t,i)})}),i&&this._open(e,t,i),void 0)},_open:function(i,s,n){function a(t){l.of=t,o.is(":hidden")||o.position(l)}var o,r,h,l=t.extend({},this.options.position);if(n){if(o=this._find(s),o.length)return o.find(".ui-tooltip-content").html(n),void 0;s.is("[title]")&&(i&&"mouseover"===i.type?s.attr("title",""):s.removeAttr("title")),o=this._tooltip(s),e(s,o.attr("id")),o.find(".ui-tooltip-content").html(n),this.options.track&&i&&/^mouse/.test(i.type)?(this._on(this.document,{mousemove:a}),a(i)):o.position(t.extend({of:s},this.options.position)),o.hide(),this._show(o,this.options.show),this.options.show&&this.options.show.delay&&(h=this.delayedShow=setInterval(function(){o.is(":visible")&&(a(l.of),clearInterval(h))},t.fx.interval)),this._trigger("open",i,{tooltip:o}),r={keyup:function(e){if(e.keyCode===t.ui.keyCode.ESCAPE){var i=t.Event(e);i.currentTarget=s[0],this.close(i,!0)}},remove:function(){this._removeTooltip(o)}},i&&"mouseover"!==i.type||(r.mouseleave="close"),i&&"focusin"!==i.type||(r.focusout="close"),this._on(!0,s,r)}},close:function(e){var s=this,n=t(e?e.currentTarget:this.element),a=this._find(n);this.closing||(clearInterval(this.delayedShow),n.data("ui-tooltip-title")&&n.attr("title",n.data("ui-tooltip-title")),i(n),a.stop(!0),this._hide(a,this.options.hide,function(){s._removeTooltip(t(this))}),n.removeData("ui-tooltip-open"),this._off(n,"mouseleave focusout keyup"),n[0]!==this.element[0]&&this._off(n,"remove"),this._off(this.document,"mousemove"),e&&"mouseleave"===e.type&&t.each(this.parents,function(e,i){t(i.element).attr("title",i.title),delete s.parents[e]}),this.closing=!0,this._trigger("close",e,{tooltip:a}),this.closing=!1)},_tooltip:function(e){var i="ui-tooltip-"+s++,n=t("
    ").attr({id:i,role:"tooltip"}).addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||""));return t("
    ").addClass("ui-tooltip-content").appendTo(n),n.appendTo(this.document[0].body),this.tooltips[i]=e,n},_find:function(e){var i=e.data("ui-tooltip-id");return i?t("#"+i):t()},_removeTooltip:function(t){t.remove(),delete this.tooltips[t.attr("id")]},_destroy:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur");n.target=n.currentTarget=s[0],e.close(n,!0),t("#"+i).remove(),s.data("ui-tooltip-title")&&(s.attr("title",s.data("ui-tooltip-title")),s.removeData("ui-tooltip-title"))})}})})(jQuery); \ No newline at end of file diff --git a/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.widget.min.js b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.widget.min.js index 01cb788..483796c 100644 --- a/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.widget.min.js +++ b/sites/all/modules/jquery_update/replace/ui/ui/minified/jquery.ui.widget.min.js @@ -1,15 +1,4 @@ -/*! - * jQuery UI Widget 1.8.11 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Widget - */ -(function(b,j){if(b.cleanData){var k=b.cleanData;b.cleanData=function(a){for(var c=0,d;(d=a[c])!=null;c++)b(d).triggerHandler("remove");k(a)}}else{var l=b.fn.remove;b.fn.remove=function(a,c){return this.each(function(){if(!c)if(!a||b.filter(a,[this]).length)b("*",this).add([this]).each(function(){b(this).triggerHandler("remove")});return l.call(b(this),a,c)})}}b.widget=function(a,c,d){var e=a.split(".")[0],f;a=a.split(".")[1];f=e+"-"+a;if(!d){d=c;c=b.Widget}b.expr[":"][f]=function(h){return!!b.data(h, -a)};b[e]=b[e]||{};b[e][a]=function(h,g){arguments.length&&this._createWidget(h,g)};c=new c;c.options=b.extend(true,{},c.options);b[e][a].prototype=b.extend(true,c,{namespace:e,widgetName:a,widgetEventPrefix:b[e][a].prototype.widgetEventPrefix||a,widgetBaseClass:f},d);b.widget.bridge(a,b[e][a])};b.widget.bridge=function(a,c){b.fn[a]=function(d){var e=typeof d==="string",f=Array.prototype.slice.call(arguments,1),h=this;d=!e&&f.length?b.extend.apply(null,[true,d].concat(f)):d;if(e&&d.charAt(0)==="_")return h; -e?this.each(function(){var g=b.data(this,a),i=g&&b.isFunction(g[d])?g[d].apply(g,f):g;if(i!==g&&i!==j){h=i;return false}}):this.each(function(){var g=b.data(this,a);g?g.option(d||{})._init():b.data(this,a,new c(d,this))});return h}};b.Widget=function(a,c){arguments.length&&this._createWidget(a,c)};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(a,c){b.data(c,this.widgetName,this);this.element=b(c);this.options=b.extend(true,{},this.options, -this._getCreateOptions(),a);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")}, -widget:function(){return this.element},option:function(a,c){var d=a;if(arguments.length===0)return b.extend({},this.options);if(typeof a==="string"){if(c===j)return this.options[a];d={};d[a]=c}this._setOptions(d);return this},_setOptions:function(a){var c=this;b.each(a,function(d,e){c._setOption(d,e)});return this},_setOption:function(a,c){this.options[a]=c;if(a==="disabled")this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",c);return this}, -enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(a,c,d){var e=this.options[a];c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();d=d||{};if(c.originalEvent){a=b.event.props.length;for(var f;a;){f=b.event.props[--a];c[f]=c.originalEvent[f]}}this.element.trigger(c,d);return!(b.isFunction(e)&&e.call(this.element[0],c,d)===false||c.isDefaultPrevented())}}})(jQuery); +/*! jQuery UI - v1.10.2 - 2013-03-14 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ +(function(e,t){var i=0,s=Array.prototype.slice,n=e.cleanData;e.cleanData=function(t){for(var i,s=0;null!=(i=t[s]);s++)try{e(i).triggerHandler("remove")}catch(a){}n(t)},e.widget=function(i,s,n){var a,r,o,h,l={},u=i.split(".")[0];i=i.split(".")[1],a=u+"-"+i,n||(n=s,s=e.Widget),e.expr[":"][a.toLowerCase()]=function(t){return!!e.data(t,a)},e[u]=e[u]||{},r=e[u][i],o=e[u][i]=function(e,i){return this._createWidget?(arguments.length&&this._createWidget(e,i),t):new o(e,i)},e.extend(o,r,{version:n.version,_proto:e.extend({},n),_childConstructors:[]}),h=new s,h.options=e.widget.extend({},h.options),e.each(n,function(i,n){return e.isFunction(n)?(l[i]=function(){var e=function(){return s.prototype[i].apply(this,arguments)},t=function(e){return s.prototype[i].apply(this,e)};return function(){var i,s=this._super,a=this._superApply;return this._super=e,this._superApply=t,i=n.apply(this,arguments),this._super=s,this._superApply=a,i}}(),t):(l[i]=n,t)}),o.prototype=e.widget.extend(h,{widgetEventPrefix:r?h.widgetEventPrefix:i},l,{constructor:o,namespace:u,widgetName:i,widgetFullName:a}),r?(e.each(r._childConstructors,function(t,i){var s=i.prototype;e.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete r._childConstructors):s._childConstructors.push(o),e.widget.bridge(i,o)},e.widget.extend=function(i){for(var n,a,r=s.call(arguments,1),o=0,h=r.length;h>o;o++)for(n in r[o])a=r[o][n],r[o].hasOwnProperty(n)&&a!==t&&(i[n]=e.isPlainObject(a)?e.isPlainObject(i[n])?e.widget.extend({},i[n],a):e.widget.extend({},a):a);return i},e.widget.bridge=function(i,n){var a=n.prototype.widgetFullName||i;e.fn[i]=function(r){var o="string"==typeof r,h=s.call(arguments,1),l=this;return r=!o&&h.length?e.widget.extend.apply(null,[r].concat(h)):r,o?this.each(function(){var s,n=e.data(this,a);return n?e.isFunction(n[r])&&"_"!==r.charAt(0)?(s=n[r].apply(n,h),s!==n&&s!==t?(l=s&&s.jquery?l.pushStack(s.get()):s,!1):t):e.error("no such method '"+r+"' for "+i+" widget instance"):e.error("cannot call methods on "+i+" prior to initialization; "+"attempted to call method '"+r+"'")}):this.each(function(){var t=e.data(this,a);t?t.option(r||{})._init():e.data(this,a,new n(r,this))}),l}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"
    ",options:{disabled:!1,create:null},_createWidget:function(t,s){s=e(s||this.defaultElement||this)[0],this.element=e(s),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this.bindings=e(),this.hoverable=e(),this.focusable=e(),s!==this&&(e.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===s&&this.destroy()}}),this.document=e(s.style?s.ownerDocument:s.document||s),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(i,s){var n,a,r,o=i;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof i)if(o={},n=i.split("."),i=n.shift(),n.length){for(a=o[i]=e.widget.extend({},this.options[i]),r=0;n.length-1>r;r++)a[n[r]]=a[n[r]]||{},a=a[n[r]];if(i=n.pop(),s===t)return a[i]===t?null:a[i];a[i]=s}else{if(s===t)return this.options[i]===t?null:this.options[i];o[i]=s}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,"disabled"===e&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!t).attr("aria-disabled",t),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(i,s,n){var a,r=this;"boolean"!=typeof i&&(n=s,s=i,i=!1),n?(s=a=e(s),this.bindings=this.bindings.add(s)):(n=s,s=this.element,a=this.widget()),e.each(n,function(n,o){function h(){return i||r.options.disabled!==!0&&!e(this).hasClass("ui-state-disabled")?("string"==typeof o?r[o]:o).apply(r,arguments):t}"string"!=typeof o&&(h.guid=o.guid=o.guid||h.guid||e.guid++);var l=n.match(/^(\w+)\s*(.*)$/),u=l[1]+r.eventNamespace,c=l[2];c?a.delegate(c,u,h):s.bind(u,h)})},_off:function(e,t){t=(t||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.unbind(t).undelegate(t)},_delay:function(e,t){function i(){return("string"==typeof e?s[e]:e).apply(s,arguments)}var s=this;return setTimeout(i,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,i,s){var n,a,r=this.options[t];if(s=s||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],a=i.originalEvent)for(n in a)n in i||(i[n]=a[n]);return this.element.trigger(i,s),!(e.isFunction(r)&&r.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,i){e.Widget.prototype["_"+t]=function(s,n,a){"string"==typeof n&&(n={effect:n});var r,o=n?n===!0||"number"==typeof n?i:n.effect||i:t;n=n||{},"number"==typeof n&&(n={duration:n}),r=!e.isEmptyObject(n),n.complete=a,n.delay&&s.delay(n.delay),r&&e.effects&&e.effects.effect[o]?s[t](n):o!==t&&s[o]?s[o](n.duration,n.easing,a):s.queue(function(i){e(this)[t](),a&&a.call(s[0]),i()})}})})(jQuery); \ No newline at end of file diff --git a/sites/all/modules/jquery_update/replace/ui/version.txt b/sites/all/modules/jquery_update/replace/ui/version.txt index 267637b..5ad2491 100644 --- a/sites/all/modules/jquery_update/replace/ui/version.txt +++ b/sites/all/modules/jquery_update/replace/ui/version.txt @@ -1 +1 @@ -1.8.11 +1.10.2 diff --git a/sites/all/modules/panels/README.txt b/sites/all/modules/panels/README.txt index 2181b78..3c86762 100644 --- a/sites/all/modules/panels/README.txt +++ b/sites/all/modules/panels/README.txt @@ -1,6 +1,3 @@ +Welcome to Panels 3 -Welcome to Panels 3. - -A little documentation should go here, but Panels 3 is alsoi a beast - you're -best off checking the online handbook on Drupal.org, or this issue: -http://drupal.org/node/887560. +Documentation is available at https://www.drupal.org/node/496278 \ No newline at end of file diff --git a/sites/all/modules/panels/UPGRADE.txt b/sites/all/modules/panels/UPGRADE.txt index d1a42f2..05c0c98 100644 --- a/sites/all/modules/panels/UPGRADE.txt +++ b/sites/all/modules/panels/UPGRADE.txt @@ -11,7 +11,7 @@ Upgrading from Panels-6.x-3.x to Panels-7.x-3.x - panels_plugin_get_function() deprecated. - - panels_required_context removed. These were deprecated long ago and + - panels_required_context removed. These were deprecated long ago and existed only to prevent crashes. - panels_optional_context removed. @@ -20,3 +20,13 @@ Upgrading from Panels-6.x-3.x to Panels-7.x-3.x - display_renderer class is now in 'renderer', not 'handler'. +Upgrading task handlers from Panels 7.x-3.5 or older to Panels 7.x-3.6 and newer: + + - You must specify a storage type for any panels display using your custom task handler. + For examples, see panels_update_7306. + + - When creating whatever stores the panel, a storage id and storage type must be defined. + See panels_mini.module for examples inside panels_mini_save and panels_mini_panels_cache_get. + + - A display access plugin must be defined. + See panels_mini/plugins/panels_storage/panels_mini.inc for an example plugin. diff --git a/sites/all/modules/panels/css/panels.css b/sites/all/modules/panels/css/panels.css index 99552a9..13c473c 100644 --- a/sites/all/modules/panels/css/panels.css +++ b/sites/all/modules/panels/css/panels.css @@ -40,11 +40,6 @@ div.panel-pane:hover div.panel-hide { margin-top: -1.5em; } -div.panel-pane div.node { - margin: 0; - padding: 0; -} - div.panel-pane div.feed a { float: right; } diff --git a/sites/all/modules/panels/css/panels_dnd.css b/sites/all/modules/panels/css/panels_dnd.css index 530b359..7252ad6 100644 --- a/sites/all/modules/panels/css/panels_dnd.css +++ b/sites/all/modules/panels/css/panels_dnd.css @@ -175,7 +175,7 @@ div.panels-set-title-hide .panel-pane-is-title { margin: 0; } -.panel-portlet .buttons input { +.panel-portlet .buttons input, .panel-portlet .buttons button { margin: 0; padding: 0; display: inline; @@ -305,11 +305,19 @@ a.close img { background: url(../images/bg-content-modal.png); height: 100%; margin: -1em; - padding-top: 1em; + padding-bottom: 1em; padding-left: 175px; position: relative; } +.panels-section-columns-quickfilter { + padding-top: 1em; + padding-left: 1em; + padding-bottom: 1em; + margin-bottom: 1em; + background-color: #EEEEEE; +} + .panels-section-columns { height: 100%; overflow: auto; @@ -369,22 +377,29 @@ a.close img { text-align: left; } +.content-type-button a { + display: inline-block; + width: 99%; +} + +.content-type-button a:focus { + border: 1px dotted black; +} + .content-type-button img { border: 2px solid white; - float: left; } .content-type-button img:hover { border: 2px solid blue; } -.content-type-button div { +.content-type-button div, +.content-type-button span { width: 85%; + position: relative; top: -5px; - left: 2px; - float: left; - padding-left: 3px; - padding-top: 5px; + left: 3px; } #panels-preview .modal-throbber-wrapper { diff --git a/sites/all/modules/panels/help/plugins-layout.html b/sites/all/modules/panels/help/plugins-layout.html index 592baed..cbc043d 100644 --- a/sites/all/modules/panels/help/plugins-layout.html +++ b/sites/all/modules/panels/help/plugins-layout.html @@ -48,7 +48,7 @@ The include file defines all the other files that our layout will utilize in ord
    1. Title:
      The title of our layout. (Utilized within the panels administration screens)
    2. Icon:
      The graphical representation of our layout. (Utilized within the panels administration screens)
    3. -
    4. Theme:
      The template file of our layout. (Sharp eyed readers will note that the theme definition utilizes underscores instead of dashes, and does not have ".tpl.php" after it. This is refering to the layout-sample-first-layout.tpl.php file all the same, it is simply how the naming convention works. Utilize dashes in the tpl file name and underscores when refering to it in your include file.)
    5. +
    6. Theme:
      The template file of our layout. (Sharp eyed readers will note that the theme definition utilizes underscores instead of dashes, and does not have ".tpl.php" after it. This is referring to the layout-sample-first-layout.tpl.php file all the same, it is simply how the naming convention works. Utilize dashes in the tpl file name and underscores when referring to it in your include file.)
    7. CSS:
      The css file to be utilized for our layout. (Utilized within the panels administration screens, AND when viewing the actual panel itself.)
    8. Panels:
      Defines all the various regions within your panel. This will be further utilized within our tpl.php file.
    diff --git a/sites/all/modules/panels/i18n_panels/README.txt b/sites/all/modules/panels/i18n_panels/README.txt new file mode 100644 index 0000000..71c4b8f --- /dev/null +++ b/sites/all/modules/panels/i18n_panels/README.txt @@ -0,0 +1,93 @@ + +This module provides by default the ability to translate panel display and +panel pane titles. +Further it introduced an extension to the ctools content_types plugin. +You can now define translatable settings which will be registered in i18n. +Out of the box the module extends the custom content content_type to allow +translation of the content. + +Requirements: + Ctools 7.x-1.x-dev (Jan 28-2014 or newer) + Panels 7.x-3.x-dev (Jan 28-2014 or newer) + +Plugin definition extension: +------------------------------ + +This example shows how the content_type custom is extended: + +#### Default: #### +/** + * Plugins are described by creating a $plugin array which will be used + * by the system that includes this file. + */ +$plugin = array( + 'title' => t('Custom content'), + 'no title override' => TRUE, + 'defaults' => array('admin_title' => '', 'title' => '', 'body' => '', 'format' => filter_fallback_format(), 'substitute' => TRUE), + 'js' => array('misc/autocomplete.js', 'misc/textarea.js', 'misc/collapse.js'), + // Make sure the edit form is only used for some subtypes. + 'edit form' => '', + 'add form' => '', + 'edit text' => t('Edit'), + 'all contexts' => TRUE, +); + +#### Extended Configuration: #### +/** + * Plugins are described by creating a $plugin array which will be used + * by the system that includes this file. + */ +$plugin = array( + 'title' => t('Custom content'), + 'no title override' => TRUE, + 'defaults' => array('admin_title' => '', 'title' => '', 'body' => '', 'format' => filter_fallback_format(), 'substitute' => TRUE), + 'js' => array('misc/autocomplete.js', 'misc/textarea.js', 'misc/collapse.js'), + // Make sure the edit form is only used for some subtypes. + 'edit form' => '', + 'add form' => '', + 'edit text' => t('Edit'), + 'all contexts' => TRUE, + 'i18n_settings' = array( + 'title', + 'body' => array('format' => 'plain_text'), + 'items|0|title' + ), +); + +The new key "i18n_settings" defines an array with the settings that are +translatable. The array contains the names of the settings, they have to be +available in the "defaults" array of the content definition. If you need to +define a format use the name of the setting as the array item key and as item +another array with the detail configuration. E.g +'i18n_settings' = array('body' => array('format' => 'plain_text')) + +If i18n_settings is a string it's used as callback. The expected return is an +array equal to the one used in the fix configuration. +You can even declare nested settings as translatable, to do so use '|' as +delimiter. +E.g. 'items|0|title' is evaluated as $settings['items'][0]['title'] + +#### Callback: #### +/** + * Plugins are described by creating a $plugin array which will be used + * by the system that includes this file. + */ +$plugin = array( + 'title' => t('Custom content'), + 'no title override' => TRUE, + 'defaults' => array('admin_title' => '', 'title' => '', 'body' => '', 'format' => filter_fallback_format(), 'substitute' => TRUE), + 'js' => array('misc/autocomplete.js', 'misc/textarea.js', 'misc/collapse.js'), + // Make sure the edit form is only used for some subtypes. + 'edit form' => '', + 'add form' => '', + 'edit text' => t('Edit'), + 'all contexts' => TRUE, + 'i18n_settings' => 'ctools_custom_content_type_i18n_settings', +); + +function ctools_custom_content_type_i18n_settings($conf) { + return array( + 'title', + 'body' => array('format' => $conf['format']), + ); +} diff --git a/sites/all/modules/panels/i18n_panels/i18n_panels.i18n.inc b/sites/all/modules/panels/i18n_panels/i18n_panels.i18n.inc new file mode 100644 index 0000000..71fdafb --- /dev/null +++ b/sites/all/modules/panels/i18n_panels/i18n_panels.i18n.inc @@ -0,0 +1,50 @@ + t('Pane Configuration'), + 'key' => 'uuid', + 'string translation' => array( + 'textgroup' => 'panels', + 'type' => 'pane_configuration', + 'properties' => array( + 'title' => t('Pane Title'), + ), + ), + ); + $info['display_configuration'] = array( + 'title' => t('Display Configuration'), + 'key' => 'uuid', + 'string translation' => array( + 'textgroup' => 'panels', + 'type' => 'display_configuration', + 'properties' => array( + 'title' => t('Display Title'), + ), + ), + ); + + return $info; +} + +/** + * Implements hook_i18n_string_info(). + */ +function i18n_panels_i18n_string_info() { + $groups['panels'] = array( + 'title' => t('Panels'), + 'description' => t('Translatable panels items: display and pane configuration items. E.g. Title.'), + // This group doesn't have strings with format. + 'format' => FALSE, + // This group can list all strings. + 'list' => FALSE, + ); + return $groups; +} diff --git a/sites/all/modules/panels/i18n_panels/i18n_panels.info b/sites/all/modules/panels/i18n_panels/i18n_panels.info new file mode 100644 index 0000000..55fa3cb --- /dev/null +++ b/sites/all/modules/panels/i18n_panels/i18n_panels.info @@ -0,0 +1,15 @@ +name = Panels translation +description = Supports translatable panels items. +dependencies[] = i18n +dependencies[] = panels +dependencies[] = i18n_string +dependencies[] = i18n_translation +package = Multilingual - Internationalization +core = 7.x + +; Information added by Drupal.org packaging script on 2016-08-20 +version = "7.x-3.7" +core = "7.x" +project = "panels" +datestamp = "1471704242" + diff --git a/sites/all/modules/panels/i18n_panels/i18n_panels.install b/sites/all/modules/panels/i18n_panels/i18n_panels.install new file mode 100644 index 0000000..ff7631b --- /dev/null +++ b/sites/all/modules/panels/i18n_panels/i18n_panels.install @@ -0,0 +1,27 @@ + t('Panels uuid support.'), + 'severity' => REQUIREMENT_OK, + 'value' => t('Available'), + ); + if (!db_field_exists('panels_pane', 'uuid')) { + $requirements['uuid']['severity'] = REQUIREMENT_ERROR; + $requirements['uuid']['value'] = t('Not found. Please apply the provided patches and run the update script.'); + } + } + return $requirements; +} diff --git a/sites/all/modules/panels/i18n_panels/i18n_panels.module b/sites/all/modules/panels/i18n_panels/i18n_panels.module new file mode 100644 index 0000000..91524e3 --- /dev/null +++ b/sites/all/modules/panels/i18n_panels/i18n_panels.module @@ -0,0 +1,442 @@ +type); + if (isset($content_type['i18n_settings'])) { + if (is_string($content_type['i18n_settings']) && function_exists($content_type['i18n_settings'])) { + $content_type['i18n_settings'] = $content_type['i18n_settings']($pane->configuration); + } + } + // Provide the override title string as translation for all panes that have + // this setting enabled. + if (isset($pane->configuration['override_title']) && $pane->configuration['override_title']) { + if (isset($content_type['i18n_settings']) && is_array($content_type['i18n_settings'])) { + $content_type['i18n_settings'][] = 'override_title_text'; + } + else { + $content_type['i18n_settings'] = array('override_title_text'); + } + } + return isset($content_type['i18n_settings']) ? $content_type['i18n_settings'] : FALSE; +} + +/** + * Returns the translation object of the pane. + * + * @param stdClass $pane + * The pane to deal with. + * + * @return stdClass|FALSE + * Returns FALSE if no translation is necessary. + */ +function i18n_panels_get_i18n_translation_object($pane) { + $translation_object = array(); + + // Handle content type specific i18n settings. + if ($i18n_settings = i18n_panels_get_i18n_settings($pane)) { + // Register translatable settings. + foreach ($i18n_settings as $i18n_setting => $settings) { + if (!is_array($settings)) { + $i18n_setting = $settings; + $settings = array('format' => 'plain_text'); + } + $translation_object[$i18n_setting] = NULL; + $key_exists = FALSE; + // Ensure a nested setting is "unpacked". + $config_value = drupal_array_get_nested_value($pane->configuration, explode('|', $i18n_setting), $key_exists); + // If we reached the end of the nested setting use the value as source. + if ($key_exists) { + $translation_object[$i18n_setting] = array( + 'string' => $config_value, + 'format' => $settings['format'], + ); + $translation_object['panels_i18n_settings'][$i18n_setting] = $settings; + } + } + } + + // Check if this pane has a custom title enabled. + if (!empty($pane->configuration['override_title'])) { + $translation_object['title']['string'] = $pane->configuration['override_title_text']; + } + if (!empty($translation_object)) { + return (object) $translation_object; + } + return FALSE; +} + +/** + * Implements hook_panels_pane_insert(). + * + * @param stdClass $pane + * The pane to deal with. + */ +function i18n_panels_panels_pane_insert($pane) { + i18n_panels_panels_pane_update($pane); +} + +/** + * Implements hook_panels_pane_update(). + * + * @param stdClass $pane + * The pane to deal with. + */ +function i18n_panels_panels_pane_update($pane) { + if ($translation_object = i18n_panels_get_i18n_translation_object($pane)) { + $translation_object->uuid = $pane->uuid; + $status = i18n_string_object_update('pane_configuration', $translation_object); + } +} + +/** + * Implements hook_panels_pane_delete(). + * + * @param array $pids + * Array with the panel ids to delete. + */ +function i18n_panels_panels_pane_delete($pids) { + if (!empty($pids)) { + // Fetch the uuids from the db. + $uuids = db_select('panels_pane') + ->fields('panels_pane', array('uuid')) + ->condition('pid', $pids) + ->execute() + ->fetchCol(); + foreach ($uuids as $uuid) { + // Create dummy pane with uuid as property. + $pane = (object) array('uuid' => $uuid); + i18n_string_object_remove('pane_configuration', $pane); + } + } +} + +/** + * Implements hook_panels_pane_prerender(). + * + * @param stdClass $pane + * The pane to deal with. + */ +function i18n_panels_panels_pane_prerender($pane) { + // Check if this pane has translations. + if (isset($pane->uuid) && $translation_object = i18n_panels_get_i18n_translation_object($pane)) { + $translation_object->uuid = $pane->uuid; + // Send to translation. + $translation_object = i18n_string_object_translate('pane_configuration', $translation_object); + unset($translation_object->uuid, $translation_object->i18n_settings); + foreach ($translation_object as $i18n_setting => $translated_setting) { + if ($i18n_setting != 'panels_i18n_settings') { + if (is_array($translated_setting)) { + $translated_setting = $translated_setting['string']; + } + drupal_array_set_nested_value($pane->configuration, explode('|', $i18n_setting), $translated_setting); + } + } + } +} + +/** + * Implements hook_panels_display_save(). + * + * @param panels_display $display + * The display to deal with. + */ +function i18n_panels_panels_display_save($display) { + $status = i18n_string_object_update('display_configuration', $display); +} + +/** + * Implements hook_panels_display_delete(). + * + * @param int $did + * Id of the display to delete. + */ +function i18n_panels_panels_delete_display($did) { + // Fetch uuid to delete the translations. + $uuid = db_select('panels_display') + ->fields('panels_display', array('uuid')) + ->condition('did', $did) + ->execute() + ->fetchColumn(); + // Build a dummy display. + $display = (object) array('uuid' => $uuid); + + // Check if this display was just saved in the db. + if (!_18n_panels_is_exported_panels_display($display)) { + // If the display was just saved in the db remove all translations. + i18n_string_object_remove('display_configuration', $display); + // Remove related pane translations too. + $pids = db_select('panels_pane') + ->fields('panels_pane', array('pid')) + ->condition('did', $did) + ->execute() + ->fetchCol(); + i18n_panels_panels_pane_delete($pids); + } + else { + // If the display is exported leave the translated strings but give the user + // a hint how to clean up. + drupal_set_message( + t( + 'The reverted panels display(s) were exported, please run a
    string refresh to update the translatable strings.', + array('!link' => url('admin/config/regional/translate/i18n_string')) + ), + 'warning', + FALSE + ); + } +} + +/** + * Implements hook_panels_pre_render(). + * + * This function must not rely on the passed $renderer parameter. The parameter + * could be empty because this function is reused in i18n_ctools_render_alter(). + * @todo Check if a drupal_alter() in panels_display::get_title() is applicable. + * + * @see i18n_ctools_render_alter() + * + * @param panels_display $display + * The display to deal with. + * @param panels_renderer_standard $renderer + * The renderer to deal with. + */ +function i18n_panels_panels_pre_render(&$display, $renderer) { + // Avoid double translations. + if (!isset($display->i18n_panels_title_translated)) { + $translation = i18n_string_object_translate('display_configuration', $display); + if (is_array($translation->title)) { + $display->title = $translation->title['string']; + } + else { + $display->title = $translation->title; + } + $display->i18n_panels_title_translated = TRUE; + } +} + +/** + * Implements hook_ctools_render_alter(). + * + * Under some circumstances the title of the panel page is set before + * hook_panels_pre_render() is fired. Such cases can be handled with this hook. + * @todo Check if a drupal_alter() in panels_display::get_title() is applicable. + */ +function i18n_ctools_render_alter(&$info, $page, $context) { + // @todo Find a better way to detect a panels page. + if ($page === TRUE && !empty($info['content']['#display']) && $info['content']['#display'] instanceof panels_display) { + i18n_panels_panels_pre_render($info['content']['#display'], NULL); + // Set the info title. This is used to set the page title. + $info['title'] = $info['content']['#display']->get_title(); + } +} + + +/** + * Implements hook_ctools_plugin_post_alter(). + * + * Register some translatable configuration settings for plugins. + * + */ +function i18n_panels_ctools_plugin_post_alter(&$plugin, $plugin_type_info) { + if ($plugin_type_info['type'] == 'content_types') { + // Modify custom content. + if ($plugin['name'] == 'custom') { + // Register callback to get the translatable settings. + $plugin['i18n_settings'] = 'ctools_custom_content_type_i18n_settings'; + } + } +} + +/** + * Callback to provide the translatable settings appropriate to the config. + * + * @param array $conf + * Content type configuration. + * + * @return array + * i18n_settings configuration. + */ +function ctools_custom_content_type_i18n_settings($conf) { + return array( + 'title', + 'body' => array('format' => $conf['format']), + ); +} + +/** + * Implements hook_i18n_string_list_TEXTGROUP_alter(). + * + * Necessary to support the dynamic translatable settings defined by ctools + * content types. + */ +function i18n_panels_i18n_string_list_panels_alter(&$strings, $type = NULL, $object = NULL) { + if (isset($object->panels_i18n_settings)) { + foreach ($object->panels_i18n_settings as $i18n_setting => $settings) { + if (isset($object->{$i18n_setting})) { + $strings['panels'][$type][$object->uuid][$i18n_setting] = $object->{$i18n_setting}; + } + } + } +} + +/** + * Implements hook_i18n_string_list(). + * + * @todo Figure out a generic solution to fetch exported displays. + */ +function i18n_panels_i18n_string_list($group) { + $strings = array(); + if ($group == 'panels') { + + // Fetch all available displays. + $displays = _18n_panels_fetch_all_panel_displays(); + + foreach ($displays as $display) { + if (empty($display->uuid)) { + drupal_set_message(t('The display %display has no uuid, please resave or re-export it.', array('%display' => $display->did)), 'warning'); + continue; + } + // Avoid duplicated runs _18n_panels_fetch_all_panel_displays() probably + // returns the same display twice, one for the db based and one for the + // exported one. + if (isset($strings['panels']['display_configuration'][$display->uuid])) { + continue; + } + $strings['panels']['display_configuration'][$display->uuid]['title']['string'] = $display->title; + foreach ($display->content as $pane) { + if (empty($pane->uuid)) { + // Fetch exported uuid and validate it. + $uuid = str_replace('new-', '', $pane->pid); + if (!panels_uuid_is_valid($uuid)) { + drupal_set_message(t('The pane %pane has no uuid, please resave or re-export it.', array('%pane' => $pane->pid)), 'warning'); + continue; + } + $pane->uuid = $uuid; + } + if ($translation_object = i18n_panels_get_i18n_translation_object($pane)) { + // Split up all strings and add them to the list. + $pane_strings = (array) $translation_object; + unset($pane_strings['panels_i18n_settings']); + foreach ($pane_strings as $key => $pane_string) { + $strings['panels']['pane_configuration'][$pane->uuid][$key] = $pane_string; + } + } + } + } + } + return $strings; +} + +/** + * Checks if the give display is exported or only stored in the db. + * + * @return boolean + * TRUE if the display is available from code. + */ +function _18n_panels_is_exported_panels_display($display) { + if (isset($display->uuid)) { + $displays = _18n_panels_fetch_all_panel_displays(); + return isset($displays['exported-' . $display->uuid]); + } + return FALSE; +} + +/** + * Returns a list of really all available panel displays. + * + * The list is statically cached. Use the parameter $reset to refresh the list + * during the same request. + * Probably returns the same display twice - once with the db based and once + * the exported one. + * + * @todo I bet there are better ways to solve this mess. + * + * @param boolean $reset + * Reset the static cache. + * + * @return array + * List of all panel displays. + */ +function _18n_panels_fetch_all_panel_displays($reset = FALSE) { + $displays = &drupal_static(__FUNCTION__, array()); + if (!empty($displays) && !$reset) { + return $displays; + } + + // Fetch db based displays. + $dids = db_select('panels_display')->fields('panels_display', array('did'))->execute()->fetchCol(); + $displays = panels_load_displays($dids); + + // Fetch exported displays. + ctools_include('export'); + foreach (ctools_export_crud_load_all('panels_display') as $panels_display) { + if (!empty($panels_display->uuid)) { + $displays['exported-' . $panels_display->uuid] = $panels_display; + } + } + + // Fetch mini panels. + $mini_panels = ctools_export_crud_load_all('panels_mini'); + foreach ($mini_panels as $pane) { + if (!empty($pane->display->uuid)) { + $displays['exported-' . $pane->display->uuid] = $pane->display; + } + } + + // Fetch in page manager embedded displays. + if (module_exists('page_manager')) { + module_load_include('inc', 'page_manager', 'page_manager.admin'); + $tasks = page_manager_get_tasks_by_type('page'); + $pages = array('operations' => array(), 'tasks' => array()); + page_manager_get_pages($tasks, $pages); + + foreach ($pages['tasks'] as $task) { + $page = page_manager_cache_load($task); + $task_info = page_manager_get_task_subtasks($page->task); + foreach ($page->handler_info as $id => $info) { + $page_manager_handler = $page->handlers[$id]; + if ($page_manager_handler->handler == 'panel_context') { + + // @todo Is there really no better way to check this? + $is_exported = ($page_manager_handler->export_type == (EXPORT_IN_CODE | EXPORT_IN_DATABASE) || (isset($page->subtask['storage']) && $page->subtask['storage'] == t('Overridden'))); + + if (!empty($page_manager_handler->conf['display'])) { + $panels_display = $page_manager_handler->conf['display']; + $displays['exported-' . $panels_display->uuid] = $panels_display; + } + elseif ($is_exported && isset($page_manager_handler->conf['did'])) { + $panels_display = panels_load_display($page_manager_handler->conf['did']); + if (isset($panels_display->uuid)) { + $displays['exported-' . $panels_display->uuid] = $panels_display; + } + } + } + } + } + } + + // Fetch panelizer displays. + if (module_exists('panelizer')) { + // Fetch all default handlers. + $panelizer_defaults = ctools_export_crud_load_all('panelizer_defaults'); + foreach ($panelizer_defaults as $panelizer_default) { + $displays['exported-' . $panelizer_default->display->uuid] = $panelizer_default->display; + } + } + return $displays; +} diff --git a/sites/all/modules/panels/includes/add-content.inc b/sites/all/modules/panels/includes/add-content.inc index 0a52ff9..5ff1b24 100644 --- a/sites/all/modules/panels/includes/add-content.inc +++ b/sites/all/modules/panels/includes/add-content.inc @@ -9,6 +9,8 @@ * Preprocess the primary entry level theme. */ function template_preprocess_panels_add_content_modal(&$vars) { + $vars['categories_array'] = array(); + // Process the list of categories. foreach ($vars['categories'] as $key => $category_info) { // 'root' category is actually displayed under the categories, so @@ -77,7 +79,10 @@ function template_preprocess_panels_add_content_link(&$vars) { $vars['description'] = isset($vars['content_type']['description']) ? $vars['content_type']['description'] : $vars['title']; $vars['icon'] = ctools_content_admin_icon($vars['content_type']); $vars['url'] = $vars['renderer']->get_url('add-pane', $vars['region'], $vars['content_type']['type_name'], $vars['content_type']['subtype_name']); - - $vars['image_button'] = ctools_ajax_image_button($vars['icon'], $vars['url'], $vars['description'], 'panels-modal-add-config'); - $vars['text_button'] = ctools_ajax_text_button($vars['title'], $vars['url'], $vars['description'], 'panels-modal-add-config'); + $subtype_class = 'add-content-link-' . str_replace('_', '-', $vars['content_type']['subtype_name']); + $vars['image_button'] = ctools_ajax_image_button($vars['icon'], $vars['url'], $vars['description'], $subtype_class . '-image-button panels-modal-add-config'); + $vars['text_button'] = ctools_ajax_text_button($vars['title'], $vars['url'], $vars['description'], $subtype_class . '-text-button panels-modal-add-config'); + if (function_exists('ctools_ajax_icon_text_button')) { + $vars['icon_text_button'] = ctools_ajax_icon_text_button($vars['title'], $vars['icon'], $vars['url'], $vars['description'], $subtype_class . '-icon-text-button panels-modal-add-config'); + } } diff --git a/sites/all/modules/panels/includes/common.inc b/sites/all/modules/panels/includes/common.inc index 120f0a7..fcecef2 100644 --- a/sites/all/modules/panels/includes/common.inc +++ b/sites/all/modules/panels/includes/common.inc @@ -89,7 +89,7 @@ class panels_allowed_layouts { * as allowed or not allowed on the initial call to panels_allowed_layouts::set_allowed() * */ - function panels_allowed_layouts($start_allowed = TRUE) { + function __construct($start_allowed = TRUE) { // TODO would be nice if there was a way to just fetch the names easily foreach ($this->list_layouts() as $layout_name) { $this->allowed_layout_settings[$layout_name] = $start_allowed ? 1 : 0; @@ -352,11 +352,21 @@ function panels_common_settings_submit($form, &$form_state) { $module_name = $form_state['values']['module_name']; variable_set($module_name . '_default', $form_state['values']['panels_common_default']); if (!$form_state['skip']) { - // merge the broken apart array neatly back together - $allowed = $form_state['values']['allowed']; + // Merge the broken apart array neatly back together. $allowed_content_types = array(); foreach ($form_state['values']['allowed'] as $allowed) { - $allowed_content_types = array_merge($allowed_content_types, $form_state['values']['content_types'][$allowed]['options']); + $values = $form_state['values']['content_types'][$allowed]['options']; + // If new content of the type is not added, storing a lisy of disabled + // content is not needed. + if (!$form_state['values']['panels_common_default'][$allowed]) { + $values = array_filter($values); + } + $allowed_content_types = array_merge($allowed_content_types, $values); + } + // Values from checkboxes are the same string as they key, but we only need + // to store the boolean value. + foreach ($allowed_content_types as &$value) { + $value = (bool) $value; } variable_set($module_name . '_allowed_types', $allowed_content_types); } diff --git a/sites/all/modules/panels/includes/display-edit.inc b/sites/all/modules/panels/includes/display-edit.inc index dc6d1b9..4e28292 100644 --- a/sites/all/modules/panels/includes/display-edit.inc +++ b/sites/all/modules/panels/includes/display-edit.inc @@ -240,7 +240,7 @@ function panels_edit_display_settings_form($form, &$form_state) { '#type' => 'textfield', '#default_value' => $display->title, '#title' => t('Title'), - '#description' => t('The title of this panel. If left blank, a default title may be used. Set to No Title if you want the title to actually be blank.'), + '#description' => t('The title of this panel. If left blank, a default title may be used. If you want the title actually to be blank, change the "Title type" dropdown from "Manually Set" to "No Title".'), '#process' => array('ctools_dependent_process'), '#dependency' => array('edit-display-title-hide-title' => array(PANELS_TITLE_FIXED)), '#maxlength' => 255, diff --git a/sites/all/modules/panels/includes/display-layout.inc b/sites/all/modules/panels/includes/display-layout.inc index ad051b4..a21e663 100644 --- a/sites/all/modules/panels/includes/display-layout.inc +++ b/sites/all/modules/panels/includes/display-layout.inc @@ -94,6 +94,7 @@ function panels_choose_layout($form, &$form_state) { } } + ctools_add_js('panels-base', 'panels'); ctools_add_js('layout', 'panels'); $form['categories'] = array( @@ -320,6 +321,8 @@ function panels_change_layout_submit($form, &$form_state) { $display->panels = $content; $display->layout = $form_state['layout']; + + panels_edit_display_settings_form_submit($form, $form_state); } /** diff --git a/sites/all/modules/panels/includes/plugins.inc b/sites/all/modules/panels/includes/plugins.inc index 9077d38..be5cd25 100644 --- a/sites/all/modules/panels/includes/plugins.inc +++ b/sites/all/modules/panels/includes/plugins.inc @@ -125,7 +125,7 @@ class panels_cache_object { /** * When constructed, take a snapshot of our existing out of band data. */ - function panels_cache_object() { + function __construct() { $this->head = drupal_add_html_head(); $this->css = drupal_add_css(); $this->tokens = ctools_set_page_token(); @@ -173,15 +173,36 @@ class panels_cache_object { $start = $this->js; $this->js = array(); + // Use the advanced mapping function from Drupal >= 7.23 if available. + $array_mapping_func = function_exists('drupal_array_diff_assoc_recursive') ? 'drupal_array_diff_assoc_recursive' : 'array_diff_assoc'; + // If there are any differences between the old and the new javascript then // store them to be added later. - if ($diff = array_diff_assoc($js, $start)) { - $this->js = $diff; - } - - // Special case the settings key and get the difference of the data. - if ($settings_diff = array_diff_assoc($js['settings']['data'], $start['settings']['data'])) { - $this->js['settings'] = $settings_diff; + if ($diff = $array_mapping_func($js, $start)) { + // Iterate over the diff to ensure we keep the keys on merge and don't add + // unnecessary items. + foreach ($diff as $key => $diff_data) { + // Special case the settings key and get the difference of the data. + if ($key === 'settings') { + // Iterate over the diff to ensure we keep the keys on merge and don't + // add unnecessary items. + if (isset($diff[$key]['data'])) { + foreach ($diff[$key]['data'] as $settings_key => $settings_data) { + // Merge the changes with the base to get a complete settings + // array. + $this->js[$key]['data'][] = drupal_array_merge_deep($settings_data, $diff[$key]['data'][$settings_key]); + } + } + } + else { + $this->js[$key] = $diff_data; + // Check if the key was present already and if so merge the changes + // with the original data to get the full settings array. + if (isset($start[$key])) { + $this->js[$key] = drupal_array_merge_deep($start[$key], $this->js[$key]); + } + } + } } // And for tokens: @@ -213,7 +234,7 @@ class panels_cache_object { drupal_add_js($args['data'], $args); } else { - foreach ($args as $setting) { + foreach ($args['data'] as $setting) { drupal_add_js($setting, 'setting'); } } @@ -457,6 +478,31 @@ function panels_get_renderer_pipelines($sort = TRUE) { return $pipelines; } +/** + * Fetch metadata on a specific panels_storage plugin. + * + * @param $storage + * Name of a panel_storage plugin. + * + * @return + * An array with information about the requested panels_storage plugin + */ +function panels_get_panels_storage_plugin($storage) { + ctools_include('plugins'); + return ctools_get_plugins('panels', 'panels_storage', $storage); +} + +/** + * Fetch metadata for all panels_storage plugins. + * + * @return + * An array of arrays with information about all available panels_storage plugins. + */ +function panels_get_panels_storage_plugins() { + ctools_include('plugins'); + return ctools_get_plugins('panels', 'panels_storage'); +} + /** * Get a function from a plugin, if it exists. * diff --git a/sites/all/modules/panels/js/display_editor.js b/sites/all/modules/panels/js/display_editor.js index 40e1146..53274f6 100644 --- a/sites/all/modules/panels/js/display_editor.js +++ b/sites/all/modules/panels/js/display_editor.js @@ -80,7 +80,7 @@ Drupal.Panels.Draggable = { regionId: 'panel-region-', // What to add to the front of a the id to get the form id for a panel - formId: 'input#edit-', + formId: '#edit-', maxWidth: 250, @@ -492,8 +492,8 @@ Drupal.behaviors.PanelsDisplayEditor = { Drupal.Panels.Draggable.savePositions(); // Bind buttons. - $('input#panels-hide-all', context).click(Drupal.Panels.clickHideAll); - $('input#panels-show-all', context).click(Drupal.Panels.clickShowAll); + $('#panels-hide-all', context).click(Drupal.Panels.clickHideAll); + $('#panels-show-all', context).click(Drupal.Panels.clickShowAll); Drupal.Panels.bindClickDelete(context); @@ -513,6 +513,11 @@ Drupal.behaviors.PanelsDisplayEditor = { $('#panels-preview').html(html); }); + // Bind modal detach behaviors to cancel current form. + $(document).bind('CToolsDetachBehaviors', function(event, context) { + $('#edit-cancel-style', context).trigger('click'); + }); + var setTitleClass = function () { if ($('#edit-display-title-hide-title').val() == 2) { $('#panels-dnd-main').removeClass('panels-set-title-hide'); diff --git a/sites/all/modules/panels/js/panels-base.js b/sites/all/modules/panels/js/panels-base.js index 4df3c80..31eb010 100644 --- a/sites/all/modules/panels/js/panels-base.js +++ b/sites/all/modules/panels/js/panels-base.js @@ -13,6 +13,45 @@ } }; + Drupal.Panels.AddContentModalQuickFilter = function() { + var input_field = $('.panels-add-content-modal input[name=quickfilter]'); + input_field.data.panelsAddContentModalQuickFilter = { + keyupTimeout: false, + filter: function(e) { + if (this.val().length) { + var search_expression = this.val().toLowerCase(); + $('.panels-add-content-modal .panels-section-columns .content-type-button').each(function(i, elem) { + if ($(elem).text().toLowerCase().search(search_expression) > -1) { + $(elem).show(); + } + else { + $(elem).hide(); + } + }); + } + else { + $('.panels-add-content-modal .panels-section-columns .content-type-button').show(); + } + } + } + // Use timeout to reduce the iteration over the DOM tree. + input_field.bind('keyup.AddContentModalQuickFilter', jQuery.proxy(function(e){ + var filter = $(this).data.panelsAddContentModalQuickFilter; + if (filter.keyupTimeout) { + window.clearTimeout(filter.timeout); + filter.keyupTimeout = false; + } + // If there's only one item left and enter is hit select it right away. + if (e.keyCode == 13 && $('.panels-add-content-modal .panels-section-columns .content-type-button:visible').length == 1) { + $('.panels-add-content-modal .panels-section-columns .content-type-button:visible a').trigger('click'); + } + else { + filter.keyupTimeout = window.setTimeout(jQuery.proxy(filter.filter, this), 200); + } + }, input_field)); + input_field.focus(); + }; + Drupal.Panels.restripeTable = function(table) { // :even and :odd are reversed because jquery counts from 0 and // we count from 1, so we're out of sync. diff --git a/sites/all/modules/panels/js/panels.js b/sites/all/modules/panels/js/panels.js deleted file mode 100644 index 3bc5807..0000000 --- a/sites/all/modules/panels/js/panels.js +++ /dev/null @@ -1,28 +0,0 @@ - -(function ($) { - Drupal.Panels = Drupal.Panels || {}; - - Drupal.Panels.autoAttach = function() { - if ($.browser.msie) { - // If IE, attach a hover event so we can see our admin links. - $("div.panel-pane").hover( - function() { - $('div.panel-hide', this).addClass("panel-hide-hover"); return true; - }, - function() { - $('div.panel-hide', this).removeClass("panel-hide-hover"); return true; - } - ); - $("div.admin-links").hover( - function() { - $(this).addClass("admin-links-hover"); return true; - }, - function(){ - $(this).removeClass("admin-links-hover"); return true; - } - ); - } - }; - - $(Drupal.Panels.autoAttach); -})(jQuery); diff --git a/sites/all/modules/panels/panels.api.php b/sites/all/modules/panels/panels.api.php new file mode 100644 index 0000000..1aa1c6a --- /dev/null +++ b/sites/all/modules/panels/panels.api.php @@ -0,0 +1,264 @@ +mini_panels_display_cache = $cache; + $handler->edit_cache_set_key($item, $argument); +} + +/** + * Allow modules to provide their own caching mechanism for the display editor. + * + * @param string $argument + * The second half of the cache key. Full key module:TASK_NAME:HANDLER_NAME + * passed part: TASK_NAME:HANDLER_NAME + * + * @return stdClass|NULL + * The cached display or NULL if the cache wasn't hit. + */ +function hook_panels_cache_get($argument) { + ctools_include('common', 'panels'); + list($handler, $item) = _panels_mini_panels_cache_get($argument); + if (isset($item->mini_panels_display_cache)) { + return $item->mini_panels_display_cache; + } + + $cache = new stdClass(); + $cache->display = $item->display; + $cache->display->context = ctools_context_load_contexts($item); + $cache->display->cache_key = 'panels_mini:' . $argument; + $cache->content_types = panels_common_get_allowed_types('panels_mini', $cache->display->context); + $cache->display_title = TRUE; + + // @TODO support locking. + $cache->locked = FALSE; + + return $cache; +} + +/** + * Allow modules to provide their own caching mechanism for the display editor. + * + * @param string $argument + * The second half of the cache key. Full key module:TASK_NAME:HANDLER_NAME + * passed part: TASK_NAME:HANDLER_NAME + * @param stdClass $cache + * The display to cache. + * + * @return stdClass + * The cached display. + */ +function hook_panels_cache_save($argument, $cache) { + list($handler, $item) = _panels_mini_panels_cache_get($argument); + $item->display = $cache->display; + panels_mini_save($item); + + $handler->edit_cache_clear($item); + + return $item; +} + +/** + * Allow modules to provide their own caching mechanism for the display editor. + * + * @param string $argument + * The second half of the cache key. Full key module:TASK_NAME:HANDLER_NAME + * passed part: TASK_NAME:HANDLER_NAME + * @param stdClass $cache + * The cached display. + */ +function hook_panels_cache_clear($argument, $cache) { + list($handler, $item) = _panels_mini_panels_cache_get($argument); + $handler->edit_cache_clear($item); +} + +/** + * Allow modules to adjust the rendering array of the panels dashboard. + * + * @param array $vars + * The output variables. + */ +function hook_panels_dashboard_blocks(&$vars) { + $vars['links']['panels_node'] = array( + 'title' => l(t('Panel node'), 'node/add/panel'), + 'description' => t('Panel nodes are node content and appear in your searches, but are more limited than panel pages.'), + 'weight' => -1, + ); +} + +/** + * Allow to alter the pane content to render. + * + * This happens after the keyword substitution. + * + * @param stdClass $content + * The content block to render. + * @param stdClass $pane + * The pane object. + * @param array $args + * The display arguments. + * @param array $contexts + * Array with the used contexts. + */ +function hook_panels_pane_content_alter($content, $pane, $args, $contexts) { + // Don't display titles. + unset($content->title); +} + +/** + * Allow modules to provide a mechanism to break locks. + * + * @param string $argument + * The second half of the cache key. Full key module:TASK_NAME:HANDLER_NAME + * passed part: TASK_NAME:HANDLER_NAME + * @param stdClass $cache + * The cached display. + */ +function hook_panels_edit_cache_break_lock($argument, $cache) { + $cache->locked = FALSE; +} + +/** + * Fired before a panels display is rendered. + * + * Last chance to modify the panels display or add output before the keyword + * substitution runs and the panels display is rendered. + * + * @param panels_display $panels_display + * The panels display that will be rendered. + * @param stdClass $renderer + * The renderer object that will be used to render. + * + * @return string + * Additional output to add before the panels display. + */ +function hook_panels_pre_render($panels_display, $renderer) { + $translation = i18n_string_object_translate('panels_display_configuration', $panels_display); + $panels_display->title = $translation->title; +} + +/** + * Fired after a panels display is rendered. + * + * Allow to add additional output after the output of the panels display. + * + * @param panels_display $panels_display + * The rendered panels display. + * @param stdClass $renderer + * The used renderer object. + * + * @return string + * Additional output to add after the panels display. + */ +function hook_panels_post_render($panels_display, $renderer) { + return t('Output proudly sponsored by panels.'); +} + +/** + * Fired before a new pane is inserted in the storage. + * + * @param stdClass $pane + * Pane that will be rendered. + */ +function hook_panels_pane_insert($pane) { + // Check if this pane has a custom title enabled. + if (!empty($pane->configuration['override_title'])) { + $translation_object = (object) array( + 'pid' => $pane->pid, + 'title' => $pane->configuration['override_title_text'], + ); + $status = i18n_string_object_update('panels_pane_configuration', $translation_object); + } +} + +/** + * Fired before a changed pane is updated in the storage. + * + * @param stdClass $pane + * Pane that will be rendered. + */ +function hook_panels_pane_update($pane) { + // Check if this pane has a custom title enabled. + if (!empty($pane->configuration['override_title'])) { + $translation_object = (object) array( + 'pid' => $pane->pid, + 'title' => $pane->configuration['override_title_text'], + ); + $status = i18n_string_object_update('panels_pane_configuration', $translation_object); + } +} + +/** + * Fired before a panel is rendered. + * + * Last chance to modify the pane before the keyword substitution runs and the + * pane is rendered. + * + * @param stdClass $pane + * Pane that will be rendered. + */ +function hook_panels_pane_prerender($pane) { + // Check if this pane has a custom title enabled. + if (!empty($pane->configuration['override_title'])) { + $translation_object = (object) array( + 'pid' => $pane->pid, + 'title' => $pane->configuration['override_title_text'], + ); + $translation_object = i18n_string_object_translate('panels_pane_configuration', $translation_object); + $pane->configuration['override_title_text'] = $translation_object->title; + } +} + +/** + * Fired before panes are deleted. + * + * @param array $pids + * Array with the panel id's to delete. + */ +function hook_panels_pane_delete($pids) { + foreach ($pids as $pid) { + // Create dummy pane with pid as property. + $pane = (object) array('pid' => $pid); + i18n_string_object_remove('panels_pane_configuration', $pane); + } +} + +/** + * Fired after a display is saved. + * + * @param panels_display $display + * The display to save. + */ +function hook_panels_display_save($display) { + i18n_string_object_update('display_configuration', $display); +} + +/** + * Fired before a display is deleted. + * + * @param integer $did + * Id of the display to delete. + */ +function hook_panels_delete_display($did) { + $uuid = db_select('panels_display') + ->fields('panels_display', array('uuid')) + ->condition('did', $did) + ->execute() + ->fetchColumn(); + $display = (object) array('uuid' => $uuid); + i18n_string_object_remove('display_configuration', $display); +} diff --git a/sites/all/modules/panels/panels.info b/sites/all/modules/panels/panels.info index 691f396..92db1d7 100644 --- a/sites/all/modules/panels/panels.info +++ b/sites/all/modules/panels/panels.info @@ -10,9 +10,9 @@ files[] = includes/legacy.inc files[] = includes/plugins.inc files[] = plugins/views/panels_views_plugin_row_fields.inc -; Information added by drupal.org packaging script on 2013-03-02 -version = "7.x-3.3+39-dev" +; Information added by Drupal.org packaging script on 2016-08-20 +version = "7.x-3.7" core = "7.x" project = "panels" -datestamp = "1362187383" +datestamp = "1471704242" diff --git a/sites/all/modules/panels/panels.install b/sites/all/modules/panels/panels.install index 6e83d44..ca997d2 100644 --- a/sites/all/modules/panels/panels.install +++ b/sites/all/modules/panels/panels.install @@ -17,7 +17,7 @@ function panels_requirements_install() { // Assume that if the user is running an installation profile that both // Panels and CTools are the same release. if (!(defined('MAINTENANCE_MODE') && MAINTENANCE_MODE == 'install')) { - // apparently the install process doesn't include .module files, + // Apparently the install process doesn't include .module files, // so we need to force the issue in order for our versioning // check to work. if (!defined('PANELS_REQUIRED_CTOOLS_API')) { @@ -30,24 +30,81 @@ function panels_requirements_install() { include_once drupal_get_path('module', 'ctools') . '/ctools.module'; } if (!module_invoke('ctools', 'api_version', PANELS_REQUIRED_CTOOLS_API)) { - $requirements['panels_ctools'] = array( - 'title' => $t('CTools API Version'), - 'value' => CTOOLS_API_VERSION, - 'severity' => REQUIREMENT_ERROR, - 'description' => t('The CTools API version is too old for Panels. Panels needs at least %version.', array('%version' => PANELS_REQUIRED_CTOOLS_API)) - ); + $requirements['panels_ctools'] = array( + 'title' => $t('CTools API Version'), + 'value' => CTOOLS_API_VERSION, + 'severity' => REQUIREMENT_ERROR, + 'description' => t('The CTools API version is too old for Panels. Panels needs at least %version.', array('%version' => PANELS_REQUIRED_CTOOLS_API)), + ); } } return $requirements; } /** - * Implementation of hook_schema(). + * Implements of hook_schema(). */ function panels_schema() { - // This should always point to our 'current' schema. This makes it relatively easy - // to keep a record of schema as we make changes to it. - return panels_schema_4(); + // This should always point to our 'current' schema. This makes it relatively + // easy to keep a record of schema as we make changes to it. + return panels_schema_8(); +} + +function panels_schema_8() { + $schema = panels_schema_7(); + + // Add the storage type and id columns. + $schema['panels_display']['fields']['storage_type'] = array( + 'type' => 'varchar', + 'length' => 255, + 'default' => '', + ); + $schema['panels_display']['fields']['storage_id'] = array( + 'type' => 'varchar', + 'length' => 255, + 'default' => '', + ); + + return $schema; +} + +function panels_schema_7() { + $schema = panels_schema_6(); + + // Update field lengths to 255 chars. + $schema['panels_pane']['fields']['subtype']['length'] = '255'; + $schema['panels_pane']['fields']['panel']['length'] = '255'; + $schema['panels_pane']['fields']['type']['length'] = '255'; + + return $schema; +} + +function panels_schema_6() { + $schema = panels_schema_5(); + + $schema['cache_panels'] = drupal_get_schema_unprocessed('system', 'cache'); + + return $schema; +} + +function panels_schema_5() { + $schema = panels_schema_4(); + + $schema['panels_display']['fields']['uuid'] = array( + 'type' => 'char', + 'length' => '36', + ); + $schema['panels_display']['export']['key'] = 'uuid'; + $schema['panels_display']['export']['key name'] = 'UUID'; + + $schema['panels_pane']['fields']['uuid'] = array( + 'type' => 'char', + 'length' => '36', + ); + $schema['panels_pane']['export']['key'] = 'uuid'; + $schema['panels_pane']['export']['key name'] = 'UUID'; + + return $schema; } function panels_schema_4() { @@ -375,3 +432,178 @@ function panels_update_7301() { return t('panels_pane.lock field already existed, update skipped.'); } + +/** + * Adding universally unique identifiers to panels. + * + * Note: This update hook is not written well. It calls apis which uses the + * most updated drupal database, causing missing columns or tables errors. To + * mitigate the issue, we've added updates from 7303 and 7305. Future updates + * should go below the 7305 update. + * + * See https://www.drupal.org/node/2787123 for more info. + */ +function panels_update_7302() { + if (!module_load_include('inc', 'ctools', 'includes/uuid')) { + throw new DrupalUpdateException(t('Ctools UUID support not detected. You must update to a more recent version of the ctools module.')); + } + // Run the 7303 update first to avoid caching issues. + // This *probably* should be placed right above update 7305, however it was + // tested here and re-testing this update is difficult, so it stays here. + panels_update_7303(); + + // Load the schema. + $schema = panels_schema_5(); + $msg = array(); + + // Add the uuid column to the pane table. + $table = 'panels_pane'; + $field = 'uuid'; + // Due to a previous failure, the column may already exist: + if (!db_field_exists($table, $field)) { + $spec = $schema[$table]['fields'][$field]; + db_add_field($table, $field, $spec); + $msg[] = t('Added panels_pane.uuid column.'); + } + + // Add the uuid column to the display table. + $table = 'panels_display'; + $field = 'uuid'; + // Due to a previous failure, the column may already exist: + if (!db_field_exists($table, $field)) { + $spec = $schema[$table]['fields'][$field]; + db_add_field($table, $field, $spec); + $msg[] = t('Added panels_display.uuid column.'); + } + + if (empty($msg)) { + $msg[] = t('UUID column already present in the panels_display & panels_pane tables.'); + } + + // Update all DB-based panes & displays to ensure that they all contain a UUID. + $display_dids = db_select('panels_display') + ->fields('panels_display', array('did')) + ->condition(db_or() + ->condition('uuid', '') + ->isNull('uuid') + ) + ->execute() + ->fetchCol(); + + // Check the panes as well, for paranoia. + $pane_dids = db_select('panels_pane') + ->distinct() + ->fields('panels_pane', array('did')) + ->condition(db_or() + ->condition('uuid', '') + ->isNull('uuid') + ) + ->execute() + ->fetchCol(); + + $dids = array_unique(array_merge($display_dids, $pane_dids)); + + // Before using panels_save_display(), we have to make sure any new fields + // are added from future updates. + panels_update_7305(); + + // If the Panels module is disabled we don't have access to + // panels_load_displays(). + if (!function_exists('panels_load_displays')) { + module_load_include('module', 'panels'); + } + if ($displays = panels_load_displays($dids)) { + foreach ($displays as $display) { + // A display save also triggers pane saves. + panels_save_display($display); + } + $msg[] = t('Generated UUIDs for database-based panel displays and panes.'); + } + else { + $msg[] = t('No database-based panel displays or panes for which to generate UUIDs.'); + } + + return implode("\n", $msg); +} + +/** + * Add a custom cache table for Panels. + */ +function panels_update_7303() { + $schema = panels_schema_6(); + + $table_name = 'cache_panels'; + if (!db_table_exists($table_name)) { + db_create_table($table_name, $schema[$table_name]); + } +} + +/** + * Update "panels_pane" table field lengths to 255 chars. + */ +function panels_update_7304() { + $schema = panels_schema_7(); + + $update_fields = array( + 'panels_pane' => array('subtype', 'panel', 'type'), + ); + + foreach($update_fields as $table => $fields) { + foreach($fields as $field_name) { + db_change_field($table, $field_name, $field_name, $schema[$table]['fields'][$field_name]); + } + } +} + +/** + * Add the "storage_type" and "storage_id" columns to "panels_display". + */ +function panels_update_7305() { + $schema = panels_schema_8(); + + $new_fields = array( + 'panels_display' => array('storage_type', 'storage_id'), + ); + + foreach ($new_fields as $table => $fields) { + foreach ($fields as $field_name) { + // Due to a previous failure, the column may already exist: + if (!db_field_exists($table, $field_name)) { + db_add_field($table, $field_name, $schema[$table]['fields'][$field_name]); + } + } + } +} + +/** + * Set the storage type and id on existing page manager panels displays. + */ +function panels_update_7306() { + if (!db_table_exists('page_manager_handlers')) { + return t('Skipping update - page_manager is not installed.'); + } + + // Get all page_manager_handlers that have a panels context. + $result = db_query("SELECT pm.name, pm.conf FROM {page_manager_handlers} pm WHERE pm.handler = 'panel_context'"); + $page_manager_panels = array(); + foreach ($result as $row) { + $conf = unserialize($row->conf); + if (isset($conf['did'])) { + $page_manager_panels[$conf['did']] = $row->name; + } + } + + if (!empty($page_manager_panels)) { + // Check panels displays that only have empty storage types + $result = db_query("SELECT pd.did FROM {panels_display} pd WHERE pd.did IN (:dids) AND storage_type = ''", array(':dids' => array_keys($page_manager_panels))); + foreach ($result as $row) { + db_update('panels_display') + ->fields(array( + 'storage_type' => 'page_manager', + 'storage_id' => $page_manager_panels[$row->did], + )) + ->condition('did', $row->did) + ->execute(); + } + } +} diff --git a/sites/all/modules/panels/panels.module b/sites/all/modules/panels/panels.module index 905ff37..4b8c731 100644 --- a/sites/all/modules/panels/panels.module +++ b/sites/all/modules/panels/panels.module @@ -6,7 +6,22 @@ * Core functionality for the Panels engine. */ -define('PANELS_REQUIRED_CTOOLS_API', '2.0-alpha'); +define('PANELS_REQUIRED_CTOOLS_API', '2.0.8'); + +/** + * The current working panels version. + * + * In a release, it should be 7.x-3.x, which should match what drush make will + * create. In a dev format, it should be 7.x-3.(x+1)-dev, which will allow + * modules depending on new features in panels to depend on panels > 7.x-3.x. + * + * To define a specific version of Panels as a dependency for another module, + * simply include a dependency line in that module's info file, e.g.: + * ; Requires Panels v7.x-3.4 or newer. + * dependencies[] = panels (>=3.4) + */ +define('PANELS_VERSION', '7.x-3.6'); + define('PANELS_TITLE_FIXED', 0); // Hide title use to be true/false. So false remains old behavior. define('PANELS_TITLE_NONE', 1); // And true meant no title. @@ -43,7 +58,7 @@ function panels_theme() { 'variables' => array('id' => NULL, 'image' => NULL, 'title' => NULL), ); $theme['panels_pane'] = array( - 'variables' => array('output' => array(), 'pane' => array(), 'display' => array()), + 'variables' => array('content' => array(), 'pane' => array(), 'display' => array()), 'path' => drupal_get_path('module', 'panels') . '/templates', 'template' => 'panels-pane', ); @@ -258,7 +273,6 @@ function panels_init() { } ctools_add_css('panels', 'panels'); - ctools_add_js('panels', 'panels'); } /** @@ -270,7 +284,7 @@ function panels_permission() { return array( 'use panels dashboard' => array( 'title' => t("Use Panels Dashboard"), - 'description' => t("Allows a user to access the !link.", array('!link' => l('Panels Dashboard', 'admin/structure/panels'))), + 'description' => t('Allows a user to access the Panels Dashboard.', array('@url' => url('admin/structure/panels'))), ), 'view pane admin links' => array( // @todo 'title' => t("View administrative links on Panel panes"), @@ -288,6 +302,11 @@ function panels_permission() { 'title' => t("Change layouts with the Panels In-Place Editor"), 'description' => t("Allows a user to change layouts with the IPE."), ), + 'bypass access in place editing' => array( + 'title' => t("Bypass access checks when using Panels In-Place Editor"), + 'description' => t("Allows using IPE even if user does not have additional permissions granted by other modules."), + 'restrict access' => TRUE, + ), 'administer advanced pane settings' => array( 'title' => t("Configure advanced settings on Panel panes"), 'description' => t(""), @@ -316,15 +335,13 @@ function panels_permission() { } /** - * Implementation of hook_flush_caches(). - * - * We implement this so that we can be sure our legacy rendering state setting - * in $conf is updated whenever caches are cleared. + * Implements hook_flush_caches(). */ -//function panels_flush_caches() { -// $legacy = panels_get_legacy_state(); -// $legacy->determineStatus(); -//} +function panels_flush_caches() { + if (db_table_exists('cache_panels')) { + return array('cache_panels'); + } +} // --------------------------------------------------------------------------- // CTools hook implementations @@ -381,6 +398,7 @@ function panels_ctools_plugin_type() { 'display_renderers' => array( 'classes' => array('renderer'), ), + 'panels_storage' => array(), ); } @@ -635,7 +653,6 @@ function panels_edit_layout($display, $finish, $destination = NULL, $allowed_lay /** * Forms the basis of a panel display - * */ class panels_display { var $args = array(); @@ -656,8 +673,10 @@ class panels_display { $pane->panel = $location; } - // Get a temporary pid for this pane. - $pane->pid = "new-" . $this->next_new_pid(); + // Generate a permanent uuid for this pane, and use + // it as a temporary pid. + $pane->uuid = ctools_uuid_generate(); + $pane->pid = 'new-' . $pane->uuid; // Add the pane to the approprate spots. $this->content[$pane->pid] = &$pane; @@ -671,23 +690,10 @@ class panels_display { function clone_pane($pid) { $pane = clone $this->content[$pid]; + $pane->uuid = ctools_uuid_generate(); return $pane; } - function next_new_pid() { - // We don't use static vars to record the next new pid because - // temporary pids can last for years in exports and in caching - // during editing. - $id = array(0); - foreach (array_keys($this->content) as $pid) { - if (!is_numeric($pid)) { - $id[] = substr($pid, 4); - } - } - $next_id = max($id); - return ++$next_id; - } - /** * Get the title from a display. * @@ -758,6 +764,55 @@ class panels_display { } return $output; } + + /** + * Determine if the given user can perform the requested operation. + * + * @param string $op + * An operation like: create, read, update, or delete. + * @param object $account + * (optional) The account to check access for. + * + * @return bool + * TRUE if access is granted; otherwise FALSE. + */ + function access($op, $account = NULL) { + global $user; + + if (!$account) { + $account = $user; + } + + // Even administrators need to go through the access system. However, to + // support legacy plugins, user 1 gets full access no matter what. + if ($account->uid == 1) { + return TRUE; + } + + if (!in_array($op, array('create', 'read', 'update', 'delete', 'change layout'))) { + return FALSE; + } + + if (empty($this->storage_type) || empty($this->storage_id)) { + return FALSE; + } + + if ($this->storage_type == 'unknown') { + return FALSE; + } + + $storage_plugin = panels_get_panels_storage_plugin($this->storage_type); + if (!$storage_plugin) { + return FALSE; + } + + $access_callback = panels_plugin_get_function('panels_storage', $storage_plugin, 'access callback'); + if (!$access_callback) { + return FALSE; + } + + return $access_callback($this->storage_type, $this->storage_id, $op, $account); + } } /** @@ -791,6 +846,7 @@ function panels_new_pane($type, $subtype, $set_defaults = FALSE) { $content_subtype = ctools_content_get_subtype($content_type, $subtype); $pane->configuration = ctools_content_get_defaults($content_type, $content_subtype); } + drupal_alter('panels_new_pane', $pane); return $pane; } @@ -871,10 +927,13 @@ function panels_load_display($did) { * * @ingroup mainapi * - * Note a new $display only receives a real did once it is run through this function. - * Until then, it uses a string placeholder, 'new', in place of a real did. The same - * applies to all new panes (whether on a new $display or not); in addition, - * panes have sequential numbers appended, of the form 'new-1', 'new-2', etc. + * Note that a new $display only receives a real did once it is run through + * this function, and likewise for the pid of any new pane. + * + * Until then, a new display uses a string placeholder, 'new', in place of + * a real did, and a new pane (whether on a new $display or not) appends a + * universally-unique identifier (which is stored permanently in the 'uuid' + * field). This format is also used in place of the real pid for exports. * * @param object $display instanceof panels_display \n * The display object to be saved. Passed by reference so the caller need not use @@ -884,6 +943,9 @@ function panels_load_display($did) { */ function panels_save_display(&$display) { $update = (isset($display->did) && is_numeric($display->did)) ? array('did') : array(); + if (empty($display->uuid) || !ctools_uuid_is_valid($display->uuid)) { + $display->uuid = ctools_uuid_generate(); + } drupal_write_record('panels_display', $display, $update); $pids = array(); @@ -914,11 +976,26 @@ function panels_save_display(&$display) { $pane->did = $display->did; $old_pid = $pane->pid; + + if (empty($pane->uuid) || !ctools_uuid_is_valid($pane->uuid)) { + $pane->uuid = ctools_uuid_generate(); + } + drupal_write_record('panels_pane', $pane, is_numeric($pid) ? array('pid') : array()); + // Allow other modules to take action after a pane is saved. + if ($pane->pid == $old_pid) { + module_invoke_all('panels_pane_update', $pane); + } + else { + module_invoke_all('panels_pane_insert', $pane); + } + if ($pane->pid != $old_pid) { - // and put it back so our pids and positions can be used - unset($display->content[$id]); + // Remove the old new-* entry from the displays content. + unset($display->content[$pid]); + + // and put it back so our pids and positions can be used. $display->content[$pane->pid] = $pane; // If the title pane was one of our panes that just got its ID changed, @@ -949,6 +1026,8 @@ function panels_save_display(&$display) { $display->panels[$id] = $new_panes; } if (!empty($pids)) { + // Allow other modules to take action before a panes are deleted. + module_invoke_all('panels_pane_delete', $pids); db_delete('panels_pane')->condition('pid', $pids)->execute(); } @@ -982,6 +1061,7 @@ function panels_delete_display($display) { else { $did = $display; } + module_invoke_all('panels_delete_display', $did); db_delete('panels_display')->condition('did', $did)->execute(); db_delete('panels_pane')->condition('did', $did)->execute(); } @@ -991,9 +1071,11 @@ function panels_delete_display($display) { * * This function is primarily intended as a mechanism for cloning displays. * It generates an exact replica (in code) of the provided $display, with - * the exception that it replaces all ids (dids and pids) with 'new-*' values. - * Only once panels_save_display() is called on the code version of $display will - * the exported display written to the database and permanently saved. + * the exception that it replaces all ids (dids and pids) with place-holder + * values (consisting of the display or pane's uuid, with a 'new-' prefix). + * + * Only once panels_save_display() is called on the code version of $display + * will the exported display be written to the database and permanently saved. * * @see panels_page_export() or _panels_page_fetch_display() for sample implementations. * @@ -1015,10 +1097,12 @@ function panels_delete_display($display) { */ function panels_export_display($display, $prefix = '') { ctools_include('export'); + if (empty($display->uuid) || !ctools_uuid_is_valid($display->uuid)) { + $display->uuid = ctools_uuid_generate(); + } + $display->did = 'new-' . $display->uuid; $output = ctools_export_object('panels_display', $display, $prefix); - $pid_counter = &drupal_static(__FUNCTION__, 0); - // Initialize empty properties. $output .= $prefix . '$display->content = array()' . ";\n"; $output .= $prefix . '$display->panels = array()' . ";\n"; @@ -1028,17 +1112,22 @@ function panels_export_display($display, $prefix = '') { if (!empty($display->content)) { $region_counters = array(); foreach ($display->content as $pane) { - $pid = 'new-' . ++$pid_counter; + + if (!isset($pane->uuid) || !ctools_uuid_is_valid($pane->uuid)) { + $pane->uuid = ctools_uuid_generate(); + } + $pid = 'new-' . $pane->uuid; + if ($pane->pid == $display->title_pane) { $title_pid = $pid; } $pane->pid = $pid; - $output .= ctools_export_object('panels_pane', $pane, $prefix . ' '); - $output .= "$prefix " . '$display->content[\'' . $pane->pid . '\'] = $pane' . ";\n"; + $output .= ctools_export_object('panels_pane', $pane, $prefix); + $output .= $prefix . '$display->content[\'' . $pane->pid . '\'] = $pane' . ";\n"; if (!isset($region_counters[$pane->panel])) { $region_counters[$pane->panel] = 0; } - $output .= "$prefix " . '$display->panels[\'' . $pane->panel . '\'][' . $region_counters[$pane->panel]++ .'] = \'' . $pane->pid . "';\n"; + $output .= $prefix . '$display->panels[\'' . $pane->panel . '\'][' . $region_counters[$pane->panel]++ .'] = \'' . $pane->pid . "';\n"; } } $output .= $prefix . '$display->hide_title = '; @@ -1288,6 +1377,7 @@ function template_preprocess_panels_pane(&$vars) { $vars['pane_suffix'] = !empty($content->pane_suffix) ? $content->pane_suffix : ''; $vars['title'] = !empty($content->title) ? $content->title : ''; + $vars['title_heading'] = !empty($content->title_heading) ? $content->title_heading : variable_get('override_title_heading', 'h2'); $vars['title_attributes_array']['class'][] = 'pane-title'; $vars['feeds'] = !empty($content->feeds) ? implode(' ', $content->feeds) : ''; @@ -1363,6 +1453,11 @@ function panels_ajax_router() { ctools_include('cleanstring'); $renderer->clean_key = ctools_cleanstring($cache_key); + $op = $renderer->get_panels_storage_op_for_ajax($method); + if (!$cache->display->access($op)) { + return MENU_ACCESS_DENIED; + } + $output = call_user_func_array(array($renderer, $method), $args); if (empty($output) && !empty($renderer->commands)) { @@ -1674,6 +1769,64 @@ function panels_page_wizard_panels_cache_set($key, $cache) { page_manager_set_wizard_cache($wizard_cache); } +/** + * Alter the page wizard basic page, when panels is selected, to inject page + * manager as the storage plugin for panels. + * @param $form + * @param $form_state + */ +function panels_form_page_manager_page_form_basic_alter(&$form, &$form_state) { + $form['#validate'][] = 'panels_page_manager_handler_add_validate'; +} + +/** + * Alter the variant add page, so when panels is selected, page manager is the + * storage plugin for panels. + * @param $form + * @param $form_state + */ +function panels_form_page_manager_handler_add_alter(&$form, &$form_state) { + $form['#validate'][] = 'panels_page_manager_handler_add_validate'; +} + +/** + * Perform the validation check to see if panel context is selected to use + * page manager as the storage plugin. + * @param $form + * @param $form_state + */ +function panels_page_manager_handler_add_validate($form, &$form_state) { + if($form_state['values']['handler'] == 'panel_context') { + $form_state['page']->storage_type = 'page_manager'; + } +} + +/** + * Implements hook_default_page_manager_handlers_alter(). + * + * If a default Panels display has no storage type, set it. + */ +function panels_default_page_manager_handlers_alter(&$handlers) { + foreach ($handlers as &$handler) { + if ($handler->handler == 'panel_context') { + $display =& $handler->conf['display']; + if (empty($display->storage_type)) { + $display->storage_type = 'page_manager'; + $display->storage_id = $handler->name; + } + } + } +} + +/** + * Implements hook_default_page_manager_pages_alter(). + */ +function panels_default_page_manager_pages_alter(&$pages) { + foreach ($pages as &$page) { + panels_default_page_manager_handlers_alter($page->default_handlers); + } +} + // -------------------------------------------------------------------------- // General utility functions @@ -1744,6 +1897,98 @@ function _panels_builder_filter($layout) { return empty($layout['builder']); } +/** + * Implements hook_get_pane_links_alter(). + * + * add links to the Panels pane dropdown menu. + */ +function panels_get_pane_links_alter(&$links, $pane, $content_type) { + if ($pane->type === "block"){ + $prefixed_name = $pane->subtype; + + // breakup the subtype string into parts. + $exploded_subtype = explode('-', $pane->subtype); + + // get the first part of the string. + $subtype_prefix = $exploded_subtype[0]; + + // get the first part of the string and add a hyphen. + $subtype_prefix_hyphen = $exploded_subtype[0] . '-'; + + // remove the prefix block- to get the name. + $name_of_block = ltrim( $prefixed_name, $subtype_prefix_hyphen); + + // check for user added menus created at /admin/structure/menu/add + // menus of that type have a subtype that is prefixed with menu-menu- + if (substr($prefixed_name, 0, 10) === "menu-menu-"){ + // remove the first prefix menu- from menu-menu- to get the name. + $name_of_block = substr($prefixed_name, 5); + + $links['top'][] = array( + 'title' => t('Edit block'), + 'href' => url('admin/structure/block/manage/' . $subtype_prefix . '/' . $name_of_block . '/configure', array('absolute' => TRUE)), + 'attributes' => array('target' => array('_blank')), + ); + + $links['top'][] = array( + 'title' => t('Edit menu links'), + 'href' => url('admin/structure/menu/manage/' . $name_of_block, array('absolute' => TRUE)), + 'attributes' => array('target' => array('_blank')), + ); + } + + // check for module provided menu blocks like Devels or Features + // menus of that type have a subtype that is prefixed with menu- + elseif(substr($prefixed_name, 0, 5) === "menu-"){ + // remove the first prefix menu- to get the name. + $name_of_block = substr($prefixed_name, 5); + + $links['top'][] = array( + 'title' => t('Edit block'), + 'href' => url('admin/structure/block/manage/' . $subtype_prefix . '/' . $name_of_block . '/configure', array('absolute' => TRUE)), + 'attributes' => array('target' => array('_blank')), + ); + + $links['top'][] = array( + 'title' => t('Edit menu links'), + 'href' => url('admin/structure/menu/manage/' . $name_of_block, array('absolute' => TRUE)), + 'attributes' => array('target' => array('_blank')), + ); + } + + // check for system blocks with menu links + elseif(substr($prefixed_name, 0, 7) === "system-") { + // remove the first prefix system- to get the name + $name_of_block = substr($prefixed_name, 7); + + $names_of_system_menus = menu_list_system_menus(); + + $links['top'][] = array( + 'title' => t('Edit block'), + 'href' => url('admin/structure/block/manage/' . $subtype_prefix . '/' . $name_of_block . '/configure', array('absolute' => TRUE)), + 'attributes' => array('target' => array('_blank')), + ); + + if (array_key_exists($name_of_block, $names_of_system_menus)){ + $links['top'][] = array( + 'title' => t('Edit menu links'), + 'href' => url('admin/structure/menu/manage/' . $name_of_block, array('absolute' => TRUE)), + 'attributes' => array('target' => array('_blank')), + ); + } + } + + // for all other blocks without menus + else{ + $links['top'][] = array( + 'title' => t('Edit block'), + 'href' => url('admin/structure/block/manage/' . $subtype_prefix . '/' . $name_of_block . '/configure', array('absolute' => TRUE)), + 'attributes' => array('target' => array('_blank')), + ); + } + } +} + // -------------------------------------------------------------------------- // Deprecated functions // @@ -1763,7 +2008,7 @@ function panels_get_path($file, $base_path = FALSE, $module = 'panels') { function panels_preprocess_html(&$vars) { $panel_body_css = &drupal_static('panel_body_css'); if (!empty($panel_body_css['body_classes_to_remove'])) { - $classes_to_remove = explode(' ', $panel_body_css['body_classes_to_remove']); + $classes_to_remove = array_filter(explode(' ', $panel_body_css['body_classes_to_remove']), 'strlen'); foreach ($vars['classes_array'] as $key => $css_class) { if (in_array($css_class, $classes_to_remove)) { unset($vars['classes_array'][$key]); diff --git a/sites/all/modules/panels/panels_ipe/css/panels_ipe-rtl.css b/sites/all/modules/panels/panels_ipe/css/panels_ipe-rtl.css index ef78afb..abfc50e 100644 --- a/sites/all/modules/panels/panels_ipe/css/panels_ipe-rtl.css +++ b/sites/all/modules/panels/panels_ipe/css/panels_ipe-rtl.css @@ -49,8 +49,8 @@ div.panels-ipe-control .form-submit { padding: 0 34px 2px 0.8em; } -input#panels-ipe-save, -input#panels-ipe-cancel { +#panels-ipe-save, +#panels-ipe-cancel { background-position: 86% 0; } diff --git a/sites/all/modules/panels/panels_ipe/css/panels_ipe.css b/sites/all/modules/panels/panels_ipe/css/panels_ipe.css index ec372c6..e7896e2 100644 --- a/sites/all/modules/panels/panels_ipe/css/panels_ipe.css +++ b/sites/all/modules/panels/panels_ipe/css/panels_ipe.css @@ -241,7 +241,9 @@ div.panels-ipe-handlebar-wrapper li.delete a span { div.panels-ipe-handlebar-wrapper li a:hover, div.panels-ipe-dragtitle span:hover, div.panels-ipe-newblock a:hover, -span.panels-ipe-draghandle-icon:hover { +span.panels-ipe-draghandle-icon:hover, +div.panels-ipe-handlebar-wrapper li a:focus, +div.panels-ipe-newblock a:focus { background: #E6E6E6; background-image: linear-gradient(bottom, #C5C5C5 0%, #FAFAFA 100%); background-image: -o-linear-gradient(bottom, #C5C5C5 0%, #FAFAFA 100%); @@ -382,6 +384,7 @@ div.panels-ipe-control .form-submit { div.panels-ipe-control input.panels-ipe-save, div.panels-ipe-control input.panels-ipe-cancel, div.panels-ipe-control input.panels-ipe-save:hover, div.panels-ipe-control input.panels-ipe-cancel:hover, +div.panels-ipe-control input.panels-ipe-save:focus, div.panels-ipe-control input.panels-ipe-cancel:focus, div.panels-ipe-control input.panels-ipe-save:active, div.panels-ipe-control input.panels-ipe-cancel:active { background-repeat: no-repeat; } @@ -394,7 +397,7 @@ div.panels-ipe-pseudobutton-container a { text-decoration: none; } -div.panels-ipe-control input.panels-ipe-save { +div.panels-ipe-control .panels-ipe-save { background-image: url(../images/icon-save.png); background-image: url(../images/icon-save.png), linear-gradient(bottom, #383838 0%, #666666 100%); background-image: url(../images/icon-save.png), -o-linear-gradient(bottom, #383838 0%, #666666 100%); @@ -411,7 +414,7 @@ div.panels-ipe-control input.panels-ipe-save { ); } -div.panels-ipe-control input.panels-ipe-cancel { +div.panels-ipe-control .panels-ipe-cancel { background-image: url(../images/icon-close.png); background-image: url(../images/icon-close.png), linear-gradient(bottom, #383838 0%, #666666 100%); background-image: url(../images/icon-close.png), -o-linear-gradient(bottom, #383838 0%, #666666 100%); @@ -429,7 +432,9 @@ div.panels-ipe-control input.panels-ipe-cancel { } div.panels-ipe-pseudobutton-container:hover, -div.panels-ipe-control .form-submit:hover { +div.panels-ipe-control .form-submit:hover, +div.panels-ipe-pseudobutton-container:focus, +div.panels-ipe-control .form-submit:focus { background: #999999; background-image: linear-gradient(bottom, #3D3D3D 0%, #999999 100%); background-image: -o-linear-gradient(bottom, #3D3D3D 0%, #999999 100%); @@ -447,11 +452,13 @@ div.panels-ipe-control .form-submit:hover { color: #FFF; } -div.panels-ipe-pseudobutton-container a:hover { +div.panels-ipe-pseudobutton-container a:hover, +div.panels-ipe-pseudobutton-container a:focus { color: #FFF; } -div.panels-ipe-control input.panels-ipe-cancel:hover { +div.panels-ipe-control .panels-ipe-cancel:hover, +div.panels-ipe-control .panels-ipe-cancel:focus { background-image: url(../images/icon-close.png), linear-gradient(bottom, #3D3D3D 0%, #999999 100%); background-image: url(../images/icon-close.png), -o-linear-gradient(bottom, #3D3D3D 0%, #999999 100%); background-image: url(../images/icon-close.png), -moz-linear-gradient(bottom, #3D3D3D 0%, #999999 100%); @@ -467,7 +474,8 @@ div.panels-ipe-control input.panels-ipe-cancel:hover { ); } -div.panels-ipe-control input.panels-ipe-save:hover { +div.panels-ipe-control .panels-ipe-save:hover, +div.panels-ipe-control .panels-ipe-save:focus { background-image: url(../images/icon-save.png), linear-gradient(bottom, #3D3D3D 0%, #999999 100%); background-image: url(../images/icon-save.png), -o-linear-gradient(bottom, #3D3D3D 0%, #999999 100%); background-image: url(../images/icon-save.png), -moz-linear-gradient(bottom, #3D3D3D 0%, #999999 100%); @@ -507,7 +515,7 @@ div.panels-ipe-pseudobutton-container a:active { color: #CCC; } -div.panels-ipe-control input.panels-ipe-cancel:active { +div.panels-ipe-control .panels-ipe-cancel:active { background-image: url(../images/icon-close.png), linear-gradient(bottom, #616161 0%, #333333 100%); background-image: url(../images/icon-close.png), -o-linear-gradient(bottom, #616161 0%, #333333 100%); background-image: url(../images/icon-close.png), -moz-linear-gradient(bottom, #616161 0%, #333333 100%); @@ -523,7 +531,7 @@ div.panels-ipe-control input.panels-ipe-cancel:active { ); } -div.panels-ipe-control input.panels-ipe-save:active { +div.panels-ipe-control .panels-ipe-save:active { background-image: url(../images/icon-save.png), linear-gradient(bottom, #616161 0%, #333333 100%); background-image: url(../images/icon-save.png), -o-linear-gradient(bottom, #616161 0%, #333333 100%); background-image: url(../images/icon-save.png), -moz-linear-gradient(bottom, #616161 0%, #333333 100%); @@ -539,6 +547,12 @@ div.panels-ipe-control input.panels-ipe-save:active { ); } +div.panels-ipe-control .panels-ipe-save, div.panels-ipe-control .panels-ipe-cancel, +div.panels-ipe-control .panels-ipe-save:hover, div.panels-ipe-control .panels-ipe-cancel:hover, +div.panels-ipe-control .panels-ipe-save:active, div.panels-ipe-control .panels-ipe-cancel:active { + background-repeat: no-repeat; +} + div.panels-ipe-pseudobutton-container a.panels-ipe-startedit { padding-left: 34px; background: url(../images/icon-configure.png) no-repeat 10px 9px; @@ -557,3 +571,7 @@ div.panels-ipe-button-container { form#panels-ipe-edit-control-form { text-align: center; } + +.panels-ipe-dragbar-admin-title{ + font-size: 0.9em; +} diff --git a/sites/all/modules/panels/panels_ipe/js/panels_ipe.js b/sites/all/modules/panels/panels_ipe/js/panels_ipe.js index 1f40698..f6cae92 100644 --- a/sites/all/modules/panels/panels_ipe/js/panels_ipe.js +++ b/sites/all/modules/panels/panels_ipe/js/panels_ipe.js @@ -2,12 +2,7 @@ // Ensure the $ alias is owned by jQuery. (function($) { -// randomly lock a pane. -// @debug only Drupal.settings.Panels = Drupal.settings.Panels || {}; -Drupal.settings.Panels.RegionLock = { - 10: { 'top': false, 'left': true, 'middle': true } -} Drupal.PanelsIPE = { editors: {}, @@ -31,6 +26,17 @@ Drupal.PanelsIPE = { Drupal.behaviors.PanelsIPE = { attach: function(context) { + // Remove any old editors. + for (var i in Drupal.PanelsIPE.editors) { + if (Drupal.settings.PanelsIPECacheKeys.indexOf(i) === -1) { + // Clean-up a little bit and remove it. + Drupal.PanelsIPE.editors[i].editing = false; + Drupal.PanelsIPE.editors[i].changed = false; + delete Drupal.PanelsIPE.editors[i]; + } + } + + // Initialize new editors. for (var i in Drupal.settings.PanelsIPECacheKeys) { var key = Drupal.settings.PanelsIPECacheKeys[i]; $('div#panels-ipe-display-' + key + ':not(.panels-ipe-processed)') @@ -213,9 +219,11 @@ function DrupalPanelsIPE(cache_key, cfg) { $('div.panels-ipe-sort-container', ipe.topParent).bind('sortstop', this.enableRegions); + // Refresh the control jQuery object. + ipe.control = $(ipe.control.selector); $('.panels-ipe-form-container', ipe.control).append(formdata); - $('input:submit:not(.ajax-processed)', ipe.control).addClass('ajax-processed').each(function() { + $('input:submit:not(.ajax-processed), button:not(.ajax-processed)', ipe.control).addClass('ajax-processed').each(function() { var element_settings = {}; element_settings.url = $(this.form).attr('action'); @@ -233,7 +241,7 @@ function DrupalPanelsIPE(cache_key, cfg) { // it clears out inline styles. $('.panels-ipe-on').show(); ipe.showForm(); - ipe.topParent.addClass('panels-ipe-editing'); + $('body').add(ipe.topParent).addClass('panels-ipe-editing'); }; @@ -264,12 +272,16 @@ function DrupalPanelsIPE(cache_key, cfg) { // Re-show all the IPE non-editing meta-elements $('div.panels-ipe-off').show('fast'); + // Refresh the container and control jQuery objects. + ipe.container = $(ipe.container.selector); + ipe.control = $(ipe.control.selector); + ipe.showButtons(); // Re-hide all the IPE meta-elements $('div.panels-ipe-on').hide(); $('.panels-ipe-editing').removeClass('panels-ipe-editing'); - $('div.panels-ipe-sort-container', ipe.topParent).sortable("destroy"); + $('div.panels-ipe-sort-container.ui-sortable', ipe.topParent).sortable("destroy"); }; this.saveEditing = function() { @@ -285,7 +297,7 @@ function DrupalPanelsIPE(cache_key, cfg) { val += id; } }); - $('input[name="panel[pane][' + region + ']"]', ipe.control).val(val); + $('[name="panel[pane][' + region + ']"]', ipe.control).val(val); }); } @@ -322,7 +334,7 @@ function DrupalPanelsIPE(cache_key, cfg) { this.createSortContainers = function() { $('div.panels-ipe-region', this.topParent).each(function() { - $('div.panels-ipe-portlet-marker', this).parent() + $(this).children('div.panels-ipe-portlet-marker').parent() .wrapInner('
    '); // Move our gadgets outside of the sort container so that sortables @@ -330,9 +342,6 @@ function DrupalPanelsIPE(cache_key, cfg) { $('div.panels-ipe-portlet-static', this).each(function() { $(this).prependTo($(this).parent().parent()); }); - - // Also remove the last panel separator. - $('div.panel-separator', this).filter(':last').remove(); }); } @@ -386,6 +395,34 @@ $(function() { } }; + Drupal.ajax.prototype.commands.insertNewPane = function(ajax, data, status) { + IPEContainerSelector = '#panels-ipe-regionid-' + data.regionId + ' div.panels-ipe-sort-container'; + firstPaneSelector = IPEContainerSelector + ' div.panels-ipe-portlet-wrapper:first'; + // Insert the new pane before the first existing pane in the region, if + // any. + if ($(firstPaneSelector).length) { + insertData = { + 'method': 'before', + 'selector': firstPaneSelector, + 'data': data.renderedPane, + 'settings': null + } + Drupal.ajax.prototype.commands.insert(ajax, insertData, status); + } + // Else, insert it as a first child of the container. Doing so might fall + // outside of the wrapping markup for the style, but it's the best we can + // do. + else { + insertData = { + 'method': 'prepend', + 'selector': IPEContainerSelector, + 'data': data.renderedPane, + 'settings': null + } + Drupal.ajax.prototype.commands.insert(ajax, insertData, status); + } + }; + /** * Override the eventResponse on ajax.js so we can add a little extra * behavior. diff --git a/sites/all/modules/panels/panels_ipe/panels_ipe.api.php b/sites/all/modules/panels/panels_ipe/panels_ipe.api.php new file mode 100644 index 0000000..e026c5b --- /dev/null +++ b/sites/all/modules/panels/panels_ipe/panels_ipe.api.php @@ -0,0 +1,31 @@ +context['panelizer'])) { + return NULL; + } + + if ($display->context['panelizer']->type[0] == 'entity:node') { + // Allow or deny IPE access based on node type. + return $display->context['panelizer']->data->type == 'awesome_page'; + } + + // Otherwise, deny access to everything! + return FALSE; +} diff --git a/sites/all/modules/panels/panels_ipe/panels_ipe.info b/sites/all/modules/panels/panels_ipe/panels_ipe.info index 4ca4cfe..02418db 100644 --- a/sites/all/modules/panels/panels_ipe/panels_ipe.info +++ b/sites/all/modules/panels/panels_ipe/panels_ipe.info @@ -1,14 +1,15 @@ name = Panels In-Place Editor description = Provide a UI for managing some Panels directly on the frontend, instead of having to use the backend. package = "Panels" +version = PANELS_VERSION dependencies[] = panels core = 7.x configure = admin/structure/panels files[] = panels_ipe.module -; Information added by drupal.org packaging script on 2013-03-02 -version = "7.x-3.3+39-dev" +; Information added by Drupal.org packaging script on 2016-08-20 +version = "7.x-3.7" core = "7.x" project = "panels" -datestamp = "1362187383" +datestamp = "1471704242" diff --git a/sites/all/modules/panels/panels_ipe/panels_ipe.module b/sites/all/modules/panels/panels_ipe/panels_ipe.module index c309684..7fd5d79 100644 --- a/sites/all/modules/panels/panels_ipe/panels_ipe.module +++ b/sites/all/modules/panels/panels_ipe/panels_ipe.module @@ -133,18 +133,22 @@ function template_preprocess_panels_ipe_pane_wrapper(&$vars) { function theme_panels_ipe_pane_wrapper($vars) { $output = $vars['output']; $pane = $vars['pane']; + $display = $vars['display']; $attributes = array( 'class' => 'panels-ipe-linkbar', ); + $type = ctools_get_content_type($pane->type); + $title ='' . ctools_content_admin_title($type, $pane->subtype, $pane->configuration, $display->context) . ''; + $links = theme('links', array('links' => $vars['links'], 'attributes' => $attributes)); if (!empty($pane->locks['type']) && $pane->locks['type'] == 'immovable') { - $links = '
    ' . $links . '
    '; + $links = '
    ' . $links .$title .'
    '; } else { - $links = '
    ' . $links . '
    '; + $links = '
    ' . $links . $title . '
    '; } $handlebar = '
    ' . $links . '
    '; @@ -217,6 +221,7 @@ function panels_ipe_get_cache_key($key = NULL) { */ function panels_ipe_toolbar_add_button($cache_key, $id, $button) { $buttons = &drupal_static('panels_ipe_toolbar_buttons', array()); + drupal_alter('panels_ipe_button', $button, $id, $cache_key); $buttons[$cache_key][$id] = $button; } @@ -242,9 +247,11 @@ function panels_ipe_page_alter(&$page) { function theme_panels_ipe_toolbar($vars) { $buttons = $vars['buttons']; + ctools_include('cleanstring'); $output = "
    "; foreach ($buttons as $key => $ipe_buttons) { + $key = ctools_cleanstring($key); $output .= "
    "; // Controls in this container will appear when the IPE is not on. diff --git a/sites/all/modules/panels/panels_ipe/plugins/display_renderers/panels_renderer_ipe.class.php b/sites/all/modules/panels/panels_ipe/plugins/display_renderers/panels_renderer_ipe.class.php index fad0592..470c4e2 100644 --- a/sites/all/modules/panels/panels_ipe/plugins/display_renderers/panels_renderer_ipe.class.php +++ b/sites/all/modules/panels/panels_ipe/plugins/display_renderers/panels_renderer_ipe.class.php @@ -7,12 +7,44 @@ class panels_renderer_ipe extends panels_renderer_editor { // The IPE operates in normal render mode, not admin mode. var $admin = FALSE; + // Whether or not the user has access. + var $access = NULL; + + function invoke_panels_ipe_access() { + if (user_access('bypass access in place editing')) { + return TRUE; + } + // Modules can return TRUE, FALSE or NULL, for allowed, disallowed, + // or don't care - respectively. On the first FALSE, we deny access, + // otherwise allow. + foreach (module_invoke_all('panels_ipe_access', $this->display) as $result) { + if ($result === FALSE) { + return FALSE; + } + } + return TRUE; + } + + function access() { + if (is_null($this->access)) { + $this->access = $this->invoke_panels_ipe_access(); + } + return $this->access; + } + function render() { $output = parent::render(); - return "
    $output
    "; + if ($this->access()) { + return "
    $output
    "; + } + return $output; } function add_meta() { + if (!$this->access()) { + return parent::add_meta(); + } + ctools_include('display-edit', 'panels'); ctools_include('content'); @@ -29,6 +61,7 @@ class panels_renderer_ipe extends panels_renderer_editor { '#type' => 'link', '#title' => t('Customize this page'), '#href' => $this->get_url('save_form'), + '#options' => array('query' => drupal_get_destination()), '#id' => 'panels-ipe-customize-page', '#attributes' => array( 'class' => array('panels-ipe-startedit', 'panels-ipe-pseudobutton'), @@ -41,7 +74,7 @@ class panels_renderer_ipe extends panels_renderer_editor { '#suffix' => '
    ', ); - panels_ipe_toolbar_add_button($this->clean_key, 'panels-ipe-startedit', $button); + panels_ipe_toolbar_add_button($this->display->cache_key, 'panels-ipe-startedit', $button); // @todo this actually should be an IPE setting instead. if (user_access('change layouts in place editing')) { @@ -49,6 +82,7 @@ class panels_renderer_ipe extends panels_renderer_editor { '#type' => 'link', '#title' => t('Change layout'), '#href' => $this->get_url('change_layout'), + '#options' => array('query' => drupal_get_destination()), '#attributes' => array( 'class' => array('panels-ipe-change-layout', 'panels-ipe-pseudobutton', 'ctools-modal-layout'), ), @@ -61,7 +95,7 @@ class panels_renderer_ipe extends panels_renderer_editor { '#suffix' => '
    ', ); - panels_ipe_toolbar_add_button($this->clean_key, 'panels-ipe-change-layout', $button); + panels_ipe_toolbar_add_button($this->display->cache_key, 'panels-ipe-change-layout', $button); } ctools_include('ajax'); @@ -70,6 +104,7 @@ class panels_renderer_ipe extends panels_renderer_editor { ctools_add_css('panels_dnd', 'panels'); ctools_add_css('panels_admin', 'panels'); + ctools_add_js('panels-base', 'panels'); ctools_add_js('panels_ipe', 'panels_ipe'); ctools_add_css('panels_ipe', 'panels_ipe'); @@ -93,6 +128,9 @@ class panels_renderer_ipe extends panels_renderer_editor { if (empty($output)) { return; } + if (!$this->access()) { + return $output; + } // If there are region locks, add them. if (!empty($pane->locks['type']) && $pane->locks['type'] == 'regions') { @@ -135,6 +173,10 @@ class panels_renderer_ipe extends panels_renderer_editor { } function prepare_panes($panes) { + if (!$this->access()) { + return parent::prepare_panes($panes); + } + // Set to admin mode just for this to ensure all panes are represented. $this->admin = TRUE; $panes = parent::prepare_panes($panes); @@ -142,6 +184,10 @@ class panels_renderer_ipe extends panels_renderer_editor { } function render_pane_content(&$pane) { + if (!$this->access()) { + return parent::render_pane_content($pane); + } + if (!empty($pane->shown) && panels_pane_access($pane, $this->display)) { $content = parent::render_pane_content($pane); } @@ -172,6 +218,10 @@ class panels_renderer_ipe extends panels_renderer_editor { * @param $panes */ function render_region($region_id, $panes) { + if (!$this->access()) { + return parent::render_region($region_id, $panes); + } + // Generate this region's 'empty' placeholder pane from the IPE plugin. $empty_ph = theme('panels_ipe_placeholder_pane', array('region_id' => $region_id, 'region_title' => $this->plugins['layout']['regions'][$region_id])); @@ -209,6 +259,19 @@ class panels_renderer_ipe extends panels_renderer_editor { // Break the lock. panels_edit_cache_break_lock($this->cache); } + } + + function get_panels_storage_op_for_ajax($method) { + switch ($method) { + case 'ajax_unlock_ipe': + case 'ajax_save_form': + return 'update'; + case 'ajax_change_layout': + case 'ajax_set_layout': + return 'change layout'; + } + + return parent::get_panels_storage_op_for_ajax($method); } /** @@ -282,6 +345,9 @@ class panels_renderer_ipe extends panels_renderer_editor { // rendered. $this->meta_location = 'inline'; $this->commands[] = ajax_command_replace("#panels-ipe-display-{$this->clean_key}", panels_render_display($this->display, $this)); + $buttons = &drupal_static('panels_ipe_toolbar_buttons', array()); + $output = theme('panels_ipe_toolbar', array('buttons' => $buttons)); + $this->commands[] = ajax_command_replace('#panels-ipe-control-container', $output); } else { // Cancelled. Clear the cache. @@ -320,6 +386,9 @@ class panels_renderer_ipe extends panels_renderer_editor { // Filter out builders $layouts = array_filter($layouts, '_panels_builder_filter'); + // Let other modules filter the layouts. + drupal_alter('panels_layouts_available', $layouts); + // Define the current layout $current_layout = $this->plugins['layout']['name']; @@ -358,7 +427,7 @@ class panels_renderer_ipe extends panels_renderer_editor { if (!empty($form_state['clicked_button']['#save-display'])) { // Saved. Save the cache. panels_edit_cache_save($this->cache); - $this->display->skip_cache; + $this->display->skip_cache = TRUE; // Since the layout changed, we have to update these things in the // renderer in order to get the right settings. @@ -405,7 +474,11 @@ class panels_renderer_ipe extends panels_renderer_editor { $pane = $this->display->content[$pid]; } - $this->commands[] = ajax_command_prepend("#panels-ipe-regionid-{$pane->panel} div.panels-ipe-sort-container", $this->render_pane($pane)); + $this->commands[] = array( + 'command' => 'insertNewPane', + 'regionId' => $pane->panel, + 'renderedPane' => $this->render_pane($pane), + ); $this->commands[] = ajax_command_changed("#panels-ipe-display-{$this->clean_key}"); $this->commands[] = array( 'command' => 'addNewPane', diff --git a/sites/all/modules/panels/panels_mini/panels_mini.css b/sites/all/modules/panels/panels_mini/panels_mini.css new file mode 100644 index 0000000..246921c --- /dev/null +++ b/sites/all/modules/panels/panels_mini/panels_mini.css @@ -0,0 +1,12 @@ +/** + * @file + * Custom CSS for the Mini Panels module. + */ + +/** + * Customize the CTools wizard trail / breadcrumb used on the edit pages for + * Mini Panels as a stop-gap measure until the UX can be completely re-done. + */ +.wizard-trail { + text-align: right; +} diff --git a/sites/all/modules/panels/panels_mini/panels_mini.info b/sites/all/modules/panels/panels_mini/panels_mini.info index 4b95608..dae879f 100644 --- a/sites/all/modules/panels/panels_mini/panels_mini.info +++ b/sites/all/modules/panels/panels_mini/panels_mini.info @@ -1,12 +1,13 @@ name = Mini panels description = Create mini panels that can be used as blocks by Drupal and panes by other panel modules. package = "Panels" +version = PANELS_VERSION dependencies[] = panels core = 7.x files[] = plugins/export_ui/panels_mini_ui.class.php -; Information added by drupal.org packaging script on 2013-03-02 -version = "7.x-3.3+39-dev" +; Information added by Drupal.org packaging script on 2016-08-20 +version = "7.x-3.7" core = "7.x" project = "panels" -datestamp = "1362187383" +datestamp = "1471704242" diff --git a/sites/all/modules/panels/panels_mini/panels_mini.install b/sites/all/modules/panels/panels_mini/panels_mini.install index 7313d4b..b3239dd 100644 --- a/sites/all/modules/panels/panels_mini/panels_mini.install +++ b/sites/all/modules/panels/panels_mini/panels_mini.install @@ -114,7 +114,7 @@ function panels_mini_uninstall() { $deltas[] = $panel_mini->pid; } - if ($deltas) { + if (db_table_exists('block') && $deltas) { // Delete all configured blocks. db_delete('block') ->condition('module', 'panels_mini') @@ -122,3 +122,61 @@ function panels_mini_uninstall() { ->execute(); } } + +/** + * Implements hook_update_dependencies(). + */ +function panels_mini_update_dependencies() { + // Update 7301 requires panels storage support + $dependencies['panels_mini'][7301] = array( + 'panels' => 7305, + ); + + return $dependencies; +} + +/** + * Set the storage type and id on existing mini panels. + */ +function panels_mini_update_7301() { + if (!isset($sandbox['progress'])) { + // Initialize batch update information. + $sandbox['progress'] = (float)0; + $sandbox['current_did'] = -1; + $sandbox['max'] = db_query("SELECT COUNT(pd.did) + FROM {panels_display} pd + JOIN {panels_mini} pm ON pm.did = pd.did + WHERE pd.storage_type = ''")->fetchField(); + } + + // Set a limit of how many rows to process per batch. + $limit = 1000; + + // Run the query + $result = db_query_range("SELECT pd.did, pm.name + FROM {panels_display} pd + JOIN {panels_mini} pm ON pm.did = pd.did + WHERE pd.storage_type = '' AND pd.did > :current_did", 0, $limit, array(':current_did' => $sandbox['current_did'])); + + foreach ($result as $row) { + db_update('panels_display') + ->fields(array( + 'storage_type' => 'panels_mini', + 'storage_id' => $row->name, + )) + ->condition('did', $row->did) + ->execute(); + + // Update our progress information. + $sandbox['progress']++; + $sandbox['current_did'] = $row->did; + } + + // Set the "finished" status, to tell batch engine whether this function + // needs to run again. + $sandbox['#finished'] = ($sandbox['progress'] >= $sandbox['max']) ? TRUE : ($sandbox['progress'] / $sandbox['max']); + + if ($sandbox['#finished']) { + return t('Added the storage type for panels_mini to relevant panels displays'); + } +} diff --git a/sites/all/modules/panels/panels_mini/panels_mini.module b/sites/all/modules/panels/panels_mini/panels_mini.module index 2691efe..2139de1 100644 --- a/sites/all/modules/panels/panels_mini/panels_mini.module +++ b/sites/all/modules/panels/panels_mini/panels_mini.module @@ -112,9 +112,11 @@ function panels_mini_block_view($delta = 0) { $contexts = ctools_context_match_required_contexts($panel_mini->requiredcontexts, $current_page['contexts']); } } + drupal_alter('panels_mini_block_contexts', $contexts, $panel_mini); $panel_mini->context = $panel_mini->display->context = ctools_context_load_contexts($panel_mini, FALSE, $contexts); $panel_mini->display->css_id = panels_mini_get_id($panel_mini->name); + $panel_mini->display->owner = $panel_mini; $block = array(); @@ -145,6 +147,10 @@ function panels_mini_block_list_alter(&$blocks) { if (module_exists('page_manager')) { $current_page = page_manager_get_current_page(); } + + // Load add at once to save time. + panels_mini_load_all(); + foreach ($blocks as $key => $block) { if ($block->module != 'panels_mini') { // This block was added by a contrib module, leave it in the list. @@ -178,6 +184,44 @@ function panels_mini_block_list_alter(&$blocks) { } } +/** + * Implements hook_get_pane_links_alter(). + */ +function panels_mini_get_pane_links_alter(&$links, $pane, $content_type) { + if ($pane->type == 'panels_mini') { + $links['top']['edit_panels_mini'] = array( + 'title' => t('Edit mini panel'), + 'href' => url('admin/structure/mini-panels/list/' . $pane->subtype . '/edit/content', array('absolute' => TRUE)), + 'attributes' => array('target' => array('_blank')), + ); + } +} + +/** + * Implements hook_contextual_links_view_alter(). + */ +function panels_mini_contextual_links_view_alter(&$element, $items) { + + // Add contextual links to all mini panel blocks with bid property. + if (isset($element['#element']['#block']) && isset($element['#element']['#block']->bid) && strpos((string) $element['#element']['#block']->bid, 'panels_mini') === 0) { + + $admin_pages = array( + t('Configure mini panel settings') => 'basic', + t('Configure mini panel context') => 'context', + t('Configure mini panel layout') => 'layout', + t('Configure mini panel content') => 'content', + ); + + foreach ($admin_pages as $title => $tail) { + $element['#links']['mini-panels-' . $tail] = array( + 'title' => $title, + 'href' => 'admin/structure/mini-panels/list/' . $element['#element']['#block']->delta . '/edit/' . $tail, + 'query' => drupal_get_destination(), + ); + } + } +} + /** * Statically store all used IDs to ensure all mini panels get a unique id. */ @@ -215,22 +259,30 @@ function panels_mini_load($name) { // We use array_key_exists because failed loads will be NULL and // isset() will try to load it again. if (!array_key_exists($name, $cache)) { - ctools_include('export'); - $result = ctools_export_load_object('panels_mini', 'names', array($name)); - if (isset($result[$name])) { - if (empty($result[$name]->display)) { - $result[$name]->display = panels_load_display($result[$name]->did); - if (!empty($result[$name]->title) && empty($result[$name]->display->title)) { - $result[$name]->display->title = $result[$name]->title; - } - } - $cache[$name] = $result[$name]; - if (!empty($result[$name]->title) && empty($result[$name]->admin_title)) { - $cache[$name]->admin_title = $result[$name]->title; - } + $cid = 'panels_mini_load:' . $name; + $result = cache_get($cid, 'cache_panels'); + if (!empty($result->data)) { + $cache[$name] = $result->data; } else { - $cache[$name] = NULL; + ctools_include('export'); + $result = ctools_export_load_object('panels_mini', 'names', array($name)); + if (isset($result[$name])) { + if (empty($result[$name]->display)) { + $result[$name]->display = panels_load_display($result[$name]->did); + if (!empty($result[$name]->title) && empty($result[$name]->display->title)) { + $result[$name]->display->title = $result[$name]->title; + } + } + $cache[$name] = $result[$name]; + if (!empty($result[$name]->title) && empty($result[$name]->admin_title)) { + $cache[$name]->admin_title = $result[$name]->title; + } + cache_set($cid, $cache[$name], 'cache_panels', CACHE_TEMPORARY); + } + else { + $cache[$name] = NULL; + } } } @@ -253,6 +305,22 @@ function panels_mini_load_all($reset = FALSE) { if ($reset) { $cache = array(); } + else { + $panel_names = db_select('panels_mini', 'pm') + ->fields('pm', array('name')) + ->execute(); + $cids = array(); + foreach ($panel_names as $name) { + $cids[] = 'panels_mini_load:' . $name->name; + } + $output = cache_get_multiple($cids, 'cache_panels'); + foreach ($output as $mini) { + if (!empty($mini->data)) { + $mini = $mini->data; + $cache[$mini->name] = $mini; + } + } + } ctools_include('export'); $minis = ctools_export_load_object('panels_mini'); @@ -294,10 +362,14 @@ function panels_mini_load_all($reset = FALSE) { */ function panels_mini_save(&$mini) { if (!empty($mini->display)) { + $mini->display->storage_id = $mini->name; $display = panels_save_display($mini->display); $mini->did = $display->did; } + // Clear the panels_mini_load cache. + cache_clear_all('panels_mini_load:', 'cache_panels', TRUE); + $update = (isset($mini->pid) && $mini->pid != 'new') ? array('pid') : array(); drupal_write_record('panels_mini', $mini, $update); @@ -350,6 +422,24 @@ function panels_mini_ctools_plugin_directory($module, $plugin) { if ($module == 'ctools' && ($plugin == 'content_types' || $plugin == 'export_ui')) { return 'plugins/' . $plugin; } + if ($module == 'panels' && $plugin == 'panels_storage') { + return 'plugins/' . $plugin; + } +} + +/** + * Implements hook_default_panels_mini_alter(). + * + * If a default Panels display has no storage type, set it. + */ +function panels_default_panels_mini_alter(&$mini_panels) { + foreach ($mini_panels as &$mini_panel) { + $display =& $mini_panel->display; + if (empty($display->storage_type)) { + $display->storage_type = 'panels_mini'; + $display->storage_id = $mini_panel->name; + } + } } /** @@ -388,6 +478,9 @@ function panels_mini_panels_cache_get($key) { $cache->display = $item->display; $cache->display->context = ctools_context_load_contexts($item); $cache->display->cache_key = 'panels_mini:' . $key; + $cache->display->storage_type = 'panels_mini'; + // Temporary storage id that's replaced in panels_mini_save(). + $cache->display->storage_id = 'panels_mini'; $cache->content_types = panels_common_get_allowed_types('panels_mini', $cache->display->context); $cache->display_title = TRUE; @@ -431,6 +524,15 @@ function panels_mini_panels_cache_save($key, $cache) { function panels_mini_panels_cache_break_lock($key, $cache) { } +/** + * Implements hook_panels_pre_render(). + */ +function panels_mini_panels_pre_render($display, $renderer) { + if (isset($display->owner->table) && $display->owner->table == 'panels_mini' && $renderer instanceof panels_renderer_standard) { + $renderer->show_empty_layout = FALSE; + } +} + /** * Implementation of hook_panels_dashboard_blocks(). * @@ -480,3 +582,14 @@ function panels_mini_panels_dashboard_blocks(&$vars) { ); } + +/** + * Implements template_preprocess_ctools_wizard_trail(). + * + * Customize the divider used in the CTools wizard to build the edit pages for + * Mini Panels as a stop-gap measure until the UX can be completely re-done. + */ +function panels_mini_preprocess_ctools_wizard_trail(&$variables) { + $variables['divider'] = ' | '; + drupal_add_css(drupal_get_path('module', 'panels_mini') . '/panels_mini.css'); +} diff --git a/sites/all/modules/panels/panels_mini/plugins/content_types/panels_mini.inc b/sites/all/modules/panels/panels_mini/plugins/content_types/panels_mini.inc index 2170111..2d092be 100644 --- a/sites/all/modules/panels/panels_mini/plugins/content_types/panels_mini.inc +++ b/sites/all/modules/panels/panels_mini/plugins/content_types/panels_mini.inc @@ -4,7 +4,7 @@ * @file * Contains the content type plugin for a mini panel. While this does not * need to be broken out into a .inc file, it's convenient that we do so - * that we don't load code unneccessarily. Plus it demonstrates plugins + * that we don't load code unnecessarily. Plus it demonstrates plugins * in modules other than Panels itself. * */ @@ -68,8 +68,13 @@ function _panels_mini_panels_mini_content_type_content_type($mini) { $type['required context'] = array(); foreach ($mini->requiredcontexts as $context) { $info = ctools_get_context($context['name']); - // TODO: allow an optional setting - $type['required context'][] = new ctools_context_required($context['identifier'], $info['context name']); + // Check if the required context is actually required. + if (!empty($context['optional'])) { + $type['required context'][] = new ctools_context_optional($context['identifier'], $info['context name']); + } + else { + $type['required context'][] = new ctools_context_required($context['identifier'], $info['context name']); + } } } return $type; diff --git a/sites/all/modules/panels/panels_mini/plugins/panels_storage/panels_mini.inc b/sites/all/modules/panels/panels_mini/plugins/panels_storage/panels_mini.inc new file mode 100644 index 0000000..c9ba35d --- /dev/null +++ b/sites/all/modules/panels/panels_mini/plugins/panels_storage/panels_mini.inc @@ -0,0 +1,22 @@ + 'panels_mini_panels_storage_access', +); + +/** + * Access callback for panels storage. + */ +function panels_mini_panels_storage_access($storage_type, $storage_id, $op, $account) { + if ($op == 'create') { + return user_access('create mini panels', $account); + } + + return user_access('administer mini panels', $account); +} diff --git a/sites/all/modules/panels/panels_node/panels_node.info b/sites/all/modules/panels/panels_node/panels_node.info index 1b77bd5..9179d15 100644 --- a/sites/all/modules/panels/panels_node/panels_node.info +++ b/sites/all/modules/panels/panels_node/panels_node.info @@ -1,14 +1,15 @@ name = Panel nodes description = Create nodes that are divided into areas with selectable content. package = "Panels" +version = PANELS_VERSION dependencies[] = panels configure = admin/structure/panels core = 7.x files[] = panels_node.module -; Information added by drupal.org packaging script on 2013-03-02 -version = "7.x-3.3+39-dev" +; Information added by Drupal.org packaging script on 2016-08-20 +version = "7.x-3.7" core = "7.x" project = "panels" -datestamp = "1362187383" +datestamp = "1471704242" diff --git a/sites/all/modules/panels/panels_node/panels_node.install b/sites/all/modules/panels/panels_node/panels_node.install index c68e40d..1af682f 100644 --- a/sites/all/modules/panels/panels_node/panels_node.install +++ b/sites/all/modules/panels/panels_node/panels_node.install @@ -56,6 +56,18 @@ function panels_node_uninstall() { drupal_uninstall_schema('panels_node'); } +/** + * Implements hook_update_dependencies(). + */ +function panels_node_update_dependencies() { + // Update 7301 requires panels storage support + $dependencies['panels_node'][7301] = array( + 'panels' => 7305, + ); + + return $dependencies; +} + /** * Implementation of hook_update to handle adding a pipeline */ @@ -69,3 +81,87 @@ function panels_node_update_6001() { db_add_field('panels_node', 'pipeline', $field); return $ret; } + +/** + * Migrate legacy Drupal 6 permissions to Drupal 7. + */ +function panels_node_update_7301() { + $permissions = array( + 'create panel-nodes' => 'create panel content', + 'edit any panel-nodes' => 'edit any panel content', + 'edit own panel-nodes' => 'edit own panel content', + 'delete any panel-nodes' => 'delete any panel content', + 'delete own panel-nodes' => 'delete own panel content', + ); + foreach ($permissions as $legacy_permission => $new_permission) { + $query = db_select('role_permission', 'p') + ->fields('p', array('rid')) + ->condition('permission', $legacy_permission); + $rids = $query->execute()->fetchCol(); + foreach ($rids as $rid) { + // Insert the new permission if it doesn't already exist. + db_merge('role_permission') + ->key(array( + 'rid' => $rid, + 'permission' => $new_permission, + )) + ->insertFields(array( + 'rid' => $rid, + 'permission' => $new_permission, + 'module' => 'node', + )) + ->execute(); + } + + // Delete the legacy permission. + db_delete('role_permission') + ->condition('permission', $legacy_permission) + ->execute(); + } +} + +/** + * Set the storage type and id on existing panels nodes. + */ +function panels_node_update_7302() { + if (!isset($sandbox['progress'])) { + // Initialize batch update information. + $sandbox['progress'] = (float)0; + $sandbox['current_did'] = -1; + $sandbox['max'] = db_query("SELECT COUNT(pd.did) + FROM {panels_display} pd + JOIN {panels_node} pn ON pn.did = pd.did + WHERE pd.storage_type = ''")->fetchField(); + } + + // Set a limit of how many rows to process per batch. + $limit = 1000; + + // Run the query + $result = db_query_range("SELECT pd.did, pn.nid + FROM {panels_display} pd + JOIN {panels_node} pn ON pn.did = pd.did + WHERE pd.storage_type = '' AND pd.did > :current_did", 0, $limit, array(':current_did' => $sandbox['current_did'])); + + foreach ($result as $row) { + db_update('panels_display') + ->fields(array( + 'storage_type' => 'panels_node', + 'storage_id' => $row->nid, + )) + ->condition('did', $row->did) + ->execute(); + + // Update our progress information. + $sandbox['progress']++; + $sandbox['current_did'] = $row->did; + } + + // Set the "finished" status, to tell batch engine whether this function + // needs to run again. + $sandbox['#finished'] = ($sandbox['progress'] >= $sandbox['max']) ? TRUE : ($sandbox['progress'] / $sandbox['max']); + + if ($sandbox['#finished']) { + return t('Added the storage type for panels_node to relevant panels displays'); + } +} diff --git a/sites/all/modules/panels/panels_node/panels_node.module b/sites/all/modules/panels/panels_node/panels_node.module index 894dc67..bc9d56f 100644 --- a/sites/all/modules/panels/panels_node/panels_node.module +++ b/sites/all/modules/panels/panels_node/panels_node.module @@ -17,33 +17,22 @@ */ function panels_node_permission() { return array( - 'create panel-nodes' => array( - 'title' => t('Create panel nodes'), - 'description' => t('Create new panel nodes.'), - ), - 'edit any panel-nodes' => array( - 'title' => t('Edit any panel-nodes'), - 'description' => t('Edit all pre-existing panel nodes regardless of ownership.'), - ), - 'edit own panel-nodes' => array( - 'title' => t('Edit own panel nodes'), - 'description' => t('Edit panel nodes owned by this user.'), - ), 'administer panel-nodes' => array( 'title' => t('Administer panel nodes'), 'description' => t('Full administrative access to panel nodes including create, update and delete all'), ), - 'delete any panel-nodes' => array( - 'title' => t('Delete any panel nodes'), - 'description' => t('Delete any panel node regardless of ownership'), - ), - 'delete own panel-nodes' => array( - 'title' => t('Delete own panel nodes'), - 'description' => t('Delete any panel node owned by this user.'), - ), ); } +/** + * Implementation of hook_ctools_plugin_directory(). + */ +function panels_node_ctools_plugin_directory($module, $plugin) { + if ($module == 'panels' && $plugin == 'panels_storage') { + return 'plugins/' . $plugin; + } +} + /** * Implementation of hook_menu(). */ @@ -83,7 +72,7 @@ function panels_node_menu() { $items['node/add/panel/choose-layout'] = array( 'title' => 'Choose layout', - 'access arguments' => array('create panel-nodes'), + 'access callback' => 'panels_add_panel_access_callback', 'page callback' => 'panels_node_add', 'type' => MENU_CALLBACK, ); @@ -102,6 +91,13 @@ function panels_node_edit_node($node) { return node_access('update', $node); } +/** + * Access callback to determine if user has access to add panel nodes. + */ +function panels_add_panel_access_callback() { + return user_access('create panel content') || user_access('administer panel-nodes'); +} + /** * Override of node add page to force layout selection prior * to actually editing a node. @@ -113,7 +109,7 @@ function panels_node_add() { ctools_include('common', 'panels'); $layouts = panels_common_get_allowed_layouts('panels_node'); - return panels_common_print_layout_links($layouts, 'node/add/panel', array('query' => $_GET)); + return panels_common_print_layout_links($layouts, 'node/add/panel', array('query' => drupal_get_query_parameters())); } // --------------------------------------------------------------------------- @@ -156,19 +152,6 @@ function panels_node_node_access($node, $op, $account) { if (user_access('administer panel-nodes', $account)) { return NODE_ACCESS_ALLOW; } - - if ($op == 'create' && user_access('create panel-nodes', $account)) { - return NODE_ACCESS_ALLOW; - } - - if ($op == 'update' && (user_access('edit any panel-nodes', $account) || $node->uid == $account->uid && user_access('edit own panel-nodes', $account))) { - return NODE_ACCESS_ALLOW; - } - - - if ($op == 'delete' && (user_access('delete any panel-nodes') || $node->uid == $account->uid && user_access('delete own panel-nodes'))) { - return NODE_ACCESS_ALLOW; - } } /** @@ -183,14 +166,12 @@ function panels_node_hook_form(&$node, &$form_state) { // and if that doesn't work present them with a list to pick from. $panel_layout = isset($node->panel_layout) ? $node->panel_layout : arg(3); if (empty($panel_layout)) { - $opts = $_GET; - unset($opts['q']); - return drupal_goto('node/add/panel/choose-layout', $opts); + drupal_goto('node/add/panel/choose-layout', array('query' => drupal_get_query_parameters())); } $layout = panels_get_layout($panel_layout); if (empty($layout)) { - return drupal_not_found(); + return MENU_NOT_FOUND; } $form['panels_node']['layout'] = array( '#type' => 'value', @@ -233,7 +214,7 @@ function panels_node_hook_form(&$node, &$form_state) { '#type' => 'radios', '#options' => $options, '#title' => t('Renderer'), - '#default_value' => isset($node->panels_node['pipeline']) ? $node->panels_node['pipeline'] : 'standard', + '#default_value' => isset($node->panels_node['pipeline']) ? $node->panels_node['pipeline'] : variable_get('panels_renderer_default', 'standard'), ); return $form; @@ -271,6 +252,8 @@ function panels_node_hook_insert(&$node) { // Create a new display and record that. $display = panels_new_display(); $display->layout = $node->panels_node['layout']; + $display->storage_type = 'panels_node'; + $display->storage_id = $node->nid; // Special handling for nodes being imported from an export.module data dump. if (!empty($node->export_display)) { @@ -431,6 +414,19 @@ function panels_node_panels_dashboard_blocks(&$vars) { ); } +/** + * Implements hook_panels_ipe_access(). + */ +function panels_node_panels_ipe_access($display) { + // We only care about Panels displays from panels_node. + if (isset($display->context['panel-node'])) { + // Only allow access to use the IPE if the user has 'update' access to + // the underlying node. + $node = $display->context['panel-node']->data; + return node_access('update', $node); + } +} + // --------------------------------------------------------------------------- // Callbacks for panel caching. diff --git a/sites/all/modules/panels/panels_node/plugins/panels_storage/panels_node.inc b/sites/all/modules/panels/panels_node/plugins/panels_storage/panels_node.inc new file mode 100644 index 0000000..a7a7a3b --- /dev/null +++ b/sites/all/modules/panels/panels_node/plugins/panels_storage/panels_node.inc @@ -0,0 +1,25 @@ + 'panels_node_panels_storage_access', +); + +/** + * Access callback for panels storage. + */ +function panels_node_panels_storage_access($storage_type, $storage_id, $op, $account) { + if ($node = node_load($storage_id)) { + if ($op == 'read') { + $op = 'view'; + } + return node_access($op, $node, $account); + } + + return FALSE; +} diff --git a/sites/all/modules/panels/plugins/cache/simple.inc b/sites/all/modules/panels/plugins/cache/simple.inc index 645c36a..6b76678 100644 --- a/sites/all/modules/panels/plugins/cache/simple.inc +++ b/sites/all/modules/panels/plugins/cache/simple.inc @@ -25,7 +25,7 @@ $plugin = array( */ function panels_simple_cache_get_cache($conf, $display, $args, $contexts, $pane = NULL) { $cid = panels_simple_cache_get_id($conf, $display, $args, $contexts, $pane); - $cache = cache_get($cid, 'cache'); + $cache = cache_get($cid, 'cache_panels'); if (!$cache) { return FALSE; } @@ -42,7 +42,7 @@ function panels_simple_cache_get_cache($conf, $display, $args, $contexts, $pane */ function panels_simple_cache_set_cache($conf, $content, $display, $args, $contexts, $pane = NULL) { $cid = panels_simple_cache_get_id($conf, $display, $args, $contexts, $pane); - cache_set($cid, $content); + cache_set($cid, $content, 'cache_panels'); } /** @@ -53,13 +53,25 @@ function panels_simple_cache_set_cache($conf, $content, $display, $args, $contex function panels_simple_cache_clear_cache($display) { $cid = 'panels_simple_cache'; - // This is used in case this is an in-code display, which means did will be something like 'new-1'. - if (isset($display->owner) && isset($display->owner->id)) { - $cid .= ':' . $display->owner->id; + // If the panel is stored in the database it'll have a numeric did value. + if (is_numeric($display->did)) { + $cid .= ':' . $display->did; + } + // Exported panels won't have a numeric did but may have a usable cache_key. + elseif (!empty($display->cache_key)) { + $cid .= ':' . str_replace('panel_context:', '', $display->cache_key); + } + // Alternatively use the css_id. + elseif (!empty($display->css_id)) { + $cid .= ':' . $display->css_id; + } + // Failover to just appending the did, which may be the completely unusable + // string 'new'. + else { + $cid .= ':' . $display->did; } - $cid .= ':' . $display->did; - cache_clear_all($cid, 'cache', TRUE); + cache_clear_all($cid, 'cache_panels', TRUE); } /** diff --git a/sites/all/modules/panels/plugins/display_renderers/panels_renderer_editor.class.php b/sites/all/modules/panels/plugins/display_renderers/panels_renderer_editor.class.php index 4f4db4a..c4214dd 100644 --- a/sites/all/modules/panels/plugins/display_renderers/panels_renderer_editor.class.php +++ b/sites/all/modules/panels/plugins/display_renderers/panels_renderer_editor.class.php @@ -61,6 +61,7 @@ class panels_renderer_editor extends panels_renderer_standard { ctools_add_js('display_editor', 'panels'); ctools_add_css('panels_dnd', 'panels'); ctools_add_css('panels_admin', 'panels'); + drupal_add_library('system', 'ui'); } } @@ -161,7 +162,7 @@ class panels_renderer_editor extends panels_renderer_standard { if ($buttons) { $output .= '' . $buttons . ''; } - $output .= '' . $title . ''; + $output .= '' . $title . ''; $output .= '
    '; // grabber $output .= '
    '; @@ -186,12 +187,12 @@ class panels_renderer_editor extends panels_renderer_standard { $style_title = isset($style['title']) ? $style['title'] : t('Default'); - $style_links[] = array( + $style_links['title'] = array( 'title' => $style_title, 'attributes' => array('class' => array('panels-text')), ); - $style_links[] = array( + $style_links['change'] = array( 'title' => t('Change'), 'href' => $this->get_url('style-type', $type, $id), 'attributes' => array('class' => array('ctools-use-modal')), @@ -199,7 +200,7 @@ class panels_renderer_editor extends panels_renderer_standard { $function = $type != 'pane' ? 'settings form' : 'pane settings form'; if (panels_plugin_get_function('styles', $style, $function)) { - $style_links[] = array( + $style_links['settings'] = array( 'title' => t('Settings'), 'href' => $this->get_url('style-settings', $type, $id), 'attributes' => array('class' => array('ctools-use-modal')), @@ -307,14 +308,14 @@ class panels_renderer_editor extends panels_renderer_standard { $links = array(); if (!empty($pane->shown)) { - $links[] = array( + $links['top']['disabled'] = array( 'title' => t('Disable this pane'), 'href' => $this->get_url('hide', $pane->pid), 'attributes' => array('class' => array('use-ajax')), ); } else { - $links[] = array( + $links['top']['enable'] = array( 'title' => t('Enable this pane'), 'href' => $this->get_url('show', $pane->pid), 'attributes' => array('class' => array('use-ajax')), @@ -322,13 +323,13 @@ class panels_renderer_editor extends panels_renderer_standard { } if (isset($this->display->title_pane) && $this->display->title_pane == $pane->pid) { - $links['panels-set-title'] = array( + $links['top']['panels-set-title'] = array( 'title' => t('✓Panel title'), 'html' => TRUE, ); } else { - $links['panels-set-title'] = array( + $links['top']['panels-set-title'] = array( 'title' => t('Panel title'), 'href' => $this->get_url('panel-title', $pane->pid), 'attributes' => array('class' => array('use-ajax')), @@ -338,7 +339,7 @@ class panels_renderer_editor extends panels_renderer_standard { $subtype = ctools_content_get_subtype($content_type, $pane->subtype); if (ctools_content_editable($content_type, $subtype, $pane->configuration)) { - $links[] = array( + $links['top']['settings'] = array( 'title' => isset($content_type['edit text']) ? $content_type['edit text'] : t('Settings'), 'href' => $this->get_url('edit-pane', $pane->pid), 'attributes' => array('class' => array('ctools-use-modal')), @@ -346,7 +347,7 @@ class panels_renderer_editor extends panels_renderer_standard { } if (user_access('administer advanced pane settings')) { - $links[] = array( + $links['top']['css'] = array( 'title' => t('CSS properties'), 'href' => $this->get_url('pane-css', $pane->pid), 'attributes' => array('class' => array('ctools-use-modal')), @@ -354,26 +355,10 @@ class panels_renderer_editor extends panels_renderer_standard { } if (user_access('administer panels styles')) { - $links[] = array( - 'title' => '
    ', - 'html' => TRUE, - ); - - $style_links = $this->get_style_links('pane', $pane->pid); - - $links[] = array( - 'title' => '' . t('Style') . '' . theme_links(array('links' => $style_links, 'attributes' => array(), 'heading' => array())), - 'html' => TRUE, - 'attributes' => array('class' => array('panels-sub-menu')), - ); + $links['style'] = $this->get_style_links('pane', $pane->pid); } if (user_access('administer pane access')) { - $links[] = array( - 'title' => '
    ', - 'html' => TRUE, - ); - $contexts = $this->display->context; // Make sure we have the logged in user context if (!isset($contexts['logged-in-user'])) { @@ -385,7 +370,7 @@ class panels_renderer_editor extends panels_renderer_standard { if (!empty($pane->access['plugins'])) { foreach ($pane->access['plugins'] as $id => $test) { $plugin = ctools_get_access_plugin($test['name']); - $access_title = isset($plugin['title']) ? $plugin['title'] : t('Broken/missing access plugin %plugin', array('%plugin' => $test['name'])); + $access_title = isset($plugin['title']) ? $plugin['title'] : t('Broken/missing access plugin %plugin', array('%plugin' => $test['name'])); $access_description = ctools_access_summary($plugin, $contexts, $test); $visibility_links[] = array( @@ -396,37 +381,28 @@ class panels_renderer_editor extends panels_renderer_standard { } } if (empty($visibility_links)) { - $visibility_links[] = array( + $visibility_links['no_rules'] = array( 'title' => t('No rules'), 'attributes' => array('class' => array('panels-text')), ); } - $visibility_links[] = array( + $visibility_links['add_rule'] = array( 'title' => t('Add new rule'), 'href' => $this->get_url('access-add-test', $pane->pid), 'attributes' => array('class' => array('ctools-use-modal')), ); - $visibility_links[] = array( + $visibility_links['settings'] = array( 'title' => t('Settings'), 'href' => $this->get_url('access-settings', $pane->pid), 'attributes' => array('class' => array('ctools-use-modal')), ); - $links[] = array( - 'title' => '' . t('Visibility rules') . '' . theme_links(array('links' => $visibility_links, 'attributes' => array(), 'heading' => array())), - 'html' => TRUE, - 'attributes' => array('class' => array('panels-sub-menu')), - ); + $links['visibility'] = $visibility_links; } if (user_access('use panels locks')) { - $links[] = array( - 'title' => '
    ', - 'html' => TRUE, - ); - $lock_type = !empty($pane->locks['type']) ? $pane->locks['type'] : 'none'; switch ($lock_type) { case 'immovable': @@ -441,62 +417,44 @@ class panels_renderer_editor extends panels_renderer_standard { break; } - $lock_links[] = array( + $lock_links['lock'] = array( 'title' => $lock_method, 'attributes' => array('class' => array('panels-text')), ); - $lock_links[] = array( + $lock_links['change'] = array( 'title' => t('Change'), 'href' => $this->get_url('lock', $pane->pid), 'attributes' => array('class' => array('ctools-use-modal')), ); - $links[] = array( - 'title' => '' . t('Locking') . '' . theme_links(array('links' => $lock_links, 'attributes' => array(), 'heading' => array())), - 'html' => TRUE, - 'attributes' => array('class' => array('panels-sub-menu')), - ); + $links['lock'] = $lock_links; } if (panels_get_caches() && user_access('use panels caching features')) { - $links[] = array( - 'title' => '
    ', - 'html' => TRUE, - ); - $method = isset($pane->cache['method']) ? $pane->cache['method'] : 0; $info = panels_get_cache($method); $cache_method = isset($info['title']) ? $info['title'] : t('No caching'); - $cache_links[] = array( + $cache_links['title'] = array( 'title' => $cache_method, 'attributes' => array('class' => array('panels-text')), ); - $cache_links[] = array( + $cache_links['change'] = array( 'title' => t('Change'), 'href' => $this->get_url('cache-method', $pane->pid), 'attributes' => array('class' => array('ctools-use-modal')), ); if (panels_plugin_get_function('cache', $info, 'settings form')) { - $cache_links[] = array( + $cache_links['settings'] = array( 'title' => t('Settings'), 'href' => $this->get_url('cache-settings', $pane->pid), 'attributes' => array('class' => array('ctools-use-modal')), ); } - $links[] = array( - 'title' => '' . t('Caching') . '' . theme_links(array('links' => $cache_links, 'attributes' => array(), 'heading' => array())), - 'html' => TRUE, - 'attributes' => array('class' => array('panels-sub-menu')), - ); + $links['cache'] = $cache_links; } - $links[] = array( - 'title' => '
    ', - 'html' => TRUE, - ); - - $links[] = array( + $links['bottom']['remove'] = array( 'title' => t('Remove'), 'href' => '#', 'attributes' => array( @@ -505,7 +463,38 @@ class panels_renderer_editor extends panels_renderer_standard { ), ); - return theme('ctools_dropdown', array('title' => theme('image', array('path' => ctools_image_path('icon-configure.png', 'panels'))), 'links' => $links, 'image' => TRUE)); + // Allow others to add/remove links from pane context menu. + // Grouped by 'top', 'style', 'visibility', 'lock', 'cache' and 'bottom' + drupal_alter('get_pane_links', $links, $pane, $content_type); + + $dropdown_links = $links['top']; + $category_labels = array( + 'style' => 'Style', + 'visibility' => 'Visibility rules', + 'lock' => 'Locking', + 'cache' => 'Caching', + ); + foreach ($category_labels as $category => $label) { + if (array_key_exists($category, $links)) { + $dropdown_links[] = array( + 'title' => '
    ', + 'html' => TRUE, + ); + $dropdown_links[] = array( + 'title' => '' . t($label) . '' . theme_links(array('links' => $links[$category], 'attributes' => array(), 'heading' => array())), + 'html' => TRUE, + 'attributes' => array('class' => array('panels-sub-menu')), + ); + } + } + + $dropdown_links[] = array( + 'title' => '
    ', + 'html' => TRUE, + ); + $dropdown_links = array_merge($dropdown_links, $links['bottom']); + + return theme('ctools_dropdown', array('title' => theme('image', array('path' => ctools_image_path('icon-configure.png', 'panels'))), 'links' => $dropdown_links, 'image' => TRUE)); } // ----------------------------------------------------------------------- @@ -525,6 +514,40 @@ class panels_renderer_editor extends panels_renderer_standard { return $url; } + /** + * Get the Panels storage oparation for a given renderer AJAX method. + * + * @param string $method + * The method name. + * + * @return string + * The Panels storage op. + */ + function get_panels_storage_op_for_ajax($method) { + switch ($method) { + case 'ajax_show': + case 'ajax_hide': + case 'ajax_select_content': + case 'ajax_add_pane': + case 'ajax_edit_pane': + case 'ajax_panel_title': + case 'ajax_cache_method': + case 'ajax_cache_settings': + case 'ajax_style_type': + case 'ajax_style_settings': + case 'ajax_pane_css': + case 'ajax_lock': + case 'ajax_access_settings': + case 'ajax_access_add_test': + case 'ajax_access_configure_test': + case 'ajax_layout': + case 'ajax_style': + return 'update'; + } + + return parent::get_panels_storage_op_for_ajax($method); + } + /** * AJAX command to show a pane. */ @@ -572,6 +595,11 @@ class panels_renderer_editor extends panels_renderer_standard { $output = theme('panels_add_content_modal', array('renderer' => $this, 'categories' => $categories, 'category' => $category, 'region' => $region)); } $this->commands[] = ctools_modal_command_display($title, $output); + + // Give keybord focus to the first item in the category we just loaded. + if (!empty($category)) { + $this->commands[] = ajax_command_invoke(".panels-add-content-modal .panels-section-columns :focusable:first", 'focus'); + } } /** @@ -656,7 +684,19 @@ class panels_renderer_editor extends panels_renderer_standard { $content_type = ctools_get_content_type($type_name); $subtype = ctools_content_get_subtype($content_type, $subtype_name); - if (!isset($step) || !isset($this->cache->new_pane)) { + // Determine if we are adding a different pane than previously cached. This + // is used to load the different pane into cache so that multistep forms + // have the correct context instead of a previously cached version that + // does not match the pane currently being added. + $is_different_pane = FALSE; + if (isset($this->cache) && isset($this->cache->new_pane)) { + $diff_type = $type_name != $this->cache->new_pane->type; + $diff_subtype = $subtype_name != $this->cache->new_pane->subtype; + + $is_different_pane = $diff_type || $diff_subtype; + } + + if (!isset($step) || !isset($this->cache->new_pane) || $is_different_pane) { $pane = panels_new_pane($type_name, $subtype_name, TRUE); $this->cache->new_pane = &$pane; } @@ -947,8 +987,11 @@ class panels_renderer_editor extends panels_renderer_standard { ctools_include('content'); $pane = &$this->display->content[$pid]; $style = isset($pane->style['style']) ? $pane->style['style'] : 'default'; - $subtype = ctools_content_get_subtype($pane->type, $pane->subtype); - $title = t('Pane style for "!pane"', array('!pane' => $subtype['title'])); + $title = ctools_content_admin_title($pane->type, $pane->subtype, $pane->configuration, $this->display->context); + if (!$title) { + $title = $pane->type; + } + $title = t('Pane style for "!title"', array('!title' => $title)); break; default: @@ -1163,9 +1206,21 @@ class panels_renderer_editor extends panels_renderer_standard { unset($this->cache->style); } + if (!empty($form_state['cancel'])) { + // The cache must be saved prior to dismissing the modal. + panels_edit_cache_set($this->cache); + $this->commands[] = ctools_modal_command_dismiss(); + return; + } + // Copy settings from form state back into the cache. if(!empty($form_state['values']['settings'])) { - $this->cache->display->content[$pid]->style['settings'] = $form_state['values']['settings']; + if ($type == 'pane') { + $this->cache->display->content[$pid]->style['settings'] = $form_state['values']['settings']; + } + else if($type == 'region') { + $this->cache->display->panel_settings['style_settings'][$pid] = $form_state['values']['settings']; + } } panels_edit_cache_set($this->cache); @@ -1485,7 +1540,7 @@ function panels_ajax_edit_pane_next(&$form_state) { } /** - * Handle the 'finish' click on teh add/edit pane form wizard. + * Handle the 'finish' click on the add/edit pane form wizard. * * All we need to do is set a flag so the return can handle adding * the pane. @@ -1510,6 +1565,8 @@ function panels_ajax_edit_pane_cancel(&$form_state) { * Choose cache method form */ function panels_edit_cache_method_form($form, &$form_state) { + ctools_form_include($form_state, 'plugins', 'panels'); + form_load_include($form_state, 'php', 'panels', '/plugins/display_renderers/panels_renderer_editor.class'); $display = &$form_state['display']; $conf = &$form_state['conf']; @@ -1558,6 +1615,8 @@ function panels_edit_cache_method_form_submit($form, &$form_state) { * Cache settings form */ function panels_edit_cache_settings_form($form, &$form_state) { + ctools_form_include($form_state, 'plugins', 'panels'); + form_load_include($form_state, 'php', 'panels', '/plugins/display_renderers/panels_renderer_editor.class'); $display = &$form_state['display']; $conf = &$form_state['conf']; $pid = $form_state['pid']; @@ -1618,6 +1677,8 @@ function panels_edit_cache_settings_form_submit($form, &$form_state) { * Choose style form */ function panels_edit_style_type_form($form, &$form_state) { + ctools_form_include($form_state, 'plugins', 'panels'); + form_load_include($form_state, 'php', 'panels', '/plugins/display_renderers/panels_renderer_editor.class'); $display = &$form_state['display']; $style = $form_state['style']; $type = $form_state['type']; @@ -1668,6 +1729,8 @@ function panels_edit_style_type_form_submit($form, &$form_state) { * Style settings form */ function panels_edit_style_settings_form($form, &$form_state) { + ctools_form_include($form_state, 'plugins', 'panels'); + form_load_include($form_state, 'php', 'panels', '/plugins/display_renderers/panels_renderer_editor.class'); $display = &$form_state['display']; $conf = &$form_state['conf']; $pid = $form_state['pid']; @@ -1692,9 +1755,28 @@ function panels_edit_style_settings_form($form, &$form_state) { '#value' => t('Save'), ); + + // Need a cancel button since the style cache can persist and impact the wrong + // pane (or region, or display). + $form['cancel_style'] = array( + '#type' => 'submit', + '#value' => t('Cancel'), + '#submit' => array('panels_edit_style_settings_form_cancel'), + ); + return $form; } +/** + * Cancel style settings form. + * + * Clears the editing cache to prevent styles being applied to incorrect regions + * or panes. + */ +function panels_edit_style_settings_form_cancel($form, &$form_state) { + $form_state['cancel'] = TRUE; +} + /** * Validate style settings. */ @@ -1722,6 +1804,8 @@ function panels_edit_style_settings_form_submit($form, &$form_state) { * Configure CSS on a pane form. */ function panels_edit_configure_pane_css_form($form, &$form_state) { + ctools_form_include($form_state, 'plugins', 'panels'); + form_load_include($form_state, 'php', 'panels', '/plugins/display_renderers/panels_renderer_editor.class'); $display = &$form_state['display']; $pane = &$form_state['pane']; @@ -1729,13 +1813,13 @@ function panels_edit_configure_pane_css_form($form, &$form_state) { '#type' => 'textfield', '#default_value' => isset($pane->css['css_id']) ? $pane->css['css_id'] : '', '#title' => t('CSS ID'), - '#description' => t('CSS ID to apply to this pane. This may be blank.'), + '#description' => t('CSS ID to apply to this pane. This may be blank. Keywords from context are allowed.'), ); $form['css_class'] = array( '#type' => 'textfield', '#default_value' => isset($pane->css['css_class']) ? $pane->css['css_class'] : '', '#title' => t('CSS class'), - '#description' => t('CSS class to apply to this pane. This may be blank.'), + '#description' => t('CSS class to apply to this pane. This may be blank. Keywords from context are allowed.'), ); $form['next'] = array( @@ -1764,6 +1848,8 @@ function panels_edit_configure_pane_css_form_submit($form, &$form_state) { * Configure lock on a pane form. */ function panels_edit_configure_pane_lock_form($form, &$form_state) { + ctools_form_include($form_state, 'plugins', 'panels'); + form_load_include($form_state, 'php', 'panels', '/plugins/display_renderers/panels_renderer_editor.class'); $display = &$form_state['display']; $pane = &$form_state['pane']; @@ -1839,6 +1925,8 @@ function panels_edit_configure_pane_lock_form_submit($form, &$form_state) { * Form to control basic visibility settings. */ function panels_edit_configure_access_settings_form($form, &$form_state) { + ctools_form_include($form_state, 'plugins', 'panels'); + form_load_include($form_state, 'php', 'panels', '/plugins/display_renderers/panels_renderer_editor.class'); $display = &$form_state['display']; $pane = &$form_state['pane']; @@ -1876,6 +1964,8 @@ function panels_edit_configure_access_settings_form_submit($form, &$form_state) * Form to add a visibility rule. */ function panels_edit_add_access_test_form($form, &$form_state) { + ctools_form_include($form_state, 'plugins', 'panels'); + form_load_include($form_state, 'php', 'panels', '/plugins/display_renderers/panels_renderer_editor.class'); $display = &$form_state['display']; $pane = &$form_state['pane']; @@ -1905,6 +1995,8 @@ function panels_edit_add_access_test_form($form, &$form_state) { * Form to configure a visibility rule. */ function panels_edit_configure_access_test_form($form, &$form_state) { + ctools_form_include($form_state, 'plugins', 'panels'); + form_load_include($form_state, 'php', 'panels', '/plugins/display_renderers/panels_renderer_editor.class'); $display = &$form_state['display']; $test = &$form_state['test']; $plugin = &$form_state['plugin']; diff --git a/sites/all/modules/panels/plugins/display_renderers/panels_renderer_standard.class.php b/sites/all/modules/panels/plugins/display_renderers/panels_renderer_standard.class.php index f523374..58a72ee 100644 --- a/sites/all/modules/panels/plugins/display_renderers/panels_renderer_standard.class.php +++ b/sites/all/modules/panels/plugins/display_renderers/panels_renderer_standard.class.php @@ -151,6 +151,15 @@ class panels_renderer_standard { */ var $suffix = ''; + /** + * Boolean flag indicating whether to render the layout even if all rendered + * regions are blank. If FALSE, the layout renders as an empty string (without + * prefix or suffix) if not in administrative mode. + * + * @var bool + */ + var $show_empty_layout = TRUE; + /** * Receive and store the display object to be rendered. * @@ -176,6 +185,19 @@ class panels_renderer_standard { } } + /** + * Get the Panels storage oparation for a given renderer AJAX method. + * + * @param string $method + * The method name. + * + * @return string + * The Panels storage op. + */ + function get_panels_storage_op_for_ajax($method) { + return 'read'; + } + /** * Prepare the attached display for rendering. * @@ -396,6 +418,22 @@ class panels_renderer_standard { $theme = $this->plugins['layout']['theme']; } + // Determine whether to render layout. + $show = TRUE; + if (!$this->show_empty_layout && !$this->admin) { + $show = FALSE; + // Render layout if any region is not empty. + foreach ($this->rendered['regions'] as $region) { + if (is_string($region) && $region !== '') { + $show = TRUE; + break; + } + } + } + if (!$show) { + return; + } + $this->rendered['layout'] = theme($theme, array('css_id' => check_plain($this->display->css_id), 'content' => $this->rendered['regions'], 'settings' => $this->display->layout_settings, 'display' => $this->display, 'layout' => $this->plugins['layout'], 'renderer' => $this)); return $this->prefix . $this->rendered['layout'] . $this->suffix; } @@ -407,17 +445,38 @@ class panels_renderer_standard { * their CSS added in the right order: inner content before outer content. */ function add_meta() { + global $theme; + if (!empty($this->plugins['layout']['css'])) { - if (file_exists(path_to_theme() . '/' . $this->plugins['layout']['css'])) { - $this->add_css(path_to_theme() . '/' . $this->plugins['layout']['css']); + // Do not use the path_to_theme() function, because it returns the + // $GLOBALS['theme_path'] value, which may be overriden in the theme() + // function when the theme hook defines the key 'theme path'. + $theme_path = isset($theme) ? drupal_get_path('theme', $theme) : ''; + + $css = $this->plugins['layout']['css']; + if (!is_array($css)) { + $css = array($css); } - else { - $this->add_css($this->plugins['layout']['path'] . '/' . $this->plugins['layout']['css']); + + // Load each of the CSS files defined in this layout. + foreach ($css as $file) { + if (!empty($theme_path) && file_exists($theme_path . '/' . $file)) { + $this->add_css($theme_path . '/' . $file); + } + else { + $this->add_css($this->plugins['layout']['path'] . '/' . $file); + } } } if ($this->admin && isset($this->plugins['layout']['admin css'])) { - $this->add_css($this->plugins['layout']['path'] . '/' . $this->plugins['layout']['admin css']); + $admin_css = $this->plugins['layout']['admin css']; + if (!is_array($admin_css)) { + $admin_css = array($admin_css); + } + foreach ($admin_css as $file) { + $this->add_css($this->plugins['layout']['path'] . '/' . $file); + } } } @@ -453,6 +512,7 @@ class panels_renderer_standard { * The array of rendered panes, keyed on pane pid. */ function render_panes() { + drupal_alter('panels_prerender_panes', $this); ctools_include('content'); // First, render all the panes into little boxes. @@ -477,6 +537,8 @@ class panels_renderer_standard { * A Panels pane object, as loaded from the database. */ function render_pane(&$pane) { + module_invoke_all('panels_pane_prerender', $pane); + $content = $this->render_pane_content($pane); if ($this->display->hide_title == PANELS_TITLE_PANE && !empty($this->display->title_pane) && $this->display->title_pane == $pane->pid) { @@ -530,7 +592,6 @@ class panels_renderer_standard { $this->display->context = array(); } - $content = FALSE; $caching = !empty($pane->cache['method']) && empty($this->display->skip_cache); if ($caching && ($cache = panels_get_cached_content($this->display, $this->display->args, $this->display->context, $pane))) { $content = $cache->content; @@ -544,10 +605,6 @@ class panels_renderer_standard { $content = ctools_content_render($pane->type, $pane->subtype, $pane->configuration, array(), $this->display->args, $this->display->context); - if (empty($content)) { - return; - } - foreach (module_implements('panels_pane_content_alter') as $module) { $function = $module . '_panels_pane_content_alter'; $function($content, $pane, $this->display->args, $this->display->context, $this, $this->display); @@ -559,14 +616,19 @@ class panels_renderer_standard { } } - // Pass long the css_id that is usually available. - if (!empty($pane->css['css_id'])) { - $content->css_id = check_plain($pane->css['css_id']); - } + // If there's content, check if we've css configuration to add. + if (!empty($content)) { + // Pass long the css_id that is usually available. + if (!empty($pane->css['css_id'])) { + $id = ctools_context_keyword_substitute($pane->css['css_id'], array(), $this->display->context); + $content->css_id = check_plain($id); + } - // Pass long the css_class that is usually available. - if (!empty($pane->css['css_class'])) { - $content->css_class = check_plain($pane->css['css_class']); + // Pass long the css_class that is usually available. + if (!empty($pane->css['css_class'])) { + $class = ctools_context_keyword_substitute($pane->css['css_class'], array(), $this->display->context, array('css safe' => TRUE)); + $content->css_class = check_plain($class); + } } return $content; @@ -580,6 +642,7 @@ class panels_renderer_standard { * An array of rendered panel regions, keyed on the region name. */ function render_regions() { + drupal_alter('panels_prerender_regions', $this); $this->rendered['regions'] = array(); // Loop through all panel regions, put all panes that belong to the current diff --git a/sites/all/modules/panels/plugins/layouts/flexible/flexible-admin.js b/sites/all/modules/panels/plugins/layouts/flexible/flexible-admin.js index 10c6dd0..2cddd42 100644 --- a/sites/all/modules/panels/plugins/layouts/flexible/flexible-admin.js +++ b/sites/all/modules/panels/plugins/layouts/flexible/flexible-admin.js @@ -17,7 +17,7 @@ Drupal.flexible.fixHeight = function() { Drupal.behaviors.flexibleAdmin = { attach: function(context) { // Show/hide layout manager button - $('input#panels-flexible-toggle-layout:not(.panels-flexible-processed)', context) + $('#panels-flexible-toggle-layout:not(.panels-flexible-processed)', context) .addClass('panels-flexible-processed') .click(function() { $('.panel-flexible-admin') @@ -290,9 +290,6 @@ Drupal.flexible.splitter = function($splitter) { // if not moving the right side, adjust the parent padding instead. splitter.parent.css('padding-left', (splitter.left_padding - moved) + 'px'); splitter.left.parent().css('margin-left', (splitter.left_parent + moved) + 'px'); - if (jQuery.browser.msie) { - splitter.left.parent().css('left', splitter.currentLeft); - } } return false; }; diff --git a/sites/all/modules/panels/plugins/layouts/flexible/flexible.inc b/sites/all/modules/panels/plugins/layouts/flexible/flexible.inc index f49886b..4cdb216 100644 --- a/sites/all/modules/panels/plugins/layouts/flexible/flexible.inc +++ b/sites/all/modules/panels/plugins/layouts/flexible/flexible.inc @@ -471,15 +471,26 @@ function panels_flexible_render_items($renderer, $list, $owner_id) { switch ($item['type']) { case 'column': $content = panels_flexible_render_items($renderer, $item['children'], $renderer->base['column'] . '-' . $id); - $groups[$location] .= panels_flexible_render_item($renderer, $item, $content, $id, $position, $max); + if (empty($renderer->settings['items'][$id]['hide_empty']) || trim($content)) { + $groups[$location] .= panels_flexible_render_item($renderer, $item, $content, $id, $position, $max); + } break; case 'row': $content = panels_flexible_render_items($renderer, $item['children'], $renderer->base['row'] . '-' . $id); - $groups[$location] .= panels_flexible_render_item($renderer, $item, $content, $id, $position, $max, TRUE); + if (empty($renderer->settings['items'][$id]['hide_empty']) || trim($content)) { + $groups[$location] .= panels_flexible_render_item($renderer, $item, $content, $id, $position, $max, TRUE); + } break; case 'region': - $content = isset($renderer->content[$id]) ? $renderer->content[$id] : " "; - $groups[$location] .= panels_flexible_render_item($renderer, $item, $content, $id, $position, $max); + if (empty($renderer->settings['items'][$id]['hide_empty'])) { + $content = isset($renderer->content[$id]) ? $renderer->content[$id] : " "; + } + else { + $content = isset($renderer->content[$id]) ? trim($renderer->content[$id]) : ""; + } + if (empty($renderer->settings['items'][$id]['hide_empty']) || $content) { + $groups[$location] .= panels_flexible_render_item($renderer, $item, $content, $id, $position, $max); + } break; } @@ -1186,6 +1197,12 @@ function panels_flexible_config_item_form($form, &$form_state) { } } + $form['hide_empty'] = array( + '#title' => t('Hide element if empty'), + '#type' => 'checkbox', + '#default_value' => !empty($item['hide_empty']) ? 1 : 0, + ); + $form['save'] = array( '#type' => 'submit', '#value' => t('Save'), @@ -1223,6 +1240,7 @@ function panels_flexible_config_item_form_submit(&$form, &$form_state) { else { $item['contains'] = $form_state['values']['contains']; } + $item['hide_empty'] = $form_state['values']['hide_empty']; } @@ -1486,6 +1504,12 @@ function panels_flexible_add_item_form($form, &$form_state) { ); } + $form['hide_empty'] = array( + '#title' => t('Hide element if empty'), + '#type' => 'checkbox', + '#default_value' => 0, + ); + $form['save'] = array( '#type' => 'submit', '#value' => t('Save'), @@ -1516,6 +1540,8 @@ function panels_flexible_add_item_form_submit(&$form, &$form_state) { $item['contains'] = $form_state['values']['contains']; } + $item['hide_empty'] = $form_state['values']['hide_empty']; + if ($item['type'] == 'region') { // derive the region key from the title $key = preg_replace("/[^a-z0-9]/", '_', drupal_strtolower($item['title'])); diff --git a/sites/all/modules/panels/plugins/layouts/threecol_25_50_25_stacked/threecol_25_50_25_stacked.css b/sites/all/modules/panels/plugins/layouts/threecol_25_50_25_stacked/threecol_25_50_25_stacked.css index 1aa00da..c24dabf 100644 --- a/sites/all/modules/panels/plugins/layouts/threecol_25_50_25_stacked/threecol_25_50_25_stacked.css +++ b/sites/all/modules/panels/plugins/layouts/threecol_25_50_25_stacked/threecol_25_50_25_stacked.css @@ -18,7 +18,7 @@ width: 25%; } -.panel-3col-stacked .panel-col .inside { +.panel-3col-stacked .panel-col-first .inside { margin: 0 .5em 1em .5em; } diff --git a/sites/all/modules/panels/plugins/page_wizards/landing_page.inc b/sites/all/modules/panels/plugins/page_wizards/landing_page.inc index d9428da..030318f 100644 --- a/sites/all/modules/panels/plugins/page_wizards/landing_page.inc +++ b/sites/all/modules/panels/plugins/page_wizards/landing_page.inc @@ -66,6 +66,8 @@ function panels_landing_page_new_page(&$cache) { ); $cache->display = panels_new_display(); $cache->display->layout = 'flexible'; + $cache->display->storage_type = 'page_manager'; + $cache->display->storage_id = 'new'; } /** @@ -257,6 +259,9 @@ function panels_landing_page_finish(&$form_state) { // Create the the panel context variant configured with our display $plugin = page_manager_get_task_handler('panel_context'); + // Set the storage id. + $cache->display->storage_id = $cache->name; + // Create a new handler. $handler = page_manager_new_task_handler($plugin); $handler->conf['title'] = t('Landing page'); diff --git a/sites/all/modules/panels/plugins/panels_storage/page_manager.inc b/sites/all/modules/panels/plugins/panels_storage/page_manager.inc new file mode 100644 index 0000000..afb3aec --- /dev/null +++ b/sites/all/modules/panels/plugins/panels_storage/page_manager.inc @@ -0,0 +1,19 @@ + 'page_manager_panels_storage_access', +); + +/** + * Access callback for panels storage. + */ +function page_manager_panels_storage_access($storage_type, $storage_id, $op, $account) { + // Only users with the 'use page manager' or administer page manager perms. + return user_access('use page manager', $account) || user_access('administer page manager', $account) || user_access('use ipe with page manager', $account); +} diff --git a/sites/all/modules/panels/plugins/task_handlers/panel_context.inc b/sites/all/modules/panels/plugins/task_handlers/panel_context.inc index 06af824..2134556 100644 --- a/sites/all/modules/panels/plugins/task_handlers/panel_context.inc +++ b/sites/all/modules/panels/plugins/task_handlers/panel_context.inc @@ -286,7 +286,8 @@ function panels_panel_context_render($handler, $base_contexts, $args, $test = TR $display->context = $contexts; $display->args = $args; - $display->css_id = $handler->conf['css_id']; + $page_css_id = ctools_context_keyword_substitute($handler->conf['css_id'], array(), $contexts); + $display->css_id = check_plain($page_css_id); $task_name = page_manager_make_task_name($handler->task, $handler->subtask); $display->cache_key = panels_panel_context_cache_key($task_name, $handler->name, $args); @@ -297,7 +298,9 @@ function panels_panel_context_render($handler, $base_contexts, $args, $test = TR $css_id = 'panel_context:' . $handler->name; $filename = ctools_css_retrieve($css_id); if (!$filename) { - $filename = ctools_css_store($css_id, $handler->conf['css']); + // Add keywords from context + $css = ctools_context_keyword_substitute($handler->conf['css'], array(), $contexts, array('css safe' => TRUE)); + $filename = ctools_css_store($css_id, $css); } drupal_add_css($filename); } @@ -317,11 +320,23 @@ function panels_panel_context_render($handler, $base_contexts, $args, $test = TR // Remove and add body element classes $panel_body_css = &drupal_static('panel_body_css'); - if (isset($handler->conf['body_classes_to_remove']) && !isset($panel_body_css['body_classes_to_remove'])) { - $panel_body_css['body_classes_to_remove'] = $handler->conf['body_classes_to_remove']; + if (isset($handler->conf['body_classes_to_remove'])) { + $classes = ctools_context_keyword_substitute($handler->conf['body_classes_to_remove'], array(), $contexts, array('css safe' => TRUE)); + if (!isset($panel_body_css['body_classes_to_remove'])) { + $panel_body_css['body_classes_to_remove'] = check_plain($classes); + } + else{ + $panel_body_css['body_classes_to_remove'] .= ' ' . check_plain($classes); + } } - if (isset($handler->conf['body_classes_to_add']) && !isset($panel_body_css['body_classes_to_add'])) { - $panel_body_css['body_classes_to_add'] = $handler->conf['body_classes_to_add']; + if (isset($handler->conf['body_classes_to_add'])) { + $classes = ctools_context_keyword_substitute($handler->conf['body_classes_to_add'], array(), $contexts, array('css safe' => TRUE)); + if (!isset($panel_body_css['body_classes_to_add'])) { + $panel_body_css['body_classes_to_add'] = check_plain($classes); + } + else { + $panel_body_css['body_classes_to_add'] .= ' '. check_plain($classes); + } } $info = array( @@ -393,7 +408,10 @@ function panels_panel_context_export(&$handler, $indent) { unset($handler->conf[$item]); } } - $display->did = 'new'; + $display = (object) array( + 'did' => 'new', + 'uuid' => ctools_uuid_generate(), + ); $handler->conf['display'] = $display; } @@ -568,6 +586,19 @@ function panels_panel_context_edit_choose($form, &$form_state) { $form_state['display'] = &panels_panel_context_get_display($form_state['handler']); + // Grab the storage_type and storage_id and inject it into the display. + if (empty($form_state['display']->storage_type)) { + if (!isset($form_state[$form_state['task_id']]->storage_type)) { + watchdog('panels', "Unable to find the storage type for specified storage. Read 'Upgrading task handlers' in CHANGELOG.txt", array(), WATCHDOG_ERROR); + $form_state['display']->storage_type = 'unknown'; + } + else { + $form_state['display']->storage_type = $form_state[$form_state['task_id']]->storage_type; + } + // When adding variants, we don't know the handler id yet. In that case, + // Mark it as new. We'll assign it later. + $form_state['display']->storage_id = !empty($form_state['handler_id']) ? $form_state['handler_id'] : 'new'; + } // Tell the Panels form not to display buttons. $form_state['no buttons'] = TRUE; @@ -725,6 +756,10 @@ function panels_panel_context_edit_content_validate(&$form, &$form_state) { } function panels_panel_context_edit_content_submit(&$form, &$form_state) { + // Update the storage_id if this is a new variant before saving. + if ($form_state['display']->storage_id == 'new') { + $form_state['display']->storage_id = $form_state['handler_id']; + } panels_edit_display_form_submit($form, $form_state); $handler = &$form_state['handler']; @@ -760,17 +795,17 @@ function panels_panel_context_edit_settings($form, &$form_state) { $form['conf']['body_classes_to_remove'] = array( '#type' => 'textfield', '#size' => 128, - '#default_value' => $conf['body_classes_to_remove'], + '#default_value' => empty($conf['body_classes_to_remove']) ? '' : $conf['body_classes_to_remove'], '#title' => t('Remove body CSS classes'), - '#description' => t('The CSS classes to remove from the body element of this page. Separated by a space. For example: no-sidebars one-sidebar sidebar-first sidebar-second two-sidebars.'), + '#description' => t('The CSS classes to remove from the body element of this page. Separated by a space. For example: no-sidebars one-sidebar sidebar-first sidebar-second two-sidebars. Keywords from context are allowed.'), ); $form['conf']['body_classes_to_add'] = array( '#type' => 'textfield', '#size' => 128, - '#default_value' => $conf['body_classes_to_add'], + '#default_value' => empty($conf['body_classes_to_add']) ? '' : $conf['body_classes_to_add'], '#title' => t('Add body CSS classes'), - '#description' => t('The CSS classes to add to the body element of this page. Separated by a space. For example: no-sidebars one-sidebar sidebar-first sidebar-second two-sidebars.'), + '#description' => t('The CSS classes to add to the body element of this page. Separated by a space. For example: no-sidebars one-sidebar sidebar-first sidebar-second two-sidebars. Keywords from context are allowed.'), ); ctools_include('plugins', 'panels'); @@ -810,13 +845,13 @@ function panels_panel_context_edit_settings($form, &$form_state) { '#size' => 35, '#default_value' => $conf['css_id'], '#title' => t('CSS ID'), - '#description' => t('The CSS ID to apply to this page'), + '#description' => t('The CSS ID to apply to this page. Keywords from context are allowed.'), ); $form['conf']['css'] = array( '#type' => 'textarea', '#title' => t('CSS code'), - '#description' => t('Enter well-formed CSS code here; this code will be embedded into the page, and should only be used for minor adjustments; it is usually better to try to put CSS for the page into the theme if possible. This CSS will be filtered for safety so some CSS may not work.'), + '#description' => t('Enter well-formed CSS code here; this code will be embedded into the page, and should only be used for minor adjustments; it is usually better to try to put CSS for the page into the theme if possible. This CSS will be filtered for safety so some CSS may not work. Keywords from context are allowed.'), '#default_value' => $conf['css'], ); @@ -900,12 +935,25 @@ function panels_panel_context_get_addressable($task, $subtask_name, $handler, $a $display->cache_key = panels_panel_context_cache_key($task->name, $handler->name, $arguments); $renderer = panels_get_renderer($handler->conf['pipeline'], $display); - if ($type == 'content') { - $renderer->prepare(); + $renderer->prepare(); + if ($address) { $pid = array_shift($address); if (!empty($renderer->prepared['panes'][$pid])) { - return $renderer->render_pane($renderer->prepared['panes'][$pid]); + if ($type == 'content') { + return $renderer->render_pane($renderer->prepared['panes'][$pid]); + } + elseif ($type == 'pane') { + return $renderer->prepared['panes'][$pid]; + } + } + } + else { + if ($type == 'content') { + return $renderer->render(); + } + elseif ($type == 'renderer') { + return $renderer; } } } diff --git a/sites/all/modules/panels/plugins/views/panels_views_plugin_row_fields.inc b/sites/all/modules/panels/plugins/views/panels_views_plugin_row_fields.inc index 814350e..4a404ab 100644 --- a/sites/all/modules/panels/plugins/views/panels_views_plugin_row_fields.inc +++ b/sites/all/modules/panels/plugins/views/panels_views_plugin_row_fields.inc @@ -137,8 +137,8 @@ class panels_views_plugin_row_fields extends views_plugin_row_fields { // Now that we have distributed our fields, go through the regions and // render them into the content array. - foreach ($this->region_fields as $region_id => $fields) { - $this->view->field = $fields; + foreach ($this->region_fields as $region_id => $fields_list) { + $this->view->field = $fields_list; $content[$region_id] = theme($this->theme_functions(), array('view' => $this->view, 'options' => $this->options, 'row' => $row)); } diff --git a/sites/all/modules/panels/templates/panels-add-content-link.tpl.php b/sites/all/modules/panels/templates/panels-add-content-link.tpl.php index b426605..149ac82 100644 --- a/sites/all/modules/panels/templates/panels-add-content-link.tpl.php +++ b/sites/all/modules/panels/templates/panels-add-content-link.tpl.php @@ -5,6 +5,10 @@ */ ?>
    - -
    + + + + +
    +
    diff --git a/sites/all/modules/panels/templates/panels-add-content-modal.tpl.php b/sites/all/modules/panels/templates/panels-add-content-modal.tpl.php index 5041ff08..4c4dff8 100644 --- a/sites/all/modules/panels/templates/panels-add-content-modal.tpl.php +++ b/sites/all/modules/panels/templates/panels-add-content-modal.tpl.php @@ -26,6 +26,12 @@
    +
    + + +
    $column): ?>
    diff --git a/sites/all/modules/panels/templates/panels-pane.tpl.php b/sites/all/modules/panels/templates/panels-pane.tpl.php index 93dd113..0aa0102 100644 --- a/sites/all/modules/panels/templates/panels-pane.tpl.php +++ b/sites/all/modules/panels/templates/panels-pane.tpl.php @@ -20,14 +20,16 @@ -
    > +
    > - > + <> + + > diff --git a/sites/all/modules/views/drush/views.drush.inc b/sites/all/modules/views/drush/views.drush.inc index dd8af1b..eb2ecc2 100644 --- a/sites/all/modules/views/drush/views.drush.inc +++ b/sites/all/modules/views/drush/views.drush.inc @@ -42,10 +42,14 @@ function views_drush_command() { ), 'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_FULL, 'aliases' => array('vr'), + 'options' => array( + 'all' => 'If provided, all views will be reverted.', + ), 'examples' => array( 'drush vr archive' => 'Reverts the "archive" view.', 'drush rln archive frontpage' => 'Reverts the "archive" and "frontpage" view.', 'drush vr' => 'Will present you with a list of overridden views to choose from, and an option to revert all overridden views.', + 'drush vr --all' => 'Will revert all overridden views.', ), ); $items['views-dev'] = array( @@ -126,15 +130,21 @@ function views_revert_views() { } } - // Return early if there are no overridden views in the system. + // If there are no overridden views in the system, report it. if (empty($overridden)) { - return drush_set_error(dt('There are no overridden views in the system.')); + drush_log(dt('There are no overridden views in the system.'), 'ok'); } - // If the user specified in the command the views to be overridden. - if (!empty($viewnames)) { + // If the user provided the "--all" option, revert all views. + if (drush_get_option('all')) { + $i = views_revert_allviews($views); + } + + // If the user specified a list of views on the CLI, revert those. + elseif (!empty($viewnames)) { foreach ($viewnames as $key => $viewname) { $is_overridden = key_exists($viewname, $overridden); + // Check if the provided view name is in the system if ($viewname && !key_exists($viewname, $views)) { drush_set_error(dt("'@viewname' view is not present in the system.", array('@viewname' => $viewname))); @@ -144,18 +154,22 @@ function views_revert_views() { drush_set_error(dt("The view specified '@viewname' is not overridden.", array('@viewname' => $viewname))); } // If the view is overriden, revert it. - elseif ($is_overridden){ + elseif ($is_overridden) { views_revert_view($views[$viewname]); $i++; } // We should never get here but well... else { - drush_set_error(dt("The view specified '@viewname' is not provided in code, and thus cannot be reverted.", array('@viewname' => $viewname))); + drush_set_error(dt( + "The view specified '@viewname' is not provided in code, and thus cannot be reverted.", + array('@viewname' => $viewname) + )); } } } - // The user did not specify any views in the command, prompt the user + // The user neither selected the "--all" option, nor provided a list of views to revert. + // Prompt the user. else { // list of choices for the user $overridden['all'] = dt('Revert all overridden views'); // add a choice at the end diff --git a/sites/all/modules/views/handlers/views_handler_area_view.inc b/sites/all/modules/views/handlers/views_handler_area_view.inc index 45ea499..3b72bf6 100644 --- a/sites/all/modules/views/handlers/views_handler_area_view.inc +++ b/sites/all/modules/views/handlers/views_handler_area_view.inc @@ -51,33 +51,48 @@ class views_handler_area_view extends views_handler_area { * Render the area */ function render($empty = FALSE) { - if (!empty($this->options['view_to_insert'])) { - list($view_name, $display_id) = explode(':', $this->options['view_to_insert']); - - $view = views_get_view($view_name); - if (empty($view) || !$view->access($display_id)) { - return; - } - $view->set_display($display_id); - - // Avoid recursion - $view->parent_views += $this->view->parent_views; - $view->parent_views[] = "$view_name:$display_id"; - - // Check if the view is part of the parent views of this view - $search = "$view_name:$display_id"; - if (in_array($search, $this->view->parent_views)) { - drupal_set_message(t("Recursion detected in view @view display @display.", array('@view' => $view_name, '@display' => $display_id)), 'error'); + if ($view = $this->loadView()) { + if (!empty($this->options['inherit_arguments']) && !empty($this->view->args)) { + return $view->preview(NULL, $this->view->args); } else { - if (!empty($this->options['inherit_arguments']) && !empty($this->view->args)) { - return $view->preview($display_id, $this->view->args); - } - else { - return $view->preview($display_id); - } + return $view->preview(NULL); } } return ''; } + + /** + * Loads the used view for rendering. + * + * @return \view|NULL + * The loaded view or NULL, in case the view was not loadable / recursion + * got detected / access got denied. + */ + protected function loadView() { + if (empty($this->options['view_to_insert'])) { + return NULL; + } + list($view_name, $display_id) = explode(':', $this->options['view_to_insert']); + + $view = views_get_view($view_name); + if (empty($view) || !$view->access($display_id)) { + return NULL; + } + $view->set_display($display_id); + + // Avoid recursion. + $view->parent_views += $this->view->parent_views; + $view->parent_views[] = "$view_name:$display_id"; + + // Check if the view is part of the parent views of this view. + $search = "$view_name:$display_id"; + if (in_array($search, $this->view->parent_views)) { + drupal_set_message(t("Recursion detected in view @view display @display.", array('@view' => $view_name, '@display' => $display_id)), 'error'); + return NULL; + } + + return $view; + } + } diff --git a/sites/all/modules/views/handlers/views_handler_argument.inc b/sites/all/modules/views/handlers/views_handler_argument.inc index 5a5ec00..86c4a0d 100644 --- a/sites/all/modules/views/handlers/views_handler_argument.inc +++ b/sites/all/modules/views/handlers/views_handler_argument.inc @@ -419,7 +419,7 @@ class views_handler_argument extends views_handler { // Let the plugins do validation. $default_id = $form_state['values']['options']['default_argument_type']; $plugin = $this->get_plugin('argument default', $default_id); - if ($plugin) { + if ($plugin && isset($form['argument_default'][$default_id]) && isset($form_state['values']['options']['argument_default'][$default_id])) { $plugin->options_validate($form['argument_default'][$default_id], $form_state, $form_state['values']['options']['argument_default'][$default_id]); } @@ -1075,9 +1075,6 @@ class views_handler_argument extends views_handler { $argument = clone $this; if (!isset($arg) && $argument->has_default_argument()) { $arg = $argument->get_default_argument(); - - // remember that this argument was computed, not passed on the URL. - $this->is_default = TRUE; } // Set the argument, which will also validate that the argument can be set. if ($argument->set_argument($arg)) { diff --git a/sites/all/modules/views/handlers/views_handler_field_contextual_links.inc b/sites/all/modules/views/handlers/views_handler_field_contextual_links.inc index faeeedc..4386e05 100644 --- a/sites/all/modules/views/handlers/views_handler_field_contextual_links.inc +++ b/sites/all/modules/views/handlers/views_handler_field_contextual_links.inc @@ -10,35 +10,7 @@ * * @ingroup views_field_handlers */ -class views_handler_field_contextual_links extends views_handler_field { - function option_definition() { - $options = parent::option_definition(); - - $options['fields'] = array('default' => array()); - $options['destination'] = array('default' => TRUE, 'bool' => TRUE); - - return $options; - } - - function options_form(&$form, &$form_state) { - $all_fields = $this->view->display_handler->get_field_labels(); - // Offer to include only those fields that follow this one. - $field_options = array_slice($all_fields, 0, array_search($this->options['id'], array_keys($all_fields))); - $form['fields'] = array( - '#type' => 'checkboxes', - '#title' => t('Fields'), - '#description' => t('Fields to be included as contextual links.'), - '#options' => $field_options, - '#default_value' => $this->options['fields'], - ); - $form['destination'] = array( - '#type' => 'checkbox', - '#title' => t('Include destination'), - '#description' => t('Include a "destination" parameter in the link to return the user to the original view upon completing the contextual action.'), - '#default_value' => $this->options['destination'], - ); - } - +class views_handler_field_contextual_links extends views_handler_field_links { function pre_render(&$values) { // Add a row plugin css class for the contextual link. $class = 'contextual-links-region'; @@ -50,35 +22,18 @@ class views_handler_field_contextual_links extends views_handler_field { } } + function options_form(&$form, &$form_state) { + parent::options_form($form, $form_state); + + $form['fields']['#description'] = t('Fields to be included as contextual links.'); + $form['destination']['#description'] = t('Include a "destination" parameter in the link to return the user to the original view upon completing the contextual action.'); + } + /** * Render the contextual fields. */ function render($values) { - $links = array(); - foreach ($this->options['fields'] as $field) { - if (empty($this->view->style_plugin->rendered_fields[$this->view->row_index][$field])) { - continue; - } - $title = $this->view->field[$field]->last_render_text; - $path = ''; - if (!empty($this->view->field[$field]->options['alter']['path'])) { - $path = $this->view->field[$field]->options['alter']['path']; - } - if (!empty($title) && !empty($path)) { - // Make sure that tokens are replaced for this paths as well. - $tokens = $this->get_render_tokens(array()); - $path = strip_tags(decode_entities(strtr($path, $tokens))); - - $links[$field] = array( - 'href' => $path, - 'title' => $title, - ); - if (!empty($this->options['destination'])) { - $links[$field]['query'] = drupal_get_destination(); - } - } - } - + $links = $this->get_links(); if (!empty($links)) { $build = array( '#prefix' => '', '#dependency' => array('edit-options-group-rows' => array(TRUE)), '#fieldset' => 'multiple_field_settings', @@ -716,6 +728,10 @@ class views_handler_field_field extends views_handler_field { } function get_value($values, $field = NULL) { + if (!isset($values->_field_data[$this->field_alias]['entity']) || !is_object($values->_field_data[$this->field_alias]['entity'])) { + return array(); + } + // Go ahead and render and store in $this->items. $entity = clone $values->_field_data[$this->field_alias]['entity']; @@ -757,6 +773,11 @@ class views_handler_field_field extends views_handler_field { return array(); } + // If requested, randomize the order of the deltas. + if ($this->options['delta_random'] && !empty($entity->{$this->definition['field_name']})) { + shuffle($entity->{$this->definition['field_name']}[$langcode]); + } + // We are supposed to show only certain deltas. if ($this->limit_values && !empty($entity->{$this->definition['field_name']})) { $all_values = !empty($entity->{$this->definition['field_name']}[$langcode]) ? $entity->{$this->definition['field_name']}[$langcode] : array(); diff --git a/sites/all/modules/views/modules/locale.views.inc b/sites/all/modules/views/modules/locale.views.inc index 3bff7db..fe6d050 100644 --- a/sites/all/modules/views/modules/locale.views.inc +++ b/sites/all/modules/views/modules/locale.views.inc @@ -218,4 +218,11 @@ function locale_views_data_alter(&$data) { 'handler' => 'views_handler_sort', ), ); + $data['node']['specific_language'] = array( + 'title' => t('Specific language'), + 'help' => t('Sort by a specific language that the content is in.'), + 'sort' => array( + 'handler' => 'views_handler_sort_node_language', + ), + ); } diff --git a/sites/all/modules/views/modules/locale/views_handler_field_locale_link_edit.inc b/sites/all/modules/views/modules/locale/views_handler_field_locale_link_edit.inc index 3789355..811bcb2 100644 --- a/sites/all/modules/views/modules/locale/views_handler_field_locale_link_edit.inc +++ b/sites/all/modules/views/modules/locale/views_handler_field_locale_link_edit.inc @@ -52,7 +52,7 @@ class views_handler_field_locale_link_edit extends views_handler_field { $text = !empty($this->options['text']) ? $this->options['text'] : t('edit'); $this->options['alter']['make_link'] = TRUE; - $this->options['alter']['path'] = 'admin/build/translate/edit/' . $data; + $this->options['alter']['path'] = 'admin/config/regional/translate/edit/' . $data; $this->options['alter']['query'] = drupal_get_destination(); return $text; diff --git a/sites/all/modules/views/modules/locale/views_handler_sort_node_language.inc b/sites/all/modules/views/modules/locale/views_handler_sort_node_language.inc new file mode 100644 index 0000000..b429891 --- /dev/null +++ b/sites/all/modules/views/modules/locale/views_handler_sort_node_language.inc @@ -0,0 +1,107 @@ +options['language'])) { + $langcode = $this->get_system_langcode($this->options['language']); + // Validate the langcode. + if (preg_match('/^[a-z0-9\-]+$/i', $langcode)) { + $this->ensure_my_table(); + // See https://stackoverflow.com/questions/14104055/ordering-by-specific-field-value-first + $formula = "{$this->table_alias}_language = '{$langcode}'"; + $this->query->add_orderby($this->table_alias, NULL, $this->options['order'], $formula); + } + } + } + + /** + * Converts a views language code into a Drupal language code. + */ + function get_system_langcode($langcode) { + global $language_content; + $default_language = language_default('language'); + $system_langcode = str_replace(array( + '***CURRENT_LANGUAGE***', + '***DEFAULT_LANGUAGE***', + ), + array( + $language_content->language, + $default_language, + ), + $langcode); + return $system_langcode; + } + + /** + * {@inheritdoc} + */ + function option_definition() { + $options = parent::option_definition(); + $options['language'] = array('default' => '***CURRENT_LANGUAGE***'); + return $options; + } + + /** + * {@inheritdoc} + */ + function admin_summary() { + $summary = parent::admin_summary(); + if ($this->options['language']) { + $language_options = $this->get_language_options(); + $summary = t('@order, @language', array( + '@order' => $summary, + '@language' => $language_options[$this->options['language']], + )); + } + return $summary; + } + + /** + * Returns languages to sort by. + * + * @return array + * All the languages. + */ + function get_language_options() { + $languages = array( + '***CURRENT_LANGUAGE***' => t("Current user's language"), + '***DEFAULT_LANGUAGE***' => t("Default site language"), + LANGUAGE_NONE => t('No language') + ); + $languages = array_merge($languages, views_language_list()); + return $languages; + } + + /** + * {@inheritdoc} + */ + function show_sort_form(&$form, &$form_state) { + parent::show_sort_form($form, $form_state); + + $form['language'] = array( + '#type' => 'radios', + '#title' => t("Specific language"), + '#description' => t("Choose which specific language to sort by. Not to be confused with the 'Language' sort handler, which sorts by language."), + '#options' => $this->get_language_options(), + '#default_value' => $this->options['language'], + ); + } + +} + diff --git a/sites/all/modules/views/modules/node.views.inc b/sites/all/modules/views/modules/node.views.inc index 71a1023..1a9c76b 100644 --- a/sites/all/modules/views/modules/node.views.inc +++ b/sites/all/modules/views/modules/node.views.inc @@ -406,6 +406,23 @@ function node_views_data() { ), ); + $data['node']['version_count'] = array( + 'title' => t('Version Count'), + 'help' => t('The total count of versions/revisions of a certain node.'), + 'field' => array( + 'handler' => 'views_handler_field_node_version_count', + 'field' => 'nid', + 'click sortable' => TRUE, + ), + 'filter' => array( + 'handler' => 'views_handler_filter_node_version_count', + 'allow empty' => FALSE, + ), + 'sort' => array( + 'handler' => 'views_handler_sort_node_version_count', + ), + ); + // ---------------------------------------------------------------------- // Content revision table @@ -413,6 +430,7 @@ function node_views_data() { // have a group defined will go into this field by default. $data['node_revisions']['moved to'] = 'node_revision'; $data['node_revision']['table']['entity type'] = 'node'; + $data['node_revision']['table']['revision'] = TRUE; $data['node_revision']['table']['group'] = t('Content revision'); // Support the conversion of the field body $data['node_revisions']['body']['moved to'] = array('field_revision_data', 'body-revision_id'); diff --git a/sites/all/modules/views/modules/node/views_handler_field_node_version_count.inc b/sites/all/modules/views/modules/node/views_handler_field_node_version_count.inc new file mode 100644 index 0000000..73c2925 --- /dev/null +++ b/sites/all/modules/views/modules/node/views_handler_field_node_version_count.inc @@ -0,0 +1,21 @@ +ensure_my_table(); + // Add the field. + $params = $this->options['group_type'] != 'group' ? array('function' => $this->options['group_type']) : array(); + $this->field_alias = $this->query->add_field(NULL, '(SELECT COUNT(vid) FROM {node_revision} WHERE nid = {node}.nid)', 'node_version_count', $params); + + $this->add_additional_fields(); + } +} diff --git a/sites/all/modules/views/modules/node/views_handler_filter_node_uid_revision.inc b/sites/all/modules/views/modules/node/views_handler_filter_node_uid_revision.inc index 4d3d9a7..f8f4000 100644 --- a/sites/all/modules/views/modules/node/views_handler_filter_node_uid_revision.inc +++ b/sites/all/modules/views/modules/node/views_handler_filter_node_uid_revision.inc @@ -18,7 +18,7 @@ class views_handler_filter_node_uid_revision extends views_handler_filter_user_n $args = array_values($this->value); - $this->query->add_where_expression($this->options['group'], "$this->table_alias.uid IN($placeholder) " . $condition . " OR + $this->query->add_where_expression($this->options['group'], "$this->table_alias.uid IN($placeholder) " . "OR ((SELECT COUNT(*) FROM {node_revision} nr WHERE nr.uid IN($placeholder) AND nr.nid = $this->table_alias.nid) > 0)", array($placeholder => $args), $args); } diff --git a/sites/all/modules/views/modules/node/views_handler_filter_node_version_count.inc b/sites/all/modules/views/modules/node/views_handler_filter_node_version_count.inc new file mode 100644 index 0000000..c39f1d9 --- /dev/null +++ b/sites/all/modules/views/modules/node/views_handler_filter_node_version_count.inc @@ -0,0 +1,36 @@ +operator == 'between') { + $this->query->add_where_expression($this->options['group'], '(SELECT COUNT(vid) FROM {node_revision} WHERE nid = {' . $this->table_alias . '}.nid) BETWEEN :min AND :max', array(':min' => $this->value['min'], ':max' => $this->value['max'])); + } + else { + $this->query->add_where_expression($this->options['group'], '((SELECT COUNT(vid) FROM {node_revision} WHERE nid = {' . $this->table_alias . '}.nid) <= :min OR (SELECT COUNT(vid) FROM {node_revision} WHERE nid = {' . $this->table_alias . '}.nid) >= :max)', array(':min' => $this->value['min'], ':max' => $this->value['max'])); + } + } + + function op_simple($field) { + $this->query->add_where_expression($this->options['group'], '(SELECT COUNT(vid) FROM {node_revision} WHERE nid = {' . $this->table_alias . '}.nid)' . $this->operator . ' :value', array(':value' => $this->value['value'])); + } + + function op_empty($field) { + if ($this->operator == 'empty') { + $operator = "IS NULL"; + } + else { + $operator = "IS NOT NULL"; + } + + $this->query->add_where_expression($this->options['group'], '(SELECT COUNT(vid) FROM {node_revision} WHERE nid = {' . $this->table_alias . '}.nid) ' . $this->operator); + } + + function op_regex($field) { + $this->query->add_where_expression($this->options['group'], '(SELECT COUNT(vid) FROM {node_revision} WHERE nid = {' . $this->table_alias . '}.nid) RLIKE :value', array(':value' => $this->value['value'])); + } +} diff --git a/sites/all/modules/views/modules/node/views_handler_sort_node_version_count.inc b/sites/all/modules/views/modules/node/views_handler_sort_node_version_count.inc new file mode 100644 index 0000000..a8e1cf6 --- /dev/null +++ b/sites/all/modules/views/modules/node/views_handler_sort_node_version_count.inc @@ -0,0 +1,19 @@ +ensure_my_table(); + + $this->query->add_orderby(NULL, '(SELECT COUNT(vid) FROM {node_revision} WHERE nid = {' . $this->table_alias . '}.nid)', $this->options['order'], 'sort_node_version_count'); + } +} diff --git a/sites/all/modules/views/modules/node/views_plugin_row_node_rss.inc b/sites/all/modules/views/modules/node/views_plugin_row_node_rss.inc index 5da746b..6671892 100644 --- a/sites/all/modules/views/modules/node/views_plugin_row_node_rss.inc +++ b/sites/all/modules/views/modules/node/views_plugin_row_node_rss.inc @@ -117,7 +117,7 @@ class views_plugin_row_node_rss extends views_plugin_row { ), array( 'key' => 'dc:creator', - 'value' => $node->name, + 'value' => format_username($node), ), array( 'key' => 'guid', diff --git a/sites/all/modules/views/modules/search/views_handler_argument_search.inc b/sites/all/modules/views/modules/search/views_handler_argument_search.inc index f0a4a44..959a25a 100644 --- a/sites/all/modules/views/modules/search/views_handler_argument_search.inc +++ b/sites/all/modules/views/modules/search/views_handler_argument_search.inc @@ -56,7 +56,7 @@ class views_handler_argument_search extends views_handler_argument { $join->construct('search_total', $search_index, 'word', 'word'); $search_total = $this->query->add_relationship('search_total', $join, $search_index); - $this->search_score = $this->query->add_field('', "SUM($search_index.score * $search_total.count)", 'score', array('aggregate' => TRUE)); + $this->search_score = $this->query->add_field('', "$search_index.score * $search_total.count", 'score', array('aggregate' => TRUE, 'function' => 'sum')); if (empty($this->query->relationships[$this->relationship])) { $base_table = $this->query->base_table; diff --git a/sites/all/modules/views/modules/search/views_handler_filter_search.inc b/sites/all/modules/views/modules/search/views_handler_filter_search.inc index 16515a7..0b93031 100644 --- a/sites/all/modules/views/modules/search/views_handler_filter_search.inc +++ b/sites/all/modules/views/modules/search/views_handler_filter_search.inc @@ -150,7 +150,7 @@ class views_handler_filter_search extends views_handler_filter { $join->construct('search_total', $search_index, 'word', 'word'); $search_total = $this->query->add_relationship('search_total', $join, $search_index); - $this->search_score = $this->query->add_field('', "SUM($search_index.score * $search_total.count)", 'score', array('aggregate' => TRUE)); + $this->search_score = $this->query->add_field('', "$search_index.score * $search_total.count", 'score', array('aggregate' => TRUE, 'function' => 'sum')); } if (empty($this->query->relationships[$this->relationship])) { diff --git a/sites/all/modules/views/modules/statistics.views.inc b/sites/all/modules/views/modules/statistics.views.inc index d6637f3..6d99c5e 100644 --- a/sites/all/modules/views/modules/statistics.views.inc +++ b/sites/all/modules/views/modules/statistics.views.inc @@ -32,7 +32,7 @@ function statistics_views_data() { 'help' => t('The total number of times the node has been viewed.'), 'field' => array( - 'handler' => 'views_handler_field_numeric', + 'handler' => 'views_handler_field_statistics_numeric', 'click sortable' => TRUE, ), 'filter' => array( @@ -49,7 +49,7 @@ function statistics_views_data() { 'help' => t('The total number of times the node has been viewed today.'), 'field' => array( - 'handler' => 'views_handler_field_numeric', + 'handler' => 'views_handler_field_statistics_numeric', 'click sortable' => TRUE, ), 'filter' => array( @@ -66,7 +66,7 @@ function statistics_views_data() { 'help' => t('The most recent time the node has been viewed.'), 'field' => array( - 'handler' => 'views_handler_field_date', + 'handler' => 'views_handler_field_node_counter_timestamp', 'click sortable' => TRUE, ), 'filter' => array( diff --git a/sites/all/modules/views/modules/statistics/views_handler_field_node_counter_timestamp.inc b/sites/all/modules/views/modules/statistics/views_handler_field_node_counter_timestamp.inc new file mode 100644 index 0000000..d665519 --- /dev/null +++ b/sites/all/modules/views/modules/statistics/views_handler_field_node_counter_timestamp.inc @@ -0,0 +1,21 @@ + t('Display content if it has the selected taxonomy terms, or children of the selected terms. Due to additional complexity, this has fewer options than the versions without depth.'), + 'real field' => 'nid', + 'argument' => array( + 'title' => t('Has taxonomy term ID with depth (using joins)'), + 'handler' => 'views_handler_argument_term_node_tid_depth_join', + 'accept depth modifier' => TRUE, + ), + 'filter' => array( + 'title' => t('Has taxonomy terms with depth (using joins)'), + 'handler' => 'views_handler_filter_term_node_tid_depth_join', + ), + ); + $data['node']['term_node_tid_depth_modifier'] = array( 'title' => t('Has taxonomy term ID depth modifier'), 'help' => t('Allows the "depth" for Taxonomy: Term ID (with depth) to be modified via an additional contextual filter value.'), diff --git a/sites/all/modules/views/modules/taxonomy/views_handler_argument_term_node_tid_depth_join.inc b/sites/all/modules/views/modules/taxonomy/views_handler_argument_term_node_tid_depth_join.inc new file mode 100644 index 0000000..23ac62d --- /dev/null +++ b/sites/all/modules/views/modules/taxonomy/views_handler_argument_term_node_tid_depth_join.inc @@ -0,0 +1,191 @@ + 0); + $options['break_phrase'] = array('default' => FALSE, 'bool' => TRUE); + $options['set_breadcrumb'] = array('default' => FALSE, 'bool' => TRUE); + $options['use_taxonomy_term_path'] = array('default' => FALSE, 'bool' => TRUE); + + return $options; + } + + function options_form(&$form, &$form_state) { + $form['depth'] = array( + '#type' => 'weight', + '#title' => t('Depth'), + '#default_value' => $this->options['depth'], + '#description' => t('The depth will match nodes tagged with terms in the hierarchy. For example, if you have the term "fruit" and a child term "apple", with a depth of 1 (or higher) then filtering for the term "fruit" will get nodes that are tagged with "apple" as well as "fruit". If negative, the reverse is true; searching for "apple" will also pick up nodes tagged with "fruit" if depth is -1 (or lower).'), + ); + + $form['break_phrase'] = array( + '#type' => 'checkbox', + '#title' => t('Allow multiple values'), + '#description' => t('If selected, users can enter multiple values in the form of 1+2+3. Due to the number of JOINs it would require, AND will be treated as OR with this filter.'), + '#default_value' => !empty($this->options['break_phrase']), + ); + + $form['set_breadcrumb'] = array( + '#type' => 'checkbox', + '#title' => t("Set the breadcrumb for the term parents"), + '#description' => t('If selected, the breadcrumb trail will include all parent terms, each one linking to this view. Note that this only works if just one term was received.'), + '#default_value' => !empty($this->options['set_breadcrumb']), + ); + + $form['use_taxonomy_term_path'] = array( + '#type' => 'checkbox', + '#title' => t("Use Drupal's taxonomy term path to create breadcrumb links"), + '#description' => t('If selected, the links in the breadcrumb trail will be created using the standard drupal method instead of the custom views method. This is useful if you are using modules like taxonomy redirect to modify your taxonomy term links.'), + '#default_value' => !empty($this->options['use_taxonomy_term_path']), + '#dependency' => array('edit-options-set-breadcrumb' => array(TRUE)), + ); + parent::options_form($form, $form_state); + } + + function set_breadcrumb(&$breadcrumb) { + if (empty($this->options['set_breadcrumb']) || !is_numeric($this->argument)) { + return; + } + + return views_taxonomy_set_breadcrumb($breadcrumb, $this); + } + + /** + * Override default_actions() to remove summary actions. + */ + function default_actions($which = NULL) { + if ($which) { + if (in_array($which, array('ignore', 'not found', 'empty', 'default'))) { + return parent::default_actions($which); + } + return; + } + $actions = parent::default_actions(); + unset($actions['summary asc']); + unset($actions['summary desc']); + unset($actions['summary asc by count']); + unset($actions['summary desc by count']); + return $actions; + } + + function query($group_by = FALSE) { + $this->ensure_my_table(); + + if (!empty($this->options['break_phrase'])) { + $tids = new stdClass(); + $tids->value = $this->argument; + $tids = views_break_phrase($this->argument, $tids); + if ($tids->value == array(-1)) { + return FALSE; + } + + if (count($tids->value) > 1) { + $operator = 'IN'; + } + else { + $operator = '='; + } + + $tids = $tids->value; + } + else { + $operator = "="; + $tids = $this->argument; + } + + // The tids variable can be an integer or an array of integers. + $tids = is_array($tids) ? $tids : array($tids); + + if ($this->options['depth'] > 0) { + // When the depth is positive search the children. + foreach ($tids as $tid) { + // The term must be loaded to get vid for use in taxonomy_get_tree(). + if ($term = taxonomy_term_load($tid)) { + // For every tid argument find all the children down to the depth set + // in the options and save the tids for the condition. + $tree = taxonomy_get_tree($term->vid, $term->tid, (int) $this->options['depth']); + $tids = array_merge($tids, array_map('_taxonomy_get_tid_from_term', $tree)); + } + } + } + elseif ($this->options['depth'] < 0) { + // When the depth is negative search the parents. + foreach ($tids as $tid) { + // For every tid argument find all the parents up to the depth set + // in the options and add the tids into the array. Since there is + // no taxonomy function to get all parents with a depth limit it + // is done here building a multidimensional array. + if ($term = taxonomy_term_load($tid)) { + // A variable is needed to track the current depth level. + $n = 0; + // Initialise our depth based parents array with the leaf term. + $parents[$n--][] = $term; + while ($n >= $this->options['depth']) { + // At each depth find the parents of the current terms. + // It is important to note that it is possible for a term to have + // multiple parents so get the parents of every parent and so on. + $parents[$n] = array(); + foreach ($parents[$n + 1] as $term) { + $parents[$n] += taxonomy_get_parents($term->tid); + } + // Save all the tids for the condition. + $tids = array_merge($tids, array_map('_taxonomy_get_tid_from_term', $parents[$n])); + $n--; + } + } + } + } + + // Check the size of the array and set the operator accordingly. + if (count($tids) > 1) { + $operator = 'IN'; + } + else { + $tids = current($tids); + $operator = '='; + } + + // Join on taxonomy index table. + $join = new views_join(); + $join->table = 'taxonomy_index'; + $join->field = 'nid'; + $join->left_table = $this->table_alias; + $join->left_field = $this->real_field; + $join->type = 'INNER'; + $join->extra = array( + array( + 'field' => 'tid', + 'value' => $tids, + 'operator' => $operator, + ) + ); + $taxonomy_index_alias = $this->query->add_relationship('taxonomy_index', $join, 'node'); + + // Distinct is required to prevent duplicate rows. + $this->query->distinct = TRUE; + } + + function title() { + $term = taxonomy_term_load($this->argument); + if (!empty($term)) { + return check_plain($term->name); + } + + return t('No name'); + } +} diff --git a/sites/all/modules/views/modules/taxonomy/views_handler_filter_term_node_tid.inc b/sites/all/modules/views/modules/taxonomy/views_handler_filter_term_node_tid.inc index 8938ca9..ca2b344 100644 --- a/sites/all/modules/views/modules/taxonomy/views_handler_filter_term_node_tid.inc +++ b/sites/all/modules/views/modules/taxonomy/views_handler_filter_term_node_tid.inc @@ -206,6 +206,9 @@ class views_handler_filter_term_node_tid extends views_handler_filter_many_to_on if (empty($form_state['exposed'])) { // Retain the helper option $this->helper->options_form($form, $form_state); + + // Show help text if not exposed to end users. + $form['value']['#description'] = t('Leave blank for all. Otherwise, the first selected term will be the default instead of "Any".'); } } @@ -228,12 +231,25 @@ class views_handler_filter_term_node_tid extends views_handler_filter_many_to_on return TRUE; } + // We need to know the operator, which is normally set in + // views_handler_filter::accept_exposed_input(), before we actually call + // the parent version of ourselves. + if (!empty($this->options['expose']['use_operator']) && !empty($this->options['expose']['operator_id']) && isset($input[$this->options['expose']['operator_id']])) { + $this->operator = $input[$this->options['expose']['operator_id']]; + } + // If view is an attachment and is inheriting exposed filters, then assume // exposed input has already been validated if (!empty($this->view->is_attachment) && $this->view->display_handler->uses_exposed()) { $this->validated_exposed_input = (array) $this->view->exposed_raw_input[$this->options['expose']['identifier']]; } + // If we're checking for EMPTY or NOT, we don't need any input, and we can + // say that our input conditions are met by just having the right operator. + if ($this->operator == 'empty' || $this->operator == 'not empty') { + return TRUE; + } + // If it's non-required and there's no value don't bother filtering. if (!$this->options['expose']['required'] && empty($this->validated_exposed_input)) { return FALSE; diff --git a/sites/all/modules/views/modules/taxonomy/views_handler_filter_term_node_tid_depth_join.inc b/sites/all/modules/views/modules/taxonomy/views_handler_filter_term_node_tid_depth_join.inc new file mode 100644 index 0000000..8139b8d --- /dev/null +++ b/sites/all/modules/views/modules/taxonomy/views_handler_filter_term_node_tid_depth_join.inc @@ -0,0 +1,142 @@ + t('Is one of'), + ); + } + + function option_definition() { + $options = parent::option_definition(); + + $options['depth'] = array('default' => 0); + + return $options; + } + + function extra_options_form(&$form, &$form_state) { + parent::extra_options_form($form, $form_state); + + $form['depth'] = array( + '#type' => 'weight', + '#title' => t('Depth'), + '#default_value' => $this->options['depth'], + '#description' => t('The depth will match nodes tagged with terms in the hierarchy. For example, if you have the term "fruit" and a child term "apple", with a depth of 1 (or higher) then filtering for the term "fruit" will get nodes that are tagged with "apple" as well as "fruit". If negative, the reverse is true; searching for "apple" will also pick up nodes tagged with "fruit" if depth is -1 (or lower).'), + ); + } + + function query() { + // If no filter values are present, then do nothing. + if (count($this->value) == 0) { + return; + } + elseif (count($this->value) == 1) { + // Somethis $this->value is an array with a single element so convert it. + if (is_array($this->value)) { + $this->value = current($this->value); + } + $operator = '='; + } + else { + $operator = 'IN';# " IN (" . implode(', ', array_fill(0, sizeof($this->value), '%d')) . ")"; + } + + // The normal use of ensure_my_table() here breaks Views. + // So instead we trick the filter into using the alias of the base table. + // See http://drupal.org/node/271833 + // If a relationship is set, we must use the alias it provides. + if (!empty($this->relationship)) { + $this->table_alias = $this->relationship; + } + // If no relationship, then use the alias of the base table. + elseif (isset($this->query->table_queue[$this->query->base_table]['alias'])) { + $this->table_alias = $this->query->table_queue[$this->query->base_table]['alias']; + } + // This should never happen, but if it does, we fail quietly. + else { + return; + } + + // The tids variable can be an integer or an array of integers. + $tids = is_array($this->value) ? $this->value : array($this->value); + + if ($this->options['depth'] > 0) { + // When the depth is positive search the children. + foreach ($tids as $tid) { + // The term must be loaded to get vid for use in taxonomy_get_tree(). + if ($term = taxonomy_term_load($tid)) { + // For every tid argument find all the children down to the depth set + // in the options and save the tids for the condition. + $tree = taxonomy_get_tree($term->vid, $term->tid, (int) $this->options['depth']); + $tids = array_merge($tids, array_map('_taxonomy_get_tid_from_term', $tree)); + } + } + } + elseif ($this->options['depth'] < 0) { + // When the depth is negative search the parents. + foreach ($tids as $tid) { + // For every tid argument find all the parents up to the depth set + // in the options and add the tids into the array. Since there is + // no taxonomy function to get all parents with a depth limit it + // is done here building a multidimensional array. + if ($term = taxonomy_term_load($tid)) { + // A variable is needed to track the current depth level. + $n = 0; + // Initialise our depth based parents array with the leaf term. + $parents[$n--][] = $term; + while ($n >= $this->options['depth']) { + // At each depth find the parents of the current terms. + // It is important to note that it is possible for a term to have + // multiple parents so get the parents of every parent and so on. + $parents[$n] = array(); + foreach ($parents[$n + 1] as $term) { + $parents[$n] += taxonomy_get_parents($term->tid); + } + // Save all the tids for the condition. + $tids = array_merge($tids, array_map('_taxonomy_get_tid_from_term', $parents[$n])); + $n--; + } + } + } + } + + // Check the size of the array and set the operator accordingly. + if (count($tids) > 1) { + $operator = 'IN'; + } + else { + $tids = current($tids); + $operator = '='; + } + + // Join on taxonomy index table. + $join = new views_join(); + $join->table = 'taxonomy_index'; + $join->field = 'nid'; + $join->left_table = $this->table_alias; + $join->left_field = $this->real_field; + $join->type = 'INNER'; + $join->extra = array( + array( + 'field' => 'tid', + 'value' => $tids, + 'operator' => $operator, + ) + ); + $taxonomy_index_alias = $this->query->add_relationship('taxonomy_index', $join, 'node'); + } +} diff --git a/sites/all/modules/views/modules/translation.views.inc b/sites/all/modules/views/modules/translation.views.inc index b36c7a7..584c63f 100644 --- a/sites/all/modules/views/modules/translation.views.inc +++ b/sites/all/modules/views/modules/translation.views.inc @@ -51,7 +51,7 @@ function translation_views_data_alter(&$data) { ), ); - // The source translation. + // All translations. $data['node']['translation'] = array( 'group' => t('Content translation'), 'title' => t('Translations'), @@ -62,7 +62,7 @@ function translation_views_data_alter(&$data) { 'base' => 'node', 'base field' => 'tnid', 'relationship table' => 'node', - 'relationship field' => 'nid', + 'relationship field' => 'tnid', 'handler' => 'views_handler_relationship_translation', 'label' => t('Translations'), ), @@ -78,7 +78,7 @@ function translation_views_data_alter(&$data) { ), ); - // The source translation. + // Child translation. $data['node']['child_translation'] = array( 'group' => t('Node translation'), 'title' => t('Child translation'), diff --git a/sites/all/modules/views/modules/views.views.inc b/sites/all/modules/views/modules/views.views.inc index 7c3f4db..ce3aad3 100644 --- a/sites/all/modules/views/modules/views.views.inc +++ b/sites/all/modules/views/modules/views.views.inc @@ -99,6 +99,14 @@ function views_views_data() { ); } + $data['views']['ctools_dropdown'] = array( + 'title' => t('Dropdown links'), + 'help' => t('Displays fields in a dropdown list, like on the views listing page.'), + 'field' => array( + 'handler' => 'views_handler_field_ctools_dropdown', + ), + ); + $data['views']['combine'] = array( 'title' => t('Combine fields filter'), 'help' => t('Combine two fields together and search by them.'), diff --git a/sites/all/modules/views/plugins/export_ui/views_ui.class.php b/sites/all/modules/views/plugins/export_ui/views_ui.class.php index 9d80138..6f87e40 100644 --- a/sites/all/modules/views/plugins/export_ui/views_ui.class.php +++ b/sites/all/modules/views/plugins/export_ui/views_ui.class.php @@ -385,8 +385,8 @@ class views_ui extends ctools_export_ui { $output = parent::list_page($js, $input); if (is_string($output)) { $output = '
    ' . $output . '
    '; - return $output; } + return $output; } } diff --git a/sites/all/modules/views/plugins/views_plugin_argument_validate.inc b/sites/all/modules/views/plugins/views_plugin_argument_validate.inc index 07b49ee..350cb43 100644 --- a/sites/all/modules/views/plugins/views_plugin_argument_validate.inc +++ b/sites/all/modules/views/plugins/views_plugin_argument_validate.inc @@ -86,7 +86,7 @@ class views_plugin_argument_validate extends views_plugin { /** * Process the summary arguments for displaying. * - * Some plugins alter the argument so it uses something else interal. + * Some plugins alter the argument so it uses something else internally. * For example the user validation set's the argument to the uid, * for a faster query. But there are use cases where you want to use * the old value again, for example the summary. diff --git a/sites/all/modules/views/plugins/views_plugin_cache.inc b/sites/all/modules/views/plugins/views_plugin_cache.inc index 81f71bf..0dfc911 100644 --- a/sites/all/modules/views/plugins/views_plugin_cache.inc +++ b/sites/all/modules/views/plugins/views_plugin_cache.inc @@ -206,14 +206,14 @@ class views_plugin_cache extends views_plugin { // Slightly less simple for CSS: $css = drupal_add_css(); $css_start = isset($this->storage['css']) ? $this->storage['css'] : array(); - $this->storage['css'] = $array_mapping_func($css, $css_start); + $this->storage['css'] = $this->assetDiff($css, $css_start, $array_mapping_func); // Get javascript after/before views renders. $js = drupal_add_js(); $js_start = isset($this->storage['js']) ? $this->storage['js'] : array(); // If there are any differences between the old and the new javascript then // store them to be added later. - $this->storage['js'] = $array_mapping_func($js, $js_start); + $this->storage['js'] = $this->assetDiff($js, $js_start, $array_mapping_func); // Special case the settings key and get the difference of the data. $settings = isset($js['settings']['data']) ? $js['settings']['data'] : array(); @@ -224,6 +224,38 @@ class views_plugin_cache extends views_plugin { $this->storage['headers'] = $array_mapping_func(drupal_get_http_header(), $this->storage['headers']); } + /** + * Computes the differences between two JS/CSS asset arrays. + * + * @param array $assets + * The current asset array. + * @param array $start_assets + * The original asset array. + * @param string $diff_function + * The function that should be used for computing the diff. + * + * @return array + * A CSS or JS asset array that contains all entries that are new/different + * in $assets. + */ + protected function assetDiff(array $assets, array $start_assets, $diff_function) { + $diff = $diff_function($assets, $start_assets); + + // Cleanup the resulting array since drupal_array_diff_assoc_recursive() can + // leave half populated arrays behind. + foreach ($diff as $key => $entry) { + // If only the weight was different we can remove this entry. + if (count($entry) == 1 && isset($entry['weight'])) { + unset($diff[$key]); + } + // If there are other differences we override with the latest entry. + elseif ($entry != $assets[$key]) { + $diff[$key] = $assets[$key]; + } + } + return $diff; + } + /** * Restore out of band data saved to cache. Copied from Panels. */ diff --git a/sites/all/modules/views/plugins/views_plugin_cache_time.inc b/sites/all/modules/views/plugins/views_plugin_cache_time.inc index 25245ea..d3ab7f9 100644 --- a/sites/all/modules/views/plugins/views_plugin_cache_time.inc +++ b/sites/all/modules/views/plugins/views_plugin_cache_time.inc @@ -107,4 +107,21 @@ class views_plugin_cache_time extends views_plugin_cache { return CACHE_PERMANENT; } } + + function cache_set($type) { + $lifespan = $this->get_lifespan($type); + if ($lifespan >= 0) { + parent::cache_set($type); + } + } + + function cache_get($type) { + $lifespan = $this->get_lifespan($type); + if ($lifespan >= 0) { + return parent::cache_get($type); + } + else { + return FALSE; + } + } } diff --git a/sites/all/modules/views/plugins/views_plugin_display.inc b/sites/all/modules/views/plugins/views_plugin_display.inc index db124de..a4b732e 100644 --- a/sites/all/modules/views/plugins/views_plugin_display.inc +++ b/sites/all/modules/views/plugins/views_plugin_display.inc @@ -53,7 +53,7 @@ class views_plugin_display extends views_plugin { $this->extender[$extender] = $plugin; } else { - vpr('Invalid display extender @extender', array('@handler' => $extender)); + vpr('Invalid display extender @extender', array('@extender' => $extender)); } } } @@ -739,7 +739,7 @@ class views_plugin_display extends views_plugin { function uses_link_display() { return !$this->has_path(); } /** - * Check to see if the display can put the exposed formin a block. + * Check to see if the display can put the exposed form in a block. * * By default, displays that do not have a path cannot disconnect * the exposed form and put it in a block, because the form has no @@ -1150,7 +1150,7 @@ class views_plugin_display extends views_plugin { ); } - $display_comment = check_plain(drupal_substr($this->get_option('display_comment'), 0, 10)); + $display_comment = check_plain(views_ui_truncate($this->get_option('display_comment'), 80)); $options['display_comment'] = array( 'category' => 'other', 'title' => t('Comment'), @@ -1419,7 +1419,7 @@ class views_plugin_display extends views_plugin { } $form['#title'] = check_plain($this->display->display_title) . ': '; - // Set the 'section' to hilite on the form. + // Set the 'section' to highlight on the form. // If it's the item we're looking at is pulling from the default display, // reflect that. Don't use is_defaulted since we want it to show up even // on the default display. @@ -1573,8 +1573,12 @@ class views_plugin_display extends views_plugin { $plugin = $this->get_plugin('access'); $form['#title'] .= t('Access options'); if ($plugin) { - $form['#help_topic'] = $plugin->definition['help topic']; - $form['#help_module'] = $plugin->definition['module']; + if (!empty($plugin->definition['help topic'])) { + $form['#help_topic'] = $plugin->definition['help topic']; + } + if (!empty($plugin->definition['module'])) { + $form['#help_module'] = $plugin->definition['module']; + } $form['access_options'] = array( '#tree' => TRUE, @@ -1615,8 +1619,12 @@ class views_plugin_display extends views_plugin { $plugin = $this->get_plugin('cache'); $form['#title'] .= t('Caching options'); if ($plugin) { - $form['#help_topic'] = $plugin->definition['help topic']; - $form['#help_module'] = $plugin->definition['module']; + if (!empty($plugin->definition['help topic'])) { + $form['#help_topic'] = $plugin->definition['help topic']; + } + if (!empty($plugin->definition['module'])) { + $form['#help_module'] = $plugin->definition['module']; + } $form['cache_options'] = array( '#tree' => TRUE, @@ -1635,11 +1643,10 @@ class views_plugin_display extends views_plugin { $form['#title'] .= t('Query options'); $this->view->init_query(); if ($this->view->query) { - if (isset($this->view->query->definition['help topic'])) { + if (!empty($this->view->query->definition['help topic'])) { $form['#help_topic'] = $this->view->query->definition['help topic']; } - - if (isset($this->view->query->definition['module'])) { + if (!empty($this->view->query->definition['module'])) { $form['#help_module'] = $this->view->query->definition['module']; } @@ -1734,8 +1741,10 @@ class views_plugin_display extends views_plugin { } $plugin = $this->get_plugin(empty($style) ? 'row' : 'style'); if ($plugin) { - if (isset($plugin->definition['help topic'])) { + if (!empty($plugin->definition['help topic'])) { $form['#help_topic'] = $plugin->definition['help topic']; + } + if (!empty($plugin->definition['module'])) { $form['#help_module'] = $plugin->definition['module']; } $form[$form_state['section']] = array( @@ -2117,7 +2126,12 @@ class views_plugin_display extends views_plugin { $plugin = $this->get_plugin('exposed_form'); $form['#title'] .= t('Exposed form options'); if ($plugin) { - $form['#help_topic'] = $plugin->definition['help topic']; + if (!empty($plugin->definition['help topic'])) { + $form['#help_topic'] = $plugin->definition['help topic']; + } + if (!empty($plugin->definition['module'])) { + $form['#help_module'] = $plugin->definition['module']; + } $form['exposed_form_options'] = array( '#tree' => TRUE, @@ -2140,7 +2154,7 @@ class views_plugin_display extends views_plugin { '#default_value' => $pager['type'], ); - $pager_plugin = views_fetch_plugin_data('pager', $pager['type'], array($this->view->base_table)); + $pager_plugin = views_fetch_plugin_data('pager', $pager['type']); if (!empty($pager_plugin['uses options'])) { $form['markup'] = array( '#prefix' => '
    ', @@ -2154,7 +2168,12 @@ class views_plugin_display extends views_plugin { $plugin = $this->get_plugin('pager'); $form['#title'] .= t('Pager options'); if ($plugin) { - $form['#help_topic'] = $plugin->definition['help topic']; + if (!empty($plugin->definition['help topic'])) { + $form['#help_topic'] = $plugin->definition['help topic']; + } + if (!empty($plugin->definition['module'])) { + $form['#help_module'] = $plugin->definition['module']; + } $form['pager_options'] = array( '#tree' => TRUE, @@ -2556,6 +2575,23 @@ class views_plugin_display extends views_plugin { $url_options['query'] = $this->view->exposed_raw_input; } $theme = views_theme_functions('views_more', $this->view, $this->display); + + $parsed_url = drupal_parse_url($path); + // Preserve the query string from url. + if (!empty($parsed_url['query'])) { + if (!empty($url_options['query'])) { + $url_options['query'] = array_merge($parsed_url['query'], $url_options['query']); + } + else { + $url_options['query'] = $parsed_url['query']; + } + $path = $parsed_url['path']; + } + // Add fragment if applicable. + if (!empty($parsed_url['fragment'])) { + $url_options['fragment'] = $parsed_url['fragment']; + } + $path = check_url(url($path, $url_options)); return theme($theme, array('more_url' => $path, 'link_text' => check_plain($this->use_more_text()), 'view' => $this->view)); diff --git a/sites/all/modules/views/plugins/views_plugin_display_attachment.inc b/sites/all/modules/views/plugins/views_plugin_display_attachment.inc index 91c8d1f..8608cfc 100644 --- a/sites/all/modules/views/plugins/views_plugin_display_attachment.inc +++ b/sites/all/modules/views/plugins/views_plugin_display_attachment.inc @@ -227,6 +227,8 @@ class views_plugin_display_attachment extends views_plugin_display { $args = $this->get_option('inherit_arguments') ? $this->view->args : array(); $view->set_arguments($args); + $exposed_input = $this->get_option('inherit_exposed_filters') ? $this->view->exposed_input : array(); + $view->set_exposed_input($exposed_input); $view->set_display($this->display->id); if ($this->get_option('inherit_pager')) { $view->display_handler->use_pager = $this->view->display[$display_id]->handler->use_pager(); diff --git a/sites/all/modules/views/plugins/views_plugin_display_block.inc b/sites/all/modules/views/plugins/views_plugin_display_block.inc index c903a9b..d581a16 100644 --- a/sites/all/modules/views/plugins/views_plugin_display_block.inc +++ b/sites/all/modules/views/plugins/views_plugin_display_block.inc @@ -222,8 +222,8 @@ class views_plugin_display_block extends views_plugin_display { } /** - * Save the block cache setting in the blocks table if this block allready - * exists in the blocks table. Dirty fix untill http://drupal.org/node/235673 gets in. + * Save the block cache setting in the blocks table if this block already + * exists in the blocks table. Dirty fix until http://drupal.org/node/235673 gets in. */ function save_block_cache($delta, $cache_setting) { if (strlen($delta) >= 32) { diff --git a/sites/all/modules/views/plugins/views_plugin_query_default.inc b/sites/all/modules/views/plugins/views_plugin_query_default.inc index 8a15e8d..7468dd9 100644 --- a/sites/all/modules/views/plugins/views_plugin_query_default.inc +++ b/sites/all/modules/views/plugins/views_plugin_query_default.inc @@ -143,7 +143,7 @@ class views_plugin_query_default extends views_plugin_query { ); /** - * -- we no longer want the base field to appear automatigically. + * -- we no longer want the base field to appear automatically. if ($base_field) { $this->fields[$base_field] = array( 'table' => $base_table, @@ -888,7 +888,7 @@ class views_plugin_query_default extends views_plugin_query { /** * Add a complex WHERE clause to the query. * - * The caller is reponsible for ensuring that all fields are fully qualified + * The caller is responsible for ensuring that all fields are fully qualified * (TABLE.FIELD) and that the table already exists in the query. * Internally the dbtng method "where" is used. * @@ -1322,6 +1322,10 @@ class views_plugin_query_default extends views_plugin_query { if (count($this->having)) { $this->has_aggregate = TRUE; } + elseif (!$this->has_aggregate) { + // Allow 'GROUP BY' even no aggregation function has been set. + $this->has_aggregate = $this->view->display_handler->get_option('group_by'); + } if ($this->has_aggregate && (!empty($this->groupby) || !empty($non_aggregates))) { $groupby = array_unique(array_merge($this->groupby, $non_aggregates)); foreach ($groupby as $field) { @@ -1588,7 +1592,7 @@ class views_plugin_query_default extends views_plugin_query { 'sort' => 'views_handler_sort_group_by_numeric', ), ) - ); + ) + views_fetch_plugin_data('query_aggregate'); } /** @@ -1616,7 +1620,8 @@ class views_plugin_query_default extends views_plugin_query { } $entity_type = $table_data['table']['entity type']; $info = entity_get_info($entity_type); - $id_alias = $this->get_field_alias($base_table_alias, $info['entity keys']['id']); + $is_revision = !empty($table_data['table']['revision']); + $id_alias = $this->get_field_alias($base_table_alias, $info['entity keys'][$is_revision ? 'revision' : 'id']); // Assemble the ids of the entities to load. $ids = array(); @@ -1626,12 +1631,34 @@ class views_plugin_query_default extends views_plugin_query { } } - $entities = entity_load($entity_type, $ids); - // Re-key the array by row-index. - $result = array(); - foreach ($ids as $key => $id) { - $result[$key] = isset($entities[$id]) ? $entities[$id] : FALSE; + if (!$is_revision) { + $entities = entity_load($entity_type, $ids); + + // Re-key the array by row-index. + $result = array(); + foreach ($ids as $key => $id) { + $result[$key] = isset($entities[$id]) ? $entities[$id] : FALSE; + } } + else { + // There's no way in core to load revisions in bulk. + $result = array(); + foreach ($ids as $key => $id) { + // Nodes can be dealt with in core. + if ($entity_type == 'node') { + $result[$key] = node_load(NULL, $id); + } + // Otherwise see if entity is enabled. + elseif (module_exists('entity')) { + $result[$key] = entity_revision_load($entity_type, $id); + } + else { + // Otherwise this isn't supported. + watchdog('views', 'Attempt to load a revision on an unsupported entity type @entity_type.', array('@entity_type' => $entity_type), WATCHDOG_WARNING); + } + } + } + return array($entity_type, $result); } } diff --git a/sites/all/modules/views/plugins/views_plugin_style.inc b/sites/all/modules/views/plugins/views_plugin_style.inc index d355e1b..fe12607 100644 --- a/sites/all/modules/views/plugins/views_plugin_style.inc +++ b/sites/all/modules/views/plugins/views_plugin_style.inc @@ -123,13 +123,23 @@ class views_plugin_style extends views_plugin { function get_row_class($row_index) { if ($this->uses_row_class()) { $class = $this->options['row_class']; + if ($this->uses_fields() && $this->view->field) { - $class = strip_tags($this->tokenize_value($class, $row_index)); + $classes = array(); + + // Explode the value by whitespace, this allows the function to handle + // a single class name and multiple class names that are then tokenized. + foreach(explode(' ', $class) as $token_class) { + $classes[] = strip_tags($this->tokenize_value($token_class, $row_index)); + } + } + else { + $classes = explode(' ', $class); } - $classes = explode(' ', $class); + // Convert whatever the result is to a nice clean class name foreach ($classes as &$class) { - $class = drupal_clean_css_identifier($class); + $class = drupal_html_class($class); } return implode(' ', $classes); } @@ -182,7 +192,7 @@ class views_plugin_style extends views_plugin { function options_form(&$form, &$form_state) { parent::options_form($form, $form_state); // Only fields-based views can handle grouping. Style plugins can also exclude - // themselves from being groupable by setting their "use grouping" definiton + // themselves from being groupable by setting their "use grouping" definition // key to FALSE. // @TODO: Document "uses grouping" in docs.php when docs.php is written. if ($this->uses_fields() && $this->definition['uses grouping']) { @@ -191,7 +201,7 @@ class views_plugin_style extends views_plugin { $options += $field_labels; // If there are no fields, we can't group on them. if (count($options) > 1) { - // This is for backward compability, when there was just a single select form. + // This is for backward compatibility, when there was just a single select form. if (is_string($this->options['grouping'])) { $grouping = $this->options['grouping']; $this->options['grouping'] = array(); @@ -419,7 +429,7 @@ class views_plugin_style extends views_plugin { * @endcode */ function render_grouping($records, $groupings = array(), $group_rendered = NULL) { - // This is for backward compability, when $groupings was a string containing + // This is for backward compatibility, when $groupings was a string containing // the ID of a single field. if (is_string($groupings)) { $rendered = $group_rendered === NULL ? TRUE : $group_rendered; @@ -486,7 +496,7 @@ class views_plugin_style extends views_plugin { ); } - // If this parameter isn't explicitely set modify the output to be fully + // If this parameter isn't explicitly set modify the output to be fully // backward compatible to code before Views 7.x-3.0-rc2. // @TODO Remove this as soon as possible e.g. October 2020 if ($group_rendered === NULL) { diff --git a/sites/all/modules/views/plugins/views_plugin_style_rss.inc b/sites/all/modules/views/plugins/views_plugin_style_rss.inc index 27106a8..79fef3d 100644 --- a/sites/all/modules/views/plugins/views_plugin_style_rss.inc +++ b/sites/all/modules/views/plugins/views_plugin_style_rss.inc @@ -71,6 +71,36 @@ class views_plugin_style_rss extends views_plugin_style { return array(); } + /** + * Return an atom:link XHTML element to add to the channel to comply with + * the RSS 2.0 specification. + * + * @see http://validator.w3.org/feed/docs/warning/MissingAtomSelfLink.html + * + * @return + * An array that can be passed to format_xml_elements(). + */ + function get_channel_elements_atom_link() { + $url_options = array('absolute' => TRUE); + $input = $this->view->get_exposed_input(); + if ($input) { + $url_options['query'] = $input; + } + $url = url($this->view->get_url(), $url_options); + + return array( + array( + 'namespace' => array('xmlns:atom' => 'http://www.w3.org/2005/Atom'), + 'key' => 'atom:link', + 'attributes' => array( + 'href' => $url, + 'rel' => 'self', + 'type' => 'application/rss+xml', + ), + ), + ); + } + /** * Get RSS feed description. * @@ -99,7 +129,10 @@ class views_plugin_style_rss extends views_plugin_style { // Fetch any additional elements for the channel and merge in their // namespaces. - $this->channel_elements = $this->get_channel_elements(); + $this->channel_elements = array_merge( + $this->get_channel_elements(), + $this->get_channel_elements_atom_link() + ); foreach ($this->channel_elements as $element) { if (isset($element['namespace'])) { $this->namespaces = array_merge($this->namespaces, $element['namespace']); diff --git a/sites/all/modules/views/test_templates/README.txt b/sites/all/modules/views/test_templates/README.txt new file mode 100644 index 0000000..551f738 --- /dev/null +++ b/sites/all/modules/views/test_templates/README.txt @@ -0,0 +1,11 @@ +Workaround for: + +- https://www.drupal.org/node/2450447 +- https://www.drupal.org/node/2415991 + + +Files of this folder cannot be included inside the views/tests directory because +they are included as tests cases and make testbot crash. + +This files could be moved to tests/templates once +https://www.drupal.org/node/2415991 be properly fixed. diff --git a/sites/all/modules/views/tests/templates/views-view--frontpage.tpl.php b/sites/all/modules/views/test_templates/views-view--frontpage.tpl.php similarity index 100% rename from sites/all/modules/views/tests/templates/views-view--frontpage.tpl.php rename to sites/all/modules/views/test_templates/views-view--frontpage.tpl.php diff --git a/sites/all/modules/views/tests/handlers/views_handler_filter_date.test b/sites/all/modules/views/tests/handlers/views_handler_filter_date.test index 34ccba6..8b92ccb 100644 --- a/sites/all/modules/views/tests/handlers/views_handler_filter_date.test +++ b/sites/all/modules/views/tests/handlers/views_handler_filter_date.test @@ -50,6 +50,21 @@ class ViewsHandlerFilterDateTest extends ViewsSqlTest { $this->assertIdenticalResultset($view, $expected_result, $this->map); $view->destroy(); + // Test "first day of" type of relative dates for simple operator. + $view->set_display('default'); + $view->init_handlers(); + $view->filter['created']->operator = '<'; + $view->filter['created']->value['type'] = 'offset'; + $view->filter['created']->value['value'] = 'last day of January 1970'; + $view->execute_display('default'); + $expected_result = array( + array('nid' => $this->nodes[0]->nid), + array('nid' => $this->nodes[1]->nid), + array('nid' => $this->nodes[2]->nid), + ); + $this->assertIdenticalResultset($view, $expected_result, $this->map); + $view->destroy(); + // Test offset for between operator. $view->set_display('default'); $view->init_handlers(); @@ -63,6 +78,22 @@ class ViewsHandlerFilterDateTest extends ViewsSqlTest { ); $this->assertIdenticalResultset($view, $expected_result, $this->map); $view->destroy(); + + // Test "first day of" type of relative dates for between operator. + $view->set_display('default'); + $view->init_handlers(); + $view->filter['created']->operator = 'between'; + $view->filter['created']->value['type'] = 'offset'; + $view->filter['created']->value['max'] = 'last day of January 1970'; + $view->filter['created']->value['min'] = 'first day of January 1970'; + $view->execute_display('default'); + $expected_result = array( + array('nid' => $this->nodes[0]->nid), + array('nid' => $this->nodes[1]->nid), + array('nid' => $this->nodes[2]->nid), + ); + $this->assertIdenticalResultset($view, $expected_result, $this->map); + $view->destroy(); } diff --git a/sites/all/modules/views/tests/styles/views_plugin_style.test b/sites/all/modules/views/tests/styles/views_plugin_style.test index dfc5413..2bb2857 100644 --- a/sites/all/modules/views/tests/styles/views_plugin_style.test +++ b/sites/all/modules/views/tests/styles/views_plugin_style.test @@ -241,7 +241,7 @@ class ViewsPluginStyleTestCase extends ViewsPluginStyleTestBase { // Setup some random css class. $view->init_display(); $view->init_style(); - $random_name = $this->randomName(); + $random_name = drupal_html_class($this->randomName()); $view->style_plugin->options['row_class'] = $random_name . " test-token-[name]"; $rendered_output = $view->preview(); @@ -255,7 +255,7 @@ class ViewsPluginStyleTestCase extends ViewsPluginStyleTestBase { $this->assertTrue(strpos($class, $random_name) !== FALSE, 'Take sure that a custom css class is added to the output.'); // Check token replacement. - $name = $view->field['name']->get_value($view->result[$count]); + $name = drupal_html_class($view->field['name']->get_value($view->result[$count])); $this->assertTrue(strpos($class, "test-token-$name") !== FALSE, 'Take sure that a token in custom css class is replaced.'); $count++; diff --git a/sites/all/modules/views/tests/views_groupby.test b/sites/all/modules/views/tests/views_groupby.test index 718d8dc..4e09256 100644 --- a/sites/all/modules/views/tests/views_groupby.test +++ b/sites/all/modules/views/tests/views_groupby.test @@ -108,11 +108,14 @@ class ViewsQueryGroupByTest extends ViewsSqlTest { } /** - * @param $group_by - * Which group_by function should be used, for example sum or count. + * @param string|null $group_by + * (optional) Which group_by function should be used, for example sum or + * count. If omitted, the aggregation is tested with no group function. + * @param array|null $values + * (optional) Expected values. */ - function GroupByTestHelper($group_by, $values) { - // Create 2 nodes of type1 and 3 nodes of type2 + function GroupByTestHelper($group_by = NULL, $values = NULL) { + // Create 4 nodes of type1 and 3 nodes of type2 $type1 = $this->drupalCreateContentType(); $type2 = $this->drupalCreateContentType(); @@ -136,6 +139,19 @@ class ViewsQueryGroupByTest extends ViewsSqlTest { $output = $view->execute_display(); $this->assertEqual(count($view->result), 2, 'Make sure the count of items is right.'); + + $results = array(); + // There's no need for a function in order to have aggregation. + if (empty($group_by)) { + $types = array($type1->type, $type2->type); + $results = array_map(function ($item) { return $item->node_type; }, $view->result); + sort($types); + sort($results); + $this->assertIdentical($results, $types); + // Exit here with no aggregation function. + return; + } + // Group by nodetype to identify the right count. foreach ($view->result as $item) { $results[$item->node_type] = $item->nid; @@ -144,7 +160,7 @@ class ViewsQueryGroupByTest extends ViewsSqlTest { $this->assertEqual($results[$type2->type], $values[1]); } - function viewsGroupByViewHelper($group_by) { + function viewsGroupByViewHelper($group_by = NULL) { $view = new view; $view->name = 'group_by_count'; $view->description = ''; @@ -164,21 +180,27 @@ class ViewsQueryGroupByTest extends ViewsSqlTest { $handler->display->display_options['pager']['type'] = 'some'; $handler->display->display_options['style_plugin'] = 'default'; $handler->display->display_options['row_plugin'] = 'fields'; - /* Field: Content: Nid */ - $handler->display->display_options['fields']['nid']['id'] = 'nid'; - $handler->display->display_options['fields']['nid']['table'] = 'node'; - $handler->display->display_options['fields']['nid']['field'] = 'nid'; - $handler->display->display_options['fields']['nid']['group_type'] = $group_by; - $handler->display->display_options['fields']['nid']['alter']['alter_text'] = 0; - $handler->display->display_options['fields']['nid']['alter']['make_link'] = 0; - $handler->display->display_options['fields']['nid']['alter']['trim'] = 0; - $handler->display->display_options['fields']['nid']['alter']['word_boundary'] = 1; - $handler->display->display_options['fields']['nid']['alter']['ellipsis'] = 1; - $handler->display->display_options['fields']['nid']['alter']['strip_tags'] = 0; - $handler->display->display_options['fields']['nid']['alter']['html'] = 0; - $handler->display->display_options['fields']['nid']['hide_empty'] = 0; - $handler->display->display_options['fields']['nid']['empty_zero'] = 0; - $handler->display->display_options['fields']['nid']['link_to_node'] = 0; + + // The test view has 2 fields ('nid' and 'type'). Don't add 'nid' when + // having no aggregation function. We just want to aggregate on node type. + if (!empty($group_by)) { + /* Field: Content: Nid */ + $handler->display->display_options['fields']['nid']['id'] = 'nid'; + $handler->display->display_options['fields']['nid']['table'] = 'node'; + $handler->display->display_options['fields']['nid']['field'] = 'nid'; + $handler->display->display_options['fields']['nid']['group_type'] = $group_by; + $handler->display->display_options['fields']['nid']['alter']['alter_text'] = 0; + $handler->display->display_options['fields']['nid']['alter']['make_link'] = 0; + $handler->display->display_options['fields']['nid']['alter']['trim'] = 0; + $handler->display->display_options['fields']['nid']['alter']['word_boundary'] = 1; + $handler->display->display_options['fields']['nid']['alter']['ellipsis'] = 1; + $handler->display->display_options['fields']['nid']['alter']['strip_tags'] = 0; + $handler->display->display_options['fields']['nid']['alter']['html'] = 0; + $handler->display->display_options['fields']['nid']['hide_empty'] = 0; + $handler->display->display_options['fields']['nid']['empty_zero'] = 0; + $handler->display->display_options['fields']['nid']['link_to_node'] = 0; + } + /* Field: Content: Type */ $handler->display->display_options['fields']['type']['id'] = 'type'; $handler->display->display_options['fields']['type']['table'] = 'node'; @@ -218,6 +240,10 @@ class ViewsQueryGroupByTest extends ViewsSqlTest { $this->GroupByTestHelper('max', array(4, 7)); } + function testGroupByNone() { + $this->GroupByTestHelper(); + } + public function testGroupByCountOnlyFilters() { // Check if GROUP BY and HAVING are included when a view // Doesn't display SUM, COUNT, MAX... functions in SELECT statment diff --git a/sites/all/modules/views/tests/views_module.test b/sites/all/modules/views/tests/views_module.test index 6a27443..e160964 100644 --- a/sites/all/modules/views/tests/views_module.test +++ b/sites/all/modules/views/tests/views_module.test @@ -194,6 +194,30 @@ class ViewsModuleTest extends ViewsSqlTest { $this->assertEqual(variable_get('views_test_views_data_count', 0), 1, 'Views data rebuilt once'); $this->assertFalse(drupal_static('_views_fetch_data_fully_loaded'), 'Views data is not fully loaded'); + + // Test if the cache consistency is ensured. There was an issue where + // calling _views_fetch_data() first with a table would prevent the function + // from properly rebuilt a missing the general cache entry. + // See https://www.drupal.org/node/2475669 for details. + // Make sure we start with a empty cache. + $this->resetStaticViewsDataCache(); + cache_clear_all('*', 'cache_views', TRUE); + + // Prime the static cache of _views_fetch_data() by calling it with a table + // first. + views_fetch_data('views_test'); + // Now remove the general cache. + cache_clear_all('views_data:en', 'cache_views'); + // Reset the static cache to see if fetches from the persistent cache + // properly rebuild the static cache. + $this->resetStaticViewsDataCache(); + // Prime the static cache of _views_fetch_data() by calling it with a table + // first. + views_fetch_data('views_test'); + // Fetch the general cache, which was deleted, an see if it is rebuild + // properly. + views_fetch_data(); + $this->assertTrue(cache_get('views_data:en', 'cache_views'), 'Cache for all tables was properly rebuild.'); } /** diff --git a/sites/all/modules/views/tests/views_query.test b/sites/all/modules/views/tests/views_query.test index 735df0e..db7d656 100644 --- a/sites/all/modules/views/tests/views_query.test +++ b/sites/all/modules/views/tests/views_query.test @@ -132,7 +132,6 @@ abstract class ViewsSqlTest extends ViewsTestCase { variable_set('views_test_schema', $this->schemaDefinition()); variable_set('views_test_views_data', $this->viewsData()); variable_set('views_test_views_plugins', $this->viewsPlugins()); - module_enable(array('views_test')); $this->resetAll(); diff --git a/sites/all/modules/views/tests/views_test.info b/sites/all/modules/views/tests/views_test.info index b090daa..6e9008e 100644 --- a/sites/all/modules/views/tests/views_test.info +++ b/sites/all/modules/views/tests/views_test.info @@ -5,9 +5,9 @@ core = 7.x dependencies[] = views hidden = TRUE -; Information added by Drupal.org packaging script on 2015-02-11 -version = "7.x-3.10" +; Information added by Drupal.org packaging script on 2016-06-15 +version = "7.x-3.14" core = "7.x" project = "views" -datestamp = "1423648085" +datestamp = "1466019588" diff --git a/sites/all/modules/views/tests/views_test.module b/sites/all/modules/views/tests/views_test.module index a746069..be533e0 100644 --- a/sites/all/modules/views/tests/views_test.module +++ b/sites/all/modules/views/tests/views_test.module @@ -23,7 +23,7 @@ function views_test_permission() { function views_test_views_api() { return array( 'api' => 3.0, - 'template path' => drupal_get_path('module', 'views_test') . '/templates', + 'template path' => drupal_get_path('module', 'views') . '/test_templates', ); } diff --git a/sites/all/modules/views/theme/views-view-table.tpl.php b/sites/all/modules/views/theme/views-view-table.tpl.php index 4fec9fa..b3443fc 100644 --- a/sites/all/modules/views/theme/views-view-table.tpl.php +++ b/sites/all/modules/views/theme/views-view-table.tpl.php @@ -27,7 +27,7 @@ $label): ?> - > + scope="col"> diff --git a/sites/all/modules/views/views.api.php b/sites/all/modules/views/views.api.php index 70c5dc8..1c7b32b 100644 --- a/sites/all/modules/views/views.api.php +++ b/sites/all/modules/views/views.api.php @@ -143,7 +143,7 @@ * responsible for building the query. Instead, they are objects that are used * to display the view or make other modifications. * - * There are 10 types of plugins in Views: + * There are several types of plugins in Views: * - Display: Display plugins are responsible for controlling *where* a view * lives; that is, how they are being exposed to other parts of Drupal. Page * and block are the most common displays, as well as the ubiquitous 'master' @@ -431,7 +431,7 @@ function hook_views_data() { 'label' => t('Published'), // This setting is used by the boolean filter handler, as possible option. 'type' => 'yes-no', - // use boolean_field = 1 instead of boolean_field <> 0 in WHERE statment. + // use boolean_field = 1 instead of boolean_field <> 0 in WHERE statement. 'use equal' => TRUE, ), 'sort' => array( @@ -602,7 +602,7 @@ function hook_field_views_data_views_data_alter(&$data, $field) { * must be one of row, display, display_extender, style, argument default, * argument validator, access, query, cache, pager, exposed_form or * localization. The plugin name should be prefixed with your module name. - * The value for each entry is an associateive array that may contain the + * The value for each entry is an associative array that may contain the * following entries: * - Used by all plugin types: * - title (required): The name of the plugin, as shown in Views. Wrap in @@ -723,7 +723,7 @@ function hook_views_plugins_alter(&$plugins) { * - path: (optional) If includes are stored somewhere other than within the * root module directory, specify its path here. * - template path: (optional) A path where the module has stored it's views - * template files. When you have specificed this key views automatically + * template files. When you have specified this key views automatically * uses the template files for the views. You can use the same naming * conventions like for normal views template files. */ @@ -859,7 +859,7 @@ function hook_views_default_views_alter(&$views) { * The View being executed. * @return * An array with keys being the strings to replace, and the values the strings - * to replace them with. The strings to replace are ofted surrounded with + * to replace them with. The strings to replace are often surrounded with * '***', as illustrated in the example implementation. */ function hook_views_query_substitutions($view) { @@ -924,7 +924,7 @@ function hook_views_pre_view(&$view, &$display_id, &$args) { * The view object about to be processed. */ function hook_views_pre_build(&$view) { - // Because of some unexplicable business logic, we should remove all + // Because of some inexplicable business logic, we should remove all // attachments from all views on Mondays. // (This alter could be done later in the execution process as well.) if (date('D') == 'Mon') { @@ -1075,7 +1075,7 @@ function hook_views_query_alter(&$view, &$query) { // Traverse through the 'where' part of the query. foreach ($query->where as &$condition_group) { foreach ($condition_group['conditions'] as &$condition) { - // If this is the part of the query filtering on title, chang the + // If this is the part of the query filtering on title, change the // condition to filter on node ID. if ($condition['field'] == 'node.title') { $condition = array( @@ -1153,8 +1153,8 @@ function hook_views_ajax_data_alter(&$commands, $view) { // Replace Views' method for scrolling to the top of the element with your // custom scrolling method. foreach ($commands as &$command) { - if ($command['method'] == 'viewsScrollTop') { - $command['method'] .= 'myScrollTop'; + if ($command['command'] == 'viewsScrollTop') { + $command['command'] .= 'myScrollTop'; } } } @@ -1171,6 +1171,32 @@ function hook_views_invalidate_cache() { cache_clear_all('views:*', 'cache_mymodule', TRUE); } +/** + * Allow modules to alter a view prior to being saved. + */ +function hook_views_view_presave($view) { + // Do some adjustments to the view. Handle with care. + if (mymodule_check_view($view)) { + mymodule_do_some_voodoo($view); + } +} + +/** + * Allow modules to respond to a view being saved. + */ +function hook_views_view_save($view) { + // Make a watchdog entry. + watchdog('views', 'The view @name was deleted by @user at @time', array('@name' => $view->name, '@user' => $GLOBALS['user']->name, '@time' => format_date(time()))); +} + +/** + * Allow modules to respond to a view being deleted or reverted. + */ +function hook_views_view_delete($view) { + // Make a watchdog entry. + watchdog('views', 'The view @name was deleted by @user at @time', array('@name' => $view->name, '@user' => $GLOBALS['user']->name, '@time' => format_date(time()))); +} + /** * @} */ diff --git a/sites/all/modules/views/views.info b/sites/all/modules/views/views.info index 87b01b9..0b425f1 100644 --- a/sites/all/modules/views/views.info +++ b/sites/all/modules/views/views.info @@ -27,9 +27,11 @@ files[] = handlers/views_handler_field.inc files[] = handlers/views_handler_field_counter.inc files[] = handlers/views_handler_field_boolean.inc files[] = handlers/views_handler_field_contextual_links.inc +files[] = handlers/views_handler_field_ctools_dropdown.inc files[] = handlers/views_handler_field_custom.inc files[] = handlers/views_handler_field_date.inc files[] = handlers/views_handler_field_entity.inc +files[] = handlers/views_handler_field_links.inc files[] = handlers/views_handler_field_markup.inc files[] = handlers/views_handler_field_math.inc files[] = handlers/views_handler_field_numeric.inc @@ -116,6 +118,7 @@ files[] = modules/locale/views_handler_field_locale_link_edit.inc files[] = modules/locale/views_handler_filter_locale_group.inc files[] = modules/locale/views_handler_filter_locale_language.inc files[] = modules/locale/views_handler_filter_locale_version.inc +files[] = modules/locale/views_handler_sort_node_language.inc files[] = modules/node/views_handler_argument_dates_various.inc files[] = modules/node/views_handler_argument_node_language.inc files[] = modules/node/views_handler_argument_node_nid.inc @@ -133,11 +136,14 @@ files[] = modules/node/views_handler_field_node_revision_link_delete.inc files[] = modules/node/views_handler_field_node_revision_link_revert.inc files[] = modules/node/views_handler_field_node_path.inc files[] = modules/node/views_handler_field_node_type.inc +files[] = modules/node/views_handler_field_node_version_count.inc files[] = modules/node/views_handler_filter_history_user_timestamp.inc files[] = modules/node/views_handler_filter_node_access.inc files[] = modules/node/views_handler_filter_node_status.inc files[] = modules/node/views_handler_filter_node_type.inc files[] = modules/node/views_handler_filter_node_uid_revision.inc +files[] = modules/node/views_handler_filter_node_version_count.inc +files[] = modules/node/views_handler_sort_node_version_count.inc files[] = modules/node/views_plugin_argument_default_node.inc files[] = modules/node/views_plugin_argument_validate_node.inc files[] = modules/node/views_plugin_row_node_rss.inc @@ -151,6 +157,8 @@ files[] = modules/search/views_handler_filter_search.inc files[] = modules/search/views_handler_sort_search_score.inc files[] = modules/search/views_plugin_row_search_view.inc files[] = modules/statistics/views_handler_field_accesslog_path.inc +files[] = modules/statistics/views_handler_field_node_counter_timestamp.inc +files[] = modules/statistics/views_handler_field_statistics_numeric.inc files[] = modules/system/views_handler_argument_file_fid.inc files[] = modules/system/views_handler_field_file.inc files[] = modules/system/views_handler_field_file_extension.inc @@ -161,6 +169,7 @@ files[] = modules/system/views_handler_filter_file_status.inc files[] = modules/taxonomy/views_handler_argument_taxonomy.inc files[] = modules/taxonomy/views_handler_argument_term_node_tid.inc files[] = modules/taxonomy/views_handler_argument_term_node_tid_depth.inc +files[] = modules/taxonomy/views_handler_argument_term_node_tid_depth_join.inc files[] = modules/taxonomy/views_handler_argument_term_node_tid_depth_modifier.inc files[] = modules/taxonomy/views_handler_argument_vocabulary_vid.inc files[] = modules/taxonomy/views_handler_argument_vocabulary_machine_name.inc @@ -169,6 +178,7 @@ files[] = modules/taxonomy/views_handler_field_term_node_tid.inc files[] = modules/taxonomy/views_handler_field_term_link_edit.inc files[] = modules/taxonomy/views_handler_filter_term_node_tid.inc files[] = modules/taxonomy/views_handler_filter_term_node_tid_depth.inc +files[] = modules/taxonomy/views_handler_filter_term_node_tid_depth_join.inc files[] = modules/taxonomy/views_handler_filter_vocabulary_vid.inc files[] = modules/taxonomy/views_handler_filter_vocabulary_machine_name.inc files[] = modules/taxonomy/views_handler_relationship_node_term_data.inc @@ -318,9 +328,9 @@ files[] = tests/views_cache.test files[] = tests/views_view.test files[] = tests/views_ui.test -; Information added by Drupal.org packaging script on 2015-02-11 -version = "7.x-3.10" +; Information added by Drupal.org packaging script on 2016-06-15 +version = "7.x-3.14" core = "7.x" project = "views" -datestamp = "1423648085" +datestamp = "1466019588" diff --git a/sites/all/modules/views/views.install b/sites/all/modules/views/views.install index b69f410..ca10d69 100644 --- a/sites/all/modules/views/views.install +++ b/sites/all/modules/views/views.install @@ -402,7 +402,7 @@ function views_update_6008() { } /** - * Enlarge the views_display.display_options field to accomodate a larger set + * Enlarge the views_display.display_options field to accommodate a larger set * of configurations (e. g. fields, filters, etc.) on a display. */ function views_schema_6009() { @@ -631,3 +631,17 @@ function views_update_7301() { ); db_change_field('views_view', 'name', 'name', $new_field); } + +/** + * Remove headers field from cache tables + * + * @see system_update_7054(). + */ +function views_update_7302() { + if (db_field_exists('cache_views', 'headers')) { + db_drop_field('cache_views', 'headers'); + } + if (db_field_exists('cache_views_data', 'headers')) { + db_drop_field('cache_views_data', 'headers'); + } +} diff --git a/sites/all/modules/views/views.module b/sites/all/modules/views/views.module index 9cdcfb5..aab3812 100644 --- a/sites/all/modules/views/views.module +++ b/sites/all/modules/views/views.module @@ -1020,8 +1020,21 @@ function views_access() { * permissions. If the $account argument is omitted, the current user * is used. */ -function views_check_perm($perm, $account = NULL) { - return user_access($perm, $account) || user_access('access all views', $account); +function views_check_perm($perms, $account = NULL) { + // Backward compatibility to ensure also a single permission string is + // properly processed. + $perms = is_array($perms) ? $perms : array($perms); + if (user_access('access all views', $account)) { + return TRUE; + } + // Perms are handled as OR, as soon one permission allows access TRUE is + // returned. + foreach ($perms as $perm) { + if (user_access($perm, $account)) { + return TRUE; + } + } + return FALSE; } /** @@ -1298,7 +1311,7 @@ function views_fetch_plugin_data($type = NULL, $plugin = NULL, $reset = FALSE) { * Either 'display', 'style' or 'row' * @param $key * For style plugins, this is an optional type to restrict to. May be 'normal', - * 'summary', 'feed' or others based on the neds of the display. + * 'summary', 'feed' or others based on the needs of the display. * @param $base * An array of possible base tables. * @@ -2413,7 +2426,7 @@ function views_process_check_options($element, &$form_state) { * Trim the field down to the specified length. * * @param $alter - * - max_length: Maximum lenght of the string, the rest gets truncated. + * - max_length: Maximum length of the string, the rest gets truncated. * - word_boundary: Trim only on a word boundary. * - ellipsis: Show an ellipsis (...) at the end of the trimmed string. * - html: Take sure that the html is correct. diff --git a/sites/all/modules/views/views_ui.info b/sites/all/modules/views/views_ui.info index d8be6e4..cbe65b0 100644 --- a/sites/all/modules/views/views_ui.info +++ b/sites/all/modules/views/views_ui.info @@ -7,9 +7,9 @@ dependencies[] = views files[] = views_ui.module files[] = plugins/views_wizard/views_ui_base_views_wizard.class.php -; Information added by Drupal.org packaging script on 2015-02-11 -version = "7.x-3.10" +; Information added by Drupal.org packaging script on 2016-06-15 +version = "7.x-3.14" core = "7.x" project = "views" -datestamp = "1423648085" +datestamp = "1466019588" diff --git a/sites/all/modules/views/views_ui.module b/sites/all/modules/views/views_ui.module index 5366f77..f35d099 100644 --- a/sites/all/modules/views/views_ui.module +++ b/sites/all/modules/views/views_ui.module @@ -248,7 +248,7 @@ function views_ui_theme() { } /** - * Impements hook_custom_theme() + * Implements hook_custom_theme(). */ function views_ui_custom_theme() { $theme = variable_get('views_ui_custom_theme', '_default'); diff --git a/sites/all/modules/views_bulk_operations/actions/archive.action.inc b/sites/all/modules/views_bulk_operations/actions/archive.action.inc index 7667e49..f005527 100644 --- a/sites/all/modules/views_bulk_operations/actions/archive.action.inc +++ b/sites/all/modules/views_bulk_operations/actions/archive.action.inc @@ -18,6 +18,7 @@ function views_bulk_operations_archive_action_info() { // "Create an advanced action" dropdown on admin/config/system/actions. 'configurable' => FALSE, 'vbo_configurable' => TRUE, + 'behavior' => array('views_property'), 'triggers' => array('any'), ); } diff --git a/sites/all/modules/views_bulk_operations/actions/book.action.inc b/sites/all/modules/views_bulk_operations/actions/book.action.inc new file mode 100644 index 0000000..ad8fa9c --- /dev/null +++ b/sites/all/modules/views_bulk_operations/actions/book.action.inc @@ -0,0 +1,79 @@ + 'node', + 'label' => t('Move to book'), + 'configurable' => TRUE, + 'behavior' => array('changes_property'), + 'triggers' => array('any'), + ); + $actions['views_bulk_operations_remove_from_book_action'] = array( + 'type' => 'node', + 'label' => t('Remove from book'), + 'configurable' => FALSE, + 'triggers' => array('any'), + ); + } + + return $actions; +} + +function views_bulk_operations_move_to_book_action_form($context) { + $form = array(); + if (!isset($context['book'])) { + $context['book'] = ''; + } + $options = array(); + $books = book_get_books(); + foreach ($books as $value) { + $options[$value['nid']] = $value['title']; + } + + if (empty($options)) { + drupal_set_message(t('You have no books.'), 'error'); + return array(); + } + + $form['book'] = array( + '#type' => 'select', + '#title' => t('Choose a parent book'), + '#options' => $options, + '#description' => t('Select the parent book page you wish to move the book page into'), + ); + return $form; +} + +function views_bulk_operations_move_to_book_action_submit($form, $form_state) { + return array('book' => $form_state['values']['book']); +} + +function views_bulk_operations_move_to_book_action($node, $context = array()) { + if (isset($context['book'])) { + $book_node = node_load($context['book']); + $mlid = db_select('menu_links' , 'ml') + ->condition('ml.link_path' , 'node/' . $node->nid) + ->fields('ml' , array('mlid')) + ->execute() + ->fetchField(); + $node->book['mlid'] = $mlid; + $node->book['bid'] = $book_node->nid; + $node->book['plid'] = $book_node->book['mlid']; + $node->book['module'] = 'book'; + } +} + +/** + * Adds the action 'Remove node from a parent book' + */ +function views_bulk_operations_remove_from_book_action($node, $context) { + $book = $node->book['mlid']; + book_node_delete($node); +} diff --git a/sites/all/modules/views_bulk_operations/actions/delete.action.inc b/sites/all/modules/views_bulk_operations/actions/delete.action.inc index f3b6272..52c72d2 100644 --- a/sites/all/modules/views_bulk_operations/actions/delete.action.inc +++ b/sites/all/modules/views_bulk_operations/actions/delete.action.inc @@ -14,6 +14,13 @@ function views_bulk_operations_delete_action_info() { 'behavior' => array('deletes_property'), 'triggers' => array('any'), ), + 'views_bulk_operations_delete_revision' => array( + 'type' => 'entity', + 'label' => t('Delete revision'), + 'configurable' => FALSE, + 'behavior' => array('deletes_property'), + 'triggers' => array('any'), + ), ); } @@ -23,3 +30,9 @@ function views_bulk_operations_delete_item($entity, $context) { entity_delete($context['entity_type'], $entity_id); } + +function views_bulk_operations_delete_revision($entity, $context) { + $info = entity_get_info($context['entity_type']); + $revision_id = $entity->{$info['entity keys']['revision']}; + entity_revision_delete($context['entity_type'], $revision_id); +} diff --git a/sites/all/modules/views_bulk_operations/actions/modify.action.inc b/sites/all/modules/views_bulk_operations/actions/modify.action.inc index 7877b42..301b17b 100644 --- a/sites/all/modules/views_bulk_operations/actions/modify.action.inc +++ b/sites/all/modules/views_bulk_operations/actions/modify.action.inc @@ -29,15 +29,19 @@ function views_bulk_operations_modify_action_info() { */ function views_bulk_operations_modify_action($entity, $context) { list(,,$bundle_name) = entity_extract_ids($context['entity_type'], $entity); - // Handle Field API fields. if (!empty($context['selected']['bundle_' . $bundle_name])) { // The pseudo entity is cloned so that changes to it don't get carried // over to the next execution. $pseudo_entity = clone $context['entities'][$bundle_name]; foreach ($context['selected']['bundle_' . $bundle_name] as $key) { + // Get this field's language. We can just pull it from the pseudo entity + // as it was created using field_attach_form and entity_language so it's + // already been figured out if this field is translatable or not and + // applied the appropriate language code to the field + $language = key($pseudo_entity->{$key}); // Replace any tokens that might exist in the field columns. - foreach ($pseudo_entity->{$key}[LANGUAGE_NONE] as $delta => &$item) { + foreach ($pseudo_entity->{$key}[$language] as $delta => &$item) { foreach ($item as $column => $value) { if (is_string($value)) { $item[$column] = token_replace($value, array($context['entity_type'] => $entity), array('sanitize' => FALSE)); @@ -46,11 +50,11 @@ function views_bulk_operations_modify_action($entity, $context) { } if (in_array($key, $context['append']['bundle_' . $bundle_name]) && !empty($entity->$key)) { - $entity->{$key}[LANGUAGE_NONE] = array_merge($entity->{$key}[LANGUAGE_NONE], $pseudo_entity->{$key}[LANGUAGE_NONE]); + $entity->{$key}[$language] = array_merge($entity->{$key}[$language], $pseudo_entity->{$key}[$language]); // Check if we breached cardinality, and notify the user. $field_info = field_info_field($key); - $field_count = count($entity->{$key}[LANGUAGE_NONE]); + $field_count = count($entity->{$key}[$language]); if ($field_info['cardinality'] != FIELD_CARDINALITY_UNLIMITED && $field_count > $field_info['cardinality']) { $entity_label = entity_label($context['entity_type'], $entity); $warning = t('Tried to set !field_count values for field !field_name that supports a maximum of !cardinality.', @@ -59,9 +63,14 @@ function views_bulk_operations_modify_action($entity, $context) { '!cardinality' => $field_info['cardinality'])); drupal_set_message($warning, 'warning', FALSE); } + + // Prevent storing duplicate references. + if (strpos($field_info['type'], 'reference') !== FALSE) { + $entity->{$key}[$language] = array_unique($entity->{$key}[LANGUAGE_NONE], SORT_REGULAR); + } } else { - $entity->$key = $pseudo_entity->$key; + $entity->{$key}[$language] = $pseudo_entity->{$key}[$language]; } } } @@ -73,6 +82,11 @@ function views_bulk_operations_modify_action($entity, $context) { // The wrapper will automatically modify $entity itself. $wrapper = entity_metadata_wrapper($context['entity_type'], $entity); foreach ($context['selected']['properties'] as $key) { + if (!$wrapper->$key->access('update')) { + // No access. + continue; + } + if (in_array($key, $context['append']['properties'])) { $old_values = $wrapper->$key->value(); $wrapper->$key->set($context['properties'][$key]); @@ -125,7 +139,7 @@ function views_bulk_operations_modify_action_form($context, &$form_state) { if (!empty($properties)) { $form['properties'] = array( '#type' => 'fieldset', - '#title' => 'Properties', + '#title' => t('Properties'), ); $form['properties']['show_value'] = array( '#suffix' => '
    ', @@ -148,6 +162,11 @@ function views_bulk_operations_modify_action_form($context, &$form_state) { ), ), ); + // The default #maxlength for textfields is 128, while most varchar + // columns hold 255 characters, which makes it a saner default here. + if ($determined_type == 'textfield') { + $form['properties'][$key]['#maxlength'] = 255; + } if (!empty($property['options list'])) { $form['properties'][$key]['#type'] = 'select'; @@ -170,6 +189,8 @@ function views_bulk_operations_modify_action_form($context, &$form_state) { } } + // Going to need this for multilingual nodes + global $language; foreach ($bundles as $bundle_name => $bundle) { $bundle_key = $info['entity keys']['bundle']; $default_values = array(); @@ -177,6 +198,7 @@ function views_bulk_operations_modify_action_form($context, &$form_state) { if (!empty($bundle_key)) { $default_values[$bundle_key] = $bundle_name; } + $default_values['language'] = $language->language; $entity = entity_create($context['entity_type'], $default_values); $form_state['entities'][$bundle_name] = $entity; @@ -195,7 +217,7 @@ function views_bulk_operations_modify_action_form($context, &$form_state) { '#title' => $label, '#parents' => array($form_key), ); - field_attach_form($context['entity_type'], $entity, $form[$form_key], $form_state, LANGUAGE_NONE); + field_attach_form($context['entity_type'], $entity, $form[$form_key], $form_state, entity_language($context['entity_type'], $entity)); // Now that all the widgets have been added, sort them by #weight. // This ensures that they will stay in the correct order when they get // assigned new weights. @@ -206,8 +228,10 @@ function views_bulk_operations_modify_action_form($context, &$form_state) { $weight = 0; foreach (element_get_visible_children($form[$form_key]) as $field_name) { // For our use case it makes no sense for any field widget to be required. - $language = $form[$form_key][$field_name]['#language']; - _views_bulk_operations_modify_action_unset_required($form[$form_key][$field_name][$language]); + if (isset($form[$form_key][$field_name]['#language'])) { + $field_language = $form[$form_key][$field_name]['#language']; + _views_bulk_operations_modify_action_unset_required($form[$form_key][$field_name][$field_language]); + } // The admin has specified which fields to display, but this field didn't // make the cut. Hide it with #access => FALSE and move on. @@ -216,32 +240,34 @@ function views_bulk_operations_modify_action_form($context, &$form_state) { continue; } - $field = $instances[$field_name]; - $form[$form_key]['show_value'][$field_name] = array( - '#type' => 'checkbox', - '#title' => $field['label'], - ); - $form[$form_key][$field_name]['#states'] = array( - 'visible' => array( - '#edit-bundle-' . str_replace('_', '-', $bundle_name) . '-show-value-' . str_replace('_', '-', $field_name) => array('checked' => TRUE), - ), - ); - // All field widgets get reassigned weights so that additional elements - // added between them (such as "_append") can be properly ordered. - $form[$form_key][$field_name]['#weight'] = $weight++; - - $field_info = field_info_field($field_name); - if ($field_info['cardinality'] != 1) { - $form[$form_key]['_append::' . $field_name] = array( + if (isset($instances[$field_name])) { + $field = $instances[$field_name]; + $form[$form_key]['show_value'][$field_name] = array( '#type' => 'checkbox', - '#title' => t('Add new value(s) to %label, instead of overwriting the existing values.', array('%label' => $field['label'])), - '#states' => array( - 'visible' => array( - '#edit-bundle-' . str_replace('_', '-', $bundle_name) . '-show-value-' . str_replace('_', '-', $field_name) => array('checked' => TRUE), - ), - ), - '#weight' => $weight++, + '#title' => $field['label'], ); + $form[$form_key][$field_name]['#states'] = array( + 'visible' => array( + '#edit-bundle-' . str_replace('_', '-', $bundle_name) . '-show-value-' . str_replace('_', '-', $field_name) => array('checked' => TRUE), + ), + ); + // All field widgets get reassigned weights so that additional elements + // added between them (such as "_append") can be properly ordered. + $form[$form_key][$field_name]['#weight'] = $weight++; + + $field_info = field_info_field($field_name); + if ($field_info['cardinality'] != 1) { + $form[$form_key]['_append::' . $field_name] = array( + '#type' => 'checkbox', + '#title' => t('Add new value(s) to %label, instead of overwriting the existing values.', array('%label' => $field['label'])), + '#states' => array( + 'visible' => array( + '#edit-bundle-' . str_replace('_', '-', $bundle_name) . '-show-value-' . str_replace('_', '-', $field_name) => array('checked' => TRUE), + ), + ), + '#weight' => $weight++, + ); + } } } @@ -277,7 +303,7 @@ function views_bulk_operations_modify_action_form($context, &$form_state) { $token_type = str_replace('_', '-', $entity_type); $form['tokens'] = array( '#type' => 'fieldset', - '#title' => 'Available tokens', + '#title' => t('Available tokens'), '#collapsible' => TRUE, '#collapsed' => TRUE, '#weight' => 998, @@ -411,8 +437,12 @@ function _views_bulk_operations_modify_action_get_properties($entity_type, $disp // List of supported types. $supported_types = array('text', 'token', 'integer', 'decimal', 'date', 'duration', 'boolean', 'uri', 'list'); - $property_info = entity_get_property_info($entity_type); + if (empty($property_info['properties'])) { + // Stop here if no properties were found. + return array(); + } + foreach ($property_info['properties'] as $key => $property) { if (in_array($key, $disabled_properties)) { continue; @@ -463,27 +493,38 @@ function _views_bulk_operations_modify_action_get_bundles($entity_type, $context $bundles = array(); $view = $context['view']; + $vbo = _views_bulk_operations_get_field($view); $display_values = $context['settings']['display_values']; $info = entity_get_info($entity_type); $bundle_key = $info['entity keys']['bundle']; + // Check if this View has a filter on the bundle key and assemble a list // of allowed bundles according to the filter. - $filtered_bundles = array(); - if (!empty($bundle_key) && isset($view->filter[$bundle_key]) && !empty($view->filter[$bundle_key]->value)) { - $operator = $view->filter[$bundle_key]->operator; - if ($operator == 'in') { - $filtered_bundles = $view->filter[$bundle_key]->value; - } - elseif ($operator == 'not in') { - $bundle_names = array_keys($info['bundles']); - $filtered_bundles = array_diff($bundle_names, $view->filter[$bundle_key]->value); + $filtered_bundles = array_keys($info['bundles']); + + // Go over all the filters and find any relevant ones. + foreach ($view->filter as $key => $filter) { + // Check it's the right field on the right table. + if ($filter->table == $vbo->table && $filter->field == $bundle_key) { + // Exposed filters may have no bundles, so check that there is a value. + if (empty($filter->value)) { + continue; + } + + $operator = $filter->operator; + if ($operator == 'in') { + $filtered_bundles = array_intersect($filtered_bundles, $filter->value); + } + elseif ($operator == 'not in') { + $filtered_bundles = array_diff($filtered_bundles, $filter->value); + } } } foreach ($info['bundles'] as $bundle_name => $bundle) { // The view is limited to specific bundles, but this bundle isn't one of // them. Ignore it. - if (!empty($filtered_bundles) && !in_array($bundle_name, $filtered_bundles)) { + if (!in_array($bundle_name, $filtered_bundles)) { continue; } @@ -575,6 +616,7 @@ function views_bulk_operations_modify_action_views_bulk_operations_form($options '#multiple' => TRUE, '#description' => t('Select which values the action form should present to the user.'), '#default_value' => $options['display_values'], + '#size' => 10, ); return $form; } diff --git a/sites/all/modules/views_bulk_operations/actions/user_cancel.action.inc b/sites/all/modules/views_bulk_operations/actions/user_cancel.action.inc new file mode 100644 index 0000000..147d292 --- /dev/null +++ b/sites/all/modules/views_bulk_operations/actions/user_cancel.action.inc @@ -0,0 +1,82 @@ + array( + 'type' => 'user', + 'label' => t('Cancel user account'), + 'configurable' => TRUE, + 'behavior' => array('deletes_property'), + 'triggers' => array('any'), + )); +} + +function views_bulk_operations_user_cancel_action_form($context) { + module_load_include('inc', 'user', 'user.pages'); + $form['user_cancel_method'] = array( + '#type' => 'item', + '#title' => t('When cancelling these accounts'), + ); + $form['user_cancel_method'] += user_cancel_methods(); + // Remove method descriptions. + foreach (element_children($form['user_cancel_method']) as $element) { + unset($form['user_cancel_method'][$element]['#description']); + } + $admin_access = user_access('administer users'); + $default_notify = variable_get('user_mail_status_canceled_notify', FALSE); + $form['user_cancel_notify'] = array( + '#type' => 'checkbox', + '#title' => t('Notify user when account is canceled.'), + '#default_value' => ($admin_access ? FALSE : $default_notify), + '#access' => $admin_access && $default_notify, + '#description' => t('When enabled, the user will receive an e-mail notification after the account has been cancelled.'), + ); + + return $form; +} + +function views_bulk_operations_user_cancel_action_submit($form, $form_state) { + return array( + 'user_cancel_method' => $form_state['values']['user_cancel_method'], + 'user_cancel_notify' => $form_state['values']['user_cancel_notify'], + ); +} + +function views_bulk_operations_user_cancel_action($account, $context) { + global $user; + // Prevent the user from cancelling itself. + if ($account->uid == $user->uid) { + return; + } + + // Allow other modules to react on the cancellation. + if ($context['user_cancel_method'] != 'user_cancel_delete') { + module_invoke_all('user_cancel', array(), $account, $context['user_cancel_method']); + } + + switch ($context['user_cancel_method']) { + case 'user_cancel_block': + case 'user_cancel_block_unpublish': + default: + // Send account blocked notification if option was checked. + if (!empty($context['user_cancel_notify'])) { + _user_mail_notify('status_blocked', $account); + } + user_save($account, array('status' => 0)); + watchdog('user', 'Blocked user: %name %email.', array('%name' => $account->name, '%email' => '<' . $account->mail . '>'), WATCHDOG_NOTICE); + break; + + case 'user_cancel_reassign': + case 'user_cancel_delete': + // Send account canceled notification if option was checked. + if (!empty($context['user_cancel_notify'])) { + _user_mail_notify('status_canceled', $account); + } + user_delete($account->uid); + watchdog('user', 'Deleted user: %name %email.', array('%name' => $account->name, '%email' => '<' . $account->mail . '>'), WATCHDOG_NOTICE); + break; + } +} diff --git a/sites/all/modules/views_bulk_operations/actions/user_roles.action.inc b/sites/all/modules/views_bulk_operations/actions/user_roles.action.inc index 394597c..616f13c 100644 --- a/sites/all/modules/views_bulk_operations/actions/user_roles.action.inc +++ b/sites/all/modules/views_bulk_operations/actions/user_roles.action.inc @@ -45,24 +45,19 @@ function views_bulk_operations_user_roles_action_submit($form, $form_state) { ); } -function views_bulk_operations_user_roles_action(&$user, $context) { - $roles = $user->roles; - $selected = (is_array($context['add_roles']) ? $context['add_roles'] : array()) + - (is_array($context['remove_roles']) ? $context['remove_roles'] : array()); - $result = db_query("SELECT rid, name FROM {role} WHERE rid IN (:selected)", array(':selected' => array_keys($selected))); - foreach ($result as $role) { - if (isset($context['add_roles'][$role->rid])) { - $add_roles[$role->rid] = $role->name; - } - if (isset($context['remove_roles'][$role->rid])) { - $remove_roles[$role->rid] = $role->name; - } +function views_bulk_operations_user_roles_action($user, $context) { + $wrapper = entity_metadata_wrapper('user', $user); + if (!$wrapper->roles->access("update")) { + // No access. + return; } - if (!empty($add_roles)) { - $roles += $add_roles; + $roles = $wrapper->roles->value(); + if (is_array($context['add_roles'])) { + $roles = array_merge($roles, $context['add_roles']); } - if (!empty($remove_roles)) { - $roles = array_diff($roles, $remove_roles); + if (is_array($context['remove_roles'])) { + $roles = array_diff($roles, $context['remove_roles']); } - user_save($user, array('roles' => $roles)); + $wrapper->roles->set($roles); + $wrapper->save(); } diff --git a/sites/all/modules/views_bulk_operations/actions_permissions.info b/sites/all/modules/views_bulk_operations/actions_permissions.info index 88f4fe0..658d1ad 100644 --- a/sites/all/modules/views_bulk_operations/actions_permissions.info +++ b/sites/all/modules/views_bulk_operations/actions_permissions.info @@ -3,9 +3,9 @@ description = Provides permission-based access control for actions. Used by View package = Administration core = 7.x -; Information added by drupal.org packaging script on 2012-12-03 -version = "7.x-3.1" +; Information added by Drupal.org packaging script on 2015-07-01 +version = "7.x-3.3" core = "7.x" project = "views_bulk_operations" -datestamp = "1354500015" +datestamp = "1435764542" diff --git a/sites/all/modules/views_bulk_operations/js/views_bulk_operations.js b/sites/all/modules/views_bulk_operations/js/views_bulk_operations.js index aeeecc6..ca76df8 100644 --- a/sites/all/modules/views_bulk_operations/js/views_bulk_operations.js +++ b/sites/all/modules/views_bulk_operations/js/views_bulk_operations.js @@ -46,21 +46,23 @@ }); // Set up the ability to click anywhere on the row to select it. - $('.views-table tbody tr', form).click(function(event) { - if (event.target.tagName.toLowerCase() != 'input' && event.target.tagName.toLowerCase() != 'a') { - $('input[id^="edit-views-bulk-operations"]:not(:disabled)', this).each(function() { - var checked = this.checked; - // trigger() toggles the checkmark *after* the event is set, - // whereas manually clicking the checkbox toggles it *beforehand*. - // that's why we manually set the checkmark first, then trigger the - // event (so that listeners get notified), then re-set the checkmark - // which the trigger will have toggled. yuck! - this.checked = !checked; - $(this).trigger('click'); - this.checked = !checked; - }); - } - }); + if (Drupal.settings.vbo.row_clickable) { + $('.views-table tbody tr', form).click(function(event) { + if (event.target.tagName.toLowerCase() != 'input' && event.target.tagName.toLowerCase() != 'a') { + $('input[id^="edit-views-bulk-operations"]:not(:disabled)', this).each(function() { + var checked = this.checked; + // trigger() toggles the checkmark *after* the event is set, + // whereas manually clicking the checkbox toggles it *beforehand*. + // that's why we manually set the checkmark first, then trigger the + // event (so that listeners get notified), then re-set the checkmark + // which the trigger will have toggled. yuck! + this.checked = !checked; + $(this).trigger('click'); + this.checked = !checked; + }); + } + }); + } } Drupal.vbo.tableSelectAllPages = function(form) { diff --git a/sites/all/modules/views_bulk_operations/plugins/operation_types/action.class.php b/sites/all/modules/views_bulk_operations/plugins/operation_types/action.class.php index 51524f1..f3e60a3 100644 --- a/sites/all/modules/views_bulk_operations/plugins/operation_types/action.class.php +++ b/sites/all/modules/views_bulk_operations/plugins/operation_types/action.class.php @@ -20,7 +20,7 @@ class ViewsBulkOperationsAction extends ViewsBulkOperationsBaseOperation { */ public function getAccessMask() { // Assume edit by default. - if (!isset($this->operationInfo['behavior'])) { + if (empty($this->operationInfo['behavior'])) { $this->operationInfo['behavior'] = array('changes_property'); } @@ -141,9 +141,11 @@ class ViewsBulkOperationsAction extends ViewsBulkOperationsBaseOperation { * @param $dom_id * The dom path to the level where the admin options form is embedded. * Needed for #dependency. + * @param $field_handler + * The Views field handler object for the VBO field. */ - public function adminOptionsForm($dom_id) { - $form = parent::adminOptionsForm($dom_id); + public function adminOptionsForm($dom_id, $field_handler) { + $form = parent::adminOptionsForm($dom_id, $field_handler); $settings_form_callback = $this->operationInfo['callback'] . '_views_bulk_operations_form'; if (function_exists($settings_form_callback)) { diff --git a/sites/all/modules/views_bulk_operations/plugins/operation_types/base.class.php b/sites/all/modules/views_bulk_operations/plugins/operation_types/base.class.php index f17f107..968921f 100644 --- a/sites/all/modules/views_bulk_operations/plugins/operation_types/base.class.php +++ b/sites/all/modules/views_bulk_operations/plugins/operation_types/base.class.php @@ -173,8 +173,10 @@ abstract class ViewsBulkOperationsBaseOperation { * @param $dom_id * The dom path to the level where the admin options form is embedded. * Needed for #dependency. + * @param $field_handler + * The Views field handler object for the VBO field. */ - public function adminOptionsForm($dom_id) { + public function adminOptionsForm($dom_id, $field_handler) { $label = $this->getAdminOption('label', ''); $form = array(); diff --git a/sites/all/modules/views_bulk_operations/plugins/operation_types/rules_component.class.php b/sites/all/modules/views_bulk_operations/plugins/operation_types/rules_component.class.php index 624c850..c40da8b 100644 --- a/sites/all/modules/views_bulk_operations/plugins/operation_types/rules_component.class.php +++ b/sites/all/modules/views_bulk_operations/plugins/operation_types/rules_component.class.php @@ -124,6 +124,8 @@ class ViewsBulkOperationsRulesComponent extends ViewsBulkOperationsBaseOperation else { $element = rules_action('component_' . $this->operationInfo['parameters']['component_key']); } - $element->execute($data); + $wrapper_type = is_array($data) ? "list<{$this->entityType}>" : $this->entityType; + $wrapper = entity_metadata_wrapper($wrapper_type, $data); + $element->execute($wrapper); } } diff --git a/sites/all/modules/views_bulk_operations/views/views_bulk_operations_handler_field_operations.inc b/sites/all/modules/views_bulk_operations/views/views_bulk_operations_handler_field_operations.inc index 43a61b8..61886d4 100644 --- a/sites/all/modules/views_bulk_operations/views/views_bulk_operations_handler_field_operations.inc +++ b/sites/all/modules/views_bulk_operations/views/views_bulk_operations_handler_field_operations.inc @@ -55,17 +55,50 @@ class views_bulk_operations_handler_field_operations extends views_handler_field 'contains' => array( 'display_type' => array('default' => 0), 'enable_select_all_pages' => array('default' => TRUE), + 'row_clickable' => array('default' => TRUE), 'force_single' => array('default' => FALSE), 'entity_load_capacity' => array('default' => 10), + 'skip_batching' => array('default' => 0), ), ); $options['vbo_operations'] = array( 'default' => array(), + 'unpack_translatable' => 'unpack_operations', + 'export' => 'export_vbo_operations', ); return $options; } + function export_vbo_operations($indent, $prefix, $storage, $option, $definition, $parents) { + // Anti-recursion, since we use the parent export helper. + unset($definition['export']); + + // Find and remove all unselected/disabled operations. + foreach ($storage['vbo_operations'] as $operation_id => $operation) { + if (empty($operation['selected'])) { + unset($storage['vbo_operations'][$operation_id]); + } + } + + return parent::export_option($indent, $prefix, $storage, $option, $definition, $parents); + } + + function unpack_operations(&$translatable, $storage, $option, $definition, $parents, $keys) { + $translatable[] = array( + 'value' => t('- Choose an operation -'), + 'keys' => array_merge($keys, array('noop')), + ); + foreach ($storage[$option] as $key => $operation) { + if (!empty($operation['override_label']) && !empty($operation['label'])) { + $translatable[] = array( + 'value' => $operation['label'], + 'keys' => array_merge($keys, array($key)), + ); + } + } + } + function options_form(&$form, &$form_state) { parent::options_form($form, $form_state); @@ -90,6 +123,12 @@ class views_bulk_operations_handler_field_operations extends views_handler_field '#default_value' => $this->options['vbo_settings']['enable_select_all_pages'], '#description' => t('Check this box to enable the ability to select all items on all pages.'), ); + $form['vbo_settings']['row_clickable'] = array( + '#type' => 'checkbox', + '#title' => t('Make the whole row clickable'), + '#default_value' => $this->options['vbo_settings']['row_clickable'], + '#description' => t('Check this box to select an item when its row has been clicked. Requires JavaScript.'), + ); $form['vbo_settings']['force_single'] = array( '#type' => 'checkbox', '#title' => t('Force single'), @@ -102,6 +141,12 @@ class views_bulk_operations_handler_field_operations extends views_handler_field '#description' => t("Improve execution performance at the cost of memory usage. Set to '1' if you're having problems."), '#default_value' => $this->options['vbo_settings']['entity_load_capacity'], ); + $form['vbo_settings']['skip_batching'] = array( + '#type' => 'checkbox', + '#title' => t('Skip batching'), + '#default_value' => $this->options['vbo_settings']['skip_batching'], + '#description' => '' . t('Warning:') . ' ' . t('This will cause timeouts for larger amounts of selected items.'), + ); // Display operations and their settings. $form['vbo_operations'] = array( @@ -142,7 +187,7 @@ class views_bulk_operations_handler_field_operations extends views_handler_field ), ); - $form['vbo_operations'][$operation_id] += $operation->adminOptionsForm($dom_id); + $form['vbo_operations'][$operation_id] += $operation->adminOptionsForm($dom_id, $this); } } diff --git a/sites/all/modules/views_bulk_operations/views_bulk_operations.info b/sites/all/modules/views_bulk_operations/views_bulk_operations.info index 052db05..8fbdffa 100644 --- a/sites/all/modules/views_bulk_operations/views_bulk_operations.info +++ b/sites/all/modules/views_bulk_operations/views_bulk_operations.info @@ -4,13 +4,14 @@ dependencies[] = entity dependencies[] = views package = Views core = 7.x +php = 5.2.9 files[] = plugins/operation_types/base.class.php files[] = views/views_bulk_operations_handler_field_operations.inc -; Information added by drupal.org packaging script on 2012-12-03 -version = "7.x-3.1" +; Information added by Drupal.org packaging script on 2015-07-01 +version = "7.x-3.3" core = "7.x" project = "views_bulk_operations" -datestamp = "1354500015" +datestamp = "1435764542" diff --git a/sites/all/modules/views_bulk_operations/views_bulk_operations.module b/sites/all/modules/views_bulk_operations/views_bulk_operations.module index da22960..e74eeb1 100644 --- a/sites/all/modules/views_bulk_operations/views_bulk_operations.module +++ b/sites/all/modules/views_bulk_operations/views_bulk_operations.module @@ -41,19 +41,20 @@ function views_bulk_operations_load_action_includes() { // The list of VBO actions is fairly static, so it's hardcoded for better // performance (hitting the filesystem with file_scan_directory(), and then // caching the result has its cost). - $path = drupal_get_path('module', 'views_bulk_operations') . '/actions/'; $files = array( - 'archive.action.inc', - 'argument_selector.action.inc', - 'delete.action.inc', - 'modify.action.inc', - 'script.action.inc', - 'user_roles.action.inc', + 'archive.action', + 'argument_selector.action', + 'book.action', + 'delete.action', + 'modify.action', + 'script.action', + 'user_roles.action', + 'user_cancel.action', ); if (!$loaded) { foreach ($files as $file) { - include_once $path . $file; + module_load_include('inc', 'views_bulk_operations', 'actions/' . $file); } $loaded = TRUE; } @@ -75,7 +76,7 @@ function views_bulk_operations_load_action_includes() { function views_bulk_operations_cron() { db_delete('queue') ->condition('name', db_like('views_bulk_operations_active_queue_'), 'LIKE') - ->condition('created', REQUEST_TIME - 864000, '<') + ->condition('created', REQUEST_TIME - 86400, '<') ->execute(); } @@ -110,7 +111,7 @@ function views_bulk_operations_theme() { 'variables' => array('view' => NULL, 'enable_select_all_pages' => TRUE), ), 'views_bulk_operations_confirmation' => array( - 'variables' => array('rows' => NULL, 'vbo' => NULL), + 'variables' => array('rows' => NULL, 'vbo' => NULL, 'operation' => NULL, 'select_all_pages' => FALSE), ), ); $files = views_bulk_operations_load_action_includes(); @@ -300,6 +301,29 @@ function views_bulk_operations_form_alter(&$form, &$form_state, $form_id) { return; } + // Add basic VBO functionality. + if ($form_state['step'] == 'views_form_views_form') { + // The submit button added by Views Form API might be used by a non-VBO Views + // Form handler. If there's no such handler on the view, hide the button. + $has_other_views_form_handlers = FALSE; + foreach ($vbo->view->field as $field) { + if (property_exists($field, 'views_form_callback') || method_exists($field, 'views_form')) { + if (!($field instanceof views_bulk_operations_handler_field_operations)) { + $has_other_views_form_handlers = TRUE; + } + } + } + if (!$has_other_views_form_handlers) { + $form['actions']['#access'] = FALSE; + } + // The VBO field is excluded from display, stop here. + if (!empty($vbo->options['exclude'])) { + return; + } + + $form = views_bulk_operations_form($form, $form_state, $vbo); + } + // Cache the built form to prevent it from being rebuilt prior to validation // and submission, which could lead to data being processed incorrectly, // because the views rows (and thus, the form elements as well) have changed @@ -319,15 +343,25 @@ function views_bulk_operations_form_alter(&$form, &$form_state, $form_id) { } } - // Add basic VBO functionality. - if ($form_state['step'] == 'views_form_views_form') { - $form = views_bulk_operations_form($form, $form_state, $vbo); - } - // Give other modules a chance to alter the form. drupal_alter('views_bulk_operations_form', $form, $form_state, $vbo); } +/** + * Implements hook_views_post_build(). + * + * Hides the VBO field if no operations are available. + * This causes the entire VBO form to be hidden. + * + * @see views_bulk_operations_form_alter(). + */ +function views_bulk_operations_views_post_build(&$view) { + $vbo = _views_bulk_operations_get_field($view); + if ($vbo && count($vbo->get_selected_operations()) < 1) { + $vbo->options['exclude'] = TRUE; + } +} + /** * Returns the 'select all' div that gets inserted below the table header row * (for table style plugins with grouping disabled), or above the view results @@ -385,7 +419,7 @@ function theme_views_bulk_operations_select_all($variables) { if ($enable_select_all_pages) { $form['select_all']['or'] = array( '#type' => 'markup', - '#markup' => 'OR', + '#markup' => '' . t('OR') . '', ); $form['select_all']['all_pages'] = array( '#type' => 'checkbox', @@ -408,8 +442,20 @@ function theme_views_bulk_operations_select_all($variables) { */ function views_bulk_operations_form($form, &$form_state, $vbo) { $form['#attached']['js'][] = drupal_get_path('module', 'views_bulk_operations') . '/js/views_bulk_operations.js'; + $form['#attached']['js'][] = array( + 'data' => array('vbo' => array( + 'row_clickable' => $vbo->get_vbo_option('row_clickable'), + )), + 'type' => 'setting', + ); + $form['#attached']['css'][] = drupal_get_path('module', 'views_bulk_operations') . '/css/views_bulk_operations.css'; - $form['#prefix'] = '
    '; + // Wrap the form in a div with specific classes for JS targeting and theming. + $class = 'vbo-views-form'; + if (empty($vbo->view->result)) { + $class .= ' vbo-views-form-empty'; + } + $form['#prefix'] = '
    '; $form['#suffix'] = '
    '; // Force browser to reload the page if Back is hit. @@ -426,25 +472,10 @@ function views_bulk_operations_form($form, &$form_state, $vbo) { '#attributes' => array('class' => 'select-all-rows'), '#default_value' => FALSE, ); - - // The submit button added by Views Form API might be used by a non-VBO Views - // Form handler. If there's no such handler on the view, hide the button. - $has_other_views_form_handlers = FALSE; - foreach ($vbo->view->field as $field) { - if (property_exists($field, 'views_form_callback') || method_exists($field, 'views_form')) { - if (!($field instanceof views_bulk_operations_handler_field_operations)) { - $has_other_views_form_handlers = TRUE; - } - } - } - if (!$has_other_views_form_handlers) { - $form['actions']['submit']['#access'] = FALSE; - } - $form['select'] = array( '#type' => 'fieldset', '#title' => t('Operations'), - '#collapsible' => TRUE, + '#collapsible' => FALSE, '#attributes' => array('class' => array('container-inline')), ); if ($vbo->get_vbo_option('display_type') == 0) { @@ -570,14 +601,23 @@ function views_bulk_operations_confirm_form($form, &$form_state, $view, $output) $operation = $form_state['operation']; $rows = $form_state['selection']; $query = drupal_get_query_parameters($_GET, array('q')); + $title = t('Are you sure you want to perform %operation on the selected items?', array('%operation' => $operation->label())); $form = confirm_form($form, - t('Are you sure you want to perform %operation on the selected items?', array('%operation' => $operation->label())), + $title, array('path' => $view->get_url(), 'query' => $query), - theme('views_bulk_operations_confirmation', array('rows' => $rows, 'vbo' => $vbo, 'select_all_pages' => $form_state['select_all_pages'])) + theme('views_bulk_operations_confirmation', array('rows' => $rows, 'vbo' => $vbo, 'operation' => $operation, 'select_all_pages' => $form_state['select_all_pages'])) ); // Add VBO's submit handler to the Confirm button added by config_form(). $form['actions']['submit']['#submit'] = array('views_bulk_operations_form_submit'); + // We can't set the View title here as $view is just a copy of the original, + // and our settings changes won't "stick" for the first page load of the + // confirmation form. We also can't just call drupal_set_title() directly + // because our title will be clobbered by the actual View title later. So + // let's tuck the title away in the form for use later. + // @see views_bulk_operations_preprocess_views_view() + $form['#vbo_confirm_form_title'] = $title; + return $form; } @@ -593,7 +633,7 @@ function theme_views_bulk_operations_confirmation($variables) { // Load the entities from the current page, and show their titles. $entities = _views_bulk_operations_entity_load($entity_type, array_values($rows), $vbo->revision); foreach ($entities as $entity) { - $items[] = check_plain(_views_bulk_operations_entity_label($entity_type, $entity)); + $items[] = check_plain(entity_label($entity_type, $entity)); } // All rows on all pages have been selected, so show a count of additional items. if ($select_all_pages) { @@ -606,6 +646,29 @@ function theme_views_bulk_operations_confirmation($variables) { return $output; } +/** + * Implements hook_preprocess_page(). + * + * Hide action links on the configure and confirm pages. + */ +function views_bulk_operations_preprocess_page(&$variables) { + if (isset($_POST['select_all'], $_POST['operation'])) { + $variables['action_links'] = array(); + } +} + +/** + * Implements hook_preprocess_views_view(). + */ +function views_bulk_operations_preprocess_views_view($variables) { + // If we've stored a title for the confirmation form, retrieve it here and + // retitle the View. + // @see views_bulk_operations_confirm_form() + if (array_key_exists('rows', $variables) && is_array($variables['rows']) && array_key_exists('#vbo_confirm_form_title', $variables['rows'])) { + $variables['view']->set_title($variables['rows']['#vbo_confirm_form_title']); + } +} + /** * Goes through the submitted values, and returns * an array of selected rows, in the form of @@ -676,8 +739,8 @@ function views_bulk_operations_form_submit($form, &$form_state) { * Entry point for executing the chosen operation upon selected rows. * * If the selected operation is an aggregate operation (requiring all selected - * items to be passed at the same time), or the execution is being triggered - * through Drush, the operation is executed directly. + * items to be passed at the same time), restricted to a single value, or has + * the skip_batching option set, the operation is executed directly. * This means that there is no batching & queueing, the PHP execution * time limit is ignored (if allowed), all selected entities are loaded and * processed. @@ -703,9 +766,13 @@ function views_bulk_operations_form_submit($form, &$form_state) { function views_bulk_operations_execute($vbo, $operation, $selection, $select_all_pages = FALSE) { global $user; - // This is an aggregate operation, and it requires all rows to be selected. - // Try to load them without a batch. - if ($operation->aggregate() && $select_all_pages) { + // Determine if the operation needs to be executed directly. + $aggregate = $operation->aggregate(); + $skip_batching = $vbo->get_vbo_option('skip_batching'); + $force_single = $vbo->get_vbo_option('force_single'); + $execute_directly = ($aggregate || $skip_batching || $force_single); + // Try to load all rows without a batch if needed. + if ($execute_directly && $select_all_pages) { views_bulk_operations_direct_adjust($selection, $vbo); } @@ -713,6 +780,15 @@ function views_bulk_operations_execute($vbo, $operation, $selection, $select_all $options = array( 'revision' => $vbo->revision, 'entity_load_capacity' => $vbo->get_vbo_option('entity_load_capacity', 10), + // The information needed to recreate the view, to avoid serializing the + // whole object. Passed to the executed operation. Also used by + // views_bulk_operations_adjust_selection(). + 'view_info' => array( + 'name' => $vbo->view->name, + 'display' => $vbo->view->current_display, + 'arguments' => $vbo->view->args, + 'exposed_input' => $vbo->view->get_exposed_input(), + ), ); // Create an array of rows in the needed format. $rows = array(); @@ -735,8 +811,8 @@ function views_bulk_operations_execute($vbo, $operation, $selection, $select_all } } - // Aggregate operations can only be executed directly. - if ($operation->aggregate()) { + if ($execute_directly) { + // Execute the operation directly and stop here. views_bulk_operations_direct_process($operation, $rows, $options); return; } @@ -763,18 +839,8 @@ function views_bulk_operations_execute($vbo, $operation, $selection, $select_all if ($select_all_pages && $vbo->view->query->pager->has_more_records()) { $total_rows = $vbo->view->total_rows; - // Pass information needed to recreate the view inside a batch, - // to avoid having to serialize the current object (which is expensive). - $view_info = array( - 'name' => $vbo->view->name, - 'display' => $vbo->view->current_display, - 'arguments' => $vbo->view->args, - 'exposed_input' => $vbo->view->get_exposed_input(), - 'entity_load_capacity' => $vbo->get_vbo_option('entity_load_capacity', 10), - ); - $batch['operations'][] = array( - 'views_bulk_operations_adjust_selection', array($view_info, $queue_name, $operation, $options), + 'views_bulk_operations_adjust_selection', array($queue_name, $operation, $options), ); } else { @@ -808,22 +874,21 @@ function views_bulk_operations_execute($vbo, $operation, $selection, $select_all /** * Batch API callback: loads the view page by page and enqueues all items. * - * @param $view_info - * An array of information about the view, used to recreate and re-execute it. * @param $queue_name * The name of the queue to which the items should be added. * @param $operation * The operation object. * @param $options - * An array of options that affect execution (revision, entity_load_capacity). - * Passed along with each new queue item. + * An array of options that affect execution (revision, entity_load_capacity, + * view_info). Passed along with each new queue item. */ -function views_bulk_operations_adjust_selection($view_info, $queue_name, $operation, $options, &$context) { +function views_bulk_operations_adjust_selection($queue_name, $operation, $options, &$context) { if (!isset($context['sandbox']['progress'])) { $context['sandbox']['progress'] = 0; $context['sandbox']['max'] = 0; } + $view_info = $options['view_info']; $view = views_get_view($view_info['name']); $view->set_exposed_input($view_info['exposed_input']); $view->set_arguments($view_info['arguments']); @@ -844,7 +909,7 @@ function views_bulk_operations_adjust_selection($view_info, $queue_name, $operat 'views_row' => array(), 'position' => array( 'current' => ++$context['sandbox']['progress'], - 'total' => $view->total_rows, + 'total' => $context['sandbox']['max'], ), ); // Some operations require full selected rows. @@ -927,7 +992,7 @@ function views_bulk_operations_active_queue_process($queue_name, $operation, $to static $queue; // It is still possible to hit the time limit. - @set_time_limit(0); + drupal_set_time_limit(0); // Prepare the sandbox. if (!isset($context['sandbox']['progress'])) { @@ -980,26 +1045,42 @@ function views_bulk_operations_queue_item_process($queue_item_data, &$log = NULL $account = user_load($queue_item_data['uid']); $entity_type = $operation->entityType; $entity_ids = array(); - foreach ($row_group as $row_id => $row) { + foreach ($row_group as $row_index => $row) { $entity_ids[] = $row['entity_id']; } $entities = _views_bulk_operations_entity_load($entity_type, $entity_ids, $options['revision']); - foreach ($row_group as $row_id => $row) { + foreach ($row_group as $row_index => $row) { $entity_id = $row['entity_id']; // A matching entity couldn't be loaded. Skip this item. if (!isset($entities[$entity_id])) { continue; } - $entity = $entities[$entity_id]; + if ($options['revision']) { + // Don't reload revisions for now, they are not statically cached and + // usually don't run into the edge case described below. + $entity = $entities[$entity_id]; + } + else { + // A previous action might have resulted in the entity being resaved + // (e.g. node synchronization from a prior node in this batch), so try + // to reload it. If no change occurred, the entity will be retrieved + // from the static cache, resulting in no performance penalty. + $entity = entity_load_single($entity_type, $entity_id); + if (empty($entity)) { + // The entity is no longer valid. + continue; + } + } + // If the current entity can't be accessed, skip it and log a notice. if (!_views_bulk_operations_entity_access($operation, $entity_type, $entity, $account)) { $message = 'Skipped %operation on @type %title due to insufficient permissions.'; $arguments = array( '%operation' => $operation->label(), '@type' => $entity_type, - '%title' => _views_bulk_operations_entity_label($entity_type, $entity), + '%title' => entity_label($entity_type, $entity), ); if ($log) { @@ -1014,11 +1095,14 @@ function views_bulk_operations_queue_item_process($queue_item_data, &$log = NULL $operation_context = array( 'progress' => $row['position'], - 'rows' => $row['views_row'], + 'view_info' => $options['view_info'], ); + if ($operation->needsRows()) { + $operation_context['rows'] = array($row_index => $row['views_row']); + } $operation->execute($entity, $operation_context); - unset($row_group[$row_id]); + unset($row_group[$row_index]); } } @@ -1055,11 +1139,11 @@ function views_bulk_operations_direct_adjust(&$selection, $vbo) { /** * Processes the passed rows directly (without batching and queueing). - * - * This is a legacy function that is now only used for aggregate operations. */ function views_bulk_operations_direct_process($operation, $rows, $options) { - @set_time_limit(0); + global $user; + + drupal_set_time_limit(0); // Prepare an array of status information. Imitates the Batch API naming // for consistency. Passed to views_bulk_operations_execute_finished(). @@ -1067,42 +1151,56 @@ function views_bulk_operations_direct_process($operation, $rows, $options) { $context['results']['progress'] = 0; $context['results']['log'] = array(); - $entity_type = $operation->entityType; - $entity_ids = array(); - foreach ($rows as $row_index => $row) { - $entity_ids[] = $row['entity_id']; - } - $entities = _views_bulk_operations_entity_load($entity_type, $entity_ids, $options['revision']); - - foreach ($entities as $id => $entity) { - if (!_views_bulk_operations_entity_access($operation, $entity_type, $entity)) { - $context['results']['log'][] = t('Skipped %operation on @type %title due to insufficient permissions.', array( - '%operation' => $operation->label(), - '@type' => $entity_type, - '%title' => _views_bulk_operations_entity_label($entity_type, $entity), - )); - unset($entities[$id]); - } - } - if (empty($entities)) { - return; - } - - // Pass the selected rows to the operation if needed. - $operation_context = array(); - if ($operation->needsRows()) { - $operation_context['rows'] = array(); + if ($operation->aggregate()) { + // Load all entities. + $entity_type = $operation->entityType; + $entity_ids = array(); foreach ($rows as $row_index => $row) { - $operation_context['rows'][$row_index] = $row['views_row']; + $entity_ids[] = $row['entity_id']; + } + $entities = _views_bulk_operations_entity_load($entity_type, $entity_ids, $options['revision']); + + // Filter out entities that can't be accessed. + foreach ($entities as $id => $entity) { + if (!_views_bulk_operations_entity_access($operation, $entity_type, $entity)) { + $context['results']['log'][] = t('Skipped %operation on @type %title due to insufficient permissions.', array( + '%operation' => $operation->label(), + '@type' => $entity_type, + '%title' => entity_label($entity_type, $entity), + )); + unset($entities[$id]); + } + } + + // If there are any entities left, execute the operation on them. + if ($entities) { + $operation_context = array( + 'view_info' => $options['view_info'], + ); + // Pass the selected rows to the operation if needed. + if ($operation->needsRows()) { + $operation_context['rows'] = array(); + foreach ($rows as $row_index => $row) { + $operation_context['rows'][$row_index] = $row['views_row']; + } + } + $operation->execute($entities, $operation_context); } } - $operation->execute($entities, $operation_context); + else { + // Imitate a queue and process the entities one by one. + $queue_item_data = array( + 'uid' => $user->uid, + 'arguments' => array($rows, $operation, $options), + ); + views_bulk_operations_queue_item_process($queue_item_data, $context['results']['log']); + } - $context['results']['log'][] = t('Performed aggregate %operation on @items.', array( + $context['results']['progress'] += count($rows); + $context['results']['log'][] = t('Performed %operation on @items.', array( '%operation' => $operation->label(), - '@items' => format_plural(count($entities), '1 item', '@count items'), + '@items' => format_plural(count($rows), '1 item', '@count items'), )); - $context['results']['progress'] += count($entities); views_bulk_operations_execute_finished(TRUE, $context['results'], array()); } @@ -1176,29 +1274,6 @@ function _views_bulk_operations_entity_load($entity_type, $ids, $revision = FALS return $entities; } -/** - * Label function for entities. - * Core entities don't declare the "label" key, so entity_label() fails, - * and a fallback is needed. This function provides that fallback. - */ -function _views_bulk_operations_entity_label($entity_type, $entity) { - $label = entity_label($entity_type, $entity); - if (!$label) { - $entity_info = entity_get_info($entity_type); - $id_key = $entity_info['entity keys']['id']; - // Many entity types (e.g. "user") have a name which fits the label perfectly. - if (isset($entity->name)) { - $label = $entity->name; - } - elseif (isset($entity->{$id_key})) { - // Fallback to the id key. - $label = $entity->{$id_key}; - } - } - - return $label; -} - /** * Helper function to report an error. */ diff --git a/sites/all/modules/views_bulk_operations/views_bulk_operations.rules.inc b/sites/all/modules/views_bulk_operations/views_bulk_operations.rules.inc index da841d9..b3a6418 100644 --- a/sites/all/modules/views_bulk_operations/views_bulk_operations.rules.inc +++ b/sites/all/modules/views_bulk_operations/views_bulk_operations.rules.inc @@ -113,8 +113,9 @@ function views_bulk_operations_rules_action_info() { */ function views_bulk_operations_views_list() { $selectable_displays = array(); - foreach (views_get_enabled_views() as $name => $view) { - foreach ($view->display as $display_name => $display) { + foreach (views_get_enabled_views() as $name => $base_view) { + foreach ($base_view->display as $display_name => $display) { + $view = $base_view->clone_view(); $view->build($display_name); $vbo = _views_bulk_operations_get_field($view); if ($vbo) { @@ -158,13 +159,12 @@ function views_bulk_operations_condition_result_count($view, $args, $minimum) { function views_bulk_operations_action_load_list($view, $args) { $vbo = _views_bulk_operations_rules_get_field($view, $args); - // Get all entity ids. - $ids = array(); + // Get all entities, pass ids to the wrapper for lazy loading. + $entity_type = $vbo->get_entity_type(); + $entities = entity_metadata_wrapper("list<$entity_type>", array()); foreach ($vbo->view->result as $row_index => $result) { - $ids[] = $vbo->get_value($result); + $entities[] = entity_metadata_wrapper($entity_type, $vbo->get_value($result)); } - // And load the entity objects. - $entities = entity_load($vbo->get_entity_type(), $ids); return array('entity_list' => $entities); } diff --git a/sites/all/modules/xmlsitemap/CHANGELOG.txt b/sites/all/modules/xmlsitemap/CHANGELOG.txt deleted file mode 100644 index 0e6350d..0000000 --- a/sites/all/modules/xmlsitemap/CHANGELOG.txt +++ /dev/null @@ -1,4 +0,0 @@ - -XML Sitemap 7.x-2.x-dev ------------------------ - diff --git a/sites/all/modules/xmlsitemap/README.txt b/sites/all/modules/xmlsitemap/README.txt index f8cda78..92eca43 100644 --- a/sites/all/modules/xmlsitemap/README.txt +++ b/sites/all/modules/xmlsitemap/README.txt @@ -65,7 +65,7 @@ MORE INFORMATION queue at http://drupal.org/project/issues/xmlsitemap. - For additional documentation, see the online module handbook at - http://drupal.org/handbook/modules/gsitemap. + http://drupal.org/handbook/modules/xmlsitemap. - You can view the sitemap.org specification at http://sitemaps.org. diff --git a/sites/all/modules/xmlsitemap/xmlsitemap.admin.inc b/sites/all/modules/xmlsitemap/xmlsitemap.admin.inc index 2b34c02..496dd2c 100644 --- a/sites/all/modules/xmlsitemap/xmlsitemap.admin.inc +++ b/sites/all/modules/xmlsitemap/xmlsitemap.admin.inc @@ -105,7 +105,7 @@ function xmlsitemap_sitemap_list_form() { '#type' => 'tableselect', '#header' => $header, '#options' => $options, - '#empty' => t('No XML sitemaps available.') . ' ' . l('Add a new XML sitemap', 'admin/config/search/xmlsitemap/add'), + '#empty' => t('No XML sitemaps available.') . ' ' . l(t('Add a new XML sitemap'), 'admin/config/search/xmlsitemap/add'), ); return $form; } @@ -348,6 +348,22 @@ function xmlsitemap_settings_form($form, &$form_state) { '#title' => t('Enable developer mode to expose additional settings.'), '#default_value' => variable_get('xmlsitemap_developer_mode', 0), ); + $form['advanced']['xmlsitemap_disable_cron_regeneration'] = array( + '#type' => 'checkbox', + '#title' => t('Disable cron generation of sitemap files.'), + '#default_value' => variable_get('xmlsitemap_disable_cron_regeneration', 0), + '#description' => t('This can be disabled if other methods are being used to generate the sitemap files, like drush xmlsitemap-regenerate.'), + ); + $form['advanced']['xmlsitemap_output_elements'] = array( + '#type' => 'checkboxes', + '#title' => t('Enable or disable the individual @loc elements from output', array('@loc' => '')), + '#options' => array( + 'lastmod' => t('Last modification date: @lastmod', array('@lastmod' => '')), + 'changefreq' => t('Change frequency: @changfreq', array('@changfreq' => '')), + 'priority' => t('Priority: @priority', array('@priority' => '')), + ), + '#default_value' => drupal_map_assoc(variable_get('xmlsitemap_output_elements', array('lastmod', 'changefreq', 'priority'))), + ); $form['xmlsitemap_settings'] = array( '#type' => 'vertical_tabs', @@ -355,7 +371,7 @@ function xmlsitemap_settings_form($form, &$form_state) { ); $entities = xmlsitemap_get_link_info(NULL, TRUE); - module_load_all_includes('inc', 'xmlsitemap'); + module_load_all_includes('xmlsitemap.inc'); foreach ($entities as $entity => $entity_info) { $form[$entity] = array( '#type' => 'fieldset', diff --git a/sites/all/modules/xmlsitemap/xmlsitemap.api.php b/sites/all/modules/xmlsitemap/xmlsitemap.api.php index eeac72a..4a84af8 100644 --- a/sites/all/modules/xmlsitemap/xmlsitemap.api.php +++ b/sites/all/modules/xmlsitemap/xmlsitemap.api.php @@ -60,10 +60,12 @@ function hook_xmlsitemap_link_info() { /** * Alter the data of a sitemap link before the link is saved. * - * @param $link + * @param array $link * An array with the data of the sitemap link. + * @param array $context + * An optional context array containing data related to the link. */ -function hook_xmlsitemap_link_alter(&$link) { +function hook_xmlsitemap_link_alter(array &$link, array $context) { if ($link['type'] == 'mymodule') { $link['priority'] += 0.5; } @@ -75,10 +77,12 @@ function hook_xmlsitemap_link_alter(&$link) { * @param $link * Associative array defining an XML sitemap link as passed into * xmlsitemap_link_save(). + * @param array $context + * An optional context array containing data related to the link. * * @see hook_xmlsitemap_link_update() */ -function hook_xmlsitemap_link_insert(array $link) { +function hook_xmlsitemap_link_insert(array $link, array $context) { db_insert('mytable') ->fields(array( 'link_type' => $link['type'], @@ -94,10 +98,12 @@ function hook_xmlsitemap_link_insert(array $link) { * @param $link * Associative array defining an XML sitemap link as passed into * xmlsitemap_link_save(). + * @param array $context + * An optional context array containing data related to the link. * * @see hook_xmlsitemap_link_insert() */ -function hook_xmlsitemap_link_update(array $link) { +function hook_xmlsitemap_link_update(array $link, array $context) { db_update('mytable') ->fields(array( 'link_type' => $link['type'], @@ -107,6 +113,20 @@ function hook_xmlsitemap_link_update(array $link) { ->execute(); } +/** + * Respond to XML sitemap link clearing and rebuilding. + * + * @param array $types + * An array of link types that are being rebuilt. + * @param bool $save_custom + * If links with overridden status and/or priority are being removed or not. + */ +function hook_xmlsitemap_rebuild_clear(array $types, $save_custom) { + db_delete('mytable') + ->condition('link_type', $types, 'IN') + ->execute(); +} + /** * Index links for the XML sitemaps. */ @@ -172,6 +192,56 @@ function hook_xmlsitemap_context_url_options(array $context) { function hook_xmlsitemap_context_url_options_alter(array &$options, array $context) { } +/** + * Alter the content added to an XML sitemap for an individual element. + * + * This hooks is called when the module is generating the XML content for the + * sitemap and allows other modules to alter existing or add additional XML data + * for any element by adding additional key value paris to the $element array. + * + * The key in the element array is then used as the name of the XML child + * element to add and the value is the value of that element. For example: + * + * @code $element['video:title'] = 'Big Ponycorn'; @endcode + * + * Would result in a child element like Big Ponycorn + * being added to the sitemap for this particular link. + * + * @param array $element + * The element that will be converted to XML for the link. + * @param array $link + * An array of properties providing context about the link that we are + * generating an XML element for. + * @param object $sitemap + * The sitemap that is currently being generated. + */ +function hook_xmlsitemap_element_alter(array &$element, array $link, $sitemap) { + if ($link['subtype'] === 'video') { + $node = node_load($link['id']); + $element['video:video'] = array( + 'video:title' => check_plain($node->title), + 'video:description' => isset($node->body[LANGUAGE_NONE][0]['summary']) ? check_plain($node->body[LANGUAGE_NONE][0]['summary']) : check_plain($node->body[LANGUAGE_NONE][0]['value']), + 'video:live' => 'no', + ); + } +} + +/** + * Alter the attributes used for the root element of the XML sitemap. + * + * For example add an xmlns:video attribute: + * + * + * @param array $attributes + * An associative array of attributes to use in the root element of an XML + * sitemap. + * @param object $sitemap + * The sitemap that is currently being generated. + */ +function hook_xmlsitemap_root_attributes_alter(&$attributes, $sitemap) { + $attributes['xmlns:video'] = 'http://www.google.com/schemas/sitemap-video/1.1'; +} + /** * Alter the query selecting data from {xmlsitemap} during sitemap generation. * diff --git a/sites/all/modules/xmlsitemap/xmlsitemap.drush.inc b/sites/all/modules/xmlsitemap/xmlsitemap.drush.inc index c59e0c8..4bd0964 100644 --- a/sites/all/modules/xmlsitemap/xmlsitemap.drush.inc +++ b/sites/all/modules/xmlsitemap/xmlsitemap.drush.inc @@ -20,13 +20,23 @@ function xmlsitemap_drush_command() { 'description' => 'Dump and re-process all possible XML sitemap data, and then regenerate the files.', 'callback' => 'drush_xmlsitemap_rebuild', 'drupal dependencies' => array('xmlsitemap'), + 'options' => array( + 'types' => 'The types of links to rebuild, comma separated. If not provided, all link types will be used.', + ), ); $items['xmlsitemap-index'] = array( 'description' => 'Process un-indexed XML sitemap links.', 'callback' => 'drush_xmlsitemap_index', 'drupal dependencies' => array('xmlsitemap'), 'options' => array( - '--limit' => 'The limit of links of each type to process. Default value: ' . variable_get('xmlsitemap_batch_limit', 100), + 'limit' => 'The limit of links of each type to process. Default value: ' . variable_get('xmlsitemap_batch_limit', 100), + ), + ); + $items['xmlsitemap-queue-rebuild'] = array( + 'description' => 'Dump and queues all possible XML sitemap data to be re-processed via the xmlsitemap_link_process queue. This command does not regenerate the sitemap files.', + 'options' => array( + 'types' => 'The types of links to queue for rebuild, comma separated. If not provided, all link types will be used.', + 'limit' => 'The number of links to be processed in each queue task.', ), ); return $items; @@ -39,6 +49,7 @@ function drush_xmlsitemap_regenerate() { module_load_include('generate.inc', 'xmlsitemap'); // Run the batch process. + timer_start('xmlsitemap_regenerate'); xmlsitemap_run_unprogressive_batch('xmlsitemap_regenerate_batch'); $vars = array( @@ -55,10 +66,21 @@ function drush_xmlsitemap_rebuild() { module_load_include('generate.inc', 'xmlsitemap'); // Build a list of rebuildable link types. - $rebuild_types = xmlsitemap_get_rebuildable_link_types(); + $types = xmlsitemap_get_rebuildable_link_types(); + if ($option_types = drush_get_option('types', '')) { + $option_types = explode(',', $option_types); + if ($invalid_types = array_diff($option_types, $types)) { + drush_set_error(dt('The following link types are invalid: @types', array('@types' => implode(', ', $invalid_types)))); + } + $types = array_intersect($types, $option_types); + } + if (empty($types)) { + return drush_set_error(dt('No link types are rebuildable.')); + } // Run the batch process. - xmlsitemap_run_unprogressive_batch('xmlsitemap_rebuild_batch', $rebuild_types, TRUE); + timer_start('xmlsitemap_rebuild'); + xmlsitemap_run_unprogressive_batch('xmlsitemap_rebuild_batch', $types, TRUE); $vars = array( '@timer' => timer_read('xmlsitemap_rebuild'), @@ -84,3 +106,66 @@ function drush_xmlsitemap_index() { drush_print(dt('Indexed @count new XML sitemap links.', array('@count' => $count_after - $count_before))); } } + +/** + * Dump and queue all the sitemap links to be rebuilt in a queue process. + */ +function drush_xmlsitemap_queue_rebuild() { + module_load_include('generate.inc', 'xmlsitemap'); + + $types = xmlsitemap_get_rebuildable_link_types(); + if ($option_types = drush_get_option('types', '')) { + $option_types = explode(',', $option_types); + if ($invalid_types = array_diff($option_types, $types)) { + drush_set_error(dt('The following link types are invalid: @types', array('@types' => implode(', ', $invalid_types)))); + } + $types = array_intersect($types, $option_types); + } + if (empty($types)) { + return drush_set_error(dt('No link types are rebuildable.')); + } + + xmlsitemap_rebuild_clear($types, TRUE); + + $link_count = 0; + $chunk_count = 0; + $chunk_size = (int) drush_get_option('limit', variable_get('xmlsitemap_batch_limit', 100)); + + // @todo Figure out how to re-use this code with xmlsitemap_rebuild_batch_fetch() + foreach ($types as $type) { + $info = xmlsitemap_get_link_info($type); + $query = new EntityFieldQuery(); + $query->entityCondition('entity_type', $type); + $query->entityCondition('entity_id', 0, '>'); + $query->addTag('xmlsitemap_link_bundle_access'); + $query->addTag('xmlsitemap_rebuild'); + $query->addMetaData('entity', $type); + $query->addMetaData('entity_info', $info); + if ($bundles = xmlsitemap_get_link_type_enabled_bundles($type)) { + $query->entityCondition('bundle', $bundles, 'IN'); + } + else { + // If no enabled bundle types, skip everything else. + continue; + } + + $results = $query->execute(); + if (!empty($results[$type])) { + $ids = array_keys($results[$type]); + $link_count += count($ids); + $chunks = array_chunk($ids, $chunk_size); + $chunk_count += count($chunks); + foreach ($chunks as $chunk) { + xmlsitemap_link_enqueue($type, $chunk); + } + } + } + + if ($link_count) { + drush_log(dt('Queued @link_count links for rebuild processing in the xmlsitemap_link_process (in @chunk_count chunks of up to @chunk_size links each).', array('@link_count' => $link_count, '@chunk_count' => $chunk_count, '@chunk_size' => $chunk_size)), 'success'); + } + else { + drush_log(dt('No links to queue for rebuild processing.'), 'ok'); + } + variable_set('xmlsitemap_rebuild_needed', FALSE); +} diff --git a/sites/all/modules/xmlsitemap/xmlsitemap.generate.inc b/sites/all/modules/xmlsitemap/xmlsitemap.generate.inc index 747347a..57c3bc1 100644 --- a/sites/all/modules/xmlsitemap/xmlsitemap.generate.inc +++ b/sites/all/modules/xmlsitemap/xmlsitemap.generate.inc @@ -32,15 +32,33 @@ function xmlsitemap_get_path_alias($path, $language) { $last_language = $language; } + // We need to pass our path through hook_url_outbound_alter(). This fixes + // clean URLs not working when they don't exist in the {url_alias} table and + // are created with something like subpathauto. + $normalized_path = $path; + + // hook_url_outbound_alter() expects defaults in url() options. + $options = array( + 'fragment' => '', + 'query' => array(), + 'absolute' => FALSE, + 'alias' => FALSE, + 'prefix' => '', + 'external' => FALSE, + ); + if ($language != LANGUAGE_NONE && isset($aliases[$language][$path])) { - return $aliases[$language][$path]; + $normalized_path = $aliases[$language][$path]; + $options['alias'] = TRUE; } elseif (isset($aliases[LANGUAGE_NONE][$path])) { - return $aliases[LANGUAGE_NONE][$path]; - } - else { - return $path; + $normalized_path = $aliases[LANGUAGE_NONE][$path]; + $options['alias'] = TRUE; } + + $original_path = $normalized_path; + drupal_alter('url_outbound', $normalized_path, $options, $original_path); + return $normalized_path; } /** @@ -136,6 +154,7 @@ function xmlsitemap_generate_page(stdClass $sitemap, $page) { } function xmlsitemap_generate_chunk(stdClass $sitemap, XMLSitemapWriter $writer, $chunk) { + $output_elements = drupal_map_assoc(variable_get('xmlsitemap_output_elements', array('lastmod', 'changefreq', 'priority'))); $lastmod_format = variable_get('xmlsitemap_lastmod_format', XMLSITEMAP_LASTMOD_MEDIUM); $url_options = $sitemap->uri['options']; @@ -150,7 +169,7 @@ function xmlsitemap_generate_chunk(stdClass $sitemap, XMLSitemapWriter $writer, $link_count = 0; $query = db_select('xmlsitemap', 'x'); - $query->fields('x', array('loc', 'lastmod', 'changefreq', 'changecount', 'priority', 'language', 'access', 'status')); + $query->fields('x', array('id', 'type', 'subtype', 'loc', 'lastmod', 'changefreq', 'changecount', 'priority', 'language', 'access', 'status')); $query->condition('x.access', 1); $query->condition('x.status', 1); $query->orderBy('x.language', 'DESC'); @@ -191,22 +210,28 @@ function xmlsitemap_generate_chunk(stdClass $sitemap, XMLSitemapWriter $writer, $element = array(); $element['loc'] = $link_url; if ($link['lastmod']) { - $element['lastmod'] = gmdate($lastmod_format, $link['lastmod']); + if (!empty($output_elements['lastmod'])) { + $element['lastmod'] = gmdate($lastmod_format, $link['lastmod']); + } // If the link has a lastmod value, update the changefreq so that links // with a short changefreq but updated two years ago show decay. // We use abs() here just incase items were created on this same cron run // because lastmod would be greater than REQUEST_TIME. $link['changefreq'] = (abs(REQUEST_TIME - $link['lastmod']) + $link['changefreq']) / 2; } - if ($link['changefreq']) { + if (!empty($output_elements['changefreq']) && $link['changefreq']) { $element['changefreq'] = xmlsitemap_get_changefreq($link['changefreq']); } - if (isset($link['priority']) && $link['priority'] != 0.5) { + if (!empty($output_elements['priority']) && isset($link['priority']) && $link['priority'] != 0.5) { // Don't output the priority value for links that have 0.5 priority. This // is the default 'assumed' value if priority is not included as per the // sitemaps.org specification. $element['priority'] = number_format($link['priority'], 1); } + + // @todo Should this be moved to XMLSitemapWritier::writeSitemapElement()? + drupal_alter('xmlsitemap_element', $element, $link, $sitemap); + $writer->writeSitemapElement('url', $element); } @@ -399,19 +424,8 @@ function xmlsitemap_batch_variable_set(array $variables) { */ function xmlsitemap_rebuild_batch_clear(array $entities, $save_custom, &$context) { if (!empty($entities)) { - $query = db_delete('xmlsitemap'); - $query->condition('type', $entities); - - // If we want to save the custom data, make sure to exclude any links - // that are not using default inclusion or priority. - if ($save_custom) { - $query->condition('status_override', 0); - $query->condition('priority_override', 0); - } - - $query->execute(); + xmlsitemap_rebuild_clear($entities, $save_custom); } - $context['message'] = t('Purging links.'); } @@ -433,6 +447,13 @@ function xmlsitemap_rebuild_batch_fetch($entity, &$context) { $query->addTag('xmlsitemap_rebuild'); $query->addMetaData('entity', $entity); $query->addMetaData('entity_info', $info); + if ($types = xmlsitemap_get_link_type_enabled_bundles($entity)) { + $query->entityCondition('bundle', $types, 'IN'); + } + else { + // If no enabled bundle types, skip everything else. + return; + } if (!isset($context['sandbox']['max'])) { $count_query = clone $query; @@ -499,3 +520,32 @@ function xmlsitemap_get_rebuildable_link_types() { return $rebuild_types; } + +/** + * Clear all sitemap links for given entity types. + * + * @param array $types + * An array of link types. + * @param bool $save_custom + * A boolean if links with status or priority overridden should not be + * removed (and hence overridden values not lost). + * + * @return int + * The number of deleted links. + */ +function xmlsitemap_rebuild_clear(array $types, $save_custom) { + // Let other modules respond to the rebuild clearing. + module_invoke_all('xmlsitemap_rebuild_clear', $types, $save_custom); + + $query = db_delete('xmlsitemap'); + $query->condition('type', $types); + + // If we want to save the custom data, make sure to exclude any links + // that are not using default inclusion or priority. + if ($save_custom) { + $query->condition('status_override', 0); + $query->condition('priority_override', 0); + } + + return $query->execute(); +} diff --git a/sites/all/modules/xmlsitemap/xmlsitemap.info b/sites/all/modules/xmlsitemap/xmlsitemap.info index a309f41..44d7258 100644 --- a/sites/all/modules/xmlsitemap/xmlsitemap.info +++ b/sites/all/modules/xmlsitemap/xmlsitemap.info @@ -14,9 +14,9 @@ files[] = xmlsitemap.test recommends[] = robotstxt configure = admin/config/search/xmlsitemap -; Information added by drupal.org packaging script on 2012-12-08 -version = "7.x-2.0-rc2+0-dev" +; Information added by Drupal.org packaging script on 2016-05-25 +version = "7.x-2.3" core = "7.x" project = "xmlsitemap" -datestamp = "1354931808" +datestamp = "1464191061" diff --git a/sites/all/modules/xmlsitemap/xmlsitemap.install b/sites/all/modules/xmlsitemap/xmlsitemap.install index 169bd96..916ebec 100644 --- a/sites/all/modules/xmlsitemap/xmlsitemap.install +++ b/sites/all/modules/xmlsitemap/xmlsitemap.install @@ -338,6 +338,11 @@ function xmlsitemap_install() { ->execute(); // @todo Does the sitemap show up on first install or is it a 404 page? + + // Create the link process the queue. + /** @var DrupalReliableQueueInterface $queue */ + $queue = DrupalQueue::get('xmlsitemap_link_process', TRUE); + $queue->createQueue(); } /** @@ -363,6 +368,11 @@ function xmlsitemap_uninstall() { // Remove the file cache directory. xmlsitemap_clear_directory(NULL, TRUE); + + // Remove the queue. + /** @var DrupalReliableQueueInterface $queue */ + $queue = DrupalQueue::get('xmlsitemap_link_process', TRUE); + $queue->deleteQueue(); } /** diff --git a/sites/all/modules/xmlsitemap/xmlsitemap.module b/sites/all/modules/xmlsitemap/xmlsitemap.module index 93e935f..09d02ea 100644 --- a/sites/all/modules/xmlsitemap/xmlsitemap.module +++ b/sites/all/modules/xmlsitemap/xmlsitemap.module @@ -64,6 +64,8 @@ function xmlsitemap_hook_info() { 'xmlsitemap_context_info_alter', 'xmlsitemap_context_url_options', 'xmlsitemap_context', + 'xmlsitemap_element_alter', + 'xmlsitemap_root_attributes_alter', 'xmlsitemap_sitemap_insert', 'xmlsitemap_sitemap_update', 'xmlsitemap_sitemap_operations', @@ -72,6 +74,7 @@ function xmlsitemap_hook_info() { 'query_xmlsitemap_generate_alter', 'query_xmlsitemap_link_bundle_access_alter', 'form_xmlsitemap_sitemap_edit_form_alter', + 'xmlsitemap_rebuild_clear', ); $hooks = array_combine($hooks, $hooks); @@ -234,6 +237,10 @@ function xmlsitemap_cron() { if (!variable_get('xmlsitemap_regenerate_needed', FALSE)) { return; } + // If cron sitemap file regeneration is disabled, stop. + if (variable_get('xmlsitemap_disable_cron_regeneration', 0)) { + return; + } // If the minimum sitemap lifetime hasn't been passed, skip. $lifetime = REQUEST_TIME - variable_get('xmlsitemap_generated_last', 0); @@ -290,6 +297,8 @@ function xmlsitemap_variables() { 'xmlsitemap_frontpage_changefreq' => XMLSITEMAP_FREQUENCY_DAILY, 'xmlsitemap_lastmod_format' => XMLSITEMAP_LASTMOD_MEDIUM, 'xmlsitemap_gz' => FALSE, + 'xmlsitemap_disable_cron_regeneration' => 0, + 'xmlsitemap_output_elements' => array('lastmod', 'changefreq', 'priority'), // Removed variables are set to NULL so they can still be deleted. 'xmlsitemap_regenerate_last' => NULL, 'xmlsitemap_custom_links' => NULL, @@ -560,10 +569,15 @@ function xmlsitemap_link_load_multiple(array $conditions = array()) { /** * Saves or updates a sitemap link. * - * @param $link + * @param array $link * An array with a sitemap link. + * @param array $context + * An optional context array containing data related to the link. + * + * @return array + * The saved sitemap link. */ -function xmlsitemap_link_save(array $link) { +function xmlsitemap_link_save(array $link, array $context = array()) { $link += array( 'access' => 1, 'status' => 1, @@ -577,7 +591,7 @@ function xmlsitemap_link_save(array $link) { ); // Allow other modules to alter the link before saving. - drupal_alter('xmlsitemap_link', $link); + drupal_alter('xmlsitemap_link', $link, $context); // Temporary validation checks. // @todo Remove in final? @@ -599,11 +613,11 @@ function xmlsitemap_link_save(array $link) { // Save the link and allow other modules to respond to the link being saved. if ($existing) { drupal_write_record('xmlsitemap', $link, array('type', 'id')); - module_invoke_all('xmlsitemap_link_update', $link); + module_invoke_all('xmlsitemap_link_update', $link, $context); } else { drupal_write_record('xmlsitemap', $link); - module_invoke_all('xmlsitemap_link_insert', $link); + module_invoke_all('xmlsitemap_link_insert', $link, $context); } return $link; @@ -1535,5 +1549,47 @@ function xmlsitemap_get_operation_link($url, $options = array()) { } $link += array('query' => $destination); + drupal_alter('xmlsitemap_operation_link', $link); return $link; } + +/** + * Implements hook_cron_queue_info(). + */ +function xmlsitemap_cron_queue_info() { + $info['xmlsitemap_link_process'] = array( + 'worker callback' => 'xmlsitemap_link_queue_process', + 'time' => 60, + ); + + return $info; +} + +/** + * Queue callback for processing sitemap links. + */ +function xmlsitemap_link_queue_process($data) { + $info = xmlsitemap_get_link_info($data['type']); + $ids = isset($data['ids']) ? $data['ids'] : array($data['id']); + if (function_exists($info['xmlsitemap']['process callback'])) { + $info['xmlsitemap']['process callback']($ids); + } +} + +/** + * Enqueue sitemap links to be updated via the xmlsitemap_link_process queue. + * + * @param string $type + * The link type. + * @param array|int $ids + * An array of link IDs or a singular link ID. + */ +function xmlsitemap_link_enqueue($type, $ids) { + $data = array(); + $data['type'] = $type; + $data['ids'] = is_array($ids) ? $ids : array($ids); + + /** @var DrupalReliableQueueInterface $queue */ + $queue = DrupalQueue::get('xmlsitemap_link_process'); + $queue->createItem($data); +} diff --git a/sites/all/modules/xmlsitemap/xmlsitemap.xmlsitemap.inc b/sites/all/modules/xmlsitemap/xmlsitemap.xmlsitemap.inc index 9ce895d..3e23622 100644 --- a/sites/all/modules/xmlsitemap/xmlsitemap.xmlsitemap.inc +++ b/sites/all/modules/xmlsitemap/xmlsitemap.xmlsitemap.inc @@ -13,7 +13,6 @@ class XMLSitemapGenerationException extends XMLSitemapException {} * Extended class for writing XML sitemap files. */ class XMLSitemapWriter extends XMLWriter { - protected $status = TRUE; protected $uri = NULL; protected $sitemapElementCount = 0; protected $linkCountFlush = 500; @@ -37,7 +36,7 @@ class XMLSitemapWriter extends XMLWriter { } public function openUri($uri) { - $return = parent::openUri(drupal_realpath($uri)); + $return = parent::openUri($uri); if (!$return) { throw new XMLSitemapGenerationException(t('Could not open file @file for writing.', array('@file' => $uri))); } @@ -46,18 +45,36 @@ class XMLSitemapWriter extends XMLWriter { public function startDocument($version = '1.0', $encoding = 'UTF-8', $standalone = NULL) { $this->setIndent(FALSE); - parent::startDocument($version, $encoding); + $result = parent::startDocument($version, $encoding); + if (!$result) { + throw new XMLSitemapGenerationException(t('Unknown error occurred while writing to file @file.', array('@file' => $this->uri))); + } if (variable_get('xmlsitemap_xsl', 1)) { $this->writeXSL(); } $this->startElement($this->rootElement, TRUE); + return $result; + } + + public function getSitemapUrl($path, array $options = array()) { + $options += $this->sitemap->uri['options']; + $options += array( + 'absolute' => TRUE, + 'base_url' => variable_get('xmlsitemap_base_url', $GLOBALS['base_url']), + 'language' => language_default(), + 'alias' => TRUE, + ); + if (!empty($options['protocol_relative'])) { + $options['base_url'] = preg_replace('~^https?:~', '', $options['base_url']); + } + return url($path, $options); } /** * Add the XML stylesheet to the XML page. */ public function writeXSL() { - $this->writePi('xml-stylesheet', 'type="text/xsl" href="' . url('sitemap.xsl') . '"'); + $this->writePi('xml-stylesheet', 'type="text/xsl" href="' . $this->getSitemapUrl('sitemap.xsl', array('protocol_relative' => TRUE)) . '"'); $this->writeRaw(PHP_EOL); } @@ -70,6 +87,9 @@ class XMLSitemapWriter extends XMLWriter { $attributes['xmlns:xsi'] = 'http://www.w3.org/2001/XMLSchema-instance'; $attributes['xsi:schemaLocation'] = 'http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd'; } + + drupal_alter('xmlsitemap_root_attributes', $attributes, $this->sitemap); + return $attributes; } @@ -111,37 +131,27 @@ class XMLSitemapWriter extends XMLWriter { /** * Write full element tag including support for nested elements. * - * @param $name + * @param string $name * The element name. - * @param $content + * @param string|array $content * The element contents or an array of the elements' sub-elements. + * + * @todo Missing a return value since XMLWriter::writeElement() has one. */ - public function writeElement($name, $content = '') { + public function writeElement($name, $content = NULL) { if (is_array($content)) { $this->startElement($name); - foreach ($content as $sub_name => $sub_content) { - $this->writeElement($sub_name, $sub_content); - } + $xml_content = format_xml_elements($content); + // Remove additional spaces from the output. + $xml_content = str_replace(array(" <", ">\n"), array("<", ">"), $xml_content); + $this->writeRaw($xml_content); $this->endElement(); } else { - parent::writeElement($name, $content); + parent::writeElement($name, check_plain((string) $content)); } } - /** - * Override of XMLWriter::flush() to track file writing status. - */ - public function flush($empty = TRUE) { - $return = parent::flush($empty); - $this->status &= (bool) $return; - return $return; - } - - public function getStatus() { - return $this->status; - } - public function getURI() { return $this->uri; } @@ -153,7 +163,7 @@ class XMLSitemapWriter extends XMLWriter { public function endDocument() { $return = parent::endDocument(); - if (!$this->getStatus()) { + if (!$return) { throw new XMLSitemapGenerationException(t('Unknown error occurred while writing to file @file.', array('@file' => $this->uri))); } @@ -179,24 +189,18 @@ class XMLSitemapIndexWriter extends XMLSitemapWriter { $attributes['xmlns:xsi'] = 'http://www.w3.org/2001/XMLSchema-instance'; $attributes['xsi:schemaLocation'] = 'http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/siteindex.xsd'; } + + drupal_alter('xmlsitemap_root_attributes', $attributes, $this->sitemap); + return $attributes; } public function generateXML() { $lastmod_format = variable_get('xmlsitemap_lastmod_format', XMLSITEMAP_LASTMOD_MEDIUM); - $url_options = $this->sitemap->uri['options']; - $url_options += array( - 'absolute' => TRUE, - 'base_url' => variable_get('xmlsitemap_base_url', $GLOBALS['base_url']), - 'language' => language_default(), - 'alias' => TRUE, - ); - for ($i = 1; $i <= $this->sitemap->chunks; $i++) { - $url_options['query']['page'] = $i; $element = array( - 'loc' => url('sitemap.xml', $url_options), + 'loc' => $this->getSitemapUrl('sitemap.xml', array('query' => array('page' => $i))), // @todo Use the actual lastmod value of the chunk file. 'lastmod' => gmdate($lastmod_format, REQUEST_TIME), ); diff --git a/sites/all/modules/xmlsitemap/xmlsitemap_custom/xmlsitemap_custom.admin.inc b/sites/all/modules/xmlsitemap/xmlsitemap_custom/xmlsitemap_custom.admin.inc index badf23d..6889ec7 100644 --- a/sites/all/modules/xmlsitemap/xmlsitemap_custom/xmlsitemap_custom.admin.inc +++ b/sites/all/modules/xmlsitemap/xmlsitemap_custom/xmlsitemap_custom.admin.inc @@ -21,11 +21,13 @@ function xmlsitemap_custom_list_links() { $rows = array(); $destination = drupal_get_destination(); - $query = db_select('xmlsitemap'); + $query = db_select('xmlsitemap') + ->extend('PagerDefault') + ->extend('TableSort'); $query->fields('xmlsitemap'); $query->condition('type', 'custom'); - $query->extend('PagerDefault')->limit(50); - $query->extend('TableSort')->orderByHeader($header); + $query->limit(25); + $query->orderByHeader($header); $result = $query->execute(); foreach ($result as $link) { diff --git a/sites/all/modules/xmlsitemap/xmlsitemap_custom/xmlsitemap_custom.info b/sites/all/modules/xmlsitemap/xmlsitemap_custom/xmlsitemap_custom.info index 56bc017..e77f4ca 100644 --- a/sites/all/modules/xmlsitemap/xmlsitemap_custom/xmlsitemap_custom.info +++ b/sites/all/modules/xmlsitemap/xmlsitemap_custom/xmlsitemap_custom.info @@ -9,9 +9,9 @@ files[] = xmlsitemap_custom.install files[] = xmlsitemap_custom.test configure = admin/config/search/xmlsitemap/custom -; Information added by drupal.org packaging script on 2012-12-08 -version = "7.x-2.0-rc2+0-dev" +; Information added by Drupal.org packaging script on 2016-05-25 +version = "7.x-2.3" core = "7.x" project = "xmlsitemap" -datestamp = "1354931808" +datestamp = "1464191061" diff --git a/sites/all/modules/xmlsitemap/xmlsitemap_engines/tests/xmlsitemap_engines_test.info b/sites/all/modules/xmlsitemap/xmlsitemap_engines/tests/xmlsitemap_engines_test.info index 2a3d8da..19a3afa 100644 --- a/sites/all/modules/xmlsitemap/xmlsitemap_engines/tests/xmlsitemap_engines_test.info +++ b/sites/all/modules/xmlsitemap/xmlsitemap_engines/tests/xmlsitemap_engines_test.info @@ -6,9 +6,9 @@ files[] = xmlsitemap_engines_test.module version = VERSION hidden = TRUE -; Information added by drupal.org packaging script on 2012-12-08 -version = "7.x-2.0-rc2+0-dev" +; Information added by Drupal.org packaging script on 2016-05-25 +version = "7.x-2.3" core = "7.x" project = "xmlsitemap" -datestamp = "1354931808" +datestamp = "1464191061" diff --git a/sites/all/modules/xmlsitemap/xmlsitemap_engines/xmlsitemap_engines.info b/sites/all/modules/xmlsitemap/xmlsitemap_engines/xmlsitemap_engines.info index 59f4529..e8894d6 100644 --- a/sites/all/modules/xmlsitemap/xmlsitemap_engines/xmlsitemap_engines.info +++ b/sites/all/modules/xmlsitemap/xmlsitemap_engines/xmlsitemap_engines.info @@ -10,9 +10,9 @@ files[] = tests/xmlsitemap_engines.test recommends[] = site_verify configure = admin/config/search/xmlsitemap/engines -; Information added by drupal.org packaging script on 2012-12-08 -version = "7.x-2.0-rc2+0-dev" +; Information added by Drupal.org packaging script on 2016-05-25 +version = "7.x-2.3" core = "7.x" project = "xmlsitemap" -datestamp = "1354931808" +datestamp = "1464191061" diff --git a/sites/all/modules/xmlsitemap/xmlsitemap_i18n/xmlsitemap_i18n.info b/sites/all/modules/xmlsitemap/xmlsitemap_i18n/xmlsitemap_i18n.info index 8c3a23a..c3f79af 100644 --- a/sites/all/modules/xmlsitemap/xmlsitemap_i18n/xmlsitemap_i18n.info +++ b/sites/all/modules/xmlsitemap/xmlsitemap_i18n/xmlsitemap_i18n.info @@ -7,9 +7,9 @@ dependencies[] = i18n files[] = xmlsitemap_i18n.module files[] = xmlsitemap_i18n.test -; Information added by drupal.org packaging script on 2012-12-08 -version = "7.x-2.0-rc2+0-dev" +; Information added by Drupal.org packaging script on 2016-05-25 +version = "7.x-2.3" core = "7.x" project = "xmlsitemap" -datestamp = "1354931808" +datestamp = "1464191061" diff --git a/sites/all/modules/xmlsitemap/xmlsitemap_i18n/xmlsitemap_i18n.module b/sites/all/modules/xmlsitemap/xmlsitemap_i18n/xmlsitemap_i18n.module index 009d75f..c02163f 100644 --- a/sites/all/modules/xmlsitemap/xmlsitemap_i18n/xmlsitemap_i18n.module +++ b/sites/all/modules/xmlsitemap/xmlsitemap_i18n/xmlsitemap_i18n.module @@ -86,24 +86,24 @@ function xmlsitemap_i18n_query_xmlsitemap_generate_alter(QueryAlterableInterface switch ($mode) { case 'simple': // Current language and language neutral. - $query->condition('language', array($current, LANGUAGE_NONE)); + $query->condition('x.language', array($current, LANGUAGE_NONE)); break; case 'mixed': // Mixed current language (if available) or default language (if not) and language neutral. - $query->condition('language', array($current, $default, LANGUAGE_NONE)); + $query->condition('x.language', array($current, $default, LANGUAGE_NONE)); break; case 'default': // Only default language and language neutral. - $query->condition('language', array($default, LANGUAGE_NONE)); + $query->condition('x.language', array($default, LANGUAGE_NONE)); break; case 'strict': // Only current language (for nodes), simple for all other types. $node_condition = db_and(); - $node_condition->condition('type', 'node'); - $node_condition->condition('language', $current); + $node_condition->condition('x.type', 'node'); + $node_condition->condition('x.language', $current); $normal_condition = db_and(); - $normal_condition->condition('type', 'node', '<>'); - $normal_condition->condition('language', array($current, LANGUAGE_NONE)); + $normal_condition->condition('x.type', 'node', '<>'); + $normal_condition->condition('x.language', array($current, LANGUAGE_NONE)); $condition = db_or(); $condition->condition($node_condition); $condition->condition($normal_condition); diff --git a/sites/all/modules/xmlsitemap/xmlsitemap_menu/xmlsitemap_menu.info b/sites/all/modules/xmlsitemap/xmlsitemap_menu/xmlsitemap_menu.info index 8d0997b..cdcfd8d 100644 --- a/sites/all/modules/xmlsitemap/xmlsitemap_menu/xmlsitemap_menu.info +++ b/sites/all/modules/xmlsitemap/xmlsitemap_menu/xmlsitemap_menu.info @@ -8,9 +8,9 @@ files[] = xmlsitemap_menu.module files[] = xmlsitemap_menu.install files[] = xmlsitemap_menu.test -; Information added by drupal.org packaging script on 2012-12-08 -version = "7.x-2.0-rc2+0-dev" +; Information added by Drupal.org packaging script on 2016-05-25 +version = "7.x-2.3" core = "7.x" project = "xmlsitemap" -datestamp = "1354931808" +datestamp = "1464191061" diff --git a/sites/all/modules/xmlsitemap/xmlsitemap_menu/xmlsitemap_menu.module b/sites/all/modules/xmlsitemap/xmlsitemap_menu/xmlsitemap_menu.module index 9b03b5b..65e24f4 100644 --- a/sites/all/modules/xmlsitemap/xmlsitemap_menu/xmlsitemap_menu.module +++ b/sites/all/modules/xmlsitemap/xmlsitemap_menu/xmlsitemap_menu.module @@ -31,6 +31,7 @@ function xmlsitemap_menu_entity_info_alter(&$info) { 'process callback' => 'xmlsitemap_menu_xmlsitemap_process_menu_links', ), 'bundle label' => t('Menu'), + 'token type' => 'menu_link', ); foreach (menu_get_menus() as $type => $name) { @@ -45,6 +46,15 @@ function xmlsitemap_menu_entity_info_alter(&$info) { ); } } + else { + // If the entity type already exists ensure the xmlsitemap is added. + $info['menu_link'] += array( + 'uri callback' => 'xmlsitemap_menu_menu_link_uri', + 'xmlsitemap' => array( + 'process callback' => 'xmlsitemap_menu_xmlsitemap_process_menu_links', + ), + ); + } } /** @@ -93,7 +103,7 @@ function xmlsitemap_menu_xmlsitemap_process_menu_links(array $mlids, array $xmls $menu_item['xmlsitemap'] = $xmlsitemap; } $link = xmlsitemap_menu_create_link($menu_item); - xmlsitemap_link_save($link); + xmlsitemap_link_save($link, array($link['type'] => $menu_item)); } // Set the global user variable back to the original user. @@ -278,3 +288,16 @@ function xmlsitemap_menu_variables() { } return $defaults; } + +/** + * Implements hook_features_pipe_COMPONENT_alter(). + * + * Add variables to exported menus. + */ +function xmlsitemap_menu_features_pipe_menu_custom_alter(&$pipe, $data, $export) { + if (!empty($data)) { + foreach ($data as $menu_name) { + $pipe['variable'][] = "xmlsitemap_settings_menu_link_{$menu_name}"; + } + } +} diff --git a/sites/all/modules/xmlsitemap/xmlsitemap_modal/xmlsitemap_modal.info b/sites/all/modules/xmlsitemap/xmlsitemap_modal/xmlsitemap_modal.info index a7ba3b5..5ef0d92 100644 --- a/sites/all/modules/xmlsitemap/xmlsitemap_modal/xmlsitemap_modal.info +++ b/sites/all/modules/xmlsitemap/xmlsitemap_modal/xmlsitemap_modal.info @@ -7,9 +7,9 @@ dependencies[] = ctools files[] = xmlsitemap_modal.module hidden = TRUE -; Information added by drupal.org packaging script on 2012-12-08 -version = "7.x-2.0-rc2+0-dev" +; Information added by Drupal.org packaging script on 2016-05-25 +version = "7.x-2.3" core = "7.x" project = "xmlsitemap" -datestamp = "1354931808" +datestamp = "1464191061" diff --git a/sites/all/modules/xmlsitemap/xmlsitemap_modal/xmlsitemap_modal.module b/sites/all/modules/xmlsitemap/xmlsitemap_modal/xmlsitemap_modal.module index 31af111..bfc2bfd 100644 --- a/sites/all/modules/xmlsitemap/xmlsitemap_modal/xmlsitemap_modal.module +++ b/sites/all/modules/xmlsitemap/xmlsitemap_modal/xmlsitemap_modal.module @@ -27,7 +27,7 @@ function xmlsitemap_modal_get_form() { $form_state = array( 'ajax' => TRUE, - 'args' => $args, + 'build_info' => array('args' => $args), ); $commands = ctools_modal_form_wrapper($form_id, $form_state); @@ -37,8 +37,8 @@ function xmlsitemap_modal_get_form() { $commands[] = ctools_ajax_command_redirect($_GET['destination']); } } - return ajax_render($commands); - //return ctools_ajax_render($commands); + print ajax_render($commands); + exit; } else { array_unshift($args, $form_id); diff --git a/sites/all/modules/xmlsitemap/xmlsitemap_node/xmlsitemap_node.info b/sites/all/modules/xmlsitemap/xmlsitemap_node/xmlsitemap_node.info index 78d83c2..7a3ac0f 100644 --- a/sites/all/modules/xmlsitemap/xmlsitemap_node/xmlsitemap_node.info +++ b/sites/all/modules/xmlsitemap/xmlsitemap_node/xmlsitemap_node.info @@ -7,9 +7,9 @@ files[] = xmlsitemap_node.module files[] = xmlsitemap_node.install files[] = xmlsitemap_node.test -; Information added by drupal.org packaging script on 2012-12-08 -version = "7.x-2.0-rc2+0-dev" +; Information added by Drupal.org packaging script on 2016-05-25 +version = "7.x-2.3" core = "7.x" project = "xmlsitemap" -datestamp = "1354931808" +datestamp = "1464191061" diff --git a/sites/all/modules/xmlsitemap/xmlsitemap_node/xmlsitemap_node.module b/sites/all/modules/xmlsitemap/xmlsitemap_node/xmlsitemap_node.module index 6a0e6d9..20f5f05 100644 --- a/sites/all/modules/xmlsitemap/xmlsitemap_node/xmlsitemap_node.module +++ b/sites/all/modules/xmlsitemap/xmlsitemap_node/xmlsitemap_node.module @@ -40,7 +40,7 @@ function xmlsitemap_node_xmlsitemap_process_node_links(array $nids) { $nodes = node_load_multiple($nids); foreach ($nodes as $node) { $link = xmlsitemap_node_create_link($node); - xmlsitemap_link_save($link); + xmlsitemap_link_save($link, array($link['type'] => $node)); } } @@ -56,7 +56,7 @@ function xmlsitemap_node_node_insert(stdClass $node) { */ function xmlsitemap_node_node_update(stdClass $node) { $link = xmlsitemap_node_create_link($node); - xmlsitemap_link_save($link); + xmlsitemap_link_save($link, array($link['type'] => $node)); } /** @@ -146,7 +146,7 @@ function xmlsitemap_node_form_node_form_alter(array &$form, array &$form_state) * An array of UNIX timestamp integers. */ function xmlsitemap_node_get_timestamps(stdClass $node) { - static $timestamps = array(); + $timestamps = &drupal_static(__FUNCTION__, array()); if (!isset($timestamps[$node->nid])) { $timestamps[$node->nid] = db_query("SELECT nr.timestamp FROM {node_revision} nr WHERE nr.nid = :nid", array(':nid' => $node->nid))->fetchCol(); @@ -331,3 +331,16 @@ function xmlsitemap_node_view_access($node, $account = NULL) { return FALSE; } + +/** + * Implements hook_features_pipe_COMPONENT_alter(). + * + * Add variables to exported node types. + */ +function xmlsitemap_node_features_pipe_node_alter(&$pipe, $data, $export) { + if (!empty($data)) { + foreach ($data as $node_type) { + $pipe['variable'][] = "xmlsitemap_settings_node_{$node_type}"; + } + } +} diff --git a/sites/all/modules/xmlsitemap/xmlsitemap_taxonomy/xmlsitemap_taxonomy.info b/sites/all/modules/xmlsitemap/xmlsitemap_taxonomy/xmlsitemap_taxonomy.info index 85247c5..214775f 100644 --- a/sites/all/modules/xmlsitemap/xmlsitemap_taxonomy/xmlsitemap_taxonomy.info +++ b/sites/all/modules/xmlsitemap/xmlsitemap_taxonomy/xmlsitemap_taxonomy.info @@ -8,9 +8,9 @@ files[] = xmlsitemap_taxonomy.module files[] = xmlsitemap_taxonomy.install files[] = xmlsitemap_taxonomy.test -; Information added by drupal.org packaging script on 2012-12-08 -version = "7.x-2.0-rc2+0-dev" +; Information added by Drupal.org packaging script on 2016-05-25 +version = "7.x-2.3" core = "7.x" project = "xmlsitemap" -datestamp = "1354931808" +datestamp = "1464191061" diff --git a/sites/all/modules/xmlsitemap/xmlsitemap_taxonomy/xmlsitemap_taxonomy.module b/sites/all/modules/xmlsitemap/xmlsitemap_taxonomy/xmlsitemap_taxonomy.module index af8dbd0..f0d335d 100644 --- a/sites/all/modules/xmlsitemap/xmlsitemap_taxonomy/xmlsitemap_taxonomy.module +++ b/sites/all/modules/xmlsitemap/xmlsitemap_taxonomy/xmlsitemap_taxonomy.module @@ -50,7 +50,7 @@ function xmlsitemap_taxonomy_xmlsitemap_process_taxonomy_term_links(array $tids) $terms = taxonomy_term_load_multiple($tids); foreach ($terms as $term) { $link = xmlsitemap_taxonomy_create_link($term); - xmlsitemap_link_save($link); + xmlsitemap_link_save($link, array($link['type'] => $term)); } } @@ -107,7 +107,7 @@ function xmlsitemap_taxonomy_vocabulary_update(stdClass $vocabulary) { */ function xmlsitemap_taxonomy_term_insert(stdClass $term) { $link = xmlsitemap_taxonomy_create_link($term); - xmlsitemap_link_save($link); + xmlsitemap_link_save($link, array($link['type'] => $term)); } /** @@ -115,7 +115,7 @@ function xmlsitemap_taxonomy_term_insert(stdClass $term) { */ function xmlsitemap_taxonomy_term_update(stdClass $term) { $link = xmlsitemap_taxonomy_create_link($term); - xmlsitemap_link_save($link); + xmlsitemap_link_save($link, array($link['type'] => $term)); } /** @@ -263,3 +263,16 @@ function xmlsitemap_taxonomy_entity_query_alter($query) { } } } + +/** + * Implements hook_features_pipe_COMPONENT_alter(). + * + * Add variables to exported taxonomy vocabularies. + */ +function xmlsitemap_taxonomy_features_pipe_taxonomy_alter(&$pipe, $data, $export) { + if (!empty($data)) { + foreach ($data as $vocabulary_name) { + $pipe['variable'][] = "xmlsitemap_settings_taxonomy_term_{$vocabulary_name}"; + } + } +} diff --git a/sites/all/modules/xmlsitemap/xmlsitemap_user/xmlsitemap_user.info b/sites/all/modules/xmlsitemap/xmlsitemap_user/xmlsitemap_user.info index aa63eb2..8361571 100644 --- a/sites/all/modules/xmlsitemap/xmlsitemap_user/xmlsitemap_user.info +++ b/sites/all/modules/xmlsitemap/xmlsitemap_user/xmlsitemap_user.info @@ -7,9 +7,9 @@ files[] = xmlsitemap_user.module files[] = xmlsitemap_user.install files[] = xmlsitemap_user.test -; Information added by drupal.org packaging script on 2012-12-08 -version = "7.x-2.0-rc2+0-dev" +; Information added by Drupal.org packaging script on 2016-05-25 +version = "7.x-2.3" core = "7.x" project = "xmlsitemap" -datestamp = "1354931808" +datestamp = "1464191061" diff --git a/sites/all/modules/xmlsitemap/xmlsitemap_user/xmlsitemap_user.module b/sites/all/modules/xmlsitemap/xmlsitemap_user/xmlsitemap_user.module index 110ea75..d441570 100644 --- a/sites/all/modules/xmlsitemap/xmlsitemap_user/xmlsitemap_user.module +++ b/sites/all/modules/xmlsitemap/xmlsitemap_user/xmlsitemap_user.module @@ -37,7 +37,7 @@ function xmlsitemap_user_xmlsitemap_process_user_links(array $uids) { $accounts = user_load_multiple($uids); foreach ($accounts as $account) { $link = xmlsitemap_user_create_link($account); - xmlsitemap_link_save($link); + xmlsitemap_link_save($link, array($link['type'] => $account)); } } @@ -51,7 +51,7 @@ function xmlsitemap_user_user_presave(&$edit, $account, $category) { $link = $edit['xmlsitemap'] + $link; unset($edit['xmlsitemap']); } - xmlsitemap_link_save($link); + xmlsitemap_link_save($link, array($link['type'] => $account)); } } @@ -60,7 +60,7 @@ function xmlsitemap_user_user_presave(&$edit, $account, $category) { */ function xmlsitemap_user_user_insert(&$edit, $account, $category) { $link = xmlsitemap_user_create_link($account); - xmlsitemap_link_save($link); + xmlsitemap_link_save($link, array($link['type'] => $account)); } /** @@ -68,7 +68,7 @@ function xmlsitemap_user_user_insert(&$edit, $account, $category) { */ function xmlsitemap_user_user_update(&$edit, $account, $category) { $link = xmlsitemap_user_create_link($account); - xmlsitemap_link_save($link); + xmlsitemap_link_save($link, array($link['type'] => $account)); } /** diff --git a/sites/all/modules/xmlsitemap/xsl/xmlsitemap.xsl b/sites/all/modules/xmlsitemap/xsl/xmlsitemap.xsl index f7ff8ec..284429e 100644 --- a/sites/all/modules/xmlsitemap/xsl/xmlsitemap.xsl +++ b/sites/all/modules/xmlsitemap/xsl/xmlsitemap.xsl @@ -27,7 +27,7 @@ xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> - + diff --git a/sites/all/modules/xmlsitemap/xsl/xmlsitemap.xsl.js b/sites/all/modules/xmlsitemap/xsl/xmlsitemap.xsl.js index 7cb91c8..a7d3027 100644 --- a/sites/all/modules/xmlsitemap/xsl/xmlsitemap.xsl.js +++ b/sites/all/modules/xmlsitemap/xsl/xmlsitemap.xsl.js @@ -28,9 +28,10 @@ $.tablesorter.addParser({ }); $(document).ready(function() { - // Set some location variales. - $('h1').append(': ' + location); - document.title += ': ' + location; + // Set some location variables. + var h1 = $('h1'); + h1.text(h1.text() + ': ' + location); + document.title = h1.text(); $('table').tablesorter({ sortList: [[0,0]],