diff --git a/admin/cli/install.php b/admin/cli/install.php index dc65e318d14..79ff0b7126d 100644 --- a/admin/cli/install.php +++ b/admin/cli/install.php @@ -425,7 +425,8 @@ if (isset($maturity)) { exit(1); } } else { - cli_error(get_string('maturitycorewarning', 'admin')); + cli_problem(get_string('maturitycorewarning', 'admin', $maturitylevel)); + cli_error(get_string('maturityallowunstable', 'admin')); } } } @@ -677,7 +678,9 @@ if (!$envstatus) { // Test plugin dependencies. require_once($CFG->libdir . '/pluginlib.php'); -if (!plugin_manager::instance()->all_plugins_ok($version)) { +$failed = array(); +if (!plugin_manager::instance()->all_plugins_ok($version, $failed)) { + cli_problem(get_string('pluginscheckfailed', 'admin', array('pluginslist' => implode(', ', array_unique($failed))))); cli_error(get_string('pluginschecktodo', 'admin')); } diff --git a/admin/cli/install_database.php b/admin/cli/install_database.php index 2524c4101eb..313f3521d40 100644 --- a/admin/cli/install_database.php +++ b/admin/cli/install_database.php @@ -161,7 +161,9 @@ if (!$envstatus) { // Test plugin dependencies. require_once($CFG->libdir . '/pluginlib.php'); -if (!plugin_manager::instance()->all_plugins_ok($version)) { +$failed = array(); +if (!plugin_manager::instance()->all_plugins_ok($version, $failed)) { + cli_problem(get_string('pluginscheckfailed', 'admin', array('pluginslist' => implode(', ', array_unique($failed))))); cli_error(get_string('pluginschecktodo', 'admin')); } diff --git a/admin/cli/mysql_engine.php b/admin/cli/mysql_engine.php index 3b51f413446..6bc3642a1d4 100644 --- a/admin/cli/mysql_engine.php +++ b/admin/cli/mysql_engine.php @@ -34,8 +34,8 @@ if ($DB->get_dbfamily() !== 'mysql') { } // now get cli options -list($options, $unrecognized) = cli_get_params(array('help'=>false, 'list'=>false, 'engine'=>false), - array('h'=>'help', 'l'=>'list')); +list($options, $unrecognized) = cli_get_params(array('help'=>false, 'list'=>false, 'engine'=>false, 'available'=>false), + array('h'=>'help', 'l'=>'list', 'a'=>'available')); if ($unrecognized) { $unrecognized = implode("\n ", $unrecognized); @@ -52,6 +52,7 @@ and does not support transactions. Options: --engine=ENGINE Convert MySQL tables to different engine -l, --list Show table information +-a, --available Show list of available engines -h, --help Print out this help Example: @@ -59,7 +60,11 @@ Example: "; if (!empty($options['engine'])) { + $engines = mysql_get_engines(); $engine = clean_param($options['engine'], PARAM_ALPHA); + if (!isset($engines[strtoupper($engine)])) { + cli_error("Error: engine '$engine' is not available on this server!"); + } echo "Converting tables to '$engine' for $CFG->wwwroot:\n"; $prefix = $DB->get_prefix(); @@ -68,9 +73,11 @@ if (!empty($options['engine'])) { $rs = $DB->get_recordset_sql($sql); $converted = 0; $skipped = 0; + $errors = 0; foreach ($rs as $table) { - if ($table->engine === $engine) { - echo str_pad($table->name, 40). " - NO CONVERSION NEEDED\n"; + if (strtoupper($table->engine) === strtoupper($engine)) { + $newengine = mysql_get_table_engine($table->name); + echo str_pad($table->name, 40). " - NO CONVERSION NEEDED ($newengine)\n"; $skipped++; continue; } @@ -78,16 +85,22 @@ if (!empty($options['engine'])) { try { $DB->change_database_structure("ALTER TABLE {$table->name} ENGINE = $engine"); + $newengine = mysql_get_table_engine($table->name); + if (strtoupper($newengine) !== strtoupper($engine)) { + echo "ERROR ($newengine)\n"; + $errors++; + continue; + } + echo "DONE ($newengine)\n"; + $converted++; } catch (moodle_exception $e) { echo $e->getMessage()."\n"; - $skipped++; + $errors++; continue; } - echo "DONE\n"; - $converted++; } $rs->close(); - echo "Converted: $converted, skipped: $skipped\n"; + echo "Converted: $converted, skipped: $skipped, errors: $errors\n"; exit(0); // success } else if (!empty($options['list'])) { @@ -115,7 +128,53 @@ if (!empty($options['engine'])) { } exit(0); // success +} else if (!empty($options['available'])) { + echo "List of available MySQL engines for $CFG->wwwroot:\n"; + $engines = mysql_get_engines(); + foreach ($engines as $engine) { + echo " $engine\n"; + } + die; + } else { echo $help; die; } + + + +// ========== Some functions ============== + +function mysql_get_engines() { + global $DB; + + $sql = "SHOW Engines"; + $rs = $DB->get_recordset_sql($sql); + $engines = array(); + foreach ($rs as $engine) { + if (strtoupper($engine->support) !== 'YES' and strtoupper($engine->support) !== 'DEFAULT') { + continue; + } + $engines[strtoupper($engine->engine)] = $engine->engine; + if (strtoupper($engine->support) === 'DEFAULT') { + $engines[strtoupper($engine->engine)] .= ' (default)'; + } + } + $rs->close(); + + return $engines; +} + +function mysql_get_table_engine($tablename) { + global $DB; + + $engine = null; + $sql = "SHOW TABLE STATUS WHERE Name = '$tablename'"; // no special chars expected here + $rs = $DB->get_recordset_sql($sql); + if ($rs->valid()) { + $record = $rs->current(); + $engine = $record->engine; + } + $rs->close(); + return $engine; +} diff --git a/admin/cli/upgrade.php b/admin/cli/upgrade.php index 33e66cc3a4f..1fae897c8cb 100644 --- a/admin/cli/upgrade.php +++ b/admin/cli/upgrade.php @@ -109,7 +109,9 @@ if (!$envstatus) { } // Test plugin dependencies. -if (!plugin_manager::instance()->all_plugins_ok($version)) { +$failed = array(); +if (!plugin_manager::instance()->all_plugins_ok($version, $failed)) { + cli_problem(get_string('pluginscheckfailed', 'admin', array('pluginslist' => implode(', ', array_unique($failed))))); cli_error(get_string('pluginschecktodo', 'admin')); } @@ -132,7 +134,8 @@ if (isset($maturity)) { echo get_string('morehelp') . ': ' . get_docs_url('admin/versions') . PHP_EOL; cli_separator(); } else { - cli_error(get_string('maturitycorewarning', 'admin', $maturitylevel)); + cli_problem(get_string('maturitycorewarning', 'admin', $maturitylevel)); + cli_error(get_string('maturityallowunstable', 'admin')); } } } diff --git a/admin/index.php b/admin/index.php index 5b01be2749b..bf3eea52aa6 100644 --- a/admin/index.php +++ b/admin/index.php @@ -152,6 +152,20 @@ if (!core_tables_exist()) { die(); } + // check plugin dependencies + $failed = array(); + if (!plugin_manager::instance()->all_plugins_ok($version, $failed)) { + $PAGE->navbar->add(get_string('pluginscheck', 'admin')); + $PAGE->set_title($strinstallation); + $PAGE->set_heading($strinstallation . ' - Moodle ' . $CFG->target_release); + + $output = $PAGE->get_renderer('core', 'admin'); + $url = new moodle_url('/admin/index.php', array('agreelicense' => 1, 'confirmrelease' => 1, 'lang' => $CFG->lang)); + echo $output->unsatisfied_dependencies_page($version, $failed, $url); + die(); + } + unset($failed); + //TODO: add a page with list of non-standard plugins here $strdatabasesetup = get_string('databasesetup'); @@ -238,6 +252,15 @@ if ($version > $CFG->version) { // upgrade $reloadurl = new moodle_url('/admin/index.php', array('confirmupgrade' => 1, 'confirmrelease' => 1)); + // check plugin dependencies first + $failed = array(); + if (!plugin_manager::instance()->all_plugins_ok($version, $failed)) { + $output = $PAGE->get_renderer('core', 'admin'); + echo $output->unsatisfied_dependencies_page($version, $failed, $reloadurl); + die(); + } + unset($failed); + if ($fetchupdates) { // no sesskey support guaranteed here if (empty($CFG->disableupdatenotifications)) { @@ -290,6 +313,16 @@ if (moodle_needs_upgrading()) { } $output = $PAGE->get_renderer('core', 'admin'); + + // check plugin dependencies first + $failed = array(); + if (!plugin_manager::instance()->all_plugins_ok($version, $failed)) { + echo $output->unsatisfied_dependencies_page($version, $failed, $PAGE->url); + die(); + } + unset($failed); + + // dependencies check passed, let's rock! echo $output->upgrade_plugin_check_page(plugin_manager::instance(), available_update_checker::instance(), $version, $showallplugins, new moodle_url($PAGE->url), diff --git a/admin/oauth2callback.php b/admin/oauth2callback.php new file mode 100644 index 00000000000..364c0023de0 --- /dev/null +++ b/admin/oauth2callback.php @@ -0,0 +1,38 @@ +. + +/** + * An oauth2 redirection endpoint which can be used for an application: + * http://tools.ietf.org/html/draft-ietf-oauth-v2-26#section-3.1.2 + * + * This is used because some oauth servers will not allow a redirect urls + * with get params (like repository callback) and that needs to be called + * using the state param. + * + * @package core + * @copyright 2012 Dan Poltawski + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +require_once(dirname(dirname(__FILE__)).'/config.php'); + +// The authorization code generated by the authorization server. +$code = required_param('code', PARAM_RAW); +// The state parameter we've given (used in moodle as a redirect url). +$state = required_param('state', PARAM_URL); + +redirect(new moodle_url($state, array('code' => $code))); diff --git a/admin/renderer.php b/admin/renderer.php index b7a1bab12db..9b689a6903e 100644 --- a/admin/renderer.php +++ b/admin/renderer.php @@ -107,6 +107,29 @@ class core_admin_renderer extends plugin_renderer_base { return $output; } + /** + * Displays the list of plugins with unsatisfied dependencies + * + * @param double|string|int $version Moodle on-disk version + * @param array $failed list of plugins with unsatisfied dependecies + * @param moodle_url $reloadurl URL of the page to recheck the dependencies + * @return string HTML + */ + public function unsatisfied_dependencies_page($version, array $failed, moodle_url $reloadurl) { + $output = ''; + + $output .= $this->header(); + $output .= $this->heading(get_string('pluginscheck', 'admin')); + $output .= $this->warning(get_string('pluginscheckfailed', 'admin', array('pluginslist' => implode(', ', array_unique($failed))))); + $output .= $this->plugins_check_table(plugin_manager::instance(), $version, array('xdep' => true)); + $output .= $this->warning(get_string('pluginschecktodo', 'admin')); + $output .= $this->continue_button($reloadurl); + + $output .= $this->footer(); + + return $output; + } + /** * Display the 'You are about to upgrade Moodle' page. The first page * during upgrade. @@ -197,19 +220,15 @@ class core_admin_renderer extends plugin_renderer_base { $output .= $this->box_end(); $output .= $this->upgrade_reload($reloadurl); - if ($pluginman->all_plugins_ok($version)) { - if ($pluginman->some_plugins_updatable()) { - $output .= $this->container_start('upgradepluginsinfo'); - $output .= $this->help_icon('upgradepluginsinfo', 'core_admin', get_string('upgradepluginsfirst', 'core_admin')); - $output .= $this->container_end(); - } - $button = new single_button($continueurl, get_string('upgradestart', 'admin'), 'get'); - $button->class = 'continuebutton'; - $output .= $this->render($button); - } else { - $output .= $this->box(get_string('pluginschecktodo', 'admin'), 'environmentbox errorbox'); + if ($pluginman->some_plugins_updatable()) { + $output .= $this->container_start('upgradepluginsinfo'); + $output .= $this->help_icon('upgradepluginsinfo', 'core_admin', get_string('upgradepluginsfirst', 'core_admin')); + $output .= $this->container_end(); } + $button = new single_button($continueurl, get_string('upgradestart', 'admin'), 'get'); + $button->class = 'continuebutton'; + $output .= $this->render($button); $output .= $this->footer(); return $output; @@ -563,13 +582,14 @@ class core_admin_renderer extends plugin_renderer_base { * This default implementation renders all plugins into one big table. The rendering * options support: * (bool)full = false: whether to display up-to-date plugins, too + * (bool)xdep = false: display the plugins with unsatisified dependecies only * * @param plugin_manager $pluginman provides information about the plugins. * @param int $version the version of the Moodle code from version.php. * @param array $options rendering options * @return string HTML code */ - public function plugins_check_table(plugin_manager $pluginman, $version, array $options = null) { + public function plugins_check_table(plugin_manager $pluginman, $version, array $options = array()) { global $CFG; $plugininfo = $pluginman->get_plugins(); @@ -578,11 +598,8 @@ class core_admin_renderer extends plugin_renderer_base { return ''; } - if (empty($options)) { - $options = array( - 'full' => false, - ); - } + $options['full'] = isset($options['full']) ? (bool)$options['full'] : false; + $options['xdep'] = isset($options['xdep']) ? (bool)$options['xdep'] : false; $table = new html_table(); $table->id = 'plugins-check'; @@ -666,16 +683,28 @@ class core_admin_renderer extends plugin_renderer_base { $statusisboring = in_array($statuscode, array( plugin_manager::PLUGIN_STATUS_NODB, plugin_manager::PLUGIN_STATUS_UPTODATE)); - $dependenciesok = $pluginman->are_dependencies_satisfied( - $plugin->get_other_required_plugins()); - if ($isstandard and $statusisboring and $dependenciesok and empty($availableupdates)) { + + $coredependency = $plugin->is_core_dependency_satisfied($version); + $otherpluginsdependencies = $pluginman->are_dependencies_satisfied($plugin->get_other_required_plugins()); + $dependenciesok = $coredependency && $otherpluginsdependencies; + + if ($options['xdep']) { + // we want to see only plugins with failed dependencies + if ($dependenciesok) { + continue; + } + + } else if ($isstandard and $statusisboring and $dependenciesok and empty($availableupdates)) { + // no change is going to happen to the plugin - display it only + // if the user wants to see the full list if (empty($options['full'])) { continue; } - } else { - $numofhighlighted[$type]++; } + // ok, the plugin should be displayed + $numofhighlighted[$type]++; + $row->cells = array($displayname, $rootdir, $source, $versiondb, $versiondisk, $requires, $status); $plugintyperows[] = $row; @@ -691,7 +720,11 @@ class core_admin_renderer extends plugin_renderer_base { $sumofhighlighted = array_sum($numofhighlighted); - if ($sumofhighlighted == 0) { + if ($options['xdep']) { + // we do not want to display no heading and links in this mode + $out = ''; + + } else if ($sumofhighlighted == 0) { $out = $this->output->container_start('nonehighlighted', 'plugins-check-info'); $out .= $this->output->heading(get_string('nonehighlighted', 'core_plugin')); if (empty($options['full'])) { diff --git a/admin/repository.php b/admin/repository.php index c3409a5b5a0..b3494cab5a5 100644 --- a/admin/repository.php +++ b/admin/repository.php @@ -1,12 +1,27 @@ . require_once(dirname(dirname(__FILE__)) . '/config.php'); require_once($CFG->dirroot . '/repository/lib.php'); require_once($CFG->libdir . '/adminlib.php'); -$repository = optional_param('repos', '', PARAM_FORMAT); -$action = optional_param('action', '', PARAM_ALPHA); -$sure = optional_param('sure', '', PARAM_ALPHA); +$repository = optional_param('repos', '', PARAM_ALPHANUMEXT); +$action = optional_param('action', '', PARAM_ACTION); +$sure = optional_param('sure', '', PARAM_ALPHA); +$downloadcontents = optional_param('downloadcontents', false, PARAM_BOOL); $display = true; // fall through to normal display @@ -42,6 +57,10 @@ $configstr = get_string('manage', 'repository'); $return = true; +if (!empty($action)) { + require_sesskey(); +} + /** * Helper function that generates a moodle_url object * relevant to the repository @@ -152,10 +171,10 @@ if (($action == 'edit') || ($action == 'new')) { // Display instances list and creation form if ($action == 'edit') { - $instanceoptionnames = repository::static_function($repository, 'get_instance_option_names'); - if (!empty($instanceoptionnames)) { - repository::display_instances_list(get_context_instance(CONTEXT_SYSTEM), $repository); - } + $instanceoptionnames = repository::static_function($repository, 'get_instance_option_names'); + if (!empty($instanceoptionnames)) { + repository::display_instances_list(context_system::instance(), $repository); + } } } } else if ($action == 'show') { @@ -185,7 +204,8 @@ if (($action == 'edit') || ($action == 'new')) { if (!confirm_sesskey()) { print_error('confirmsesskeybad', '', $baseurl); } - if ($repositorytype->delete()) { + + if ($repositorytype->delete($downloadcontents)) { redirect($baseurl); } else { print_error('instancenotdeleted', 'repository', $baseurl); @@ -193,7 +213,34 @@ if (($action == 'edit') || ($action == 'new')) { exit; } else { echo $OUTPUT->header(); - echo $OUTPUT->confirm(get_string('confirmremove', 'repository', $repositorytype->get_readablename()), $sesskeyurl . '&action=delete&repos=' . $repository . '&sure=yes', $baseurl); + + $message = get_string('confirmremove', 'repository', $repositorytype->get_readablename()); + + $output = $OUTPUT->box_start('generalbox', 'notice'); + $output .= html_writer::tag('p', $message); + + $removeurl = new moodle_url($sesskeyurl); + $removeurl->params(array( + 'action' =>'delete', + 'repos' => $repository, + 'sure' => 'yes', + )); + + $removeanddownloadurl = new moodle_url($sesskeyurl); + $removeanddownloadurl->params(array( + 'action' =>'delete', + 'repos'=> $repository, + 'sure' => 'yes', + 'downloadcontents' => 1, + )); + + $output .= $OUTPUT->single_button($removeurl, get_string('continueuninstall', 'repository')); + $output .= $OUTPUT->single_button($removeanddownloadurl, get_string('continueuninstallanddownload', 'repository')); + $output .= $OUTPUT->single_button($baseurl, get_string('cancel')); + $output .= $OUTPUT->box_end(); + + echo $output; + $return = false; } } else if ($action == 'moveup') { @@ -255,7 +302,7 @@ if (($action == 'edit') || ($action == 'new')) { // Calculate number of instances in order to display them for the Moodle administrator if (!empty($instanceoptionnames)) { $params = array(); - $params['context'] = array(get_system_context()); + $params['context'] = array(context_system::instance()); $params['onlyvisible'] = false; $params['type'] = $typename; $admininstancenumber = count(repository::static_function($typename, 'get_instances', $params)); diff --git a/admin/repositoryinstance.php b/admin/repositoryinstance.php index e75193d0be4..fe751464192 100644 --- a/admin/repositoryinstance.php +++ b/admin/repositoryinstance.php @@ -1,18 +1,35 @@ . require_once(dirname(dirname(__FILE__)) . '/config.php'); require_once($CFG->dirroot . '/repository/lib.php'); require_once($CFG->libdir . '/adminlib.php'); +require_sesskey(); + // id of repository $edit = optional_param('edit', 0, PARAM_INT); -$new = optional_param('new', '', PARAM_FORMAT); +$new = optional_param('new', '', PARAM_PLUGIN); $hide = optional_param('hide', 0, PARAM_INT); $delete = optional_param('delete', 0, PARAM_INT); $sure = optional_param('sure', '', PARAM_ALPHA); $type = optional_param('type', '', PARAM_PLUGIN); +$downloadcontents = optional_param('downloadcontents', false, PARAM_BOOL); -$context = get_context_instance(CONTEXT_SYSTEM); +$context = context_system::instance(); $pagename = 'repositorycontroller'; @@ -24,16 +41,20 @@ if ($edit){ $pagename = 'repositoryinstancenew'; } -admin_externalpage_setup($pagename); -require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM)); +admin_externalpage_setup($pagename, '', null, new moodle_url('/admin/repositoryinstances.php')); +require_capability('moodle/site:config', $context); + +$baseurl = new moodle_url("/$CFG->admin/repositoryinstance.php", array('sesskey'=>sesskey())); + +$parenturl = new moodle_url("/$CFG->admin/repository.php", array( + 'sesskey'=>sesskey(), + 'action'=>'edit', +)); -$sesskeyurl = "$CFG->wwwroot/$CFG->admin/repositoryinstance.php?sesskey=" . sesskey(); -$baseurl = "$CFG->wwwroot/$CFG->admin/repository.php?session=". sesskey() .'&action=edit&repos='; if ($new) { - $baseurl .= $new; -} -else { - $baseurl .= $type; + $parenturl->param('repos', $new); +} else { + $parenturl->param('repos', $type); } $return = true; @@ -48,7 +69,7 @@ if (!empty($edit) || !empty($new)) { $typeid = $instance->options['typeid']; } else { $plugin = $new; - $typeid = $new; + $typeid = null; $instance = null; } @@ -57,12 +78,9 @@ if (!empty($edit) || !empty($new)) { // end setup, begin output if ($mform->is_cancelled()){ - redirect($baseurl); + redirect($parenturl); exit; } else if ($fromform = $mform->get_data()){ - if (!confirm_sesskey()) { - print_error('confirmsesskeybad', '', $baseurl); - } if ($edit) { $settings = array(); $settings['name'] = $fromform->name; @@ -77,13 +95,13 @@ if (!empty($edit) || !empty($new)) { } $success = $instance->set_option($settings); } else { - $success = repository::static_function($plugin, 'create', $plugin, 0, get_system_context(), $fromform); + $success = repository::static_function($plugin, 'create', $plugin, 0, $context, $fromform); $data = data_submitted(); } if ($success) { - redirect($baseurl); + redirect($parenturl); } else { - print_error('instancenotsaved', 'repository', $baseurl); + print_error('instancenotsaved', 'repository', $parenturl); } exit; } else { @@ -95,9 +113,6 @@ if (!empty($edit) || !empty($new)) { $return = false; } } else if (!empty($hide)) { - if (!confirm_sesskey()) { - print_error('confirmsesskeybad', '', $baseurl); - } $instance = repository::get_type_by_typename($hide); $instance->hide(); $return = true; @@ -108,25 +123,38 @@ if (!empty($edit) || !empty($new)) { throw new repository_exception('readonlyinstance', 'repository'); } if ($sure) { - if (!confirm_sesskey()) { - print_error('confirmsesskeybad', '', $baseurl); - } - if ($instance->delete()) { + if ($instance->delete($downloadcontents)) { $deletedstr = get_string('instancedeleted', 'repository'); - redirect($baseurl, $deletedstr, 3); + redirect($parenturl, $deletedstr, 3); } else { - print_error('instancenotdeleted', 'repository', $baseurl); + print_error('instancenotdeleted', 'repository', $parenturl); } exit; } echo $OUTPUT->header(); - echo $OUTPUT->confirm(get_string('confirmdelete', 'repository', $instance->name), "$sesskeyurl&type=$type'&delete=$delete'&sure=yes", "$CFG->wwwroot/$CFG->admin/repositoryinstance.php?session=". sesskey()); + echo $OUTPUT->box_start('generalbox', 'notice'); + $continueurl = new moodle_url($baseurl, array( + 'type' => $type, + 'delete' => $delete, + 'sure' => 'yes', + )); + $continueanddownloadurl = new moodle_url($continueurl, array( + 'downloadcontents' => 1 + )); + $message = get_string('confirmdelete', 'repository', $instance->name); + echo html_writer::tag('p', $message); + + echo $OUTPUT->single_button($continueurl, get_string('continueuninstall', 'repository')); + echo $OUTPUT->single_button($continueanddownloadurl, get_string('continueuninstallanddownload', 'repository')); + echo $OUTPUT->single_button($parenturl, get_string('cancel')); + + echo $OUTPUT->box_end(); + $return = false; } if (!empty($return)) { - - redirect($baseurl); + redirect($parenturl); } echo $OUTPUT->footer(); diff --git a/admin/settings/development.php b/admin/settings/development.php index 9d7b5a09981..e55e1f28f00 100644 --- a/admin/settings/development.php +++ b/admin/settings/development.php @@ -13,6 +13,8 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page $temp->add(new admin_setting_configcheckbox('enablesafebrowserintegration', new lang_string('enablesafebrowserintegration', 'admin'), new lang_string('configenablesafebrowserintegration', 'admin'), 0)); $temp->add(new admin_setting_configcheckbox('enablegroupmembersonly', new lang_string('enablegroupmembersonly', 'admin'), new lang_string('configenablegroupmembersonly', 'admin'), 0)); + $temp->add(new admin_setting_configcheckbox('dndallowtextandlinks', new lang_string('dndallowtextandlinks', 'admin'), new lang_string('configdndallowtextandlinks', 'admin'), 0)); + $ADMIN->add('experimental', $temp); // "debugging" settingpage diff --git a/admin/settings/plugins.php b/admin/settings/plugins.php index 6d192b6d37d..638aa4009b7 100644 --- a/admin/settings/plugins.php +++ b/admin/settings/plugins.php @@ -330,12 +330,12 @@ if ($hassiteconfig) { $typeoptionnames = repository::static_function($repositorytype->get_typename(), 'get_type_option_names'); $instanceoptionnames = repository::static_function($repositorytype->get_typename(), 'get_instance_option_names'); if (!empty($typeoptionnames) || !empty($instanceoptionnames)) { - $ADMIN->add('repositorysettings', - new admin_externalpage('repositorysettings'.$repositorytype->get_typename(), - $repositorytype->get_readablename(), - $url . '?action=edit&repos=' . $repositorytype->get_typename()), - 'moodle/site:config'); - } + + $params = array('action'=>'edit', 'sesskey'=>sesskey(), 'repos'=>$repositorytype->get_typename()); + $settingsurl = new moodle_url("/$CFG->admin/repository.php", $params); + $repositoryexternalpage = new admin_externalpage('repositorysettings'.$repositorytype->get_typename(), $repositorytype->get_readablename(), $settingsurl); + $ADMIN->add('repositorysettings', $repositoryexternalpage); + } } } @@ -370,7 +370,7 @@ if ($hassiteconfig) { // to set the page layout on all admin pages. // $wsdoclink = $OUTPUT->doc_link('How_to_get_a_security_key'); $url = new moodle_url(get_docs_url('How_to_get_a_security_key')); - $wsdoclink = html_writer::tag('a', new lang_string('supplyinfo'),array('href'=>$url)); + $wsdoclink = html_writer::tag('a', new lang_string('supplyinfo', 'webservice'), array('href'=>$url)); $temp->add(new admin_setting_configcheckbox('enablewsdocumentation', new lang_string('enablewsdocumentation', 'admin'), new lang_string('configenablewsdocumentation', 'admin', $wsdoclink), false)); $ADMIN->add('webservicesettings', $temp); diff --git a/admin/timezone.php b/admin/timezone.php index 34e1fa40fda..e031be44bbe 100644 --- a/admin/timezone.php +++ b/admin/timezone.php @@ -9,6 +9,9 @@ $zone = clean_param($zone, PARAM_PATH); } + $PAGE->set_url('/admin/timezone.php'); + $PAGE->set_context(context_system::instance()); + require_login(); require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM)); @@ -18,7 +21,6 @@ $strusers = get_string("users"); $strall = get_string("all"); - $PAGE->set_url('/admin/timezone.php'); $PAGE->set_title($strtimezone); $PAGE->set_heading($strtimezone); $PAGE->navbar->add($strtimezone); diff --git a/admin/tool/assignmentupgrade/batchupgrade.php b/admin/tool/assignmentupgrade/batchupgrade.php index 20ebf5c9958..31bca246490 100644 --- a/admin/tool/assignmentupgrade/batchupgrade.php +++ b/admin/tool/assignmentupgrade/batchupgrade.php @@ -22,16 +22,20 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ +define('NO_OUTPUT_BUFFERING', true); + require_once(dirname(__FILE__) . '/../../../config.php'); -require_once(dirname(__FILE__) . '/locallib.php'); -require_once(dirname(__FILE__) . '/upgradableassignmentstable.php'); -require_once(dirname(__FILE__) . '/upgradableassignmentsbatchform.php'); require_once($CFG->libdir . '/adminlib.php'); +require_once($CFG->dirroot . '/admin/tool/assignmentupgrade/locallib.php'); +require_once($CFG->dirroot . '/admin/tool/assignmentupgrade/upgradableassignmentstable.php'); +require_once($CFG->dirroot . '/admin/tool/assignmentupgrade/upgradableassignmentsbatchform.php'); require_sesskey(); // admin_externalpage_setup calls require_login and checks moodle/site:config admin_externalpage_setup('assignmentupgrade', '', array(), tool_assignmentupgrade_url('batchupgrade')); + +$PAGE->set_pagelayout('maintenance'); $PAGE->navbar->add(get_string('batchupgrade', 'tool_assignmentupgrade')); $renderer = $PAGE->get_renderer('tool_assignmentupgrade'); @@ -41,7 +45,26 @@ if (!$confirm) { print_error('invalidrequest'); die(); } -$result = tool_assignmentupgrade_upgrade_multiple_assignments(optional_param('upgradeall', 0, PARAM_BOOL), - explode(',', optional_param('selected', '', PARAM_TEXT))); +raise_memory_limit(MEMORY_EXTRA); +session_get_instance()->write_close(); // release session -echo $renderer->convert_multiple_assignments_result($result); +echo $renderer->header(); +echo $renderer->heading(get_string('batchupgrade', 'tool_assignmentupgrade')); + +$current = 0; +if (optional_param('upgradeall', false, PARAM_BOOL)) { + $assignmentids = tool_assignmentupgrade_load_all_upgradable_assignmentids(); +} else { + $assignmentids = explode(',', optional_param('selected', '', PARAM_TEXT)); +} +$total = count($assignmentids); + +foreach ($assignmentids as $assignmentid) { + list($summary, $success, $log) = tool_assignmentupgrade_upgrade_assignment($assignmentid); + $current += 1; + echo $renderer->heading(get_string('upgradeprogress', 'tool_assignmentupgrade', array('current'=>$current, 'total'=>$total)), 3); + echo $renderer->convert_assignment_result($summary, $success, $log); +} + +echo $renderer->continue_button(tool_assignmentupgrade_url('listnotupgraded')); +echo $renderer->footer(); diff --git a/admin/tool/assignmentupgrade/index.php b/admin/tool/assignmentupgrade/index.php index bb7ff493b10..f4cd1797d73 100644 --- a/admin/tool/assignmentupgrade/index.php +++ b/admin/tool/assignmentupgrade/index.php @@ -34,8 +34,8 @@ */ require_once(dirname(__FILE__) . '/../../../config.php'); -require_once(dirname(__FILE__) . '/locallib.php'); require_once($CFG->libdir . '/adminlib.php'); +require_once($CFG->dirroot . '/admin/tool/assignmentupgrade/locallib.php'); // admin_externalpage_setup calls require_login and checks moodle/site:config admin_externalpage_setup('assignmentupgrade'); @@ -47,4 +47,4 @@ $actions = array(); $header = get_string('pluginname', 'tool_assignmentupgrade'); $actions[] = tool_assignmentupgrade_action::make('listnotupgraded'); -echo $renderer->index_page($header, $actions); \ No newline at end of file +echo $renderer->index_page($header, $actions); diff --git a/admin/tool/assignmentupgrade/lang/en/tool_assignmentupgrade.php b/admin/tool/assignmentupgrade/lang/en/tool_assignmentupgrade.php index 3b3734bc247..e9a61dcb381 100644 --- a/admin/tool/assignmentupgrade/lang/en/tool_assignmentupgrade.php +++ b/admin/tool/assignmentupgrade/lang/en/tool_assignmentupgrade.php @@ -26,6 +26,7 @@ $string['areyousure'] = 'Are you sure?'; $string['areyousuremessage'] = 'Are you sure you want to upgrade the assignment "{$a->name}"?'; $string['assignmentid'] = 'Assignment ID'; $string['assignmentnotfound'] = 'Assignment could not be found (id={$a})'; +$string['assignmentsperpage'] = 'Assignments per page'; $string['assignmenttype'] = 'Assignment type'; $string['backtoindex'] = 'Back to index'; $string['batchoperations'] = 'Batch operations'; @@ -43,6 +44,7 @@ $string['pluginname'] = 'Assignment upgrade helper'; $string['select'] = 'Select'; $string['submissions'] = 'Submissions'; $string['supported'] = 'Upgrade'; +$string['updatetable'] = 'Update table'; $string['unknown'] = 'Unknown'; $string['upgradeassignmentsummary'] = 'Upgrade assignment: {$a->name} (Course: {$a->shortname})'; $string['upgradeassignmentsuccess'] = 'Result: Upgrade successful'; @@ -52,5 +54,6 @@ $string['upgradeselected'] = 'Upgrade selected assignments'; $string['upgradeselectedcount'] = 'Upgrade {$a} selected assignments?'; $string['upgradeall'] = 'Upgrade all assignments'; $string['upgradeallconfirm'] = 'Upgrade all assignments?'; +$string['upgradeprogress'] = 'Upgrade assignment {$a->current} of {$a->total}'; $string['upgradesingle'] = 'Upgrade single assignment'; $string['viewcourse'] = 'View the course with the converted assignment'; diff --git a/admin/tool/assignmentupgrade/listnotupgraded.php b/admin/tool/assignmentupgrade/listnotupgraded.php index 37605a5d36a..b03883adf4a 100644 --- a/admin/tool/assignmentupgrade/listnotupgraded.php +++ b/admin/tool/assignmentupgrade/listnotupgraded.php @@ -23,10 +23,11 @@ */ require_once(dirname(__FILE__) . '/../../../config.php'); -require_once(dirname(__FILE__) . '/locallib.php'); -require_once(dirname(__FILE__) . '/upgradableassignmentstable.php'); -require_once(dirname(__FILE__) . '/upgradableassignmentsbatchform.php'); require_once($CFG->libdir . '/adminlib.php'); +require_once($CFG->dirroot . '/admin/tool/assignmentupgrade/locallib.php'); +require_once($CFG->dirroot . '/admin/tool/assignmentupgrade/upgradableassignmentstable.php'); +require_once($CFG->dirroot . '/admin/tool/assignmentupgrade/upgradableassignmentsbatchform.php'); +require_once($CFG->dirroot . '/admin/tool/assignmentupgrade/paginationform.php'); // admin_externalpage_setup calls require_login and checks moodle/site:config admin_externalpage_setup('assignmentupgrade', '', array(), tool_assignmentupgrade_url('listnotupgraded')); @@ -34,16 +35,26 @@ $PAGE->navbar->add(get_string('listnotupgraded', 'tool_assignmentupgrade')); $renderer = $PAGE->get_renderer('tool_assignmentupgrade'); -$perpage = get_user_preferences('tool_assignmentupgrade_perpage', 5); +$perpage = optional_param('perpage', 0, PARAM_INT); +if (!$perpage) { + $perpage = get_user_preferences('tool_assignmentupgrade_perpage', 100); +} else { + set_user_preference('tool_assignmentupgrade_perpage', $perpage); +} $assignments = new tool_assignmentupgrade_assignments_table($perpage); $batchform = new tool_assignmentupgrade_batchoperations_form(); $data = $batchform->get_data(); + if ($data && $data->selectedassignments != '' || $data && isset($data->upgradeall)) { require_sesskey(); echo $renderer->confirm_batch_operation_page($data); } else { - echo $renderer->assignment_list_page($assignments, $batchform); + $paginationform = new tool_assignmentupgrade_pagination_form(); + $pagedata = new stdClass(); + $pagedata->perpage = $perpage; + $paginationform->set_data($pagedata); + echo $renderer->assignment_list_page($assignments, $batchform, $paginationform); } diff --git a/admin/tool/assignmentupgrade/locallib.php b/admin/tool/assignmentupgrade/locallib.php index 5b814859fc3..6ea1883a4d3 100644 --- a/admin/tool/assignmentupgrade/locallib.php +++ b/admin/tool/assignmentupgrade/locallib.php @@ -170,54 +170,33 @@ function tool_assignmentupgrade_load_all_upgradable_assignmentids() { /** - * Convert a list of assignments from the old format to the new one. - * @param bool $upgradeall - Upgrade all possible assignments - * @param array $assignmentids An array of assignment ids to upgrade - * @return array of $entry['assignmentsummary' => (result from tool_assignmentupgrade_get_assignment) - * $entry['success'] => boolean - * $entry['log'] => string - upgrade log + * Upgrade a single assignment. This is used by both upgrade single and upgrade batch + * + * @param int $assignmentid - The assignment id to upgrade + * @return array(string, boolean, string) - + * The array contains + * - the assignment summary (returned by tool_assignmentupgrade_get_assignment) + * - success + * - the upgrade log */ -function tool_assignmentupgrade_upgrade_multiple_assignments($upgradeall, $assignmentids) { +function tool_assignmentupgrade_upgrade_assignment($assignmentid) { global $CFG; - require_once($CFG->dirroot . '/mod/assign/locallib.php'); require_once($CFG->dirroot . '/mod/assign/upgradelib.php'); - $upgrades = array(); - - if ($upgradeall) { - $assignmentids = tool_assignmentupgrade_load_all_upgradable_assignmentids(); - } $assignment_upgrader = new assign_upgrade_manager(); - foreach ($assignmentids as $assignmentid) { - $info = tool_assignmentupgrade_get_assignment($assignmentid); - if ($info) { - $log = ''; - $success = $assignment_upgrader->upgrade_assignment($assignmentid, $log); - } else { - $success = false; - $log = get_string('assignmentnotfound', 'tool_assignmentupgrade', $assignmentid); - $info = new stdClass(); - $info->name = get_string('unknown', 'tool_assignmentupgrade'); - $info->shortname = get_string('unknown', 'tool_assignmentupgrade'); - } - - $upgrades[] = array('assignmentsummary'=>$info, 'success'=>$success, 'log'=>$log); + $info = tool_assignmentupgrade_get_assignment($assignmentid); + if ($info) { + $log = ''; + $success = $assignment_upgrader->upgrade_assignment($assignmentid, $log); + } else { + $success = false; + $log = get_string('assignmentnotfound', 'tool_assignmentupgrade', $assignmentid); + $info = new stdClass(); + $info->name = get_string('unknown', 'tool_assignmentupgrade'); + $info->shortname = get_string('unknown', 'tool_assignmentupgrade'); } - return $upgrades; -} -/** - * Convert a single assignment from the old format to the new one. - * @param stdClass $assignmentinfo An object containing information about this class - * @param string $log This gets appended to with the details of the conversion process - * @return boolean This is the overall result (true/false) - */ -function tool_assignmentupgrade_upgrade_assignment($assignmentinfo, &$log) { - global $CFG; - require_once($CFG->dirroot . '/mod/assign/locallib.php'); - require_once($CFG->dirroot . '/mod/assign/upgradelib.php'); - $assignment_upgrader = new assign_upgrade_manager(); - return $assignment_upgrader->upgrade_assignment($assignmentinfo->id, $log); + return array($info, $success, $log); } /** diff --git a/admin/tool/assignmentupgrade/module.js b/admin/tool/assignmentupgrade/module.js index 829f99a34ad..edee839835f 100644 --- a/admin/tool/assignmentupgrade/module.js +++ b/admin/tool/assignmentupgrade/module.js @@ -61,6 +61,11 @@ M.tool_assignmentupgrade = { } }); + var perpage = Y.one('#id_perpage'); + perpage.on('change', function(e) { + window.onbeforeunload = null; + Y.one('.tool_assignmentupgrade_paginationform form').submit(); + }); } } diff --git a/admin/tool/assignmentupgrade/paginationform.php b/admin/tool/assignmentupgrade/paginationform.php new file mode 100644 index 00000000000..3efb8d4d508 --- /dev/null +++ b/admin/tool/assignmentupgrade/paginationform.php @@ -0,0 +1,59 @@ +. + +/** + * This file contains the forms to create and edit an instance of this module + * + * @package tool_assignmentupgrade + * @copyright 2012 NetSpot {@link http://www.netspot.com.au} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die('Direct access to this script is forbidden.'); + + +/** Include formslib.php */ +require_once ($CFG->libdir.'/formslib.php'); + +/** + * Assignment upgrade table display options + * + * @package tool_assignmentupgrade + * @copyright 2012 NetSpot {@link http://www.netspot.com.au} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +class tool_assignmentupgrade_pagination_form extends moodleform { + /** + * Define this form - called from the parent constructor + */ + function definition() { + $mform = $this->_form; + $instance = $this->_customdata; + + $mform->addElement('header', 'general', get_string('assignmentsperpage', 'tool_assignmentupgrade')); + // visible elements + $options = array(10=>'10', 20=>'20', 50=>'50', 100=>'100'); + $mform->addElement('select', 'perpage', get_string('assignmentsperpage', 'assign'), $options); + + // hidden params + $mform->addElement('hidden', 'action', 'saveoptions'); + $mform->setType('action', PARAM_ALPHA); + + // buttons + $this->add_action_buttons(false, get_string('updatetable', 'tool_assignmentupgrade')); + } +} + diff --git a/admin/tool/assignmentupgrade/renderer.php b/admin/tool/assignmentupgrade/renderer.php index 16c013c9108..ddb8cfabad4 100644 --- a/admin/tool/assignmentupgrade/renderer.php +++ b/admin/tool/assignmentupgrade/renderer.php @@ -112,9 +112,10 @@ class tool_assignmentupgrade_renderer extends plugin_renderer_base { * Render the list of assignments that still need to be upgraded page. * @param tool_assignmentupgrade_assignments_table $assignments of data about assignments. * @param tool_assignmentupgrade_batchoperations_form $batchform Submitted form with list of assignments to upgrade + * @param tool_assignmentupgrade_pagination_form $paginationform Form which contains the preferences for paginating the table * @return string html to output. */ - public function assignment_list_page(tool_assignmentupgrade_assignments_table $assignments, tool_assignmentupgrade_batchoperations_form $batchform) { + public function assignment_list_page(tool_assignmentupgrade_assignments_table $assignments, tool_assignmentupgrade_batchoperations_form $batchform, tool_assignmentupgrade_pagination_form $paginationform) { $output = ''; $output .= $this->header(); $this->page->requires->js_init_call('M.tool_assignmentupgrade.init_upgrade_table', array()); @@ -126,6 +127,10 @@ class tool_assignmentupgrade_renderer extends plugin_renderer_base { $output .= $this->container_start('tool_assignmentupgrade_upgradetable'); + $output .= $this->container_start('tool_assignmentupgrade_paginationform'); + $output .= $this->moodleform($paginationform); + $output .= $this->container_end(); + $output .= $this->flexible_table($assignments, $assignments->get_rows_per_page(), true); $output .= $this->container_end(); @@ -140,43 +145,6 @@ class tool_assignmentupgrade_renderer extends plugin_renderer_base { return $output; } - /** - * Render the result of an assignment conversion - * @param array $assignments - An array of arrays with keys $entry['assignmentsummary', 'success', 'log'] - * See convert_assignment_result for more description of these keys. - * @return string html to output. - */ - public function convert_multiple_assignments_result($assignments) { - $output = ''; - $output .= $this->header(); - $output .= $this->heading(get_string('batchupgrade', 'tool_assignmentupgrade')); - - foreach ($assignments as $assignment) { - $assignmentsummary = $assignment['assignmentsummary']; - $success = $assignment['success']; - $log = $assignment['log']; - - $output .= $this->heading(get_string('upgradeassignmentsummary', 'tool_assignmentupgrade', $assignmentsummary), 5); - if ($success) { - $output .= $this->container(get_string('upgradeassignmentsuccess', 'tool_assignmentupgrade')); - - } else { - $output .= $this->container(get_string('upgradeassignmentfailed', 'tool_assignmentupgrade', $assignment)); - } - if (isset($assignmentsummary->courseid)) { - $output .= html_writer::link(new moodle_url('/course/view.php', array('id'=>$assignmentsummary->courseid)) ,get_string('viewcourse', 'tool_assignmentupgrade')); - } - - - } - - $output .= $this->continue_button(tool_assignmentupgrade_url('listnotupgraded')); - - - $output .= $this->footer(); - return $output; - } - /** * Render the result of an assignment conversion * @param stdClass $assignmentsummary data about the assignment to upgrade. @@ -186,19 +154,17 @@ class tool_assignmentupgrade_renderer extends plugin_renderer_base { */ public function convert_assignment_result($assignmentsummary, $success, $log) { $output = ''; - $output .= $this->header(); - $output .= $this->heading(get_string('conversioncomplete', 'tool_assignmentupgrade')); + $output .= $this->container_start('tool_assignmentupgrade_result'); + $output .= $this->container(get_string('upgradeassignmentsummary', 'tool_assignmentupgrade', $assignmentsummary)); if (!$success) { - $output .= get_string('conversionfailed', 'tool_assignmentupgrade', $log); + $output .= $this->container(get_string('conversionfailed', 'tool_assignmentupgrade', $log)); } else { - $output .= html_writer::link(new moodle_url('/course/view.php', array('id'=>$assignmentsummary->courseid)) ,get_string('viewcourse', 'tool_assignmentupgrade')); + $output .= $this->container(get_string('upgradeassignmentsuccess', 'tool_assignmentupgrade')); + $output .= $this->container(html_writer::link(new moodle_url('/course/view.php', array('id'=>$assignmentsummary->courseid)) ,get_string('viewcourse', 'tool_assignmentupgrade'))); } + $output .= $this->container_end(); - $output .= $this->continue_button(tool_assignmentupgrade_url('listnotupgraded')); - - - $output .= $this->footer(); return $output; } diff --git a/admin/tool/assignmentupgrade/styles.css b/admin/tool/assignmentupgrade/styles.css index 0188dc416eb..277400bded1 100644 --- a/admin/tool/assignmentupgrade/styles.css +++ b/admin/tool/assignmentupgrade/styles.css @@ -8,4 +8,4 @@ #page-admin-tool-assignmentupgrade-listnotupgraded .tool_assignmentupgrade_upgradetable tr.selectedrow td { background-color: #ffeecc; } #page-admin-tool-assignmentupgrade-listnotupgraded .tool_assignmentupgrade_upgradetable tr.unselectedrow td { background-color: white; } - +#page-admin-tool-assignmentupgrade-listnotupgraded .tool_assignmentupgrade_paginationform .hidden { display: none; } diff --git a/admin/tool/assignmentupgrade/upgradableassignmentstable.php b/admin/tool/assignmentupgrade/upgradableassignmentstable.php index 0e4830ba602..307a8c95f61 100644 --- a/admin/tool/assignmentupgrade/upgradableassignmentstable.php +++ b/admin/tool/assignmentupgrade/upgradableassignmentstable.php @@ -70,12 +70,11 @@ class tool_assignmentupgrade_assignments_table extends table_sql implements rend $from = '{assignment} a JOIN {course} c ON a.course = c.id ' . ' LEFT JOIN {assignment_submissions} s ON a.id = s.assignment'; - $where = '1 = 1'; $where .= ' GROUP BY a.id, a.name, a.assignmenttype, c.shortname, c.id '; $this->set_sql($fields, $from, $where, array()); - $this->set_count_sql('SELECT COUNT(*) FROM ' . $from, array()); + $this->set_count_sql('SELECT COUNT(*) FROM {assignment} a JOIN {course} c ON a.course = c.id', array()); $columns = array(); $headers = array(); diff --git a/admin/tool/assignmentupgrade/upgradesingle.php b/admin/tool/assignmentupgrade/upgradesingle.php index 2464ebea56c..5125bbbfa66 100644 --- a/admin/tool/assignmentupgrade/upgradesingle.php +++ b/admin/tool/assignmentupgrade/upgradesingle.php @@ -23,8 +23,8 @@ */ require_once(dirname(__FILE__) . '/../../../config.php'); -require_once(dirname(__FILE__) . '/locallib.php'); require_once($CFG->libdir . '/adminlib.php'); +require_once($CFG->dirroot . '/admin/tool/assignmentupgrade/locallib.php'); require_sesskey(); @@ -36,13 +36,11 @@ admin_externalpage_setup('assignmentupgrade', '', array(), tool_assignmentupgrad $PAGE->navbar->add(get_string('upgradesingle', 'tool_assignmentupgrade')); $renderer = $PAGE->get_renderer('tool_assignmentupgrade'); -$assignmentinfo = tool_assignmentupgrade_get_assignment($assignmentid); -if (!$assignmentinfo) { - print_error('invalidrequest'); - die(); -} - $log = ''; -$result = tool_assignmentupgrade_upgrade_assignment($assignmentinfo, $log); +list($summary, $success, $log) = tool_assignmentupgrade_upgrade_assignment($assignmentid); -echo $renderer->convert_assignment_result($assignmentinfo, $result, $log); +echo $renderer->header(); +echo $renderer->heading(get_string('conversioncomplete', 'tool_assignmentupgrade')); +echo $renderer->convert_assignment_result($summary, $success, $log); +echo $renderer->continue_button(tool_assignmentupgrade_url('listnotupgraded')); +echo $renderer->footer(); diff --git a/admin/tool/assignmentupgrade/upgradesingleconfirm.php b/admin/tool/assignmentupgrade/upgradesingleconfirm.php index 0325b4a09d4..b7ec24c52e9 100644 --- a/admin/tool/assignmentupgrade/upgradesingleconfirm.php +++ b/admin/tool/assignmentupgrade/upgradesingleconfirm.php @@ -23,8 +23,8 @@ */ require_once(dirname(__FILE__) . '/../../../config.php'); -require_once(dirname(__FILE__) . '/locallib.php'); require_once($CFG->libdir . '/adminlib.php'); +require_once($CFG->dirroot . '/admin/tool/assignmentupgrade/locallib.php'); require_sesskey(); diff --git a/admin/tool/bloglevelupgrade/index.php b/admin/tool/bloglevelupgrade/index.php index 9c87eec8227..bd2a5310b37 100644 --- a/admin/tool/bloglevelupgrade/index.php +++ b/admin/tool/bloglevelupgrade/index.php @@ -121,7 +121,7 @@ function bloglevelupgrade_entries($blogentries, $forum, $cm, $groupid=-1) { $discussion->groupid = $groupid; $message = ''; - $discussionid = forum_add_discussion($discussion, null, $message); + $discussionid = forum_add_discussion($discussion, null, $message, $blogentry->userid); // Copy file attachment records $fs = get_file_storage(); diff --git a/admin/tool/unittest/coveragefile.php b/admin/tool/unittest/coveragefile.php index 8c17b60e3eb..d3c8737a4e8 100644 --- a/admin/tool/unittest/coveragefile.php +++ b/admin/tool/unittest/coveragefile.php @@ -60,9 +60,8 @@ if (!isset($args[0]) || !in_array($args[0], $alloweddirs)) { print_error('invalidarguments'); } -// only serve some controlled extensions -$allowedextensions = array('text/html', 'text/css', 'image/gif', 'application/x-javascript'); -if (!in_array(mimeinfo('type', $filepath), $allowedextensions)) { +// only serve some controlled extensions/mimetypes +if (!file_extension_in_typegroup($filepath, array('web_file', 'web_image'), true)) { print_error('invalidarguments'); } diff --git a/auth/shibboleth/index.php b/auth/shibboleth/index.php index 7bc8f90c892..a1e4a1c3840 100644 --- a/auth/shibboleth/index.php +++ b/auth/shibboleth/index.php @@ -30,6 +30,7 @@ /// If we can find the Shibboleth attribute, save it in session and return to main login page if (!empty($_SERVER[$pluginconfig->user_attribute])) { // Shibboleth auto-login + $frm = new stdClass(); $frm->username = strtolower($_SERVER[$pluginconfig->user_attribute]); $frm->password = substr(base64_encode($_SERVER[$pluginconfig->user_attribute]),0,8); // The random password consists of the first 8 letters of the base 64 encoded user ID diff --git a/backup/backupfilesedit_form.php b/backup/backupfilesedit_form.php index 7906a080d1a..36a4030da07 100644 --- a/backup/backupfilesedit_form.php +++ b/backup/backupfilesedit_form.php @@ -27,7 +27,7 @@ class backup_files_edit_form extends moodleform { function definition() { $mform =& $this->_form; $contextid = $this->_customdata['contextid']; - $options = array('subdirs'=>0, 'maxfiles'=>-1, 'accepted_types'=>'*', 'return_types'=>FILE_INTERNAL); + $options = array('subdirs'=>0, 'maxfiles'=>-1, 'accepted_types'=>'*', 'return_types'=>FILE_INTERNAL | FILE_REFERENCE); $mform->addElement('filemanager', 'files_filemanager', get_string('files'), null, $options); $mform->addElement('hidden', 'contextid', $this->_customdata['contextid']); $mform->addElement('hidden', 'currentcontext', $this->_customdata['currentcontext']); diff --git a/backup/moodle2/backup_stepslib.php b/backup/moodle2/backup_stepslib.php index e7b6018cdf3..a2fa9488605 100644 --- a/backup/moodle2/backup_stepslib.php +++ b/backup/moodle2/backup_stepslib.php @@ -1404,7 +1404,7 @@ class backup_final_files_structure_step extends backup_structure_step { 'contenthash', 'contextid', 'component', 'filearea', 'itemid', 'filepath', 'filename', 'userid', 'filesize', 'mimetype', 'status', 'timecreated', 'timemodified', - 'source', 'author', 'license', 'sortorder')); + 'source', 'author', 'license', 'sortorder', 'reference', 'repositoryid')); // Build the tree @@ -1412,9 +1412,12 @@ class backup_final_files_structure_step extends backup_structure_step { // Define sources - $file->set_source_sql("SELECT f.* + $file->set_source_sql("SELECT f.*, r.repositoryid, r.reference FROM {files} f - JOIN {backup_ids_temp} bi ON f.id = bi.itemid + LEFT JOIN {files_reference} r + ON r.id = f.referencefileid + JOIN {backup_ids_temp} bi + ON f.id = bi.itemid WHERE bi.backupid = ? AND bi.itemname = 'filefinal'", array(backup::VAR_BACKUPID)); @@ -1442,6 +1445,8 @@ class backup_main_structure_step extends backup_structure_step { $info['backup_date'] = time(); $info['backup_uniqueid']= $this->get_backupid(); $info['mnet_remoteusers']=backup_controller_dbops::backup_includes_mnet_remote_users($this->get_backupid()); + $info['include_file_references_to_external_content'] = + backup_controller_dbops::backup_includes_file_references($this->get_backupid()); $info['original_wwwroot']=$CFG->wwwroot; $info['original_site_identifier_hash'] = md5(get_site_identifier()); $info['original_course_id'] = $this->get_courseid(); @@ -1461,7 +1466,7 @@ class backup_main_structure_step extends backup_structure_step { $information = new backup_nested_element('information', null, array( 'name', 'moodle_version', 'moodle_release', 'backup_version', - 'backup_release', 'backup_date', 'mnet_remoteusers', 'original_wwwroot', + 'backup_release', 'backup_date', 'mnet_remoteusers', 'include_file_references_to_external_content', 'original_wwwroot', 'original_site_identifier_hash', 'original_course_id', 'original_course_fullname', 'original_course_shortname', 'original_course_startdate', 'original_course_contextid', 'original_system_contextid')); @@ -1584,8 +1589,12 @@ class backup_store_backup_file extends backup_execution_step { // Calculate the zip fullpath (in OS temp area it's always backup.mbz) $zipfile = $basepath . '/backup.mbz'; + $has_file_references = backup_controller_dbops::backup_includes_file_references($this->get_backupid()); // Perform storage and return it (TODO: shouldn't be array but proper result object) - return array('backup_destination' => backup_helper::store_backup_file($this->get_backupid(), $zipfile)); + return array( + 'backup_destination' => backup_helper::store_backup_file($this->get_backupid(), $zipfile), + 'include_file_references_to_external_content' => $has_file_references + ); } } diff --git a/backup/moodle2/backup_xml_transformer.class.php b/backup/moodle2/backup_xml_transformer.class.php index a3770d03528..25c8503bcf7 100644 --- a/backup/moodle2/backup_xml_transformer.class.php +++ b/backup/moodle2/backup_xml_transformer.class.php @@ -27,6 +27,13 @@ defined('MOODLE_INTERNAL') || die(); +// Cache for storing link encoders, so that we don't need to call +// register_link_encoders each time backup_xml_transformer is constructed +// TODO MDL-25290 replace global with MUC code. +global $LINKS_ENCODERS_CACHE; + +$LINKS_ENCODERS_CACHE = array(); + /** * Class implementing the @xml_contenttrasnformed logic to be applied in moodle2 backups * @@ -131,7 +138,19 @@ class backup_xml_transformer extends xml_contenttransformer { return $result; } + /** + * Register all available content link encoders + * + * @return array encoder + * @todo MDL-25290 replace LINKS_ENCODERS_CACHE global with MUC code + */ private function register_link_encoders() { + global $LINKS_ENCODERS_CACHE; + // If encoder is linked, then return cached encoder. + if (!empty($LINKS_ENCODERS_CACHE)) { + return $LINKS_ENCODERS_CACHE; + } + $encoders = array(); // Add the course encoder @@ -160,6 +179,7 @@ class backup_xml_transformer extends xml_contenttransformer { // Add local encodes // TODO: Any interest? 1.9 never had that. + $LINKS_ENCODERS_CACHE = $encoders; return $encoders; } } diff --git a/backup/moodle2/restore_final_task.class.php b/backup/moodle2/restore_final_task.class.php index e8831d71651..377011eef26 100644 --- a/backup/moodle2/restore_final_task.class.php +++ b/backup/moodle2/restore_final_task.class.php @@ -135,6 +135,7 @@ class restore_final_task extends restore_task { $rules[] = new restore_log_rule('course', 'report outline', 'report/outline/index.php?id={course}', '{course}'); $rules[] = new restore_log_rule('course', 'report participation', 'report/participation/index.php?id={course}', '{course}'); $rules[] = new restore_log_rule('course', 'report stats', 'report/stats/index.php?id={course}', '{course}'); + $rules[] = new restore_log_rule('course', 'view section', 'view.php?id={course}§ion={course_sectionnumber}', '{course_section}'); // module 'user' rules $rules[] = new restore_log_rule('user', 'view', 'view.php?id={user}&course={course}', '{user}'); diff --git a/backup/moodle2/restore_stepslib.php b/backup/moodle2/restore_stepslib.php index fda860c9cf1..d87cdb94db9 100644 --- a/backup/moodle2/restore_stepslib.php +++ b/backup/moodle2/restore_stepslib.php @@ -586,11 +586,23 @@ class restore_load_included_files extends restore_structure_step { return array($file); } - // Processing functions go here + /** + * Processing functions go here + * + * @param array $data one file record including repositoryid and reference + */ public function process_file($data) { $data = (object)$data; // handy + $isreference = !empty($data->repositoryid); + $issamesite = $this->task->is_samesite(); + + // If it's not samesite, we skip file refernces + if (!$issamesite && $isreference) { + return; + } + // load it if needed: // - it it is one of the annotated inforef files (course/section/activity/block) // - it is one "user", "group", "grouping", "grade", "question" or "qtype_xxxx" component file (that aren't sent to inforef ever) @@ -601,6 +613,7 @@ class restore_load_included_files extends restore_structure_step { $data->component == 'grouping' || $data->component == 'grade' || $data->component == 'question' || substr($data->component, 0, 5) == 'qtype'); if ($isfileref || $iscomponent) { + // Process files restore_dbops::set_backup_files_record($this->get_restoreid(), $data); } } @@ -1034,6 +1047,7 @@ class restore_section_structure_step extends restore_structure_step { global $CFG, $DB; $data = (object)$data; $oldid = $data->id; // We'll need this later + $oldsection = $data->number; $restorefiles = false; @@ -1086,10 +1100,12 @@ class restore_section_structure_step extends restore_structure_step { $DB->update_record('course_sections', $section); $newitemid = $secrec->id; + $oldsection = $secrec->section; } // Annotate the section mapping, with restorefiles option if needed $this->set_mapping('course_section', $oldid, $newitemid, $restorefiles); + $this->set_mapping('course_sectionnumber', $oldsection, $section->section, $restorefiles); // set the new course_section id in the task $this->task->set_sectionid($newitemid); @@ -2528,7 +2544,7 @@ class restore_module_structure_step extends restore_structure_step { $data = (object)$data; $oldid = $data->id; - + $oldsection = $data->sectionnumber; $this->task->set_old_moduleversion($data->version); $data->course = $this->task->get_courseid(); @@ -2555,6 +2571,7 @@ class restore_module_structure_step extends restore_structure_step { 'course' => $this->get_courseid(), 'section' => 1); $data->section = $DB->insert_record('course_sections', $sectionrec); // section 1 + $this->set_mapping('course_sectionnumber', $oldsection, $sectionrec->section, $restorefiles); } $data->groupingid= $this->get_mappingid('grouping', $data->groupingid); // grouping if (!$CFG->enablegroupmembersonly) { // observe groupsmemberonly diff --git a/backup/util/dbops/backup_controller_dbops.class.php b/backup/util/dbops/backup_controller_dbops.class.php index c77aeb6e4c4..68c17526d2f 100644 --- a/backup/util/dbops/backup_controller_dbops.class.php +++ b/backup/util/dbops/backup_controller_dbops.class.php @@ -409,6 +409,27 @@ abstract class backup_controller_dbops extends backup_dbops { return (int)(bool)$count; } + /** + * Given the backupid, detect if the backup contains references to external contents + * + * @copyright 2012 Dongsheng Cai {@link http://dongsheng.org} + * @return int + */ + public static function backup_includes_file_references($backupid) { + global $CFG, $DB; + + $sql = "SELECT count(r.repositoryid) + FROM {files} f + LEFT JOIN {files_reference} r + ON r.id = f.referencefileid + JOIN {backup_ids_temp} bi + ON f.id = bi.itemid + WHERE bi.backupid = ? + AND bi.itemname = 'filefinal'"; + $count = $DB->count_records_sql($sql, array($backupid)); + return (int)(bool)$count; + } + /** * Given the courseid, return some course related information we want to transport * diff --git a/backup/util/dbops/restore_dbops.class.php b/backup/util/dbops/restore_dbops.class.php index 25f2e533d1c..81dbaf6ea75 100644 --- a/backup/util/dbops/restore_dbops.class.php +++ b/backup/util/dbops/restore_dbops.class.php @@ -28,6 +28,38 @@ * TODO: Finish phpdocs */ abstract class restore_dbops { + /** + * Keep cache of backup records. + * @var array + * @todo MDL-25290 static should be replaced with MUC code. + */ + private static $backupidscache = array(); + /** + * Keep track of backup ids which are cached. + * @var array + * @todo MDL-25290 static should be replaced with MUC code. + */ + private static $backupidsexist = array(); + /** + * Count is expensive, so manually keeping track of + * backupidscache, to avoid memory issues. + * @var int + * @todo MDL-25290 static should be replaced with MUC code. + */ + private static $backupidscachesize = 2048; + /** + * Count is expensive, so manually keeping track of + * backupidsexist, to avoid memory issues. + * @var int + * @todo MDL-25290 static should be replaced with MUC code. + */ + private static $backupidsexistsize = 10240; + /** + * Slice backupids cache to add more data. + * @var int + * @todo MDL-25290 static should be replaced with MUC code. + */ + private static $backupidsslice = 512; /** * Return one array containing all the tasks that have been included @@ -151,6 +183,135 @@ abstract class restore_dbops { return $problems; } + /** + * Return cached backup id's + * + * @param int $restoreid id of backup + * @param string $itemname name of the item + * @param int $itemid id of item + * @return array backup id's + * @todo MDL-25290 replace static backupids* with MUC code + */ + protected static function get_backup_ids_cached($restoreid, $itemname, $itemid) { + global $DB; + + $key = "$itemid $itemname $restoreid"; + + // If record exists in cache then return. + if (isset(self::$backupidsexist[$key]) && isset(self::$backupidscache[$key])) { + // Return a copy of cached data, to avoid any alterations in cached data. + return clone self::$backupidscache[$key]; + } + + // Clean cache, if it's full. + if (self::$backupidscachesize <= 0) { + // Remove some records, to keep memory in limit. + self::$backupidscache = array_slice(self::$backupidscache, self::$backupidsslice, null, true); + self::$backupidscachesize = self::$backupidscachesize + self::$backupidsslice; + } + if (self::$backupidsexistsize <= 0) { + self::$backupidsexist = array_slice(self::$backupidsexist, self::$backupidsslice, null, true); + self::$backupidsexistsize = self::$backupidsexistsize + self::$backupidsslice; + } + + // Retrive record from database. + $record = array( + 'backupid' => $restoreid, + 'itemname' => $itemname, + 'itemid' => $itemid + ); + if ($dbrec = $DB->get_record('backup_ids_temp', $record)) { + self::$backupidsexist[$key] = $dbrec->id; + self::$backupidscache[$key] = $dbrec; + self::$backupidscachesize--; + self::$backupidsexistsize--; + return $dbrec; + } else { + return false; + } + } + + /** + * Cache backup ids' + * + * @param int $restoreid id of backup + * @param string $itemname name of the item + * @param int $itemid id of item + * @param array $extrarecord extra record which needs to be updated + * @return void + * @todo MDL-25290 replace static BACKUP_IDS_* with MUC code + */ + protected static function set_backup_ids_cached($restoreid, $itemname, $itemid, $extrarecord) { + global $DB; + + $key = "$itemid $itemname $restoreid"; + + $record = array( + 'backupid' => $restoreid, + 'itemname' => $itemname, + 'itemid' => $itemid, + ); + + // If record is not cached then add one. + if (!isset(self::$backupidsexist[$key])) { + // If we have this record in db, then just update this. + if ($existingrecord = $DB->get_record('backup_ids_temp', $record)) { + self::$backupidsexist[$key] = $existingrecord->id; + self::$backupidsexistsize--; + self::update_backup_cached_record($record, $extrarecord, $key, $existingrecord); + } else { + // Add new record to cache and db. + $recorddefault = array ( + 'newitemid' => 0, + 'parentitemid' => null, + 'info' => null); + $record = array_merge($record, $recorddefault, $extrarecord); + $record['id'] = $DB->insert_record('backup_ids_temp', $record); + self::$backupidsexist[$key] = $record['id']; + self::$backupidsexistsize--; + if (self::$backupidscachesize > 0) { + // Cache new records if we haven't got many yet. + self::$backupidscache[$key] = (object) $record; + self::$backupidscachesize--; + } + } + } else { + self::update_backup_cached_record($record, $extrarecord, $key); + } + } + + /** + * Updates existing backup record + * + * @param array $record record which needs to be updated + * @param array $extrarecord extra record which needs to be updated + * @param string $key unique key which is used to identify cached record + * @param stdClass $existingrecord (optional) existing record + */ + protected static function update_backup_cached_record($record, $extrarecord, $key, $existingrecord = null) { + global $DB; + // Update only if extrarecord is not empty. + if (!empty($extrarecord)) { + $extrarecord['id'] = self::$backupidsexist[$key]; + $DB->update_record('backup_ids_temp', $extrarecord); + // Update existing cache or add new record to cache. + if (isset(self::$backupidscache[$key])) { + $record = array_merge((array)self::$backupidscache[$key], $extrarecord); + self::$backupidscache[$key] = (object) $record; + } else if (self::$backupidscachesize > 0) { + if ($existingrecord) { + self::$backupidscache[$key] = $existingrecord; + } else { + // Retrive record from database and cache updated records. + self::$backupidscache[$key] = $DB->get_record('backup_ids_temp', $record); + } + $record = array_merge((array)self::$backupidscache[$key], $extrarecord); + self::$backupidscache[$key] = (object) $record; + self::$backupidscachesize--; + } + } + } + /** * Given one role, as loaded from XML, perform the best possible matching against the assignable * roles, using different fallback alternatives (shortname, archetype, editingteacher => teacher, defaultcourseroleid) @@ -685,6 +846,9 @@ abstract class restore_dbops { $rs = $DB->get_recordset_sql($sql, $params); foreach ($rs as $rec) { $file = (object)unserialize(base64_decode($rec->info)); + + $isreference = !empty($file->repositoryid); + // ignore root dirs (they are created automatically) if ($file->filepath == '/' && $file->filename == '.') { continue; @@ -697,10 +861,12 @@ abstract class restore_dbops { $fs->create_directory($newcontextid, $component, $filearea, $rec->newitemid, $file->filepath, $file->userid); continue; } + // arrived here, file found // Find file in backup pool $backuppath = $basepath . backup_file_manager::get_backup_content_file_location($file->contenthash); - if (!file_exists($backuppath)) { + + if (!file_exists($backuppath) && !$isreference) { throw new restore_dbops_exception('file_not_found_in_pool', $file); } if (!$fs->file_exists($newcontextid, $component, $filearea, $rec->newitemid, $file->filepath, $file->filename)) { @@ -717,7 +883,11 @@ abstract class restore_dbops { 'author' => $file->author, 'license' => $file->license, 'sortorder' => $file->sortorder); - $fs->create_file_from_pathname($file_record, $backuppath); + if ($isreference) { + $fs->create_file_from_reference($file_record, $file->repositoryid, $file->reference); + } else { + $fs->create_file_from_pathname($file_record, $backuppath); + } } } $rs->close(); @@ -1204,21 +1374,13 @@ abstract class restore_dbops { public static function set_backup_files_record($restoreid, $filerec) { global $DB; + // Store external files info in `info` field $filerec->info = base64_encode(serialize($filerec)); // Serialize the whole rec in info $filerec->backupid = $restoreid; $DB->insert_record('backup_files_temp', $filerec); } - public static function set_backup_ids_record($restoreid, $itemname, $itemid, $newitemid = 0, $parentitemid = null, $info = null) { - global $DB; - - // Build the basic (mandatory) record info - $record = array( - 'backupid' => $restoreid, - 'itemname' => $itemname, - 'itemid' => $itemid - ); // Build conditionally the extra record info $extrarecord = array(); if ($newitemid != 0) { @@ -1231,34 +1393,16 @@ abstract class restore_dbops { $extrarecord['info'] = base64_encode(serialize($info)); } - // TODO: Analyze if some static (and limited) cache by the 3 params could save us a bunch of get_record() calls - // Note: Sure it will! And also will improve getter - if (!$dbrec = $DB->get_record('backup_ids_temp', $record)) { // Need to insert the complete record - $DB->insert_record('backup_ids_temp', array_merge($record, $extrarecord)); - - } else { // Need to update the extra record info if there is something to - if (!empty($extrarecord)) { - $extrarecord['id'] = $dbrec->id; - $DB->update_record('backup_ids_temp', $extrarecord); - } - } + self::set_backup_ids_cached($restoreid, $itemname, $itemid, $extrarecord); } public static function get_backup_ids_record($restoreid, $itemname, $itemid) { - global $DB; + $dbrec = self::get_backup_ids_cached($restoreid, $itemname, $itemid); - // Build the basic (mandatory) record info to look for - $record = array( - 'backupid' => $restoreid, - 'itemname' => $itemname, - 'itemid' => $itemid - ); - // TODO: Analyze if some static (and limited) cache by the 3 params could save us a bunch of get_record() calls - if ($dbrec = $DB->get_record('backup_ids_temp', $record)) { - if ($dbrec->info != null) { - $dbrec->info = unserialize(base64_decode($dbrec->info)); - } + if ($dbrec && isset($dbrec->info) && is_string($dbrec->info)) { + $dbrec->info = unserialize(base64_decode($dbrec->info)); } + return $dbrec; } diff --git a/backup/util/helper/backup_cron_helper.class.php b/backup/util/helper/backup_cron_helper.class.php index d25c7945634..94a7a873189 100644 --- a/backup/util/helper/backup_cron_helper.class.php +++ b/backup/util/helper/backup_cron_helper.class.php @@ -315,6 +315,7 @@ abstract class backup_cron_automated_helper { */ public static function launch_automated_backup($course, $starttime, $userid) { + $outcome = true; $config = get_config('backup'); $bc = new backup_controller(backup::TYPE_1COURSE, $course->id, backup::FORMAT_MOODLE, backup::INTERACTIVE_NO, backup::MODE_AUTOMATED, $userid); @@ -347,7 +348,7 @@ abstract class backup_cron_automated_helper { $bc->set_status(backup::STATUS_AWAITING); - $outcome = $bc->execute_plan(); + $bc->execute_plan(); $results = $bc->get_results(); $file = $results['backup_destination']; $dir = $config->backup_auto_destination; @@ -363,16 +364,17 @@ abstract class backup_cron_automated_helper { } } - $outcome = true; - } catch (backup_exception $e) { - $bc->log('backup_auto_failed_on_course', backup::LOG_WARNING, $course->shortname); + } catch (moodle_exception $e) { + $bc->log('backup_auto_failed_on_course', backup::LOG_ERROR, $course->shortname); // Log error header. + $bc->log('Exception: ' . $e->errorcode, backup::LOG_ERROR, $e->a, 1); // Log original exception problem. + $bc->log('Debug: ' . $e->debuginfo, backup::LOG_DEBUG, null, 1); // Log original debug information. $outcome = false; } $bc->destroy(); unset($bc); - return true; + return $outcome; } /** diff --git a/backup/util/helper/backup_file_manager.class.php b/backup/util/helper/backup_file_manager.class.php index fb6477a6996..9941af7f4b6 100644 --- a/backup/util/helper/backup_file_manager.class.php +++ b/backup/util/helper/backup_file_manager.class.php @@ -73,6 +73,10 @@ class backup_file_manager { $fs = get_file_storage(); $file = $fs->get_file_instance($filerecorid); + // If the file is external file, skip copying. + if ($file->is_external_file()) { + return; + } // Calculate source and target paths (use same subdirs strategy for both) $targetfilepath = self::get_backup_storage_base_dir($backupid) . '/' . diff --git a/backup/util/helper/backup_general_helper.class.php b/backup/util/helper/backup_general_helper.class.php index 73b5d3b4014..ff5dc89ddd1 100644 --- a/backup/util/helper/backup_general_helper.class.php +++ b/backup/util/helper/backup_general_helper.class.php @@ -145,6 +145,12 @@ abstract class backup_general_helper extends backup_helper { $info->original_course_startdate= $infoarr['original_course_startdate']; $info->original_course_contextid= $infoarr['original_course_contextid']; $info->original_system_contextid= $infoarr['original_system_contextid']; + // Moodle backup file don't have this option before 2.3 + if (!empty($infoarr['include_file_references_to_external_content'])) { + $info->include_file_references_to_external_content = 1; + } else { + $info->include_file_references_to_external_content = 0; + } $info->type = $infoarr['details']['detail'][0]['type']; $info->format = $infoarr['details']['detail'][0]['format']; $info->mode = $infoarr['details']['detail'][0]['mode']; diff --git a/backup/util/helper/convert_helper.class.php b/backup/util/helper/convert_helper.class.php index 8f481dec7f2..e5d21b8fbaf 100644 --- a/backup/util/helper/convert_helper.class.php +++ b/backup/util/helper/convert_helper.class.php @@ -55,12 +55,6 @@ abstract class convert_helper { $converters = array(); - // Only apply for backup converters if the (experimental) setting enables it. - // This will be out once we get proper support of backup converters. MDL-29956 - if (!$restore && empty($CFG->enablebackupconverters)) { - return $converters; - } - $plugins = get_list_of_plugins('backup/converter'); foreach ($plugins as $name) { $filename = $restore ? 'lib.php' : 'backuplib.php'; diff --git a/backup/util/plan/base_plan.class.php b/backup/util/plan/base_plan.class.php index 3ed176b0bbf..eab1869d6d3 100644 --- a/backup/util/plan/base_plan.class.php +++ b/backup/util/plan/base_plan.class.php @@ -61,7 +61,12 @@ abstract class base_plan implements checksumable, executable { // Append task settings to plan array, if not present, for comodity foreach ($task->get_settings() as $key => $setting) { if (!in_array($setting, $this->settings)) { - $this->settings[] = $setting; + $name = $setting->get_name(); + if (!isset($this->settings[$name])) { + $this->settings[$name] = $setting; + } else { + throw new base_plan_exception('multiple_settings_by_name_found', $name); + } } } } @@ -84,23 +89,16 @@ abstract class base_plan implements checksumable, executable { /** * return one setting by name, useful to request root/course settings - * that are, by definition, unique by name. Throws exception if multiple - * are found + * that are, by definition, unique by name. * - * TODO: Change this to string indexed array for quicker lookup. Not critical + * @param string $name name of the setting + * @throws base_plan_exception if setting name is not found. */ public function get_setting($name) { $result = null; - foreach ($this->settings as $key => $setting) { - if ($setting->get_name() == $name) { - if ($result != null) { - throw new base_plan_exception('multiple_settings_by_name_found', $name); - } else { - $result = $setting; - } - } - } - if (!$result) { + if (isset($this->settings[$name])) { + $result = $this->settings[$name]; + } else { throw new base_plan_exception('setting_by_name_not_found', $name); } return $result; diff --git a/backup/util/ui/backup_ui_stage.class.php b/backup/util/ui/backup_ui_stage.class.php index 2cc20455259..799556157e0 100644 --- a/backup/util/ui/backup_ui_stage.class.php +++ b/backup/util/ui/backup_ui_stage.class.php @@ -124,6 +124,8 @@ class backup_ui_stage_initial extends backup_ui_stage { // Store as a variable so we can iterate by reference $tasks = $this->ui->get_tasks(); // Iterate all tasks by reference + $add_settings = array(); + $dependencies = array(); foreach ($tasks as &$task) { // For the initial stage we are only interested in the root settings if ($task instanceof backup_root_task) { @@ -134,17 +136,23 @@ class backup_ui_stage_initial extends backup_ui_stage { if ($setting->get_name() == 'filename') { continue; } - $form->add_setting($setting, $task); + $add_settings[] = array($setting, $task); } // Then add all dependencies foreach ($settings as &$setting) { if ($setting->get_name() == 'filename') { continue; } - $form->add_dependencies($setting); + $dependencies[] = $setting; } } } + // Add all settings at once. + $form->add_settings($add_settings); + // Add dependencies. + foreach ($dependencies as $depsetting) { + $form->add_dependencies($depsetting); + } $this->stageform = $form; } // Return the form @@ -226,6 +234,8 @@ class backup_ui_stage_schema extends backup_ui_stage { $tasks = $this->ui->get_tasks(); $content = ''; $courseheading = false; + $add_settings = array(); + $dependencies = array(); foreach ($tasks as $task) { if (!($task instanceof backup_root_task)) { if (!$courseheading) { @@ -235,11 +245,11 @@ class backup_ui_stage_schema extends backup_ui_stage { } // First add each setting foreach ($task->get_settings() as $setting) { - $form->add_setting($setting, $task); + $add_settings[] = array($setting, $task); } // The add all the dependencies foreach ($task->get_settings() as $setting) { - $form->add_dependencies($setting); + $dependencies[] = $setting; } } else if ($this->ui->enforce_changed_dependencies()) { // Only show these settings if dependencies changed them. @@ -254,6 +264,10 @@ class backup_ui_stage_schema extends backup_ui_stage { } } } + $form->add_settings($add_settings); + foreach ($dependencies as $depsetting) { + $form->add_dependencies($depsetting); + } $this->stageform = $form; } return $this->stageform; @@ -470,6 +484,9 @@ class backup_ui_stage_complete extends backup_ui_stage_final { $output = ''; $output .= $renderer->box_start(); + if (!empty($this->results['include_file_references_to_external_content'])) { + $output .= $renderer->notification(get_string('filereferencesincluded', 'backup'), 'notifyproblem'); + } $output .= $renderer->notification(get_string('executionsuccess', 'backup'), 'notifysuccess'); $output .= $renderer->continue_button($restorerul); $output .= $renderer->box_end(); diff --git a/backup/util/ui/base_moodleform.class.php b/backup/util/ui/base_moodleform.class.php index ad992602083..e0ffc0f9fcf 100644 --- a/backup/util/ui/base_moodleform.class.php +++ b/backup/util/ui/base_moodleform.class.php @@ -136,24 +136,38 @@ abstract class base_moodleform extends moodleform { * @return bool */ function add_setting(backup_setting $setting, base_task $task=null) { + return $this->add_settings(array(array($setting, $task))); + } + /** + * Adds multiple backup_settings as elements to the form + * @param array $settingstasks Consists of array($setting, $task) elements + * @return bool + */ + public function add_settings(array $settingstasks) { global $OUTPUT; - // If the setting cant be changed or isn't visible then add it as a fixed setting. - if (!$setting->get_ui()->is_changeable() || $setting->get_visibility() != backup_setting::VISIBLE) { - return $this->add_fixed_setting($setting, $task); - } + $defaults = array(); + foreach ($settingstasks as $st) { + list($setting, $task) = $st; + // If the setting cant be changed or isn't visible then add it as a fixed setting. + if (!$setting->get_ui()->is_changeable() || $setting->get_visibility() != backup_setting::VISIBLE) { + $this->add_fixed_setting($setting, $task); + continue; + } - // First add the formatting for this setting - $this->add_html_formatting($setting); + // First add the formatting for this setting + $this->add_html_formatting($setting); - // The call the add method with the get_element_properties array - call_user_func_array(array($this->_form, 'addElement'), $setting->get_ui()->get_element_properties($task, $OUTPUT)); - $this->_form->setDefault($setting->get_ui_name(), $setting->get_value()); - if ($setting->has_help()) { - list($identifier, $component) = $setting->get_help(); - $this->_form->addHelpButton($setting->get_ui_name(), $identifier, $component); + // Then call the add method with the get_element_properties array + call_user_func_array(array($this->_form, 'addElement'), $setting->get_ui()->get_element_properties($task, $OUTPUT)); + $defaults[$setting->get_ui_name()] = $setting->get_value(); + if ($setting->has_help()) { + list($identifier, $component) = $setting->get_help(); + $this->_form->addHelpButton($setting->get_ui_name(), $identifier, $component); + } + $this->_form->addElement('html', html_writer::end_tag('div')); } - $this->_form->addElement('html', html_writer::end_tag('div')); + $this->_form->setDefaults($defaults); return true; } /** @@ -317,4 +331,4 @@ abstract class base_moodleform extends moodleform { $this->definition_after_data(); } } -} \ No newline at end of file +} diff --git a/backup/util/ui/renderer.php b/backup/util/ui/renderer.php index 7afcdfd368a..9e0ab9dd4f9 100644 --- a/backup/util/ui/renderer.php +++ b/backup/util/ui/renderer.php @@ -92,6 +92,16 @@ class core_backup_renderer extends plugin_renderer_base { $html .= $this->backup_detail_pair(get_string('originalwwwroot', 'backup'), html_writer::tag('span', $details->original_wwwroot, array('class'=>'originalwwwroot')). html_writer::tag('span', '['.$details->original_site_identifier_hash.']', array('class'=>'sitehash sub-detail'))); + if (!empty($details->include_file_references_to_external_content)) { + $message = ''; + if (backup_general_helper::backup_is_samesite($details)) { + $message = $yestick . ' ' . get_string('filereferencessamesite', 'backup'); + } else { + $message = $notick . ' ' . get_string('filereferencesnotsamesite', 'backup'); + } + $html .= $this->backup_detail_pair(get_string('includefilereferences', 'backup'), $message); + } + $html .= html_writer::end_tag('div'); $html .= html_writer::start_tag('div', array('class'=>'backup-section settings-section')); diff --git a/blocks/activity_modules/block_activity_modules.php b/blocks/activity_modules/block_activity_modules.php index c290b2444f4..2aa257865c9 100644 --- a/blocks/activity_modules/block_activity_modules.php +++ b/blocks/activity_modules/block_activity_modules.php @@ -1,5 +1,8 @@ libdir . '/filelib.php'); + class block_activity_modules extends block_list { function init() { $this->title = get_string('pluginname', 'block_activity_modules'); @@ -50,7 +53,7 @@ class block_activity_modules extends block_list { foreach ($modfullnames as $modname => $modfullname) { if ($modname === 'resources') { - $icon = ' '; + $icon = $OUTPUT->pix_icon(file_extension_icon('.htm'), '', 'moodle', array('class' => 'icon')). ' '; $this->content->items[] = ''.$icon.$modfullname.''; } else { $icon = ' '; diff --git a/blocks/private_files/block_private_files.php b/blocks/private_files/block_private_files.php index 594f27600f5..bf4cc89c10b 100644 --- a/blocks/private_files/block_private_files.php +++ b/blocks/private_files/block_private_files.php @@ -62,7 +62,7 @@ class block_private_files extends block_base { $renderer = $this->page->get_renderer('block_private_files'); $this->content->text = $renderer->private_files_tree(); if (has_capability('moodle/user:manageownfiles', $this->context)) { - $this->content->text .= $OUTPUT->single_button(new moodle_url('/user/filesedit.php', array('returnurl'=>$PAGE->url->out())), get_string('myfilesmanage'), 'get'); + $this->content->text .= $OUTPUT->single_button(new moodle_url('/user/files.php', array('returnurl'=>$PAGE->url->out())), get_string('myfilesmanage'), 'get'); } $this->content->footer = ''; diff --git a/blocks/private_files/edit.php b/blocks/private_files/edit.php index 5a7667bbd76..67b1e70d5bc 100644 --- a/blocks/private_files/edit.php +++ b/blocks/private_files/edit.php @@ -45,7 +45,7 @@ $PAGE->set_pagelayout('mydashboard'); $PAGE->set_pagetype('user-private-files'); $data = new stdClass(); -$options = array('subdirs'=>1, 'maxbytes'=>$CFG->userquota, 'maxfiles'=>-1, 'accepted_types'=>'*', 'return_types'=>FILE_INTERNAL); +$options = array('subdirs'=>1, 'maxbytes'=>$CFG->userquota, 'maxfiles'=>-1, 'accepted_types'=>'*'); file_prepare_standard_filemanager($data, 'files', $options, $context, 'user', 'private', 0); $mform = new block_private_files_form(null, array('data'=>$data, 'options'=>$options)); diff --git a/blocks/private_files/renderer.php b/blocks/private_files/renderer.php index 5c27971e55a..eb109faa1b8 100644 --- a/blocks/private_files/renderer.php +++ b/blocks/private_files/renderer.php @@ -65,14 +65,13 @@ class block_private_files_renderer extends plugin_renderer_base { } $result = ''; diff --git a/blog/index.php b/blog/index.php index 8d28dbcc6f1..77476a98242 100644 --- a/blog/index.php +++ b/blog/index.php @@ -192,6 +192,8 @@ if (!empty($userid)) { if (!blog_user_can_view_user_entry($userid)) { print_error('cannotviewcourseblog', 'blog'); } + + $PAGE->navigation->extend_for_user($user); } } diff --git a/blog/locallib.php b/blog/locallib.php index 9eb1e8fe621..6ac89440782 100644 --- a/blog/locallib.php +++ b/blog/locallib.php @@ -513,10 +513,7 @@ class blog_entry { $ffurl = file_encode_url($CFG->wwwroot.'/pluginfile.php', '/'.SYSCONTEXTID.'/blog/attachment/'.$this->id.'/'.$filename); $mimetype = $file->get_mimetype(); - $icon = mimeinfo_from_type("icon", $mimetype); - $type = mimeinfo_from_type("type", $mimetype); - - $image = $OUTPUT->pix_icon("f/$icon", $filename, 'moodle', array('class'=>'icon')); + $image = $OUTPUT->pix_icon(file_file_icon($file), $filename, 'moodle', array('class'=>'icon')); if ($return == "html") { $output .= html_writer::link($ffurl, $image); @@ -526,7 +523,7 @@ class blog_entry { $output .= "$strattachment $filename:\n$ffurl\n"; } else { - if (in_array($type, array('image/gif', 'image/jpeg', 'image/png'))) { // Image attachments don't get printed as links + if (file_mimetype_in_typegroup($file->get_mimetype(), 'web_image')) { // Image attachments don't get printed as links $imagereturn .= '
'; } else { $imagereturn .= html_writer::link($ffurl, $image); diff --git a/calendar/lib.php b/calendar/lib.php index 16c5f283feb..815299001b5 100644 --- a/calendar/lib.php +++ b/calendar/lib.php @@ -242,7 +242,6 @@ function calendar_get_mini($courses, $groups, $users, $cal_month = false, $cal_y $days_title = calendar_get_days(); $summary = get_string('calendarheading', 'calendar', userdate(make_timestamp($y, $m), get_string('strftimemonthyear'))); - $summary = get_string('tabledata', 'access', $summary); $content .= ''; // Begin table $content .= ''; // Header row: day names @@ -1352,6 +1351,10 @@ function calendar_set_filters(array $courseeventsfrom, $ignorefilters = false) { $user = false; $group = false; + // capabilities that allow seeing group events from all groups + // TODO: rewrite so that moodle/calendar:manageentries is not necessary here + $allgroupscaps = array('moodle/site:accessallgroups', 'moodle/calendar:manageentries'); + $isloggedin = isloggedin(); if ($ignorefilters || calendar_show_event_type(CALENDAR_EVENT_COURSE)) { @@ -1377,26 +1380,35 @@ function calendar_set_filters(array $courseeventsfrom, $ignorefilters = false) { if (!empty($courseeventsfrom) && (calendar_show_event_type(CALENDAR_EVENT_GROUP) || $ignorefilters)) { - if (!empty($CFG->calendar_adminseesall) && has_capability('moodle/calendar:manageentries', get_system_context())) { - $group = true; - } else if ($isloggedin) { - $groupids = array(); - - // We already have the courses to examine in $courses - // For each course... - foreach ($courseeventsfrom as $courseid => $course) { - // If the user is an editing teacher in there, - if (!empty($USER->groupmember[$course->id])) { - // We've already cached the users groups for this course so we can just use that - $groupids = array_merge($groupids, $USER->groupmember[$course->id]); - } else if (($course->groupmode != NOGROUPS || !$course->groupmodeforce) && has_capability('moodle/calendar:manageentries', get_context_instance(CONTEXT_COURSE, $course->id))) { - // If this course has groups, show events from all of them - $coursegroups = groups_get_user_groups($course->id, $USER->id); - $groupids = array_merge($groupids, $coursegroups['0']); - } + if (count($courseeventsfrom)==1) { + $course = reset($courseeventsfrom); + if (has_any_capability($allgroupscaps, get_context_instance(CONTEXT_COURSE, $course->id))) { + $coursegroups = groups_get_all_groups($course->id, 0, 0, 'g.id'); + $group = array_keys($coursegroups); } - if (!empty($groupids)) { - $group = $groupids; + } + if ($group === false) { + if (!empty($CFG->calendar_adminseesall) && has_any_capability($allgroupscaps, get_system_context())) { + $group = true; + } else if ($isloggedin) { + $groupids = array(); + + // We already have the courses to examine in $courses + // For each course... + foreach ($courseeventsfrom as $courseid => $course) { + // If the user is an editing teacher in there, + if (!empty($USER->groupmember[$course->id])) { + // We've already cached the users groups for this course so we can just use that + $groupids = array_merge($groupids, $USER->groupmember[$course->id]); + } else if ($course->groupmode != NOGROUPS || !$course->groupmodeforce) { + // If this course has groups, show events from all of those related to the current user + $coursegroups = groups_get_user_groups($course->id, $USER->id); + $groupids = array_merge($groupids, $coursegroups['0']); + } + } + if (!empty($groupids)) { + $group = $groupids; + } } } } diff --git a/comment/comment.js b/comment/comment.js index dcf669e293e..a16b83a9c78 100644 --- a/comment/comment.js +++ b/comment/comment.js @@ -385,6 +385,9 @@ bodyContent: '
id", get_string('changessaved')); + add_to_log($course->id, 'course', 'completion updated', 'completion.php?id='.$course->id); + + $url = new moodle_url('/course/view.php', array('id' => $course->id)); + redirect($url); } diff --git a/course/dndupload.js b/course/dndupload.js index b0d35a3dc83..9b7c4e4a6fe 100644 --- a/course/dndupload.js +++ b/course/dndupload.js @@ -92,14 +92,12 @@ M.course_dndupload = { this.init_events(el); }, this); - var div = this.add_status_div(); - div.setContent(M.util.get_string('dndworking', 'moodle')); + this.add_status_div(); }, /** * Add a div element to tell the user that drag and drop upload * is available (or to explain why it is not available) - * @return the DOM element to add messages to */ add_status_div: function() { var div = document.createElement('div'); @@ -108,7 +106,34 @@ M.course_dndupload = { if (coursecontents) { coursecontents.insertBefore(div, coursecontents.firstChild); } - return this.Y.one(div); + div = this.Y.one(div); + + var handlefile = (this.handlers.filehandlers.length > 0); + var handletext = false; + var handlelink = false; + var i; + for (i=0; i 0) { + // Fix a Firefox bug which makes sites with a '~' in their wwwroot + // log the user out when clicking on the link (before refreshing the page). + resel.div.innerHTML = unescape(resel.div.innerHTML); + } self.add_editing(result.elementid); } else { // Error - remove the dummy element @@ -813,6 +851,7 @@ M.course_dndupload = { * @param contents the actual data that was dropped * @param section the DOM element representing the selected course section * @param sectionnumber the number of the selected course section + * @param module the module chosen to handle this upload */ upload_item: function(name, type, contents, section, sectionnumber, module) { @@ -846,6 +885,11 @@ M.course_dndupload = { if (result.onclick) { resel.a.onclick = result.onclick; } + if (self.Y.UA.gecko > 0) { + // Fix a Firefox bug which makes sites with a '~' in their wwwroot + // log the user out when clicking on the link (before refreshing the page). + resel.div.innerHTML = unescape(resel.div.innerHTML); + } self.add_editing(result.elementid, sectionnumber); } else { // Error - remove the dummy element diff --git a/course/dnduploadlib.php b/course/dnduploadlib.php index 7c7756cd3a9..c0ed633ac60 100644 --- a/course/dnduploadlib.php +++ b/course/dnduploadlib.php @@ -52,7 +52,13 @@ function dndupload_add_to_course($course, $modnames) { 'fullpath' => new moodle_url('/course/dndupload.js'), 'strings' => array( array('addfilehere', 'moodle'), - array('dndworking', 'moodle'), + array('dndworkingfiletextlink', 'moodle'), + array('dndworkingfilelink', 'moodle'), + array('dndworkingfiletext', 'moodle'), + array('dndworkingfile', 'moodle'), + array('dndworkingtextlink', 'moodle'), + array('dndworkingtext', 'moodle'), + array('dndworkinglink', 'moodle'), array('filetoolarge', 'moodle'), array('actionchoice', 'moodle'), array('servererror', 'moodle'), @@ -103,7 +109,7 @@ class dndupload_handler { // Add some default types to handle. // Note: 'Files' type is hard-coded into the Javascript as this needs to be ... // ... treated a little differently. - $this->add_type('url', array('url', 'text/uri-list'), get_string('addlinkhere', 'moodle'), + $this->add_type('url', array('url', 'text/uri-list', 'text/x-moz-url'), get_string('addlinkhere', 'moodle'), get_string('nameforlink', 'moodle'), 10); $this->add_type('text/html', array('text/html'), get_string('addpagehere', 'moodle'), get_string('nameforpage', 'moodle'), 20); @@ -298,17 +304,21 @@ class dndupload_handler { * @return object Data to pass on to Javascript code */ public function get_js_data() { + global $CFG; + $ret = new stdClass; // Sort the types by priority. uasort($this->types, array($this, 'type_compare')); $ret->types = array(); - foreach ($this->types as $type) { - if (empty($type->handlers)) { - continue; // Skip any types without registered handlers. + if (!empty($CFG->dndallowtextandlinks)) { + foreach ($this->types as $type) { + if (empty($type->handlers)) { + continue; // Skip any types without registered handlers. + } + $ret->types[] = $type; } - $ret->types[] = $type; } $ret->filehandlers = $this->filehandlers; @@ -430,6 +440,10 @@ class dndupload_ajax_processor { if ($content != null) { throw new moodle_exception('fileuploadwithcontent', 'moodle'); } + } else { + if (empty($content)) { + throw new moodle_exception('dnduploadwithoutcontent', 'moodle'); + } } require_sesskey(); @@ -543,7 +557,13 @@ class dndupload_ajax_processor { } // The following are used inside some few core functions, so may as well set them here. $this->cm->coursemodule = $this->cm->id; - $this->cm->groupmodelink = (!$this->course->groupmodeforce); + $groupbuttons = ($this->course->groupmode or (!$this->course->groupmodeforce)); + if ($groupbuttons and plugin_supports('mod', $this->module->name, FEATURE_GROUPS, 0)) { + $this->cm->groupmodelink = (!$this->course->groupmodeforce); + } else { + $this->cm->groupmodelink = false; + $this->cm->groupmode = false; + } } /** @@ -605,6 +625,8 @@ class dndupload_ajax_processor { throw new moodle_exception('errorcreatingactivity', 'moodle', '', $this->module->name); } $mod = $info->cms[$this->cm->id]; + $mod->groupmodelink = $this->cm->groupmodelink; + $mod->groupmode = $this->cm->groupmode; // Trigger mod_created event with information about this module. $eventdata = new stdClass(); @@ -622,12 +644,6 @@ class dndupload_ajax_processor { "view.php?id=$mod->id", "$instanceid", $mod->id); - if ($this->cm->groupmodelink && plugin_supports('mod', $mod->modname, FEATURE_GROUPS, 0)) { - $mod->groupmodelink = $this->cm->groupmodelink; - } else { - $mod->groupmodelink = false; - } - $this->send_response($mod); } diff --git a/course/externallib.php b/course/externallib.php index 98a68d6bf35..d02506f2511 100644 --- a/course/externallib.php +++ b/course/externallib.php @@ -302,8 +302,7 @@ class core_course_external extends external_api { $exceptionparam = new stdClass(); $exceptionparam->message = $e->getMessage(); $exceptionparam->courseid = $course->id; - throw new moodle_exception( - get_string('errorcoursecontextnotvalid', 'webservice', $exceptionparam)); + throw new moodle_exception('errorcoursecontextnotvalid', 'webservice', '', $exceptionparam); } require_capability('moodle/course:view', $context); @@ -519,23 +518,20 @@ class core_course_external extends external_api { $exceptionparam = new stdClass(); $exceptionparam->message = $e->getMessage(); $exceptionparam->catid = $course['categoryid']; - throw new moodle_exception( - get_string('errorcatcontextnotvalid', 'webservice', $exceptionparam)); + throw new moodle_exception('errorcatcontextnotvalid', 'webservice', '', $exceptionparam); } require_capability('moodle/course:create', $context); // Make sure lang is valid if (key_exists('lang', $course) and empty($availablelangs[$course['lang']])) { - throw new moodle_exception( - get_string('errorinvalidparam', 'webservice', 'lang')); + throw new moodle_exception('errorinvalidparam', 'webservice', '', 'lang'); } // Make sure theme is valid if (key_exists('forcetheme', $course)) { if (!empty($CFG->allowcoursethemes)) { if (empty($availablethemes[$course['forcetheme']])) { - throw new moodle_exception( - get_string('errorinvalidparam', 'webservice', 'forcetheme')); + throw new moodle_exception('errorinvalidparam', 'webservice', '', 'forcetheme'); } else { $course['theme'] = $course['forcetheme']; } diff --git a/course/format/renderer.php b/course/format/renderer.php index 45977d452a4..f0dd91f6d8a 100644 --- a/course/format/renderer.php +++ b/course/format/renderer.php @@ -56,6 +56,21 @@ abstract class format_section_renderer_base extends plugin_renderer_base { */ abstract protected function page_title(); + /** + * Generate the section title + * + * @param stdClass $section The course_section entry from DB + * @param stdClass $course The course entry from DB + * @return string HTML to output. + */ + public function section_title($section, $course) { + $title = get_section_name($course, $section); + if ($section->section != 0 && $course->coursedisplay == COURSE_DISPLAY_MULTIPAGE) { + $title = html_writer::link(course_get_url($course, $section->section), $title); + } + return $title; + } + /** * Generate the content to displayed on the right part of a section * before course modules are included @@ -92,7 +107,7 @@ abstract class format_section_renderer_base extends plugin_renderer_base { if ($section->section != 0) { // Only in the non-general sections. - if ($course->marker == $section->section) { + if ($this->is_section_current($section, $course)) { $o = get_accesshide(get_string('currentsection', 'format_'.$course->format)); } } @@ -106,7 +121,7 @@ abstract class format_section_renderer_base extends plugin_renderer_base { * * @param stdClass $section The course_section entry from DB * @param stdClass $course The course entry from DB - * @param bool $onsectionpage true if being printed on a section page + * @param bool $onsectionpage true if being printed on a single-section page * @return string HTML to output. */ protected function section_header($section, $course, $onsectionpage) { @@ -115,16 +130,14 @@ abstract class format_section_renderer_base extends plugin_renderer_base { $o = ''; $currenttext = ''; $sectionstyle = ''; - $linktitle = false; if ($section->section != 0) { // Only in the non-general sections. if (!$section->visible) { $sectionstyle = ' hidden'; - } else if ($course->marker == $section->section) { + } else if ($this->is_section_current($section, $course)) { $sectionstyle = ' current'; } - $linktitle = ($course->coursedisplay == COURSE_DISPLAY_MULTIPAGE); } $o.= html_writer::start_tag('li', array('id' => 'section-'.$section->section, @@ -138,11 +151,7 @@ abstract class format_section_renderer_base extends plugin_renderer_base { $o.= html_writer::start_tag('div', array('class' => 'content')); if (!$onsectionpage) { - $title = get_section_name($course, $section); - if ($linktitle) { - $title = html_writer::link(course_get_url($course, $section->section), $title); - } - $o.= $this->output->heading($title, 3, 'sectionname'); + $o.= $this->output->heading($this->section_title($section, $course), 3, 'sectionname'); } $o.= html_writer::start_tag('div', array('class' => 'summary')); @@ -261,10 +270,15 @@ abstract class format_section_renderer_base extends plugin_renderer_base { * @return string HTML to output. */ protected function section_summary($section, $course) { + // If section is hidden then display grey section link + $classattr = 'section-summary clearfix'; + If (!$section->visible) { + $classattr .= ' dimmed_text'; + } $o = ''; $o.= html_writer::start_tag('li', array('id' => 'section-'.$section->section, - 'class' => 'section-summary clearfix')); + 'class' => $classattr)); $title = get_section_name($course, $section); $o.= html_writer::start_tag('a', array('href' => course_get_url($course, $section->section))); @@ -351,9 +365,13 @@ abstract class format_section_renderer_base extends plugin_renderer_base { $back = $sectionno - 1; while ($back > 0 and empty($links['previous'])) { if ($canviewhidden || $sections[$back]->visible) { + $params = array(); + if (!$sections[$back]->visible) { + $params = array('class' => 'dimmed_text'); + } $previouslink = html_writer::tag('span', $this->output->larrow(), array('class' => 'larrow')); $previouslink .= get_section_name($course, $sections[$back]); - $links['previous'] = html_writer::link(course_get_url($course, $back), $previouslink); + $links['previous'] = html_writer::link(course_get_url($course, $back), $previouslink, $params); } $back--; } @@ -361,9 +379,13 @@ abstract class format_section_renderer_base extends plugin_renderer_base { $forward = $sectionno + 1; while ($forward <= $course->numsections and empty($links['next'])) { if ($canviewhidden || $sections[$forward]->visible) { + $params = array(); + if (!$sections[$forward]->visible) { + $params = array('class' => 'dimmed_text'); + } $nextlink = get_section_name($course, $sections[$forward]); $nextlink .= html_writer::tag('span', $this->output->rarrow(), array('class' => 'rarrow')); - $links['next'] = html_writer::link(course_get_url($course, $forward), $nextlink); + $links['next'] = html_writer::link(course_get_url($course, $forward), $nextlink, $params); } $forward++; } @@ -444,7 +466,6 @@ abstract class format_section_renderer_base extends plugin_renderer_base { echo $this->start_section_list(); echo $this->section_hidden($displaysection); echo $this->end_section_list(); - echo $sectionnavlinks; } // Can't view this section. return; @@ -463,20 +484,24 @@ abstract class format_section_renderer_base extends plugin_renderer_base { echo $this->end_section_list(); } + // Start single-section div + echo html_writer::start_tag('div', array('class' => 'single-section')); + // Title with section navigation links. $sectionnavlinks = $this->get_nav_links($course, $sections, $displaysection); $sectiontitle = ''; - $sectiontitle .= html_writer::start_tag('div', array('class' => 'section-navigation headingblock header')); + $sectiontitle .= html_writer::start_tag('div', array('class' => 'section-navigation header headingblock')); $sectiontitle .= html_writer::tag('span', $sectionnavlinks['previous'], array('class' => 'mdl-left')); $sectiontitle .= html_writer::tag('span', $sectionnavlinks['next'], array('class' => 'mdl-right')); - $sectiontitle .= html_writer::tag('div', get_section_name($course, $sections[$displaysection]), array('class' => 'mdl-align')); + // Title attributes + $titleattr = 'mdl-align title'; + if (!$sections[$displaysection]->visible) { + $titleattr .= ' dimmed_text'; + } + $sectiontitle .= html_writer::tag('div', get_section_name($course, $sections[$displaysection]), array('class' => $titleattr)); $sectiontitle .= html_writer::end_tag('div'); echo $sectiontitle; - // Show completion help icon. - $completioninfo = new completion_info($course); - echo $completioninfo->display_help_icon(); - // Copy activity clipboard.. echo $this->course_activity_clipboard($course, $displaysection); @@ -486,7 +511,11 @@ abstract class format_section_renderer_base extends plugin_renderer_base { // The requested section page. $thissection = $sections[$displaysection]; echo $this->section_header($thissection, $course, true); - print_section($course, $thissection, $mods, $modnamesused, true); + // Show completion help icon. + $completioninfo = new completion_info($course); + echo $completioninfo->display_help_icon(); + + print_section($course, $thissection, $mods, $modnamesused, true, '100%', false, true); if ($PAGE->user_is_editing()) { print_section_add_menus($course, $displaysection, $modnames); } @@ -502,6 +531,9 @@ abstract class format_section_renderer_base extends plugin_renderer_base { $sectionbottomnav .= html_writer::tag('div', $courselink, array('class' => 'mdl-align')); $sectionbottomnav .= html_writer::end_tag('div'); echo $sectionbottomnav; + + // close single-section div. + echo html_writer::end_tag('div'); } /** @@ -552,6 +584,8 @@ abstract class format_section_renderer_base extends plugin_renderer_base { // a section_info object - we will need at least the uservisible // field in it. $thissection->uservisible = true; + $thissection->availableinfo = null; + $thissection->showavailability = 0; } // Show the section if the user is permitted to access it, OR if it's not available // but showavailability is turned on @@ -599,7 +633,7 @@ abstract class format_section_renderer_base extends plugin_renderer_base { echo $this->end_section_list(); - echo html_writer::start_tag('div', array('class' => 'mdl-right')); + echo html_writer::start_tag('div', array('id' => 'changenumsections', 'class' => 'mdl-right')); // Increase number of sections. $straddsection = get_string('increasesections', 'moodle'); @@ -644,4 +678,16 @@ abstract class format_section_renderer_base extends plugin_renderer_base { $options->overflowdiv = true; return format_text($summarytext, $section->summaryformat, $options); } + + /** + * Is the section passed in the current section? (Note this isn't strictly + * a renderering method, but neater here). + * + * @param stdClass $course The course entry from DB + * @param stdClass $section The course_section entry from the DB + * @return bool true if the section is current + */ + protected function is_section_current($section, $course) { + return ($course->marker == $section->section); + } } diff --git a/course/format/topics/format.js b/course/format/topics/format.js index 85aec6d42fc..71e87972308 100644 --- a/course/format/topics/format.js +++ b/course/format/topics/format.js @@ -1,17 +1,28 @@ -// Javascript functions for course format +// Javascript functions for Topics course format M.course = M.course || {}; M.course.format = M.course.format || {}; /** - * Get section list for this format + * Get sections config for this format * - * @param {YUI} Y YUI3 instance - * @return {string} section list selector + * The section structure is: + *
    + *
  • ...
  • + *
  • ...
  • + * ... + *
+ * + * @return {object} section list configuration */ -M.course.format.get_section_selector = function(Y) { - return 'li.section'; +M.course.format.get_config = function() { + return { + container_node : 'ul', + container_class : 'topics', + section_node : 'li', + section_class : 'section' + }; } /** @@ -25,13 +36,32 @@ M.course.format.get_section_selector = function(Y) { M.course.format.swap_sections = function(Y, node1, node2) { var CSS = { COURSECONTENT : 'course-content', - LEFT : 'left', SECTIONADDMENUS : 'section_add_menus' }; var sectionlist = Y.Node.all('.'+CSS.COURSECONTENT+' '+M.course.format.get_section_selector(Y)); - // Swap left block - sectionlist.item(node1).one('.'+CSS.LEFT).swap(sectionlist.item(node2).one('.'+CSS.LEFT)); // Swap menus sectionlist.item(node1).one('.'+CSS.SECTIONADDMENUS).swap(sectionlist.item(node2).one('.'+CSS.SECTIONADDMENUS)); } + +/** + * Process sections after ajax response + * + * @param {YUI} Y YUI3 instance + * @param {array} response ajax response + * @param {string} sectionfrom first affected section + * @param {string} sectionto last affected section + * @return void + */ +M.course.format.process_sections = function(Y, sectionlist, response, sectionfrom, sectionto) { + var CSS = { + SECTIONNAME : 'sectionname' + }; + + if (response.action == 'move') { + // update titles in all affected sections + for (var i = sectionfrom; i <= sectionto; i++) { + sectionlist.item(i).one('.'+CSS.SECTIONNAME).setContent(response.sectiontitles[i]); + } + } +} diff --git a/course/format/topics/lib.php b/course/format/topics/lib.php index 710abaf318e..e8632fcab8b 100644 --- a/course/format/topics/lib.php +++ b/course/format/topics/lib.php @@ -80,3 +80,24 @@ function callback_topics_ajax_support() { $ajaxsupport->testedbrowsers = array('MSIE' => 6.0, 'Gecko' => 20061111, 'Safari' => 531, 'Chrome' => 6.0); return $ajaxsupport; } + +/** + * Callback function to do some action after section move + * + * @param stdClass $course The course entry from DB + * @return array This will be passed in ajax respose. + */ +function callback_topics_ajax_section_move($course) { + global $COURSE, $PAGE; + + $titles = array(); + rebuild_course_cache($course->id); + $modinfo = get_fast_modinfo($COURSE); + $renderer = $PAGE->get_renderer('format_topics'); + if ($renderer && ($sections = $modinfo->get_section_info_all())) { + foreach ($sections as $number => $section) { + $titles[$number] = $renderer->section_title($section, $course); + } + } + return array('sectiontitles' => $titles, 'action' => 'move'); +} diff --git a/course/format/topics/renderer.php b/course/format/topics/renderer.php index 7050488c5b1..5ef126f5987 100644 --- a/course/format/topics/renderer.php +++ b/course/format/topics/renderer.php @@ -102,23 +102,4 @@ class format_topics_renderer extends format_section_renderer_base { return array_merge($controls, parent::section_edit_controls($course, $section, $onsectionpage)); } - - /** - * Generate the content to displayed on the left part of a section - * - * before course modules are included - * @param stdClass $section The course_section entry from DB - * @param stdClass $course The course entry from DB - * @param bool $onsectionpage true if being printed on a section page - * @return string HTML to output. - */ - protected function section_left_content($section, $course, $onsectionpage) { - $o = parent::section_left_content($section, $course, $onsectionpage); - - if ($section->section > 0) { - $o.= $section->section; - } - - return $o; - } } diff --git a/course/format/weeks/format.js b/course/format/weeks/format.js index 78c20631b70..f410e07d357 100644 --- a/course/format/weeks/format.js +++ b/course/format/weeks/format.js @@ -1,17 +1,28 @@ -// Javascript functions for course format +// Javascript functions for Weeks course format M.course = M.course || {}; M.course.format = M.course.format || {}; /** - * Get section list for this format + * Get sections config for this format * - * @param {YUI} Y YUI3 instance - * @return {string} section list selector + * The section structure is: + *
    + *
  • ...
  • + *
  • ...
  • + * ... + *
+ * + * @return {object} section list configuration */ -M.course.format.get_section_selector = function(Y) { - return 'li.section'; +M.course.format.get_config = function() { + return { + container_node : 'ul', + container_class : 'weeks', + section_node : 'li', + section_class : 'section' + }; } /** @@ -25,16 +36,32 @@ M.course.format.get_section_selector = function(Y) { M.course.format.swap_sections = function(Y, node1, node2) { var CSS = { COURSECONTENT : 'course-content', - LEFT : 'left', SECTIONADDMENUS : 'section_add_menus', - WEEKDATES: 'weekdates' }; var sectionlist = Y.Node.all('.'+CSS.COURSECONTENT+' '+M.course.format.get_section_selector(Y)); - // Swap left block - sectionlist.item(node1).one('.'+CSS.LEFT).swap(sectionlist.item(node2).one('.'+CSS.LEFT)); // Swap menus sectionlist.item(node1).one('.'+CSS.SECTIONADDMENUS).swap(sectionlist.item(node2).one('.'+CSS.SECTIONADDMENUS)); - // Swap week dates - sectionlist.item(node1).one('.'+CSS.WEEKDATES).swap(sectionlist.item(node2).one('.'+CSS.WEEKDATES)); +} + +/** + * Process sections after ajax response + * + * @param {YUI} Y YUI3 instance + * @param {array} response ajax response + * @param {string} sectionfrom first affected section + * @param {string} sectionto last affected section + * @return void + */ +M.course.format.process_sections = function(Y, sectionlist, response, sectionfrom, sectionto) { + var CSS = { + SECTIONNAME : 'sectionname' + }; + + if (response.action == 'move') { + // update titles in all affected sections + for (var i = sectionfrom; i <= sectionto; i++) { + sectionlist.item(i).one('.'+CSS.SECTIONNAME).setContent(response.sectiontitles[i]); + } + } } diff --git a/course/format/weeks/lib.php b/course/format/weeks/lib.php index 9201c9e2d6f..a1e1ea9cd16 100644 --- a/course/format/weeks/lib.php +++ b/course/format/weeks/lib.php @@ -67,25 +67,20 @@ function callback_weeks_definition() { function callback_weeks_get_section_name($course, $section) { // We can't add a node without text if (!empty($section->name)) { - // Return the name the user set - return format_string($section->name, true, array('context' => get_context_instance(CONTEXT_COURSE, $course->id))); + // Return the name the user set. + return format_string($section->name, true, array('context' => context_course::instance($course->id))); } else if ($section->section == 0) { - // Return the section0name + // Return the general section. return get_string('section0name', 'format_weeks'); } else { - // Got to work out the date of the week so that we can show it - $sections = get_all_sections($course->id); - $weekdate = $course->startdate+7200; - foreach ($sections as $sec) { - if ($sec->id == $section->id) { - break; - } else if ($sec->section != 0) { - $weekdate += 604800; - } - } - $strftimedateshort = ' '.get_string('strftimedateshort'); - $weekday = userdate($weekdate, $strftimedateshort); - $endweekday = userdate($weekdate+518400, $strftimedateshort); + $dates = format_weeks_get_section_dates($section, $course); + + // We subtract 24 hours for display purposes. + $dates->end = ($dates->end - 86400); + + $dateformat = ' '.get_string('strftimedateshort'); + $weekday = userdate($dates->start, $dateformat); + $endweekday = userdate($dates->end, $dateformat); return $weekday.' - '.$endweekday; } } @@ -102,3 +97,44 @@ function callback_weeks_ajax_support() { $ajaxsupport->testedbrowsers = array('MSIE' => 6.0, 'Gecko' => 20061111, 'Safari' => 531, 'Chrome' => 6.0); return $ajaxsupport; } + +/** + * Return the start and end date of the passed section + * + * @param stdClass $section The course_section entry from the DB + * @param stdClass $course The course entry from DB + * @return stdClass property start for startdate, property end for enddate + */ +function format_weeks_get_section_dates($section, $course) { + $oneweekseconds = 604800; + // Hack alert. We add 2 hours to avoid possible DST problems. (e.g. we go into daylight + // savings and the date changes. + $startdate = $course->startdate + 7200; + + $dates = new stdClass(); + $dates->start = $startdate + ($oneweekseconds * ($section->section - 1)); + $dates->end = $dates->start + $oneweekseconds; + + return $dates; +} + +/** + * Callback function to do some action after section move + * + * @param stdClass $course The course entry from DB + * @return array This will be passed in ajax respose. + */ +function callback_weeks_ajax_section_move($course) { + global $COURSE, $PAGE; + + $titles = array(); + rebuild_course_cache($course->id); + $modinfo = get_fast_modinfo($COURSE); + $renderer = $PAGE->get_renderer('format_weeks'); + if ($renderer && ($sections = $modinfo->get_section_info_all())) { + foreach ($sections as $number => $section) { + $titles[$number] = $renderer->section_title($section, $course); + } + } + return array('sectiontitles' => $titles, 'action' => 'move'); +} diff --git a/course/format/weeks/renderer.php b/course/format/weeks/renderer.php index 33d640281b6..e87936ccbf5 100644 --- a/course/format/weeks/renderer.php +++ b/course/format/weeks/renderer.php @@ -26,6 +26,7 @@ defined('MOODLE_INTERNAL') || die(); require_once($CFG->dirroot.'/course/format/renderer.php'); +require_once($CFG->dirroot.'/course/format/weeks/lib.php'); /** @@ -58,4 +59,22 @@ class format_weeks_renderer extends format_section_renderer_base { protected function page_title() { return get_string('weeklyoutline'); } + + /** + * Is the section passed in the current section? + * + * @param stdClass $section The course_section entry from the DB + * @param stdClass $course The course entry from DB + * @return bool true if the section is current + */ + protected function is_section_current($section, $course) { + if ($section->section < 1) { + return false; + } + + $timenow = time(); + $dates = format_weeks_get_section_dates($section, $course); + + return (($timenow >= $dates->start) && ($timenow < $dates->end)); + } } diff --git a/course/lib.php b/course/lib.php index 9a64052c153..a5566d6a6bc 100644 --- a/course/lib.php +++ b/course/lib.php @@ -1518,13 +1518,6 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false, //Accessibility: for files get description via icon, this is very ugly hack! $altname = ''; $altname = $mod->modfullname; - if (!empty($customicon)) { - $archetype = plugin_supports('mod', $mod->modname, FEATURE_MOD_ARCHETYPE, MOD_ARCHETYPE_OTHER); - if ($archetype == MOD_ARCHETYPE_RESOURCE) { - $mimetype = mimeinfo_from_icon('type', $customicon); - $altname = get_mimetype_description($mimetype); - } - } // Avoid unnecessary duplication: if e.g. a forum name already // includes the word forum (or Forum, etc) then it is unhelpful // to include that in the accessible description that is added. @@ -1735,7 +1728,7 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false, // see the activity itself, or for staff) if (!$mod->uservisible) { echo '
'.$mod->availableinfo.'
'; - } else if ($canviewhidden && !empty($CFG->enableavailability)) { + } else if ($canviewhidden && !empty($CFG->enableavailability) && $mod->visible) { $ci = new condition_info($mod); $fullinfo = $ci->get_full_information(); if($fullinfo) { @@ -3002,6 +2995,8 @@ function move_section($course, $section, $move) { } $n++; } + // After moving section, rebuild course cache. + rebuild_course_cache($course->id, true); return true; } diff --git a/course/recent.php b/course/recent.php index f33ef54c617..8b31e29835f 100644 --- a/course/recent.php +++ b/course/recent.php @@ -221,7 +221,9 @@ if (!empty($activities)) { echo $OUTPUT->spacer(array('height'=>30, 'br'=>true)); // should be done with CSS instead } echo $OUTPUT->box_start(); - echo "

$activity->name

"; + if (!empty($activity->name)) { + echo html_writer::tag('h2', $activity->name); + } $inbox = true; } else if ($activity->type == 'activity') { @@ -230,16 +232,17 @@ if (!empty($activities)) { $cm = $modinfo->cms[$activity->cmid]; if ($cm->visible) { - $linkformat = ''; + $class = ''; } else { - $linkformat = 'class="dimmed"'; + $class = 'dimmed'; } $name = format_string($cm->name); $modfullname = $modnames[$cm->modname]; - $image = "pix_url('icon', $cm->modname) . "\" class=\"icon\" alt=\"$modfullname\" />"; - echo "

$image $modfullname". - " wwwroot/mod/$cm->modname/view.php?id=$cm->id\" $linkformat>$name

"; + $image = $OUTPUT->pix_icon('icon', $modfullname, $cm->modname, array('class' => 'icon smallicon')); + $link = html_writer::link(new moodle_url("/mod/$cm->modname/view.php", + array("id" => $cm->id)), $name, array('class' => $class)); + echo html_writer::tag('h3', "$image $modfullname $link"); } } else { @@ -269,7 +272,7 @@ if (!empty($activities)) { } else { - echo '

' . get_string('norecentactivity') . '

'; + echo html_writer::tag('h3', get_string('norecentactivity'), array('class' => 'mdl-align')); } diff --git a/course/rest.php b/course/rest.php index 5152563ad92..6efd228db65 100644 --- a/course/rest.php +++ b/course/rest.php @@ -89,6 +89,15 @@ switch($requestmethod) { case 'move': move_section_to($course, $id, $value); + // See if format wants to do something about it + $libfile = $CFG->dirroot.'/course/format/'.$course->format.'/lib.php'; + $functionname = 'callback_'.$course->format.'_ajax_section_move'; + if (!function_exists($functionname) && file_exists($libfile)) { + require_once $libfile; + } + if (function_exists($functionname)) { + echo json_encode($functionname($course)); + } break; } rebuild_course_cache($course->id); diff --git a/course/view.php b/course/view.php index a7b1784b1c5..de3798102d2 100644 --- a/course/view.php +++ b/course/view.php @@ -88,8 +88,18 @@ require_once($CFG->dirroot.'/calendar/lib.php'); /// This is after login because it needs $USER - //TODO: danp do we need different urls? - add_to_log($course->id, 'course', 'view', "view.php?id=$course->id", "$course->id"); + $logparam = 'id='. $course->id; + $loglabel = 'view'; + $infoid = $course->id; + if(!empty($section)) { + $logparam .= '§ion='. $section; + $loglabel = 'view section'; + $sectionparams = array('course' => $course->id, 'section' => $section); + if ($coursesections = $DB->get_record('course_sections', $sectionparams, 'id', MUST_EXIST)) { + $infoid = $coursesections->id; + } + } + add_to_log($course->id, 'course', $loglabel, "view.php?". $logparam, $infoid); $course->format = clean_param($course->format, PARAM_ALPHA); if (!file_exists($CFG->dirroot.'/course/format/'.$course->format.'/format.php')) { diff --git a/course/yui/coursebase/coursebase.js b/course/yui/coursebase/coursebase.js index 713ad709d95..b02c36263c0 100644 --- a/course/yui/coursebase/coursebase.js +++ b/course/yui/coursebase/coursebase.js @@ -52,6 +52,171 @@ YUI.add('moodle-course-coursebase', function(Y) { // Ensure that M.course exists and that coursebase is initialised correctly M.course = M.course || {}; M.course.coursebase = M.course.coursebase || new COURSEBASE(); + + // Abstract functions that needs to be defined per format (course/format/somename/format.js) + M.course.format = M.course.format || {} + + /** + * Swap section (should be defined in format.js if requred) + * + * @param {YUI} Y YUI3 instance + * @param {string} node1 node to swap to + * @param {string} node2 node to swap with + * @return {NodeList} section list + */ + M.course.format.swap_sections = M.course.format.swap_sections || function(Y, node1, node2) { + return null; + } + + /** + * Process sections after ajax response (should be defined in format.js) + * If some response is expected, we pass it over to format, as it knows better + * hot to process it. + * + * @param {YUI} Y YUI3 instance + * @param {NodeList} list of sections + * @param {array} response ajax response + * @param {string} sectionfrom first affected section + * @param {string} sectionto last affected section + * @return void + */ + M.course.format.process_sections = M.course.format.process_sections || function(Y, sectionlist, response, sectionfrom, sectionto) { + return null; + } + + /** + * Get sections config for this format, for examples see function definition + * in the formats. + * + * @return {object} section list configuration + */ + M.course.format.get_config = M.course.format.get_config || function() { + return { + container_node : null, // compulsory + container_class : null, // compulsory + section_wrapper_node : null, // optional + section_wrapper_class : null, // optional + section_node : null, // compulsory + section_class : null // compulsory + } + } + + /** + * Get section list for this format (usually items inside container_node.container_class selector) + * + * @param {YUI} Y YUI3 instance + * @return {string} section selector + */ + M.course.format.get_section_selector = M.course.format.get_section_selector || function(Y) { + var config = M.course.format.get_config(); + if (config.section_node && config.section_class) { + return config.section_node + '.' + config.section_class; + } + console.log('section_node and section_class are not defined in M.course.format.get_config'); + return null; + } + + /** + * Get section wraper for this format (only used in case when each + * container_node.container_class node is wrapped in some other element). + * + * @param {YUI} Y YUI3 instance + * @return {string} section wrapper selector or M.course.format.get_section_selector + * if section_wrapper_node and section_wrapper_class are not defined in the format config. + */ + M.course.format.get_section_wrapper = M.course.format.get_section_wrapper || function(Y) { + var config = M.course.format.get_config(); + if (config.section_wrapper_node && config.section_wrapper_class) { + return config.section_wrapper_node + '.' + config.section_wrapper_class; + } + return M.course.format.get_section_selector(Y); + } + + /** + * Get the tag of container node + * + * @return {string} tag of container node. + */ + M.course.format.get_containernode = M.course.format.get_containernode || function() { + var config = M.course.format.get_config(); + if (config.container_node) { + return config.container_node; + } else { + console.log('container_node is not defined in M.course.format.get_config'); + } + } + + /** + * Get the class of container node + * + * @return {string} class of the container node. + */ + M.course.format.get_containerclass = M.course.format.get_containerclass || function() { + var config = M.course.format.get_config(); + if (config.container_class) { + return config.container_class; + } else { + console.log('container_class is not defined in M.course.format.get_config'); + } + } + + /** + * Get the tag of draggable node (section wrapper if exists, otherwise section) + * + * @return {string} tag of the draggable node. + */ + M.course.format.get_sectionwrappernode = M.course.format.get_sectionwrappernode || function() { + var config = M.course.format.get_config(); + if (config.section_wrapper_node) { + return config.section_wrapper_node; + } else { + return config.section_node; + } + } + + /** + * Get the class of draggable node (section wrapper if exists, otherwise section) + * + * @return {string} class of the draggable node. + */ + M.course.format.get_sectionwrapperclass = M.course.format.get_sectionwrapperclass || function() { + var config = M.course.format.get_config(); + if (config.section_wrapper_class) { + return config.section_wrapper_class; + } else { + return config.section_class; + } + } + + /** + * Get the tag of section node + * + * @return {string} tag of section node. + */ + M.course.format.get_sectionnode = M.course.format.get_sectionnode || function() { + var config = M.course.format.get_config(); + if (config.section_node) { + return config.section_node; + } else { + console.log('section_node is not defined in M.course.format.get_config'); + } + } + + /** + * Get the class of section node + * + * @return {string} class of the section node. + */ + M.course.format.get_sectionclass = M.course.format.get_sectionclass || function() { + var config = M.course.format.get_config(); + if (config.section_class) { + return config.section_class; + } else { + console.log('section_class is not defined in M.course.format.get_config'); + } + + } + }, '@VERSION@', { requires : ['base', 'node'] diff --git a/course/yui/dragdrop/dragdrop.js b/course/yui/dragdrop/dragdrop.js index c3ed979443b..080cace768d 100644 --- a/course/yui/dragdrop/dragdrop.js +++ b/course/yui/dragdrop/dragdrop.js @@ -17,9 +17,7 @@ YUI.add('moodle-course-dragdrop', function(Y) { SECTION : 'section', SECTIONADDMENUS : 'section_add_menus', SECTIONHANDLE : 'section-handle', - SUMMARY : 'summary', - TOPICS : 'topics', - WEEKDATES: 'weekdates' + SUMMARY : 'summary' }; var DRAGSECTION = function() { @@ -31,16 +29,17 @@ YUI.add('moodle-course-dragdrop', function(Y) { initializer : function(params) { // Set group for parent class this.groups = ['section']; - this.samenodeclass = CSS.SECTION; - this.parentnodeclass = CSS.TOPICS; + this.samenodeclass = M.course.format.get_sectionwrapperclass(); + this.parentnodeclass = M.course.format.get_containerclass(); // Check if we are in single section mode if (Y.Node.one('.'+CSS.JUMPMENU)) { return false; } // Initialise sections dragging - if (M.course.format && M.course.format.get_section_selector && typeof(M.course.format.get_section_selector) == 'function') { - this.sectionlistselector = '.'+CSS.COURSECONTENT+' '+M.course.format.get_section_selector(Y); + this.sectionlistselector = M.course.format.get_section_wrapper(Y); + if (this.sectionlistselector) { + this.sectionlistselector = '.'+CSS.COURSECONTENT+' '+this.sectionlistselector; this.setup_for_section(this.sectionlistselector); } }, @@ -109,17 +108,24 @@ YUI.add('moodle-course-dragdrop', function(Y) { // Get our drag object var drag = e.target; // Creat a dummy structure of the outer elemnents for clean styles application - var ul = Y.Node.create(''); - ul.addClass(CSS.TOPICS); - var li = Y.Node.create('
  • '); - li.addClass(CSS.SECTION); - li.setStyle('margin', 0); - li.setContent(drag.get('node').get('innerHTML')); - ul.appendChild(li); - drag.get('dragNode').setContent(ul); + var containernode = Y.Node.create('<'+M.course.format.get_containernode()+'>'); + containernode.addClass(M.course.format.get_containerclass()); + var sectionnode = Y.Node.create('<'+ M.course.format.get_sectionwrappernode()+'>'); + sectionnode.addClass( M.course.format.get_sectionwrapperclass()); + sectionnode.setStyle('margin', 0); + sectionnode.setContent(drag.get('node').get('innerHTML')); + containernode.appendChild(sectionnode); + drag.get('dragNode').setContent(containernode); drag.get('dragNode').addClass(CSS.COURSECONTENT); }, + drag_dropmiss : function(e) { + // Missed the target, but we assume the user intended to drop it + // on the last last ghost node location, e.drag and e.drop should be + // prepared by global_drag_dropmiss parent so simulate drop_hit(e). + this.drop_hit(e); + }, + drop_hit : function(e) { var drag = e.drag; // Get a reference to our drag node @@ -173,9 +179,16 @@ YUI.add('moodle-course-dragdrop', function(Y) { lightbox.show(); }, success: function(tid, response) { - window.setTimeout(function(e) { - lightbox.hide(); - }, 250); + // Update section titles, we can't simply swap them as + // they might have custom title + try { + var responsetext = Y.JSON.parse(response.responseText); + if (responsetext.error) { + new M.core.ajaxException(responsetext); + } + M.course.format.process_sections(Y, sectionlist, responsetext, loopstart, loopend); + } catch (e) {} + // Classic bubble sort algorithm is applied to the section // nodes between original drag node location and the new one. do { @@ -186,16 +199,19 @@ YUI.add('moodle-course-dragdrop', function(Y) { var sectionid = sectionlist.item(i-1).get('id'); sectionlist.item(i-1).set('id', sectionlist.item(i).get('id')); sectionlist.item(i).set('id', sectionid); - // See what format needs to be swapped - if (M.course.format && M.course.format.swap_sections && typeof(M.course.format.swap_sections) == 'function') { - M.course.format.swap_sections(Y, i-1, i); - } + // See what format needs to swap + M.course.format.swap_sections(Y, i-1, i); // Update flag swapped = true; } } loopend = loopend - 1; } while (swapped); + + // Finally, hide the lightbox + window.setTimeout(function(e) { + lightbox.hide(); + }, 250); }, failure: function(tid, response) { this.ajax_failure(response); @@ -232,8 +248,9 @@ YUI.add('moodle-course-dragdrop', function(Y) { this.parentnodeclass = CSS.SECTION; // Go through all sections - if (M.course.format && M.course.format.get_section_selector && typeof(M.course.format.get_section_selector) == 'function') { - var sectionlistselector = '.'+CSS.COURSECONTENT+' '+M.course.format.get_section_selector(Y); + var sectionlistselector = M.course.format.get_section_selector(Y); + if (sectionlistselector) { + sectionlistselector = '.'+CSS.COURSECONTENT+' '+sectionlistselector; this.setup_for_section(sectionlistselector); M.course.coursebase.register_module(this); M.course.dragres = this; @@ -263,7 +280,7 @@ YUI.add('moodle-course-dragdrop', function(Y) { padding: '20 0 20 0' }); // Go through each li element and make them draggable - this.setup_for_resource('li#'+sectionnode.get('id')+' li.'+CSS.ACTIVITY); + this.setup_for_resource('#'+sectionnode.get('id')+' li.'+CSS.ACTIVITY); }, this); }, /** @@ -311,14 +328,19 @@ YUI.add('moodle-course-dragdrop', function(Y) { drag.get('dragNode').all('img.iconsmall').setStyle('vertical-align', 'baseline'); }, + drag_dropmiss : function(e) { + // Missed the target, but we assume the user intended to drop it + // on the last last ghost node location, e.drag and e.drop should be + // prepared by global_drag_dropmiss parent so simulate drop_hit(e). + this.drop_hit(e); + }, + drop_hit : function(e) { var drag = e.drag; // Get a reference to our drag node var dragnode = drag.get('node'); var dropnode = e.drop.get('node'); - var sectionselector = M.course.format.get_section_selector(Y); - // Add spinner if it not there var spinner = M.util.add_spinner(Y, dragnode.one(CSS.COMMANDSPAN)); @@ -336,7 +358,7 @@ YUI.add('moodle-course-dragdrop', function(Y) { params['class'] = 'resource'; params.field = 'move'; params.id = Number(this.get_resource_id(dragnode)); - params.sectionId = this.get_section_id(dropnode.ancestor(sectionselector)); + params.sectionId = this.get_section_id(dropnode.ancestor(M.course.format.get_section_wrapper(Y), true)); if (dragnode.next()) { params.beforeId = Number(this.get_resource_id(dragnode.next())); diff --git a/course/yui/toolboxes/toolboxes.js b/course/yui/toolboxes/toolboxes.js index 6dfcce0bd7d..024785ebf4b 100644 --- a/course/yui/toolboxes/toolboxes.js +++ b/course/yui/toolboxes/toolboxes.js @@ -28,7 +28,7 @@ YUI.add('moodle-course-toolboxes', function(Y) { MOVELEFTCLASS : 'editing_moveleft', MOVERIGHT : 'a.editing_moveright', PAGECONTENT : 'div#page-content', - RIGHTDIV : 'div.right', + RIGHTSIDE : '.right', SECTIONHIDDENCLASS : 'hidden', SECTIONIDPREFIX : 'section-', SECTIONLI : 'li.section', @@ -384,7 +384,7 @@ YUI.add('moodle-course-toolboxes', function(Y) { e.preventDefault(); // Return early if the current section is hidden - var section = e.target.ancestor(CSS.SECTIONLI); + var section = e.target.ancestor(M.course.format.get_section_selector(Y)); if (section && section.hasClass(CSS.SECTIONHIDDENCLASS)) { return; } @@ -649,17 +649,17 @@ YUI.add('moodle-course-toolboxes', function(Y) { }, _setup_for_section : function(toolboxtarget) { // Section Highlighting - this.replace_button(toolboxtarget, CSS.RIGHTDIV + ' ' + CSS.HIGHLIGHT, this.toggle_highlight); + this.replace_button(toolboxtarget, CSS.RIGHTSIDE + ' ' + CSS.HIGHLIGHT, this.toggle_highlight); // Section Visibility - this.replace_button(toolboxtarget, CSS.RIGHTDIV + ' ' + CSS.SHOWHIDE, this.toggle_hide_section); + this.replace_button(toolboxtarget, CSS.RIGHTSIDE + ' ' + CSS.SHOWHIDE, this.toggle_hide_section); }, toggle_hide_section : function(e) { // Prevent the default button action e.preventDefault(); // Get the section we're working on - var section = e.target.ancestor(CSS.SECTIONLI); + var section = e.target.ancestor(M.course.format.get_section_selector(Y)); var button = e.target.ancestor('a', true); var hideicon = button.one('img'); @@ -691,7 +691,7 @@ YUI.add('moodle-course-toolboxes', function(Y) { var data = { 'class' : 'section', 'field' : 'visible', - 'id' : this.get_section_id(section), + 'id' : this.get_section_id(section.ancestor(M.course.format.get_section_wrapper(Y), true)), 'value' : value }; @@ -725,7 +725,7 @@ YUI.add('moodle-course-toolboxes', function(Y) { e.preventDefault(); // Get the section we're working on - var section = e.target.ancestor(CSS.SECTIONLI); + var section = e.target.ancestor(M.course.format.get_section_selector(Y)); var button = e.target.ancestor('a', true); var buttonicon = button.one('img'); @@ -736,22 +736,22 @@ YUI.add('moodle-course-toolboxes', function(Y) { // Set the current highlighted item text var old_string = M.util.get_string('markthistopic', 'moodle'); Y.one(CSS.PAGECONTENT) - .all(CSS.SECTIONLI + '.current ' + CSS.HIGHLIGHT) + .all(M.course.format.get_section_selector(Y) + '.current ' + CSS.HIGHLIGHT) .set('title', old_string); Y.one(CSS.PAGECONTENT) - .all(CSS.SECTIONLI + '.current ' + CSS.HIGHLIGHT + ' img') + .all(M.course.format.get_section_selector(Y) + '.current ' + CSS.HIGHLIGHT + ' img') .set('title', old_string) .set('alt', old_string) .set('src', M.util.image_url('i/marker')); // Remove the highlighting from all sections - var allsections = Y.one(CSS.PAGECONTENT).all(CSS.SECTIONLI) + var allsections = Y.one(CSS.PAGECONTENT).all(M.course.format.get_section_selector(Y)) .removeClass('current'); // Then add it if required to the selected section if (!togglestatus) { section.addClass('current'); - value = this.get_section_id(section); + value = this.get_section_id(section.ancestor(M.course.format.get_section_wrapper(Y), true)); var new_string = M.util.get_string('markedthistopic', 'moodle'); button .set('title', new_string); diff --git a/draftfile.php b/draftfile.php index baeceaf7af7..ede57069134 100644 --- a/draftfile.php +++ b/draftfile.php @@ -36,6 +36,7 @@ if (isguestuser()) { } $relativepath = get_file_argument(); +$preview = optional_param('preview', null, PARAM_ALPHANUM); // relative path must start with '/' if (!$relativepath) { @@ -84,4 +85,4 @@ if (!$file = $fs->get_file_by_hash(sha1($fullpath)) or $file->get_filename() == // finally send the file // ======================================== session_get_instance()->write_close(); // unlock session during fileserving -send_stored_file($file, 0, false, true); // force download - security first! +send_stored_file($file, 0, false, true, array('preview' => $preview)); // force download - security first! diff --git a/enrol/externallib.php b/enrol/externallib.php index 57b6ac13efd..08438e18b77 100644 --- a/enrol/externallib.php +++ b/enrol/externallib.php @@ -207,7 +207,7 @@ class core_enrol_external extends external_api { $exceptionparam = new stdClass(); $exceptionparam->message = $e->getMessage(); $exceptionparam->courseid = $params['courseid']; - throw new moodle_exception(get_string('errorcoursecontextnotvalid' , 'webservice', $exceptionparam)); + throw new moodle_exception('errorcoursecontextnotvalid' , 'webservice', '', $exceptionparam); } if ($courseid == SITEID) { @@ -543,7 +543,7 @@ class moodle_enrol_external extends external_api { $exceptionparam = new stdClass(); $exceptionparam->message = $e->getMessage(); $exceptionparam->courseid = $params['courseid']; - throw new moodle_exception(get_string('errorcoursecontextnotvalid' , 'webservice', $exceptionparam)); + throw new moodle_exception('errorcoursecontextnotvalid' , 'webservice', '', $exceptionparam); } if ($courseid == SITEID) { diff --git a/enrol/mnet/enrol.php b/enrol/mnet/enrol.php index 7a0a0af5a63..c09cd7e4601 100644 --- a/enrol/mnet/enrol.php +++ b/enrol/mnet/enrol.php @@ -145,6 +145,7 @@ class enrol_mnet_mnetservice_enrol { // users {@link http://tracker.moodle.org/browse/MDL-21327} $user = mnet_strip_user((object)$userdata, mnet_fields_to_import($client)); $user->mnethostid = $client->id; + $user->auth = 'mnet'; try { $user->id = $DB->insert_record('user', $user); } catch (Exception $e) { diff --git a/files/coursefilesedit_form.php b/files/coursefilesedit_form.php index e5498dcec18..fadd387413d 100644 --- a/files/coursefilesedit_form.php +++ b/files/coursefilesedit_form.php @@ -21,7 +21,7 @@ class coursefiles_edit_form extends moodleform { function definition() { $mform =& $this->_form; $contextid = $this->_customdata['contextid']; - $options = array('subdirs'=>1, 'maxfiles'=>-1, 'accepted_types'=>'*', 'return_types'=>FILE_INTERNAL); + $options = array('subdirs'=>1, 'maxfiles'=>-1, 'accepted_types'=>'*'); $mform->addElement('filemanager', 'files_filemanager', '', null, $options); $mform->addElement('hidden', 'contextid', $this->_customdata['contextid']); $this->set_data($this->_customdata['data']); diff --git a/files/filebrowser_ajax.php b/files/filebrowser_ajax.php index 2d651e95765..a8b638b5c54 100644 --- a/files/filebrowser_ajax.php +++ b/files/filebrowser_ajax.php @@ -70,10 +70,10 @@ switch ($action) { if ($child->is_directory()) { $fileitem['isdir'] = true; $fileitem['url'] = $url->out(false); - $fileitem['icon'] = $OUTPUT->pix_icon('f/folder', get_string('icon')); + $fileitem['icon'] = $OUTPUT->pix_icon(file_folder_icon(), get_string('icon')); } else { $fileitem['url'] = $child->get_url(); - $fileitem['icon'] = $OUTPUT->pix_icon('f/'.mimeinfo('icon', $child->get_visible_name()), get_string('icon')); + $fileitem['icon'] = $OUTPUT->pix_icon(file_file_icon($child), get_string('icon')); } $tree[] = $fileitem; } diff --git a/files/renderer.php b/files/renderer.php index 15971636267..3728a23443c 100644 --- a/files/renderer.php +++ b/files/renderer.php @@ -56,25 +56,31 @@ class core_files_renderer extends plugin_renderer_base { $html .= $this->output->box_start(); $table = new html_table(); - $table->head = array(get_string('filename', 'backup'), get_string('size'), get_string('modified')); - $table->align = array('left', 'right', 'right'); + $table->head = array(get_string('name'), get_string('lastmodified'), get_string('size', 'repository'), get_string('type', 'repository')); + $table->align = array('left', 'left', 'left', 'left'); $table->width = '100%'; $table->data = array(); foreach ($tree->tree as $file) { - if (!empty($file['isdir'])) { - $table->data[] = array( - html_writer::link($file['url'], $this->output->pix_icon('f/folder', 'icon') . ' ' . $file['filename']), - '', - $file['filedate'], - ); - } else { - $table->data[] = array( - html_writer::link($file['url'], $this->output->pix_icon('f/'.mimeinfo('icon', $file['filename']), get_string('icon')) . ' ' . $file['filename']), - $file['filesize'], - $file['filedate'], - ); + $filedate = $filesize = $filetype = ''; + if ($file['filedate']) { + $filedate = userdate($file['filedate'], get_string('strftimedatetimeshort', 'langconfig')); } + if (empty($file['isdir'])) { + if ($file['filesize']) { + $filesize = display_size($file['filesize']); + } + $fileicon = file_file_icon($file, 24); + $filetype = get_mimetype_description($file); + } else { + $fileicon = file_folder_icon(24); + } + $table->data[] = array( + html_writer::link($file['url'], $this->output->pix_icon($fileicon, get_string('icon')) . ' ' . $file['filename']), + $filedate, + $filesize, + $filetype + ); } $html .= html_writer::table($table); @@ -82,8 +88,818 @@ class core_files_renderer extends plugin_renderer_base { $html .= $this->output->box_end(); return $html; } -} + /** + * Prints the file manager and initializes all necessary libraries + * + *
    +     * $fm = new form_filemanager($options);
    +     * $output = get_renderer('core', 'files');
    +     * echo $output->render($fm);
    +     * 
    + * + * @param form_filemanager $fm File manager to render + * @return string HTML fragment + */ + public function render_form_filemanager($fm) { + static $filemanagertemplateloaded; + $html = $this->fm_print_generallayout($fm); + $module = array( + 'name'=>'form_filemanager', + 'fullpath'=>'/lib/form/filemanager.js', + 'requires' => array('core_filepicker', 'base', 'io-base', 'node', 'json', 'core_dndupload', 'panel', 'resize-plugin', 'dd-plugin'), + 'strings' => array( + array('error', 'moodle'), array('info', 'moodle'), array('confirmdeletefile', 'repository'), + array('draftareanofiles', 'repository'), array('entername', 'repository'), array('enternewname', 'repository'), + array('invalidjson', 'repository'), array('popupblockeddownload', 'repository'), + array('unknownoriginal', 'repository'), array('confirmdeletefolder', 'repository'), + array('confirmdeletefilewithhref', 'repository'), array('confirmrenamefolder', 'repository'), + array('confirmrenamefile', 'repository') + ) + ); + if (empty($filemanagertemplateloaded)) { + $filemanagertemplateloaded = true; + $this->page->requires->js_init_call('M.form_filemanager.set_templates', + array($this->filemanager_js_templates()), true, $module); + } + $this->page->requires->js_init_call('M.form_filemanager.init', array($fm->options), true, $module); + + // non javascript file manager + $html .= ''; + + + return $html; + } + + /** + * Returns html for displaying one file manager + * + * The main element in HTML must have id="filemanager-{$client_id}" and + * class="filemanager fm-loading"; + * After all necessary code on the page (both html and javascript) is loaded, + * the class fm-loading will be removed and added class fm-loaded; + * The main element (class=filemanager) will be assigned the following classes: + * 'fm-maxfiles' - when filemanager has maximum allowed number of files; + * 'fm-nofiles' - when filemanager has no files at all (although there might be folders); + * 'fm-noitems' - when current view (folder) has no items - neither files nor folders; + * 'fm-updating' - when current view is being updated (usually means that loading icon is to be displayed); + * 'fm-nomkdir' - when 'Make folder' action is unavailable (empty($fm->options->subdirs) == true) + * + * Element with class 'filemanager-container' will be holding evens for dnd upload (dragover, etc.). + * It will have class: + * 'dndupload-ready' - when a file is being dragged over the browser + * 'dndupload-over' - when file is being dragged over this filepicker (additional to 'dndupload-ready') + * 'dndupload-uploading' - during the upload process (note that after dnd upload process is + * over, the file manager will refresh the files list and therefore will have for a while class + * fm-updating. Both waiting processes should look similar so the images don't jump for user) + * + * If browser supports Drag-and-drop, the body element will have class 'dndsupported', + * otherwise - 'dndnotsupported'; + * + * Element with class 'fp-content' will be populated with files list; + * Element with class 'fp-btn-add' will hold onclick event for adding a file (opening filepicker); + * Element with class 'fp-btn-mkdir' will hold onclick event for adding new folder; + * Element with class 'fp-btn-download' will hold onclick event for download action; + * + * Element with class 'fp-path-folder' is a template for one folder in path toolbar. + * It will hold mouse click event and will be assigned classes first/last/even/odd respectfully. + * Parent element will receive class 'empty' when there are no folders to be displayed; + * The content of subelement with class 'fp-path-folder-name' will be substituted with folder name; + * + * Element with class 'fp-viewbar' will have the class 'enabled' or 'disabled' when view mode + * can be changed or not; + * Inside element with class 'fp-viewbar' there are expected elements with classes + * 'fp-vb-icons', 'fp-vb-tree' and 'fp-vb-details'. They will handle onclick events to switch + * between the view modes, the last clicked element will have the class 'checked'; + * + * @param form_filemanager $fm + * @return string + */ + private function fm_print_generallayout($fm) { + global $OUTPUT; + $options = $fm->options; + $client_id = $options->client_id; + $straddfile = get_string('addfile', 'repository'); + $strmakedir = get_string('makeafolder', 'moodle'); + $strdownload = get_string('downloadfolder', 'repository'); + $strloading = get_string('loading', 'repository'); + $strdroptoupload = get_string('droptoupload', 'moodle'); + $icon_progress = $OUTPUT->pix_icon('i/loading_small', $strloading).''; + $restrictions = $this->fm_print_restrictions($fm); + $strdndenabled = get_string('dndenabled_insentence', 'moodle').$OUTPUT->help_icon('dndenabled'); + $strdndenabledinbox = get_string('dndenabled_inbox', 'moodle'); + $loading = get_string('loading', 'repository'); + + $html = ' +
    +
    + '.$restrictions.' + - '.$strdndenabled.' +
    +
    + +
    + +
    +
    +
    '.$icon_progress.'
    +
    +
    +
    +
    + '.$strdndenabledinbox.'
    +
    +
    '.$strdroptoupload.'
    +
    '.$icon_progress.'
    +
    +
    '.$icon_progress.'
    +
    +
    '; + return preg_replace('/\{\!\}/', '', $html); + } + + /** + * FileManager JS template for displaying one file in 'icon view' mode. + * + * Except for elements described in fp_js_template_iconfilename, this template may also + * contain element with class 'fp-contextmenu'. If context menu is available for this + * file, the top element will receive the additional class 'fp-hascontextmenu' and + * the element with class 'fp-contextmenu' will hold onclick event for displaying + * the context menu. + * + * @see fp_js_template_iconfilename() + * @return string + */ + private function fm_js_template_iconfilename() { + $rv = ' +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    + '.$this->pix_icon('i/menu', '▶').' +
    '; + return preg_replace('/\{\!\}/', '', $rv); + } + + /** + * FileManager JS template for displaying file name in 'table view' and 'tree view' modes. + * + * Except for elements described in fp_js_template_listfilename, this template may also + * contain element with class 'fp-contextmenu'. If context menu is available for this + * file, the top element will receive the additional class 'fp-hascontextmenu' and + * the element with class 'fp-contextmenu' will hold onclick event for displaying + * the context menu. + * + * @todo MDL-32736 remove onclick="return false;" + * @see fp_js_template_listfilename() + * @return string + */ + private function fm_js_template_listfilename() { + $rv = ' + + + + + + '.$this->pix_icon('i/menu', '▶').' +'; + return preg_replace('/\{\!\}/', '', $rv); + } + + /** + * FileManager JS template for displaying 'Make new folder' dialog. + * + * Must be wrapped in an element, CSS for this element must define width and height of the window; + * + * Must have one input element with type="text" (for users to enter the new folder name); + * + * content of element with class 'fp-dlg-curpath' will be replaced with current path where + * new folder is about to be created; + * elements with classes 'fp-dlg-butcreate' and 'fp-dlg-butcancel' will hold onclick events; + * + * @return string + */ + private function fm_js_template_mkdir() { + $rv = ' +
    +

    New folder name:

    +
    + '.get_string('create').' + '.get_string('cancel').' +
    '; + return preg_replace('/\{\!\}/', '', $rv); + } + + /** + * FileManager JS template for error/info message displayed as a separate popup window. + * + * @see fp_js_template_message() + * @return string + */ + private function fm_js_template_message() { + return $this->fp_js_template_message(); + } + + /** + * FileManager JS template for window with file information/actions. + * + * All content must be enclosed in one element, CSS for this class must define width and + * height of the window; + * + * Thumbnail image will be added as content to the element with class 'fp-thumbnail'; + * + * Inside the window the elements with the following classnames must be present: + * 'fp-saveas', 'fp-author', 'fp-license', 'fp-path'. Inside each of them must be + * one input element (or select in case of fp-license and fp-path). They may also have labels. + * The elements will be assign with class 'uneditable' and input/select element will become + * disabled if they are not applicable for the particular file; + * + * There may be present elements with classes 'fp-original', 'fp-datemodified', 'fp-datecreated', + * 'fp-size', 'fp-dimensions', 'fp-reflist'. They will receive additional class 'fp-unknown' if + * information is unavailable. If there is information available, the content of embedded + * element with class 'fp-value' will be substituted with the value; + * + * The value of Original ('fp-original') is loaded in separate request. When it is applicable + * but not yet loaded the 'fp-original' element receives additional class 'fp-loading'; + * + * The value of 'Aliases/Shortcuts' ('fp-reflist') is also loaded in separate request. When it + * is applicable but not yet loaded the 'fp-original' element receives additional class + * 'fp-loading'. The string explaining that XX references exist will replace content of element + * 'fp-refcount'. Inside '.fp-reflist .fp-value' each reference will be enclosed in
  • ; + * + * Elements with classes 'fp-file-update', 'fp-file-download', 'fp-file-delete', 'fp-file-zip', + * 'fp-file-unzip', 'fp-file-setmain' and 'fp-file-cancel' will hold corresponding onclick + * events (there may be several elements with class 'fp-file-cancel'); + * + * When confirm button is pressed and file is being selected, the top element receives + * additional class 'loading'. It is removed when response from server is received. + * + * When any of the input fields is changed, the top element receives class 'fp-changed'; + * When current file can be set as main - top element receives class 'fp-cansetmain'; + * When current file is folder/zip/file - top element receives respectfully class + * 'fp-folder'/'fp-zip'/'fp-file'; + * + * @return string + */ + private function fm_js_template_fileselectlayout() { + $strloading = get_string('loading', 'repository'); + $icon_progress = $this->pix_icon('i/loading_small', $strloading).''; + $rv = ' +
  • + + + + + + + + + + + + +
    :
    :
    :
    :
    :'.$icon_progress.' '.$strloading.'
    :

    '.$icon_progress.' '.$strloading.'

      + +

      +
      +

      + '.get_string('update', 'moodle').' + '.get_string('cancel').' +

      +
      +
      +
      '.get_string('lastmodified', 'moodle').':
      +
      '.get_string('datecreated', 'repository').':
      +
      '.get_string('size', 'repository').':
      +
      '.get_string('dimensions', 'repository').':
      +
      +'; + return preg_replace('/\{\!\}/', '', $rv); + } + + /** + * FileManager JS template for popup confirm dialogue window. + * + * Must have one top element, CSS for this element must define width and height of the window; + * + * content of element with class 'fp-dlg-text' will be replaced with dialog text; + * elements with classes 'fp-dlg-butconfirm' and 'fp-dlg-butcancel' will + * hold onclick events; + * + * @return string + */ + private function fm_js_template_confirmdialog() { + $rv = ' +
      +
      + '.get_string('ok').' + '.get_string('cancel').' +
      '; + return preg_replace('/\{\!\}/', '', $rv); + } + + /** + * Returns all FileManager JavaScript templates as an array. + * + * @return array + */ + public function filemanager_js_templates() { + $class_methods = get_class_methods($this); + $templates = array(); + foreach ($class_methods as $method_name) { + if (preg_match('/^fm_js_template_(.*)$/', $method_name, $matches)) + $templates[$matches[1]] = $this->$method_name(); + } + return $templates; + } + + /** + * Displays restrictions for the file manager + * + * @param form_filemanager $fm + * @return string + */ + private function fm_print_restrictions($fm) { + $maxbytes = display_size($fm->options->maxbytes); + if (empty($options->maxfiles) || $options->maxfiles == -1) { + $maxsize = get_string('maxfilesize', 'moodle', $maxbytes); + //$string['maxfilesize'] = 'Maximum size for new files: {$a}'; + } else { + $strparam = (object)array('size' => $maxbytes, 'attachments' => $options->maxfiles); + $maxsize = get_string('maxsizeandattachments', 'moodle', $strparam); + //$string['maxsizeandattachments'] = 'Maximum size for new files: {$a->size}, maximum attachments: {$a->attachments}'; + } + // TODO MDL-32020 also should say about 'File types accepted' + return ''. $maxsize. ''; + } + + /** + * Template for FilePicker with general layout (not QuickUpload). + * + * Must have one top element containing everything else (recommended
      ), + * CSS for this element must define width and height of the filepicker window. Or CSS must + * define min-width, max-width, min-height and max-height and in this case the filepicker + * window will be resizeable; + * + * Element with class 'fp-viewbar' will have the class 'enabled' or 'disabled' when view mode + * can be changed or not; + * Inside element with class 'fp-viewbar' there are expected elements with classes + * 'fp-vb-icons', 'fp-vb-tree' and 'fp-vb-details'. They will handle onclick events to switch + * between the view modes, the last clicked element will have the class 'checked'; + * + * Element with class 'fp-repo' is a template for displaying one repository. Other repositories + * will be attached as siblings (classes first/last/even/odd will be added respectfully). + * The currently selected repostory will have class 'active'. Contents of element with class + * 'fp-repo-name' will be replaced with repository name, source of image with class + * 'fp-repo-icon' will be replaced with repository icon; + * + * Element with class 'fp-content' is obligatory and will hold the current contents; + * + * Element with class 'fp-paging' will contain page navigation (will be deprecated soon); + * + * Element with class 'fp-path-folder' is a template for one folder in path toolbar. + * It will hold mouse click event and will be assigned classes first/last/even/odd respectfully. + * Parent element will receive class 'empty' when there are no folders to be displayed; + * The content of subelement with class 'fp-path-folder-name' will be substituted with folder name; + * + * Element with class 'fp-toolbar' will have class 'empty' if all 'Back', 'Search', 'Refresh', + * 'Logout', 'Manage' and 'Help' are unavailable for this repo; + * + * Inside fp-toolbar there are expected elements with classes fp-tb-back, fp-tb-search, + * fp-tb-refresh, fp-tb-logout, fp-tb-manage and fp-tb-help. Each of them will have + * class 'enabled' or 'disabled' if particular repository has this functionality. + * Element with class 'fp-tb-search' must contain empty form inside, it's contents will + * be substituted with the search form returned by repository (in the most cases it + * is generated with template core_repository_renderer::repository_default_searchform); + * Other elements must have either or
      + + '; + return preg_replace('/\{\!\}/', '', $rv); + } + + /** + * FilePicker JS template to display during loading process (inside element with class 'fp-content'). + * + * @return string + */ + private function fp_js_template_loading() { + return ' +
      +
      + +

      '.get_string('loading', 'repository').'

      +
      +
      '; + } + + /** + * FilePicker JS template for error (inside element with class 'fp-content'). + * + * must have element with class 'fp-error', its content will be replaced with error text + * and the error code will be assigned as additional class to this element + * used errors: invalidjson, nofilesavailable, norepositoriesavailable + * + * @return string + */ + private function fp_js_template_error() { + $rv = ' +
      '; + return preg_replace('/\{\!\}/', '', $rv); + } + + /** + * FilePicker JS template for error/info message displayed as a separate popup window. + * + * Must be wrapped in one element, CSS for this element must define + * width and height of the window. It will be assigned with an additional class 'fp-msg-error' + * or 'fp-msg-info' depending on message type; + * + * content of element with class 'fp-msg-text' will be replaced with error/info text; + * + * element with class 'fp-msg-butok' will hold onclick event + * + * @return string + */ + private function fp_js_template_message() { + $rv = ' +
      +

      + '.get_string('ok').' +
      '; + return preg_replace('/\{\!\}/', '', $rv); + } + + /** + * FilePicker JS template for popup dialogue window asking for action when file with the same name already exists. + * + * Must have one top element, CSS for this element must define width and height of the window; + * + * content of element with class 'fp-dlg-text' will be replaced with dialog text; + * elements with classes 'fp-dlg-butoverwrite', 'fp-dlg-butrename' and 'fp-dlg-butcancel' will + * hold onclick events; + * + * content of element with class 'fp-dlg-butrename' will be substituted with appropriate string + * (Note that it may have long text) + * + * @return string + */ + private function fp_js_template_processexistingfile() { + $rv = ' +
      +

      + '.get_string('overwrite', 'repository').' + '.get_string('cancel').' + +
      '; + return preg_replace('/\{\!\}/', '', $rv); + } + + /** + * FilePicker JS template for repository login form including templates for each element type + * + * Must contain one
      element with templates for different input types inside: + * Elements with classes 'fp-login-popup', 'fp-login-textarea', 'fp-login-select' and + * 'fp-login-input' are templates for displaying respective login form elements. Inside + * there must be exactly one element with type

      +
      +
      +'; + return preg_replace('/\{\!\}/', '', $rv); + } + + /** + * Returns all FilePicker JavaScript templates as an array. + * + * @return array + */ + public function filepicker_js_templates() { + $class_methods = get_class_methods($this); + $templates = array(); + foreach ($class_methods as $method_name) { + if (preg_match('/^fp_js_template_(.*)$/', $method_name, $matches)) + $templates[$matches[1]] = $this->$method_name(); + } + return $templates; + } + + /** + * Returns HTML for default repository searchform to be passed to Filepicker + * + * This will be used as contents for search form defined in generallayout template + * (form with id {TOOLSEARCHID}). + * Default contents is one text input field with name="s" + */ + public function repository_default_searchform() { + $str = ''; + return $str; + } +} /** * Data structure representing a general moodle file tree viewer @@ -148,8 +964,9 @@ class files_tree_viewer implements renderable { $fileitem = array( 'params' => $params, 'filename' => $child->get_visible_name(), - 'filedate' => $filedate ? userdate($filedate) : '', - 'filesize' => $filesize ? display_size($filesize) : '' + 'mimetype' => $child->get_mimetype(), + 'filedate' => $filedate ? $filedate : '', + 'filesize' => $filesize ? $filesize : '' ); $url = new moodle_url('/files/index.php', $params); if ($child->is_directory()) { diff --git a/filter/glossary/yui/autolinker/autolinker.js b/filter/glossary/yui/autolinker/autolinker.js index 46d04bca80f..e9af017e0ad 100644 --- a/filter/glossary/yui/autolinker/autolinker.js +++ b/filter/glossary/yui/autolinker/autolinker.js @@ -70,7 +70,8 @@ YUI.add('moodle-filter_glossary-autolinker', function(Y) { this.overlay.hide(); //hide progress indicator for (key in data.entries) { - new M.core.alert({title:data.entries[key].concept, message:data.entries[key].definition, lightbox:false}); + definition = data.entries[key].definition + data.entries[key].attachments + new M.core.alert({title:data.entries[key].concept, message:definition, lightbox:false}); } return true; diff --git a/grade/lib.php b/grade/lib.php index 185fed52039..9d1bda94983 100644 --- a/grade/lib.php +++ b/grade/lib.php @@ -32,16 +32,56 @@ require_once $CFG->libdir.'/gradelib.php'; * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class graded_users_iterator { - public $course; - public $grade_items; - public $groupid; - public $users_rs; - public $grades_rs; - public $gradestack; - public $sortfield1; - public $sortorder1; - public $sortfield2; - public $sortorder2; + + /** + * The couse whose users we are interested in + */ + protected $course; + + /** + * An array of grade items or null if only user data was requested + */ + protected $grade_items; + + /** + * The group ID we are interested in. 0 means all groups. + */ + protected $groupid; + + /** + * A recordset of graded users + */ + protected $users_rs; + + /** + * A recordset of user grades (grade_grade instances) + */ + protected $grades_rs; + + /** + * Array used when moving to next user while iterating through the grades recordset + */ + protected $gradestack; + + /** + * The first field of the users table by which the array of users will be sorted + */ + protected $sortfield1; + + /** + * Should sortfield1 be ASC or DESC + */ + protected $sortorder1; + + /** + * The second field of the users table by which the array of users will be sorted + */ + protected $sortfield2; + + /** + * Should sortfield2 be ASC or DESC + */ + protected $sortorder2; /** * Should users whose enrolment has been suspended be ignored? @@ -59,7 +99,7 @@ class graded_users_iterator { * @param string $sortfield2 The second field of the users table by which the array of users will be sorted * @param string $sortorder2 The order in which the second sorting field will be sorted (ASC or DESC) */ - public function graded_users_iterator($course, $grade_items=null, $groupid=0, + public function __construct($course, $grade_items=null, $groupid=0, $sortfield1='lastname', $sortorder1='ASC', $sortfield2='firstname', $sortorder2='ASC') { $this->course = $course; @@ -75,6 +115,7 @@ class graded_users_iterator { /** * Initialise the iterator + * * @return boolean success */ public function init() { @@ -177,7 +218,7 @@ class graded_users_iterator { * Returns information about the next user * @return mixed array of user info, all grades and feedback or null when no more users found */ - function next_user() { + public function next_user() { if (!$this->users_rs) { return false; // no users present } @@ -244,10 +285,9 @@ class graded_users_iterator { } /** - * Close the iterator, do not forget to call this function. - * @return void + * Close the iterator, do not forget to call this function */ - function close() { + public function close() { if ($this->users_rs) { $this->users_rs->close(); $this->users_rs = null; @@ -273,23 +313,23 @@ class graded_users_iterator { /** - * _push + * Add a grade_grade instance to the grade stack * * @param grade_grade $grade Grade object * * @return void */ - function _push($grade) { + private function _push($grade) { array_push($this->gradestack, $grade); } /** - * _pop + * Remove a grade_grade instance from the grade stack * - * @return object current grade object + * @return grade_grade current grade object */ - function _pop() { + private function _pop() { global $DB; if (empty($this->gradestack)) { if (empty($this->grades_rs) || !$this->grades_rs->valid()) { @@ -1049,6 +1089,7 @@ class grade_structure { */ public function get_element_icon(&$element, $spacerifnone=false) { global $CFG, $OUTPUT; + require_once $CFG->libdir.'/filelib.php'; switch ($element['type']) { case 'item': @@ -1114,7 +1155,7 @@ class grade_structure { case 'category': $strcat = get_string('category', 'grades'); - return ''.s($strcat).''; } diff --git a/group/externallib.php b/group/externallib.php index b0e7ce9077a..9045afd702f 100644 --- a/group/externallib.php +++ b/group/externallib.php @@ -95,8 +95,7 @@ class core_group_external extends external_api { $exceptionparam = new stdClass(); $exceptionparam->message = $e->getMessage(); $exceptionparam->courseid = $group->courseid; - throw new moodle_exception( - get_string('errorcoursecontextnotvalid' , 'webservice', $exceptionparam)); + throw new moodle_exception('errorcoursecontextnotvalid' , 'webservice', '', $exceptionparam); } require_capability('moodle/course:managegroups', $context); @@ -168,8 +167,7 @@ class core_group_external extends external_api { $exceptionparam = new stdClass(); $exceptionparam->message = $e->getMessage(); $exceptionparam->courseid = $group->courseid; - throw new moodle_exception( - get_string('errorcoursecontextnotvalid' , 'webservice', $exceptionparam)); + throw new moodle_exception('errorcoursecontextnotvalid' , 'webservice', '', $exceptionparam); } require_capability('moodle/course:managegroups', $context); @@ -231,8 +229,7 @@ class core_group_external extends external_api { $exceptionparam = new stdClass(); $exceptionparam->message = $e->getMessage(); $exceptionparam->courseid = $params['courseid']; - throw new moodle_exception( - get_string('errorcoursecontextnotvalid' , 'webservice', $exceptionparam)); + throw new moodle_exception('errorcoursecontextnotvalid' , 'webservice', '', $exceptionparam); } require_capability('moodle/course:managegroups', $context); @@ -310,8 +307,7 @@ class core_group_external extends external_api { $exceptionparam = new stdClass(); $exceptionparam->message = $e->getMessage(); $exceptionparam->courseid = $group->courseid; - throw new moodle_exception( - get_string('errorcoursecontextnotvalid' , 'webservice', $exceptionparam)); + throw new moodle_exception('errorcoursecontextnotvalid' , 'webservice', '', $exceptionparam); } require_capability('moodle/course:managegroups', $context); @@ -369,8 +365,7 @@ class core_group_external extends external_api { $exceptionparam = new stdClass(); $exceptionparam->message = $e->getMessage(); $exceptionparam->courseid = $group->courseid; - throw new moodle_exception( - get_string('errorcoursecontextnotvalid' , 'webservice', $exceptionparam)); + throw new moodle_exception('errorcoursecontextnotvalid' , 'webservice', '', $exceptionparam); } require_capability('moodle/course:managegroups', $context); @@ -450,8 +445,7 @@ class core_group_external extends external_api { $exceptionparam = new stdClass(); $exceptionparam->message = $e->getMessage(); $exceptionparam->courseid = $group->courseid; - throw new moodle_exception( - get_string('errorcoursecontextnotvalid' , 'webservice', $exceptionparam)); + throw new moodle_exception('errorcoursecontextnotvalid' , 'webservice', '', $exceptionparam); } require_capability('moodle/course:managegroups', $context); @@ -529,8 +523,7 @@ class core_group_external extends external_api { $exceptionparam = new stdClass(); $exceptionparam->message = $e->getMessage(); $exceptionparam->courseid = $group->courseid; - throw new moodle_exception( - get_string('errorcoursecontextnotvalid' , 'webservice', $exceptionparam)); + throw new moodle_exception('errorcoursecontextnotvalid' , 'webservice', '', $exceptionparam); } require_capability('moodle/course:managegroups', $context); diff --git a/install/lang/ar/admin.php b/install/lang/ar/admin.php index cd5cf168aa3..a5496914a7f 100644 --- a/install/lang/ar/admin.php +++ b/install/lang/ar/admin.php @@ -36,7 +36,7 @@ $string['cliincorrectvalueerror'] = 'خطأ، القيمة "{$a->value}" غير $string['cliincorrectvalueretry'] = 'قيمة غير صحيحة، حاول مرة أخرى'; $string['clitypevalue'] = 'أدخل القيمة'; $string['clitypevaluedefault'] = 'ادخل القيم أو اضغط انتر (Enter) لإستخدام القيم الأفتراضية ({$a})'; -$string['cliunknowoption'] = 'خيارات غير معروفة +$string['cliunknowoption'] = 'خيارات غير معروفة {$a} الرجاء استخدام خيار المساعدة'; $string['cliyesnoprompt'] = 'ادخل (Y) تعني نعم أو (N) تعني لأ'; diff --git a/install/lang/ast/install.php b/install/lang/ast/install.php index 0c21e014975..d0a60ba1cad 100644 --- a/install/lang/ast/install.php +++ b/install/lang/ast/install.php @@ -44,10 +44,10 @@ $string['memorylimithelp'] = '

      La llende de memoria del PHP del so servidor ta

      Esto va facer que Moodle tenga problemes de memoria más tarde, especialmente si tien munchos módulos y/o munchos usuarios.

      -

      Recomendamos que configure PHP con una llende más grande si ye posible, como por exemplu 40M. +

      Recomendamos que configure PHP con una llende más grande si ye posible, como por exemplu 40M. Esisten varies formes nes que pue intentar facer esta modificación:

        -
      1. Si pue, recompile PHP con --enable-memory-limit. +
      2. Si pue, recompile PHP con --enable-memory-limit. Esto va permitir que\'l propiu Moodle modifique la llende de memoria.
      3. Si tien accesu al so ficheru php.ini pue modificar el valor de memory_limit a daqué paecío a 40M. Si nun tien accesu a esi ficheru igual pue pidir al alministrador del sistema que lo faiga.
      4. En dellos servidores PHP pue crear un ficheru .htaccess nel direutoriu Moodle cola ringlera que vien darréu: diff --git a/install/lang/az/admin.php b/install/lang/az/admin.php index 49b0e3072f0..310d4dda90c 100644 --- a/install/lang/az/admin.php +++ b/install/lang/az/admin.php @@ -36,7 +36,7 @@ $string['cliincorrectvalueerror'] = 'Səhv, "{$a->option}" üçün səhv "{$a->v $string['cliincorrectvalueretry'] = 'Səhv, "{$a->option}" üçün səhv "{$a->value}" qiyməti'; $string['clitypevalue'] = 'Qiyməti daxil edin'; $string['clitypevaluedefault'] = 'Qiyməti daxil edin, ({$a}) qiymətindən avtomatik olaraq istifadə etmək üçün Enter düyməsini basın'; -$string['cliunknowoption'] = 'Təyin olunmayan parametrlər: +$string['cliunknowoption'] = 'Təyin olunmayan parametrlər: {$a} Zəhmət olmasa help parametrindən istifadə edin'; $string['cliyesnoprompt'] = 'y (bəli) və n (xeyr) düyməsini basın'; diff --git a/install/lang/az/install.php b/install/lang/az/install.php index 65c5e2d7f23..1611a804925 100644 --- a/install/lang/az/install.php +++ b/install/lang/az/install.php @@ -70,23 +70,23 @@ $string['pathsroparentdataroot'] = '({$a->parent}) valideyn kataloquna yazmaq m $string['pathssubadmindir'] = 'Veb-hostinqlərin sayı az olduqda yol/admin idarəetmə panelinə və ya digər bir yerə keçmək üçün xüsusi URL-dir. Təəssüf ki, bu Moodlun idarəetmə səhifələrinin standart mövqeyi ilə ziddiyyət təşkil edir. Bunu Moodle kataloqunda admin qovluğunun adını dəyişməklə və burada yeni adı göstərməklə aradan qaldırmaq olar. Məsələn, moodleadmin. Bu zaman Moodlun idarəetmə panelinə bütün keçidlər avtomatik olaraq dəyişir.'; $string['pathssubdataroot'] = 'Moodlun yüklənmiş faylları harada saxlayacağını mütləq göstərmək lazımdır Veb-server istifadəçisinin (usually \'nobody\' or \'apache\') bu kataloqda oxuma və YAZMA üçün icazəsi olmalıdır, lakin bu zaman İnternetdən birbaşa müraciət mümkün ola bilməz. Əgər bu kataloq mövcud deyilsə, quraşdırma proqramı onu yaratmağa cəhd edir. '; $string['pathssubdirroot'] = 'Moodlun quraşdırılması kataloquna tam yol'; -$string['pathssubwwwroot'] = 'Moodla keçidin mümkün olduğu tam veb-ünvan. -Moodla keçid üçün bir neçə ünvandan istifadə etmək mümkün deyil. Əgər sizin saytın bir neçə açıq ünvanı varsa, siz həmişə bu ünvanlardan göstərilən ünvana keçidi təmin etməlisiniz. -əgəgr sizin sayta həm İnternetdən və həm də lokal şəbəkədən keçid mümkündürsə, burada ümumi ünvanı göstərin və DNS-i elə sazlayın ki, lokal istifadəçilər də bu ünvandan istifadə edə bilsin. -Əgər göstərilən ünvan düzgün deyilsə, quraşdırmanı digər qiymətlə yenidən başlamaq üçün brauzerin ünvan sətirində URL-i dəyişin. '; +$string['pathssubwwwroot'] = 'Moodla keçidin mümkün olduğu tam veb-ünvan. +Moodla keçid üçün bir neçə ünvandan istifadə etmək mümkün deyil. Əgər sizin saytın bir neçə açıq ünvanı varsa, siz həmişə bu ünvanlardan göstərilən ünvana keçidi təmin etməlisiniz. +əgəgr sizin sayta həm İnternetdən və həm də lokal şəbəkədən keçid mümkündürsə, burada ümumi ünvanı göstərin və DNS-i elə sazlayın ki, lokal istifadəçilər də bu ünvandan istifadə edə bilsin. +Əgər göstərilən ünvan düzgün deyilsə, quraşdırmanı digər qiymətlə yenidən başlamaq üçün brauzerin ünvan sətirində URL-i dəyişin.'; $string['pathsunsecuredataroot'] = 'Verilənlər kataloqunun mövqeyi təhlükəsizlik tələblərinə cavab vermir.'; $string['pathswrongadmindir'] = 'Admin kataloqu mövcud deyil'; $string['phpextension'] = '{$a} PHP geniçlənməsi'; $string['phpversion'] = 'PHP versiyası'; -$string['phpversionhelp'] = '

        Moodle üçün PHP-nin 4.3.0 və ondan yuxarı və ya 5.1.0 və ondan yuxarı versiyaları(5.0.versiyasının bəzi problemləri məlumdur) lazımdır.

        -

        İndi Siz, {$a} versiyasından istifadə edirsiniz

        -

        Siz PHP-ni yeniləməlisiniz və ya PHP-nin daha yeni versiyası olan xostinqə keçməlisiniz!
        +$string['phpversionhelp'] = '

        Moodle üçün PHP-nin 4.3.0 və ondan yuxarı və ya 5.1.0 və ondan yuxarı versiyaları(5.0.versiyasının bəzi problemləri məlumdur) lazımdır.

        +

        İndi Siz, {$a} versiyasından istifadə edirsiniz

        +

        Siz PHP-ni yeniləməlisiniz və ya PHP-nin daha yeni versiyası olan xostinqə keçməlisiniz!
        (5.0.x verisyası olarsa 4.4.x versiyasına qayıda bilərsiniz)

        '; $string['welcomep10'] = '{$a->installername} ({$a->installerversion})'; $string['welcomep20'] = 'Siz bu səhifəni ona görə görürsünüz ki, {$a->packname} {$a->packversion} proqram paketini öz kompyüterinizdə müvəffəqiyyətlə qurmusunuz. Təbrik edirik!'; $string['welcomep30'] = '{$a->installername} proqram paketinin bu versiyasında Moodleun işləyəcəyi mühiti yaratmaq üçün aşağıdakı proqramlar var:'; $string['welcomep40'] = 'Paketə həmçinin Moodle {$a->moodlerelease} ({$a->moodleversion}) daxildir.'; -$string['welcomep50'] = 'Bu paketə daxil olan əlavələrdən istifadə edilmə ardıcıllığı, müvafiq lisenziyalarla müəyyən edilir. {$a->installername} tam proqram paketi +$string['welcomep50'] = 'Bu paketə daxil olan əlavələrdən istifadə edilmə ardıcıllığı, müvafiq lisenziyalarla müəyyən edilir. {$a->installername} tam proqram paketi
        mənbəni açırGPL lisenziyasının şərtlərinə uyğun olaraq yayılır.'; $string['welcomep60'] = 'Növbəti səhifələrdə Siz, bir neçə sadə addımla öz kompyüterinizdə Moodle-un parametrlərini sazlaya və quraşdıra bilərsiniz. Siz sazlama parametrlərini susmaya görə qəbul edə və ya öz tələblərinizdən asılı olaraq dəyişə bilərsiniz.'; $string['welcomep70'] = 'Moodle quraşdırma prosesini davam etmək üçün "Növbəti" düyməsini sıxın.'; diff --git a/install/lang/ca/admin.php b/install/lang/ca/admin.php index ffb19b6cb7e..01a0d35cb8a 100644 --- a/install/lang/ca/admin.php +++ b/install/lang/ca/admin.php @@ -36,7 +36,7 @@ $string['cliincorrectvalueerror'] = 'Error, valor incorrecte "{$a->value}" per a $string['cliincorrectvalueretry'] = 'Valor incorrecte, si us plau, torneu-ho a provar.'; $string['clitypevalue'] = 'Valor de tipus'; $string['clitypevaluedefault'] = 'valor de tipus, premeu Intro per fer servir un valor per defecte ({$a})'; -$string['cliunknowoption'] = 'Opcions invàlides: +$string['cliunknowoption'] = 'Opcions invàlides: {$a} L\'opció --help us orientarà.'; $string['cliyesnoprompt'] = 'Escriu y (significa Sí) o n (significa No)'; diff --git a/install/lang/ca/install.php b/install/lang/ca/install.php index 6294519797f..d57d69d67c3 100644 --- a/install/lang/ca/install.php +++ b/install/lang/ca/install.php @@ -64,8 +64,8 @@ $string['welcomep10'] = '{$a->installername} ({$a->installerversion})'; $string['welcomep20'] = 'Esteu veient aquesta pàgina perquè heu instal·lat amb èxit i heu executat el paquet {$a->packname} {$a->packversion}. Felicitacions!'; $string['welcomep30'] = 'Aquesta versió de {$a->installername} inclou les aplicacions necessàries per crear un entorn en el qual funcioni Moodle:'; $string['welcomep40'] = 'El paquet inclou també Moodle {$a->moodlerelease} ({$a->moodleversion}).'; -$string['welcomep50'] = 'L\'ús de totes les aplicacions d\'aquest paquet és governat per les seves llicències respectives. El paquet {$a->installername} complet és -codi font obert i es distribueix +$string['welcomep50'] = 'L\'ús de totes les aplicacions d\'aquest paquet és governat per les seves llicències respectives. El paquet {$a->installername} complet és +codi font obert i es distribueix sota llicència GPL.'; $string['welcomep60'] = 'Les pàgines següents us guiaran per una sèrie de passos fàcils de seguir per configurar Moodle en el vostre ordinador. Podeu acceptar els paràmetres per defecte o, opcionalment, modificar-los perquè s\'ajustin a les vostres necessitats.'; $string['welcomep70'] = 'Feu clic en el botó "Següent" per continuar la configuració de Moodle.'; diff --git a/install/lang/cy/install.php b/install/lang/cy/install.php index 08593603419..5b0f627e34c 100644 --- a/install/lang/cy/install.php +++ b/install/lang/cy/install.php @@ -42,21 +42,21 @@ $string['installation'] = 'Gosod'; $string['langdownloaderror'] = 'Yn anffodus, ni osodwyd yr iaith ganlynol: "{$a}". Bydd y broses osod yn cario ymlaen yn Saesneg.'; $string['memorylimithelp'] = '

        Mae maint y cof PHP yn eich gweinydd ar hyn o bryd yn {$a}.

        -

        Gall hyn arwain at broblemau â\'r cof yn nes ymlaen, yn enwedig +

        Gall hyn arwain at broblemau â\'r cof yn nes ymlaen, yn enwedig os ydych wedi galluogi llawer o fodiwlau a/neu lawer o ddefnyddwyr.

        -

        Rydym yn argymell eich bod yn ffurfweddu PHP gyda mwy o gof os yn bosib, megis 40M. +

        Rydym yn argymell eich bod yn ffurfweddu PHP gyda mwy o gof os yn bosib, megis 40M. Mae sawl ffordd o wneud hyn:

          -
        1. Os ydych yn gallu, ceisiwch ail-grynhoi PHP gyda --enable-memory-limit. +
        2. Os ydych yn gallu, ceisiwch ail-grynhoi PHP gyda --enable-memory-limit. Bydd hyn yn gadael i Moodle osod maint y cof ei hun.
        3. -
        4. Os ydych yn gallu mynd i mewn i\'ch ffeil php.ini, gallwch newid y gosodiad memory_limit - yn y fan honno i tua 40M. Os nad ydych chi\'n gallu gwneud hyn eich hun, efallai +
        5. Os ydych yn gallu mynd i mewn i\'ch ffeil php.ini, gallwch newid y gosodiad memory_limit + yn y fan honno i tua 40M. Os nad ydych chi\'n gallu gwneud hyn eich hun, efallai y gallech ofyn i\'ch gweinyddwr wneud hyn i chi.
        6. -
        7. Ar rai gweinyddion PHP, gallwch greu ffeil .htaccess yng nghyfeiriadur Moodle +
        8. Ar rai gweinyddion PHP, gallwch greu ffeil .htaccess yng nghyfeiriadur Moodle sy\'n cynnwys y llinell hon:

          php_value memory_limit 40M

          -

          Fodd bynnag, ar rai gweinyddion bydd hyn yn atal pob tudalen PHP rhag gweithio +

          Fodd bynnag, ar rai gweinyddion bydd hyn yn atal pob tudalen PHP rhag gweithio (bydd gwallau\'n ymddangos pan fyddwch yn edrych ar dudalennau) felly bydd rhaid i chi dynnu\'r ffeil .htaccess file.

        '; $string['phpversion'] = 'Fersiwn PHP'; @@ -65,15 +65,15 @@ $string['phpversionhelp'] = '

        Mae angen o leiaf fersiwn PHP 4.3.0 neu 5.1.0 ar

        Rhaid i chi uwchraddio PHP neu newid i westeiwr â fersiwn diweddarach o PHP!
        (Os oes gennych 5.0.x gallwch hefyd is-raddio i fersiwn 4.4.x)

        '; $string['welcomep10'] = '{$a->installername} ({$a->installerversion})'; -$string['welcomep20'] = 'Rydych chi\'n gweld y dudalen hon gan eich bod wedi gosod a +$string['welcomep20'] = 'Rydych chi\'n gweld y dudalen hon gan eich bod wedi gosod a lansio\'r pecyn {$a->packname} {$a->packversion} yn llwyddiannus ar eich cyfrifiadur. Llongyfarchiadau!'; -$string['welcomep30'] = 'Mae\'r fersiwn {$a->installername} yn cynnwys rhaglenni +$string['welcomep30'] = 'Mae\'r fersiwn {$a->installername} yn cynnwys rhaglenni i greu amgylchedd y gall Moodle weithio ynddo, sef:'; $string['welcomep40'] = 'Mae\'r pecyn hefyd yn cynnwys Moodle {$a->moodlerelease} ({$a->moodleversion}).'; -$string['welcomep50'] = 'Y trwyddedau perthnasol sy\'n llywodraethu dros yr holl raglenni yn y pecyn hwn. Y pecyn cyflawn yw {$a->installername} +$string['welcomep50'] = 'Y trwyddedau perthnasol sy\'n llywodraethu dros yr holl raglenni yn y pecyn hwn. Y pecyn cyflawn yw {$a->installername} open source a chaiff ei ddosbarthu dan y drwydded GPL.'; -$string['welcomep60'] = 'Bydd y tudalennau canlynol yn eich arwain drwy\'r camau syml i - ffurfweddu a gosod Moodle ar eich cyfrifiadur. Gallwch ddewis derbyn y gosodiadau +$string['welcomep60'] = 'Bydd y tudalennau canlynol yn eich arwain drwy\'r camau syml i + ffurfweddu a gosod Moodle ar eich cyfrifiadur. Gallwch ddewis derbyn y gosodiadau diofyn, neu gallwch eu newid eich hun ar gyfer eich dibenion chi.'; $string['welcomep70'] = 'Cliciwch y botwm "Nesaf" i fwrw ymlaen i osod Moodle.'; $string['wwwroot'] = 'Cyfeiriad ar y we'; diff --git a/install/lang/da/install.php b/install/lang/da/install.php index c746a8b68ee..e85ebfaa632 100644 --- a/install/lang/da/install.php +++ b/install/lang/da/install.php @@ -48,21 +48,21 @@ Installationsprogrammet udfører et tjek før hver installation og opgradering. $string['errorsinenvironment'] = 'Systemtjekket mislykkedes!'; $string['installation'] = 'Installation'; $string['langdownloaderror'] = 'Sproget "{$a}" blev desværre ikke installeret. Installationen vil fortsætte på engelsk.'; -$string['memorylimithelp'] = '

        Den mængde hukommelse PHP kan bruge, er sat til {$a}.

        +$string['memorylimithelp'] = '

        Den mængde hukommelse PHP kan bruge, er sat til {$a}.

        -

        Dette kan forårsage at der opstår problemer senere, især hvis du har mange moduler aktiveret eller mange brugere.

        +

        Dette kan forårsage at der opstår problemer senere, især hvis du har mange moduler aktiveret eller mange brugere.

        -

        Vi anbefaler at du konfigurerer PHP med mere hukommelse, f.eks. 40M. -Der er flere måder hvorpå du kan rette det.

        -
          -
        1. Hvis du har mulighed for det, kan du rekompilere PHP med --enable-memory-limit. -Det vil tillade at Moodle selv kan definere hvor meget hukommelse der er brug for.
        2. +

          Vi anbefaler at du konfigurerer PHP med mere hukommelse, f.eks. 40M. +Der er flere måder hvorpå du kan rette det.

          +
            +
          1. Hvis du har mulighed for det, kan du rekompilere PHP med --enable-memory-limit. +Det vil tillade at Moodle selv kan definere hvor meget hukommelse der er brug for.
          2. -
          3. Hvis du har adgang til php.ini filen kan du ændre memory_limit-indstillingen til noget i retning af 40M. -Hvis du ikke har direkte adgang til den kan du bede systemadministratoren om at gøre det for dig.
          4. +
          5. Hvis du har adgang til php.ini filen kan du ændre memory_limit-indstillingen til noget i retning af 40M. +Hvis du ikke har direkte adgang til den kan du bede systemadministratoren om at gøre det for dig.
          6. På nogle servere kan du oprette en \'.htaccess\' fil og gemme den i moodle-mappen med linjen: -
            php_value memory_limit 40M
            +
            php_value memory_limit 40M

            Det kan dog på nogle servere forhindre alle PHP-siderne i at virke (du vil se fejl når du ser på siderne). I så fald kan du blive nødt til at fjerne \'.htaccess\' filen igen.

          '; $string['paths'] = 'Stier'; $string['pathserrcreatedataroot'] = 'Datamappen ({$a->dataroot}) kan ikke oprettes af installationsprogrammet.'; @@ -72,19 +72,18 @@ $string['pathsroparentdataroot'] = 'Den overordnede mappe ({$a->parent}) er skri $string['pathssubadmindir'] = 'Enkelte webhoteller bruger /admin som speciel URL til kontrolpanelet el. lign. Desværre konflikter det med Moodles standardplacering af admin-sider. Du kan klare dette ved at give admin-mappen et andet navn i din installation og skrive det her. Det kan f.eks. være moodleadmin. Det vil fikse admin-links i Moodle.'; $string['pathssubdataroot'] = 'Du har brug for et sted, hvor Moodle kan gemme uploadede filer. Denne mappe skal kunne læses OG SKRIVES I af webserverbrugeren (oftest \'ingen\' eller \'apache\'), men må ikke være tilgængelig direkte via internettet. Installationsprogrammet vil forsøge at oprette mappen, hvis ikke den allerede eksisterer.'; $string['pathssubdirroot'] = 'Den fulde sti til Moodleinstallationen.'; -$string['pathssubwwwroot'] = 'Moodles fulde web-adresse. +$string['pathssubwwwroot'] = 'Moodles fulde web-adresse. Det er ikke muligt at komme ind på Moodle fra mere end en adresse. Hvis dit websted har flere offentlige adresser skal du opsætte permanent viderestilling til dem alle undtagen denne. Hvis dit websted er tilgængeligt fra både internet og intranet skal du bruge internetadressen her og opsætte din DNS sådan at intranet-brugerne kan bruge den offentlige adresse også. -Hvis ikke adressen er korrekt må du ændre URL\'en i din browser og genstarte installationen med den rigtige adresse. -'; +Hvis ikke adressen er korrekt må du ændre URL\'en i din browser og genstarte installationen med den rigtige adresse.'; $string['pathsunsecuredataroot'] = 'Datamappen er ikke sikret'; $string['pathswrongadmindir'] = 'Adminmappe eksisterer ikke'; $string['phpextension'] = '{$a} PHP-extension'; $string['phpversion'] = 'PHP version'; -$string['phpversionhelp'] = '

          Moodle kræver mindst PHP version 4.3.0. eller 5.1.0 (5.0.x er behæftet med fejl).

          -

          Webserveren bruger i øjeblikket version {$a}

          -

          Du bliver nødt til at opdatere PHP eller flytte systemet over på en anden webserver der har en nyere version af PHP!

          +$string['phpversionhelp'] = '

          Moodle kræver mindst PHP version 4.3.0. eller 5.1.0 (5.0.x er behæftet med fejl).

          +

          Webserveren bruger i øjeblikket version {$a}

          +

          Du bliver nødt til at opdatere PHP eller flytte systemet over på en anden webserver der har en nyere version af PHP!

          (Har du ver. 5.0.x kan du også nedgradere til 4.4.x)

          '; $string['welcomep10'] = '{$a->installername} ({$a->installerversion})'; $string['welcomep20'] = 'Du ser denne side fordi du med succes har installeret og åbnet pakken {$a->packname} {$a->packversion} på din computer. diff --git a/install/lang/de/admin.php b/install/lang/de/admin.php index ceff3da3116..f5b781cbffb 100644 --- a/install/lang/de/admin.php +++ b/install/lang/de/admin.php @@ -36,7 +36,7 @@ $string['cliincorrectvalueerror'] = 'Fehler: Falscher Wert "{$a->value}" für "{ $string['cliincorrectvalueretry'] = 'Falscher Wert - bitte nochmal'; $string['clitypevalue'] = 'Wert eingeben'; $string['clitypevaluedefault'] = 'Wert eingeben oder Standardwert benutzen ({$a})'; -$string['cliunknowoption'] = 'Nicht erkannte Optionen: +$string['cliunknowoption'] = 'Nicht erkannte Optionen: {$a} Hilfe wird über die Option -help angezeigt.'; $string['cliyesnoprompt'] = 'y (yes=ja) oder n (no=nein) eingeben'; diff --git a/install/lang/de/install.php b/install/lang/de/install.php index c1a2188dd90..3484e7a88f2 100644 --- a/install/lang/de/install.php +++ b/install/lang/de/install.php @@ -66,7 +66,7 @@ $string['pathsroparentdataroot'] = 'Das Verzeichnis ({$a->parent}) ist schreibge $string['pathssubadmindir'] = 'Einige Webserver benutzen /admin als speziellen Link, um auf Einstellungsseiten oder Ähnliches zu verweisen. Unglücklicherweise kollidiert dies mit dem standardmäßigen Verzeichnis für die Moodle-Administration. Sie können dieses Problem beheben, indem Sie das Verzeichnis admin in Ihrer Moodle-Installation umbenennen und den neuen Namen hier eingeben (z.B. moodleadmin). Mit dieser Änderung werden alle Admin-Links korrigiert.'; $string['pathssubdataroot'] = 'Sie benötigen einen Platz, wo Moodle hochgeladene Dateien abspeichern kann. Dieses Verzeichnis muss Lese- und Schreibrechte für das Nutzerkonto besitzen, mit dem Ihr Webservers läuft (üblicherweise \'nobody\', \'apache\' oder \'www\'). Außerdem sollte das Verzeichnis nicht direkt aus dem Internet erreichbar sein. Das Intallationsskript wird versuchen, ein solches Verzeichnis zu erstellen, falls es nicht existiert.

          '; $string['pathssubdirroot'] = 'Vollständiger Pfad der Moodle-Installation'; -$string['pathssubwwwroot'] = 'Vollständige Webadresse für den Zugriff auf Moodle. Es ist nicht möglich, über unterschiedliche Adressen auf Moodle zuzugreifen. Sollte Ihre Website mehrere öffentliche Adressen verwenden, so müssen Sie eine Adresse festlegen und für die übrigen Adressen dauerhafte Weiterleitungen dorthin einrichten. +$string['pathssubwwwroot'] = 'Vollständige Webadresse für den Zugriff auf Moodle. Es ist nicht möglich, über unterschiedliche Adressen auf Moodle zuzugreifen. Sollte Ihre Website mehrere öffentliche Adressen verwenden, so müssen Sie eine Adresse festlegen und für die übrigen Adressen dauerhafte Weiterleitungen dorthin einrichten.

          Falls Ihre Website gleichzeitig im Intranet und im Internet erreichbar ist, so tragen Sie die öffentliche Adresse ein. Konfigurieren Sie den DNS so, dass Moodle auch aus dem Intranet über die öffentliche Adresse erreichbar ist.

          Führen Sie Ihre Moodle-Installation unbedingt mit der richtigen Adresse durch, weil es andernfalls zu Problemen kommen könnte.'; $string['pathsunsecuredataroot'] = 'Der Speicherort des Verzeichnisses \'dataroot\' ist unsicher'; diff --git a/install/lang/es/install.php b/install/lang/es/install.php index caf44907a1f..750165db5e4 100644 --- a/install/lang/es/install.php +++ b/install/lang/es/install.php @@ -81,17 +81,17 @@ $string['phpextension'] = 'Extensión PHP {$a}'; $string['phpversion'] = 'Versión PHP'; $string['phpversionhelp'] = '

          Moodle requiere al menos una versión de PHP 4.3.0 o 5.1.0 ((5.0.x tiene una serie de problemas conocidos).

          En este momento está ejecutando la versión {$a}

          -

          ¡Debe actualizar PHP o trasladarse a otro servidor con una versión más reciente de PHP!
          +

          ¡Debe actualizar PHP o trasladarse a otro servidor con una versión más reciente de PHP!
          (En caso de 5.0.x podría también revertir a la versión 4.4.x)

          '; $string['welcomep10'] = '{$a->installername} ({$a->installerversion})'; $string['welcomep20'] = 'Si está viendo esta página es porque ha podido ejecutar el paquete {$a->packname} {$a->packversion} en su ordenador. !Enhorabuena!'; -$string['welcomep30'] = 'Esta versión de {$a->installername} incluye las +$string['welcomep30'] = 'Esta versión de {$a->installername} incluye las aplicaciones necesarias para que Moodle funcione en su ordenador, principalmente:'; $string['welcomep40'] = 'El paquete también incluye Moodle {$a->moodlerelease} ({$a->moodleversion}).'; -$string['welcomep50'] = 'El uso de todas las aplicaciones del paquete está gobernado por sus respectivas - licencias. El programa {$a->installername} es - código abierto y se distribuye +$string['welcomep50'] = 'El uso de todas las aplicaciones del paquete está gobernado por sus respectivas + licencias. El programa {$a->installername} es + código abierto y se distribuye bajo licencia GPL.'; $string['welcomep60'] = 'Las siguientes páginas le guiarán a través de algunos sencillos pasos para configurar y ajustar Moodle en su ordenador. Puede utilizar los valores por defecto sugeridos o, diff --git a/install/lang/es_mx/admin.php b/install/lang/es_mx/admin.php new file mode 100644 index 00000000000..c50bbe74117 --- /dev/null +++ b/install/lang/es_mx/admin.php @@ -0,0 +1,33 @@ +. + +/** + * Automatically generated strings for Moodle 2.3dev installer + * + * Do not edit this file manually! It contains just a subset of strings + * needed during the very first steps of installation. This file was + * generated automatically by export-installer.php (which is part of AMOS + * {@link http://docs.moodle.org/dev/Languages/AMOS}) using the + * list of strings defined in /install/stringnames.txt. + * + * @package installer + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$string['environmentrequireinstall'] = 'debe estar instalado y activado'; diff --git a/install/lang/es_mx/install.php b/install/lang/es_mx/install.php new file mode 100644 index 00000000000..a3586f021e3 --- /dev/null +++ b/install/lang/es_mx/install.php @@ -0,0 +1,38 @@ +. + +/** + * Automatically generated strings for Moodle 2.3dev installer + * + * Do not edit this file manually! It contains just a subset of strings + * needed during the very first steps of installation. This file was + * generated automatically by export-installer.php (which is part of AMOS + * {@link http://docs.moodle.org/dev/Languages/AMOS}) using the + * list of strings defined in /install/stringnames.txt. + * + * @package installer + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$string['databasehost'] = 'host de la Base de Datos'; +$string['environmentsub2'] = 'Cada versión de Moodle tiene algún requisito mínimo de la versión de PHP y un número obligatorio de extensiones de PHP. Una comprobación del entorno completo se realiza antes de cada instalación y actualización. Por favor, póngase en contacto con el administrador del servidor si no sabe cómo instalar la nueva versión o habilitar las extensiones PHP.'; +$string['errorsinenvironment'] = '¡La comprobación del entorno falló!'; +$string['welcomep20'] = 'Si está viendo esta página es porque ha podido ejecutar el paquete {$a->packname} {$a->packversion} en su computadora. !Enhorabuena!'; +$string['welcomep30'] = 'Esta versión de {$a->installername} incluye las aplicaciones necesarias para que Moodle funcione en su computadora principalmente:'; +$string['welcomep60'] = 'Las siguientes páginas le guiarán a través de algunos sencillos pasos para configurar y ajustar Moodle en su computadora. Puede utilizar los valores por defecto sugeridos o, de forma opcional, modificarlos para que se ajusten a sus necesidades.'; diff --git a/install/lang/et/admin.php b/install/lang/et/admin.php index 7a183b8e64e..cae3554ab34 100644 --- a/install/lang/et/admin.php +++ b/install/lang/et/admin.php @@ -36,7 +36,7 @@ $string['cliincorrectvalueerror'] = 'Viga, vigane väärtus "{$a->value}" "{$a-> $string['cliincorrectvalueretry'] = 'Vale väärtus(value), palun proovige uuesti'; $string['clitypevalue'] = 'tüübi väärtus'; $string['clitypevaluedefault'] = 'sisesta väärtus, vajuta Enter kasutamaks vaikeväärtust ({$a})'; -$string['cliunknowoption'] = 'Tundmatud valikud: +$string['cliunknowoption'] = 'Tundmatud valikud: {$a} Palun kasuta --help valikut.'; $string['cliyesnoprompt'] = 'kirjuta y (tähendab jah) või n (tähendab ei)'; diff --git a/install/lang/eu/install.php b/install/lang/eu/install.php index 4f7b57e26ed..682ee9b1108 100644 --- a/install/lang/eu/install.php +++ b/install/lang/eu/install.php @@ -75,13 +75,13 @@ $string['phpversionhelp'] = '

          Moodle-k PHP 4.1.0 edo geroagoko bertsioa behar $string['welcomep10'] = '{$a->installername} ({$a->installerversion})'; $string['welcomep20'] = 'Orri hau ikusten baduzu {$a->packname} {$a->packversion} paketea zure ordenadorean instalatu ahal izan duzu. Zorionak!'; -$string['welcomep30'] = '{$a->installername}ren bertsio honek Moodlek +$string['welcomep30'] = '{$a->installername}ren bertsio honek Moodlek zure ordenadorean funtzionatzeko behar diren aplikazioak dauzka, bereziki:'; $string['welcomep40'] = 'Paketeak ere zera dauka: Moodle {$a->moodlerelease} ({$a->moodleversion}).'; -$string['welcomep50'] = 'Paketeko aplikazio guztien erabilpena dagozkien lizentziek - arautzen dute. {$a->installername} aplikazioak - kode irekia dauka eta +$string['welcomep50'] = 'Paketeko aplikazio guztien erabilpena dagozkien lizentziek + arautzen dute. {$a->installername} aplikazioak + kode irekia dauka eta GPL lizentziapean banatzen da.'; $string['welcomep60'] = 'Datozen orriek urrats erraz batzuen bidez gidatuko zaituzte Moodle zure ordenadorean instalatu eta konfiguratzeko. Aholkatzen diren lehentsitako baloreak diff --git a/install/lang/gl/install.php b/install/lang/gl/install.php index 2d3518df35e..b1cd753ef06 100644 --- a/install/lang/gl/install.php +++ b/install/lang/gl/install.php @@ -44,10 +44,10 @@ $string['memorylimithelp'] = '

          O límite de memoria para PHP do seu servidor e

          Isto fará que Moodle teña problemas de memoria máis tarde, especialmente se ten un número de módulos significativo e/ou un gran número de usuarios.

          -

          Recomendamos que configure PHP cun límite maior se é posible, como por exemplo 16M. +

          Recomendamos que configure PHP cun límite maior se é posible, como por exemplo 16M. Existen varias formas que pode tentar para facer esta modificación:

            -
          1. Se pode, recompile PHP con --enable-memory-limit. +
          2. Se pode, recompile PHP con --enable-memory-limit. Iso permitirá que o propio Moodle modifique o límite de memoria.
          3. Se ten acceso ao seu ficheiro php.ini pode modificar o valor de memory_limit para algo semellante a 16M. Se non ten acceso a ese ficheiro tal vez poida pedir ao administrador do sistema que o faga.
          4. Nalgúns servidores PHP servers pode crear un ficheiro .htaccess no directorio Moodle coa liña seguinte: @@ -61,7 +61,7 @@ $string['phpversionhelp'] = '

            Moodle require unha versión de PHP de 4.3.0 com (No caso de ter unha versión 5.0.x pode retornar para unha versión 4.4.x)

            '; $string['welcomep10'] = '{$a->installername} ({$a->installerversion})'; $string['welcomep20'] = 'Está a ver esta páxina porque conseguiu instalar e iniciar o paquete {$a->packname} {$a->packversion} no seu computador. Parabéns!'; -$string['welcomep30'] = 'Esta versión do {$a->installername} inclúe as aplicacións +$string['welcomep30'] = 'Esta versión do {$a->installername} inclúe as aplicacións para crear o ámbito en que Moodle pode funcionar, nomeadamente:'; $string['welcomep40'] = 'O paquete tamén inclúe Moodle {$a->moodlerelease} ({$a->moodleversion}).'; $string['welcomep50'] = 'A utilización de todas as aplicacións deste paquete réxese polas respectivas licenzas. O paquete {$a->installername} completo é código aberto distribuído nos termos da licenza GPL.'; diff --git a/install/lang/he/admin.php b/install/lang/he/admin.php index 5baee6027b6..eb6550f00dd 100644 --- a/install/lang/he/admin.php +++ b/install/lang/he/admin.php @@ -37,7 +37,7 @@ $string['cliincorrectvalueerror'] = 'שגיאה: ערך לא תקין $string['cliincorrectvalueretry'] = 'ערך שגוי, נסה שנית'; $string['clitypevalue'] = 'סוג הערך'; $string['clitypevaluedefault'] = 'סוג הערך, הקש Enter לשימוש בערך ברירת מחדל ({$a})'; -$string['cliunknowoption'] = 'אפשרויות לא מוכרות : +$string['cliunknowoption'] = 'אפשרויות לא מוכרות : {$a} אנא השתמש באפשרות העזרה.'; $string['cliyesnoprompt'] = 'רשום y (שפרושו כן) או n (שפרושו לא)'; diff --git a/install/lang/he/install.php b/install/lang/he/install.php index a756854938a..e107fcdc05d 100644 --- a/install/lang/he/install.php +++ b/install/lang/he/install.php @@ -79,8 +79,8 @@ $string['paths'] = 'נתיבים'; $string['pathserrcreatedataroot'] = 'ספריית המידע (Data Directory) - ({$a->dataroot}) לא יכולה להיווצר על-ידי המתקין.'; $string['pathshead'] = 'נתיבים מאושרים'; $string['pathsrodataroot'] = 'ספריית המידע (Data Directory) לא ניתנת לכתיבה.'; -$string['pathsroparentdataroot'] = 'ספריית האב - ({$a->parent}) לא ניתנת לכתיבה. -ספריית המידע (Data Directory) - ({$a->dataroot}) לא יכולה להיווצר על-ידי המתקין. '; +$string['pathsroparentdataroot'] = 'ספריית האב - ({$a->parent}) לא ניתנת לכתיבה. +ספריית המידע (Data Directory) - ({$a->dataroot}) לא יכולה להיווצר על-ידי המתקין.'; $string['pathssubdirroot'] = 'הנתיב המלא לספריית ההתקנה של Moodle'; $string['pathsunsecuredataroot'] = 'ספריית המידע (Data Directory) לא מאובטחת'; $string['pathswrongadmindir'] = 'ספריית ה-admin לא קיימת'; @@ -96,11 +96,11 @@ $string['welcomep20'] = 'הינך רואה את עמוד זה מפני שהתק חבילה במחשבך. ברכותינו!'; $string['welcomep30'] = 'גירסת {$a->installername} כוללת את היישומים ליצור סביבה אשר בה Moodle יפעל דהיינו:'; -$string['welcomep40'] = 'החבילה כוללת בנוסף +$string['welcomep40'] = 'החבילה כוללת בנוסף Moodle {$a->moodlerelease} ({$a->moodleversion}).'; -$string['welcomep50'] = 'השימוש בכל היישומים בחבילה זו מפוקח ע"י הרשיונות המתאימים להם. החבילה +$string['welcomep50'] = 'השימוש בכל היישומים בחבילה זו מפוקח ע"י הרשיונות המתאימים להם. החבילה {$a->installername} -השלמה היא +השלמה היא קוד פתוח והיא מבוזרת תחת רישיון diff --git a/install/lang/hr/install.php b/install/lang/hr/install.php index 52b9c410ee3..91d10caaca5 100644 --- a/install/lang/hr/install.php +++ b/install/lang/hr/install.php @@ -50,15 +50,15 @@ Puna provjera okruženja se obavlja prije svake instalacije ili nadogradnje post $string['errorsinenvironment'] = 'Pogreške u okruženju poslužitelja!'; $string['installation'] = 'Instalacija'; $string['langdownloaderror'] = 'Nažalost, jezik "{$a}" nije instaliran. Proces instalacije će biti nastavljen na engleskom jeziku.'; -$string['memorylimithelp'] = '

            PHP ograničenje memorije na poslužitelju je trenutno podešeno na {$a}.

            +$string['memorylimithelp'] = '

            PHP ograničenje memorije na poslužitelju je trenutno podešeno na {$a}.

            -

            Ova postavka može kasnije rezultirati memorijskim problemima na vašem Moodle sustavu, posebno ako imate veći broj uključenih modula i/ili veći broj korisnika.

            +

            Ova postavka može kasnije rezultirati memorijskim problemima na vašem Moodle sustavu, posebno ako imate veći broj uključenih modula i/ili veći broj korisnika.

            Preporučujemo da konfigurirate PHP s većim ograničenjem ako je moguće, recimo 40M. Postoji nekoliko načina na koje to možete napraviti:

            -
              -
            1. Ako možete, rekompajlirajte PHP s --enable-memory-limit. Ovo će dozvoliti Moodle sustavu samostalno postavljanje memorijskog ograničenja.
            2. -
            3. Ako imate pristup php.ini datoteci, možete promijeniti memory_limit vrijednost na 40M. Ako nemate pristup toj datoteci možete pitati svog administratora da to uradi.
            4. -
            5. Na nekim PHP poslužiteljima možete napraviti .htaccess datoteku u Moodle mapi koja sadrži red:

              php_value memory_limit 40M

              +
                +
              1. Ako možete, rekompajlirajte PHP s --enable-memory-limit. Ovo će dozvoliti Moodle sustavu samostalno postavljanje memorijskog ograničenja.
              2. +
              3. Ako imate pristup php.ini datoteci, možete promijeniti memory_limit vrijednost na 40M. Ako nemate pristup toj datoteci možete pitati svog administratora da to uradi.
              4. +
              5. Na nekim PHP poslužiteljima možete napraviti .htaccess datoteku u Moodle mapi koja sadrži red:

                php_value memory_limit 40M

                Uzmite u obzir da će na nekim poslužiteljima to spriječiti prikazivanje svih PHP stranica (bit će vam prikazana poruka o grešci), pa ćete na takvim poslužiteljima morati ukloniti .htaccess datoteku.

              '; $string['paths'] = 'Putanje (PATH)'; $string['pathserrcreatedataroot'] = 'Instalacijska skripta ne može stvoriti \'Mapu s podacima\' ({$a->dataroot}).'; @@ -69,8 +69,8 @@ $string['pathssubadmindir'] = 'Manji broj webhosting tvrtki koristi /admin kao p Ovo će promijeniti administratorsku poveznicu na Moodle sustavu u novu vrijednost.'; $string['pathssubdataroot'] = 'Mora postojati mapa u koju Moodle može pohraniti upload datoteke. Korisnik pod kojim je pokrenut web server (obično \'nobody\' ili \'apache\') bi morao imati mogućnost čitanja/pisanja podataka u toj mapi, ali oni ne bi trebali biti dostupni direktno preko weba. Instalacijska skripta će pokušati stvoriti navedenu mapu ako ista ne postoji.'; $string['pathssubdirroot'] = 'Puna putanja (PATH) do Moodle instalacije.'; -$string['pathssubwwwroot'] = 'Unesite punu web adresu putem koje će se pristupati vašem Moodle sustavu. -Moodle sustavu NIJE MOGUĆE pristupiti preko više URL-ova, odaberite onaj koji vam najviše odgovara. +$string['pathssubwwwroot'] = 'Unesite punu web adresu putem koje će se pristupati vašem Moodle sustavu. +Moodle sustavu NIJE MOGUĆE pristupiti preko više URL-ova, odaberite onaj koji vam najviše odgovara. Ako vaš poslužitelj ima višestruke javne adrese, onda morate postaviti tzv. permanent redirect na sve osim ove adrese. Ako je vaš poslužitelj dostupan i putem intraneta i Interneta, onda ovdje unesite javnu adresu i podesite DNS tako da vaši intranet korisnici mogu koristiti tu javnu adresu. Ako adresa nije točna, molimo unesite točnu adresu u vaš internet preglednik i ponovno pokrenite instalaciju s promijenjenim vrijednostima.'; diff --git a/install/lang/hu/install.php b/install/lang/hu/install.php index 771029f75d3..2bedea2a6ac 100644 --- a/install/lang/hu/install.php +++ b/install/lang/hu/install.php @@ -59,18 +59,18 @@ $string['pathsroparentdataroot'] = 'A felettes könyvtás ({$a->parent}) nem ír $string['pathssubadmindir'] = 'Egy pár webes gazdagép esetén az /admin speciális URL pl. a vezérlőpanel eléréséhez. Ez ütközik a Moodle admin oldalainak standard helyével. Javítás: a telepítésben nevezze át a rendszergazda könyvtárát, az új nevet pedig írja be ide. Például: moodleadmin. Ezzel helyrehozhatók a Moodle rendszergazdai ugrópontjai.'; $string['pathssubdataroot'] = 'Szüksége van egy helyre, ahol a Moodle mentheti a feltöltött állományokat. Ez a könyvtár a webszerver felhasználója (általában \'nobody\' vagy \'apache\') számára legyen mind olvasható, MIND ÍRHATÓ. Ha nem létezik, a telepítő megpróbálja létrehozni.'; $string['pathssubdirroot'] = 'Teljes útvonal a Moodle telepítéséhez. '; -$string['pathssubwwwroot'] = 'A Moodle elérésére használandó teljes webcím. A Moodle egyszerre több -címről nem érhető el. Ha portálja több címet használ, a jelen cím kivételével az összeshez állandó -átirányítást kell beállítania. Ha portálja mind intranetről, mind az internetről elérhető, a nyilvános -címet itt adja meg, a DNS-t pedig úgy állítsa be, hogy az intranetről a +$string['pathssubwwwroot'] = 'A Moodle elérésére használandó teljes webcím. A Moodle egyszerre több +címről nem érhető el. Ha portálja több címet használ, a jelen cím kivételével az összeshez állandó +átirányítást kell beállítania. Ha portálja mind intranetről, mind az internetről elérhető, a nyilvános +címet itt adja meg, a DNS-t pedig úgy állítsa be, hogy az intranetről a nyilvános cím is elérhető legyen. Ha a cím hibás, módosítsa böngészőjében az URL-t, hogy a telepítés egy másik értékkel induljon újra.'; $string['pathsunsecuredataroot'] = 'Az adatok gyökérkönyvtára nem biztonságos.'; $string['pathswrongadmindir'] = 'Nem létezik az admin könyvtár.'; $string['phpextension'] = '{$a} PHP-bővítmény'; $string['phpversion'] = 'PHP-verzió'; $string['phpversionhelp'] = 'A Moodle használatához legalább a PHP 4.3.0 vagy 5.1.0 verziója szükséges - (az 5.0.x több ismert gond miatt nem ajánlott). Az Ön által használt -verzió {$a}. Frissítse a PHP-verziót, vagy térjen át újabb PHP-verziót + (az 5.0.x több ismert gond miatt nem ajánlott). Az Ön által használt +verzió {$a}. Frissítse a PHP-verziót, vagy térjen át újabb PHP-verziót működtető gazdagépre! (5.0.x esetén visszatérhet a 4.4.x verzióhoz is)'; $string['welcomep10'] = '{$a->installername} ({$a->installerversion})'; $string['welcomep20'] = 'Azért látja ezt az oldalt, mert sikeresen telepítette és futtatja az {$a->packname} {$a->packversion} csomagot számítógépén. Gratulálunk!'; diff --git a/install/lang/hy/install.php b/install/lang/hy/install.php index 2ff3b58ce9e..17a6fc8038c 100644 --- a/install/lang/hy/install.php +++ b/install/lang/hy/install.php @@ -42,17 +42,17 @@ $string['installation'] = 'Տեղակայում'; $string['langdownloaderror'] = 'Ցավոք "{$a}" լեզուն տեղակայված չէ և տեղակայման գործընթացը կշարունակվի անգլերենով։'; $string['memorylimithelp'] = '

              PHP-ի հիշողության սահմանը սպասարկչի համար ներկայումս սահմանված է՝ {$a}։

              -

              հետագայում կարող եք հիշողության հետ կապված խնդիրներ ունենալ, +

              հետագայում կարող եք հիշողության հետ կապված խնդիրներ ունենալ, եթե Moodle-ում ունենաք շատ մոդուլներ և/կամ մեծ թվով օգտագործողներ։

              Խորհուրդ ենք տալիս PHP-ն կազմաձևել հնարավորին շատ հիշողության համար, օրինակ` 40M: Դրա համար կան մի քանի ձևեր, որոնք կարող եք փորձել.

              1. Եթե դուք կարող եք, վերակազմարկել PHP-ն --enable-memory-limit-ով։ Այն թույլ կտա Moodle-ին ինքնուրույն կարգաբերել հիշողության սահմանը։
              2. -
              3. Եթե Ձեզ մատչելի է php.ini ֆայլը, կարող եք փոխել memory_limit-ը՝ +
              4. Եթե Ձեզ մատչելի է php.ini ֆայլը, կարող եք փոխել memory_limit-ը՝ կարգաբերելով մոտավորապես 40M։
              5. Որոշ PHP սպասարկիչներում Moodle դիրեկտորիայում կարող եք ստեղծել .htaccess ֆայլը, որը պարունակում է այս տողը՝
                php_value memory_limit 40M
                -

                Սակայն որոշ սպասարկիչներում սա կկանխարգելի բոլոր PHP էջերի աշխատելը +

                Սակայն որոշ սպասարկիչներում սա կկանխարգելի բոլոր PHP էջերի աշխատելը (դուք կտեսնեք սխալներ էջերը դիտելիս), այսպիսով դուք պետք է ջնջեք .htaccess ֆայլը։

              '; $string['phpversion'] = 'PHP տարբերակ'; @@ -64,7 +64,7 @@ $string['welcomep10'] = '{$a->installername} ({$a->installerversion})'; $string['welcomep20'] = 'Դուք տեսնում եք այս էջը, քանի որ հաջողությամբ տեղակայել և գործարկել {$a->packname} {$a->packversion} փաթեթը։ Շնորհավորանքներ։'; $string['welcomep30'] = '{$a->installername} թողարկումը պարունակում է կիրառական ծրագրեր, որոնք ստեղծում են միջավայր, որտեղ Moodle կաշխատի, մասնավորապես՝'; $string['welcomep40'] = 'Այս փաթեթը պարունակում է նաև Moodle {$a->moodlerelease} ({$a->moodleversion})։'; -$string['welcomep50'] = 'Փաթեթի բոլոր կիրառական ծրագրերի օգտագործումը ղեկավարվում է դրանց համապատասխան արտոնագրերով: Ամբողջական {$a->installername} փաթեթը +$string['welcomep50'] = 'Փաթեթի բոլոր կիրառական ծրագրերի օգտագործումը ղեկավարվում է դրանց համապատասխան արտոնագրերով: Ամբողջական {$a->installername} փաթեթը բաց կոդով է և տրամադրվում է GPL արտոնագրով։'; $string['welcomep60'] = 'Հետևյալ էջերի որոշ հեշտ քայլերին հետևելով՝ կարող եք Moodle տեղակայել Ձեր համակարգչում։ Դուք կարող եք համաձայնվել լռելյայն կարգաբերումների հետ կամ փոխել դրանք՝ ձեր պահանջներին համապատասխան:'; $string['welcomep70'] = 'Սեղմեք ստորև գտնվող \'Հաջորդ\' կոճակը, որպեսզի անցնեք Moodle-ի կարգաբերման հաջորդ քայլին:'; diff --git a/install/lang/ka/install.php b/install/lang/ka/install.php index 1a3fc916062..6c84297ff1b 100644 --- a/install/lang/ka/install.php +++ b/install/lang/ka/install.php @@ -38,21 +38,21 @@ $string['dirroot'] = 'Moodle-ის დირექტორია'; $string['installation'] = 'ინსტალირება'; $string['memorylimithelp'] = '

              The PHP memory limit for your server is currently set to {$a}.

              -

              This may cause Moodle to have memory problems later on, especially +

              This may cause Moodle to have memory problems later on, especially if you have a lot of modules enabled and/or a lot of users.

              -

              We recommend that you configure PHP with a higher limit if possible, like 40M. +

              We recommend that you configure PHP with a higher limit if possible, like 40M. There are several ways of doing this that you can try:

                -
              1. If you are able to, recompile PHP with --enable-memory-limit. +
              2. If you are able to, recompile PHP with --enable-memory-limit. This will allow Moodle to set the memory limit itself.
              3. -
              4. If you have access to your php.ini file, you can change the memory_limit -setting in there to something like 40M. If you don\'t have access you might +
              5. If you have access to your php.ini file, you can change the memory_limit +setting in there to something like 40M. If you don\'t have access you might be able to ask your administrator to do this for you.
              6. -
              7. On some PHP servers you can create a .htaccess file in the Moodle directory +
              8. On some PHP servers you can create a .htaccess file in the Moodle directory containing this line:

                php_value memory_limit 40M

                -

                However, on some servers this will prevent all PHP pages from working +

                However, on some servers this will prevent all PHP pages from working (you will see errors when you look at pages) so you\'ll have to remove the .htaccess file.

              '; $string['phpversion'] = 'PHP ვარიანტი'; diff --git a/install/lang/ko/install.php b/install/lang/ko/install.php index ecf2c08b66c..4670869c0ac 100644 --- a/install/lang/ko/install.php +++ b/install/lang/ko/install.php @@ -51,7 +51,7 @@ $string['memorylimithelp'] = '

              현재 서버의 PHP 메모리 사용량은 {$a

              이는 추후에 무들이 원활히 구동되는 데 문제가 될 것입니다. 특히 여러분이 상당히 많은 모듈을 이용하고 또 사용자가 많아지게 되면 문제가 될 소지가 더 커집니다.

              -

              PHP가 사용할 수 있는 메모리 용랑을 40M 나 아니면 더 큰 값으로 설정하길 권합니다. 설정하는 방법은 +

              PHP가 사용할 수 있는 메모리 용랑을 40M 나 아니면 더 큰 값으로 설정하길 권합니다. 설정하는 방법은 여러가지가 있습니다.

              1. 만약 PHP소스를 재컴파일 할 수 있다면 옵션에 --enable-memory-limit 을 포함시켜 컴파일 하십시오. 이렇게 해 놓으면 무들 프로그램으로 메모리 용량을 제어할 수 있게 됩니다.
              2. @@ -71,7 +71,7 @@ $string['pathssubdataroot'] = '무들로 업로드된 파일을 저장할 수 $string['pathssubdirroot'] = '무들 설치를 위한 완전한 디렉토리 경로.'; $string['pathssubwwwroot'] = '무들을 접속할 수 있는 전체 웹 주소. 다중 주소를 이용해서는 무들에 접속할 수 없습니다. 만일 사이트가 복수의 공개 주소를 갖고 있는 경우, 여기에 입력한 주소 이외의 곳에서는 영구적인 redirect를 설정해 놓아야만 합니다. -만약 여러분의 사이트가 인터넷과 인트라넷 모두에서 접속할 수 있다면 여기에 공식적인 주소를 입력하고 DNS를 설정해서 인트라넷 사용자들도 공개 주소를 사용할 수 있게 해야할 것입니다. +만약 여러분의 사이트가 인터넷과 인트라넷 모두에서 접속할 수 있다면 여기에 공식적인 주소를 입력하고 DNS를 설정해서 인트라넷 사용자들도 공개 주소를 사용할 수 있게 해야할 것입니다. 만일 주소가 올바르지 않다면 브라우저에서 URL을 변경하여 다른 값으로 설치를 다시 시작 하십시요.'; $string['pathsunsecuredataroot'] = 'Dataroot 경로가 안전하지 않음'; $string['pathswrongadmindir'] = '관리자 경로가 존재하지 않음'; diff --git a/install/lang/lv/install.php b/install/lang/lv/install.php index 83200d68928..6d24b7e829c 100644 --- a/install/lang/lv/install.php +++ b/install/lang/lv/install.php @@ -43,16 +43,16 @@ $string['installation'] = 'Instalēšana'; $string['langdownloaderror'] = '“{$a}” valodas pakotne diemžēl netika instalēta. Instalēšana tiks turpināta angļu valodā.'; $string['memorylimithelp'] = '

                Pašlaik iestatītais PHP atmiņas apjoma ierobežojums jūsu serverī ir {$a}.

                -

                Sistēmā Moodle tas vēlāk var izraisīt atmiņas izmantošanas problēmas, it īpaši tad, +

                Sistēmā Moodle tas vēlāk var izraisīt atmiņas izmantošanas problēmas, it īpaši tad, ja būsit iespējojis lielu skaitu moduļu un/vai lietotāju.

                Ja iespējams, ieteicams konfigurēt PHP ar lielāku maksimālās atmiņas apjomu, piemēram, 40 MB. Ir vairāki veidi, kā to var izdarīt, piemēram:

                  -
                1. Ja iespējams, atkārtoti kompilējiet PHP, izmantojot --enable-memory-limit. +
                2. Ja iespējams, atkārtoti kompilējiet PHP, izmantojot --enable-memory-limit. Šādā gadījumā sistēma Moodle atmiņas apjoma ierobežojumu varēs iestatīt automātiski.
                3. Ja jums ir piekļuve php.ini failam, varat mainīt tajā esošo parametra memory_limit iestatījumu, piemēram, uz 40 MB. Ja jums nav piekļuves šim failam, palūdziet to izdarīt administratoram.
                4. Dažos PHP serveros Moodle direktorijā var izveidot failu .htaccess, kurā ir šāda rinda:

                  php_value memory_limit 40M

                  -

                  Tomēr dažos serveros tas neļaus darboties nevienai PHP lapai +

                  Tomēr dažos serveros tas neļaus darboties nevienai PHP lapai (atverot šīs lapas, tiks parādīti kļūdas ziņojumi), un fails .htaccess būs jānoņem.

                '; $string['phpversion'] = 'PHP versija'; @@ -61,17 +61,17 @@ $string['phpversionhelp'] = '

                Sistēmā Moodle jāizmanto PHP, kuras versija i

                Ir jājaunina PHP vai jāpāriet uz resursdatoru, kurā tiek izmantota jaunāka PHP versija.

                (Ja PHP versija ir 5.0.x, var arī atkāpties uz versiju 4.4.x)

                '; $string['welcomep10'] = '{$a->installername} ({$a->installerversion})'; -$string['welcomep20'] = 'Jūs redzat šo lapu, jo esat veiksmīgi instalējis un +$string['welcomep20'] = 'Jūs redzat šo lapu, jo esat veiksmīgi instalējis un palaidis savā datorā pakotni {$a->packname} {$a->packversion}. Apsveicam!'; -$string['welcomep30'] = 'Šajā {$a->installername} laidienā ir iekļautas lietojumprogrammas, +$string['welcomep30'] = 'Šajā {$a->installername} laidienā ir iekļautas lietojumprogrammas, kas paredzētas, lai izveidotu vidi, kurā darbosies sistēma Moodle, proti:'; $string['welcomep40'] = 'Pakotnē ir iekļauta arī sistēma Moodle {$a->moodlerelease} ({$a->moodleversion}).'; -$string['welcomep50'] = 'Visu šīs pakotnes lietojumprogrammu izmantošanu regulē attiecīgo - licenču nosacījumi. Visā {$a->installername} pakotnē ir iekļauts - atklātais pirmkods, un tā tiek izplatīta +$string['welcomep50'] = 'Visu šīs pakotnes lietojumprogrammu izmantošanu regulē attiecīgo + licenču nosacījumi. Visā {$a->installername} pakotnē ir iekļauts + atklātais pirmkods, un tā tiek izplatīta saskaņā ar GPL licences nosacījumiem.'; -$string['welcomep60'] = 'Nākamajās lapās tiks sniegti vienkārši norādījumi par to, kā - datorā konfigurēt un iestatīt sistēmu Moodle. Varat akceptēt noklusējuma +$string['welcomep60'] = 'Nākamajās lapās tiks sniegti vienkārši norādījumi par to, kā + datorā konfigurēt un iestatīt sistēmu Moodle. Varat akceptēt noklusējuma iestatījumus vai varat tos mainīt, lai pielāgotu savām vajadzībām.'; $string['welcomep70'] = 'Noklikšķiniet uz pogas Tālāk, lai turpinātu sistēmas Moodle instalēšanu.'; $string['wwwroot'] = 'Tīmekļa adrese'; diff --git a/install/lang/mk/install.php b/install/lang/mk/install.php index a8167d75d1e..935b4b5d230 100644 --- a/install/lang/mk/install.php +++ b/install/lang/mk/install.php @@ -42,16 +42,16 @@ $string['installation'] = 'Инсталација'; $string['langdownloaderror'] = 'За жал, јазикот "{$a}" не беше инсталиран. Инсталацискиот процес ќе продолжи на англиски.'; $string['memorylimithelp'] = '

                Прагот на меморијата кај PHP за Вашиот компјутер моментално е подесена на {$a}.

                -

                Ова може да предизвика проблеми со меморијата подоцна, +

                Ова може да предизвика проблеми со меморијата подоцна, посебно ако имате голем број на овозможени модули (единици) и/или голем број на корисници.

                Ви препорачуваме да го конфигурирате PHP со најголем можен праг на меморија, како што е 16М. Еве неколку начини за да го постигнете тоа :

                  -
                1. Ако сте способен, повторно компајлирајте PHP со--enable-memory-limit. +
                2. Ако сте способен, повторно компајлирајте PHP со--enable-memory-limit. Ова ќе овозможи на Moodle сам да го постави прагот на меморијата.
                3. -
                4. Ако имате пристап до Вашата датотека php.ini, можете да го промените memory_limit - на 16М. Во спротивно, ако немате пристап, можеби ќе бидете способни +
                5. Ако имате пристап до Вашата датотека php.ini, можете да го промените memory_limit + на 16М. Во спротивно, ако немате пристап, можеби ќе бидете способни да го замолите администраторот да ја заврши оваа работа.
                6. На некои PHP сервери, можете да креирате датотека .htaccess во директориумот на Moodle, која ги содржи следниве линии : diff --git a/install/lang/mn/install.php b/install/lang/mn/install.php index 482b10f68b2..7e8947d5b1e 100644 --- a/install/lang/mn/install.php +++ b/install/lang/mn/install.php @@ -60,7 +60,7 @@ $string['welcomep10'] = '{$a->installername} ({$a->installerversion})'; $string['welcomep20'] = 'Та {$a->packname} {$a->packversion} багцыг компьютер дээрээ амжилттай суулгаж ажиллуулсан тул энэ хуудсыг харж байна. Баяр хүргэе!'; $string['welcomep30'] = '{$a->installername} -ний энэ хувилбар нь Mooдл ажиллах орчныг үүсгэх програмууд агуулсан, тэдгээр нь:'; $string['welcomep40'] = 'Энэ багц нь мөн Mooдл {$a->moodlerelease} ({$a->moodleversion})-г агуулсан.'; -$string['welcomep50'] = 'Энэ багц доторх бүх програмууд нь өөрсдийн лизенцтэй. Бүрэн {$a->installername} багц нь +$string['welcomep50'] = 'Энэ багц доторх бүх програмууд нь өөрсдийн лизенцтэй. Бүрэн {$a->installername} багц нь open source бөгөөд GPL -ийн лизенцийн дор түгээгддэг.'; $string['welcomep60'] = 'Дараагийн хуудсууд нь компьютер дээрээ Mooдл тохируулах тааруулах энгийн алхмуудыг агуулсан байгаа. Та анхны утгын тохиргоонуудыг хүлээн авч болно, эсвэл өөрийн хэрэгцээнд нийцүүлэн өөрчилж болно.'; $string['welcomep70'] = 'Mooдлээ тохируулахын тулд доорх “Үргэлжлүүлэх” товчин дээр дарж цааж явна уу.'; diff --git a/install/lang/nl/admin.php b/install/lang/nl/admin.php index 73dc271a02a..8bf5c86f3b3 100644 --- a/install/lang/nl/admin.php +++ b/install/lang/nl/admin.php @@ -36,7 +36,7 @@ $string['cliincorrectvalueerror'] = 'Fout, waarde "{$a->value}" voor de optie "{ $string['cliincorrectvalueretry'] = 'Foute waarde. Probeer opnieuw'; $string['clitypevalue'] = 'type waarde'; $string['clitypevaluedefault'] = 'type waarde, druk op Enter om de standaardwaarde te gebruiken ({$a})'; -$string['cliunknowoption'] = 'Onherkenbare opties: +$string['cliunknowoption'] = 'Onherkenbare opties: {$a} gebruik --help optie.'; $string['cliyesnoprompt'] = 'typ j (ja) of n (nee)'; diff --git a/install/lang/no/install.php b/install/lang/no/install.php index 8abb31663f5..650c985b2d4 100644 --- a/install/lang/no/install.php +++ b/install/lang/no/install.php @@ -51,7 +51,7 @@ $string['memorylimithelp'] = '

                  PHP minnegrensen for serveren din er nå satt t

                  Dette kan skape minneproblemer for Moodle senere, spesielt hvis du har mange moduler tillatt og/eller mange brukere.

                  Vi anbefaler at du konfigurer PHP med en høyere grense enn mulig, for eksepmel 40M. Det er flere måter å gjøre dette på.:

                    -
                  1. Hvis du har muligheten, rekompiler PHP med--enable-memory-limit. +
                  2. Hvis du har muligheten, rekompiler PHP med--enable-memory-limit. Dette vil tillate Moodle å sette minnegrensen selv.
                  3. Hvis du har tilgang til php.ini fila di, kan du endre memory_limit innstillinga der til omtrent 40M. Hvis du ikke har tilgang kan du be administrator gjøre dette for deg.
                  4. På noen PHP-servere kan du lage en .htaccess fil i Moodlemappen som inneholder denne linjen: diff --git a/install/lang/pl/install.php b/install/lang/pl/install.php index 630bf341d24..92f3b0a2b97 100644 --- a/install/lang/pl/install.php +++ b/install/lang/pl/install.php @@ -68,7 +68,7 @@ $string['pathsunsecuredataroot'] = 'Lokalizacja głównego katalogu danych nie j $string['pathswrongadmindir'] = 'Katalog admin nie istnieje'; $string['phpextension'] = '{$a} rozszerzenie PHP'; $string['phpversion'] = 'Wersja PHP'; -$string['phpversionhelp'] = '

                    Moodle wymaga wersji PHP co najmniej 4.3.0 lub 5.1.0 (5.0.x posiada kilka znanych problemów).

                    +$string['phpversionhelp'] = '

                    Moodle wymaga wersji PHP co najmniej 4.3.0 lub 5.1.0 (5.0.x posiada kilka znanych problemów).

                    Obecnie jest uruchomiona wersja {$a}

                    Musisz uaktualnić wersję PHP lub przenieść na host z nowszą wersją PHP!
                    (W przypadku wersji 5.0.x możesz dokonać downgrade do wersji 4.4.x)

                    '; $string['welcomep10'] = '{$a->installername} ({$a->installerversion})'; diff --git a/install/lang/pt/admin.php b/install/lang/pt/admin.php index 783189c0c10..c05e227eefe 100644 --- a/install/lang/pt/admin.php +++ b/install/lang/pt/admin.php @@ -36,8 +36,8 @@ $string['cliincorrectvalueerror'] = 'Erro. Valor "{$a->value}" incorreto para "{ $string['cliincorrectvalueretry'] = 'Valor incorreto, por favor tente novamente'; $string['clitypevalue'] = 'valor do tipo'; $string['clitypevaluedefault'] = 'Escreva o valor. Ou Enter para usar o valor por omissão ({$a}).'; -$string['cliunknowoption'] = 'Opções desconhecidas: -{$a} +$string['cliunknowoption'] = 'Opções desconhecidas: +{$a} Por favor use a opção --help'; $string['cliyesnoprompt'] = 'digite s (para sim) ou n (para não)'; $string['environmentrequireinstall'] = 'é necessário estar instalada/ativa'; diff --git a/install/lang/pt/install.php b/install/lang/pt/install.php index 2c32390404f..28b379e21ec 100644 --- a/install/lang/pt/install.php +++ b/install/lang/pt/install.php @@ -69,7 +69,7 @@ $string['pathshead'] = 'Confirmar caminhos'; $string['pathsrodataroot'] = 'A diretoria dataroot não tem permissões de escrita.'; $string['pathsroparentdataroot'] = 'O diretório pai ({$a->parent}) não tem permissões de escrita. O programa de instalação não conseguiu criar o diretório de dados ({$a->dataroot})'; $string['pathssubadmindir'] = 'Alguns (poucos) alojamentos web usam /admin como um URL especial para permitir o acesso ao control panel ou a outras funcionalidades. -Infelizmente esta designação entra em conflito com a localização que o Moodle atribui às páginas de administração. +Infelizmente esta designação entra em conflito com a localização que o Moodle atribui às páginas de administração. A solução passa por renomear o diretório admin da sua instalação do Moodle e colocando o nome escolhido aqui. Por exemplo: moodleadmin. Isto corrige os links de administração no Moodle.'; $string['pathssubdataroot'] = 'É necessário um local onde o Moodle possa gravar os ficheiros submetidos. Este diretório tem que ter permissões de leitura e ESCRITA pelo servidor web (normalmente \'nobody\' ou \'apache\'), mas não pode estar acessível através da web. O programa de instalação tentará criar este diretório se ele ainda não existir.'; diff --git a/install/lang/pt_br/install.php b/install/lang/pt_br/install.php index 15b6f3de0a0..fa8b9b95b99 100644 --- a/install/lang/pt_br/install.php +++ b/install/lang/pt_br/install.php @@ -34,6 +34,7 @@ $string['admindirname'] = 'Diretório admin'; $string['availablelangs'] = 'Lista de idiomas disponíveis'; $string['chooselanguagehead'] = 'Escolha um idioma'; $string['chooselanguagesub'] = 'Por favor, escolha o idioma para a instalação.Este idioma também será utilizado como idioma padrão do site, embora você possa mudar mais tarde.'; +$string['clialreadyconfigured'] = 'Arquivo config.php já existente. Por favor use admin/cli/install_database.php se você quer instalar este site'; $string['clialreadyinstalled'] = 'O arquivo config.php já existe, por favor use admin/cli/upgrade.php, se você quiser atualizar o seu site.'; $string['cliinstallheader'] = 'Programa de instalação por linha de comando do Moodle {$a}'; $string['databasehost'] = 'Host da base de dados'; @@ -82,7 +83,7 @@ $string['phpversionhelp'] = '

                    Moodle requer a versão 4.3.0 de PHP ou posterio

                    Atualize a versão do PHP!

                    (atenção, a versão 5.0.x tem muitos problemas - use a versão 5.1.0 ou a 4.4)'; $string['welcomep10'] = '{$a->installername} ({$a->installerversion})'; -$string['welcomep20'] = 'Se você chegou nesta página, o pacote {$a->packname} {$a->packversion} foi instalado. Parabéns!'; +$string['welcomep20'] = 'Você está vendo esa página pois instalou com sucesso o pacote{$a->packname} {$a->packversion}. Parabéns!'; $string['welcomep30'] = 'Esta versão do {$a->installername} inclui as aplicações para a criação de um ambiente em que Moodle possa operar:'; $string['welcomep40'] = 'O pacote inclui também o Moodle {$a->moodlerelease} ({$a->moodleversion}).'; $string['welcomep50'] = 'O uso das aplicações incluídas neste pacote é regulamentado pelas respectivas licenças. O instalador completo {$a->installername} é open source e é distribuído com uma licença GPL.'; diff --git a/install/lang/ru/install.php b/install/lang/ru/install.php index c715ae48451..a1cab1b9f2e 100644 --- a/install/lang/ru/install.php +++ b/install/lang/ru/install.php @@ -53,12 +53,12 @@ $string['memorylimithelp'] = '

                    Сейчас ограничение памят

                    Из-за этого у через какое-то время у Moodle могут возникнуть проблемы с памятью, особенно если у Вас будет много модулей и/или пользователей.

                    -

                    Мы рекомендуем, если возможно, установить в PHP более высокое ограничение памяти, например 40M. +

                    Мы рекомендуем, если возможно, установить в PHP более высокое ограничение памяти, например 40M. Это можно попробовать сделать следующими способами:

                      -
                    1. Если есть возможность, перекомпилируёте PHP с ключом --enable-memory-limit. +
                    2. Если есть возможность, перекомпилируёте PHP с ключом --enable-memory-limit. В этом случае Moodle сможет самостоятельна установить ограничение памяти.
                    3. -
                    4. Если у Вас есть доступ к файлу php.ini, Вы можете изменить параметр memory_limit +
                    5. Если у Вас есть доступ к файлу php.ini, Вы можете изменить параметр memory_limit на что-нибудь типа 40M. Если доступа у Вас нет, может быть у Вас есть возможность попросить администратора сделать это.
                    6. На некоторых серверах PHP можно создать в каталоге Moodle файл .htaccess содержащий следующую строку:
                      php_value memory_limit 40M
                      diff --git a/install/lang/sl/install.php b/install/lang/sl/install.php index c32d5bb6da8..5aac8db9311 100644 --- a/install/lang/sl/install.php +++ b/install/lang/sl/install.php @@ -52,18 +52,18 @@ $string['memorylimithelp'] = '

                      Omejitev pomnilnika PHP je trenutno na vašem s

                      To lahko povzroči, da bo imel Moodle pozneje težave s pomnilnikom. Še posebej, če imate vključenih veliko modulov oziroma veliko uporabnikov.

                      -

                      Priporočamo, da konfigurirate PHP z višjo omejitvijo, če je možno npr. 40M. +

                      Priporočamo, da konfigurirate PHP z višjo omejitvijo, če je možno npr. 40M. To lahko poskusite storiti na več načinov:

                        -
                      1. Če lahko, ponovno prevedite PHP z --enable-memory-limit. +
                      2. Če lahko, ponovno prevedite PHP z --enable-memory-limit. To bo omogočilo, da bo Moodle sam nastavil omejitev pomnilnik zase.
                      3. -
                      4. Če imate dostop do vaše datoteke php.ini, lahko spremenite vrednost memory_limit - v tej datoteki na, recimo, 40M. Če nimate dostopa, boste morda +
                      5. Če imate dostop do vaše datoteke php.ini, lahko spremenite vrednost memory_limit + v tej datoteki na, recimo, 40M. Če nimate dostopa, boste morda lahko prosili vašega skrbnika, da to naredi za vas.
                      6. -
                      7. Na nekaterih strežnikih PHP lahko ustvarite datoteko .htaccess v imeniku Moodle, +
                      8. Na nekaterih strežnikih PHP lahko ustvarite datoteko .htaccess v imeniku Moodle, ki naj vsebuje to vrstico:

                        php_value memory_limit 40M

                        -

                        Vendar lahko to prepreči delovanje vseh PHP strani +

                        Vendar lahko to prepreči delovanje vseh PHP strani (ob prikazu strani boste videli napake) in boste morali odstraniti datoteko .htaccess.

                      '; $string['paths'] = 'Poti'; @@ -84,17 +84,17 @@ $string['phpversionhelp'] = '

                      Moodle zahteva različico PHP vsaj 4.3.0 ali 5.1

                      Posodobiti in nadgraditi morate PHP ali premakniti program na strežnik s novejšo različico PHP!
                      (V primeru različice 5.0.x lahko namestite tudi različico 4.4.x)

                      '; $string['welcomep10'] = '{$a->installername} ({$a->installerversion})'; -$string['welcomep20'] = 'To stran vidite, ker ste uspešno namestili in +$string['welcomep20'] = 'To stran vidite, ker ste uspešno namestili in zagnali paket {$a->packname} {$a->packversion} na vašem računalniku. Čestitamo!'; -$string['welcomep30'] = 'Ta različica {$a->installername} vključuje aplikacije +$string['welcomep30'] = 'Ta različica {$a->installername} vključuje aplikacije za ustvarjanje okolja v katerem bo deloval Moodle in sicer:'; $string['welcomep40'] = 'Ta paket vključuje tudi Moodle {$a->moodlerelease} ({$a->moodleversion}).'; -$string['welcomep50'] = 'Uporabo vseh aplikacij v tem paketu določajo njihove ustrezne - licence. Celoten paket {$a->installername} je - odprta koda in se razširja +$string['welcomep50'] = 'Uporabo vseh aplikacij v tem paketu določajo njihove ustrezne + licence. Celoten paket {$a->installername} je + odprta koda in se razširja pod licenco GPL.'; -$string['welcomep60'] = 'Naslednje strani vas bodo popeljale skozi nekaj enostavno sledljivih korakov za - konfiguracijo in nastavitev Moodle na vašem računalniku. Sprejmete lahko privzete +$string['welcomep60'] = 'Naslednje strani vas bodo popeljale skozi nekaj enostavno sledljivih korakov za + konfiguracijo in nastavitev Moodle na vašem računalniku. Sprejmete lahko privzete nastavitve ali jih, če tako želite, spremenite, da bodo ustrezale vašim potrebam.'; $string['welcomep70'] = 'Kliknite spodnji gumb "Naprej" za nadaljevanje nastavitve Moodle.'; $string['wwwroot'] = 'Spletni naslov'; diff --git a/install/lang/sm/install.php b/install/lang/sm/install.php index 0a3b2bcaf73..8eb9d888140 100644 --- a/install/lang/sm/install.php +++ b/install/lang/sm/install.php @@ -37,21 +37,21 @@ $string['dirroot'] = 'Auala atu i le Moodle'; $string['installation'] = 'Fa\'atu/Install'; $string['memorylimithelp'] = '

                      The PHP memory limit for your server is currently set to {$a}.

                      -

                      This may cause Moodle to have memory problems later on, especially +

                      This may cause Moodle to have memory problems later on, especially if you have a lot of modules enabled and/or a lot of users. -

                      We recommend that you configure PHP with a higher limit if possible, like 40M. +

                      We recommend that you configure PHP with a higher limit if possible, like 40M. There are several ways of doing this that you can try:

                        -
                      1. If you are able to, recompile PHP with --enable-memory-limit. +
                      2. If you are able to, recompile PHP with --enable-memory-limit. This will allow Moodle to set the memory limit itself. -
                      3. If you have access to your php.ini file, you can change the memory_limit - setting in there to something like 40M. If you don\'t have access you might +
                      4. If you have access to your php.ini file, you can change the memory_limit + setting in there to something like 40M. If you don\'t have access you might be able to ask your administrator to do this for you. -
                      5. On some PHP servers you can create a .htaccess file in the Moodle directory +
                      6. On some PHP servers you can create a .htaccess file in the Moodle directory containing this line:

                        php_value memory_limit 40M

                        -

                        However, on some servers this will prevent all PHP pages from working +

                        However, on some servers this will prevent all PHP pages from working (you will see errors when you look at pages) so you\'ll have to remove the .htaccess file.

                      '; $string['phpversion'] = 'Liliuga PHP'; diff --git a/install/lang/sr_cr/install.php b/install/lang/sr_cr/install.php index 676ee680716..b4b78e7234b 100644 --- a/install/lang/sr_cr/install.php +++ b/install/lang/sr_cr/install.php @@ -69,8 +69,8 @@ $string['pathsroparentdataroot'] = 'Није могућ упис у надређ $string['pathssubadmindir'] = 'Врло мали број веб сервера користи /admin као специјални URL за приступ разним подешавањима (контролни панел и сл.). Нажалост, то доводи до конфликта са стандардном локацијом за администраторске странице у Moodleu. Овај проблем можете решити тако што ћете променити име администраторског директоријума у вашој инсталацији, и овде уписати то ново име. На пример moodleadmin. Ово подешавање ће преправити администраторске линкове у Moodle систему.'; $string['pathssubdataroot'] = 'Потребан вам је простор где ће Moodle чувати постављене датотеке. Овај директоријум треба да буде подешен тако да се може читати и у њега уписивати од стране корисника веб сервера (обично \'nobody\' или \'apache\'), али истовремено мора бити доступан директно преко веба. Уколико овај директоријум не постоји Moodle ће покушати да га креира током инсталације.'; $string['pathssubdirroot'] = 'Пуна путања до директотијума за инсталацију Moodlea.'; -$string['pathssubwwwroot'] = 'Пуна веб адреса путем које ће се приступати Moodleu. Није могуће приступати Moodleu користећи више адреса. -Ако ваш сајт има више јавних адреса онда на свима морате да подесите перманентне редирекције осим на овој. +$string['pathssubwwwroot'] = 'Пуна веб адреса путем које ће се приступати Moodleu. Није могуће приступати Moodleu користећи више адреса. +Ако ваш сајт има више јавних адреса онда на свима морате да подесите перманентне редирекције осим на овој. Ако је ваш сајт доступан са интернета али и из интранет окружења овде употребите јавну адресу и подесите DNS тако да и интранет корисници могу да користе јавну адресу. Ако је адреса нетачна промените URL у свом веб читачу да бисте поново покренули инсталацију са другачијом вредношћу.'; $string['pathsunsecuredataroot'] = 'Dataroot локација није безбедна'; diff --git a/install/lang/sr_lt/install.php b/install/lang/sr_lt/install.php index bdc611b35f2..0cfa2e3a55d 100644 --- a/install/lang/sr_lt/install.php +++ b/install/lang/sr_lt/install.php @@ -69,8 +69,8 @@ $string['pathsroparentdataroot'] = 'Nije moguć upis u nadređeni direktorijum ( $string['pathssubadmindir'] = 'Vrlo mali broj veb servera koristi /admin kao specijalni URL za pristup raznim podešavanjima (kontrolni panel i sl.). Nažalost, to dovodi do konflikta sa standardnom lokacijom za administratorske stranice u Moodleu. Ovaj problem možete rešiti tako što ćete promeniti ime administratorskog direktorijuma u vašoj instalaciji, i ovde upisati to novo ime. Na primer moodleadmin. Ovo podešavanje će prepraviti administratorske linkove u Moodle sistemu.'; $string['pathssubdataroot'] = 'Potreban vam je prostor gde će Moodle čuvati postavljene datoteke. Ovaj direktorijum treba da bude podešen tako da se može čitati i u njega upisivati od strane korisnika veb servera (obično \'nobody\' ili \'apache\'), ali istovremeno mora biti dostupan direktno preko veba. Ukoliko ovaj direktorijum ne postoji Moodle će pokušati da ga kreira tokom instalacije.'; $string['pathssubdirroot'] = 'Puna putanja do direktotijuma za instalaciju Moodlea.'; -$string['pathssubwwwroot'] = 'Puna veb adresa putem koje će se pristupati Moodleu. Nije moguće pristupati Moodleu koristeći više adresa. -Ako vaš sajt ima više javnih adresa onda na svima morate da podesite permanentne redirekcije osim na ovoj. +$string['pathssubwwwroot'] = 'Puna veb adresa putem koje će se pristupati Moodleu. Nije moguće pristupati Moodleu koristeći više adresa. +Ako vaš sajt ima više javnih adresa onda na svima morate da podesite permanentne redirekcije osim na ovoj. Ako je vaš sajt dostupan sa interneta ali i iz intranet okruženja ovde upotrebite javnu adresu i podesite DNS tako da i intranet korisnici mogu da koriste javnu adresu. Ako je adresa netačna promenite URL u svom veb čitaču da biste ponovo pokrenuli instalaciju sa drugačijom vrednošću.'; $string['pathsunsecuredataroot'] = 'Dataroot lokacija nije bezbedna'; diff --git a/install/lang/ta/install.php b/install/lang/ta/install.php index 4d4eee7f10a..05782f1d0b5 100644 --- a/install/lang/ta/install.php +++ b/install/lang/ta/install.php @@ -42,21 +42,21 @@ $string['installation'] = 'Installation'; $string['langdownloaderror'] = 'Unfortunately the language "{$a}" was not installed. The installation process will continue in English.'; $string['memorylimithelp'] = '

                      The PHP memory limit for your server is currently set to {$a}.

                      -

                      This may cause Moodle to have memory problems later on, especially +

                      This may cause Moodle to have memory problems later on, especially if you have a lot of modules enabled and/or a lot of users.

                      -

                      We recommend that you configure PHP with a higher limit if possible, like 40M. +

                      We recommend that you configure PHP with a higher limit if possible, like 40M. There are several ways of doing this that you can try:

                        -
                      1. If you are able to, recompile PHP with --enable-memory-limit. +
                      2. If you are able to, recompile PHP with --enable-memory-limit. This will allow Moodle to set the memory limit itself.
                      3. -
                      4. If you have access to your php.ini file, you can change the memory_limit - setting in there to something like 40M. If you don\'t have access you might +
                      5. If you have access to your php.ini file, you can change the memory_limit + setting in there to something like 40M. If you don\'t have access you might be able to ask your administrator to do this for you.
                      6. -
                      7. On some PHP servers you can create a .htaccess file in the Moodle directory +
                      8. On some PHP servers you can create a .htaccess file in the Moodle directory containing this line:

                        php_value memory_limit 40M

                        -

                        However, on some servers this will prevent all PHP pages from working +

                        However, on some servers this will prevent all PHP pages from working (you will see errors when you look at pages) so you\'ll have to remove the .htaccess file.

                      '; $string['phpversion'] = 'பிஎச்பி பதிப்பு'; @@ -65,17 +65,17 @@ $string['phpversionhelp'] = '

                      Moodle requires a PHP version of at least 4.3.0

                      You must upgrade PHP or move to a host with a newer version of PHP!
                      (In case of 5.0.x you could also downgrade to 4.4.x version)

                      '; $string['welcomep10'] = '{$a->installername} ({$a->installerversion})'; -$string['welcomep20'] = 'You are seeing this page because you have successfully installed and +$string['welcomep20'] = 'You are seeing this page because you have successfully installed and launched the {$a->packname} {$a->packversion} package in your computer. Congratulations!'; -$string['welcomep30'] = 'This release of the {$a->installername} includes the applications +$string['welcomep30'] = 'This release of the {$a->installername} includes the applications to create an environment in which Moodle will operate, namely:'; $string['welcomep40'] = 'The package also includes Moodle {$a->moodlerelease} ({$a->moodleversion}).'; -$string['welcomep50'] = 'The use of all the applications in this package is governed by their respective - licences. The complete {$a->installername} package is - open source and is distributed +$string['welcomep50'] = 'The use of all the applications in this package is governed by their respective + licences. The complete {$a->installername} package is + open source and is distributed under the GPL license.'; -$string['welcomep60'] = 'The following pages will lead you through some easy to follow steps to - configure and set up Moodle on your computer. You may accept the default +$string['welcomep60'] = 'The following pages will lead you through some easy to follow steps to + configure and set up Moodle on your computer. You may accept the default settings or, optionally, amend them to suit your own needs.'; $string['welcomep70'] = 'Click the "Next" button below to continue with the set up of Moodle.'; $string['wwwroot'] = 'இணைய முகவரி'; diff --git a/install/lang/ta_lk/install.php b/install/lang/ta_lk/install.php index 06f4810c169..13ebd278847 100644 --- a/install/lang/ta_lk/install.php +++ b/install/lang/ta_lk/install.php @@ -55,7 +55,7 @@ $string['memorylimithelp'] = '

                      உங்களுடைய சேவையக

                    7. சில PHP சேவையகங்களில் நீங்கள் இந்த வரியைக் கொண்டிருக்கின்ற Moodle கோப்புத் தொகுதியிலுள்ள ஒரு .htaccess கோப்பை உருவாக்க முடிகிறது.

                      php_பெறுமதி நினைவக_வரையறை 40M

                      - +

                      எப்படியாயினும், சில சேவையகங்களில் இது வேலை செய்வதிலிருந்து அனைத்து PHP பக்கங்களை தடுக்கும்(நீங்கள் பக்கங்களை பார்க்கின்ற போது தவறுகளை பார்ப்பீர்கள்) ஆகையால் நீங்கள் .htaccess கோப்பை நீக்க வேண்டியிருக்கும்.

                    '; $string['paths'] = 'பாதைகள்'; @@ -68,7 +68,7 @@ $string['phpversionhelp'] = '

                    Moodle குறைந்தளவு ஒரு (5.0.x இன் சம்பவத்தில்,நீங்கள் 4.4.x பதிப்பிற்கு கீழ்த்தரப்படுத்த முடிகின்றது)

                    '; $string['welcomep10'] = '{$a->installername} ({$a->installerversion})'; -$string['welcomep20'] = 'நீங்கள் வெற்றிகரமாக நிறுவி ஆரம்பித்துள்ளதன் காரணமாக நீங்கள் இப்பக்கத்தை பார்க்கிறீர்கள் +$string['welcomep20'] = 'நீங்கள் வெற்றிகரமாக நிறுவி ஆரம்பித்துள்ளதன் காரணமாக நீங்கள் இப்பக்கத்தை பார்க்கிறீர்கள் {$a->packname} {$a->packversion} உங்கள் கணனியில் உள்ள பொதியில் உள்ளது.வாழ்த்துக்கள்!'; $string['welcomep30'] = '{$a->installername}ன் வெளியீடு, Moodle இயங்கும் என்கின்ற ஒரு சூழலை உருவாக்குவதற்கு பயன்பாட்டு மென்பொருளை உள்ளடக்குகிறது.'; $string['welcomep40'] = 'பொதி, Moodle {$a->moodlerelease} ({$a->moodleversion}) ஐயும் உள்ளடக்கியிருக்கின்றது.'; diff --git a/install/lang/th/install.php b/install/lang/th/install.php index ffbfb560aab..92d663811b6 100644 --- a/install/lang/th/install.php +++ b/install/lang/th/install.php @@ -48,7 +48,7 @@ $string['memorylimithelp'] = '

                    ค่าความจำสูงสุด

                      -
                    1. รีคอมไพล์ PHP ใหม่ โดยเพิ่มคำสั่ง --enable-memory-limit ซึ่งเป็นการตั้งค่าให้ moodle กำหนดขีดจำกัดค่าสูงสุดเอง +
                    2. รีคอมไพล์ PHP ใหม่ โดยเพิ่มคำสั่ง --enable-memory-limit ซึ่งเป็นการตั้งค่าให้ moodle กำหนดขีดจำกัดค่าสูงสุดเอง
                    3. ถ้าคุณสามารถแก้ไขไฟล์ php.ini ได้ด้วยตนเองก็สามารถเปลี่ยนค่า memory_limit ให้เป็นค่าอื่นได้เช่น 40M แต่ถ้าไม่สามารถเปลี่ยนค่านี้ได้ด้วยตนเองให้แจ้งผู้ดูแลระบบแก้ไข @@ -56,7 +56,7 @@ $string['memorylimithelp'] = '

                      ค่าความจำสูงสุด

                      php_value memory_limit 40M

                      -

                      อย่างไรก็ตามในบางเซิร์ฟเวอร์คุณไม่สามารถใช้ วิธีนี้ได้ โดยจะมีการแสดง error ขึ้นมาคุณจำเป็นต้องลบไฟล์ดังกล่าวนี้ทิ้ง +

                      อย่างไรก็ตามในบางเซิร์ฟเวอร์คุณไม่สามารถใช้ วิธีนี้ได้ โดยจะมีการแสดง error ขึ้นมาคุณจำเป็นต้องลบไฟล์ดังกล่าวนี้ทิ้ง

                    '; $string['phpversion'] = 'PHP เวอร์ชัน'; $string['phpversionhelp'] = '

                    Moodle จำเป็นต้องใช้ PHP เวอร์ชัน 4.1.0 เป็นอย่างน้อย

                    @@ -68,7 +68,7 @@ $string['welcomep10'] = '{$a->installername} ({$a->installerversion})'; $string['welcomep20'] = 'ท่านได้ทำการติดตั้ง{$a->packname} {$a->packversion} สำเร็จแล้ว'; $string['welcomep30'] = 'เวอร์ชั่น {$a->installername}รวมโปรแกรมสำหรับสร้างความให้กับระบบซึ่ง Moodle สามารถทำงานได้'; $string['welcomep40'] = 'แพ็กเกจนี้รวม Moodle {$a->moodlerelease} ({$a->moodleversion}).'; -$string['welcomep50'] = 'การใช้งานโปรแกรมต่าง ๆ ในแพ็กเกจนี้สามารถทำได้โดยไม่ละเมิดสัญญานุญาตของแต่ละโปรแกรม โปแกรม{$a->installername}เต็มรูปแบบนั้นจัดเป็นโปรแกรมประเภท +$string['welcomep50'] = 'การใช้งานโปรแกรมต่าง ๆ ในแพ็กเกจนี้สามารถทำได้โดยไม่ละเมิดสัญญานุญาตของแต่ละโปรแกรม โปแกรม{$a->installername}เต็มรูปแบบนั้นจัดเป็นโปรแกรมประเภท โอเพ่นซอร์ส และเผยแพร่ภายใต้สํญญานุญาต GPL'; $string['welcomep60'] = 'หน้าถัดจากนี้ไปจะเป็นการตั้งค่า Moodle บนคอมพิวเตอร์คุณสามารถยอมรับค่าที่ตั้งไว้ทั้งหมดหรือเปลี่ยนแปลงให้เหมาะกับความต้องการ'; $string['welcomep70'] = 'คลิกที่ "ต่อไป" เพื่อติดตั้ง Moodle ต่อไป'; diff --git a/install/lang/tl/install.php b/install/lang/tl/install.php index 20e086cda93..f5e241519f9 100644 --- a/install/lang/tl/install.php +++ b/install/lang/tl/install.php @@ -48,15 +48,15 @@ $string['memorylimithelp'] = '

                    Ang memory limit ng PHP para sa server mo ay ka

                    Iminumungkahi namin na isaayos mo ang PHP na may mas mataas na limit kung maaari, tulad ng 40M. May iba\'t-ibang paraan na magagawa kayo upang ito ay maiisakatuparan:

                      -
                    1. Kunga maaari mong gawin, muling ikompayl ang PHP na may --enable-memory-limit. +
                    2. Kunga maaari mong gawin, muling ikompayl ang PHP na may --enable-memory-limit. Pahihintulutan nito ang Moodle na itakda ang memory limit sa sarili nito.
                    3. -
                    4. Kung mapapasok mo ang iyong sakong php.ini, mababago mo ang memory_limit +
                    5. Kung mapapasok mo ang iyong sakong php.ini, mababago mo ang memory_limit na kaayusan doon at gawin itong mga 40M. Kung wala kang karapatang pasukin ito baka puwede mong hilingin sa administrador na gawin ito para sa iyo.
                    6. Sa ilang PHP serve maaari kang lumikha ng isang sakong .htaccess sa bugsok ng Moodle na naglalaman ng linyang ito:

                      php_value memory_limit 40M

                      -

                      Subali\'t sa ilang server ay pipigilin nito ang paggana ng lahat ng pahinang PHP +

                      Subali\'t sa ilang server ay pipigilin nito ang paggana ng lahat ng pahinang PHP (makakakita ka ng mga error kapag tumingin ka sa mga pahina) kaya\'t kakailanganin mong tanggalin ang sakong .htaccess.

                    '; $string['phpversion'] = 'Bersiyon ng PHP'; diff --git a/install/lang/to/install.php b/install/lang/to/install.php index fab3b5b524a..254fcdb9c3c 100644 --- a/install/lang/to/install.php +++ b/install/lang/to/install.php @@ -39,16 +39,16 @@ $string['memorylimithelp'] = '

                    Koe memolii PHP limiti ki ho\'o seeva \'oku lo

                    \'E malava eni ke fakalanga\'i e Muutolo ke \'iai ha ngaahi memolii palopalema \'a mui ange , tautautefito kapau \'oku ma\'u ha ngaahi motiula \'oku malava pea/mo ha kau \'iusa tokolahi. -

                    \'Oku mau faka\'ai\'ai koe keke fakafika ho\'o PHP aki ha limiti ma\'olunga kapau \'e lava, hange koe 40M. +

                    \'Oku mau faka\'ai\'ai koe keke fakafika ho\'o PHP aki ha limiti ma\'olunga kapau \'e lava, hange koe 40M. Koe ngaahi founga kehekehe eni teke lava \'o \'ahi\'ahi\'i ki hono fai \'o \'eni:

                      -
                    1. Kapau teke lava,toe fakatahatah\'i e PHP moe --malava-memolii-limiti. - \'E hanga he\'e me\'a ko\'eni \'o fakangofua e Muutolo kene seti pee e limiti \'oe memolii \'eia pee. -
                    2. Kapau \'oku \'iai ha\'o \'ekisesi ki ho\'o php.ini faile, teke lava \'o liliu memolii_limiti - \'o seti\'i ia ki ha me\'a hangee koe 40M. Kapau \'oku \'ikai ke \'iai ha\'o \'ekisesi, teke kei malava pe keke kole ki ho\'o \'etiminisituleitaa kene fai \'eni ma\'au. +
                    3. Kapau teke lava,toe fakatahatah\'i e PHP moe --malava-memolii-limiti. + \'E hanga he\'e me\'a ko\'eni \'o fakangofua e Muutolo kene seti pee e limiti \'oe memolii \'eia pee. +
                    4. Kapau \'oku \'iai ha\'o \'ekisesi ki ho\'o php.ini faile, teke lava \'o liliu memolii_limiti + \'o seti\'i ia ki ha me\'a hangee koe 40M. Kapau \'oku \'ikai ke \'iai ha\'o \'ekisesi, teke kei malava pe keke kole ki ho\'o \'etiminisituleitaa kene fai \'eni ma\'au.
                    5. \'i he ni\'ihi \'oe ngaahi seeva PHPtekelava \'o fakatupu ha .ht\'ekisesi faile \'i loto \'ihe fakahinohino Muutolo \'oku \'i loto \'i he laine ko \'eni:

                      php_mahu\'inga memolii_limiti 40M

                      -

                      Kaekehe, he\'ikai ke lava \'eni ia \'i he ni\'ihi \'oe ngaahi seevaall PHP ngaahi peesi \'oku ngaue +

                      Kaekehe, he\'ikai ke lava \'eni ia \'i he ni\'ihi \'oe ngaahi seevaall PHP ngaahi peesi \'oku ngaue (teke lava \'o sio ki he ngaahi fehalaaki \'i ha\'o sio ki he ngaahi peesi) koia ai kuopau keke to\'o e .ht\'ekisesi faile.

                    '; $string['phpversion'] = 'vesiniPHP'; diff --git a/install/lang/vi/install.php b/install/lang/vi/install.php index 3d3f5a902d6..ed369bb22f1 100644 --- a/install/lang/vi/install.php +++ b/install/lang/vi/install.php @@ -38,21 +38,21 @@ $string['dirroot'] = 'Thư mục Moodle'; $string['installation'] = 'Cài đặt'; $string['memorylimithelp'] = '

                    PHP thiết lập giới hạn bộ nhớ cho máy chủ của bạn hiện tại là {$a}.

                    -

                    Đây có thể là nguyên nhân Moodle có các vấn đề về bộ nhớ vào một thời điểm nào đó, đặc biệt +

                    Đây có thể là nguyên nhân Moodle có các vấn đề về bộ nhớ vào một thời điểm nào đó, đặc biệt nếu bạn có nhiều môđun được cho phép và nhiều người dùng. -

                    Chúng tôi đề nghị rằng bạn cấu hình PHP với một giới hạn lớn hơn nếu có thể, chẳng hạn như 40M. +

                    Chúng tôi đề nghị rằng bạn cấu hình PHP với một giới hạn lớn hơn nếu có thể, chẳng hạn như 40M. Có một số cách để làm điều này mà bạn có thể thử:

                      -
                    1. Nếu bạn có khả năng, biên tập lại PHP với --giới hạn bộ nhớ cho phép. +
                    2. Nếu bạn có khả năng, biên tập lại PHP với --giới hạn bộ nhớ cho phép. Điều này sẽ cho phép Moodle tự thiết lập giới hạn bộ nhớ. -
                    3. Nếu bạn truy cập file php.ini của bạn, bạn có thể thay đổi giới hạn bộ nhớ - thiết lập trong đó thành một giá trị nào đó chẳng hạn như 40M. Nếu bạn không được phép truy cập +
                    4. Nếu bạn truy cập file php.ini của bạn, bạn có thể thay đổi giới hạn bộ nhớ + thiết lập trong đó thành một giá trị nào đó chẳng hạn như 40M. Nếu bạn không được phép truy cập bạn có thể yêu cầu quản trị viên của bạn để làm điều đó cho bạn.
                    5. -
                    6. Trên một số máy chủ chạy PHP bạn có thể tạo một file .htaccess trong thư mục Moodle +
                    7. Trên một số máy chủ chạy PHP bạn có thể tạo một file .htaccess trong thư mục Moodle chứa dòng này:

                      giá trị giới hạn bộ nhớ 40M

                      -

                      Tuy nhiên, trên một số máy chủ điều này có thể ngăn cản tất cả các trang PHP làm việc +

                      Tuy nhiên, trên một số máy chủ điều này có thể ngăn cản tất cả các trang PHP làm việc (bạn sẽ nhìn thấy các lỗi khi bạn xem xét những trang này )vì thế bạn sẽ pahỉ di chuyền file .htaccess.

                    '; $string['phpversion'] = 'Phiên bản PHP'; diff --git a/lang/en/access.php b/lang/en/access.php index b338d424d16..ee81afc8a35 100644 --- a/lang/en/access.php +++ b/lang/en/access.php @@ -39,8 +39,6 @@ $string['skipa'] = 'Skip {$a}'; $string['skipblock'] = 'Skip block'; $string['skipnavigation'] = 'Skip navigation'; $string['skipto'] = 'Skip to {$a}'; -$string['tabledata'] = 'Data table, {$a}'; -$string['tablelayout'] = 'Layout table, {$a}'; $string['tocontent'] = 'Skip to main content'; $string['tonavigation'] = 'Go to navigation'; $string['youarehere'] = 'You are here'; diff --git a/lang/en/admin.php b/lang/en/admin.php index 5cee004eef8..6dbb85977b9 100644 --- a/lang/en/admin.php +++ b/lang/en/admin.php @@ -183,6 +183,7 @@ $string['configdenyemailaddresses'] = 'To deny email addresses from particular d $string['configenabledevicedetection'] = 'Enables detection of mobiles, smartphones, tablets or default devices (desktop PCs, laptops, etc) for the application of themes and other features.'; $string['configdisableuserimages'] = 'Disable the ability for users to change user profile images.'; $string['configdisplayloginfailures'] = 'This will display information to selected users about previous failed logins.'; +$string['configdndallowtextandlinks'] = 'Enable or disable the dragging and dropping of text and links onto a course page, alongside the dragging and dropping of files. Note that the dragging of text into Firefox or between different browsers is unreliable and may result in no data being uploaded, or corrupted text being uploaded.'; $string['configdocroot'] = 'Defines the path to the Moodle Docs. You can change this if you wish to have your own custom online documentation. However, if you do that make sure that the paths in your documentation follow the same format as http://docs.moodle.org.'; $string['configdoctonewwindow'] = 'If you enable this, then links to Moodle Docs will be shown in a new window.'; $string['configeditordictionary'] = 'This value will be used if aspell doesn\'t have dictionary for users own language.'; @@ -431,6 +432,7 @@ $string['devicetype'] = 'Device type'; $string['disableuserimages'] = 'Disable user profile images'; $string['displayerrorswarning'] = 'Enabling the PHP setting display_errors is not recommended on production sites because some error messages may reveal sensitive information about your server.'; $string['displayloginfailures'] = 'Display login failures to'; +$string['dndallowtextandlinks'] = 'Drag and drop upload of text/links'; $string['docroot'] = 'Moodle Docs document root'; $string['doctonewwindow'] = 'Open in new window'; $string['download'] = 'Download'; @@ -634,6 +636,7 @@ $string['maturity50'] = 'Alpha'; $string['maturity100'] = 'Beta'; $string['maturity150'] = 'Release candidate'; $string['maturity200'] = 'Stable version'; +$string['maturityallowunstable'] = 'Hint: You may want to run this script with --allow-unstable option'; $string['maturitycoreinfo'] = 'Your site is currently running unstable "{$a}" development code.'; $string['maturitycorewarning'] = 'The version of Moodle that you are about to install or upgrade to contains unstable "{$a}" development code that is not suitable for use on most production @@ -751,6 +754,8 @@ $string['pleaserefreshregistration'] = 'Your site has been registered with moodl $string['pleaseregister'] = 'Please register your site to remove this button'; $string['plugin'] = 'Plugin'; $string['plugins'] = 'Plugins'; +$string['pluginscheck'] = 'Plugin dependencies check'; +$string['pluginscheckfailed'] = 'Dependencies check failed for {$a->pluginslist}'; $string['pluginschecktodo'] = 'You must solve all the plugin requirements before proceeding to install this Moodle version!'; $string['pluginsoverview'] = 'Plugins overview'; $string['profilecategory'] = 'Category'; diff --git a/lang/en/backup.php b/lang/en/backup.php index 3cb7ec138f9..fa809254ddb 100644 --- a/lang/en/backup.php +++ b/lang/en/backup.php @@ -117,6 +117,9 @@ $string['errorinvalidformat'] = 'Unknown backup format'; $string['errorinvalidformatinfo'] = 'The selected file is not a valid Moodle backup file and can\'t be restored.'; $string['executionsuccess'] = 'The backup file was successfully created.'; $string['filename'] = 'Filename'; +$string['filereferencesincluded'] = 'File references to external contents included in backup package, they won\'t work on other sites.'; +$string['filereferencessamesite'] = 'Backup is from the same site, file references can be restored'; +$string['filereferencesnotsamesite'] = 'Backup is from other site, file references cannot be restored'; $string['generalactivities'] = 'Include activities'; $string['generalanonymize'] = 'Anonymise information'; $string['generalbackdefaults'] = 'General backup defaults'; @@ -148,6 +151,7 @@ $string['includeditems'] = 'Included items:'; $string['includesection'] = 'Section {$a}'; $string['includeuserinfo'] = 'User data'; $string['loglifetime'] = 'Keep logs for'; +$string['includefilereferences'] = 'File references to external contents'; $string['locked'] = 'Locked'; $string['lockedbypermission'] = 'You don\'t have sufficient permissions to change this setting'; $string['lockedbyconfig'] = 'This setting has been locked by the default backup settings'; diff --git a/lang/en/error.php b/lang/en/error.php index 75fb0be028c..b40859b4e18 100644 --- a/lang/en/error.php +++ b/lang/en/error.php @@ -224,6 +224,7 @@ $string['errorsettinguserpref'] = 'Error setting user preference'; $string['errorunzippingfiles'] = 'Error unzipping files'; $string['expiredkey'] = 'Expired key'; $string['externalauthpassworderror'] = 'Non-empty password for external authentication'; +$string['externalfilenolocation'] = 'External file has no location path'; $string['failtoloadblocks'] = 'One or more blocks are registered in the database, but they all failed to load!'; $string['fieldrequired'] = '"{$a}" is a required field'; $string['fileexists'] = 'File exists'; @@ -323,6 +324,7 @@ $string['invalidsection'] = 'Course module record contains invalid section'; $string['invalidsesskey'] = 'Incorrect sesskey submitted, form not accepted!'; $string['invalidshortname'] = 'That\'s an invalid short course name'; $string['invalidstatedetected'] = 'Something has gone wrong: {$a}. This should never normally happen.'; +$string['invalidsourcefield'] = 'Draft file\'s source field is invalid'; $string['invalidurl'] = 'Invalid URL'; $string['invaliduser'] = 'Invalid user'; $string['invaliduserid'] = 'Invalid user id'; diff --git a/lang/en/mimetypes.php b/lang/en/mimetypes.php index 17d224e7c4d..9cb966dd3cb 100644 --- a/lang/en/mimetypes.php +++ b/lang/en/mimetypes.php @@ -18,6 +18,19 @@ /** * Strings for component 'mimetypes', language 'en', branch 'MOODLE_20_STABLE' * + * Strings are used to display human-readable name of mimetype. Some mimetypes share the same + * string. The following attributes are passed in the parameter when processing the string: + * $a->ext - filename extension in lower case + * $a->EXT - filename extension, capitalized + * $a->Ext - filename extension with first capital letter + * $a->mimetype - file mimetype + * $a->mimetype1 - first chunk of mimetype (before /) + * $a->mimetype2 - second chunk of mimetype (after /) + * $a->Mimetype, $a->MIMETYPE, $a->Mimetype1, $a->Mimetype2, $a->MIMETYPE1, $a->MIMETYPE2 + * - the same with capitalized first/all letters + * + * @see get_mimetypes_array() + * @see get_mimetype_description() * @package mimetypes * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later @@ -25,15 +38,19 @@ $string['application/msword'] = 'Word document'; $string['application/pdf'] = 'PDF document'; +$string['application/vnd.moodle.backup'] = 'Moodle backup'; $string['application/vnd.ms-excel'] = 'Excel spreadsheet'; $string['application/vnd.ms-powerpoint'] = 'Powerpoint presentation'; -$string['application/zip'] = 'zip archive'; -$string['audio/mp3'] = 'MP3 audio file'; -$string['audio/wav'] = 'sound file'; -$string['document/unknown'] = 'file'; -$string['image/bmp'] = 'uncompressed BMP image'; -$string['image/gif'] = 'GIF image'; -$string['image/jpeg'] = 'JPEG image'; -$string['image/png'] = 'PNG image'; -$string['text/plain'] = 'text file'; +$string['application/vnd.openxmlformats-officedocument.presentationml.presentation'] = 'Powerpoint presentation'; +$string['application/vnd.openxmlformats-officedocument.presentationml.slideshow'] = 'Powerpoint slideshow'; +$string['application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'] = 'Excel spreadsheet'; +$string['application/vnd.openxmlformats-officedocument.spreadsheetml.template'] = 'Excel template'; +$string['application/vnd.openxmlformats-officedocument.wordprocessingml.document'] = 'Word document'; +$string['archive'] = 'Archive ({$a->EXT})'; +$string['audio'] = 'Audio file ({$a->EXT})'; +$string['default'] = '{$a->mimetype}'; +$string['document/unknown'] = 'File'; +$string['image'] = 'Image ({$a->MIMETYPE2})'; +$string['text/html'] = 'HTML document'; +$string['text/plain'] = 'Text file'; $string['text/rtf'] = 'RTF document'; diff --git a/lang/en/moodle.php b/lang/en/moodle.php index b7cc79e707c..224b7411f87 100644 --- a/lang/en/moodle.php +++ b/lang/en/moodle.php @@ -466,8 +466,15 @@ $string['displayonpage'] = 'Display on page'; $string['dndenabled'] = 'Drag and drop available'; $string['dndenabled_help'] = 'You can drag one or more files from your desktop and drop them onto the box below to upload them.
                    Note: this may not work with other web browsers'; $string['dndenabled_insentence'] = 'drag and drop available'; -$string['dndenabled_inbox'] = 'drag and drop files here to upload them'; -$string['dndworking'] = 'Drag and drop files, text or links onto course sections to upload them'; +$string['dndenabled_inbox'] = 'You can drag and drop files here to add them.'; +$string['dnduploadwithoutcontent'] = 'This upload does not have any content'; +$string['dndworkingfiletextlink'] = 'Drag and drop files, text or links onto course sections to upload them'; +$string['dndworkingfilelink'] = 'Drag and drop files or links onto course sections to upload them'; +$string['dndworkingfiletext'] = 'Drag and drop files or text onto course sections to upload them'; +$string['dndworkingfile'] = 'Drag and drop files onto course sections to upload them'; +$string['dndworkingtextlink'] = 'Drag and drop text or links onto course sections to upload them'; +$string['dndworkingtext'] = 'Drag and drop text onto course sections to upload it'; +$string['dndworkinglink'] = 'Drag and drop links onto course sections to upload them'; $string['documentation'] = 'Moodle documentation'; $string['down'] = 'Down'; $string['download'] = 'Download'; @@ -1242,6 +1249,7 @@ $string['olduserdirectory'] = 'This is the OLD users directory, and is no longer $string['opentoguests'] = 'Guest access'; $string['optional'] = 'optional'; $string['order'] = 'Order'; +$string['originalpath'] = 'Original path'; $string['orphanedactivities'] = 'Orphaned activities'; $string['other'] = 'Other'; $string['outline'] = 'Outline'; diff --git a/lang/en/plugin.php b/lang/en/plugin.php index 3bc89ef8d37..3bba405afa6 100644 --- a/lang/en/plugin.php +++ b/lang/en/plugin.php @@ -31,7 +31,7 @@ $string['checkforupdates'] = 'Check for available updates'; $string['checkforupdateslast'] = 'Last check done on {$a}'; $string['displayname'] = 'Plugin name'; $string['moodleversion'] = 'Moodle {$a}'; -$string['nonehighlighted'] = 'No plugins require your attention during this upgrade'; +$string['nonehighlighted'] = 'No plugins require your attention now'; $string['nonehighlightedinfo'] = 'Display the list of all installed plugins anyway'; $string['noneinstalled'] = 'No plugins of this type are installed'; $string['notes'] = 'Notes'; @@ -52,7 +52,7 @@ $string['requiredby'] = 'Required by: {$a}'; $string['requires'] = 'Requires'; $string['rootdir'] = 'Directory'; $string['settings'] = 'Settings'; -$string['somehighlighted'] = 'Number of plugins requiring attention during this upgrade: {$a}'; +$string['somehighlighted'] = 'Number of plugins requiring your attention: {$a}'; $string['somehighlightedinfo'] = 'Display the full list of installed plugins'; $string['somehighlightedonly'] = 'Display only plugins requiring your attention'; $string['source'] = 'Source'; diff --git a/lang/en/repository.php b/lang/en/repository.php index 0e84fcd4c64..42c8658591e 100644 --- a/lang/en/repository.php +++ b/lang/en/repository.php @@ -61,9 +61,15 @@ $string['commonrepositorysettings'] = 'Common repository settings'; $string['configallowexternallinks'] = 'This option enables all users to choose whether or not external media is copied into Moodle or not. If this is off then media is always copied into Moodle (this is usually best for overall data integrity and security). If this is on then users can choose each time they add media to a text.'; $string['configcacheexpire'] = 'The amount of time that file listings are cached locally (in seconds) when browsing external repositories.'; $string['configsaved'] = 'Configuration saved!'; -$string['confirmdelete'] = 'Are you sure you want to delete this repository - {$a}?'; +$string['confirmdelete'] = 'Are you sure you want to delete this repository - {$a}? If you choose "Continue and download", file references to external contents will be downloaded to moodle, but it could take long time to process.'; $string['confirmdeletefile'] = 'Are you sure you want to delete this file?'; -$string['confirmremove'] = 'Are you sure you want to remove this repository plugin, its options and all of its instances - {$a}?'; +$string['confirmrenamefile'] = 'Are you sure you want to rename/move this file? There are {$a} alias/shortcut files that use this file as their source. If you proceed then those aliases will be converted to true copies.'; +$string['confirmdeletefilewithhref'] = 'Are you sure you want to delete this file? There are {$a} alias/shortcut files that use this file as their source. If you proceed then those aliases will be converted to true copies.'; +$string['confirmdeletefolder'] = 'Are you sure you want to delete this folder? All files and subfolders will be deleted.'; +$string['confirmremove'] = 'Are you sure you want to remove this repository plugin, its options and all of its instances - {$a}? If you choose "Continue and download", file references to external contents will be downloaded to moodle, but it could take long time to process.'; +$string['confirmrenamefolder'] = ' Are you sure you want to move/rename this folder? Any alias/shortcut files that reference files in this folder will be converted into true copies.'; +$string['continueuninstall'] = 'Continue'; +$string['continueuninstallanddownload'] = 'Continue and download'; $string['copying'] = 'Copying'; $string['create'] = 'Create'; $string['createfolderfail'] = 'Fail to create this folder'; @@ -72,8 +78,11 @@ $string['createinstance'] = 'Create a repository instance'; $string['createrepository'] = 'Create a repository instance'; $string['createxxinstance'] = 'Create "{$a}" instance'; $string['date'] = 'Date'; +$string['datecreated'] = 'Created'; $string['deleted'] = 'Repository deleted'; $string['deleterepository'] = 'Delete this repository'; +$string['detailview'] = 'View details'; +$string['dimensions'] = 'Dimensions'; $string['disabled'] = 'Disabled'; $string['download'] = 'Download'; $string['downloadfolder'] = 'Download all'; @@ -102,11 +111,15 @@ $string['filenotnull'] = 'You must select a file to upload.'; $string['filesaved'] = 'The file has been saved'; $string['filepicker'] = 'File picker'; $string['filesizenull'] = 'File size cannot be determined'; +$string['folderexists'] = 'Folder name already being used, please use another name'; +$string['foldernotfound'] = 'Folder not found'; +$string['folderrecurse'] = 'Folder can not be moved to it\s own subfolder'; $string['getfile'] = 'Select this file'; $string['hidden'] = 'Hidden'; $string['choosealink'] = 'Choose a link...'; $string['chooselicense'] = 'Choose license'; $string['iconview'] = 'View as icons'; +$string['imagesize'] = '{$a->width} x {$a->height} px'; $string['instance'] = 'instance'; $string['instancedeleted'] = 'Instance deleted'; $string['instances'] = 'Repository instances'; @@ -117,6 +130,7 @@ $string['invalidjson'] = 'Invalid JSON string'; $string['invalidplugin'] = 'Invalid repository {$a} plug-in'; $string['invalidfiletype'] = '{$a} filetype cannot be accepted.'; $string['invalidrepositoryid'] = 'Invalid repository ID'; +$string['invalidparams'] = 'Invalid parameters'; $string['isactive'] = 'Active?'; $string['keyword'] = 'Keyword'; $string['linkexternal'] = 'Link external'; @@ -124,6 +138,9 @@ $string['listview'] = 'View as list'; $string['loading'] = 'Loading...'; $string['login'] = 'Login'; $string['logout'] = 'Logout'; +$string['makefileinternal'] = 'Make a copy of the file'; +$string['makefilelink'] = 'Link to the file directly'; +$string['makefilereference'] = 'Create an alias/shortcut to the file'; $string['manage'] = 'Manage repositories'; $string['manageurl'] = 'Manage'; $string['manageuserrepository'] = 'Manage individual repository'; @@ -139,6 +156,7 @@ $string['norepositoriesavailable'] = 'Sorry, none of your current repositories c $string['norepositoriesexternalavailable'] = 'Sorry, none of your current repositories can return external files.'; $string['notyourinstances'] = 'You can not view/edit repository instances of another user'; $string['off'] = 'Enabled but hidden'; +$string['original'] = 'Original'; $string['openpicker'] = 'Choose a file...'; $string['operation'] = 'Operation'; $string['on'] = 'Enabled and visible'; @@ -150,10 +168,12 @@ $string['popup'] = 'Click "Login" button to login'; $string['popupblockeddownload'] = 'The downloading window is blocked, please allow the popup window, and try again.'; $string['preview'] = 'Preview'; $string['readonlyinstance'] = 'You cannot edit/delete a read-only instance'; +$string['referencesexist'] = 'There are {$a} alias/shortcut files that use this file as their source'; +$string['referenceslist'] = 'Aliases/Shortcuts'; $string['refresh'] = 'Refresh'; $string['refreshnonjsfilepicker'] = 'Please close this window and refresh non-javascript file picker'; $string['removed'] = 'Repository removed'; -$string['renameto'] = 'Rename to'; +$string['renameto'] = 'Rename to "{$a}"'; $string['repositories'] = 'Repositories'; $string['repository'] = 'Repository'; $string['repositorycourse'] = 'Course repositories'; @@ -175,10 +195,14 @@ $string['submit'] = 'Submit'; $string['sync'] = 'Sync'; $string['thumbview'] = 'View as icons'; $string['title'] = 'Choose a file...'; +$string['type'] = 'Type'; $string['typenotvisible'] = 'Type not visible'; +$string['unknownoriginal'] = 'Unknown'; $string['upload'] = 'Upload this file'; $string['uploading'] = 'Uploading...'; $string['uploadsucc'] = 'The file has been uploaded successfully'; +$string['undisclosedreference'] = '(Undisclosed)'; +$string['uselatestfile'] = 'Use latest file'; $string['usercontextrepositorydisabled'] = 'You cannot edit this repository in user context'; $string['usenonjsfilemanager'] = 'Open file manager in new window'; $string['usenonjsfilepicker'] = 'Open file picker in new window'; diff --git a/lang/en/webservice.php b/lang/en/webservice.php index 2b8aefba412..2b72efe56a5 100644 --- a/lang/en/webservice.php +++ b/lang/en/webservice.php @@ -25,7 +25,6 @@ $string['accessexception'] = 'Access control exception'; $string['actwebserviceshhdr'] = 'Active web service protocols'; -$string['accesstofunctionnotallowed'] = 'Access to the function {$a}() is not allowed. Please check if a service containing the function is enabled. In the service settings: if the service is restricted check that the user is listed. Still in the service settings check for IP restriction or if the service requires a capability.'; $string['addaservice'] = 'Add service'; $string['addcapabilitytousers'] = 'Check users capability'; $string['addcapabilitytousersdescription'] = 'Users should have two capabilities - webservice:createtoken and a capability matching the protocols used, for example webservice/rest:use, webservice/soap:use. To achieve this, create a web services role with the appropriate capabilities allowed and assign it to the web services user as a system role.'; @@ -76,7 +75,6 @@ $string['enableprotocols'] = 'Enable protocols'; $string['enableprotocolsdescription'] = 'At least one protocol should be enabled. For security reasons, only protocols that are to be used should be enabled.'; $string['enablews'] = 'Enable web services'; $string['enablewsdescription'] = 'Web services must be enabled in Advanced features.'; -$string['enabledirectdownload'] = 'Web service file downloading must be enabled in external service settings'; $string['entertoken'] = 'Enter a security key/token:'; $string['error'] = 'Error: {$a}'; $string['errorcatcontextnotvalid'] = 'You cannot execute functions in the category context (category id:{$a->catid}). The context error message was: {$a->message}'; @@ -107,7 +105,6 @@ $string['invalidextresponse'] = 'Invalid external api response: {$a}'; $string['invalidiptoken'] = 'Invalid token - your IP is not supported'; $string['invalidtimedtoken'] = 'Invalid token - token expired'; $string['invalidtoken'] = 'Invalid token - token not found'; -$string['invalidtokensession'] = 'Invalid session based token - session not found or expired'; $string['iprestriction'] = 'IP restriction'; $string['iprestriction_help'] = 'The user will need to call web service from the listed IPs.'; $string['key'] = 'Key'; @@ -137,7 +134,6 @@ $string['potusers'] = 'Not authorised users'; $string['potusersmatching'] = 'Not authorised users matching'; $string['print'] = 'Print all'; $string['protocol'] = 'Protocol'; -$string['protocolnotallowed'] = 'You are not allowed to use the {$a} protocol (missing capability: webservice/{$a}:use)'; $string['removefunction'] = 'Remove'; $string['removefunctionconfirm'] = 'Do you really want to remove function "{$a->function}" from service "{$a->service}"?'; $string['requireauthentication'] = 'This method requires authentication with xxx permission.'; @@ -174,6 +170,7 @@ $string['serviceusersmatching'] = 'Authorised users matching'; $string['serviceuserssettings'] = 'Change settings for the authorised users'; $string['simpleauthlog'] = 'Simple authentication login'; $string['step'] = 'Step'; +$string['supplyinfo'] = 'More details'; $string['testauserwithtestclientdescription'] = 'Simulate external access to the service using the web service test client. Before doing so, login as a user with the moodle/webservice:createtoken capability and obtain the security key (token) via My profile settings. You will use this token in the test client. In the test client, also choose an enabled protocol with the token authentication. WARNING: The functions that you test WILL BE EXECUTED for this user, so be careful what you choose to test!'; $string['testclient'] = 'Web service test client'; $string['testclientdescription'] = '* The web service test client executes the functions for REAL. Do not test functions that you don\'t know.
                    * All existing web service functions are not yet implemented into the test client.
                    * In order to check that a user cannot access some functions, you can test some functions that you didn\'t allow.
                    * To see clearer error messages set the debugging to {$a->mode} into {$a->atag}
                    * Access the {$a->amfatag}.'; @@ -206,8 +203,6 @@ $string['wsaccessuserexpired'] = 'Refused web service access for password expire $string['wsaccessusernologin'] = 'Refused web service access for nologin authentication username: {$a}'; $string['wsaccessusersuspended'] = 'Refused web service access for suspended username: {$a}'; $string['wsaccessuserunconfirmed'] = 'Refused web service access for unconfirmed username: {$a}'; -$string['wsauthmissing'] = 'The web service authentication plugin is missing.'; -$string['wsauthnotenabled'] = 'The web service authentication plugin is disabled.'; $string['wsclientdoc'] = 'Moodle web service client documentation'; $string['wsdocapi'] = 'API Documentation'; $string['wsdocumentation'] = 'Web service documentation'; diff --git a/lib/completion/completion_aggregation.php b/lib/completion/completion_aggregation.php index e7a07863781..e6e626a4de9 100644 --- a/lib/completion/completion_aggregation.php +++ b/lib/completion/completion_aggregation.php @@ -49,13 +49,16 @@ class completion_aggregation extends data_object { */ public $required_fields = array('id', 'course', 'criteriatype', 'method', 'value'); + /* @var array Array of unique fields, used in where clauses */ + public $unique_fields = array('course', 'criteriatype'); + /* @var int Course id */ public $course; /* @var int Criteria type this aggregation method applies to, or NULL for overall course aggregation */ public $criteriatype; - /* @var int Aggregation method (COMPLETION_AGGREGATION_* constant)*/ + /* @var int Aggregation method (COMPLETION_AGGREGATION_* constant) */ public $method; /* @var mixed Method value */ @@ -98,4 +101,19 @@ class completion_aggregation extends data_object { $this->method = COMPLETION_AGGREGATION_ALL; } } + + + /** + * Save aggregation method to database + * + * @access public + * @return boolean + */ + public function save() { + if ($this->id) { + return $this->update(); + } else { + return $this->insert(); + } + } } diff --git a/lib/completion/completion_completion.php b/lib/completion/completion_completion.php index 2b5d8bf4bad..e6523eadf26 100644 --- a/lib/completion/completion_completion.php +++ b/lib/completion/completion_completion.php @@ -111,7 +111,7 @@ class completion_completion extends data_object { $this->timeenrolled = $timeenrolled; } - $this->_save(); + return $this->_save(); } /** @@ -137,7 +137,7 @@ class completion_completion extends data_object { $this->timestarted = $timestarted; } - $this->_save(); + return $this->_save(); } /** @@ -165,24 +165,24 @@ class completion_completion extends data_object { $this->timecompleted = $timecomplete; // Save record - $this->_save(); + return $this->_save(); } /** * Save course completion status * * This method creates a course_completions record if none exists + * @access private + * @return bool */ private function _save() { - global $DB; - if ($this->timeenrolled === null) { $this->timeenrolled = 0; } // Save record if ($this->id) { - $this->update(); + return $this->update(); } else { // Make sure reaggregate field is not null if (!$this->reaggregate) { @@ -191,10 +191,10 @@ class completion_completion extends data_object { // Make sure timestarted is not null if (!$this->timestarted) { - $this->timestarted = 0; + $this->timestarted = 0; } - - $this->insert(); + + return $this->insert(); } } } diff --git a/lib/completion/completion_criteria.php b/lib/completion/completion_criteria.php index d93e9a043a2..31f5187edcb 100644 --- a/lib/completion/completion_criteria.php +++ b/lib/completion/completion_criteria.php @@ -167,11 +167,11 @@ abstract class completion_criteria extends data_object { public static function factory($params) { global $CFG, $COMPLETION_CRITERIA_TYPES; - if (!isset($params->criteriatype) || !isset($COMPLETION_CRITERIA_TYPES[$params->criteriatype])) { + if (!isset($params['criteriatype']) || !isset($COMPLETION_CRITERIA_TYPES[$params['criteriatype']])) { error('invalidcriteriatype', 'completion'); } - $class = 'completion_criteria_'.$COMPLETION_CRITERIA_TYPES[$params->criteriatype]; + $class = 'completion_criteria_'.$COMPLETION_CRITERIA_TYPES[$params['criteriatype']]; require_once($CFG->libdir.'/completion/'.$class.'.php'); return new $class($params, false); diff --git a/lib/completion/completion_criteria_activity.php b/lib/completion/completion_criteria_activity.php index 409bf42c08f..375c9663cbe 100644 --- a/lib/completion/completion_criteria_activity.php +++ b/lib/completion/completion_criteria_activity.php @@ -235,8 +235,7 @@ class completion_criteria_activity extends completion_criteria { // Loop through completions, and mark as complete $rs = $DB->get_recordset_sql($sql); foreach ($rs as $record) { - - $completion = new completion_criteria_completion((array)$record); + $completion = new completion_criteria_completion((array) $record, DATA_OBJECT_FETCH_BY_KEY); $completion->mark_complete($record->timecompleted); } $rs->close(); diff --git a/lib/completion/completion_criteria_completion.php b/lib/completion/completion_criteria_completion.php index f4d700d0772..7f448001d20 100644 --- a/lib/completion/completion_criteria_completion.php +++ b/lib/completion/completion_criteria_completion.php @@ -44,6 +44,9 @@ class completion_criteria_completion extends data_object { /* @var array Array of required table fields, must start with 'id'. */ public $required_fields = array('id', 'userid', 'course', 'criteriaid', 'gradefinal', 'rpl', 'deleted', 'unenroled', 'timecompleted'); + /* @var array Array of unique fields, used in where clauses */ + public $unique_fields = array('userid', 'course', 'criteriaid'); + /* @var int User ID */ public $userid; diff --git a/lib/completion/completion_criteria_course.php b/lib/completion/completion_criteria_course.php index 882ee6365c2..a25dea2ae6b 100644 --- a/lib/completion/completion_criteria_course.php +++ b/lib/completion/completion_criteria_course.php @@ -193,7 +193,7 @@ class completion_criteria_course extends completion_criteria { // Loop through completions, and mark as complete $rs = $DB->get_recordset_sql($sql); foreach ($rs as $record) { - $completion = new completion_criteria_completion((array)$record); + $completion = new completion_criteria_completion((array) $record, DATA_OBJECT_FETCH_BY_KEY); $completion->mark_complete($record->timecompleted); } $rs->close(); diff --git a/lib/completion/completion_criteria_date.php b/lib/completion/completion_criteria_date.php index e6e81c09148..baecc20f420 100644 --- a/lib/completion/completion_criteria_date.php +++ b/lib/completion/completion_criteria_date.php @@ -179,7 +179,7 @@ class completion_criteria_date extends completion_criteria { // Loop through completions, and mark as complete $rs = $DB->get_recordset_sql($sql, array(time())); foreach ($rs as $record) { - $completion = new completion_criteria_completion((array)$record); + $completion = new completion_criteria_completion((array) $record, DATA_OBJECT_FETCH_BY_KEY); $completion->mark_complete($record->timeend); } $rs->close(); diff --git a/lib/completion/completion_criteria_duration.php b/lib/completion/completion_criteria_duration.php index 97bcb923b00..ead1a556c2b 100644 --- a/lib/completion/completion_criteria_duration.php +++ b/lib/completion/completion_criteria_duration.php @@ -229,8 +229,7 @@ class completion_criteria_duration extends completion_criteria { $now = time(); $rs = $DB->get_recordset_sql($sql, array($now, $now)); foreach ($rs as $record) { - - $completion = new completion_criteria_completion((array)$record); + $completion = new completion_criteria_completion((array) $record, DATA_OBJECT_FETCH_BY_KEY); // Use time start if not 0, otherwise use timeenrolled if ($record->otimestart) { diff --git a/lib/completion/completion_criteria_grade.php b/lib/completion/completion_criteria_grade.php index e452454d080..6bc32ed7236 100644 --- a/lib/completion/completion_criteria_grade.php +++ b/lib/completion/completion_criteria_grade.php @@ -215,7 +215,7 @@ class completion_criteria_grade extends completion_criteria { // Loop through completions, and mark as complete $rs = $DB->get_recordset_sql($sql); foreach ($rs as $record) { - $completion = new completion_criteria_completion((array)$record); + $completion = new completion_criteria_completion((array) $record, DATA_OBJECT_FETCH_BY_KEY); $completion->mark_complete($record->timecompleted); } $rs->close(); diff --git a/lib/completion/cron.php b/lib/completion/cron.php index be480d47a21..3645c0618d6 100644 --- a/lib/completion/cron.php +++ b/lib/completion/cron.php @@ -317,7 +317,7 @@ function completion_cron_completions() { foreach ($completions as $params) { $timecompleted = max($timecompleted, $params->timecompleted); - $completion = new completion_criteria_completion($params, false); + $completion = new completion_criteria_completion((array)$params, false); // Handle aggregation special cases if ($params->criteriatype == COMPLETION_CRITERIA_TYPE_ACTIVITY) { diff --git a/lib/completion/data_object.php b/lib/completion/data_object.php index 01345ee0cc9..9d862ba914a 100644 --- a/lib/completion/data_object.php +++ b/lib/completion/data_object.php @@ -26,6 +26,14 @@ defined('MOODLE_INTERNAL') || die(); + +/** + * Trigger for the new data_object api. + * + * See data_object::__constructor + */ +define('DATA_OBJECT_FETCH_BY_KEY', 2); + /** * A data abstraction object that holds methods and attributes * @@ -50,32 +58,74 @@ abstract class data_object { */ public $optional_fields = array(); + /* @var Array of unique fields, used in where clauses and constructor */ + public $unique_fields = array(); + /* @var int The primary key */ public $id; + /** * Constructor. Optionally (and by default) attempts to fetch corresponding row from DB. * - * @param array $params an array with required parameters for this data object. - * @param bool $fetch Whether to fetch corresponding row from DB or not, - * optional fields might not be defined if false used + * If $fetch is not false, there are a few different things that can happen: + * - true: + * load corresponding row from the database, using $params as the WHERE clause + * + * - DATA_OBJECT_FETCH_BY_KEY: + * load corresponding row from the database, using only the $id in the WHERE clause (if set), + * otherwise using the columns listed in $this->unique_fields. + * + * - array(): + * load corresponding row from the database, using the columns listed in this array + * in the WHERE clause + * + * @param array $params required parameters and their values for this data object + * @param mixed $fetch if false, do not attempt to fetch from the database, otherwise see notes */ public function __construct($params = null, $fetch = true) { - if (!empty($params) and (is_array($params) or is_object($params))) { - if ($fetch) { - if ($data = $this->fetch($params)) { - self::set_properties($this, $data); - } else { - self::set_properties($this, $this->optional_fields);//apply defaults for optional fields - self::set_properties($this, $params); - } - } else { - self::set_properties($this, $params); + if (is_object($params)) { + throw new coding_exception('data_object params should be in the form of an array, not an object'); + } + + // If no params given, apply defaults for optional fields + if (empty($params) || !is_array($params)) { + self::set_properties($this, $this->optional_fields); + return; + } + + // If fetch is false, do not load from database + if ($fetch === false) { + self::set_properties($this, $params); + return; + } + + // Compose where clause only from fields in unique_fields + if ($fetch === DATA_OBJECT_FETCH_BY_KEY && !empty($this->unique_fields)) { + if (empty($params['id'])) { + $where = array_intersect_key($params, array_flip($this->unique_fields)); } - + else { + $where = array('id' => $params['id']); + } + // Compose where clause from given field names + } else if (is_array($fetch) && !empty($fetch)) { + $where = array_intersect_key($params, array_flip($fetch)); + // Use entire params array for where clause } else { - self::set_properties($this, $this->optional_fields);//apply defaults for optional fields + $where = $params; + } + + // Attempt to load from database + if ($data = $this->fetch($where)) { + // Apply data from database, then data sent to constructor + self::set_properties($this, $data); + self::set_properties($this, $params); + } else { + // Apply defaults for optional fields, then data from constructor + self::set_properties($this, $this->optional_fields); + self::set_properties($this, $params); } } @@ -339,4 +389,4 @@ abstract class data_object { */ public function notify_changed($deleted) { } -} \ No newline at end of file +} diff --git a/lib/completionlib.php b/lib/completionlib.php index a47a1f89ee2..2034af148f5 100644 --- a/lib/completionlib.php +++ b/lib/completionlib.php @@ -322,8 +322,9 @@ class completion_info { */ public function get_user_completion($user_id, $criteria) { $params = array( + 'course' => $this->course_id, + 'userid' => $user_id, 'criteriaid' => $criteria->id, - 'userid' => $user_id ); $completion = new completion_criteria_completion($params); @@ -362,7 +363,7 @@ class completion_info { // Build array of criteria objects $this->criteria = array(); foreach ($records as $record) { - $this->criteria[$record->id] = completion_criteria::factory($record); + $this->criteria[$record->id] = completion_criteria::factory((array)$record); } } diff --git a/lib/conditionlib.php b/lib/conditionlib.php index 9bcd4bbe5d2..0d8b3cbfde7 100644 --- a/lib/conditionlib.php +++ b/lib/conditionlib.php @@ -69,7 +69,8 @@ class condition_info extends condition_info_base { * @param object $cm Moodle course-module object. May have extra fields * ->conditionsgrade, ->conditionscompletion which should come from * get_fast_modinfo. Should have ->availablefrom, ->availableuntil, - * and ->showavailability, ->course; but the only required thing is ->id. + * and ->showavailability, ->course, ->visible; but the only required + * thing is ->id. * @param int $expectingmissing Used to control whether or not a developer * debugging message (performance warning) will be displayed if some of * the above data is missing and needs to be retrieved; a @@ -426,7 +427,8 @@ abstract class condition_info_base { * @return array Array of field names */ protected function get_main_table_fields() { - return array('id', 'course', 'availablefrom', 'availableuntil', 'showavailability'); + return array('id', 'course', 'visible', + 'availablefrom', 'availableuntil', 'showavailability'); } /** @@ -846,6 +848,16 @@ abstract class condition_info_base { } } + // If the item is marked as 'not visible' then we don't change the available + // flag (visible/available are treated distinctly), but we remove any + // availability info. If the item is hidden with the eye icon, it doesn't + // make sense to show 'Available from ' or similar, because even + // when that date arrives it will still not be available unless somebody + // toggles the eye icon. + if (!$this->item->visible) { + $information = ''; + } + $information = trim($information); return $available; } diff --git a/lib/cronlib.php b/lib/cronlib.php index b05e34f87c9..f89adbd6d06 100644 --- a/lib/cronlib.php +++ b/lib/cronlib.php @@ -376,7 +376,7 @@ function cron_run() { //Run registration updated cron mtrace(get_string('siteupdatesstart', 'hub')); - require_once($CFG->dirroot . '/admin/registration/lib.php'); + require_once($CFG->dirroot . '/' . $CFG->admin . '/registration/lib.php'); $registrationmanager = new registration_manager(); $registrationmanager->cron(); mtrace(get_string('siteupdatesend', 'hub')); @@ -403,9 +403,7 @@ function cron_run() { cron_execute_plugin_type('format', 'course formats'); cron_execute_plugin_type('profilefield', 'profile fields'); cron_execute_plugin_type('webservice', 'webservices'); - // TODO: Repository lib.php files are messed up (include many other files, etc), so it is - // currently not possible to implement repository plugin cron using this infrastructure - // cron_execute_plugin_type('repository', 'repository plugins'); + cron_execute_plugin_type('repository', 'repository plugins'); cron_execute_plugin_type('qbehaviour', 'question behaviours'); cron_execute_plugin_type('qformat', 'question import/export formats'); cron_execute_plugin_type('qtype', 'question types'); @@ -462,6 +460,9 @@ function cron_run() { $fs = get_file_storage(); $fs->cron(); + mtrace("Clean up cached external files"); + // 1 week + cache_file::cleanup(array(), 60 * 60 * 24 * 7); mtrace("Cron script completed correctly"); diff --git a/lib/db/install.php b/lib/db/install.php index f0bb45df6f9..b3e9aa23c88 100644 --- a/lib/db/install.php +++ b/lib/db/install.php @@ -319,8 +319,9 @@ function xmldb_main_install() { set_role_contextlevels($guestrole, get_default_contextlevels('guest')); set_role_contextlevels($userrole, get_default_contextlevels('user')); - // Init themes - set_config('themerev', 1); + // Init theme and JS revisions + set_config('themerev', time()); + set_config('jsrev', time()); // Install licenses require_once($CFG->libdir . '/licenselib.php'); diff --git a/lib/db/install.xml b/lib/db/install.xml index 1d83d84ead5..d4b707752f3 100644 --- a/lib/db/install.xml +++ b/lib/db/install.xml @@ -1,5 +1,5 @@ - @@ -149,7 +149,8 @@ - + + @@ -190,7 +191,8 @@ - + +
                    @@ -226,7 +228,8 @@ - + +
                    @@ -2326,7 +2329,7 @@
                    - +
                    @@ -2346,12 +2349,16 @@ - + + + + - + + @@ -2359,7 +2366,20 @@
                    - +
                    + + + + + + + + + + + +
                    + @@ -2850,4 +2870,4 @@
                    -
                    \ No newline at end of file + diff --git a/lib/db/log.php b/lib/db/log.php index f404e019e0c..f0475f62870 100644 --- a/lib/db/log.php +++ b/lib/db/log.php @@ -38,6 +38,7 @@ global $DB; // TODO: this is a hack, we should really do something with the SQL $logs = array( array('module'=>'course', 'action'=>'user report', 'mtable'=>'user', 'field'=>$DB->sql_concat('firstname', "' '" , 'lastname')), array('module'=>'course', 'action'=>'view', 'mtable'=>'course', 'field'=>'fullname'), + array('module'=>'course', 'action'=>'view section', 'mtable'=>'course_sections', 'field'=>'COALESCE(name, section)'), array('module'=>'course', 'action'=>'update', 'mtable'=>'course', 'field'=>'fullname'), array('module'=>'course', 'action'=>'enrol', 'mtable'=>'course', 'field'=>'fullname'), // there should be some way to store user id of the enrolled user! array('module'=>'course', 'action'=>'unenrol', 'mtable'=>'course', 'field'=>'fullname'), // there should be some way to store user id of the enrolled user! diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index b263a39e735..ba53f99374e 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -592,5 +592,182 @@ function xmldb_main_upgrade($oldversion) { upgrade_main_savepoint(true, 2012051100.03); } + if ($oldversion < 2012052100.00) { + + // Define field referencefileid to be added to files. + $table = new xmldb_table('files'); + + // Define field referencefileid to be added to files. + $field = new xmldb_field('referencefileid', XMLDB_TYPE_INTEGER, '10', null, null, null, null, 'sortorder'); + + // Conditionally launch add field referencefileid. + if (!$dbman->field_exists($table, $field)) { + $dbman->add_field($table, $field); + } + + // Define field referencelastsync to be added to files. + $field = new xmldb_field('referencelastsync', XMLDB_TYPE_INTEGER, '10', null, null, null, null, 'referencefileid'); + + // Conditionally launch add field referencelastsync. + if (!$dbman->field_exists($table, $field)) { + $dbman->add_field($table, $field); + } + + // Define field referencelifetime to be added to files. + $field = new xmldb_field('referencelifetime', XMLDB_TYPE_INTEGER, '10', null, null, null, null, 'referencelastsync'); + + // Conditionally launch add field referencelifetime. + if (!$dbman->field_exists($table, $field)) { + $dbman->add_field($table, $field); + } + + $key = new xmldb_key('referencefileid', XMLDB_KEY_FOREIGN, array('referencefileid'), 'files_reference', array('id')); + // Launch add key referencefileid + $dbman->add_key($table, $key); + + // Define table files_reference to be created. + $table = new xmldb_table('files_reference'); + + // Adding fields to table files_reference. + $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null); + $table->add_field('repositoryid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); + $table->add_field('lastsync', XMLDB_TYPE_INTEGER, '10', null, null, null, null); + $table->add_field('lifetime', XMLDB_TYPE_INTEGER, '10', null, null, null, null); + $table->add_field('reference', XMLDB_TYPE_TEXT, null, null, null, null, null); + + // Adding keys to table files_reference. + $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id')); + $table->add_key('repositoryid', XMLDB_KEY_FOREIGN, array('repositoryid'), 'repository_instances', array('id')); + + // Conditionally launch create table for files_reference + if (!$dbman->table_exists($table)) { + $dbman->create_table($table); + } + + // Main savepoint reached + upgrade_main_savepoint(true, 2012052100.00); + } + + if ($oldversion < 2012052500.03) { // fix invalid course_completion_records MDL-27368 + //first get all instances of duplicate records + $sql = 'SELECT userid, course FROM {course_completions} WHERE (deleted IS NULL OR deleted <> 1) GROUP BY userid, course HAVING (count(id) > 1)'; + $duplicates = $DB->get_recordset_sql($sql, array()); + + foreach ($duplicates as $duplicate) { + $pointer = 0; + //now get all the records for this user/course + $sql = 'userid = ? AND course = ? AND (deleted IS NULL OR deleted <> 1)'; + $completions = $DB->get_records_select('course_completions', $sql, + array($duplicate->userid, $duplicate->course), 'timecompleted DESC, timestarted DESC'); + $needsupdate = false; + $origcompletion = null; + foreach ($completions as $completion) { + $pointer++; + if ($pointer === 1) { //keep 1st record but delete all others. + $origcompletion = $completion; + } else { + //we need to keep the "oldest" of all these fields as the valid completion record. + $fieldstocheck = array('timecompleted', 'timestarted', 'timeenrolled'); + foreach ($fieldstocheck as $f) { + if ($origcompletion->$f > $completion->$f) { + $origcompletion->$f = $completion->$f; + $needsupdate = true; + } + } + $DB->delete_records('course_completions', array('id'=>$completion->id)); + } + } + if ($needsupdate) { + $DB->update_record('course_completions', $origcompletion); + } + } + + // Main savepoint reached + upgrade_main_savepoint(true, 2012052500.03); + } + + if ($oldversion < 2012052900.00) { + // Clean up all duplicate records in the course_completions table in preparation + // for adding a new index there. + upgrade_course_completion_remove_duplicates( + 'course_completions', + array('userid', 'course'), + array('timecompleted', 'timestarted', 'timeenrolled') + ); + + // Main savepoint reached + upgrade_main_savepoint(true, 2012052900.00); + } + + if ($oldversion < 2012052900.01) { + // Add indexes to prevent new duplicates in the course_completions table. + // Define index useridcourse (unique) to be added to course_completions + $table = new xmldb_table('course_completions'); + $index = new xmldb_index('useridcourse', XMLDB_INDEX_UNIQUE, array('userid', 'course')); + + // Conditionally launch add index useridcourse + if (!$dbman->index_exists($table, $index)) { + $dbman->add_index($table, $index); + } + + // Main savepoint reached + upgrade_main_savepoint(true, 2012052900.01); + } + + if ($oldversion < 2012052900.02) { + // Clean up all duplicate records in the course_completion_crit_compl table in preparation + // for adding a new index there. + upgrade_course_completion_remove_duplicates( + 'course_completion_crit_compl', + array('userid', 'course', 'criteriaid'), + array('timecompleted') + ); + + // Main savepoint reached + upgrade_main_savepoint(true, 2012052900.02); + } + + if ($oldversion < 2012052900.03) { + // Add indexes to prevent new duplicates in the course_completion_crit_compl table. + // Define index useridcoursecriteraid (unique) to be added to course_completion_crit_compl + $table = new xmldb_table('course_completion_crit_compl'); + $index = new xmldb_index('useridcoursecriteraid', XMLDB_INDEX_UNIQUE, array('userid', 'course', 'criteriaid')); + + // Conditionally launch add index useridcoursecriteraid + if (!$dbman->index_exists($table, $index)) { + $dbman->add_index($table, $index); + } + + // Main savepoint reached + upgrade_main_savepoint(true, 2012052900.03); + } + + if ($oldversion < 2012052900.04) { + // Clean up all duplicate records in the course_completion_aggr_methd table in preparation + // for adding a new index there. + upgrade_course_completion_remove_duplicates( + 'course_completion_aggr_methd', + array('course', 'criteriatype') + ); + + // Main savepoint reached + upgrade_main_savepoint(true, 2012052900.04); + } + + if ($oldversion < 2012052900.05) { + // Add indexes to prevent new duplicates in the course_completion_aggr_methd table. + // Define index coursecriteratype (unique) to be added to course_completion_aggr_methd + $table = new xmldb_table('course_completion_aggr_methd'); + $index = new xmldb_index('coursecriteriatype', XMLDB_INDEX_UNIQUE, array('course', 'criteriatype')); + + // Conditionally launch add index coursecriteratype + if (!$dbman->index_exists($table, $index)) { + $dbman->add_index($table, $index); + } + + // Main savepoint reached + upgrade_main_savepoint(true, 2012052900.05); + } + return true; -} +} \ No newline at end of file diff --git a/lib/dml/mssql_native_moodle_database.php b/lib/dml/mssql_native_moodle_database.php index 028538c4f2e..5ae728e86c6 100644 --- a/lib/dml/mssql_native_moodle_database.php +++ b/lib/dml/mssql_native_moodle_database.php @@ -826,7 +826,7 @@ class mssql_native_moodle_database extends moodle_database { } else { unset($params['id']); if ($returnid) { - $returning = "; SELECT SCOPE_IDENTITY()"; + $returning = "OUTPUT inserted.id"; } } @@ -838,18 +838,29 @@ class mssql_native_moodle_database extends moodle_database { $qms = array_fill(0, count($params), '?'); $qms = implode(',', $qms); - $sql = "INSERT INTO {" . $table . "} ($fields) VALUES($qms) $returning"; + $sql = "INSERT INTO {" . $table . "} ($fields) $returning VALUES ($qms)"; list($sql, $params, $type) = $this->fix_sql_params($sql, $params); $rawsql = $this->emulate_bound_params($sql, $params); $this->query_start($sql, $params, SQL_QUERY_INSERT); $result = mssql_query($rawsql, $this->mssql); - $this->query_end($result); + // Expected results are: + // - true: insert ok and there isn't returned information. + // - false: insert failed and there isn't returned information. + // - resource: insert executed, need to look for returned (output) + // values to know if the insert was ok or no. Posible values + // are false = failed, integer = insert ok, id returned. + $end = false; + if (is_bool($result)) { + $end = $result; + } else if (is_resource($result)) { + $end = mssql_result($result, 0, 0); // Fetch 1st column from 1st row. + } + $this->query_end($end); // End the query with the calculated $end. if ($returning !== "") { - $row = mssql_fetch_assoc($result); - $params['id'] = reset($row); + $params['id'] = $end; } $this->free_result($result); diff --git a/lib/dml/tests/dml_test.php b/lib/dml/tests/dml_test.php index 0ef6eca624d..410c7ffef3b 100644 --- a/lib/dml/tests/dml_test.php +++ b/lib/dml/tests/dml_test.php @@ -2078,6 +2078,34 @@ class dml_testcase extends database_driver_testcase { $this->assertEquals(1e-300, $DB->get_field($tablename, 'onetext', array('id' => $id))); $id = $DB->insert_record($tablename, array('onetext' => 1e300)); $this->assertEquals(1e300, $DB->get_field($tablename, 'onetext', array('id' => $id))); + + // Test that inserting data violating one unique key leads to error. + // Empty the table completely. + $this->assertTrue($DB->delete_records($tablename)); + + // Add one unique constraint (index). + $key = new xmldb_key('testuk', XMLDB_KEY_UNIQUE, array('course', 'oneint')); + $dbman->add_key($table, $key); + + // Let's insert one record violating the constraint multiple times. + $record = (object)array('course' => 1, 'oneint' => 1); + $this->assertTrue($DB->insert_record($tablename, $record, false)); // insert 1st. No problem expected. + + // Re-insert same record, not returning id. dml_exception expected. + try { + $DB->insert_record($tablename, $record, false); + $this->fail("Expecting an exception, none occurred"); + } catch (exception $e) { + $this->assertTrue($e instanceof dml_exception); + } + + // Re-insert same record, returning id. dml_exception expected. + try { + $DB->insert_record($tablename, $record, true); + $this->fail("Expecting an exception, none occurred"); + } catch (exception $e) { + $this->assertTrue($e instanceof dml_exception); + } } public function test_import_record() { diff --git a/lib/editor/tinymce/lib.php b/lib/editor/tinymce/lib.php index 885af159a10..01537e912e7 100644 --- a/lib/editor/tinymce/lib.php +++ b/lib/editor/tinymce/lib.php @@ -28,7 +28,7 @@ defined('MOODLE_INTERNAL') || die(); class tinymce_texteditor extends texteditor { /** @var string active version - directory name */ - public $version = '3.5'; + public $version = '3.5.1.1'; public function supported_by_browser() { if (check_browser_version('MSIE', 6)) { diff --git a/lib/editor/tinymce/tiny_mce/3.5/jquery.tinymce.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/jquery.tinymce.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/jquery.tinymce.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/jquery.tinymce.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/langs/en.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/langs/en.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/langs/en.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/langs/en.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/license.txt b/lib/editor/tinymce/tiny_mce/3.5.1.1/license.txt similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/license.txt rename to lib/editor/tinymce/tiny_mce/3.5.1.1/license.txt diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/advhr/css/advhr.css b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/advhr/css/advhr.css similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/advhr/css/advhr.css rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/advhr/css/advhr.css diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/advhr/editor_plugin.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/advhr/editor_plugin.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/advhr/editor_plugin.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/advhr/editor_plugin.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/advhr/editor_plugin_src.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/advhr/editor_plugin_src.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/advhr/editor_plugin_src.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/advhr/editor_plugin_src.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/advhr/js/rule.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/advhr/js/rule.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/advhr/js/rule.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/advhr/js/rule.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/advhr/langs/en_dlg.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/advhr/langs/en_dlg.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/advhr/langs/en_dlg.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/advhr/langs/en_dlg.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/advhr/rule.htm b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/advhr/rule.htm similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/advhr/rule.htm rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/advhr/rule.htm diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/advimage/css/advimage.css b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/advimage/css/advimage.css similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/advimage/css/advimage.css rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/advimage/css/advimage.css diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/advimage/editor_plugin.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/advimage/editor_plugin.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/advimage/editor_plugin.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/advimage/editor_plugin.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/advimage/editor_plugin_src.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/advimage/editor_plugin_src.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/advimage/editor_plugin_src.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/advimage/editor_plugin_src.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/advimage/image.htm b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/advimage/image.htm similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/advimage/image.htm rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/advimage/image.htm diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/advimage/img/sample.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/advimage/img/sample.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/advimage/img/sample.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/advimage/img/sample.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/advimage/js/image.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/advimage/js/image.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/advimage/js/image.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/advimage/js/image.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/advimage/langs/en_dlg.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/advimage/langs/en_dlg.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/advimage/langs/en_dlg.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/advimage/langs/en_dlg.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/advlink/css/advlink.css b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/advlink/css/advlink.css similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/advlink/css/advlink.css rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/advlink/css/advlink.css diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/advlink/editor_plugin.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/advlink/editor_plugin.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/advlink/editor_plugin.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/advlink/editor_plugin.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/advlink/editor_plugin_src.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/advlink/editor_plugin_src.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/advlink/editor_plugin_src.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/advlink/editor_plugin_src.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/advlink/js/advlink.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/advlink/js/advlink.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/advlink/js/advlink.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/advlink/js/advlink.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/advlink/langs/en_dlg.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/advlink/langs/en_dlg.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/advlink/langs/en_dlg.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/advlink/langs/en_dlg.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/advlink/link.htm b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/advlink/link.htm similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/advlink/link.htm rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/advlink/link.htm diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/advlist/editor_plugin.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/advlist/editor_plugin.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/advlist/editor_plugin.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/advlist/editor_plugin.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/advlist/editor_plugin_src.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/advlist/editor_plugin_src.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/advlist/editor_plugin_src.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/advlist/editor_plugin_src.js diff --git a/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/autolink/editor_plugin.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/autolink/editor_plugin.js new file mode 100644 index 00000000000..17f825b1bdb --- /dev/null +++ b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/autolink/editor_plugin.js @@ -0,0 +1 @@ +(function(){tinymce.create("tinymce.plugins.AutolinkPlugin",{init:function(a,b){var c=this;a.onKeyDown.addToTop(function(d,f){if(f.keyCode==13){return c.handleEnter(d)}});if(tinyMCE.isIE){return}a.onKeyPress.add(function(d,f){if(f.which==41){return c.handleEclipse(d)}});a.onKeyUp.add(function(d,f){if(f.keyCode==32){return c.handleSpacebar(d)}})},handleEclipse:function(a){this.parseCurrentLine(a,-1,"(",true)},handleSpacebar:function(a){this.parseCurrentLine(a,0,"",true)},handleEnter:function(a){this.parseCurrentLine(a,-1,"",false)},parseCurrentLine:function(i,d,b,g){var a,f,c,n,k,m,h,e,j;a=i.selection.getRng(true).cloneRange();if(a.startOffset<5){e=a.endContainer.previousSibling;if(e==null){if(a.endContainer.firstChild==null||a.endContainer.firstChild.nextSibling==null){return}e=a.endContainer.firstChild.nextSibling}j=e.length;a.setStart(e,j);a.setEnd(e,j);if(a.endOffset<5){return}f=a.endOffset;n=e}else{n=a.endContainer;if(n.nodeType!=3&&n.firstChild){while(n.nodeType!=3&&n.firstChild){n=n.firstChild}a.setStart(n,0);a.setEnd(n,n.nodeValue.length)}if(a.endOffset==1){f=2}else{f=a.endOffset-1-d}}c=f;do{a.setStart(n,f-2);a.setEnd(n,f-1);f-=1}while(a.toString()!=" "&&a.toString()!=""&&a.toString().charCodeAt(0)!=160&&(f-2)>=0&&a.toString()!=b);if(a.toString()==b||a.toString().charCodeAt(0)==160){a.setStart(n,f);a.setEnd(n,c);f+=1}else{if(a.startOffset==0){a.setStart(n,0);a.setEnd(n,c)}else{a.setStart(n,f);a.setEnd(n,c)}}var m=a.toString();if(m.charAt(m.length-1)=="."){a.setEnd(n,c-1)}m=a.toString();h=m.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+-]+@)(.+)$/i);if(h){if(h[1]=="www."){h[1]="http://www."}else{if(/@$/.test(h[1])&&!/^mailto:/.test(h[1])){h[1]="mailto:"+h[1]}}k=i.selection.getBookmark();i.selection.setRng(a);tinyMCE.execCommand("createlink",false,h[1]+h[2]);i.selection.moveToBookmark(k);if(tinyMCE.isWebKit){i.selection.collapse(false);var l=Math.min(n.length,c+1);a.setStart(n,l);a.setEnd(n,l);i.selection.setRng(a)}}},getInfo:function(){return{longname:"Autolink",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autolink",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("autolink",tinymce.plugins.AutolinkPlugin)})(); \ No newline at end of file diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/autolink/editor_plugin_src.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/autolink/editor_plugin_src.js similarity index 93% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/autolink/editor_plugin_src.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/autolink/editor_plugin_src.js index 2dd4c696034..87670517192 100644 --- a/lib/editor/tinymce/tiny_mce/3.5/plugins/autolink/editor_plugin_src.js +++ b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/autolink/editor_plugin_src.js @@ -61,7 +61,7 @@ // We need at least five characters to form a URL, // hence, at minimum, five characters from the beginning of the line. - r = ed.selection.getRng().cloneRange(); + r = ed.selection.getRng(true).cloneRange(); if (r.startOffset < 5) { // During testing, the caret is placed inbetween two text nodes. // The previous text node contains the URL. @@ -124,13 +124,19 @@ r.setEnd(endContainer, start); } + // Exclude last . from word like "www.site.com." + var text = r.toString(); + if (text.charAt(text.length - 1) == '.') { + r.setEnd(endContainer, start - 1); + } + text = r.toString(); - matches = text.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|[A-Z0-9._%+-]+@)(.+)$/i); + matches = text.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+-]+@)(.+)$/i); if (matches) { if (matches[1] == 'www.') { matches[1] = 'http://www.'; - } else if (/@$/.test(matches[1])) { + } else if (/@$/.test(matches[1]) && !/^mailto:/.test(matches[1])) { matches[1] = 'mailto:' + matches[1]; } diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/autoresize/editor_plugin.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/autoresize/editor_plugin.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/autoresize/editor_plugin.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/autoresize/editor_plugin.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/autoresize/editor_plugin_src.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/autoresize/editor_plugin_src.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/autoresize/editor_plugin_src.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/autoresize/editor_plugin_src.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/autosave/editor_plugin.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/autosave/editor_plugin.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/autosave/editor_plugin.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/autosave/editor_plugin.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/autosave/editor_plugin_src.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/autosave/editor_plugin_src.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/autosave/editor_plugin_src.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/autosave/editor_plugin_src.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/autosave/langs/en.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/autosave/langs/en.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/autosave/langs/en.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/autosave/langs/en.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/bbcode/editor_plugin.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/bbcode/editor_plugin.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/bbcode/editor_plugin.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/bbcode/editor_plugin.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/bbcode/editor_plugin_src.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/bbcode/editor_plugin_src.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/bbcode/editor_plugin_src.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/bbcode/editor_plugin_src.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/contextmenu/editor_plugin.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/contextmenu/editor_plugin.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/contextmenu/editor_plugin.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/contextmenu/editor_plugin.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/contextmenu/editor_plugin_src.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/contextmenu/editor_plugin_src.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/contextmenu/editor_plugin_src.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/contextmenu/editor_plugin_src.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/directionality/editor_plugin.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/directionality/editor_plugin.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/directionality/editor_plugin.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/directionality/editor_plugin.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/directionality/editor_plugin_src.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/directionality/editor_plugin_src.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/directionality/editor_plugin_src.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/directionality/editor_plugin_src.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/dragmath/dragmath.php b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/dragmath/dragmath.php similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/dragmath/dragmath.php rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/dragmath/dragmath.php diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/dragmath/editor_plugin.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/dragmath/editor_plugin.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/dragmath/editor_plugin.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/dragmath/editor_plugin.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/dragmath/editor_plugin_src.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/dragmath/editor_plugin_src.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/dragmath/editor_plugin_src.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/dragmath/editor_plugin_src.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/dragmath/img/dragmath.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/dragmath/img/dragmath.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/dragmath/img/dragmath.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/dragmath/img/dragmath.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/dragmath/js/dragmath.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/dragmath/js/dragmath.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/dragmath/js/dragmath.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/dragmath/js/dragmath.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/dragmath/langs/en_dlg.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/dragmath/langs/en_dlg.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/dragmath/langs/en_dlg.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/dragmath/langs/en_dlg.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/emotions/editor_plugin.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/emotions/editor_plugin.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/emotions/editor_plugin.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/emotions/editor_plugin.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/emotions/editor_plugin_src.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/emotions/editor_plugin_src.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/emotions/editor_plugin_src.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/emotions/editor_plugin_src.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/emotions/emotions.htm b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/emotions/emotions.htm similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/emotions/emotions.htm rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/emotions/emotions.htm diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/emotions/img/smiley-cool.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/emotions/img/smiley-cool.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/emotions/img/smiley-cool.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/emotions/img/smiley-cool.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/emotions/img/smiley-cry.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/emotions/img/smiley-cry.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/emotions/img/smiley-cry.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/emotions/img/smiley-cry.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/emotions/img/smiley-embarassed.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/emotions/img/smiley-embarassed.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/emotions/img/smiley-embarassed.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/emotions/img/smiley-embarassed.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/emotions/img/smiley-foot-in-mouth.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/emotions/img/smiley-foot-in-mouth.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/emotions/img/smiley-foot-in-mouth.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/emotions/img/smiley-foot-in-mouth.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/emotions/img/smiley-frown.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/emotions/img/smiley-frown.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/emotions/img/smiley-frown.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/emotions/img/smiley-frown.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/emotions/img/smiley-innocent.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/emotions/img/smiley-innocent.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/emotions/img/smiley-innocent.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/emotions/img/smiley-innocent.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/emotions/img/smiley-kiss.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/emotions/img/smiley-kiss.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/emotions/img/smiley-kiss.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/emotions/img/smiley-kiss.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/emotions/img/smiley-laughing.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/emotions/img/smiley-laughing.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/emotions/img/smiley-laughing.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/emotions/img/smiley-laughing.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/emotions/img/smiley-money-mouth.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/emotions/img/smiley-money-mouth.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/emotions/img/smiley-money-mouth.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/emotions/img/smiley-money-mouth.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/emotions/img/smiley-sealed.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/emotions/img/smiley-sealed.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/emotions/img/smiley-sealed.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/emotions/img/smiley-sealed.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/emotions/img/smiley-smile.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/emotions/img/smiley-smile.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/emotions/img/smiley-smile.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/emotions/img/smiley-smile.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/emotions/img/smiley-surprised.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/emotions/img/smiley-surprised.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/emotions/img/smiley-surprised.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/emotions/img/smiley-surprised.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/emotions/img/smiley-tongue-out.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/emotions/img/smiley-tongue-out.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/emotions/img/smiley-tongue-out.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/emotions/img/smiley-tongue-out.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/emotions/img/smiley-undecided.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/emotions/img/smiley-undecided.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/emotions/img/smiley-undecided.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/emotions/img/smiley-undecided.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/emotions/img/smiley-wink.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/emotions/img/smiley-wink.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/emotions/img/smiley-wink.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/emotions/img/smiley-wink.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/emotions/img/smiley-yell.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/emotions/img/smiley-yell.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/emotions/img/smiley-yell.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/emotions/img/smiley-yell.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/emotions/js/emotions.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/emotions/js/emotions.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/emotions/js/emotions.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/emotions/js/emotions.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/emotions/langs/en_dlg.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/emotions/langs/en_dlg.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/emotions/langs/en_dlg.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/emotions/langs/en_dlg.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/example/dialog.htm b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/example/dialog.htm similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/example/dialog.htm rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/example/dialog.htm diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/example/editor_plugin.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/example/editor_plugin.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/example/editor_plugin.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/example/editor_plugin.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/example/editor_plugin_src.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/example/editor_plugin_src.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/example/editor_plugin_src.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/example/editor_plugin_src.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/example/img/example.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/example/img/example.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/example/img/example.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/example/img/example.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/example/js/dialog.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/example/js/dialog.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/example/js/dialog.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/example/js/dialog.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/example/langs/en.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/example/langs/en.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/example/langs/en.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/example/langs/en.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/example/langs/en_dlg.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/example/langs/en_dlg.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/example/langs/en_dlg.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/example/langs/en_dlg.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/example_dependency/editor_plugin.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/example_dependency/editor_plugin.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/example_dependency/editor_plugin.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/example_dependency/editor_plugin.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/example_dependency/editor_plugin_src.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/example_dependency/editor_plugin_src.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/example_dependency/editor_plugin_src.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/example_dependency/editor_plugin_src.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/fullpage/css/fullpage.css b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/fullpage/css/fullpage.css similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/fullpage/css/fullpage.css rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/fullpage/css/fullpage.css diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/fullpage/editor_plugin.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/fullpage/editor_plugin.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/fullpage/editor_plugin.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/fullpage/editor_plugin.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/fullpage/editor_plugin_src.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/fullpage/editor_plugin_src.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/fullpage/editor_plugin_src.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/fullpage/editor_plugin_src.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/fullpage/fullpage.htm b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/fullpage/fullpage.htm similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/fullpage/fullpage.htm rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/fullpage/fullpage.htm diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/fullpage/js/fullpage.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/fullpage/js/fullpage.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/fullpage/js/fullpage.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/fullpage/js/fullpage.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/fullpage/langs/en_dlg.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/fullpage/langs/en_dlg.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/fullpage/langs/en_dlg.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/fullpage/langs/en_dlg.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/fullscreen/editor_plugin.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/fullscreen/editor_plugin.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/fullscreen/editor_plugin.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/fullscreen/editor_plugin.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/fullscreen/editor_plugin_src.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/fullscreen/editor_plugin_src.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/fullscreen/editor_plugin_src.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/fullscreen/editor_plugin_src.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/fullscreen/fullscreen.htm b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/fullscreen/fullscreen.htm similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/fullscreen/fullscreen.htm rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/fullscreen/fullscreen.htm diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/iespell/editor_plugin.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/iespell/editor_plugin.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/iespell/editor_plugin.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/iespell/editor_plugin.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/iespell/editor_plugin_src.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/iespell/editor_plugin_src.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/iespell/editor_plugin_src.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/iespell/editor_plugin_src.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/inlinepopups/editor_plugin.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/inlinepopups/editor_plugin.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/inlinepopups/editor_plugin.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/inlinepopups/editor_plugin.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/inlinepopups/editor_plugin_src.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/inlinepopups/editor_plugin_src.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/inlinepopups/editor_plugin_src.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/inlinepopups/editor_plugin_src.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/inlinepopups/skins/clearlooks2/img/alert.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/inlinepopups/skins/clearlooks2/img/alert.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/inlinepopups/skins/clearlooks2/img/alert.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/inlinepopups/skins/clearlooks2/img/alert.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/inlinepopups/skins/clearlooks2/img/button.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/inlinepopups/skins/clearlooks2/img/button.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/inlinepopups/skins/clearlooks2/img/button.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/inlinepopups/skins/clearlooks2/img/button.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/inlinepopups/skins/clearlooks2/img/corners.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/inlinepopups/skins/clearlooks2/img/corners.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/inlinepopups/skins/clearlooks2/img/corners.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/inlinepopups/skins/clearlooks2/img/corners.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/inlinepopups/skins/clearlooks2/window.css b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/inlinepopups/skins/clearlooks2/window.css similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/inlinepopups/skins/clearlooks2/window.css rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/inlinepopups/skins/clearlooks2/window.css diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/inlinepopups/template.htm b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/inlinepopups/template.htm similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/inlinepopups/template.htm rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/inlinepopups/template.htm diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/insertdatetime/editor_plugin.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/insertdatetime/editor_plugin.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/insertdatetime/editor_plugin.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/insertdatetime/editor_plugin.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/insertdatetime/editor_plugin_src.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/insertdatetime/editor_plugin_src.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/insertdatetime/editor_plugin_src.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/insertdatetime/editor_plugin_src.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/layer/editor_plugin.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/layer/editor_plugin.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/layer/editor_plugin.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/layer/editor_plugin.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/layer/editor_plugin_src.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/layer/editor_plugin_src.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/layer/editor_plugin_src.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/layer/editor_plugin_src.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/legacyoutput/editor_plugin.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/legacyoutput/editor_plugin.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/legacyoutput/editor_plugin.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/legacyoutput/editor_plugin.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/legacyoutput/editor_plugin_src.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/legacyoutput/editor_plugin_src.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/legacyoutput/editor_plugin_src.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/legacyoutput/editor_plugin_src.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/lists/editor_plugin.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/lists/editor_plugin.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/lists/editor_plugin.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/lists/editor_plugin.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/lists/editor_plugin_src.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/lists/editor_plugin_src.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/lists/editor_plugin_src.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/lists/editor_plugin_src.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/media/css/media.css b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/media/css/media.css similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/media/css/media.css rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/media/css/media.css diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/media/editor_plugin.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/media/editor_plugin.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/media/editor_plugin.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/media/editor_plugin.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/media/editor_plugin_src.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/media/editor_plugin_src.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/media/editor_plugin_src.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/media/editor_plugin_src.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/media/js/embed.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/media/js/embed.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/media/js/embed.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/media/js/embed.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/media/js/media.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/media/js/media.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/media/js/media.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/media/js/media.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/media/langs/en_dlg.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/media/langs/en_dlg.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/media/langs/en_dlg.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/media/langs/en_dlg.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/media/media.htm b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/media/media.htm similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/media/media.htm rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/media/media.htm diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/media/moxieplayer.swf b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/media/moxieplayer.swf similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/media/moxieplayer.swf rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/media/moxieplayer.swf diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/moodleemoticon/dialog.php b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/moodleemoticon/dialog.php similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/moodleemoticon/dialog.php rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/moodleemoticon/dialog.php diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/moodleemoticon/editor_plugin.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/moodleemoticon/editor_plugin.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/moodleemoticon/editor_plugin.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/moodleemoticon/editor_plugin.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/moodleemoticon/editor_plugin_src.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/moodleemoticon/editor_plugin_src.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/moodleemoticon/editor_plugin_src.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/moodleemoticon/editor_plugin_src.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/moodleemoticon/img/moodleemoticon.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/moodleemoticon/img/moodleemoticon.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/moodleemoticon/img/moodleemoticon.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/moodleemoticon/img/moodleemoticon.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/moodleemoticon/js/dialog.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/moodleemoticon/js/dialog.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/moodleemoticon/js/dialog.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/moodleemoticon/js/dialog.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/moodlemedia/css/media.css b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/moodlemedia/css/media.css similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/moodlemedia/css/media.css rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/moodlemedia/css/media.css diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/moodlemedia/editor_plugin.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/moodlemedia/editor_plugin.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/moodlemedia/editor_plugin.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/moodlemedia/editor_plugin.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/moodlemedia/editor_plugin_src.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/moodlemedia/editor_plugin_src.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/moodlemedia/editor_plugin_src.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/moodlemedia/editor_plugin_src.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/moodlemedia/img/icon.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/moodlemedia/img/icon.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/moodlemedia/img/icon.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/moodlemedia/img/icon.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/moodlemedia/js/media.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/moodlemedia/js/media.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/moodlemedia/js/media.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/moodlemedia/js/media.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/moodlemedia/moodlemedia.htm b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/moodlemedia/moodlemedia.htm similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/moodlemedia/moodlemedia.htm rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/moodlemedia/moodlemedia.htm diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/moodlemedia/preview.php b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/moodlemedia/preview.php similarity index 77% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/moodlemedia/preview.php rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/moodlemedia/preview.php index 431b077687c..f26251a5c81 100644 --- a/lib/editor/tinymce/tiny_mce/3.5/plugins/moodlemedia/preview.php +++ b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/moodlemedia/preview.php @@ -25,6 +25,8 @@ require(dirname(__FILE__) . '/../../../../../../../config.php'); require_once($CFG->libdir . '/filelib.php'); +require_once($CFG->libdir . '/editorlib.php'); +require_once($CFG->libdir . '/editor/tinymce/lib.php'); // Must be logged in require_login(); @@ -32,9 +34,11 @@ require_login(); // Require path to draftfile.php file $path = required_param('path', PARAM_PATH); +$editor = new tinymce_texteditor(); + // Now output this file which is super-simple $PAGE->set_pagelayout('embedded'); -$PAGE->set_url(new moodle_url('/lib/editor/tinymce/tiny_mce/3.4.6/plugins/moodlemedia/preview.php', +$PAGE->set_url(new moodle_url('/lib/editor/tinymce/tiny_mce/'.$editor->version.'/plugins/moodlemedia/preview.php', array('path' => $path))); $PAGE->set_context(context_system::instance()); $PAGE->add_body_class('core_media_preview'); @@ -42,7 +46,15 @@ $PAGE->add_body_class('core_media_preview'); echo $OUTPUT->header(); $mediarenderer = $PAGE->get_renderer('core', 'media'); -$url = new moodle_url('/draftfile.php/' . $path); + +$path = '/'.trim($path, '/'); + +if (empty($CFG->slasharguments)) { + $url = new moodle_url('/draftfile.php', array('file'=>$path)); +} else { + $url = new moodle_url('/draftfile.php'); + $url->set_slashargument($path); +} if ($mediarenderer->can_embed_url($url)) { echo $mediarenderer->embed_url($url); } diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/moodlenolink/editor_plugin.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/moodlenolink/editor_plugin.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/moodlenolink/editor_plugin.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/moodlenolink/editor_plugin.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/moodlenolink/editor_plugin_src.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/moodlenolink/editor_plugin_src.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/moodlenolink/editor_plugin_src.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/moodlenolink/editor_plugin_src.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/moodlenolink/img/ed_nolink.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/moodlenolink/img/ed_nolink.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/moodlenolink/img/ed_nolink.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/moodlenolink/img/ed_nolink.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/moodlenolink/langs/en.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/moodlenolink/langs/en.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/moodlenolink/langs/en.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/moodlenolink/langs/en.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/nonbreaking/editor_plugin.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/nonbreaking/editor_plugin.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/nonbreaking/editor_plugin.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/nonbreaking/editor_plugin.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/nonbreaking/editor_plugin_src.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/nonbreaking/editor_plugin_src.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/nonbreaking/editor_plugin_src.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/nonbreaking/editor_plugin_src.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/noneditable/editor_plugin.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/noneditable/editor_plugin.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/noneditable/editor_plugin.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/noneditable/editor_plugin.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/noneditable/editor_plugin_src.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/noneditable/editor_plugin_src.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/noneditable/editor_plugin_src.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/noneditable/editor_plugin_src.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/pagebreak/editor_plugin.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/pagebreak/editor_plugin.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/pagebreak/editor_plugin.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/pagebreak/editor_plugin.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/pagebreak/editor_plugin_src.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/pagebreak/editor_plugin_src.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/pagebreak/editor_plugin_src.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/pagebreak/editor_plugin_src.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/paste/editor_plugin.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/paste/editor_plugin.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/paste/editor_plugin.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/paste/editor_plugin.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/paste/editor_plugin_src.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/paste/editor_plugin_src.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/paste/editor_plugin_src.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/paste/editor_plugin_src.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/paste/js/pastetext.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/paste/js/pastetext.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/paste/js/pastetext.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/paste/js/pastetext.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/paste/js/pasteword.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/paste/js/pasteword.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/paste/js/pasteword.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/paste/js/pasteword.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/paste/langs/en_dlg.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/paste/langs/en_dlg.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/paste/langs/en_dlg.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/paste/langs/en_dlg.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/paste/pastetext.htm b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/paste/pastetext.htm similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/paste/pastetext.htm rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/paste/pastetext.htm diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/paste/pasteword.htm b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/paste/pasteword.htm similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/paste/pasteword.htm rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/paste/pasteword.htm diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/preview/editor_plugin.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/preview/editor_plugin.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/preview/editor_plugin.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/preview/editor_plugin.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/preview/editor_plugin_src.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/preview/editor_plugin_src.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/preview/editor_plugin_src.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/preview/editor_plugin_src.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/preview/example.html b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/preview/example.html similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/preview/example.html rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/preview/example.html diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/preview/jscripts/embed.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/preview/jscripts/embed.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/preview/jscripts/embed.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/preview/jscripts/embed.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/preview/preview.html b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/preview/preview.html similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/preview/preview.html rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/preview/preview.html diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/print/editor_plugin.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/print/editor_plugin.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/print/editor_plugin.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/print/editor_plugin.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/print/editor_plugin_src.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/print/editor_plugin_src.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/print/editor_plugin_src.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/print/editor_plugin_src.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/save/editor_plugin.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/save/editor_plugin.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/save/editor_plugin.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/save/editor_plugin.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/save/editor_plugin_src.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/save/editor_plugin_src.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/save/editor_plugin_src.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/save/editor_plugin_src.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/searchreplace/css/searchreplace.css b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/searchreplace/css/searchreplace.css similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/searchreplace/css/searchreplace.css rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/searchreplace/css/searchreplace.css diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/searchreplace/editor_plugin.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/searchreplace/editor_plugin.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/searchreplace/editor_plugin.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/searchreplace/editor_plugin.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/searchreplace/editor_plugin_src.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/searchreplace/editor_plugin_src.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/searchreplace/editor_plugin_src.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/searchreplace/editor_plugin_src.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/searchreplace/js/searchreplace.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/searchreplace/js/searchreplace.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/searchreplace/js/searchreplace.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/searchreplace/js/searchreplace.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/searchreplace/langs/en_dlg.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/searchreplace/langs/en_dlg.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/searchreplace/langs/en_dlg.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/searchreplace/langs/en_dlg.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/searchreplace/searchreplace.htm b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/searchreplace/searchreplace.htm similarity index 96% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/searchreplace/searchreplace.htm rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/searchreplace/searchreplace.htm index fe711759598..ae81d40dccc 100644 --- a/lib/editor/tinymce/tiny_mce/3.5/plugins/searchreplace/searchreplace.htm +++ b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/searchreplace/searchreplace.htm @@ -93,7 +93,7 @@ - + diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/spellchecker/changelog.txt b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/spellchecker/changelog.txt similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/spellchecker/changelog.txt rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/spellchecker/changelog.txt diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/spellchecker/classes/EnchantSpell.php b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/spellchecker/classes/EnchantSpell.php similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/spellchecker/classes/EnchantSpell.php rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/spellchecker/classes/EnchantSpell.php diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/spellchecker/classes/GoogleSpell.php b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/spellchecker/classes/GoogleSpell.php similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/spellchecker/classes/GoogleSpell.php rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/spellchecker/classes/GoogleSpell.php diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/spellchecker/classes/PSpell.php b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/spellchecker/classes/PSpell.php similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/spellchecker/classes/PSpell.php rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/spellchecker/classes/PSpell.php diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/spellchecker/classes/PSpellShell.php b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/spellchecker/classes/PSpellShell.php similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/spellchecker/classes/PSpellShell.php rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/spellchecker/classes/PSpellShell.php diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/spellchecker/classes/SpellChecker.php b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/spellchecker/classes/SpellChecker.php similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/spellchecker/classes/SpellChecker.php rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/spellchecker/classes/SpellChecker.php diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/spellchecker/classes/utils/JSON.php b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/spellchecker/classes/utils/JSON.php similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/spellchecker/classes/utils/JSON.php rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/spellchecker/classes/utils/JSON.php diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/spellchecker/classes/utils/Logger.php b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/spellchecker/classes/utils/Logger.php similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/spellchecker/classes/utils/Logger.php rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/spellchecker/classes/utils/Logger.php diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/spellchecker/config.php b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/spellchecker/config.php similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/spellchecker/config.php rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/spellchecker/config.php diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/spellchecker/css/content.css b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/spellchecker/css/content.css similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/spellchecker/css/content.css rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/spellchecker/css/content.css diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/spellchecker/editor_plugin.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/spellchecker/editor_plugin.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/spellchecker/editor_plugin.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/spellchecker/editor_plugin.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/spellchecker/editor_plugin_src.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/spellchecker/editor_plugin_src.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/spellchecker/editor_plugin_src.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/spellchecker/editor_plugin_src.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/spellchecker/img/wline.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/spellchecker/img/wline.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/spellchecker/img/wline.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/spellchecker/img/wline.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/spellchecker/includes/general.php b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/spellchecker/includes/general.php similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/spellchecker/includes/general.php rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/spellchecker/includes/general.php diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/spellchecker/rpc.php b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/spellchecker/rpc.php similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/spellchecker/rpc.php rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/spellchecker/rpc.php diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/style/css/props.css b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/style/css/props.css similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/style/css/props.css rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/style/css/props.css diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/style/editor_plugin.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/style/editor_plugin.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/style/editor_plugin.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/style/editor_plugin.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/style/editor_plugin_src.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/style/editor_plugin_src.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/style/editor_plugin_src.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/style/editor_plugin_src.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/style/js/props.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/style/js/props.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/style/js/props.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/style/js/props.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/style/langs/en_dlg.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/style/langs/en_dlg.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/style/langs/en_dlg.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/style/langs/en_dlg.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/style/props.htm b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/style/props.htm similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/style/props.htm rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/style/props.htm diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/style/readme.txt b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/style/readme.txt similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/style/readme.txt rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/style/readme.txt diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/tabfocus/editor_plugin.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/tabfocus/editor_plugin.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/tabfocus/editor_plugin.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/tabfocus/editor_plugin.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/tabfocus/editor_plugin_src.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/tabfocus/editor_plugin_src.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/tabfocus/editor_plugin_src.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/tabfocus/editor_plugin_src.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/table/cell.htm b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/table/cell.htm similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/table/cell.htm rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/table/cell.htm diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/table/css/cell.css b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/table/css/cell.css similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/table/css/cell.css rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/table/css/cell.css diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/table/css/row.css b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/table/css/row.css similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/table/css/row.css rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/table/css/row.css diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/table/css/table.css b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/table/css/table.css similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/table/css/table.css rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/table/css/table.css diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/table/editor_plugin.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/table/editor_plugin.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/table/editor_plugin.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/table/editor_plugin.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/table/editor_plugin_src.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/table/editor_plugin_src.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/table/editor_plugin_src.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/table/editor_plugin_src.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/table/js/cell.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/table/js/cell.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/table/js/cell.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/table/js/cell.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/table/js/merge_cells.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/table/js/merge_cells.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/table/js/merge_cells.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/table/js/merge_cells.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/table/js/row.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/table/js/row.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/table/js/row.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/table/js/row.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/table/js/table.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/table/js/table.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/table/js/table.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/table/js/table.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/table/langs/en_dlg.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/table/langs/en_dlg.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/table/langs/en_dlg.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/table/langs/en_dlg.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/table/merge_cells.htm b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/table/merge_cells.htm similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/table/merge_cells.htm rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/table/merge_cells.htm diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/table/row.htm b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/table/row.htm similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/table/row.htm rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/table/row.htm diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/table/table.htm b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/table/table.htm similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/table/table.htm rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/table/table.htm diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/template/blank.htm b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/template/blank.htm similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/template/blank.htm rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/template/blank.htm diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/template/css/template.css b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/template/css/template.css similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/template/css/template.css rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/template/css/template.css diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/template/editor_plugin.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/template/editor_plugin.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/template/editor_plugin.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/template/editor_plugin.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/template/editor_plugin_src.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/template/editor_plugin_src.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/template/editor_plugin_src.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/template/editor_plugin_src.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/template/js/template.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/template/js/template.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/template/js/template.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/template/js/template.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/template/langs/en_dlg.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/template/langs/en_dlg.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/template/langs/en_dlg.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/template/langs/en_dlg.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/template/template.htm b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/template/template.htm similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/template/template.htm rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/template/template.htm diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/visualblocks/css/visualblocks.css b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/visualblocks/css/visualblocks.css similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/visualblocks/css/visualblocks.css rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/visualblocks/css/visualblocks.css diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/visualblocks/editor_plugin.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/visualblocks/editor_plugin.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/visualblocks/editor_plugin.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/visualblocks/editor_plugin.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/visualblocks/editor_plugin_src.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/visualblocks/editor_plugin_src.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/visualblocks/editor_plugin_src.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/visualblocks/editor_plugin_src.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/visualblocks/img/address.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/visualblocks/img/address.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/visualblocks/img/address.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/visualblocks/img/address.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/visualblocks/img/article.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/visualblocks/img/article.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/visualblocks/img/article.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/visualblocks/img/article.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/visualblocks/img/aside.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/visualblocks/img/aside.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/visualblocks/img/aside.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/visualblocks/img/aside.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/visualblocks/img/blockquote.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/visualblocks/img/blockquote.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/visualblocks/img/blockquote.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/visualblocks/img/blockquote.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/visualblocks/img/div.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/visualblocks/img/div.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/visualblocks/img/div.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/visualblocks/img/div.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/visualblocks/img/figure.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/visualblocks/img/figure.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/visualblocks/img/figure.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/visualblocks/img/figure.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/visualblocks/img/h1.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/visualblocks/img/h1.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/visualblocks/img/h1.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/visualblocks/img/h1.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/visualblocks/img/h2.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/visualblocks/img/h2.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/visualblocks/img/h2.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/visualblocks/img/h2.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/visualblocks/img/h3.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/visualblocks/img/h3.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/visualblocks/img/h3.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/visualblocks/img/h3.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/visualblocks/img/h4.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/visualblocks/img/h4.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/visualblocks/img/h4.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/visualblocks/img/h4.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/visualblocks/img/h5.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/visualblocks/img/h5.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/visualblocks/img/h5.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/visualblocks/img/h5.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/visualblocks/img/h6.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/visualblocks/img/h6.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/visualblocks/img/h6.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/visualblocks/img/h6.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/visualblocks/img/hgroup.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/visualblocks/img/hgroup.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/visualblocks/img/hgroup.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/visualblocks/img/hgroup.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/visualblocks/img/p.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/visualblocks/img/p.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/visualblocks/img/p.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/visualblocks/img/p.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/visualblocks/img/pre.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/visualblocks/img/pre.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/visualblocks/img/pre.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/visualblocks/img/pre.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/visualblocks/img/section.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/visualblocks/img/section.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/visualblocks/img/section.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/visualblocks/img/section.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/visualchars/editor_plugin.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/visualchars/editor_plugin.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/visualchars/editor_plugin.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/visualchars/editor_plugin.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/visualchars/editor_plugin_src.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/visualchars/editor_plugin_src.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/visualchars/editor_plugin_src.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/visualchars/editor_plugin_src.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/wordcount/editor_plugin.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/wordcount/editor_plugin.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/wordcount/editor_plugin.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/wordcount/editor_plugin.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/wordcount/editor_plugin_src.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/wordcount/editor_plugin_src.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/wordcount/editor_plugin_src.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/wordcount/editor_plugin_src.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/xhtmlxtras/abbr.htm b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/xhtmlxtras/abbr.htm similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/xhtmlxtras/abbr.htm rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/xhtmlxtras/abbr.htm diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/xhtmlxtras/acronym.htm b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/xhtmlxtras/acronym.htm similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/xhtmlxtras/acronym.htm rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/xhtmlxtras/acronym.htm diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/xhtmlxtras/attributes.htm b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/xhtmlxtras/attributes.htm similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/xhtmlxtras/attributes.htm rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/xhtmlxtras/attributes.htm diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/xhtmlxtras/cite.htm b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/xhtmlxtras/cite.htm similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/xhtmlxtras/cite.htm rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/xhtmlxtras/cite.htm diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/xhtmlxtras/css/attributes.css b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/xhtmlxtras/css/attributes.css similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/xhtmlxtras/css/attributes.css rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/xhtmlxtras/css/attributes.css diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/xhtmlxtras/css/popup.css b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/xhtmlxtras/css/popup.css similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/xhtmlxtras/css/popup.css rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/xhtmlxtras/css/popup.css diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/xhtmlxtras/del.htm b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/xhtmlxtras/del.htm similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/xhtmlxtras/del.htm rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/xhtmlxtras/del.htm diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/xhtmlxtras/editor_plugin.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/xhtmlxtras/editor_plugin.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/xhtmlxtras/editor_plugin.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/xhtmlxtras/editor_plugin.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/xhtmlxtras/editor_plugin_src.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/xhtmlxtras/editor_plugin_src.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/xhtmlxtras/editor_plugin_src.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/xhtmlxtras/editor_plugin_src.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/xhtmlxtras/ins.htm b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/xhtmlxtras/ins.htm similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/xhtmlxtras/ins.htm rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/xhtmlxtras/ins.htm diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/xhtmlxtras/js/abbr.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/xhtmlxtras/js/abbr.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/xhtmlxtras/js/abbr.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/xhtmlxtras/js/abbr.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/xhtmlxtras/js/acronym.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/xhtmlxtras/js/acronym.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/xhtmlxtras/js/acronym.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/xhtmlxtras/js/acronym.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/xhtmlxtras/js/attributes.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/xhtmlxtras/js/attributes.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/xhtmlxtras/js/attributes.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/xhtmlxtras/js/attributes.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/xhtmlxtras/js/cite.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/xhtmlxtras/js/cite.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/xhtmlxtras/js/cite.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/xhtmlxtras/js/cite.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/xhtmlxtras/js/del.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/xhtmlxtras/js/del.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/xhtmlxtras/js/del.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/xhtmlxtras/js/del.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/xhtmlxtras/js/element_common.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/xhtmlxtras/js/element_common.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/xhtmlxtras/js/element_common.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/xhtmlxtras/js/element_common.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/xhtmlxtras/js/ins.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/xhtmlxtras/js/ins.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/xhtmlxtras/js/ins.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/xhtmlxtras/js/ins.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/xhtmlxtras/langs/en_dlg.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/xhtmlxtras/langs/en_dlg.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/plugins/xhtmlxtras/langs/en_dlg.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/plugins/xhtmlxtras/langs/en_dlg.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/advanced/about.htm b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/about.htm similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/advanced/about.htm rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/about.htm diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/advanced/anchor.htm b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/anchor.htm similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/advanced/anchor.htm rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/anchor.htm diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/advanced/charmap.htm b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/charmap.htm similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/advanced/charmap.htm rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/charmap.htm diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/advanced/color_picker.htm b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/color_picker.htm similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/advanced/color_picker.htm rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/color_picker.htm diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/advanced/editor_template.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/editor_template.js similarity index 76% rename from lib/editor/tinymce/tiny_mce/3.5/themes/advanced/editor_template.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/editor_template.js index 5e9deec8926..e7ae8ab0910 100644 --- a/lib/editor/tinymce/tiny_mce/3.5/themes/advanced/editor_template.js +++ b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/editor_template.js @@ -1 +1 @@ -(function(h){var i=h.DOM,g=h.dom.Event,c=h.extend,f=h.each,a=h.util.Cookie,e,d=h.explode;function b(m,k){var q,p=m.dom,n="",o,l;previewStyles=m.settings.preview_styles;if(previewStyles===false){return""}if(!previewStyles){previewStyles="font-family font-size font-weight text-decoration text-transform color background-color"}function j(r){return r.replace(/%(\w+)/g,"")}name=k.block||k.inline||"span";q=p.create(name);f(k.styles,function(s,r){s=j(s);if(s){p.setStyle(q,r,s)}});f(k.attributes,function(s,r){s=j(s);if(s){p.setAttrib(q,r,s)}});f(k.classes,function(r){r=j(r);if(!p.hasClass(q,r)){p.addClass(q,r)}});p.setStyles(q,{position:"absolute",left:-65535});m.getBody().appendChild(q);o=p.getStyle(m.getBody(),"fontSize",true);o=/px$/.test(o)?parseInt(o,10):0;f(previewStyles.split(" "),function(r){var s=p.getStyle(q,r,true);if(r=="background-color"&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(s)){s=p.getStyle(m.getBody(),r,true);if(p.toHex(s).toLowerCase()=="#ffffff"){return}}if(r=="font-size"){if(/em|%$/.test(s)){if(o===0){return}s=parseFloat(s,10)/(/%$/.test(s)?100:1);s=(s*o)+"px"}}n+=r+":"+s+";"});p.remove(q);return n}h.ThemeManager.requireLangPack("advanced");h.create("tinymce.themes.AdvancedTheme",{sizes:[8,10,12,14,18,24,36],controls:{bold:["bold_desc","Bold"],italic:["italic_desc","Italic"],underline:["underline_desc","Underline"],strikethrough:["striketrough_desc","Strikethrough"],justifyleft:["justifyleft_desc","JustifyLeft"],justifycenter:["justifycenter_desc","JustifyCenter"],justifyright:["justifyright_desc","JustifyRight"],justifyfull:["justifyfull_desc","JustifyFull"],bullist:["bullist_desc","InsertUnorderedList"],numlist:["numlist_desc","InsertOrderedList"],outdent:["outdent_desc","Outdent"],indent:["indent_desc","Indent"],cut:["cut_desc","Cut"],copy:["copy_desc","Copy"],paste:["paste_desc","Paste"],undo:["undo_desc","Undo"],redo:["redo_desc","Redo"],link:["link_desc","mceLink"],unlink:["unlink_desc","unlink"],image:["image_desc","mceImage"],cleanup:["cleanup_desc","mceCleanup"],help:["help_desc","mceHelp"],code:["code_desc","mceCodeEditor"],hr:["hr_desc","InsertHorizontalRule"],removeformat:["removeformat_desc","RemoveFormat"],sub:["sub_desc","subscript"],sup:["sup_desc","superscript"],forecolor:["forecolor_desc","ForeColor"],forecolorpicker:["forecolor_desc","mceForeColor"],backcolor:["backcolor_desc","HiliteColor"],backcolorpicker:["backcolor_desc","mceBackColor"],charmap:["charmap_desc","mceCharMap"],visualaid:["visualaid_desc","mceToggleVisualAid"],anchor:["anchor_desc","mceInsertAnchor"],newdocument:["newdocument_desc","mceNewDocument"],blockquote:["blockquote_desc","mceBlockQuote"]},stateControls:["bold","italic","underline","strikethrough","bullist","numlist","justifyleft","justifycenter","justifyright","justifyfull","sub","sup","blockquote"],init:function(k,l){var m=this,n,j,p;m.editor=k;m.url=l;m.onResolveName=new h.util.Dispatcher(this);k.forcedHighContrastMode=k.settings.detect_highcontrast&&m._isHighContrast();k.settings.skin=k.forcedHighContrastMode?"highcontrast":k.settings.skin;m.settings=n=c({theme_advanced_path:true,theme_advanced_toolbar_location:"bottom",theme_advanced_buttons1:"bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect",theme_advanced_buttons2:"bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code",theme_advanced_buttons3:"hr,removeformat,visualaid,|,sub,sup,|,charmap",theme_advanced_blockformats:"p,address,pre,h1,h2,h3,h4,h5,h6",theme_advanced_toolbar_align:"center",theme_advanced_fonts:"Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",theme_advanced_more_colors:1,theme_advanced_row_height:23,theme_advanced_resize_horizontal:1,theme_advanced_resizing_use_cookie:1,theme_advanced_font_sizes:"1,2,3,4,5,6,7",theme_advanced_font_selector:"span",theme_advanced_show_current_color:0,readonly:k.settings.readonly},k.settings);if(!n.font_size_style_values){n.font_size_style_values="8pt,10pt,12pt,14pt,18pt,24pt,36pt"}if(h.is(n.theme_advanced_font_sizes,"string")){n.font_size_style_values=h.explode(n.font_size_style_values);n.font_size_classes=h.explode(n.font_size_classes||"");p={};k.settings.theme_advanced_font_sizes=n.theme_advanced_font_sizes;f(k.getParam("theme_advanced_font_sizes","","hash"),function(r,q){var o;if(q==r&&r>=1&&r<=7){q=r+" ("+m.sizes[r-1]+"pt)";o=n.font_size_classes[r-1];r=n.font_size_style_values[r-1]||(m.sizes[r-1]+"pt")}if(/^\s*\./.test(r)){o=r.replace(/\./g,"")}p[q]=o?{"class":o}:{fontSize:r}});n.theme_advanced_font_sizes=p}if((j=n.theme_advanced_path_location)&&j!="none"){n.theme_advanced_statusbar_location=n.theme_advanced_path_location}if(n.theme_advanced_statusbar_location=="none"){n.theme_advanced_statusbar_location=0}if(k.settings.content_css!==false){k.contentCSS.push(k.baseURI.toAbsolute(l+"/skins/"+k.settings.skin+"/content.css"))}k.onInit.add(function(){if(!k.settings.readonly){k.onNodeChange.add(m._nodeChanged,m);k.onKeyUp.add(m._updateUndoStatus,m);k.onMouseUp.add(m._updateUndoStatus,m);k.dom.bind(k.dom.getRoot(),"dragend",function(){m._updateUndoStatus(k)})}});k.onSetProgressState.add(function(r,o,s){var t,u=r.id,q;if(o){m.progressTimer=setTimeout(function(){t=r.getContainer();t=t.insertBefore(i.create("DIV",{style:"position:relative"}),t.firstChild);q=i.get(r.id+"_tbl");i.add(t,"div",{id:u+"_blocker","class":"mceBlocker",style:{width:q.clientWidth+2,height:q.clientHeight+2}});i.add(t,"div",{id:u+"_progress","class":"mceProgress",style:{left:q.clientWidth/2,top:q.clientHeight/2}})},s||0)}else{i.remove(u+"_blocker");i.remove(u+"_progress");clearTimeout(m.progressTimer)}});i.loadCSS(n.editor_css?k.documentBaseURI.toAbsolute(n.editor_css):l+"/skins/"+k.settings.skin+"/ui.css");if(n.skin_variant){i.loadCSS(l+"/skins/"+k.settings.skin+"/ui_"+n.skin_variant+".css")}},_isHighContrast:function(){var j,k=i.add(i.getRoot(),"div",{style:"background-color: rgb(171,239,86);"});j=(i.getStyle(k,"background-color",true)+"").toLowerCase().replace(/ /g,"");i.remove(k);return j!="rgb(171,239,86)"&&j!="#abef56"},createControl:function(m,j){var k,l;if(l=j.createControl(m)){return l}switch(m){case"styleselect":return this._createStyleSelect();case"formatselect":return this._createBlockFormats();case"fontselect":return this._createFontSelect();case"fontsizeselect":return this._createFontSizeSelect();case"forecolor":return this._createForeColorMenu();case"backcolor":return this._createBackColorMenu()}if((k=this.controls[m])){return j.createButton(m,{title:"advanced."+k[0],cmd:k[1],ui:k[2],value:k[3]})}},execCommand:function(l,k,m){var j=this["_"+l];if(j){j.call(this,k,m);return true}return false},_importClasses:function(l){var j=this.editor,k=j.controlManager.get("styleselect");if(k.getLength()==0){f(j.dom.getClasses(),function(q,m){var p="style_"+m,n;n={inline:"span",attributes:{"class":q["class"]},selector:"*"};j.formatter.register(p,n);k.add(q["class"],p,{style:function(){return b(j,n)}})})}},_createStyleSelect:function(o){var l=this,j=l.editor,k=j.controlManager,m;m=k.createListBox("styleselect",{title:"advanced.style_select",onselect:function(q){var r,n=[],p;f(m.items,function(s){n.push(s.value)});j.focus();j.undoManager.add();r=j.formatter.matchAll(n);h.each(r,function(s){if(!q||s==q){if(s){j.formatter.remove(s)}p=true}});if(!p){j.formatter.apply(q)}j.undoManager.add();j.nodeChanged();return false}});j.onPreInit.add(function(){var p=0,n=j.getParam("style_formats");if(n){f(n,function(q){var r,s=0;f(q,function(){s++});if(s>1){r=q.name=q.name||"style_"+(p++);j.formatter.register(r,q);m.add(q.title,r,{style:function(){return b(j,q)}})}else{m.add(q.title)}})}else{f(j.getParam("theme_advanced_styles","","hash"),function(t,s){var r,q;if(t){r="style_"+(p++);q={inline:"span",classes:t,selector:"*"};j.formatter.register(r,q);m.add(l.editor.translate(s),r,{style:function(){return b(j,q)}})}})}});if(m.getLength()==0){m.onPostRender.add(function(p,q){if(!m.NativeListBox){g.add(q.id+"_text","focus",l._importClasses,l);g.add(q.id+"_text","mousedown",l._importClasses,l);g.add(q.id+"_open","focus",l._importClasses,l);g.add(q.id+"_open","mousedown",l._importClasses,l)}else{g.add(q.id,"focus",l._importClasses,l)}})}return m},_createFontSelect:function(){var l,k=this,j=k.editor;l=j.controlManager.createListBox("fontselect",{title:"advanced.fontdefault",onselect:function(m){var n=l.items[l.selectedIndex];if(!m&&n){j.execCommand("FontName",false,n.value);return}j.execCommand("FontName",false,m);l.select(function(o){return m==o});if(n&&n.value==m){l.select(null)}return false}});if(l){f(j.getParam("theme_advanced_fonts",k.settings.theme_advanced_fonts,"hash"),function(n,m){l.add(j.translate(m),n,{style:n.indexOf("dings")==-1?"font-family:"+n:""})})}return l},_createFontSizeSelect:function(){var m=this,k=m.editor,n,l=0,j=[];n=k.controlManager.createListBox("fontsizeselect",{title:"advanced.font_size",onselect:function(o){var p=n.items[n.selectedIndex];if(!o&&p){p=p.value;if(p["class"]){k.formatter.toggle("fontsize_class",{value:p["class"]});k.undoManager.add();k.nodeChanged()}else{k.execCommand("FontSize",false,p.fontSize)}return}if(o["class"]){k.focus();k.undoManager.add();k.formatter.toggle("fontsize_class",{value:o["class"]});k.undoManager.add();k.nodeChanged()}else{k.execCommand("FontSize",false,o.fontSize)}n.select(function(q){return o==q});if(p&&(p.value.fontSize==o.fontSize||p.value["class"]&&p.value["class"]==o["class"])){n.select(null)}return false}});if(n){f(m.settings.theme_advanced_font_sizes,function(p,o){var q=p.fontSize;if(q>=1&&q<=7){q=m.sizes[parseInt(q)-1]+"pt"}n.add(o,p,{style:"font-size:"+q,"class":"mceFontSize"+(l++)+(" "+(p["class"]||""))})})}return n},_createBlockFormats:function(){var l,j={p:"advanced.paragraph",address:"advanced.address",pre:"advanced.pre",h1:"advanced.h1",h2:"advanced.h2",h3:"advanced.h3",h4:"advanced.h4",h5:"advanced.h5",h6:"advanced.h6",div:"advanced.div",blockquote:"advanced.blockquote",code:"advanced.code",dt:"advanced.dt",dd:"advanced.dd",samp:"advanced.samp"},k=this;l=k.editor.controlManager.createListBox("formatselect",{title:"advanced.block",onselect:function(m){k.editor.execCommand("FormatBlock",false,m);return false}});if(l){f(k.editor.getParam("theme_advanced_blockformats",k.settings.theme_advanced_blockformats,"hash"),function(n,m){l.add(k.editor.translate(m!=n?m:j[n]),n,{"class":"mce_formatPreview mce_"+n,style:function(){return b(k.editor,{block:n})}})})}return l},_createForeColorMenu:function(){var n,k=this,l=k.settings,m={},j;if(l.theme_advanced_more_colors){m.more_colors_func=function(){k._mceColorPicker(0,{color:n.value,func:function(o){n.setColor(o)}})}}if(j=l.theme_advanced_text_colors){m.colors=j}if(l.theme_advanced_default_foreground_color){m.default_color=l.theme_advanced_default_foreground_color}m.title="advanced.forecolor_desc";m.cmd="ForeColor";m.scope=this;n=k.editor.controlManager.createColorSplitButton("forecolor",m);return n},_createBackColorMenu:function(){var n,k=this,l=k.settings,m={},j;if(l.theme_advanced_more_colors){m.more_colors_func=function(){k._mceColorPicker(0,{color:n.value,func:function(o){n.setColor(o)}})}}if(j=l.theme_advanced_background_colors){m.colors=j}if(l.theme_advanced_default_background_color){m.default_color=l.theme_advanced_default_background_color}m.title="advanced.backcolor_desc";m.cmd="HiliteColor";m.scope=this;n=k.editor.controlManager.createColorSplitButton("backcolor",m);return n},renderUI:function(l){var q,m,r,w=this,u=w.editor,x=w.settings,v,k,j;if(u.settings){u.settings.aria_label=x.aria_label+u.getLang("advanced.help_shortcut")}q=k=i.create("span",{role:"application","aria-labelledby":u.id+"_voice",id:u.id+"_parent","class":"mceEditor "+u.settings.skin+"Skin"+(x.skin_variant?" "+u.settings.skin+"Skin"+w._ufirst(x.skin_variant):"")+(u.settings.directionality=="rtl"?" mceRtl":"")});i.add(q,"span",{"class":"mceVoiceLabel",style:"display:none;",id:u.id+"_voice"},x.aria_label);if(!i.boxModel){q=i.add(q,"div",{"class":"mceOldBoxModel"})}q=v=i.add(q,"table",{role:"presentation",id:u.id+"_tbl","class":"mceLayout",cellSpacing:0,cellPadding:0});q=r=i.add(q,"tbody");switch((x.theme_advanced_layout_manager||"").toLowerCase()){case"rowlayout":m=w._rowLayout(x,r,l);break;case"customlayout":m=u.execCallback("theme_advanced_custom_layout",x,r,l,k);break;default:m=w._simpleLayout(x,r,l,k)}q=l.targetNode;j=v.rows;i.addClass(j[0],"mceFirst");i.addClass(j[j.length-1],"mceLast");f(i.select("tr",r),function(o){i.addClass(o.firstChild,"mceFirst");i.addClass(o.childNodes[o.childNodes.length-1],"mceLast")});if(i.get(x.theme_advanced_toolbar_container)){i.get(x.theme_advanced_toolbar_container).appendChild(k)}else{i.insertAfter(k,q)}g.add(u.id+"_path_row","click",function(n){n=n.target;if(n.nodeName=="A"){w._sel(n.className.replace(/^.*mcePath_([0-9]+).*$/,"$1"));return false}});if(!u.getParam("accessibility_focus")){g.add(i.add(k,"a",{href:"#"},""),"focus",function(){tinyMCE.get(u.id).focus()})}if(x.theme_advanced_toolbar_location=="external"){l.deltaHeight=0}w.deltaHeight=l.deltaHeight;l.targetNode=null;u.onKeyDown.add(function(p,n){var s=121,o=122;if(n.altKey){if(n.keyCode===s){if(h.isWebKit){window.focus()}w.toolbarGroup.focus();return g.cancel(n)}else{if(n.keyCode===o){i.get(p.id+"_path_row").focus();return g.cancel(n)}}}});u.addShortcut("alt+0","","mceShortcuts",w);return{iframeContainer:m,editorContainer:u.id+"_parent",sizeContainer:v,deltaHeight:l.deltaHeight}},getInfo:function(){return{longname:"Advanced theme",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",version:h.majorVersion+"."+h.minorVersion}},resizeBy:function(j,k){var l=i.get(this.editor.id+"_ifr");this.resizeTo(l.clientWidth+j,l.clientHeight+k)},resizeTo:function(j,n,l){var k=this.editor,m=this.settings,o=i.get(k.id+"_tbl"),p=i.get(k.id+"_ifr");j=Math.max(m.theme_advanced_resizing_min_width||100,j);n=Math.max(m.theme_advanced_resizing_min_height||100,n);j=Math.min(m.theme_advanced_resizing_max_width||65535,j);n=Math.min(m.theme_advanced_resizing_max_height||65535,n);i.setStyle(o,"height","");i.setStyle(p,"height",n);if(m.theme_advanced_resize_horizontal){i.setStyle(o,"width","");i.setStyle(p,"width",j);if(j"));i.setHTML(l,r.join(""))},_addStatusBar:function(p,k){var l,w=this,q=w.editor,x=w.settings,j,u,v,m;l=i.add(p,"tr");l=m=i.add(l,"td",{"class":"mceStatusbar"});l=i.add(l,"div",{id:q.id+"_path_row",role:"group","aria-labelledby":q.id+"_path_voice"});if(x.theme_advanced_path){i.add(l,"span",{id:q.id+"_path_voice"},q.translate("advanced.path"));i.add(l,"span",{},": ")}else{i.add(l,"span",{}," ")}if(x.theme_advanced_resizing){i.add(m,"a",{id:q.id+"_resize",href:"javascript:;",onclick:"return false;","class":"mceResize",tabIndex:"-1"});if(x.theme_advanced_resizing_use_cookie){q.onPostRender.add(function(){var n=a.getHash("TinyMCE_"+q.id+"_size"),r=i.get(q.id+"_tbl");if(!n){return}w.resizeTo(n.cw,n.ch)})}q.onPostRender.add(function(){g.add(q.id+"_resize","click",function(n){n.preventDefault()});g.add(q.id+"_resize","mousedown",function(E){var t,r,s,o,D,A,B,G,n,F,y;function z(H){H.preventDefault();n=B+(H.screenX-D);F=G+(H.screenY-A);w.resizeTo(n,F)}function C(H){g.remove(i.doc,"mousemove",t);g.remove(q.getDoc(),"mousemove",r);g.remove(i.doc,"mouseup",s);g.remove(q.getDoc(),"mouseup",o);n=B+(H.screenX-D);F=G+(H.screenY-A);w.resizeTo(n,F,true)}E.preventDefault();D=E.screenX;A=E.screenY;y=i.get(w.editor.id+"_ifr");B=n=y.clientWidth;G=F=y.clientHeight;t=g.add(i.doc,"mousemove",z);r=g.add(q.getDoc(),"mousemove",z);s=g.add(i.doc,"mouseup",C);o=g.add(q.getDoc(),"mouseup",C)})})}k.deltaHeight-=21;l=p=null},_updateUndoStatus:function(k){var j=k.controlManager,l=k.undoManager;j.setDisabled("undo",!l.hasUndo()&&!l.typing);j.setDisabled("redo",!l.hasRedo())},_nodeChanged:function(o,u,E,r,F){var z=this,D,G=0,y,H,A=z.settings,x,l,w,C,m,k,j;h.each(z.stateControls,function(n){u.setActive(n,o.queryCommandState(z.controls[n][1]))});function q(p){var s,n=F.parents,t=p;if(typeof(p)=="string"){t=function(v){return v.nodeName==p}}for(s=0;s0){H.mark(p)}})}if(H=u.get("formatselect")){D=q(o.dom.isBlock);if(D){H.select(D.nodeName.toLowerCase())}}q(function(p){if(p.nodeName==="SPAN"){if(!x&&p.className){x=p.className}}if(o.dom.is(p,A.theme_advanced_font_selector)){if(!l&&p.style.fontSize){l=p.style.fontSize}if(!w&&p.style.fontFamily){w=p.style.fontFamily.replace(/[\"\']+/g,"").replace(/^([^,]+).*/,"$1").toLowerCase()}if(!C&&p.style.color){C=p.style.color}if(!m&&p.style.backgroundColor){m=p.style.backgroundColor}}return false});if(H=u.get("fontselect")){H.select(function(n){return n.replace(/^([^,]+).*/,"$1").toLowerCase()==w})}if(H=u.get("fontsizeselect")){if(A.theme_advanced_runtime_fontsize&&!l&&!x){l=o.dom.getStyle(E,"fontSize",true)}H.select(function(n){if(n.fontSize&&n.fontSize===l){return true}if(n["class"]&&n["class"]===x){return true}})}if(A.theme_advanced_show_current_color){function B(p,n){if(H=u.get(p)){if(!n){n=H.settings.default_color}if(n!==H.value){H.displayColor(n)}}}B("forecolor",C);B("backcolor",m)}if(A.theme_advanced_show_current_color){function B(p,n){if(H=u.get(p)){if(!n){n=H.settings.default_color}if(n!==H.value){H.displayColor(n)}}}B("forecolor",C);B("backcolor",m)}if(A.theme_advanced_path&&A.theme_advanced_statusbar_location){D=i.get(o.id+"_path")||i.add(o.id+"_path_row","span",{id:o.id+"_path"});if(z.statusKeyboardNavigation){z.statusKeyboardNavigation.destroy();z.statusKeyboardNavigation=null}i.setHTML(D,"");q(function(I){var p=I.nodeName.toLowerCase(),s,v,t="";if(I.nodeType!=1||p==="br"||I.getAttribute("data-mce-bogus")||i.hasClass(I,"mceItemHidden")||i.hasClass(I,"mceItemRemoved")){return}if(h.isIE&&I.scopeName!=="HTML"&&I.scopeName){p=I.scopeName+":"+p}p=p.replace(/mce\:/g,"");switch(p){case"b":p="strong";break;case"i":p="em";break;case"img":if(y=i.getAttrib(I,"src")){t+="src: "+y+" "}break;case"a":if(y=i.getAttrib(I,"name")){t+="name: "+y+" ";p+="#"+y}if(y=i.getAttrib(I,"href")){t+="href: "+y+" "}break;case"font":if(y=i.getAttrib(I,"face")){t+="font: "+y+" "}if(y=i.getAttrib(I,"size")){t+="size: "+y+" "}if(y=i.getAttrib(I,"color")){t+="color: "+y+" "}break;case"span":if(y=i.getAttrib(I,"style")){t+="style: "+y+" "}break}if(y=i.getAttrib(I,"id")){t+="id: "+y+" "}if(y=I.className){y=y.replace(/\b\s*(webkit|mce|Apple-)\w+\s*\b/g,"");if(y){t+="class: "+y+" ";if(o.dom.isBlock(I)||p=="img"||p=="span"){p+="."+y}}}p=p.replace(/(html:)/g,"");p={name:p,node:I,title:t};z.onResolveName.dispatch(z,p);t=p.title;p=p.name;v=i.create("a",{href:"javascript:;",role:"button",onmousedown:"return false;",title:t,"class":"mcePath_"+(G++)},p);if(D.hasChildNodes()){D.insertBefore(i.create("span",{"aria-hidden":"true"},"\u00a0\u00bb "),D.firstChild);D.insertBefore(v,D.firstChild)}else{D.appendChild(v)}},o.getBody());if(i.select("a",D).length>0){z.statusKeyboardNavigation=new h.ui.KeyboardNavigation({root:o.id+"_path_row",items:i.select("a",D),excludeFromTabOrder:true,onCancel:function(){o.focus()}},i)}}},_sel:function(j){this.editor.execCommand("mceSelectNodeDepth",false,j)},_mceInsertAnchor:function(l,k){var j=this.editor;j.windowManager.open({url:this.url+"/anchor.htm",width:320+parseInt(j.getLang("advanced.anchor_delta_width",0)),height:90+parseInt(j.getLang("advanced.anchor_delta_height",0)),inline:true},{theme_url:this.url})},_mceCharMap:function(){var j=this.editor;j.windowManager.open({url:this.url+"/charmap.htm",width:550+parseInt(j.getLang("advanced.charmap_delta_width",0)),height:265+parseInt(j.getLang("advanced.charmap_delta_height",0)),inline:true},{theme_url:this.url})},_mceHelp:function(){var j=this.editor;j.windowManager.open({url:this.url+"/about.htm",width:480,height:380,inline:true},{theme_url:this.url})},_mceShortcuts:function(){var j=this.editor;j.windowManager.open({url:this.url+"/shortcuts.htm",width:480,height:380,inline:true},{theme_url:this.url})},_mceColorPicker:function(l,k){var j=this.editor;k=k||{};j.windowManager.open({url:this.url+"/color_picker.htm",width:375+parseInt(j.getLang("advanced.colorpicker_delta_width",0)),height:250+parseInt(j.getLang("advanced.colorpicker_delta_height",0)),close_previous:false,inline:true},{input_color:k.color,func:k.func,theme_url:this.url})},_mceCodeEditor:function(k,l){var j=this.editor;j.windowManager.open({url:this.url+"/source_editor.htm",width:parseInt(j.getParam("theme_advanced_source_editor_width",720)),height:parseInt(j.getParam("theme_advanced_source_editor_height",580)),inline:true,resizable:true,maximizable:true},{theme_url:this.url})},_mceImage:function(k,l){var j=this.editor;if(j.dom.getAttrib(j.selection.getNode(),"class","").indexOf("mceItem")!=-1){return}j.windowManager.open({url:this.url+"/image.htm",width:355+parseInt(j.getLang("advanced.image_delta_width",0)),height:275+parseInt(j.getLang("advanced.image_delta_height",0)),inline:true},{theme_url:this.url})},_mceLink:function(k,l){var j=this.editor;j.windowManager.open({url:this.url+"/link.htm",width:310+parseInt(j.getLang("advanced.link_delta_width",0)),height:200+parseInt(j.getLang("advanced.link_delta_height",0)),inline:true},{theme_url:this.url})},_mceNewDocument:function(){var j=this.editor;j.windowManager.confirm("advanced.newdocument",function(k){if(k){j.execCommand("mceSetContent",false,"")}})},_mceForeColor:function(){var j=this;this._mceColorPicker(0,{color:j.fgColor,func:function(k){j.fgColor=k;j.editor.execCommand("ForeColor",false,k)}})},_mceBackColor:function(){var j=this;this._mceColorPicker(0,{color:j.bgColor,func:function(k){j.bgColor=k;j.editor.execCommand("HiliteColor",false,k)}})},_ufirst:function(j){return j.substring(0,1).toUpperCase()+j.substring(1)}});h.ThemeManager.add("advanced",h.themes.AdvancedTheme)}(tinymce)); \ No newline at end of file +(function(h){var i=h.DOM,g=h.dom.Event,c=h.extend,f=h.each,a=h.util.Cookie,e,d=h.explode;function b(m,k){var q,p=m.dom,n="",o,l;previewStyles=m.settings.preview_styles;if(previewStyles===false){return""}if(!previewStyles){previewStyles="font-family font-size font-weight text-decoration text-transform color background-color"}function j(r){return r.replace(/%(\w+)/g,"")}name=k.block||k.inline||"span";q=p.create(name);f(k.styles,function(s,r){s=j(s);if(s){p.setStyle(q,r,s)}});f(k.attributes,function(s,r){s=j(s);if(s){p.setAttrib(q,r,s)}});f(k.classes,function(r){r=j(r);if(!p.hasClass(q,r)){p.addClass(q,r)}});p.setStyles(q,{position:"absolute",left:-65535});m.getBody().appendChild(q);o=p.getStyle(m.getBody(),"fontSize",true);o=/px$/.test(o)?parseInt(o,10):0;f(previewStyles.split(" "),function(r){var s=p.getStyle(q,r,true);if(r=="background-color"&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(s)){s=p.getStyle(m.getBody(),r,true);if(p.toHex(s).toLowerCase()=="#ffffff"){return}}if(r=="font-size"){if(/em|%$/.test(s)){if(o===0){return}s=parseFloat(s,10)/(/%$/.test(s)?100:1);s=(s*o)+"px"}}n+=r+":"+s+";"});p.remove(q);return n}h.ThemeManager.requireLangPack("advanced");h.create("tinymce.themes.AdvancedTheme",{sizes:[8,10,12,14,18,24,36],controls:{bold:["bold_desc","Bold"],italic:["italic_desc","Italic"],underline:["underline_desc","Underline"],strikethrough:["striketrough_desc","Strikethrough"],justifyleft:["justifyleft_desc","JustifyLeft"],justifycenter:["justifycenter_desc","JustifyCenter"],justifyright:["justifyright_desc","JustifyRight"],justifyfull:["justifyfull_desc","JustifyFull"],bullist:["bullist_desc","InsertUnorderedList"],numlist:["numlist_desc","InsertOrderedList"],outdent:["outdent_desc","Outdent"],indent:["indent_desc","Indent"],cut:["cut_desc","Cut"],copy:["copy_desc","Copy"],paste:["paste_desc","Paste"],undo:["undo_desc","Undo"],redo:["redo_desc","Redo"],link:["link_desc","mceLink"],unlink:["unlink_desc","unlink"],image:["image_desc","mceImage"],cleanup:["cleanup_desc","mceCleanup"],help:["help_desc","mceHelp"],code:["code_desc","mceCodeEditor"],hr:["hr_desc","InsertHorizontalRule"],removeformat:["removeformat_desc","RemoveFormat"],sub:["sub_desc","subscript"],sup:["sup_desc","superscript"],forecolor:["forecolor_desc","ForeColor"],forecolorpicker:["forecolor_desc","mceForeColor"],backcolor:["backcolor_desc","HiliteColor"],backcolorpicker:["backcolor_desc","mceBackColor"],charmap:["charmap_desc","mceCharMap"],visualaid:["visualaid_desc","mceToggleVisualAid"],anchor:["anchor_desc","mceInsertAnchor"],newdocument:["newdocument_desc","mceNewDocument"],blockquote:["blockquote_desc","mceBlockQuote"]},stateControls:["bold","italic","underline","strikethrough","bullist","numlist","justifyleft","justifycenter","justifyright","justifyfull","sub","sup","blockquote"],init:function(k,l){var m=this,n,j,p;m.editor=k;m.url=l;m.onResolveName=new h.util.Dispatcher(this);k.forcedHighContrastMode=k.settings.detect_highcontrast&&m._isHighContrast();k.settings.skin=k.forcedHighContrastMode?"highcontrast":k.settings.skin;m.settings=n=c({theme_advanced_path:true,theme_advanced_toolbar_location:"bottom",theme_advanced_buttons1:"bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect",theme_advanced_buttons2:"bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code",theme_advanced_buttons3:"hr,removeformat,visualaid,|,sub,sup,|,charmap",theme_advanced_blockformats:"p,address,pre,h1,h2,h3,h4,h5,h6",theme_advanced_toolbar_align:"center",theme_advanced_fonts:"Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",theme_advanced_more_colors:1,theme_advanced_row_height:23,theme_advanced_resize_horizontal:1,theme_advanced_resizing_use_cookie:1,theme_advanced_font_sizes:"1,2,3,4,5,6,7",theme_advanced_font_selector:"span",theme_advanced_show_current_color:0,readonly:k.settings.readonly},k.settings);if(!n.font_size_style_values){n.font_size_style_values="8pt,10pt,12pt,14pt,18pt,24pt,36pt"}if(h.is(n.theme_advanced_font_sizes,"string")){n.font_size_style_values=h.explode(n.font_size_style_values);n.font_size_classes=h.explode(n.font_size_classes||"");p={};k.settings.theme_advanced_font_sizes=n.theme_advanced_font_sizes;f(k.getParam("theme_advanced_font_sizes","","hash"),function(r,q){var o;if(q==r&&r>=1&&r<=7){q=r+" ("+m.sizes[r-1]+"pt)";o=n.font_size_classes[r-1];r=n.font_size_style_values[r-1]||(m.sizes[r-1]+"pt")}if(/^\s*\./.test(r)){o=r.replace(/\./g,"")}p[q]=o?{"class":o}:{fontSize:r}});n.theme_advanced_font_sizes=p}if((j=n.theme_advanced_path_location)&&j!="none"){n.theme_advanced_statusbar_location=n.theme_advanced_path_location}if(n.theme_advanced_statusbar_location=="none"){n.theme_advanced_statusbar_location=0}if(k.settings.content_css!==false){k.contentCSS.push(k.baseURI.toAbsolute(l+"/skins/"+k.settings.skin+"/content.css"))}k.onInit.add(function(){if(!k.settings.readonly){k.onNodeChange.add(m._nodeChanged,m);k.onKeyUp.add(m._updateUndoStatus,m);k.onMouseUp.add(m._updateUndoStatus,m);k.dom.bind(k.dom.getRoot(),"dragend",function(){m._updateUndoStatus(k)})}});k.onSetProgressState.add(function(r,o,s){var t,u=r.id,q;if(o){m.progressTimer=setTimeout(function(){t=r.getContainer();t=t.insertBefore(i.create("DIV",{style:"position:relative"}),t.firstChild);q=i.get(r.id+"_tbl");i.add(t,"div",{id:u+"_blocker","class":"mceBlocker",style:{width:q.clientWidth+2,height:q.clientHeight+2}});i.add(t,"div",{id:u+"_progress","class":"mceProgress",style:{left:q.clientWidth/2,top:q.clientHeight/2}})},s||0)}else{i.remove(u+"_blocker");i.remove(u+"_progress");clearTimeout(m.progressTimer)}});i.loadCSS(n.editor_css?k.documentBaseURI.toAbsolute(n.editor_css):l+"/skins/"+k.settings.skin+"/ui.css");if(n.skin_variant){i.loadCSS(l+"/skins/"+k.settings.skin+"/ui_"+n.skin_variant+".css")}},_isHighContrast:function(){var j,k=i.add(i.getRoot(),"div",{style:"background-color: rgb(171,239,86);"});j=(i.getStyle(k,"background-color",true)+"").toLowerCase().replace(/ /g,"");i.remove(k);return j!="rgb(171,239,86)"&&j!="#abef56"},createControl:function(m,j){var k,l;if(l=j.createControl(m)){return l}switch(m){case"styleselect":return this._createStyleSelect();case"formatselect":return this._createBlockFormats();case"fontselect":return this._createFontSelect();case"fontsizeselect":return this._createFontSizeSelect();case"forecolor":return this._createForeColorMenu();case"backcolor":return this._createBackColorMenu()}if((k=this.controls[m])){return j.createButton(m,{title:"advanced."+k[0],cmd:k[1],ui:k[2],value:k[3]})}},execCommand:function(l,k,m){var j=this["_"+l];if(j){j.call(this,k,m);return true}return false},_importClasses:function(l){var j=this.editor,k=j.controlManager.get("styleselect");if(k.getLength()==0){f(j.dom.getClasses(),function(q,m){var p="style_"+m,n;n={inline:"span",attributes:{"class":q["class"]},selector:"*"};j.formatter.register(p,n);k.add(q["class"],p,{style:function(){return b(j,n)}})})}},_createStyleSelect:function(o){var l=this,j=l.editor,k=j.controlManager,m;m=k.createListBox("styleselect",{title:"advanced.style_select",onselect:function(q){var r,n=[],p;f(m.items,function(s){n.push(s.value)});j.focus();j.undoManager.add();r=j.formatter.matchAll(n);h.each(r,function(s){if(!q||s==q){if(s){j.formatter.remove(s)}p=true}});if(!p){j.formatter.apply(q)}j.undoManager.add();j.nodeChanged();return false}});j.onPreInit.add(function(){var p=0,n=j.getParam("style_formats");if(n){f(n,function(q){var r,s=0;f(q,function(){s++});if(s>1){r=q.name=q.name||"style_"+(p++);j.formatter.register(r,q);m.add(q.title,r,{style:function(){return b(j,q)}})}else{m.add(q.title)}})}else{f(j.getParam("theme_advanced_styles","","hash"),function(t,s){var r,q;if(t){r="style_"+(p++);q={inline:"span",classes:t,selector:"*"};j.formatter.register(r,q);m.add(l.editor.translate(s),r,{style:function(){return b(j,q)}})}})}});if(m.getLength()==0){m.onPostRender.add(function(p,q){if(!m.NativeListBox){g.add(q.id+"_text","focus",l._importClasses,l);g.add(q.id+"_text","mousedown",l._importClasses,l);g.add(q.id+"_open","focus",l._importClasses,l);g.add(q.id+"_open","mousedown",l._importClasses,l)}else{g.add(q.id,"focus",l._importClasses,l)}})}return m},_createFontSelect:function(){var l,k=this,j=k.editor;l=j.controlManager.createListBox("fontselect",{title:"advanced.fontdefault",onselect:function(m){var n=l.items[l.selectedIndex];if(!m&&n){j.execCommand("FontName",false,n.value);return}j.execCommand("FontName",false,m);l.select(function(o){return m==o});if(n&&n.value==m){l.select(null)}return false}});if(l){f(j.getParam("theme_advanced_fonts",k.settings.theme_advanced_fonts,"hash"),function(n,m){l.add(j.translate(m),n,{style:n.indexOf("dings")==-1?"font-family:"+n:""})})}return l},_createFontSizeSelect:function(){var m=this,k=m.editor,n,l=0,j=[];n=k.controlManager.createListBox("fontsizeselect",{title:"advanced.font_size",onselect:function(o){var p=n.items[n.selectedIndex];if(!o&&p){p=p.value;if(p["class"]){k.formatter.toggle("fontsize_class",{value:p["class"]});k.undoManager.add();k.nodeChanged()}else{k.execCommand("FontSize",false,p.fontSize)}return}if(o["class"]){k.focus();k.undoManager.add();k.formatter.toggle("fontsize_class",{value:o["class"]});k.undoManager.add();k.nodeChanged()}else{k.execCommand("FontSize",false,o.fontSize)}n.select(function(q){return o==q});if(p&&(p.value.fontSize==o.fontSize||p.value["class"]&&p.value["class"]==o["class"])){n.select(null)}return false}});if(n){f(m.settings.theme_advanced_font_sizes,function(p,o){var q=p.fontSize;if(q>=1&&q<=7){q=m.sizes[parseInt(q)-1]+"pt"}n.add(o,p,{style:"font-size:"+q,"class":"mceFontSize"+(l++)+(" "+(p["class"]||""))})})}return n},_createBlockFormats:function(){var l,j={p:"advanced.paragraph",address:"advanced.address",pre:"advanced.pre",h1:"advanced.h1",h2:"advanced.h2",h3:"advanced.h3",h4:"advanced.h4",h5:"advanced.h5",h6:"advanced.h6",div:"advanced.div",blockquote:"advanced.blockquote",code:"advanced.code",dt:"advanced.dt",dd:"advanced.dd",samp:"advanced.samp"},k=this;l=k.editor.controlManager.createListBox("formatselect",{title:"advanced.block",onselect:function(m){k.editor.execCommand("FormatBlock",false,m);return false}});if(l){f(k.editor.getParam("theme_advanced_blockformats",k.settings.theme_advanced_blockformats,"hash"),function(n,m){l.add(k.editor.translate(m!=n?m:j[n]),n,{"class":"mce_formatPreview mce_"+n,style:function(){return b(k.editor,{block:n})}})})}return l},_createForeColorMenu:function(){var n,k=this,l=k.settings,m={},j;if(l.theme_advanced_more_colors){m.more_colors_func=function(){k._mceColorPicker(0,{color:n.value,func:function(o){n.setColor(o)}})}}if(j=l.theme_advanced_text_colors){m.colors=j}if(l.theme_advanced_default_foreground_color){m.default_color=l.theme_advanced_default_foreground_color}m.title="advanced.forecolor_desc";m.cmd="ForeColor";m.scope=this;n=k.editor.controlManager.createColorSplitButton("forecolor",m);return n},_createBackColorMenu:function(){var n,k=this,l=k.settings,m={},j;if(l.theme_advanced_more_colors){m.more_colors_func=function(){k._mceColorPicker(0,{color:n.value,func:function(o){n.setColor(o)}})}}if(j=l.theme_advanced_background_colors){m.colors=j}if(l.theme_advanced_default_background_color){m.default_color=l.theme_advanced_default_background_color}m.title="advanced.backcolor_desc";m.cmd="HiliteColor";m.scope=this;n=k.editor.controlManager.createColorSplitButton("backcolor",m);return n},renderUI:function(l){var q,m,r,w=this,u=w.editor,x=w.settings,v,k,j;if(u.settings){u.settings.aria_label=x.aria_label+u.getLang("advanced.help_shortcut")}q=k=i.create("span",{role:"application","aria-labelledby":u.id+"_voice",id:u.id+"_parent","class":"mceEditor "+u.settings.skin+"Skin"+(x.skin_variant?" "+u.settings.skin+"Skin"+w._ufirst(x.skin_variant):"")+(u.settings.directionality=="rtl"?" mceRtl":"")});i.add(q,"span",{"class":"mceVoiceLabel",style:"display:none;",id:u.id+"_voice"},x.aria_label);if(!i.boxModel){q=i.add(q,"div",{"class":"mceOldBoxModel"})}q=v=i.add(q,"table",{role:"presentation",id:u.id+"_tbl","class":"mceLayout",cellSpacing:0,cellPadding:0});q=r=i.add(q,"tbody");switch((x.theme_advanced_layout_manager||"").toLowerCase()){case"rowlayout":m=w._rowLayout(x,r,l);break;case"customlayout":m=u.execCallback("theme_advanced_custom_layout",x,r,l,k);break;default:m=w._simpleLayout(x,r,l,k)}q=l.targetNode;j=v.rows;i.addClass(j[0],"mceFirst");i.addClass(j[j.length-1],"mceLast");f(i.select("tr",r),function(o){i.addClass(o.firstChild,"mceFirst");i.addClass(o.childNodes[o.childNodes.length-1],"mceLast")});if(i.get(x.theme_advanced_toolbar_container)){i.get(x.theme_advanced_toolbar_container).appendChild(k)}else{i.insertAfter(k,q)}g.add(u.id+"_path_row","click",function(n){n=n.target;if(n.nodeName=="A"){w._sel(n.className.replace(/^.*mcePath_([0-9]+).*$/,"$1"));return false}});if(!u.getParam("accessibility_focus")){g.add(i.add(k,"a",{href:"#"},""),"focus",function(){tinyMCE.get(u.id).focus()})}if(x.theme_advanced_toolbar_location=="external"){l.deltaHeight=0}w.deltaHeight=l.deltaHeight;l.targetNode=null;u.onKeyDown.add(function(p,n){var s=121,o=122;if(n.altKey){if(n.keyCode===s){if(h.isWebKit){window.focus()}w.toolbarGroup.focus();return g.cancel(n)}else{if(n.keyCode===o){i.get(p.id+"_path_row").focus();return g.cancel(n)}}}});u.addShortcut("alt+0","","mceShortcuts",w);return{iframeContainer:m,editorContainer:u.id+"_parent",sizeContainer:v,deltaHeight:l.deltaHeight}},getInfo:function(){return{longname:"Advanced theme",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",version:h.majorVersion+"."+h.minorVersion}},resizeBy:function(j,k){var l=i.get(this.editor.id+"_ifr");this.resizeTo(l.clientWidth+j,l.clientHeight+k)},resizeTo:function(j,n,l){var k=this.editor,m=this.settings,o=i.get(k.id+"_tbl"),p=i.get(k.id+"_ifr");j=Math.max(m.theme_advanced_resizing_min_width||100,j);n=Math.max(m.theme_advanced_resizing_min_height||100,n);j=Math.min(m.theme_advanced_resizing_max_width||65535,j);n=Math.min(m.theme_advanced_resizing_max_height||65535,n);i.setStyle(o,"height","");i.setStyle(p,"height",n);if(m.theme_advanced_resize_horizontal){i.setStyle(o,"width","");i.setStyle(p,"width",j);if(j"));i.setHTML(l,r.join(""))},_addStatusBar:function(p,k){var l,w=this,q=w.editor,x=w.settings,j,u,v,m;l=i.add(p,"tr");l=m=i.add(l,"td",{"class":"mceStatusbar"});l=i.add(l,"div",{id:q.id+"_path_row",role:"group","aria-labelledby":q.id+"_path_voice"});if(x.theme_advanced_path){i.add(l,"span",{id:q.id+"_path_voice"},q.translate("advanced.path"));i.add(l,"span",{},": ")}else{i.add(l,"span",{}," ")}if(x.theme_advanced_resizing){i.add(m,"a",{id:q.id+"_resize",href:"javascript:;",onclick:"return false;","class":"mceResize",tabIndex:"-1"});if(x.theme_advanced_resizing_use_cookie){q.onPostRender.add(function(){var n=a.getHash("TinyMCE_"+q.id+"_size"),r=i.get(q.id+"_tbl");if(!n){return}w.resizeTo(n.cw,n.ch)})}q.onPostRender.add(function(){g.add(q.id+"_resize","click",function(n){n.preventDefault()});g.add(q.id+"_resize","mousedown",function(E){var t,r,s,o,D,A,B,G,n,F,y;function z(H){H.preventDefault();n=B+(H.screenX-D);F=G+(H.screenY-A);w.resizeTo(n,F)}function C(H){g.remove(i.doc,"mousemove",t);g.remove(q.getDoc(),"mousemove",r);g.remove(i.doc,"mouseup",s);g.remove(q.getDoc(),"mouseup",o);n=B+(H.screenX-D);F=G+(H.screenY-A);w.resizeTo(n,F,true)}E.preventDefault();D=E.screenX;A=E.screenY;y=i.get(w.editor.id+"_ifr");B=n=y.clientWidth;G=F=y.clientHeight;t=g.add(i.doc,"mousemove",z);r=g.add(q.getDoc(),"mousemove",z);s=g.add(i.doc,"mouseup",C);o=g.add(q.getDoc(),"mouseup",C)})})}k.deltaHeight-=21;l=p=null},_updateUndoStatus:function(k){var j=k.controlManager,l=k.undoManager;j.setDisabled("undo",!l.hasUndo()&&!l.typing);j.setDisabled("redo",!l.hasRedo())},_nodeChanged:function(o,u,E,r,F){var z=this,D,G=0,y,H,A=z.settings,x,l,w,C,m,k,j;h.each(z.stateControls,function(n){u.setActive(n,o.queryCommandState(z.controls[n][1]))});function q(p){var s,n=F.parents,t=p;if(typeof(p)=="string"){t=function(v){return v.nodeName==p}}for(s=0;s0){H.mark(p)}})}if(H=u.get("formatselect")){D=q(o.dom.isBlock);if(D){H.select(D.nodeName.toLowerCase())}}q(function(p){if(p.nodeName==="SPAN"){if(!x&&p.className){x=p.className}}if(o.dom.is(p,A.theme_advanced_font_selector)){if(!l&&p.style.fontSize){l=p.style.fontSize}if(!w&&p.style.fontFamily){w=p.style.fontFamily.replace(/[\"\']+/g,"").replace(/^([^,]+).*/,"$1").toLowerCase()}if(!C&&p.style.color){C=p.style.color}if(!m&&p.style.backgroundColor){m=p.style.backgroundColor}}return false});if(H=u.get("fontselect")){H.select(function(n){return n.replace(/^([^,]+).*/,"$1").toLowerCase()==w})}if(H=u.get("fontsizeselect")){if(A.theme_advanced_runtime_fontsize&&!l&&!x){l=o.dom.getStyle(E,"fontSize",true)}H.select(function(n){if(n.fontSize&&n.fontSize===l){return true}if(n["class"]&&n["class"]===x){return true}})}if(A.theme_advanced_show_current_color){function B(p,n){if(H=u.get(p)){if(!n){n=H.settings.default_color}if(n!==H.value){H.displayColor(n)}}}B("forecolor",C);B("backcolor",m)}if(A.theme_advanced_show_current_color){function B(p,n){if(H=u.get(p)){if(!n){n=H.settings.default_color}if(n!==H.value){H.displayColor(n)}}}B("forecolor",C);B("backcolor",m)}if(A.theme_advanced_path&&A.theme_advanced_statusbar_location){D=i.get(o.id+"_path")||i.add(o.id+"_path_row","span",{id:o.id+"_path"});if(z.statusKeyboardNavigation){z.statusKeyboardNavigation.destroy();z.statusKeyboardNavigation=null}i.setHTML(D,"");q(function(I){var p=I.nodeName.toLowerCase(),s,v,t="";if(I.nodeType!=1||p==="br"||I.getAttribute("data-mce-bogus")||i.hasClass(I,"mceItemHidden")||i.hasClass(I,"mceItemRemoved")){return}if(h.isIE&&I.scopeName!=="HTML"&&I.scopeName){p=I.scopeName+":"+p}p=p.replace(/mce\:/g,"");switch(p){case"b":p="strong";break;case"i":p="em";break;case"img":if(y=i.getAttrib(I,"src")){t+="src: "+y+" "}break;case"a":if(y=i.getAttrib(I,"name")){t+="name: "+y+" ";p+="#"+y}if(y=i.getAttrib(I,"href")){t+="href: "+y+" "}break;case"font":if(y=i.getAttrib(I,"face")){t+="font: "+y+" "}if(y=i.getAttrib(I,"size")){t+="size: "+y+" "}if(y=i.getAttrib(I,"color")){t+="color: "+y+" "}break;case"span":if(y=i.getAttrib(I,"style")){t+="style: "+y+" "}break}if(y=i.getAttrib(I,"id")){t+="id: "+y+" "}if(y=I.className){y=y.replace(/\b\s*(webkit|mce|Apple-)\w+\s*\b/g,"");if(y){t+="class: "+y+" ";if(o.dom.isBlock(I)||p=="img"||p=="span"){p+="."+y}}}p=p.replace(/(html:)/g,"");p={name:p,node:I,title:t};z.onResolveName.dispatch(z,p);t=p.title;p=p.name;v=i.create("a",{href:"javascript:;",role:"button",onmousedown:"return false;",title:t,"class":"mcePath_"+(G++)},p);if(D.hasChildNodes()){D.insertBefore(i.create("span",{"aria-hidden":"true"},"\u00a0\u00bb "),D.firstChild);D.insertBefore(v,D.firstChild)}else{D.appendChild(v)}},o.getBody());if(i.select("a",D).length>0){z.statusKeyboardNavigation=new h.ui.KeyboardNavigation({root:o.id+"_path_row",items:i.select("a",D),excludeFromTabOrder:true,onCancel:function(){o.focus()}},i)}}},_sel:function(j){this.editor.execCommand("mceSelectNodeDepth",false,j)},_mceInsertAnchor:function(l,k){var j=this.editor;j.windowManager.open({url:this.url+"/anchor.htm",width:320+parseInt(j.getLang("advanced.anchor_delta_width",0)),height:90+parseInt(j.getLang("advanced.anchor_delta_height",0)),inline:true},{theme_url:this.url})},_mceCharMap:function(){var j=this.editor;j.windowManager.open({url:this.url+"/charmap.htm",width:550+parseInt(j.getLang("advanced.charmap_delta_width",0)),height:265+parseInt(j.getLang("advanced.charmap_delta_height",0)),inline:true},{theme_url:this.url})},_mceHelp:function(){var j=this.editor;j.windowManager.open({url:this.url+"/about.htm",width:480,height:380,inline:true},{theme_url:this.url})},_mceShortcuts:function(){var j=this.editor;j.windowManager.open({url:this.url+"/shortcuts.htm",width:480,height:380,inline:true},{theme_url:this.url})},_mceColorPicker:function(l,k){var j=this.editor;k=k||{};j.windowManager.open({url:this.url+"/color_picker.htm",width:375+parseInt(j.getLang("advanced.colorpicker_delta_width",0)),height:250+parseInt(j.getLang("advanced.colorpicker_delta_height",0)),close_previous:false,inline:true},{input_color:k.color,func:k.func,theme_url:this.url})},_mceCodeEditor:function(k,l){var j=this.editor;j.windowManager.open({url:this.url+"/source_editor.htm",width:parseInt(j.getParam("theme_advanced_source_editor_width",720)),height:parseInt(j.getParam("theme_advanced_source_editor_height",580)),inline:true,resizable:true,maximizable:true},{theme_url:this.url})},_mceImage:function(k,l){var j=this.editor;if(j.dom.getAttrib(j.selection.getNode(),"class","").indexOf("mceItem")!=-1){return}j.windowManager.open({url:this.url+"/image.htm",width:355+parseInt(j.getLang("advanced.image_delta_width",0)),height:275+parseInt(j.getLang("advanced.image_delta_height",0)),inline:true},{theme_url:this.url})},_mceLink:function(k,l){var j=this.editor;j.windowManager.open({url:this.url+"/link.htm",width:310+parseInt(j.getLang("advanced.link_delta_width",0)),height:200+parseInt(j.getLang("advanced.link_delta_height",0)),inline:true},{theme_url:this.url})},_mceNewDocument:function(){var j=this.editor;j.windowManager.confirm("advanced.newdocument",function(k){if(k){j.execCommand("mceSetContent",false,"")}})},_mceForeColor:function(){var j=this;this._mceColorPicker(0,{color:j.fgColor,func:function(k){j.fgColor=k;j.editor.execCommand("ForeColor",false,k)}})},_mceBackColor:function(){var j=this;this._mceColorPicker(0,{color:j.bgColor,func:function(k){j.bgColor=k;j.editor.execCommand("HiliteColor",false,k)}})},_ufirst:function(j){return j.substring(0,1).toUpperCase()+j.substring(1)}});h.ThemeManager.add("advanced",h.themes.AdvancedTheme)}(tinymce)); \ No newline at end of file diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/advanced/editor_template_src.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/editor_template_src.js similarity index 96% rename from lib/editor/tinymce/tiny_mce/3.5/themes/advanced/editor_template_src.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/editor_template_src.js index 61fe537074e..607e820a56f 100644 --- a/lib/editor/tinymce/tiny_mce/3.5/themes/advanced/editor_template_src.js +++ b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/editor_template_src.js @@ -1089,19 +1089,17 @@ p = getParent('A'); if (c = cm.get('link')) { - if (!p || !p.name) { - c.setDisabled(!p && co); - c.setActive(!!p); - } + c.setDisabled((!p && co) || (p && !p.href)); + c.setActive(!!p && (!p.name && !p.id)); } if (c = cm.get('unlink')) { c.setDisabled(!p && co); - c.setActive(!!p && !p.name); + c.setActive(!!p && !p.name && !p.id); } if (c = cm.get('anchor')) { - c.setActive(!co && !!p && p.name); + c.setActive(!co && !!p && (p.name || (p.id && !p.href))); } p = getParent('IMG'); diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/advanced/image.htm b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/image.htm similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/advanced/image.htm rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/image.htm diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/advanced/img/colorpicker.jpg b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/img/colorpicker.jpg similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/advanced/img/colorpicker.jpg rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/img/colorpicker.jpg diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/advanced/img/flash.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/img/flash.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/advanced/img/flash.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/img/flash.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/advanced/img/icons.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/img/icons.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/advanced/img/icons.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/img/icons.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/advanced/img/iframe.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/img/iframe.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/advanced/img/iframe.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/img/iframe.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/advanced/img/pagebreak.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/img/pagebreak.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/advanced/img/pagebreak.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/img/pagebreak.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/advanced/img/quicktime.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/img/quicktime.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/advanced/img/quicktime.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/img/quicktime.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/advanced/img/realmedia.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/img/realmedia.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/advanced/img/realmedia.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/img/realmedia.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/advanced/img/shockwave.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/img/shockwave.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/advanced/img/shockwave.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/img/shockwave.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/advanced/img/trans.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/img/trans.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/advanced/img/trans.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/img/trans.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/advanced/img/video.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/img/video.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/advanced/img/video.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/img/video.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/advanced/img/windowsmedia.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/img/windowsmedia.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/advanced/img/windowsmedia.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/img/windowsmedia.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/advanced/js/about.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/js/about.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/advanced/js/about.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/js/about.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/advanced/js/anchor.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/js/anchor.js similarity index 68% rename from lib/editor/tinymce/tiny_mce/3.5/themes/advanced/js/anchor.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/js/anchor.js index 2940db3591f..778d3226679 100644 --- a/lib/editor/tinymce/tiny_mce/3.5/themes/advanced/js/anchor.js +++ b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/js/anchor.js @@ -6,7 +6,7 @@ var AnchorDialog = { this.editor = ed; elm = ed.dom.getParent(ed.selection.getNode(), 'A'); - v = ed.dom.getAttrib(elm, 'name'); + v = ed.dom.getAttrib(elm, 'name') || ed.dom.getAttrib(elm, 'id'); if (v) { this.action = 'update'; @@ -17,7 +17,7 @@ var AnchorDialog = { }, update : function() { - var ed = this.editor, elm, name = document.forms[0].anchorName.value; + var ed = this.editor, elm, name = document.forms[0].anchorName.value, attribName; if (!name || !/^[a-z][a-z0-9\-\_:\.]*$/i.test(name)) { tinyMCEPopup.alert('advanced_dlg.anchor_invalid'); @@ -29,13 +29,23 @@ var AnchorDialog = { if (this.action != 'update') ed.selection.collapse(1); + var aRule = ed.schema.getElementRule('a'); + if (!aRule || aRule.attributes.name) { + attribName = 'name'; + } else { + attribName = 'id'; + } + elm = ed.dom.getParent(ed.selection.getNode(), 'A'); if (elm) { - elm.setAttribute('name', name); - elm.name = name; - } else + elm.setAttribute(attribName, name); + elm[attribName] = name; + } else { // create with zero-sized nbsp so that in Webkit where anchor is on last line by itself caret cannot be placed after it - ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', {name : name, 'class' : 'mceItemAnchor'}, '\uFEFF')); + var attrs = {'class' : 'mceItemAnchor'}; + attrs[attribName] = name; + ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', attrs, '\uFEFF')); + } tinyMCEPopup.close(); } diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/advanced/js/charmap.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/js/charmap.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/advanced/js/charmap.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/js/charmap.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/advanced/js/color_picker.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/js/color_picker.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/advanced/js/color_picker.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/js/color_picker.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/advanced/js/image.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/js/image.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/advanced/js/image.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/js/image.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/advanced/js/link.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/js/link.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/advanced/js/link.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/js/link.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/advanced/js/source_editor.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/js/source_editor.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/advanced/js/source_editor.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/js/source_editor.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/advanced/langs/en.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/langs/en.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/advanced/langs/en.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/langs/en.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/advanced/langs/en_dlg.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/langs/en_dlg.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/advanced/langs/en_dlg.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/langs/en_dlg.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/advanced/link.htm b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/link.htm similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/advanced/link.htm rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/link.htm diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/advanced/shortcuts.htm b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/shortcuts.htm similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/advanced/shortcuts.htm rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/shortcuts.htm diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/advanced/skins/default/content.css b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/skins/default/content.css similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/advanced/skins/default/content.css rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/skins/default/content.css diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/advanced/skins/default/dialog.css b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/skins/default/dialog.css similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/advanced/skins/default/dialog.css rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/skins/default/dialog.css diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/advanced/skins/default/img/buttons.png b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/skins/default/img/buttons.png similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/advanced/skins/default/img/buttons.png rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/skins/default/img/buttons.png diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/advanced/skins/default/img/items.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/skins/default/img/items.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/advanced/skins/default/img/items.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/skins/default/img/items.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/advanced/skins/default/img/menu_arrow.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/skins/default/img/menu_arrow.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/advanced/skins/default/img/menu_arrow.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/skins/default/img/menu_arrow.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/advanced/skins/default/img/menu_check.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/skins/default/img/menu_check.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/advanced/skins/default/img/menu_check.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/skins/default/img/menu_check.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/advanced/skins/default/img/progress.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/skins/default/img/progress.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/advanced/skins/default/img/progress.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/skins/default/img/progress.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/advanced/skins/default/img/tabs.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/skins/default/img/tabs.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/advanced/skins/default/img/tabs.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/skins/default/img/tabs.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/advanced/skins/default/ui.css b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/skins/default/ui.css similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/advanced/skins/default/ui.css rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/skins/default/ui.css diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/advanced/skins/highcontrast/content.css b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/skins/highcontrast/content.css similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/advanced/skins/highcontrast/content.css rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/skins/highcontrast/content.css diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/advanced/skins/highcontrast/dialog.css b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/skins/highcontrast/dialog.css similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/advanced/skins/highcontrast/dialog.css rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/skins/highcontrast/dialog.css diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/advanced/skins/highcontrast/ui.css b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/skins/highcontrast/ui.css similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/advanced/skins/highcontrast/ui.css rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/skins/highcontrast/ui.css diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/advanced/skins/o2k7/content.css b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/skins/o2k7/content.css similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/advanced/skins/o2k7/content.css rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/skins/o2k7/content.css diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/advanced/skins/o2k7/dialog.css b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/skins/o2k7/dialog.css similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/advanced/skins/o2k7/dialog.css rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/skins/o2k7/dialog.css diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/advanced/skins/o2k7/img/button_bg.png b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/skins/o2k7/img/button_bg.png similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/advanced/skins/o2k7/img/button_bg.png rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/skins/o2k7/img/button_bg.png diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/advanced/skins/o2k7/img/button_bg_black.png b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/skins/o2k7/img/button_bg_black.png similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/advanced/skins/o2k7/img/button_bg_black.png rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/skins/o2k7/img/button_bg_black.png diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/advanced/skins/o2k7/img/button_bg_silver.png b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/skins/o2k7/img/button_bg_silver.png similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/advanced/skins/o2k7/img/button_bg_silver.png rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/skins/o2k7/img/button_bg_silver.png diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/advanced/skins/o2k7/ui.css b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/skins/o2k7/ui.css similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/advanced/skins/o2k7/ui.css rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/skins/o2k7/ui.css diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/advanced/skins/o2k7/ui_black.css b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/skins/o2k7/ui_black.css similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/advanced/skins/o2k7/ui_black.css rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/skins/o2k7/ui_black.css diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/advanced/skins/o2k7/ui_silver.css b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/skins/o2k7/ui_silver.css similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/advanced/skins/o2k7/ui_silver.css rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/skins/o2k7/ui_silver.css diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/advanced/source_editor.htm b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/source_editor.htm similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/advanced/source_editor.htm rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/advanced/source_editor.htm diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/simple/editor_template.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/simple/editor_template.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/simple/editor_template.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/simple/editor_template.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/simple/editor_template_src.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/simple/editor_template_src.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/simple/editor_template_src.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/simple/editor_template_src.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/simple/img/icons.gif b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/simple/img/icons.gif similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/simple/img/icons.gif rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/simple/img/icons.gif diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/simple/langs/en.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/simple/langs/en.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/simple/langs/en.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/simple/langs/en.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/simple/skins/default/content.css b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/simple/skins/default/content.css similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/simple/skins/default/content.css rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/simple/skins/default/content.css diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/simple/skins/default/ui.css b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/simple/skins/default/ui.css similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/simple/skins/default/ui.css rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/simple/skins/default/ui.css diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/simple/skins/o2k7/content.css b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/simple/skins/o2k7/content.css similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/simple/skins/o2k7/content.css rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/simple/skins/o2k7/content.css diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/simple/skins/o2k7/img/button_bg.png b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/simple/skins/o2k7/img/button_bg.png similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/simple/skins/o2k7/img/button_bg.png rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/simple/skins/o2k7/img/button_bg.png diff --git a/lib/editor/tinymce/tiny_mce/3.5/themes/simple/skins/o2k7/ui.css b/lib/editor/tinymce/tiny_mce/3.5.1.1/themes/simple/skins/o2k7/ui.css similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/themes/simple/skins/o2k7/ui.css rename to lib/editor/tinymce/tiny_mce/3.5.1.1/themes/simple/skins/o2k7/ui.css diff --git a/lib/editor/tinymce/tiny_mce/3.5.1.1/tiny_mce.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/tiny_mce.js new file mode 100644 index 00000000000..173a2e488b6 --- /dev/null +++ b/lib/editor/tinymce/tiny_mce/3.5.1.1/tiny_mce.js @@ -0,0 +1 @@ +(function(e){var a=/^\s*|\s*$/g,b,d="B".replace(/A(.)|B/,"$1")==="$1";var c={majorVersion:"@@tinymce_major_version@@",minorVersion:"@@tinymce_minor_version@@",releaseDate:"@@tinymce_release_date@@",_init:function(){var s=this,q=document,o=navigator,g=o.userAgent,m,f,l,k,j,r;s.isOpera=e.opera&&opera.buildNumber;s.isWebKit=/WebKit/.test(g);s.isIE=!s.isWebKit&&!s.isOpera&&(/MSIE/gi).test(g)&&(/Explorer/gi).test(o.appName);s.isIE6=s.isIE&&/MSIE [56]/.test(g);s.isIE7=s.isIE&&/MSIE [7]/.test(g);s.isIE8=s.isIE&&/MSIE [8]/.test(g);s.isIE9=s.isIE&&/MSIE [9]/.test(g);s.isGecko=!s.isWebKit&&/Gecko/.test(g);s.isMac=g.indexOf("Mac")!=-1;s.isAir=/adobeair/i.test(g);s.isIDevice=/(iPad|iPhone)/.test(g);s.isIOS5=s.isIDevice&&g.match(/AppleWebKit\/(\d*)/)[1]>=534;if(e.tinyMCEPreInit){s.suffix=tinyMCEPreInit.suffix;s.baseURL=tinyMCEPreInit.base;s.query=tinyMCEPreInit.query;return}s.suffix="";f=q.getElementsByTagName("base");for(m=0;m0?b:[f.scope]);if(e===false){break}}a.inDispatch=false;return e}});(function(){var a=tinymce.each;tinymce.create("tinymce.util.URI",{URI:function(e,g){var f=this,i,d,c,h;e=tinymce.trim(e);g=f.settings=g||{};if(/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e)){f.source=e;return}if(e.indexOf("/")===0&&e.indexOf("//")!==0){e=(g.base_uri?g.base_uri.protocol||"http":"http")+"://mce_host"+e}if(!/^[\w\-]*:?\/\//.test(e)){h=g.base_uri?g.base_uri.path:new tinymce.util.URI(location.href).directory;e=((g.base_uri&&g.base_uri.protocol)||"http")+"://mce_host"+f.toAbsPath(h,e)}e=e.replace(/@@/g,"(mce_at)");e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);a(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(b,j){var k=e[j];if(k){k=k.replace(/\(mce_at\)/g,"@@")}f[b]=k});c=g.base_uri;if(c){if(!f.protocol){f.protocol=c.protocol}if(!f.userInfo){f.userInfo=c.userInfo}if(!f.port&&f.host==="mce_host"){f.port=c.port}if(!f.host||f.host==="mce_host"){f.host=c.host}f.source=""}},setPath:function(c){var b=this;c=/^(.*?)\/?(\w+)?$/.exec(c);b.path=c[0];b.directory=c[1];b.file=c[2];b.source="";b.getURI()},toRelative:function(b){var d=this,f;if(b==="./"){return b}b=new tinymce.util.URI(b,{base_uri:d});if((b.host!="mce_host"&&d.host!=b.host&&b.host)||d.port!=b.port||d.protocol!=b.protocol){return b.getURI()}var c=d.getURI(),e=b.getURI();if(c==e||(c.charAt(c.length-1)=="/"&&c.substr(0,c.length-1)==e)){return c}f=d.toRelPath(d.path,b.path);if(b.query){f+="?"+b.query}if(b.anchor){f+="#"+b.anchor}return f},toAbsolute:function(b,c){b=new tinymce.util.URI(b,{base_uri:this});return b.getURI(this.host==b.host&&this.protocol==b.protocol?c:0)},toRelPath:function(g,h){var c,f=0,d="",e,b;g=g.substring(0,g.lastIndexOf("/"));g=g.split("/");c=h.split("/");if(g.length>=c.length){for(e=0,b=g.length;e=c.length||g[e]!=c[e]){f=e+1;break}}}if(g.length=g.length||g[e]!=c[e]){f=e+1;break}}}if(f===1){return h}for(e=0,b=g.length-(f-1);e=0;c--){if(f[c].length===0||f[c]==="."){continue}if(f[c]===".."){b++;continue}if(b>0){b--;continue}h.push(f[c])}c=e.length-b;if(c<=0){g=h.reverse().join("/")}else{g=e.slice(0,c).join("/")+"/"+h.reverse().join("/")}if(g.indexOf("/")!==0){g="/"+g}if(d&&g.lastIndexOf("/")!==g.length-1){g+=d}return g},getURI:function(d){var c,b=this;if(!b.source||d){c="";if(!d){if(b.protocol){c+=b.protocol+"://"}if(b.userInfo){c+=b.userInfo+"@"}if(b.host){c+=b.host}if(b.port){c+=":"+b.port}}if(b.path){c+=b.path}if(b.query){c+="?"+b.query}if(b.anchor){c+="#"+b.anchor}b.source=c}return b.source}})})();(function(){var a=tinymce.each;tinymce.create("static tinymce.util.Cookie",{getHash:function(d){var b=this.get(d),c;if(b){a(b.split("&"),function(e){e=e.split("=");c=c||{};c[unescape(e[0])]=unescape(e[1])})}return c},setHash:function(j,b,g,f,i,c){var h="";a(b,function(e,d){h+=(!h?"":"&")+escape(d)+"="+escape(e)});this.set(j,h,g,f,i,c)},get:function(i){var h=document.cookie,g,f=i+"=",d;if(!h){return}d=h.indexOf("; "+f);if(d==-1){d=h.indexOf(f);if(d!==0){return null}}else{d+=2}g=h.indexOf(";",d);if(g==-1){g=h.length}return unescape(h.substring(d+f.length,g))},set:function(i,b,g,f,h,c){document.cookie=i+"="+escape(b)+((g)?"; expires="+g.toGMTString():"")+((f)?"; path="+escape(f):"")+((h)?"; domain="+h:"")+((c)?"; secure":"")},remove:function(e,b){var c=new Date();c.setTime(c.getTime()-1000);this.set(e,"",c,b,c)}})})();(function(){function serialize(o,quote){var i,v,t,name;quote=quote||'"';if(o==null){return"null"}t=typeof o;if(t=="string"){v="\bb\tt\nn\ff\rr\"\"''\\\\";return quote+o.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(a,b){if(quote==='"'&&a==="'"){return a}i=v.indexOf(b);if(i+1){return"\\"+v.charAt(i+1)}a=b.charCodeAt().toString(16);return"\\u"+"0000".substring(a.length)+a})+quote}if(t=="object"){if(o.hasOwnProperty&&o instanceof Array){for(i=0,v="[";i0?",":"")+serialize(o[i],quote)}return v+"]"}v="{";for(name in o){if(o.hasOwnProperty(name)){v+=typeof o[name]!="function"?(v.length>1?","+quote:quote)+name+quote+":"+serialize(o[name],quote):""}}return v+"}"}return""+o}tinymce.util.JSON={serialize:serialize,parse:function(s){try{return eval("("+s+")")}catch(ex){}}}})();tinymce.create("static tinymce.util.XHR",{send:function(g){var a,e,b=window,h=0;function f(){if(!g.async||a.readyState==4||h++>10000){if(g.success&&h<10000&&a.status==200){g.success.call(g.success_scope,""+a.responseText,a,g)}else{if(g.error){g.error.call(g.error_scope,h>10000?"TIMED_OUT":"GENERAL",a,g)}}a=null}else{b.setTimeout(f,10)}}g.scope=g.scope||this;g.success_scope=g.success_scope||g.scope;g.error_scope=g.error_scope||g.scope;g.async=g.async===false?false:true;g.data=g.data||"";function d(i){a=0;try{a=new ActiveXObject(i)}catch(c){}return a}a=b.XMLHttpRequest?new XMLHttpRequest():d("Microsoft.XMLHTTP")||d("Msxml2.XMLHTTP");if(a){if(a.overrideMimeType){a.overrideMimeType(g.content_type)}a.open(g.type||(g.data?"POST":"GET"),g.url,g.async);if(g.content_type){a.setRequestHeader("Content-Type",g.content_type)}a.setRequestHeader("X-Requested-With","XMLHttpRequest");a.send(g.data);if(!g.async){return f()}e=b.setTimeout(f,10)}}});(function(){var c=tinymce.extend,b=tinymce.util.JSON,a=tinymce.util.XHR;tinymce.create("tinymce.util.JSONRequest",{JSONRequest:function(d){this.settings=c({},d);this.count=0},send:function(f){var e=f.error,d=f.success;f=c(this.settings,f);f.success=function(h,g){h=b.parse(h);if(typeof(h)=="undefined"){h={error:"JSON Parse error."}}if(h.error){e.call(f.error_scope||f.scope,h.error,g)}else{d.call(f.success_scope||f.scope,h.result)}};f.error=function(h,g){if(e){e.call(f.error_scope||f.scope,h,g)}};f.data=b.serialize({id:f.id||"c"+(this.count++),method:f.method,params:f.params});f.content_type="application/json";a.send(f)},"static":{sendRPC:function(d){return new tinymce.util.JSONRequest().send(d)}}})}());(function(a){a.VK={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,modifierPressed:function(b){return b.shiftKey||b.ctrlKey||b.altKey}}})(tinymce);tinymce.util.Quirks=function(d){var l=tinymce.VK,r=l.BACKSPACE,s=l.DELETE,o=d.dom,A=d.selection,q=d.settings;function c(E,D){try{d.getDoc().execCommand(E,false,D)}catch(C){}}function h(){function C(F){var D,H,E,G;D=A.getRng();H=o.getParent(D.startContainer,o.isBlock);if(F){H=o.getNext(H,o.isBlock)}if(H){E=H.firstChild;while(E&&E.nodeType==3&&E.nodeValue.length===0){E=E.nextSibling}if(E&&E.nodeName==="SPAN"){G=E.cloneNode(false)}}d.getDoc().execCommand(F?"ForwardDelete":"Delete",false,null);H=o.getParent(D.startContainer,o.isBlock);tinymce.each(o.select("span.Apple-style-span,font.Apple-style-span",H),function(I){var J=A.getBookmark();if(G){o.replace(G.cloneNode(false),I,true)}else{o.remove(I,true)}A.moveToBookmark(J)})}d.onKeyDown.add(function(D,F){var E;E=F.keyCode==s;if(!F.isDefaultPrevented()&&(E||F.keyCode==r)&&!l.modifierPressed(F)){F.preventDefault();C(E)}});d.addCommand("Delete",function(){C()})}function B(){function D(F,I){var E,H,G=I?"start":"end";E=F[G+"Container"];H=F[G+"Offset"];if(E.nodeType==1&&E.hasChildNodes()){E=E.childNodes[Math.min(I?H:(H>0?H-1:0),E.childNodes.length-1)]}return E}function C(H,L){var G,K,F,I,J=L?"start":"end",E;G=H[J+"Container"];K=H[J+"Offset"];F=o.getRoot();if(G.nodeType==1){E=K>=G.childNodes.length;G=D(H,L);if(G.nodeType==3){K=L&&!E?0:G.nodeValue.length}}if(G.nodeType==3&&((L&&K>0)||(!L&&K7){return}c("RespectVisibilityInDesign",true);o.addClass(d.getBody(),"mceHideBrInPre");d.parser.addNodeFilter("pre",function(D,F){var G=D.length,I,E,J,H;while(G--){I=D[G].getAll("br");E=I.length;while(E--){J=I[E];H=J.prev;if(H&&H.type===3&&H.value.charAt(H.value-1)!="\n"){H.value+="\n"}else{J.parent.insert(new tinymce.html.Node("#text",3),J,true).value="\n"}}}});d.serializer.addNodeFilter("pre",function(D,F){var G=D.length,I,E,J,H;while(G--){I=D[G].getAll("br");E=I.length;while(E--){J=I[E];H=J.prev;if(H&&H.type==3){H.value=H.value.replace(/\r?\n$/,"")}}}})}function f(){o.bind(d.getBody(),"mouseup",function(E){var D,C=A.getNode();if(C.nodeName=="IMG"){if(D=o.getStyle(C,"width")){o.setAttrib(C,"width",D.replace(/[^0-9%]+/g,""));o.setStyle(C,"width","")}if(D=o.getStyle(C,"height")){o.setAttrib(C,"height",D.replace(/[^0-9%]+/g,""));o.setStyle(C,"height","")}}})}function p(){d.onKeyDown.add(function(I,J){var H,C,D,F,G,K,E;H=J.keyCode==s;if(!J.isDefaultPrevented()&&(H||J.keyCode==r)&&!l.modifierPressed(J)){C=A.getRng();D=C.startContainer;F=C.startOffset;E=C.collapsed;if(D.nodeType==3&&D.nodeValue.length>0&&((F===0&&!E)||(E&&F===(H?0:1)))){nonEmptyElements=I.schema.getNonEmptyElements();J.preventDefault();G=o.create("br",{id:"__tmp"});D.parentNode.insertBefore(G,D);I.getDoc().execCommand(H?"ForwardDelete":"Delete",false,null);D=A.getRng().startContainer;K=D.previousSibling;if(K&&K.nodeType==1&&!o.isBlock(K)&&o.isEmpty(K)&&!nonEmptyElements[K.nodeName.toLowerCase()]){o.remove(K)}o.remove("__tmp")}}})}function e(){d.onKeyDown.add(function(G,H){var E,D,I,C,F;if(H.isDefaultPrevented()||H.keyCode!=l.BACKSPACE){return}E=A.getRng();D=E.startContainer;I=E.startOffset;C=o.getRoot();F=D;if(!E.collapsed||I!==0){return}while(F&&F.parentNode&&F.parentNode.firstChild==F&&F.parentNode!=C){F=F.parentNode}if(F.tagName==="BLOCKQUOTE"){G.formatter.toggle("blockquote",null,F);E.setStart(D,0);E.setEnd(D,0);A.setRng(E);A.collapse(false)}})}function k(){function C(){d._refreshContentEditable();c("StyleWithCSS",false);c("enableInlineTableEditing",false);if(!q.object_resizing){c("enableObjectResizing",false)}}if(!q.readonly){d.onBeforeExecCommand.add(C);d.onMouseDown.add(C)}}function n(){function C(D,E){tinymce.each(o.select("a"),function(H){var F=H.parentNode,G=o.getRoot();if(F.lastChild===H){while(F&&!o.isBlock(F)){if(F.parentNode.lastChild!==F||F===G){return}F=F.parentNode}o.add(F,"br",{"data-mce-bogus":1})}})}d.onExecCommand.add(function(D,E){if(E==="CreateLink"){C(D)}});d.onSetContent.add(A.onSetContent.add(C))}function t(){if(q.forced_root_block){d.onInit.add(function(){c("DefaultParagraphSeparator",q.forced_root_block)})}}function a(){function C(E,D){if(!E||!D.initial){d.execCommand("mceRepaint")}}d.onUndo.add(C);d.onRedo.add(C);d.onSetContent.add(C)}function j(){d.onKeyDown.add(function(C,D){if(!D.isDefaultPrevented()&&D.keyCode==8&&A.getNode().nodeName=="IMG"){D.preventDefault();C.undoManager.beforeChange();o.remove(A.getNode());C.undoManager.add()}})}v();e();B();if(tinymce.isWebKit){p();h();u();x();t();if(tinymce.isIDevice){i()}}if(tinymce.isIE){m();z();g();f();j()}if(tinymce.isGecko){m();b();y();k();n();a()}};(function(j){var a,g,d,k=/[&<>\"\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,b=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,f=/[<>&\"\']/g,c=/&(#x|#)?([\w]+);/g,i={128:"\u20AC",130:"\u201A",131:"\u0192",132:"\u201E",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02C6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017D",145:"\u2018",146:"\u2019",147:"\u201C",148:"\u201D",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02DC",153:"\u2122",154:"\u0161",155:"\u203A",156:"\u0153",158:"\u017E",159:"\u0178"};g={'"':""","'":"'","<":"<",">":">","&":"&"};d={"<":"<",">":">","&":"&",""":'"',"'":"'"};function h(l){var m;m=document.createElement("div");m.innerHTML=l;return m.textContent||m.innerText||l}function e(m,p){var n,o,l,q={};if(m){m=m.split(",");p=p||10;for(n=0;n1){return"&#"+(((n.charCodeAt(0)-55296)*1024)+(n.charCodeAt(1)-56320)+65536)+";"}return g[n]||"&#"+n.charCodeAt(0)+";"})},encodeNamed:function(n,l,m){m=m||a;return n.replace(l?k:b,function(o){return g[o]||m[o]||o})},getEncodeFunc:function(l,o){var p=j.html.Entities;o=e(o)||a;function m(r,q){return r.replace(q?k:b,function(s){return g[s]||o[s]||"&#"+s.charCodeAt(0)+";"||s})}function n(r,q){return p.encodeNamed(r,q,o)}l=j.makeMap(l.replace(/\+/g,","));if(l.named&&l.numeric){return m}if(l.named){if(o){return n}return p.encodeNamed}if(l.numeric){return p.encodeNumeric}return p.encodeRaw},decode:function(l){return l.replace(c,function(n,m,o){if(m){o=parseInt(o,m.length===2?16:10);if(o>65535){o-=65536;return String.fromCharCode(55296+(o>>10),56320+(o&1023))}else{return i[o]||String.fromCharCode(o)}}return d[n]||a[n]||h(n)})}}})(tinymce);tinymce.html.Styles=function(d,f){var k=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,h=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,b=/\s*([^:]+):\s*([^;]+);?/g,l=/\s+$/,m=/rgb/,e,g,a={},j;d=d||{};j="\\\" \\' \\; \\: ; : \uFEFF".split(" ");for(g=0;g1?r:"0"+r}return"#"+o(q)+o(p)+o(i)}return{toHex:function(i){return i.replace(k,c)},parse:function(s){var z={},q,n,x,r,v=d.url_converter,y=d.url_converter_scope||this;function p(D,G){var F,C,B,E;F=z[D+"-top"+G];if(!F){return}C=z[D+"-right"+G];if(F!=C){return}B=z[D+"-bottom"+G];if(C!=B){return}E=z[D+"-left"+G];if(B!=E){return}z[D+G]=E;delete z[D+"-top"+G];delete z[D+"-right"+G];delete z[D+"-bottom"+G];delete z[D+"-left"+G]}function u(C){var D=z[C],B;if(!D||D.indexOf(" ")<0){return}D=D.split(" ");B=D.length;while(B--){if(D[B]!==D[0]){return false}}z[C]=D[0];return true}function A(D,C,B,E){if(!u(C)){return}if(!u(B)){return}if(!u(E)){return}z[D]=z[C]+" "+z[B]+" "+z[E];delete z[C];delete z[B];delete z[E]}function t(B){r=true;return a[B]}function i(C,B){if(r){C=C.replace(/\uFEFF[0-9]/g,function(D){return a[D]})}if(!B){C=C.replace(/\\([\'\";:])/g,"$1")}return C}function o(C,B,F,E,G,D){G=G||D;if(G){G=i(G);return"'"+G.replace(/\'/g,"\\'")+"'"}B=i(B||F||E);if(v){B=v.call(y,B,"style")}return"url('"+B.replace(/\'/g,"\\'")+"')"}if(s){s=s.replace(/\\[\"\';:\uFEFF]/g,t).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(B){return B.replace(/[;:]/g,t)});while(q=b.exec(s)){n=q[1].replace(l,"").toLowerCase();x=q[2].replace(l,"");if(n&&x.length>0){if(n==="font-weight"&&x==="700"){x="bold"}else{if(n==="color"||n==="background-color"){x=x.toLowerCase()}}x=x.replace(k,c);x=x.replace(h,o);z[n]=r?i(x,true):x}b.lastIndex=q.index+q[0].length}p("border","");p("border","-width");p("border","-color");p("border","-style");p("padding","");p("margin","");A("border","border-width","border-style","border-color");if(z.border==="medium none"){delete z.border}}return z},serialize:function(p,r){var o="",n,q;function i(t){var x,u,s,v;x=f.styles[t];if(x){for(u=0,s=x.length;u0){o+=(o.length>0?" ":"")+t+": "+v+";"}}}}if(r&&f&&f.styles){i("*");i(r)}else{for(n in p){q=p[n];if(q!==e&&q.length>0){o+=(o.length>0?" ":"")+n+": "+q+";"}}}return o}}};(function(f){var a={},e=f.makeMap,g=f.each;function d(j,i){return j.split(i||",")}function h(m,l){var j,k={};function i(n){return n.replace(/[A-Z]+/g,function(o){return i(m[o])})}for(j in m){if(m.hasOwnProperty(j)){m[j]=i(m[j])}}i(l).replace(/#/g,"#text").replace(/(\w+)\[([^\]]+)\]\[([^\]]*)\]/g,function(q,o,n,p){n=d(n,"|");k[o]={attributes:e(n),attributesOrder:n,children:e(p,"|",{"#comment":{}})}});return k}function b(){var i=a.html5;if(!i){i=a.html5=h({A:"id|accesskey|class|dir|draggable|item|hidden|itemprop|role|spellcheck|style|subject|title",B:"#|a|abbr|area|audio|b|bdo|br|button|canvas|cite|code|command|datalist|del|dfn|em|embed|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|meta|meter|noscript|object|output|progress|q|ruby|samp|script|select|small|span|strong|sub|sup|svg|textarea|time|var|video",C:"#|a|abbr|area|address|article|aside|audio|b|bdo|blockquote|br|button|canvas|cite|code|command|datalist|del|details|dfn|dialog|div|dl|em|embed|fieldset|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|menu|meta|meter|nav|noscript|ol|object|output|p|pre|progress|q|ruby|samp|script|section|select|small|span|strong|style|sub|sup|svg|table|textarea|time|ul|var|video"},"html[A|manifest][body|head]head[A][base|command|link|meta|noscript|script|style|title]title[A][#]base[A|href|target][]link[A|href|rel|media|type|sizes][]meta[A|http-equiv|name|content|charset][]style[A|type|media|scoped][#]script[A|charset|type|src|defer|async][#]noscript[A][C]body[A][C]section[A][C]nav[A][C]article[A][C]aside[A][C]h1[A][B]h2[A][B]h3[A][B]h4[A][B]h5[A][B]h6[A][B]hgroup[A][h1|h2|h3|h4|h5|h6]header[A][C]footer[A][C]address[A][C]p[A][B]br[A][]pre[A][B]dialog[A][dd|dt]blockquote[A|cite][C]ol[A|start|reversed][li]ul[A][li]li[A|value][C]dl[A][dd|dt]dt[A][B]dd[A][C]a[A|href|target|ping|rel|media|type][B]em[A][B]strong[A][B]small[A][B]cite[A][B]q[A|cite][B]dfn[A][B]abbr[A][B]code[A][B]var[A][B]samp[A][B]kbd[A][B]sub[A][B]sup[A][B]i[A][B]b[A][B]mark[A][B]progress[A|value|max][B]meter[A|value|min|max|low|high|optimum][B]time[A|datetime][B]ruby[A][B|rt|rp]rt[A][B]rp[A][B]bdo[A][B]span[A][B]ins[A|cite|datetime][B]del[A|cite|datetime][B]figure[A][C|legend|figcaption]figcaption[A][C]img[A|alt|src|height|width|usemap|ismap][]iframe[A|name|src|height|width|sandbox|seamless][]embed[A|src|height|width|type][]object[A|data|type|height|width|usemap|name|form|classid][param]param[A|name|value][]details[A|open][C|legend]command[A|type|label|icon|disabled|checked|radiogroup][]menu[A|type|label][C|li]legend[A][C|B]div[A][C]source[A|src|type|media][]audio[A|src|autobuffer|autoplay|loop|controls][source]video[A|src|autobuffer|autoplay|loop|controls|width|height|poster][source]hr[A][]form[A|accept-charset|action|autocomplete|enctype|method|name|novalidate|target][C]fieldset[A|disabled|form|name][C|legend]label[A|form|for][B]input[A|type|accept|alt|autocomplete|checked|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|height|list|max|maxlength|min|multiple|pattern|placeholder|readonly|required|size|src|step|width|files|value|name][]button[A|autofocus|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|name|value|type][B]select[A|autofocus|disabled|form|multiple|name|size][option|optgroup]datalist[A][B|option]optgroup[A|disabled|label][option]option[A|disabled|selected|label|value][]textarea[A|autofocus|disabled|form|maxlength|name|placeholder|readonly|required|rows|cols|wrap][]keygen[A|autofocus|challenge|disabled|form|keytype|name][]output[A|for|form|name][B]canvas[A|width|height][]map[A|name][B|C]area[A|shape|coords|href|alt|target|media|rel|ping|type][]mathml[A][]svg[A][]table[A|summary][caption|colgroup|thead|tfoot|tbody|tr]caption[A][C]colgroup[A|span][col]col[A|span][]thead[A][tr]tfoot[A][tr]tbody[A][tr]tr[A][th|td]th[A|headers|rowspan|colspan|scope][B]td[A|headers|rowspan|colspan][C]")}return i}function c(){var i=a.html4;if(!i){i=a.html4=h({Z:"H|K|N|O|P",Y:"X|form|R|Q",ZG:"E|span|width|align|char|charoff|valign",X:"p|T|div|U|W|isindex|fieldset|table",ZF:"E|align|char|charoff|valign",W:"pre|hr|blockquote|address|center|noframes",ZE:"abbr|axis|headers|scope|rowspan|colspan|align|char|charoff|valign|nowrap|bgcolor|width|height",ZD:"[E][S]",U:"ul|ol|dl|menu|dir",ZC:"p|Y|div|U|W|table|br|span|bdo|object|applet|img|map|K|N|Q",T:"h1|h2|h3|h4|h5|h6",ZB:"X|S|Q",S:"R|P",ZA:"a|G|J|M|O|P",R:"a|H|K|N|O",Q:"noscript|P",P:"ins|del|script",O:"input|select|textarea|label|button",N:"M|L",M:"em|strong|dfn|code|q|samp|kbd|var|cite|abbr|acronym",L:"sub|sup",K:"J|I",J:"tt|i|b|u|s|strike",I:"big|small|font|basefont",H:"G|F",G:"br|span|bdo",F:"object|applet|img|map|iframe",E:"A|B|C",D:"accesskey|tabindex|onfocus|onblur",C:"onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup",B:"lang|xml:lang|dir",A:"id|class|style|title"},"script[id|charset|type|language|src|defer|xml:space][]style[B|id|type|media|title|xml:space][]object[E|declare|classid|codebase|data|type|codetype|archive|standby|width|height|usemap|name|tabindex|align|border|hspace|vspace][#|param|Y]param[id|name|value|valuetype|type][]p[E|align][#|S]a[E|D|charset|type|name|href|hreflang|rel|rev|shape|coords|target][#|Z]br[A|clear][]span[E][#|S]bdo[A|C|B][#|S]applet[A|codebase|archive|code|object|alt|name|width|height|align|hspace|vspace][#|param|Y]h1[E|align][#|S]img[E|src|alt|name|longdesc|width|height|usemap|ismap|align|border|hspace|vspace][]map[B|C|A|name][X|form|Q|area]h2[E|align][#|S]iframe[A|longdesc|name|src|frameborder|marginwidth|marginheight|scrolling|align|width|height][#|Y]h3[E|align][#|S]tt[E][#|S]i[E][#|S]b[E][#|S]u[E][#|S]s[E][#|S]strike[E][#|S]big[E][#|S]small[E][#|S]font[A|B|size|color|face][#|S]basefont[id|size|color|face][]em[E][#|S]strong[E][#|S]dfn[E][#|S]code[E][#|S]q[E|cite][#|S]samp[E][#|S]kbd[E][#|S]var[E][#|S]cite[E][#|S]abbr[E][#|S]acronym[E][#|S]sub[E][#|S]sup[E][#|S]input[E|D|type|name|value|checked|disabled|readonly|size|maxlength|src|alt|usemap|onselect|onchange|accept|align][]select[E|name|size|multiple|disabled|tabindex|onfocus|onblur|onchange][optgroup|option]optgroup[E|disabled|label][option]option[E|selected|disabled|label|value][]textarea[E|D|name|rows|cols|disabled|readonly|onselect|onchange][]label[E|for|accesskey|onfocus|onblur][#|S]button[E|D|name|value|type|disabled][#|p|T|div|U|W|table|G|object|applet|img|map|K|N|Q]h4[E|align][#|S]ins[E|cite|datetime][#|Y]h5[E|align][#|S]del[E|cite|datetime][#|Y]h6[E|align][#|S]div[E|align][#|Y]ul[E|type|compact][li]li[E|type|value][#|Y]ol[E|type|compact|start][li]dl[E|compact][dt|dd]dt[E][#|S]dd[E][#|Y]menu[E|compact][li]dir[E|compact][li]pre[E|width|xml:space][#|ZA]hr[E|align|noshade|size|width][]blockquote[E|cite][#|Y]address[E][#|S|p]center[E][#|Y]noframes[E][#|Y]isindex[A|B|prompt][]fieldset[E][#|legend|Y]legend[E|accesskey|align][#|S]table[E|summary|width|border|frame|rules|cellspacing|cellpadding|align|bgcolor][caption|col|colgroup|thead|tfoot|tbody|tr]caption[E|align][#|S]col[ZG][]colgroup[ZG][col]thead[ZF][tr]tr[ZF|bgcolor][th|td]th[E|ZE][#|Y]form[E|action|method|name|enctype|onsubmit|onreset|accept|accept-charset|target][#|X|R|Q]noscript[E][#|Y]td[E|ZE][#|Y]tfoot[ZF][tr]tbody[ZF][tr]area[E|D|shape|coords|href|nohref|alt|target][]base[id|href|target][]body[E|onload|onunload|background|bgcolor|text|link|vlink|alink][#|Y]")}return i}f.html.Schema=function(A){var u=this,s={},k={},j=[],D,y;var o,q,z,r,v,n,p={};function m(F,E,H){var G=A[F];if(!G){G=a[F];if(!G){G=e(E," ",e(E.toUpperCase()," "));G=f.extend(G,H);a[F]=G}}else{G=e(G,",",e(G.toUpperCase()," "))}return G}A=A||{};y=A.schema=="html5"?b():c();if(A.verify_html===false){A.valid_elements="*[*]"}if(A.valid_styles){D={};g(A.valid_styles,function(F,E){D[E]=f.explode(F)})}o=m("whitespace_elements","pre script style textarea");q=m("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr");z=m("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source");r=m("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls");n=m("non_empty_elements","td th iframe video audio object",z);v=m("block_elements","h1 h2 h3 h4 h5 h6 hr p div address pre form table tbody thead tfoot th tr td li ol ul caption blockquote center dl dt dd dir fieldset noscript menu isindex samp header footer article section hgroup aside nav figure option datalist select optgroup");function i(E){return new RegExp("^"+E.replace(/([?+*])/g,".$1")+"$")}function C(L){var K,G,Z,V,aa,F,I,U,X,Q,Y,ac,O,J,W,E,S,H,ab,ad,P,T,N=/^([#+\-])?([^\[\/]+)(?:\/([^\[]+))?(?:\[([^\]]+)\])?$/,R=/^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,M=/[*?+]/;if(L){L=d(L);if(s["@"]){S=s["@"].attributes;H=s["@"].attributesOrder}for(K=0,G=L.length;K=0){for(U=A.length-1;U>=V;U--){T=A[U];if(T.valid){n.end(T.name)}}A.length=V}}function p(U,T,Y,X,W){var Z,V;T=T.toLowerCase();Y=T in H?T:j(Y||X||W||"");if(v&&!z&&T.indexOf("data-")!==0){Z=P[T];if(!Z&&F){V=F.length;while(V--){Z=F[V];if(Z.pattern.test(T)){break}}if(V===-1){Z=null}}if(!Z){return}if(Z.validValues&&!(Y in Z.validValues)){return}}N.map[T]=Y;N.push({name:T,value:Y})}l=new RegExp("<(?:(?:!--([\\w\\W]*?)-->)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([^>]+)>)|(?:([A-Za-z0-9\\-\\:]+)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g");D=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:\\.|[^\"])*)\")|(?:\'((?:\\.|[^\'])*)\')|([^>\s]+)))?/g;K={script:/<\/script[^>]*>/gi,style:/<\/style[^>]*>/gi,noscript:/<\/noscript[^>]*>/gi};M=e.getShortEndedElements();J=c.self_closing_elements||e.getSelfClosingElements();H=e.getBoolAttrs();v=c.validate;s=c.remove_internals;y=c.fix_self_closing;q=a.isIE;o=/^:/;while(g=l.exec(E)){if(G0&&A[A.length-1].name===I){u(I)}if(!v||(m=e.getElementRule(I))){k=true;if(v){P=m.attributes;F=m.attributePatterns}if(R=g[8]){z=R.indexOf("data-mce-type")!==-1;if(z&&s){k=false}N=[];N.map={};R.replace(D,p)}else{N=[];N.map={}}if(v&&!z){S=m.attributesRequired;L=m.attributesDefault;f=m.attributesForced;if(f){Q=f.length;while(Q--){t=f[Q];r=t.name;h=t.value;if(h==="{$uid}"){h="mce_"+x++}N.map[r]=h;N.push({name:r,value:h})}}if(L){Q=L.length;while(Q--){t=L[Q];r=t.name;if(!(r in N.map)){h=t.value;if(h==="{$uid}"){h="mce_"+x++}N.map[r]=h;N.push({name:r,value:h})}}}if(S){Q=S.length;while(Q--){if(S[Q] in N.map){break}}if(Q===-1){k=false}}if(N.map["data-mce-bogus"]){k=false}}if(k){n.start(I,N,O)}}else{k=false}if(B=K[I]){B.lastIndex=G=g.index+g[0].length;if(g=B.exec(E)){if(k){C=E.substr(G,g.index-G)}G=g.index+g[0].length}else{C=E.substr(G);G=E.length}if(k&&C.length>0){n.text(C,true)}if(k){n.end(I)}l.lastIndex=G;continue}if(!O){if(!R||R.indexOf("/")!=R.length-1){A.push({name:I,valid:k})}else{if(k){n.end(I)}}}}else{if(I=g[1]){n.comment(I)}else{if(I=g[2]){n.cdata(I)}else{if(I=g[3]){n.doctype(I)}else{if(I=g[4]){n.pi(I,g[5])}}}}}}G=g.index+g[0].length}if(G=0;Q--){I=A[Q];if(I.valid){n.end(I.name)}}}}})(tinymce);(function(d){var c=/^[ \t\r\n]*$/,e={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11};function a(k,l,j){var i,h,f=j?"lastChild":"firstChild",g=j?"prev":"next";if(k[f]){return k[f]}if(k!==l){i=k[g];if(i){return i}for(h=k.parent;h&&h!==l;h=h.parent){i=h[g];if(i){return i}}}}function b(f,g){this.name=f;this.type=g;if(g===1){this.attributes=[];this.attributes.map={}}}d.extend(b.prototype,{replace:function(g){var f=this;if(g.parent){g.remove()}f.insert(g,f);f.remove();return f},attr:function(h,l){var f=this,g,j,k;if(typeof h!=="string"){for(j in h){f.attr(j,h[j])}return f}if(g=f.attributes){if(l!==k){if(l===null){if(h in g.map){delete g.map[h];j=g.length;while(j--){if(g[j].name===h){g=g.splice(j,1);return f}}}return f}if(h in g.map){j=g.length;while(j--){if(g[j].name===h){g[j].value=l;break}}}else{g.push({name:h,value:l})}g.map[h]=l;return f}else{return g.map[h]}}},clone:function(){var g=this,n=new b(g.name,g.type),h,f,m,j,k;if(m=g.attributes){k=[];k.map={};for(h=0,f=m.length;h1){v.reverse();z=n=f.filterNode(v[0].clone());for(t=0;t0){Q.value=l;Q=Q.prev}else{O=Q.prev;Q.remove();Q=O}}}function H(O){var P,l={};for(P in O){if(P!=="li"&&P!="p"){l[P]=O[P]}}return l}n=new b.html.SaxParser({validate:z,self_closing_elements:H(h.getSelfClosingElements()),cdata:function(l){B.append(K("#cdata",4)).value=l},text:function(P,l){var O;if(!L){P=P.replace(k," ");if(B.lastChild&&o[B.lastChild.name]){P=P.replace(E,"")}}if(P.length!==0){O=K("#text",3);O.raw=!!l;B.append(O).value=P}},comment:function(l){B.append(K("#comment",8)).value=l},pi:function(l,O){B.append(K(l,7)).value=O;I(B)},doctype:function(O){var l;l=B.append(K("#doctype",10));l.value=O;I(B)},start:function(l,W,P){var U,R,Q,O,S,X,V,T;Q=z?h.getElementRule(l):{};if(Q){U=K(Q.outputName||l,1);U.attributes=W;U.shortEnded=P;B.append(U);T=p[B.name];if(T&&p[U.name]&&!T[U.name]){M.push(U)}R=d.length;while(R--){S=d[R].name;if(S in W.map){F=c[S];if(F){F.push(U)}else{c[S]=[U]}}}if(o[l]){I(U)}if(!P){B=U}if(!L&&s[l]){L=true}}},end:function(l){var S,P,R,O,Q;P=z?h.getElementRule(l):{};if(P){if(o[l]){if(!L){S=B.firstChild;if(S&&S.type===3){R=S.value.replace(E,"");if(R.length>0){S.value=R;S=S.next}else{O=S.next;S.remove();S=O}while(S&&S.type===3){R=S.value;O=S.next;if(R.length===0||y.test(R)){S.remove();S=O}S=O}}S=B.lastChild;if(S&&S.type===3){R=S.value.replace(t,"");if(R.length>0){S.value=R;S=S.prev}else{O=S.prev;S.remove();S=O}while(S&&S.type===3){R=S.value;O=S.prev;if(R.length===0||y.test(R)){S.remove();S=O}S=O}}}S=B.prev;if(S&&S.type===3){R=S.value.replace(E,"");if(R.length>0){S.value=R}else{S.remove()}}}if(L&&s[l]){L=false}if(P.removeEmpty||P.paddEmpty){if(B.isEmpty(u)){if(P.paddEmpty){B.empty().append(new a("#text","3")).value="\u00a0"}else{if(!B.attributes.map.name&&!B.attributes.map.id){Q=B.parent;B.empty().remove();B=Q;return}}}}B=B.parent}}},h);J=B=new a(m.context||g.root_name,11);n.parse(v);if(z&&M.length){if(!m.context){j(M)}else{m.invalid=true}}if(q&&J.name=="body"){G()}if(!m.invalid){for(N in i){F=e[N];A=i[N];x=A.length;while(x--){if(!A[x].parent){A.splice(x,1)}}for(D=0,C=F.length;D0){o=c[c.length-1];if(o.length>0&&o!=="\n"){c.push("\n")}}c.push("<",m);if(k){for(n=0,j=k.length;n0){o=c[c.length-1];if(o.length>0&&o!=="\n"){c.push("\n")}}},end:function(h){var i;c.push("");if(a&&d[h]&&c.length>0){i=c[c.length-1];if(i.length>0&&i!=="\n"){c.push("\n")}}},text:function(i,h){if(i.length>0){c[c.length]=h?i:f(i)}},cdata:function(h){c.push("")},comment:function(h){c.push("")},pi:function(h,i){if(i){c.push("")}else{c.push("")}if(a){c.push("\n")}},doctype:function(h){c.push("",a?"\n":"")},reset:function(){c.length=0},getContent:function(){return c.join("").replace(/\n$/,"")}}};(function(a){a.html.Serializer=function(c,d){var b=this,e=new a.html.Writer(c);c=c||{};c.validate="validate" in c?c.validate:true;b.schema=d=d||new a.html.Schema();b.writer=e;b.serialize=function(h){var g,i;i=c.validate;g={3:function(k,j){e.text(k.value,k.raw)},8:function(j){e.comment(j.value)},7:function(j){e.pi(j.name,j.value)},10:function(j){e.doctype(j.value)},4:function(j){e.cdata(j.value)},11:function(j){if((j=j.firstChild)){do{f(j)}while(j=j.next)}}};e.reset();function f(k){var t=g[k.type],j,o,s,r,p,u,n,m,q;if(!t){j=k.name;o=k.shortEnded;s=k.attributes;if(i&&s&&s.length>1){u=[];u.map={};q=d.getElementRule(k.name);for(n=0,m=q.attributesOrder.length;n=8;k.boxModel=!e.isIE||o.compatMode=="CSS1Compat"||k.stdMode;k.hasOuterHTML="outerHTML" in o.createElement("a");k.settings=l=e.extend({keep_values:false,hex_colors:1},l);k.schema=l.schema;k.styles=new e.html.Styles({url_converter:l.url_converter,url_converter_scope:l.url_converter_scope},l.schema);if(e.isIE6){try{o.execCommand("BackgroundImageCache",false,true)}catch(m){k.cssFlicker=true}}k.fixDoc(o);k.events=l.ownEvents?new e.dom.EventUtils(l.proxy):e.dom.Event;e.addUnload(k.destroy,k);n=l.schema?l.schema.getBlockElements():{};k.isBlock=function(q){var p=q.nodeType;if(p){return !!(p===1&&n[q.nodeName])}return !!n[q]}},fixDoc:function(k){var j=this.settings,i;if(b&&j.schema){("abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video").replace(/\w+/g,function(l){k.createElement(l)});for(i in j.schema.getCustomElements()){k.createElement(i)}}},clone:function(k,i){var j=this,m,l;if(!b||k.nodeType!==1||i){return k.cloneNode(i)}l=j.doc;if(!i){m=l.createElement(k.nodeName);g(j.getAttribs(k),function(n){j.setAttrib(m,n.nodeName,j.getAttrib(k,n.nodeName))});return m}return m.firstChild},getRoot:function(){var i=this,j=i.settings;return(j&&i.get(j.root_element))||i.doc.body},getViewPort:function(j){var k,i;j=!j?this.win:j;k=j.document;i=this.boxModel?k.documentElement:k.body;return{x:j.pageXOffset||i.scrollLeft,y:j.pageYOffset||i.scrollTop,w:j.innerWidth||i.clientWidth,h:j.innerHeight||i.clientHeight}},getRect:function(l){var k,i=this,j;l=i.get(l);k=i.getPos(l);j=i.getSize(l);return{x:k.x,y:k.y,w:j.w,h:j.h}},getSize:function(l){var j=this,i,k;l=j.get(l);i=j.getStyle(l,"width");k=j.getStyle(l,"height");if(i.indexOf("px")===-1){i=0}if(k.indexOf("px")===-1){k=0}return{w:parseInt(i,10)||l.offsetWidth||l.clientWidth,h:parseInt(k,10)||l.offsetHeight||l.clientHeight}},getParent:function(k,j,i){return this.getParents(k,j,i,false)},getParents:function(s,m,k,q){var j=this,i,l=j.settings,p=[];s=j.get(s);q=q===undefined;if(l.strict_root){k=k||j.getRoot()}if(d(m,"string")){i=m;if(m==="*"){m=function(o){return o.nodeType==1}}else{m=function(o){return j.is(o,i)}}}while(s){if(s==k||!s.nodeType||s.nodeType===9){break}if(!m||m(s)){if(q){p.push(s)}else{return s}}s=s.parentNode}return q?p:null},get:function(i){var j;if(i&&this.doc&&typeof(i)=="string"){j=i;i=this.doc.getElementById(i);if(i&&i.id!==j){return this.doc.getElementsByName(j)[1]}}return i},getNext:function(j,i){return this._findSib(j,i,"nextSibling")},getPrev:function(j,i){return this._findSib(j,i,"previousSibling")},select:function(k,j){var i=this;return e.dom.Sizzle(k,i.get(j)||i.get(i.settings.root_element)||i.doc,[])},is:function(l,j){var k;if(l.length===undefined){if(j==="*"){return l.nodeType==1}if(c.test(j)){j=j.toLowerCase().split(/,/);l=l.nodeName.toLowerCase();for(k=j.length-1;k>=0;k--){if(j[k]==l){return true}}return false}}return e.dom.Sizzle.matches(j,l.nodeType?[l]:l).length>0},add:function(l,o,i,k,m){var j=this;return this.run(l,function(r){var q,n;q=d(o,"string")?j.doc.createElement(o):o;j.setAttribs(q,i);if(k){if(k.nodeType){q.appendChild(k)}else{j.setHTML(q,k)}}return !m?r.appendChild(q):q})},create:function(k,i,j){return this.add(this.doc.createElement(k),k,i,j,1)},createHTML:function(q,i,m){var p="",l=this,j;p+="<"+q;for(j in i){if(i.hasOwnProperty(j)){p+=" "+j+'="'+l.encode(i[j])+'"'}}if(typeof(m)!="undefined"){return p+">"+m+""}return p+" />"},remove:function(i,j){return this.run(i,function(l){var m,k=l.parentNode;if(!k){return null}if(j){while(m=l.firstChild){if(!e.isIE||m.nodeType!==3||m.nodeValue){k.insertBefore(m,l)}else{l.removeChild(m)}}}return k.removeChild(l)})},setStyle:function(l,i,j){var k=this;return k.run(l,function(o){var n,m;n=o.style;i=i.replace(/-(\D)/g,function(q,p){return p.toUpperCase()});if(k.pixelStyles.test(i)&&(e.is(j,"number")||/^[\-0-9\.]+$/.test(j))){j+="px"}switch(i){case"opacity":if(b){n.filter=j===""?"":"alpha(opacity="+(j*100)+")";if(!l.currentStyle||!l.currentStyle.hasLayout){n.display="inline-block"}}n[i]=n["-moz-opacity"]=n["-khtml-opacity"]=j||"";break;case"float":b?n.styleFloat=j:n.cssFloat=j;break;default:n[i]=j||""}if(k.settings.update_styles){k.setAttrib(o,"data-mce-style")}})},getStyle:function(l,i,k){l=this.get(l);if(!l){return}if(this.doc.defaultView&&k){i=i.replace(/[A-Z]/g,function(m){return"-"+m});try{return this.doc.defaultView.getComputedStyle(l,null).getPropertyValue(i)}catch(j){return null}}i=i.replace(/-(\D)/g,function(n,m){return m.toUpperCase()});if(i=="float"){i=b?"styleFloat":"cssFloat"}if(l.currentStyle&&k){return l.currentStyle[i]}return l.style?l.style[i]:undefined},setStyles:function(l,m){var j=this,k=j.settings,i;i=k.update_styles;k.update_styles=0;g(m,function(o,p){j.setStyle(l,p,o)});k.update_styles=i;if(k.update_styles){j.setAttrib(l,k.cssText)}},removeAllAttribs:function(i){return this.run(i,function(l){var k,j=l.attributes;for(k=j.length-1;k>=0;k--){l.removeAttributeNode(j.item(k))}})},setAttrib:function(k,l,i){var j=this;if(!k||!l){return}if(j.settings.strict){l=l.toLowerCase()}return this.run(k,function(p){var o=j.settings;var m=p.getAttribute(l);if(i!==null){switch(l){case"style":if(!d(i,"string")){g(i,function(q,r){j.setStyle(p,r,q)});return}if(o.keep_values){if(i&&!j._isRes(i)){p.setAttribute("data-mce-style",i,2)}else{p.removeAttribute("data-mce-style",2)}}p.style.cssText=i;break;case"class":p.className=i||"";break;case"src":case"href":if(o.keep_values){if(o.url_converter){i=o.url_converter.call(o.url_converter_scope||j,i,l,p)}j.setAttrib(p,"data-mce-"+l,i,2)}break;case"shape":p.setAttribute("data-mce-style",i);break}}if(d(i)&&i!==null&&i.length!==0){p.setAttribute(l,""+i,2)}else{p.removeAttribute(l,2)}if(tinyMCE.activeEditor&&m!=i){var n=tinyMCE.activeEditor;n.onSetAttrib.dispatch(n,p,l,i)}})},setAttribs:function(j,k){var i=this;return this.run(j,function(l){g(k,function(m,o){i.setAttrib(l,o,m)})})},getAttrib:function(m,o,k){var i,j=this,l;m=j.get(m);if(!m||m.nodeType!==1){return k===l?false:k}if(!d(k)){k=""}if(/^(src|href|style|coords|shape)$/.test(o)){i=m.getAttribute("data-mce-"+o);if(i){return i}}if(b&&j.props[o]){i=m[j.props[o]];i=i&&i.nodeValue?i.nodeValue:i}if(!i){i=m.getAttribute(o,2)}if(/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(o)){if(m[j.props[o]]===true&&i===""){return o}return i?o:""}if(m.nodeName==="FORM"&&m.getAttributeNode(o)){return m.getAttributeNode(o).nodeValue}if(o==="style"){i=i||m.style.cssText;if(i){i=j.serializeStyle(j.parseStyle(i),m.nodeName);if(j.settings.keep_values&&!j._isRes(i)){m.setAttribute("data-mce-style",i)}}}if(f&&o==="class"&&i){i=i.replace(/(apple|webkit)\-[a-z\-]+/gi,"")}if(b){switch(o){case"rowspan":case"colspan":if(i===1){i=""}break;case"size":if(i==="+0"||i===20||i===0){i=""}break;case"width":case"height":case"vspace":case"checked":case"disabled":case"readonly":if(i===0){i=""}break;case"hspace":if(i===-1){i=""}break;case"maxlength":case"tabindex":if(i===32768||i===2147483647||i==="32768"){i=""}break;case"multiple":case"compact":case"noshade":case"nowrap":if(i===65535){return o}return k;case"shape":i=i.toLowerCase();break;default:if(o.indexOf("on")===0&&i){i=e._replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/,"$1",""+i)}}}return(i!==l&&i!==null&&i!=="")?""+i:k},getPos:function(q,l){var j=this,i=0,p=0,m,o=j.doc,k;q=j.get(q);l=l||o.body;if(q){if(q.getBoundingClientRect){q=q.getBoundingClientRect();m=j.boxModel?o.documentElement:o.body;i=q.left+(o.documentElement.scrollLeft||o.body.scrollLeft)-m.clientTop;p=q.top+(o.documentElement.scrollTop||o.body.scrollTop)-m.clientLeft;return{x:i,y:p}}k=q;while(k&&k!=l&&k.nodeType){i+=k.offsetLeft||0;p+=k.offsetTop||0;k=k.offsetParent}k=q.parentNode;while(k&&k!=l&&k.nodeType){i-=k.scrollLeft||0;p-=k.scrollTop||0;k=k.parentNode}}return{x:i,y:p}},parseStyle:function(i){return this.styles.parse(i)},serializeStyle:function(j,i){return this.styles.serialize(j,i)},loadCSS:function(i){var k=this,l=k.doc,j;if(!i){i=""}j=l.getElementsByTagName("head")[0];g(i.split(","),function(m){var n;if(k.files[m]){return}k.files[m]=true;n=k.create("link",{rel:"stylesheet",href:e._addVer(m)});if(b&&l.documentMode&&l.recalc){n.onload=function(){if(l.recalc){l.recalc()}n.onload=null}}j.appendChild(n)})},addClass:function(i,j){return this.run(i,function(k){var l;if(!j){return 0}if(this.hasClass(k,j)){return k.className}l=this.removeClass(k,j);return k.className=(l!=""?(l+" "):"")+j})},removeClass:function(k,l){var i=this,j;return i.run(k,function(n){var m;if(i.hasClass(n,l)){if(!j){j=new RegExp("(^|\\s+)"+l+"(\\s+|$)","g")}m=n.className.replace(j," ");m=e.trim(m!=" "?m:"");n.className=m;if(!m){n.removeAttribute("class");n.removeAttribute("className")}return m}return n.className})},hasClass:function(j,i){j=this.get(j);if(!j||!i){return false}return(" "+j.className+" ").indexOf(" "+i+" ")!==-1},show:function(i){return this.setStyle(i,"display","block")},hide:function(i){return this.setStyle(i,"display","none")},isHidden:function(i){i=this.get(i);return !i||i.style.display=="none"||this.getStyle(i,"display")=="none"},uniqueId:function(i){return(!i?"mce_":i)+(this.counter++)},setHTML:function(k,j){var i=this;return i.run(k,function(m){if(b){while(m.firstChild){m.removeChild(m.firstChild)}try{m.innerHTML="
                    "+j;m.removeChild(m.firstChild)}catch(l){m=i.create("div");m.innerHTML="
                    "+j;g(m.childNodes,function(o,n){if(n){m.appendChild(o)}})}}else{m.innerHTML=j}return j})},getOuterHTML:function(k){var j,i=this;k=i.get(k);if(!k){return null}if(k.nodeType===1&&i.hasOuterHTML){return k.outerHTML}j=(k.ownerDocument||i.doc).createElement("body");j.appendChild(k.cloneNode(true));return j.innerHTML},setOuterHTML:function(l,j,m){var i=this;function k(p,o,r){var s,q;q=r.createElement("body");q.innerHTML=o;s=q.lastChild;while(s){i.insertAfter(s.cloneNode(true),p);s=s.previousSibling}i.remove(p)}return this.run(l,function(o){o=i.get(o);if(o.nodeType==1){m=m||o.ownerDocument||i.doc;if(b){try{if(b&&o.nodeType==1){o.outerHTML=j}else{k(o,j,m)}}catch(n){k(o,j,m)}}else{k(o,j,m)}}})},decode:h.decode,encode:h.encodeAllRaw,insertAfter:function(i,j){j=this.get(j);return this.run(i,function(l){var k,m;k=j.parentNode;m=j.nextSibling;if(m){k.insertBefore(l,m)}else{k.appendChild(l)}return l})},replace:function(m,l,i){var j=this;if(d(l,"array")){m=m.cloneNode(true)}return j.run(l,function(k){if(i){g(e.grep(k.childNodes),function(n){m.appendChild(n)})}return k.parentNode.replaceChild(m,k)})},rename:function(l,i){var k=this,j;if(l.nodeName!=i.toUpperCase()){j=k.create(i);g(k.getAttribs(l),function(m){k.setAttrib(j,m.nodeName,k.getAttrib(l,m.nodeName))});k.replace(j,l,1)}return j||l},findCommonAncestor:function(k,i){var l=k,j;while(l){j=i;while(j&&l!=j){j=j.parentNode}if(l==j){break}l=l.parentNode}if(!l&&k.ownerDocument){return k.ownerDocument.documentElement}return l},toHex:function(i){var k=/^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(i);function j(l){l=parseInt(l,10).toString(16);return l.length>1?l:"0"+l}if(k){i="#"+j(k[1])+j(k[2])+j(k[3]);return i}return i},getClasses:function(){var n=this,j=[],m,o={},p=n.settings.class_filter,l;if(n.classes){return n.classes}function q(i){g(i.imports,function(s){q(s)});g(i.cssRules||i.rules,function(s){switch(s.type||1){case 1:if(s.selectorText){g(s.selectorText.split(","),function(r){r=r.replace(/^\s*|\s*$|^\s\./g,"");if(/\.mce/.test(r)||!/\.[\w\-]+$/.test(r)){return}l=r;r=e._replace(/.*\.([a-z0-9_\-]+).*/i,"$1",r);if(p&&!(r=p(r,l))){return}if(!o[r]){j.push({"class":r});o[r]=1}})}break;case 3:q(s.styleSheet);break}})}try{g(n.doc.styleSheets,q)}catch(k){}if(j.length>0){n.classes=j}return j},run:function(l,k,j){var i=this,m;if(i.doc&&typeof(l)==="string"){l=i.get(l)}if(!l){return false}j=j||this;if(!l.nodeType&&(l.length||l.length===0)){m=[];g(l,function(o,n){if(o){if(typeof(o)=="string"){o=i.doc.getElementById(o)}m.push(k.call(j,o,n))}});return m}return k.call(j,l)},getAttribs:function(j){var i;j=this.get(j);if(!j){return[]}if(b){i=[];if(j.nodeName=="OBJECT"){return j.attributes}if(j.nodeName==="OPTION"&&this.getAttrib(j,"selected")){i.push({specified:1,nodeName:"selected"})}j.cloneNode(false).outerHTML.replace(/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi,"").replace(/[\w:\-]+/gi,function(k){i.push({specified:1,nodeName:k})});return i}return j.attributes},isEmpty:function(m,k){var r=this,o,n,q,j,l,p=0;m=m.firstChild;if(m){j=new e.dom.TreeWalker(m,m.parentNode);k=k||r.schema?r.schema.getNonEmptyElements():null;do{q=m.nodeType;if(q===1){if(m.getAttribute("data-mce-bogus")){continue}l=m.nodeName.toLowerCase();if(k&&k[l]){if(l==="br"){p++;continue}return false}n=r.getAttribs(m);o=m.attributes.length;while(o--){l=m.attributes[o].nodeName;if(l==="name"||l==="data-mce-bookmark"){return false}}}if(q==8){return false}if((q===3&&!a.test(m.nodeValue))){return false}}while(m=j.next())}return p<=1},destroy:function(j){var i=this;i.win=i.doc=i.root=i.events=i.frag=null;if(!j){e.removeUnload(i.destroy)}},createRng:function(){var i=this.doc;return i.createRange?i.createRange():new e.dom.Range(this)},nodeIndex:function(m,n){var i=0,k,l,j;if(m){for(k=m.nodeType,m=m.previousSibling,l=m;m;m=m.previousSibling){j=m.nodeType;if(n&&j==3){if(j==k||!m.nodeValue.length){continue}}i++;k=j}}return i},split:function(m,l,p){var q=this,i=q.createRng(),n,k,o;function j(v){var t,s=v.childNodes,u=v.nodeType;function x(A){var z=A.previousSibling&&A.previousSibling.nodeName=="SPAN";var y=A.nextSibling&&A.nextSibling.nodeName=="SPAN";return z&&y}if(u==1&&v.getAttribute("data-mce-type")=="bookmark"){return}for(t=s.length-1;t>=0;t--){j(s[t])}if(u!=9){if(u==3&&v.nodeValue.length>0){var r=e.trim(v.nodeValue).length;if(!q.isBlock(v.parentNode)||r>0||r===0&&x(v)){return}}else{if(u==1){s=v.childNodes;if(s.length==1&&s[0]&&s[0].nodeType==1&&s[0].getAttribute("data-mce-type")=="bookmark"){v.parentNode.insertBefore(s[0],v)}if(s.length||/^(br|hr|input|img)$/i.test(v.nodeName)){return}}}q.remove(v)}return v}if(m&&l){i.setStart(m.parentNode,q.nodeIndex(m));i.setEnd(l.parentNode,q.nodeIndex(l));n=i.extractContents();i=q.createRng();i.setStart(l.parentNode,q.nodeIndex(l)+1);i.setEnd(m.parentNode,q.nodeIndex(m)+1);k=i.extractContents();o=m.parentNode;o.insertBefore(j(n),m);if(p){o.replaceChild(p,l)}else{o.insertBefore(l,m)}o.insertBefore(j(k),m);q.remove(m);return p||l}},bind:function(l,i,k,j){return this.events.add(l,i,k,j||this)},unbind:function(k,i,j){return this.events.remove(k,i,j)},fire:function(k,j,i){return this.events.fire(k,j,i)},getContentEditable:function(j){var i;if(j.nodeType!=1){return null}i=j.getAttribute("data-mce-contenteditable");if(i&&i!=="inherit"){return i}return j.contentEditable!=="inherit"?j.contentEditable:null},_findSib:function(l,i,j){var k=this,m=i;if(l){if(d(m,"string")){m=function(n){return k.is(n,i)}}for(l=l[j];l;l=l[j]){if(m(l)){return l}}}return null},_isRes:function(i){return/^(top|left|bottom|right|width|height)/i.test(i)||/;\s*(top|left|bottom|right|width|height)/i.test(i)}});e.DOM=new e.dom.DOMUtils(document,{process_html:0})})(tinymce);(function(a){function b(c){var O=this,e=c.doc,U=0,F=1,j=2,E=true,S=false,W="startOffset",h="startContainer",Q="endContainer",A="endOffset",k=tinymce.extend,n=c.nodeIndex;k(O,{startContainer:e,startOffset:0,endContainer:e,endOffset:0,collapsed:E,commonAncestorContainer:e,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:q,setEnd:s,setStartBefore:g,setStartAfter:J,setEndBefore:K,setEndAfter:u,collapse:B,selectNode:y,selectNodeContents:G,compareBoundaryPoints:v,deleteContents:p,extractContents:I,cloneContents:d,insertNode:D,surroundContents:N,cloneRange:L,toStringIE:T});function x(){return e.createDocumentFragment()}function q(X,t){C(E,X,t)}function s(X,t){C(S,X,t)}function g(t){q(t.parentNode,n(t))}function J(t){q(t.parentNode,n(t)+1)}function K(t){s(t.parentNode,n(t))}function u(t){s(t.parentNode,n(t)+1)}function B(t){if(t){O[Q]=O[h];O[A]=O[W]}else{O[h]=O[Q];O[W]=O[A]}O.collapsed=E}function y(t){g(t);u(t)}function G(t){q(t,0);s(t,t.nodeType===1?t.childNodes.length:t.nodeValue.length)}function v(aa,t){var ad=O[h],Y=O[W],ac=O[Q],X=O[A],ab=t.startContainer,af=t.startOffset,Z=t.endContainer,ae=t.endOffset;if(aa===0){return H(ad,Y,ab,af)}if(aa===1){return H(ac,X,ab,af)}if(aa===2){return H(ac,X,Z,ae)}if(aa===3){return H(ad,Y,Z,ae)}}function p(){l(j)}function I(){return l(U)}function d(){return l(F)}function D(aa){var X=this[h],t=this[W],Z,Y;if((X.nodeType===3||X.nodeType===4)&&X.nodeValue){if(!t){X.parentNode.insertBefore(aa,X)}else{if(t>=X.nodeValue.length){c.insertAfter(aa,X)}else{Z=X.splitText(t);X.parentNode.insertBefore(aa,Z)}}}else{if(X.childNodes.length>0){Y=X.childNodes[t]}if(Y){X.insertBefore(aa,Y)}else{X.appendChild(aa)}}}function N(X){var t=O.extractContents();O.insertNode(X);X.appendChild(t);O.selectNode(X)}function L(){return k(new b(c),{startContainer:O[h],startOffset:O[W],endContainer:O[Q],endOffset:O[A],collapsed:O.collapsed,commonAncestorContainer:O.commonAncestorContainer})}function P(t,X){var Y;if(t.nodeType==3){return t}if(X<0){return t}Y=t.firstChild;while(Y&&X>0){--X;Y=Y.nextSibling}if(Y){return Y}return t}function m(){return(O[h]==O[Q]&&O[W]==O[A])}function H(Z,ab,X,aa){var ac,Y,t,ad,af,ae;if(Z==X){if(ab==aa){return 0}if(ab0){O.collapse(X)}}else{O.collapse(X)}O.collapsed=m();O.commonAncestorContainer=c.findCommonAncestor(O[h],O[Q])}function l(ad){var ac,Z=0,af=0,X,ab,Y,aa,t,ae;if(O[h]==O[Q]){return f(ad)}for(ac=O[Q],X=ac.parentNode;X;ac=X,X=X.parentNode){if(X==O[h]){return r(ac,ad)}++Z}for(ac=O[h],X=ac.parentNode;X;ac=X,X=X.parentNode){if(X==O[Q]){return V(ac,ad)}++af}ab=af-Z;Y=O[h];while(ab>0){Y=Y.parentNode;ab--}aa=O[Q];while(ab<0){aa=aa.parentNode;ab++}for(t=Y.parentNode,ae=aa.parentNode;t!=ae;t=t.parentNode,ae=ae.parentNode){Y=t;aa=ae}return o(Y,aa,ad)}function f(ac){var ae,af,t,Y,Z,ad,aa,X,ab;if(ac!=j){ae=x()}if(O[W]==O[A]){return ae}if(O[h].nodeType==3){af=O[h].nodeValue;t=af.substring(O[W],O[A]);if(ac!=F){Y=O[h];X=O[W];ab=O[A]-O[W];if(X===0&&ab>=Y.nodeValue.length-1){Y.parentNode.removeChild(Y)}else{Y.deleteData(X,ab)}O.collapse(E)}if(ac==j){return}if(t.length>0){ae.appendChild(e.createTextNode(t))}return ae}Y=P(O[h],O[W]);Z=O[A]-O[W];while(Y&&Z>0){ad=Y.nextSibling;aa=z(Y,ac);if(ae){ae.appendChild(aa)}--Z;Y=ad}if(ac!=F){O.collapse(E)}return ae}function r(ad,aa){var ac,ab,X,t,Z,Y;if(aa!=j){ac=x()}ab=i(ad,aa);if(ac){ac.appendChild(ab)}X=n(ad);t=X-O[W];if(t<=0){if(aa!=F){O.setEndBefore(ad);O.collapse(S)}return ac}ab=ad.previousSibling;while(t>0){Z=ab.previousSibling;Y=z(ab,aa);if(ac){ac.insertBefore(Y,ac.firstChild)}--t;ab=Z}if(aa!=F){O.setEndBefore(ad);O.collapse(S)}return ac}function V(ab,aa){var ad,X,ac,t,Z,Y;if(aa!=j){ad=x()}ac=R(ab,aa);if(ad){ad.appendChild(ac)}X=n(ab);++X;t=O[A]-X;ac=ab.nextSibling;while(ac&&t>0){Z=ac.nextSibling;Y=z(ac,aa);if(ad){ad.appendChild(Y)}--t;ac=Z}if(aa!=F){O.setStartAfter(ab);O.collapse(E)}return ad}function o(ab,t,ae){var Y,ag,aa,ac,ad,X,af,Z;if(ae!=j){ag=x()}Y=R(ab,ae);if(ag){ag.appendChild(Y)}aa=ab.parentNode;ac=n(ab);ad=n(t);++ac;X=ad-ac;af=ab.nextSibling;while(X>0){Z=af.nextSibling;Y=z(af,ae);if(ag){ag.appendChild(Y)}af=Z;--X}Y=i(t,ae);if(ag){ag.appendChild(Y)}if(ae!=F){O.setStartAfter(ab);O.collapse(E)}return ag}function i(ac,ad){var Y=P(O[Q],O[A]-1),ae,ab,aa,t,X,Z=Y!=O[Q];if(Y==ac){return M(Y,Z,S,ad)}ae=Y.parentNode;ab=M(ae,S,S,ad);while(ae){while(Y){aa=Y.previousSibling;t=M(Y,Z,S,ad);if(ad!=j){ab.insertBefore(t,ab.firstChild)}Z=E;Y=aa}if(ae==ac){return ab}Y=ae.previousSibling;ae=ae.parentNode;X=M(ae,S,S,ad);if(ad!=j){X.appendChild(ab)}ab=X}}function R(ac,ad){var Z=P(O[h],O[W]),aa=Z!=O[h],ae,ab,Y,t,X;if(Z==ac){return M(Z,aa,E,ad)}ae=Z.parentNode;ab=M(ae,S,E,ad);while(ae){while(Z){Y=Z.nextSibling;t=M(Z,aa,E,ad);if(ad!=j){ab.appendChild(t)}aa=E;Z=Y}if(ae==ac){return ab}Z=ae.nextSibling;ae=ae.parentNode;X=M(ae,S,E,ad);if(ad!=j){X.appendChild(ab)}ab=X}}function M(t,aa,ad,ae){var Z,Y,ab,X,ac;if(aa){return z(t,ae)}if(t.nodeType==3){Z=t.nodeValue;if(ad){X=O[W];Y=Z.substring(X);ab=Z.substring(0,X)}else{X=O[A];Y=Z.substring(0,X);ab=Z.substring(X)}if(ae!=F){t.nodeValue=ab}if(ae==j){return}ac=c.clone(t,S);ac.nodeValue=Y;return ac}if(ae==j){return}return c.clone(t,S)}function z(X,t){if(t!=j){return t==F?c.clone(X,E):X}X.parentNode.removeChild(X)}function T(){return c.create("body",null,d()).outerText}return O}a.Range=b;b.prototype.toString=function(){return this.toStringIE()}})(tinymce.dom);(function(){function a(d){var b=this,h=d.dom,c=true,f=false;function e(i,j){var k,t=0,q,n,m,l,o,r,p=-1,s;k=i.duplicate();k.collapse(j);s=k.parentElement();if(s.ownerDocument!==d.dom.doc){return}while(s.contentEditable==="false"){s=s.parentNode}if(!s.hasChildNodes()){return{node:s,inside:1}}m=s.children;q=m.length-1;while(t<=q){r=Math.floor((t+q)/2);l=m[r];k.moveToElementText(l);p=k.compareEndPoints(j?"StartToStart":"EndToEnd",i);if(p>0){q=r-1}else{if(p<0){t=r+1}else{return{node:l}}}}if(p<0){if(!l){k.moveToElementText(s);k.collapse(true);l=s;n=true}else{k.collapse(false)}o=0;while(k.compareEndPoints(j?"StartToStart":"StartToEnd",i)!==0){if(k.move("character",1)===0||s!=k.parentElement()){break}o++}}else{k.collapse(true);o=0;while(k.compareEndPoints(j?"StartToStart":"StartToEnd",i)!==0){if(k.move("character",-1)===0||s!=k.parentElement()){break}o++}}return{node:l,position:p,offset:o,inside:n}}function g(){var i=d.getRng(),r=h.createRng(),l,k,p,q,m,j;l=i.item?i.item(0):i.parentElement();if(l.ownerDocument!=h.doc){return r}k=d.isCollapsed();if(i.item){r.setStart(l.parentNode,h.nodeIndex(l));r.setEnd(r.startContainer,r.startOffset+1);return r}function o(A){var u=e(i,A),s,y,z=0,x,v,t;s=u.node;y=u.offset;if(u.inside&&!s.hasChildNodes()){r[A?"setStart":"setEnd"](s,0);return}if(y===v){r[A?"setStartBefore":"setEndAfter"](s);return}if(u.position<0){x=u.inside?s.firstChild:s.nextSibling;if(!x){r[A?"setStartAfter":"setEndAfter"](s);return}if(!y){if(x.nodeType==3){r[A?"setStart":"setEnd"](x,0)}else{r[A?"setStartBefore":"setEndBefore"](x)}return}while(x){t=x.nodeValue;z+=t.length;if(z>=y){s=x;z-=y;z=t.length-z;break}x=x.nextSibling}}else{x=s.previousSibling;if(!x){return r[A?"setStartBefore":"setEndBefore"](s)}if(!y){if(s.nodeType==3){r[A?"setStart":"setEnd"](x,s.nodeValue.length)}else{r[A?"setStartAfter":"setEndAfter"](x)}return}while(x){z+=x.nodeValue.length;if(z>=y){s=x;z-=y;break}x=x.previousSibling}}r[A?"setStart":"setEnd"](s,z)}try{o(true);if(!k){o()}}catch(n){if(n.number==-2147024809){m=b.getBookmark(2);p=i.duplicate();p.collapse(true);l=p.parentElement();if(!k){p=i.duplicate();p.collapse(false);q=p.parentElement();q.innerHTML=q.innerHTML}l.innerHTML=l.innerHTML;b.moveToBookmark(m);i=d.getRng();o(true);if(!k){o()}}else{throw n}}return r}this.getBookmark=function(m){var j=d.getRng(),o,i,l={};function n(u){var t,p,s,r,q=[];t=u.parentNode;p=h.getRoot().parentNode;while(t!=p&&t.nodeType!==9){s=t.children;r=s.length;while(r--){if(u===s[r]){q.push(r);break}}u=t;t=t.parentNode}return q}function k(q){var p;p=e(j,q);if(p){return{position:p.position,offset:p.offset,indexes:n(p.node),inside:p.inside}}}if(m===2){if(!j.item){l.start=k(true);if(!d.isCollapsed()){l.end=k()}}else{l.start={ctrl:true,indexes:n(j.item(0))}}}return l};this.moveToBookmark=function(k){var j,i=h.doc.body;function m(o){var r,q,n,p;r=h.getRoot();for(q=o.length-1;q>=0;q--){p=r.children;n=o[q];if(n<=p.length-1){r=p[n]}}return r}function l(r){var n=k[r?"start":"end"],q,p,o;if(n){q=n.position>0;p=i.createTextRange();p.moveToElementText(m(n.indexes));offset=n.offset;if(offset!==o){p.collapse(n.inside||q);p.moveStart("character",q?-offset:offset)}else{p.collapse(r)}j.setEndPoint(r?"StartToStart":"EndToStart",p);if(r){j.collapse(true)}}}if(k.start){if(k.start.ctrl){j=i.createControlRange();j.addElement(m(k.start.indexes));j.select()}else{j=i.createTextRange();l(true);l();j.select()}}};this.addRange=function(i){var n,l,k,p,t,q,s,r=d.dom.doc,m=r.body;function j(A){var v,z,u,y,x;u=h.create("a");v=A?k:t;z=A?p:q;y=n.duplicate();if(v==r||v==r.documentElement){v=m;z=0}if(v.nodeType==3){v.parentNode.insertBefore(u,v);y.moveToElementText(u);y.moveStart("character",z);h.remove(u);n.setEndPoint(A?"StartToStart":"EndToEnd",y)}else{x=v.childNodes;if(x.length){if(z>=x.length){h.insertAfter(u,x[x.length-1])}else{v.insertBefore(u,x[z])}y.moveToElementText(u)}else{if(v.canHaveHTML){v.innerHTML="\uFEFF";u=v.firstChild;y.moveToElementText(u);y.collapse(f)}}n.setEndPoint(A?"StartToStart":"EndToEnd",y);h.remove(u)}}k=i.startContainer;p=i.startOffset;t=i.endContainer;q=i.endOffset;n=m.createTextRange();if(k==t&&k.nodeType==1){if(p==q&&!k.hasChildNodes()){if(k.canHaveHTML){s=k.previousSibling;if(s&&!s.hasChildNodes()&&h.isBlock(s)){s.innerHTML="\uFEFF"}else{s=null}k.innerHTML="\uFEFF\uFEFF";n.moveToElementText(k.lastChild);n.select();h.doc.selection.clear();k.innerHTML="";if(s){s.innerHTML=""}return}else{p=h.nodeIndex(k);k=k.parentNode}}if(p==q-1){try{l=m.createControlRange();l.addElement(k.childNodes[p]);l.select();return}catch(o){}}}j(true);j();n.select()};this.getRangeAt=g}tinymce.dom.TridentSelection=a})();(function(){var n=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,i="sizcache",o=0,r=Object.prototype.toString,h=false,g=true,q=/\\/g,u=/\r\n/g,x=/\W/;[0,0].sort(function(){g=false;return 0});var d=function(C,e,F,G){F=F||[];e=e||document;var I=e;if(e.nodeType!==1&&e.nodeType!==9){return[]}if(!C||typeof C!=="string"){return F}var z,K,N,y,J,M,L,E,B=true,A=d.isXML(e),D=[],H=C;do{n.exec("");z=n.exec(H);if(z){H=z[3];D.push(z[1]);if(z[2]){y=z[3];break}}}while(z);if(D.length>1&&j.exec(C)){if(D.length===2&&k.relative[D[0]]){K=s(D[0]+D[1],e,G)}else{K=k.relative[D[0]]?[e]:d(D.shift(),e);while(D.length){C=D.shift();if(k.relative[C]){C+=D.shift()}K=s(C,K,G)}}}else{if(!G&&D.length>1&&e.nodeType===9&&!A&&k.match.ID.test(D[0])&&!k.match.ID.test(D[D.length-1])){J=d.find(D.shift(),e,A);e=J.expr?d.filter(J.expr,J.set)[0]:J.set[0]}if(e){J=G?{expr:D.pop(),set:l(G)}:d.find(D.pop(),D.length===1&&(D[0]==="~"||D[0]==="+")&&e.parentNode?e.parentNode:e,A);K=J.expr?d.filter(J.expr,J.set):J.set;if(D.length>0){N=l(K)}else{B=false}while(D.length){M=D.pop();L=M;if(!k.relative[M]){M=""}else{L=D.pop()}if(L==null){L=e}k.relative[M](N,L,A)}}else{N=D=[]}}if(!N){N=K}if(!N){d.error(M||C)}if(r.call(N)==="[object Array]"){if(!B){F.push.apply(F,N)}else{if(e&&e.nodeType===1){for(E=0;N[E]!=null;E++){if(N[E]&&(N[E]===true||N[E].nodeType===1&&d.contains(e,N[E]))){F.push(K[E])}}}else{for(E=0;N[E]!=null;E++){if(N[E]&&N[E].nodeType===1){F.push(K[E])}}}}}else{l(N,F)}if(y){d(y,I,F,G);d.uniqueSort(F)}return F};d.uniqueSort=function(y){if(p){h=g;y.sort(p);if(h){for(var e=1;e0};d.find=function(E,e,F){var D,z,B,A,C,y;if(!E){return[]}for(z=0,B=k.order.length;z":function(D,y){var C,B=typeof y==="string",z=0,e=D.length;if(B&&!x.test(y)){y=y.toLowerCase();for(;z=0)){if(!z){e.push(C)}}else{if(z){y[B]=false}}}}return false},ID:function(e){return e[1].replace(q,"")},TAG:function(y,e){return y[1].replace(q,"").toLowerCase()},CHILD:function(e){if(e[1]==="nth"){if(!e[2]){d.error(e[0])}e[2]=e[2].replace(/^\+|\s*/g,"");var y=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(e[2]==="even"&&"2n"||e[2]==="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(y[1]+(y[2]||1))-0;e[3]=y[3]-0}else{if(e[2]){d.error(e[0])}}e[0]=o++;return e},ATTR:function(B,y,z,e,C,D){var A=B[1]=B[1].replace(q,"");if(!D&&k.attrMap[A]){B[1]=k.attrMap[A]}B[4]=(B[4]||B[5]||"").replace(q,"");if(B[2]==="~="){B[4]=" "+B[4]+" "}return B},PSEUDO:function(B,y,z,e,C){if(B[1]==="not"){if((n.exec(B[3])||"").length>1||/^\w/.test(B[3])){B[3]=d(B[3],null,null,y)}else{var A=d.filter(B[3],y,z,true^C);if(!z){e.push.apply(e,A)}return false}}else{if(k.match.POS.test(B[0])||k.match.CHILD.test(B[0])){return true}}return B},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){if(e.parentNode){e.parentNode.selectedIndex}return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(z,y,e){return !!d(e[3],z).length},header:function(e){return(/h\d/i).test(e.nodeName)},text:function(z){var e=z.getAttribute("type"),y=z.type;return z.nodeName.toLowerCase()==="input"&&"text"===y&&(e===y||e===null)},radio:function(e){return e.nodeName.toLowerCase()==="input"&&"radio"===e.type},checkbox:function(e){return e.nodeName.toLowerCase()==="input"&&"checkbox"===e.type},file:function(e){return e.nodeName.toLowerCase()==="input"&&"file"===e.type},password:function(e){return e.nodeName.toLowerCase()==="input"&&"password"===e.type},submit:function(y){var e=y.nodeName.toLowerCase();return(e==="input"||e==="button")&&"submit"===y.type},image:function(e){return e.nodeName.toLowerCase()==="input"&&"image"===e.type},reset:function(y){var e=y.nodeName.toLowerCase();return(e==="input"||e==="button")&&"reset"===y.type},button:function(y){var e=y.nodeName.toLowerCase();return e==="input"&&"button"===y.type||e==="button"},input:function(e){return(/input|select|textarea|button/i).test(e.nodeName)},focus:function(e){return e===e.ownerDocument.activeElement}},setFilters:{first:function(y,e){return e===0},last:function(z,y,e,A){return y===A.length-1},even:function(y,e){return e%2===0},odd:function(y,e){return e%2===1},lt:function(z,y,e){return ye[3]-0},nth:function(z,y,e){return e[3]-0===y},eq:function(z,y,e){return e[3]-0===y}},filter:{PSEUDO:function(z,E,D,F){var e=E[1],y=k.filters[e];if(y){return y(z,D,E,F)}else{if(e==="contains"){return(z.textContent||z.innerText||b([z])||"").indexOf(E[3])>=0}else{if(e==="not"){var A=E[3];for(var C=0,B=A.length;C=0)}}},ID:function(y,e){return y.nodeType===1&&y.getAttribute("id")===e},TAG:function(y,e){return(e==="*"&&y.nodeType===1)||!!y.nodeName&&y.nodeName.toLowerCase()===e},CLASS:function(y,e){return(" "+(y.className||y.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(C,A){var z=A[1],e=d.attr?d.attr(C,z):k.attrHandle[z]?k.attrHandle[z](C):C[z]!=null?C[z]:C.getAttribute(z),D=e+"",B=A[2],y=A[4];return e==null?B==="!=":!B&&d.attr?e!=null:B==="="?D===y:B==="*="?D.indexOf(y)>=0:B==="~="?(" "+D+" ").indexOf(y)>=0:!y?D&&e!==false:B==="!="?D!==y:B==="^="?D.indexOf(y)===0:B==="$="?D.substr(D.length-y.length)===y:B==="|="?D===y||D.substr(0,y.length+1)===y+"-":false},POS:function(B,y,z,C){var e=y[2],A=k.setFilters[e];if(A){return A(B,z,y,C)}}}};var j=k.match.POS,c=function(y,e){return"\\"+(e-0+1)};for(var f in k.match){k.match[f]=new RegExp(k.match[f].source+(/(?![^\[]*\])(?![^\(]*\))/.source));k.leftMatch[f]=new RegExp(/(^(?:.|\r|\n)*?)/.source+k.match[f].source.replace(/\\(\d+)/g,c))}k.match.globalPOS=j;var l=function(y,e){y=Array.prototype.slice.call(y,0);if(e){e.push.apply(e,y);return e}return y};try{Array.prototype.slice.call(document.documentElement.childNodes,0)[0].nodeType}catch(v){l=function(B,A){var z=0,y=A||[];if(r.call(B)==="[object Array]"){Array.prototype.push.apply(y,B)}else{if(typeof B.length==="number"){for(var e=B.length;z";e.insertBefore(y,e.firstChild);if(document.getElementById(z)){k.find.ID=function(B,C,D){if(typeof C.getElementById!=="undefined"&&!D){var A=C.getElementById(B[1]);return A?A.id===B[1]||typeof A.getAttributeNode!=="undefined"&&A.getAttributeNode("id").nodeValue===B[1]?[A]:undefined:[]}};k.filter.ID=function(C,A){var B=typeof C.getAttributeNode!=="undefined"&&C.getAttributeNode("id");return C.nodeType===1&&B&&B.nodeValue===A}}e.removeChild(y);e=y=null})();(function(){var e=document.createElement("div");e.appendChild(document.createComment(""));if(e.getElementsByTagName("*").length>0){k.find.TAG=function(y,C){var B=C.getElementsByTagName(y[1]);if(y[1]==="*"){var A=[];for(var z=0;B[z];z++){if(B[z].nodeType===1){A.push(B[z])}}B=A}return B}}e.innerHTML="";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){k.attrHandle.href=function(y){return y.getAttribute("href",2)}}e=null})();if(document.querySelectorAll){(function(){var e=d,A=document.createElement("div"),z="__sizzle__";A.innerHTML="

                    ";if(A.querySelectorAll&&A.querySelectorAll(".TEST").length===0){return}d=function(L,C,G,K){C=C||document;if(!K&&!d.isXML(C)){var J=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(L);if(J&&(C.nodeType===1||C.nodeType===9)){if(J[1]){return l(C.getElementsByTagName(L),G)}else{if(J[2]&&k.find.CLASS&&C.getElementsByClassName){return l(C.getElementsByClassName(J[2]),G)}}}if(C.nodeType===9){if(L==="body"&&C.body){return l([C.body],G)}else{if(J&&J[3]){var F=C.getElementById(J[3]);if(F&&F.parentNode){if(F.id===J[3]){return l([F],G)}}else{return l([],G)}}}try{return l(C.querySelectorAll(L),G)}catch(H){}}else{if(C.nodeType===1&&C.nodeName.toLowerCase()!=="object"){var D=C,E=C.getAttribute("id"),B=E||z,N=C.parentNode,M=/^\s*[+~]/.test(L);if(!E){C.setAttribute("id",B)}else{B=B.replace(/'/g,"\\$&")}if(M&&N){C=C.parentNode}try{if(!M||N){return l(C.querySelectorAll("[id='"+B+"'] "+L),G)}}catch(I){}finally{if(!E){D.removeAttribute("id")}}}}}return e(L,C,G,K)};for(var y in e){d[y]=e[y]}A=null})()}(function(){var e=document.documentElement,z=e.matchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.msMatchesSelector;if(z){var B=!z.call(document.createElement("div"),"div"),y=false;try{z.call(document.documentElement,"[test!='']:sizzle")}catch(A){y=true}d.matchesSelector=function(D,F){F=F.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!d.isXML(D)){try{if(y||!k.match.PSEUDO.test(F)&&!/!=/.test(F)){var C=z.call(D,F);if(C||!B||D.document&&D.document.nodeType!==11){return C}}}catch(E){}}return d(F,null,null,[D]).length>0}}})();(function(){var e=document.createElement("div");e.innerHTML="
                    ";if(!e.getElementsByClassName||e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}k.order.splice(1,0,"CLASS");k.find.CLASS=function(y,z,A){if(typeof z.getElementsByClassName!=="undefined"&&!A){return z.getElementsByClassName(y[1])}};e=null})();function a(y,D,C,G,E,F){for(var A=0,z=G.length;A0){B=e;break}}}e=e[y]}G[A]=B}}}if(document.documentElement.contains){d.contains=function(y,e){return y!==e&&(y.contains?y.contains(e):true)}}else{if(document.documentElement.compareDocumentPosition){d.contains=function(y,e){return !!(y.compareDocumentPosition(e)&16)}}else{d.contains=function(){return false}}}d.isXML=function(e){var y=(e?e.ownerDocument||e:0).documentElement;return y?y.nodeName!=="HTML":false};var s=function(z,e,D){var C,E=[],B="",F=e.nodeType?[e]:e;while((C=k.match.PSEUDO.exec(z))){B+=C[0];z=z.replace(k.match.PSEUDO,"")}z=k.relative[z]?z+"*":z;for(var A=0,y=F.length;A"+(i.item?i.item(0).outerHTML:i.htmlText);m.removeChild(m.firstChild)}else{m.innerHTML=i.toString()}}if(/^\s/.test(m.innerHTML)){j=" "}if(/\s+$/.test(m.innerHTML)){l=" "}h.getInner=true;h.content=g.isCollapsed()?"":j+g.serializer.serialize(m,h)+l;g.onGetContent.dispatch(g,h);return h.content},setContent:function(h,j){var o=this,g=o.getRng(),k,l=o.win.document,n,m;j=j||{format:"html"};j.set=true;h=j.content=h;if(!j.no_events){o.onBeforeSetContent.dispatch(o,j)}h=j.content;if(g.insertNode){h+='_';if(g.startContainer==l&&g.endContainer==l){l.body.innerHTML=h}else{g.deleteContents();if(l.body.childNodes.length===0){l.body.innerHTML=h}else{if(g.createContextualFragment){g.insertNode(g.createContextualFragment(h))}else{n=l.createDocumentFragment();m=l.createElement("div");n.appendChild(m);m.outerHTML=h;g.insertNode(n)}}}k=o.dom.get("__caret");g=l.createRange();g.setStartBefore(k);g.setEndBefore(k);o.setRng(g);o.dom.remove("__caret");try{o.setRng(g)}catch(i){}}else{if(g.item){l.execCommand("Delete",false,null);g=o.getRng()}if(/^\s+/.test(h)){g.pasteHTML('_'+h);o.dom.remove("__mce_tmp")}else{g.pasteHTML(h)}}if(!j.no_events){o.onSetContent.dispatch(o,j)}},getStart:function(){var h=this.getRng(),i,g,k,j;if(h.duplicate||h.item){if(h.item){return h.item(0)}k=h.duplicate();k.collapse(1);i=k.parentElement();g=j=h.parentElement();while(j=j.parentNode){if(j==i){i=g;break}}return i}else{i=h.startContainer;if(i.nodeType==1&&i.hasChildNodes()){i=i.childNodes[Math.min(i.childNodes.length-1,h.startOffset)]}if(i&&i.nodeType==3){return i.parentNode}return i}},getEnd:function(){var h=this,i=h.getRng(),j,g;if(i.duplicate||i.item){if(i.item){return i.item(0)}i=i.duplicate();i.collapse(0);j=i.parentElement();if(j&&j.nodeName=="BODY"){return j.lastChild||j}return j}else{j=i.endContainer;g=i.endOffset;if(j.nodeType==1&&j.hasChildNodes()){j=j.childNodes[g>0?g-1:g]}if(j&&j.nodeType==3){return j.parentNode}return j}},getBookmark:function(s,v){var y=this,n=y.dom,h,k,j,o,i,p,q,m="\uFEFF",x;function g(z,A){var t=0;e(n.select(z),function(C,B){if(C==A){t=B}});return t}function u(t){function z(E){var A,D,C,B=E?"start":"end";A=t[B+"Container"];D=t[B+"Offset"];if(A.nodeType==1&&A.nodeName=="TR"){C=A.childNodes;A=C[Math.min(E?D:D-1,C.length-1)];if(A){D=E?0:A.childNodes.length;t["set"+(E?"Start":"End")](A,D)}}}z(true);z();return t}function l(){var z=y.getRng(true),t=n.getRoot(),A={};function B(E,J){var D=E[J?"startContainer":"endContainer"],I=E[J?"startOffset":"endOffset"],C=[],F,H,G=0;if(D.nodeType==3){if(v){for(F=D.previousSibling;F&&F.nodeType==3;F=F.previousSibling){I+=F.nodeValue.length}}C.push(I)}else{H=D.childNodes;if(I>=H.length&&H.length){G=1;I=Math.max(0,H.length-1)}C.push(y.dom.nodeIndex(H[I],v)+G)}for(;D&&D!=t;D=D.parentNode){C.push(y.dom.nodeIndex(D,v))}return C}A.start=B(z,true);if(!y.isCollapsed()){A.end=B(z)}return A}if(s==2){if(y.tridentSel){return y.tridentSel.getBookmark(s)}return l()}if(s){return{rng:y.getRng()}}h=y.getRng();j=n.uniqueId();o=tinyMCE.activeEditor.selection.isCollapsed();x="overflow:hidden;line-height:0px";if(h.duplicate||h.item){if(!h.item){k=h.duplicate();try{h.collapse();h.pasteHTML(''+m+"");if(!o){k.collapse(false);h.moveToElementText(k.parentElement());if(h.compareEndPoints("StartToEnd",k)===0){k.move("character",-1)}k.pasteHTML(''+m+"")}}catch(r){return null}}else{p=h.item(0);i=p.nodeName;return{name:i,index:g(i,p)}}}else{p=y.getNode();i=p.nodeName;if(i=="IMG"){return{name:i,index:g(i,p)}}k=u(h.cloneRange());if(!o){k.collapse(false);k.insertNode(n.create("span",{"data-mce-type":"bookmark",id:j+"_end",style:x},m))}h=u(h);h.collapse(true);h.insertNode(n.create("span",{"data-mce-type":"bookmark",id:j+"_start",style:x},m))}y.moveToBookmark({id:j,keep:1});return{id:j}},moveToBookmark:function(o){var s=this,m=s.dom,j,i,g,r,k,u,p,q;function h(A){var t=o[A?"start":"end"],x,y,z,v;if(t){z=t[0];for(y=r,x=t.length-1;x>=1;x--){v=y.childNodes;if(t[x]>v.length-1){return}y=v[t[x]]}if(y.nodeType===3){z=Math.min(t[0],y.nodeValue.length)}if(y.nodeType===1){z=Math.min(t[0],y.childNodes.length)}if(A){g.setStart(y,z)}else{g.setEnd(y,z)}}return true}function l(B){var v=m.get(o.id+"_"+B),A,t,y,z,x=o.keep;if(v){A=v.parentNode;if(B=="start"){if(!x){t=m.nodeIndex(v)}else{A=v.firstChild;t=1}k=u=A;p=q=t}else{if(!x){t=m.nodeIndex(v)}else{A=v.firstChild;t=1}u=A;q=t}if(!x){z=v.previousSibling;y=v.nextSibling;e(d.grep(v.childNodes),function(C){if(C.nodeType==3){C.nodeValue=C.nodeValue.replace(/\uFEFF/g,"")}});while(v=m.get(o.id+"_"+B)){m.remove(v,1)}if(z&&y&&z.nodeType==y.nodeType&&z.nodeType==3&&!d.isOpera){t=z.nodeValue.length;z.appendData(y.nodeValue);m.remove(y);if(B=="start"){k=u=z;p=q=t}else{u=z;q=t}}}}}function n(t){if(m.isBlock(t)&&!t.innerHTML&&!b){t.innerHTML='
                    '}return t}if(o){if(o.start){g=m.createRng();r=m.getRoot();if(s.tridentSel){return s.tridentSel.moveToBookmark(o)}if(h(true)&&h()){s.setRng(g)}}else{if(o.id){l("start");l("end");if(k){g=m.createRng();g.setStart(n(k),p);g.setEnd(n(u),q);s.setRng(g)}}else{if(o.name){s.select(m.select(o.name)[o.index])}else{if(o.rng){s.setRng(o.rng)}}}}}},select:function(l,k){var j=this,m=j.dom,h=m.createRng(),g;function i(n,p){var o=new a(n,n);do{if(n.nodeType==3&&d.trim(n.nodeValue).length!==0){if(p){h.setStart(n,0)}else{h.setEnd(n,n.nodeValue.length)}return}if(n.nodeName=="BR"){if(p){h.setStartBefore(n)}else{h.setEndBefore(n)}return}}while(n=(p?o.next():o.prev()))}if(l){g=m.nodeIndex(l);h.setStart(l.parentNode,g);h.setEnd(l.parentNode,g+1);if(k){i(l,1);i(l)}j.setRng(h)}return l},isCollapsed:function(){var g=this,i=g.getRng(),h=g.getSel();if(!i||i.item){return false}if(i.compareEndPoints){return i.compareEndPoints("StartToEnd",i)===0}return !h||i.collapsed},collapse:function(g){var i=this,h=i.getRng(),j;if(h.item){j=h.item(0);h=i.win.document.body.createTextRange();h.moveToElementText(j)}h.collapse(!!g);i.setRng(h)},getSel:function(){var h=this,g=this.win;return g.getSelection?g.getSelection():g.document.selection},getRng:function(m){var h=this,j,g,l,k=h.win.document;if(m&&h.tridentSel){return h.tridentSel.getRangeAt(0)}try{if(j=h.getSel()){g=j.rangeCount>0?j.getRangeAt(0):(j.createRange?j.createRange():k.createRange())}}catch(i){}if(d.isIE&&g&&g.setStart&&k.selection.createRange().item){l=k.selection.createRange().item(0);g=k.createRange();g.setStartBefore(l);g.setEndAfter(l)}if(!g){g=k.createRange?k.createRange():k.body.createTextRange()}if(g.setStart&&g.startContainer.nodeType===9&&g.collapsed){l=h.dom.getRoot();g.setStart(l,0);g.setEnd(l,0)}if(h.selectedRange&&h.explicitRange){if(g.compareBoundaryPoints(g.START_TO_START,h.selectedRange)===0&&g.compareBoundaryPoints(g.END_TO_END,h.selectedRange)===0){g=h.explicitRange}else{h.selectedRange=null;h.explicitRange=null}}return g},setRng:function(k,g){var j,i=this;if(!i.tridentSel){j=i.getSel();if(j){i.explicitRange=k;try{j.removeAllRanges()}catch(h){}j.addRange(k);if(g===false&&j.extend){j.collapse(k.endContainer,k.endOffset);j.extend(k.startContainer,k.startOffset)}i.selectedRange=j.rangeCount>0?j.getRangeAt(0):null}}else{if(k.cloneRange){try{i.tridentSel.addRange(k);return}catch(h){}}try{k.select()}catch(h){}}},setNode:function(h){var g=this;g.setContent(g.dom.getOuterHTML(h));return h},getNode:function(){var i=this,h=i.getRng(),j=i.getSel(),m,l=h.startContainer,g=h.endContainer;function k(q,o){var p=q;while(q&&q.nodeType===3&&q.length===0){q=o?q.nextSibling:q.previousSibling}return q||p}if(!h){return i.dom.getRoot()}if(h.setStart){m=h.commonAncestorContainer;if(!h.collapsed){if(h.startContainer==h.endContainer){if(h.endOffset-h.startOffset<2){if(h.startContainer.hasChildNodes()){m=h.startContainer.childNodes[h.startOffset]}}}if(l.nodeType===3&&g.nodeType===3){if(l.length===h.startOffset){l=k(l.nextSibling,true)}else{l=l.parentNode}if(h.endOffset===0){g=k(g.previousSibling,false)}else{g=g.parentNode}if(l&&l===g){return l}}}if(m&&m.nodeType==3){return m.parentNode}return m}return h.item?h.item(0):h.parentElement()},getSelectedBlocks:function(p,h){var o=this,k=o.dom,m,l,i,j=[];m=k.getParent(p||o.getStart(),k.isBlock);l=k.getParent(h||o.getEnd(),k.isBlock);if(m){j.push(m)}if(m&&l&&m!=l){i=m;var g=new a(m,k.getRoot());while((i=g.next())&&i!=l){if(k.isBlock(i)){j.push(i)}}}if(l&&m!=l){j.push(l)}return j},isForward:function(){var i=this.dom,g=this.getSel(),j,h;if(!g||g.anchorNode==null||g.focusNode==null){return true}j=i.createRng();j.setStart(g.anchorNode,g.anchorOffset);j.collapse(true);h=i.createRng();h.setStart(g.focusNode,g.focusOffset);h.collapse(true);return j.compareBoundaryPoints(j.START_TO_START,h)<=0},normalize:function(){var h=this,g,m,l,j,i;function k(p){var o,r,n,s=h.dom,u=s.getRoot(),q,t,v;function y(z,A){var B=new a(z,s.getParent(z.parentNode,s.isBlock)||u);while(z=B[A?"prev":"next"]()){if(z.nodeName==="BR"){return true}}}function x(B,z){var C,A;z=z||o;C=new a(z,s.getParent(z.parentNode,s.isBlock)||u);while(q=C[B?"prev":"next"]()){if(q.nodeType===3&&q.nodeValue.length>0){o=q;r=B?q.nodeValue.length:0;m=true;return}if(s.isBlock(q)||t[q.nodeName.toLowerCase()]){return}A=q}if(l&&A){o=A;m=true;r=0}}o=g[(p?"start":"end")+"Container"];r=g[(p?"start":"end")+"Offset"];t=s.schema.getNonEmptyElements();if(o.nodeType===9){o=s.getRoot();r=0}if(o===u){if(p){q=o.childNodes[r>0?r-1:0];if(q){v=q.nodeName.toLowerCase();if(t[q.nodeName]||q.nodeName=="TABLE"){return}}}if(o.hasChildNodes()){o=o.childNodes[Math.min(!p&&r>0?r-1:r,o.childNodes.length-1)];r=0;if(o.hasChildNodes()&&!/TABLE/.test(o.nodeName)){q=o;n=new a(o,u);do{if(q.nodeType===3&&q.nodeValue.length>0){r=p?0:q.nodeValue.length;o=q;m=true;break}if(t[q.nodeName.toLowerCase()]){r=s.nodeIndex(q);o=q.parentNode;if(q.nodeName=="IMG"&&!p){r++}m=true;break}}while(q=(p?n.next():n.prev()))}}}if(l){if(o.nodeType===3&&r===0){x(true)}if(o.nodeType===1){q=o.childNodes[r];if(q&&q.nodeName==="BR"&&!y(q)&&!y(q,true)){x(true,o.childNodes[r])}}}if(p&&!l&&o.nodeType===3&&r===o.nodeValue.length){x(false)}if(m){g["set"+(p?"Start":"End")](o,r)}}if(d.isIE){return}g=h.getRng();l=g.collapsed;k(true);if(!l){k()}if(m){if(l){g.collapse(true)}h.setRng(g,h.isForward())}},destroy:function(h){var g=this;g.win=null;if(!h){d.removeUnload(g.destroy)}},_fixIESelection:function(){var h=this.dom,n=h.doc,i=n.body,k,o,g;function j(p,s){var q=i.createTextRange();try{q.moveToPoint(p,s)}catch(r){q=null}return q}function m(q){var p;if(q.button){p=j(q.x,q.y);if(p){if(p.compareEndPoints("StartToStart",o)>0){p.setEndPoint("StartToStart",o)}else{p.setEndPoint("EndToEnd",o)}p.select()}}else{l()}}function l(){var p=n.selection.createRange();if(o&&!p.item&&p.compareEndPoints("StartToEnd",p)===0){o.select()}h.unbind(n,"mouseup",l);h.unbind(n,"mousemove",m);o=k=0}n.documentElement.unselectable=true;h.bind(n,["mousedown","contextmenu"],function(p){if(p.target.nodeName==="HTML"){if(k){l()}g=n.documentElement;if(g.scrollHeight>g.clientHeight){return}k=1;o=j(p.x,p.y);if(o){h.bind(n,"mouseup",l);h.bind(n,"mousemove",m);h.win.focus();o.select()}}})}})})(tinymce);(function(a){a.dom.Serializer=function(e,i,f){var h,b,d=a.isIE,g=a.each,c;if(!e.apply_source_formatting){e.indent=false}i=i||a.DOM;f=f||new a.html.Schema(e);e.entity_encoding=e.entity_encoding||"named";e.remove_trailing_brs="remove_trailing_brs" in e?e.remove_trailing_brs:true;h=new a.util.Dispatcher(self);b=new a.util.Dispatcher(self);c=new a.html.DomParser(e,f);c.addAttributeFilter("src,href,style",function(k,j){var o=k.length,l,q,n="data-mce-"+j,p=e.url_converter,r=e.url_converter_scope,m;while(o--){l=k[o];q=l.attributes.map[n];if(q!==m){l.attr(j,q.length>0?q:null);l.attr(n,null)}else{q=l.attributes.map[j];if(j==="style"){q=i.serializeStyle(i.parseStyle(q),l.name)}else{if(p){q=p.call(r,q,j,l.name)}}l.attr(j,q.length>0?q:null)}}});c.addAttributeFilter("class",function(j,k){var l=j.length,m,n;while(l--){m=j[l];n=m.attr("class").replace(/(?:^|\s)mce(Item\w+|Selected)(?!\S)/g,"");m.attr("class",n.length>0?n:null)}});c.addAttributeFilter("data-mce-type",function(j,l,k){var m=j.length,n;while(m--){n=j[m];if(n.attributes.map["data-mce-type"]==="bookmark"&&!k.cleanup){n.remove()}}});c.addAttributeFilter("data-mce-expando",function(j,l,k){var m=j.length;while(m--){j[m].attr(l,null)}});c.addNodeFilter("script,style",function(k,l){var m=k.length,n,o;function j(p){return p.replace(/()/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*(()?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")}while(m--){n=k[m];o=n.firstChild?n.firstChild.value:"";if(l==="script"){n.attr("type",(n.attr("type")||"text/javascript").replace(/^mce\-/,""));if(o.length>0){n.firstChild.value="// "}}else{if(o.length>0){n.firstChild.value=""}}}});c.addNodeFilter("#comment",function(j,k){var l=j.length,m;while(l--){m=j[l];if(m.value.indexOf("[CDATA[")===0){m.name="#cdata";m.type=4;m.value=m.value.replace(/^\[CDATA\[|\]\]$/g,"")}else{if(m.value.indexOf("mce:protected ")===0){m.name="#text";m.type=3;m.raw=true;m.value=unescape(m.value).substr(14)}}}});c.addNodeFilter("xml:namespace,input",function(j,k){var l=j.length,m;while(l--){m=j[l];if(m.type===7){m.remove()}else{if(m.type===1){if(k==="input"&&!("type" in m.attributes.map)){m.attr("type","text")}}}}});if(e.fix_list_elements){c.addNodeFilter("ul,ol",function(k,l){var m=k.length,n,j;while(m--){n=k[m];j=n.parent;if(j.name==="ul"||j.name==="ol"){if(n.prev&&n.prev.name==="li"){n.prev.append(n)}}}})}c.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style",function(j,k){var l=j.length;while(l--){j[l].attr(k,null)}});return{schema:f,addNodeFilter:c.addNodeFilter,addAttributeFilter:c.addAttributeFilter,onPreProcess:h,onPostProcess:b,serialize:function(o,m){var l,p,k,j,n;if(d&&i.select("script,style,select,map").length>0){n=o.innerHTML;o=o.cloneNode(false);i.setHTML(o,n)}else{o=o.cloneNode(true)}l=o.ownerDocument.implementation;if(l.createHTMLDocument){p=l.createHTMLDocument("");g(o.nodeName=="BODY"?o.childNodes:[o],function(q){p.body.appendChild(p.importNode(q,true))});if(o.nodeName!="BODY"){o=p.body.firstChild}else{o=p.body}k=i.doc;i.doc=p}m=m||{};m.format=m.format||"html";if(!m.no_events){m.node=o;h.dispatch(self,m)}j=new a.html.Serializer(e,f);m.content=j.serialize(c.parse(a.trim(m.getInner?o.innerHTML:i.getOuterHTML(o)),m));if(!m.cleanup){m.content=m.content.replace(/\uFEFF|\u200B/g,"")}if(!m.no_events){b.dispatch(self,m)}if(k){i.doc=k}m.node=null;return m.content},addRules:function(j){f.addValidElements(j)},setRules:function(j){f.setValidElements(j)}}}})(tinymce);(function(a){a.dom.ScriptLoader=function(h){var c=0,k=1,i=2,l={},j=[],e={},d=[],g=0,f;function b(m,v){var x=this,q=a.DOM,s,o,r,n;function p(){q.remove(n);if(s){s.onreadystatechange=s.onload=s=null}v()}function u(){if(typeof(console)!=="undefined"&&console.log){console.log("Failed to load: "+m)}}n=q.uniqueId();if(a.isIE6){o=new a.util.URI(m);r=location;if(o.host==r.hostname&&o.port==r.port&&(o.protocol+":")==r.protocol&&o.protocol.toLowerCase()!="file"){a.util.XHR.send({url:a._addVer(o.getURI()),success:function(y){var t=q.create("script",{type:"text/javascript"});t.text=y;document.getElementsByTagName("head")[0].appendChild(t);q.remove(t);p()},error:u});return}}s=document.createElement("script");s.id=n;s.type="text/javascript";s.src=a._addVer(m);if(!a.isIE){s.onload=p}s.onerror=u;if(!a.isOpera){s.onreadystatechange=function(){var t=s.readyState;if(t=="complete"||t=="loaded"){p()}}}(document.getElementsByTagName("head")[0]||document.body).appendChild(s)}this.isDone=function(m){return l[m]==i};this.markDone=function(m){l[m]=i};this.add=this.load=function(m,q,n){var o,p=l[m];if(p==f){j.push(m);l[m]=c}if(q){if(!e[m]){e[m]=[]}e[m].push({func:q,scope:n||this})}};this.loadQueue=function(n,m){this.loadScripts(j,n,m)};this.loadScripts=function(m,q,p){var o;function n(r){a.each(e[r],function(s){s.func.call(s.scope)});e[r]=f}d.push({func:q,scope:p||this});o=function(){var r=a.grep(m);m.length=0;a.each(r,function(s){if(l[s]==i){n(s);return}if(l[s]!=k){l[s]=k;g++;b(s,function(){l[s]=i;g--;n(s);o()})}});if(!g){a.each(d,function(s){s.func.call(s.scope)});d.length=0}};o()}};a.ScriptLoader=new a.dom.ScriptLoader()})(tinymce);(function(a){a.dom.RangeUtils=function(c){var b="\uFEFF";this.walk=function(d,s){var i=d.startContainer,l=d.startOffset,t=d.endContainer,m=d.endOffset,j,g,o,h,r,q,e;e=c.select("td.mceSelected,th.mceSelected");if(e.length>0){a.each(e,function(u){s([u])});return}function f(u){var v;v=u[0];if(v.nodeType===3&&v===i&&l>=v.nodeValue.length){u.splice(0,1)}v=u[u.length-1];if(m===0&&u.length>0&&v===t&&v.nodeType===3){u.splice(u.length-1,1)}return u}function p(x,v,u){var y=[];for(;x&&x!=u;x=x[v]){y.push(x)}return y}function n(v,u){do{if(v.parentNode==u){return v}v=v.parentNode}while(v)}function k(x,v,y){var u=y?"nextSibling":"previousSibling";for(h=x,r=h.parentNode;h&&h!=v;h=r){r=h.parentNode;q=p(h==x?h:h[u],u);if(q.length){if(!y){q.reverse()}s(f(q))}}}if(i.nodeType==1&&i.hasChildNodes()){i=i.childNodes[l]}if(t.nodeType==1&&t.hasChildNodes()){t=t.childNodes[Math.min(m-1,t.childNodes.length-1)]}if(i==t){return s(f([i]))}j=c.findCommonAncestor(i,t);for(h=i;h;h=h.parentNode){if(h===t){return k(i,j,true)}if(h===j){break}}for(h=t;h;h=h.parentNode){if(h===i){return k(t,j)}if(h===j){break}}g=n(i,j)||i;o=n(t,j)||t;k(i,g,true);q=p(g==i?g:g.nextSibling,"nextSibling",o==t?o.nextSibling:o);if(q.length){s(f(q))}k(t,o)};this.split=function(e){var h=e.startContainer,d=e.startOffset,i=e.endContainer,g=e.endOffset;function f(j,k){return j.splitText(k)}if(h==i&&h.nodeType==3){if(d>0&&dd){g=g-d;h=i=f(i,g).previousSibling;g=i.nodeValue.length;d=0}else{g=0}}}else{if(h.nodeType==3&&d>0&&d0&&g=m.length){r=0}}t=m[r];f.setAttrib(g,"tabindex","-1");f.setAttrib(t.id,"tabindex","0");f.get(t.id).focus();if(e.actOnFocus){e.onAction(t.id)}if(s){a.cancel(s)}};p=function(z){var v=37,u=39,y=38,A=40,r=27,t=14,s=13,x=32;switch(z.keyCode){case v:if(i){q.moveFocus(-1)}break;case u:if(i){q.moveFocus(1)}break;case y:if(o){q.moveFocus(-1)}break;case A:if(o){q.moveFocus(1)}break;case r:if(e.onCancel){e.onCancel();a.cancel(z)}break;case t:case s:case x:if(e.onAction){e.onAction(g);a.cancel(z)}break}};c(m,function(t,r){var s,u;if(!t.id){t.id=f.uniqueId("_mce_item_")}u=f.get(t.id);if(l){f.bind(u,"blur",h);s="-1"}else{s=(r===0?"0":"-1")}u.setAttribute("tabindex",s);f.bind(u,"focus",k)});if(m[0]){g=m[0].id}f.setAttrib(n,"tabindex","-1");var j=f.get(n);f.bind(j,"focus",d);f.bind(j,"keydown",p)}})})(tinymce);(function(c){var b=c.DOM,a=c.is;c.create("tinymce.ui.Control",{Control:function(f,e,d){this.id=f;this.settings=e=e||{};this.rendered=false;this.onRender=new c.util.Dispatcher(this);this.classPrefix="";this.scope=e.scope||this;this.disabled=0;this.active=0;this.editor=d},setAriaProperty:function(f,e){var d=b.get(this.id+"_aria")||b.get(this.id);if(d){b.setAttrib(d,"aria-"+f,!!e)}},focus:function(){b.get(this.id).focus()},setDisabled:function(d){if(d!=this.disabled){this.setAriaProperty("disabled",d);this.setState("Disabled",d);this.setState("Enabled",!d);this.disabled=d}},isDisabled:function(){return this.disabled},setActive:function(d){if(d!=this.active){this.setState("Active",d);this.active=d;this.setAriaProperty("pressed",d)}},isActive:function(){return this.active},setState:function(f,d){var e=b.get(this.id);f=this.classPrefix+f;if(d){b.addClass(e,f)}else{b.removeClass(e,f)}},isRendered:function(){return this.rendered},renderHTML:function(){},renderTo:function(d){b.setHTML(d,this.renderHTML())},postRender:function(){var e=this,d;if(a(e.disabled)){d=e.disabled;e.disabled=-1;e.setDisabled(d)}if(a(e.active)){d=e.active;e.active=-1;e.setActive(d)}},remove:function(){b.remove(this.id);this.destroy()},destroy:function(){c.dom.Event.clear(this.id)}})})(tinymce);tinymce.create("tinymce.ui.Container:tinymce.ui.Control",{Container:function(c,b,a){this.parent(c,b,a);this.controls=[];this.lookup={}},add:function(a){this.lookup[a.id]=a;this.controls.push(a);return a},get:function(a){return this.lookup[a]}});tinymce.create("tinymce.ui.Separator:tinymce.ui.Control",{Separator:function(b,a){this.parent(b,a);this.classPrefix="mceSeparator";this.setDisabled(true)},renderHTML:function(){return tinymce.DOM.createHTML("span",{"class":this.classPrefix,role:"separator","aria-orientation":"vertical",tabindex:"-1"})}});(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.MenuItem:tinymce.ui.Control",{MenuItem:function(g,f){this.parent(g,f);this.classPrefix="mceMenuItem"},setSelected:function(f){this.setState("Selected",f);this.setAriaProperty("checked",!!f);this.selected=f},isSelected:function(){return this.selected},postRender:function(){var f=this;f.parent();if(c(f.selected)){f.setSelected(f.selected)}}})})(tinymce);(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.Menu:tinymce.ui.MenuItem",{Menu:function(h,g){var f=this;f.parent(h,g);f.items={};f.collapsed=false;f.menuCount=0;f.onAddItem=new d.util.Dispatcher(this)},expand:function(g){var f=this;if(g){a(f,function(h){if(h.expand){h.expand()}},"items",f)}f.collapsed=false},collapse:function(g){var f=this;if(g){a(f,function(h){if(h.collapse){h.collapse()}},"items",f)}f.collapsed=true},isCollapsed:function(){return this.collapsed},add:function(f){if(!f.settings){f=new d.ui.MenuItem(f.id||b.uniqueId(),f)}this.onAddItem.dispatch(this,f);return this.items[f.id]=f},addSeparator:function(){return this.add({separator:true})},addMenu:function(f){if(!f.collapse){f=this.createMenu(f)}this.menuCount++;return this.add(f)},hasMenus:function(){return this.menuCount!==0},remove:function(f){delete this.items[f.id]},removeAll:function(){var f=this;a(f,function(g){if(g.removeAll){g.removeAll()}else{g.remove()}g.destroy()},"items",f);f.items={}},createMenu:function(g){var f=new d.ui.Menu(g.id||b.uniqueId(),g);f.onAddItem.add(this.onAddItem.dispatch,this.onAddItem);return f}})})(tinymce);(function(e){var d=e.is,c=e.DOM,f=e.each,a=e.dom.Event,b=e.dom.Element;e.create("tinymce.ui.DropMenu:tinymce.ui.Menu",{DropMenu:function(h,g){g=g||{};g.container=g.container||c.doc.body;g.offset_x=g.offset_x||0;g.offset_y=g.offset_y||0;g.vp_offset_x=g.vp_offset_x||0;g.vp_offset_y=g.vp_offset_y||0;if(d(g.icons)&&!g.icons){g["class"]+=" mceNoIcons"}this.parent(h,g);this.onShowMenu=new e.util.Dispatcher(this);this.onHideMenu=new e.util.Dispatcher(this);this.classPrefix="mceMenu"},createMenu:function(j){var h=this,i=h.settings,g;j.container=j.container||i.container;j.parent=h;j.constrain=j.constrain||i.constrain;j["class"]=j["class"]||i["class"];j.vp_offset_x=j.vp_offset_x||i.vp_offset_x;j.vp_offset_y=j.vp_offset_y||i.vp_offset_y;j.keyboard_focus=i.keyboard_focus;g=new e.ui.DropMenu(j.id||c.uniqueId(),j);g.onAddItem.add(h.onAddItem.dispatch,h.onAddItem);return g},focus:function(){var g=this;if(g.keyboardNav){g.keyboardNav.focus()}},update:function(){var i=this,j=i.settings,g=c.get("menu_"+i.id+"_tbl"),l=c.get("menu_"+i.id+"_co"),h,k;h=j.max_width?Math.min(g.offsetWidth,j.max_width):g.offsetWidth;k=j.max_height?Math.min(g.offsetHeight,j.max_height):g.offsetHeight;if(!c.boxModel){i.element.setStyles({width:h+2,height:k+2})}else{i.element.setStyles({width:h,height:k})}if(j.max_width){c.setStyle(l,"width",h)}if(j.max_height){c.setStyle(l,"height",k);if(g.clientHeightv){p=r?r-u:Math.max(0,(v-A.vp_offset_x)-u)}if((n+A.vp_offset_y+l)>q){n=Math.max(0,(q-A.vp_offset_y)-l)}}c.setStyles(o,{left:p,top:n});z.element.update();z.isMenuVisible=1;z.mouseClickFunc=a.add(o,"click",function(s){var h;s=s.target;if(s&&(s=c.getParent(s,"tr"))&&!c.hasClass(s,m+"ItemSub")){h=z.items[s.id];if(h.isDisabled()){return}k=z;while(k){if(k.hideMenu){k.hideMenu()}k=k.settings.parent}if(h.settings.onclick){h.settings.onclick(s)}return false}});if(z.hasMenus()){z.mouseOverFunc=a.add(o,"mouseover",function(x){var h,t,s;x=x.target;if(x&&(x=c.getParent(x,"tr"))){h=z.items[x.id];if(z.lastMenu){z.lastMenu.collapse(1)}if(h.isDisabled()){return}if(x&&c.hasClass(x,m+"ItemSub")){t=c.getRect(x);h.showMenu((t.x+t.w-i),t.y-i,t.x);z.lastMenu=h;c.addClass(c.get(h.id).firstChild,m+"ItemActive")}}})}a.add(o,"keydown",z._keyHandler,z);z.onShowMenu.dispatch(z);if(A.keyboard_focus){z._setupKeyboardNav()}},hideMenu:function(j){var g=this,i=c.get("menu_"+g.id),h;if(!g.isMenuVisible){return}if(g.keyboardNav){g.keyboardNav.destroy()}a.remove(i,"mouseover",g.mouseOverFunc);a.remove(i,"click",g.mouseClickFunc);a.remove(i,"keydown",g._keyHandler);c.hide(i);g.isMenuVisible=0;if(!j){g.collapse(1)}if(g.element){g.element.hide()}if(h=c.get(g.id)){c.removeClass(h.firstChild,g.classPrefix+"ItemActive")}g.onHideMenu.dispatch(g)},add:function(i){var g=this,h;i=g.parent(i);if(g.isRendered&&(h=c.get("menu_"+g.id))){g._add(c.select("tbody",h)[0],i)}return i},collapse:function(g){this.parent(g);this.hideMenu(1)},remove:function(g){c.remove(g.id);this.destroy();return this.parent(g)},destroy:function(){var g=this,h=c.get("menu_"+g.id);if(g.keyboardNav){g.keyboardNav.destroy()}a.remove(h,"mouseover",g.mouseOverFunc);a.remove(c.select("a",h),"focus",g.mouseOverFunc);a.remove(h,"click",g.mouseClickFunc);a.remove(h,"keydown",g._keyHandler);if(g.element){g.element.remove()}c.remove(h)},renderNode:function(){var i=this,j=i.settings,l,h,k,g;g=c.create("div",{role:"listbox",id:"menu_"+i.id,"class":j["class"],style:"position:absolute;left:0;top:0;z-index:200000;outline:0"});if(i.settings.parent){c.setAttrib(g,"aria-parent","menu_"+i.settings.parent.id)}k=c.add(g,"div",{role:"presentation",id:"menu_"+i.id+"_co","class":i.classPrefix+(j["class"]?" "+j["class"]:"")});i.element=new b("menu_"+i.id,{blocker:1,container:j.container});if(j.menu_line){c.add(k,"span",{"class":i.classPrefix+"Line"})}l=c.add(k,"table",{role:"presentation",id:"menu_"+i.id+"_tbl",border:0,cellPadding:0,cellSpacing:0});h=c.add(l,"tbody");f(i.items,function(m){i._add(h,m)});i.rendered=true;return g},_setupKeyboardNav:function(){var i,h,g=this;i=c.get("menu_"+g.id);h=c.select("a[role=option]","menu_"+g.id);h.splice(0,0,i);g.keyboardNav=new e.ui.KeyboardNavigation({root:"menu_"+g.id,items:h,onCancel:function(){g.hideMenu()},enableUpDown:true});i.focus()},_keyHandler:function(g){var h=this,i;switch(g.keyCode){case 37:if(h.settings.parent){h.hideMenu();h.settings.parent.focus();a.cancel(g)}break;case 39:if(h.mouseOverFunc){h.mouseOverFunc(g)}break}},_add:function(j,h){var i,q=h.settings,p,l,k,m=this.classPrefix,g;if(q.separator){l=c.add(j,"tr",{id:h.id,"class":m+"ItemSeparator"});c.add(l,"td",{"class":m+"ItemSeparator"});if(i=l.previousSibling){c.addClass(i,"mceLast")}return}i=l=c.add(j,"tr",{id:h.id,"class":m+"Item "+m+"ItemEnabled"});i=k=c.add(i,q.titleItem?"th":"td");i=p=c.add(i,"a",{id:h.id+"_aria",role:q.titleItem?"presentation":"option",href:"javascript:;",onclick:"return false;",onmousedown:"return false;"});if(q.parent){c.setAttrib(p,"aria-haspopup","true");c.setAttrib(p,"aria-owns","menu_"+h.id)}c.addClass(k,q["class"]);g=c.add(i,"span",{"class":"mceIcon"+(q.icon?" mce_"+q.icon:"")});if(q.icon_src){c.add(g,"img",{src:q.icon_src})}i=c.add(i,q.element||"span",{"class":"mceText",title:h.settings.title},h.settings.title);if(h.settings.style){if(typeof h.settings.style=="function"){h.settings.style=h.settings.style()}c.setAttrib(i,"style",h.settings.style)}if(j.childNodes.length==1){c.addClass(l,"mceFirst")}if((i=l.previousSibling)&&c.hasClass(i,m+"ItemSeparator")){c.addClass(l,"mceFirst")}if(h.collapse){c.addClass(l,m+"ItemSub")}if(i=l.previousSibling){c.removeClass(i,"mceLast")}c.addClass(l,"mceLast")}})})(tinymce);(function(b){var a=b.DOM;b.create("tinymce.ui.Button:tinymce.ui.Control",{Button:function(e,d,c){this.parent(e,d,c);this.classPrefix="mceButton"},renderHTML:function(){var f=this.classPrefix,e=this.settings,d,c;c=a.encode(e.label||"");d='';if(e.image&&!(this.editor&&this.editor.forcedHighContrastMode)){d+=''+a.encode(e.title)+''+c}else{d+=''+(c?''+c+"":"")}d+='";d+="";return d},postRender:function(){var d=this,e=d.settings,c;if(b.isIE&&d.editor){b.dom.Event.add(d.id,"mousedown",function(f){var g=d.editor.selection.getNode().nodeName;c=g==="IMG"?d.editor.selection.getBookmark():null})}b.dom.Event.add(d.id,"click",function(f){if(!d.isDisabled()){if(b.isIE&&d.editor&&c!==null){d.editor.selection.moveToBookmark(c)}return e.onclick.call(e.scope,f)}});b.dom.Event.add(d.id,"keyup",function(f){if(!d.isDisabled()&&f.keyCode==b.VK.SPACEBAR){return e.onclick.call(e.scope,f)}})}})})(tinymce);(function(e){var d=e.DOM,b=e.dom.Event,f=e.each,a=e.util.Dispatcher,c;e.create("tinymce.ui.ListBox:tinymce.ui.Control",{ListBox:function(j,i,g){var h=this;h.parent(j,i,g);h.items=[];h.onChange=new a(h);h.onPostRender=new a(h);h.onAdd=new a(h);h.onRenderMenu=new e.util.Dispatcher(this);h.classPrefix="mceListBox";h.marked={}},select:function(h){var g=this,j,i;g.marked={};if(h==c){return g.selectByIndex(-1)}if(h&&typeof(h)=="function"){i=h}else{i=function(k){return k==h}}if(h!=g.selectedValue){f(g.items,function(l,k){if(i(l.value)){j=1;g.selectByIndex(k);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(g){var i=this,j,k,h;i.marked={};if(g!=i.selectedIndex){j=d.get(i.id+"_text");h=d.get(i.id+"_voiceDesc");k=i.items[g];if(k){i.selectedValue=k.value;i.selectedIndex=g;d.setHTML(j,d.encode(k.title));d.setHTML(h,i.settings.title+" - "+k.title);d.removeClass(j,"mceTitle");d.setAttrib(i.id,"aria-valuenow",k.title)}else{d.setHTML(j,d.encode(i.settings.title));d.setHTML(h,d.encode(i.settings.title));d.addClass(j,"mceTitle");i.selectedValue=i.selectedIndex=null;d.setAttrib(i.id,"aria-valuenow",i.settings.title)}j=0}},mark:function(g){this.marked[g]=true},add:function(j,g,i){var h=this;i=i||{};i=e.extend(i,{title:j,value:g});h.items.push(i);h.onAdd.dispatch(h,i)},getLength:function(){return this.items.length},renderHTML:function(){var j="",g=this,i=g.settings,k=g.classPrefix;j='';j+="";j+="";j+="";return j},showMenu:function(){var h=this,j,i=d.get(this.id),g;if(h.isDisabled()||h.items.length===0){return}if(h.menu&&h.menu.isMenuVisible){return h.hideMenu()}if(!h.isMenuRendered){h.renderMenu();h.isMenuRendered=true}j=d.getPos(i);g=h.menu;g.settings.offset_x=j.x;g.settings.offset_y=j.y;g.settings.keyboard_focus=!e.isOpera;f(h.items,function(k){if(g.items[k.id]){g.items[k.id].setSelected(0)}});f(h.items,function(k){if(g.items[k.id]&&h.marked[k.value]){g.items[k.id].setSelected(1)}if(k.value===h.selectedValue){g.items[k.id].setSelected(1)}});g.showMenu(0,i.clientHeight);b.add(d.doc,"mousedown",h.hideMenu,h);d.addClass(h.id,h.classPrefix+"Selected")},hideMenu:function(h){var g=this;if(g.menu&&g.menu.isMenuVisible){d.removeClass(g.id,g.classPrefix+"Selected");if(h&&h.type=="mousedown"&&(h.target.id==g.id+"_text"||h.target.id==g.id+"_open")){return}if(!h||!d.getParent(h.target,".mceMenu")){d.removeClass(g.id,g.classPrefix+"Selected");b.remove(d.doc,"mousedown",g.hideMenu,g);g.menu.hideMenu()}}},renderMenu:function(){var h=this,g;g=h.settings.control_manager.createDropMenu(h.id+"_menu",{menu_line:1,"class":h.classPrefix+"Menu mceNoIcons",max_width:250,max_height:150});g.onHideMenu.add(function(){h.hideMenu();h.focus()});g.add({title:h.settings.title,"class":"mceMenuItemTitle",onclick:function(){if(h.settings.onselect("")!==false){h.select("")}}});f(h.items,function(i){if(i.value===c){g.add({title:i.title,role:"option","class":"mceMenuItemTitle",onclick:function(){if(h.settings.onselect("")!==false){h.select("")}}})}else{i.id=d.uniqueId();i.role="option";i.onclick=function(){if(h.settings.onselect(i.value)!==false){h.select(i.value)}};g.add(i)}});h.onRenderMenu.dispatch(h,g);h.menu=g},postRender:function(){var g=this,h=g.classPrefix;b.add(g.id,"click",g.showMenu,g);b.add(g.id,"keydown",function(i){if(i.keyCode==32){g.showMenu(i);b.cancel(i)}});b.add(g.id,"focus",function(){if(!g._focused){g.keyDownHandler=b.add(g.id,"keydown",function(i){if(i.keyCode==40){g.showMenu();b.cancel(i)}});g.keyPressHandler=b.add(g.id,"keypress",function(j){var i;if(j.keyCode==13){i=g.selectedValue;g.selectedValue=null;b.cancel(j);g.settings.onselect(i)}})}g._focused=1});b.add(g.id,"blur",function(){b.remove(g.id,"keydown",g.keyDownHandler);b.remove(g.id,"keypress",g.keyPressHandler);g._focused=0});if(e.isIE6||!d.boxModel){b.add(g.id,"mouseover",function(){if(!d.hasClass(g.id,h+"Disabled")){d.addClass(g.id,h+"Hover")}});b.add(g.id,"mouseout",function(){if(!d.hasClass(g.id,h+"Disabled")){d.removeClass(g.id,h+"Hover")}})}g.onPostRender.dispatch(g,d.get(g.id))},destroy:function(){this.parent();b.clear(this.id+"_text");b.clear(this.id+"_open")}})})(tinymce);(function(e){var d=e.DOM,b=e.dom.Event,f=e.each,a=e.util.Dispatcher,c;e.create("tinymce.ui.NativeListBox:tinymce.ui.ListBox",{NativeListBox:function(h,g){this.parent(h,g);this.classPrefix="mceNativeListBox"},setDisabled:function(g){d.get(this.id).disabled=g;this.setAriaProperty("disabled",g)},isDisabled:function(){return d.get(this.id).disabled},select:function(h){var g=this,j,i;if(h==c){return g.selectByIndex(-1)}if(h&&typeof(h)=="function"){i=h}else{i=function(k){return k==h}}if(h!=g.selectedValue){f(g.items,function(l,k){if(i(l.value)){j=1;g.selectByIndex(k);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(g){d.get(this.id).selectedIndex=g+1;this.selectedValue=this.items[g]?this.items[g].value:null},add:function(k,h,g){var j,i=this;g=g||{};g.value=h;if(i.isRendered()){d.add(d.get(this.id),"option",g,k)}j={title:k,value:h,attribs:g};i.items.push(j);i.onAdd.dispatch(i,j)},getLength:function(){return this.items.length},renderHTML:function(){var i,g=this;i=d.createHTML("option",{value:""},"-- "+g.settings.title+" --");f(g.items,function(h){i+=d.createHTML("option",{value:h.value},h.title)});i=d.createHTML("select",{id:g.id,"class":"mceNativeListBox","aria-labelledby":g.id+"_aria"},i);i+=d.createHTML("span",{id:g.id+"_aria",style:"display: none"},g.settings.title);return i},postRender:function(){var h=this,i,j=true;h.rendered=true;function g(l){var k=h.items[l.target.selectedIndex-1];if(k&&(k=k.value)){h.onChange.dispatch(h,k);if(h.settings.onselect){h.settings.onselect(k)}}}b.add(h.id,"change",g);b.add(h.id,"keydown",function(l){var k;b.remove(h.id,"change",i);j=false;k=b.add(h.id,"blur",function(){if(j){return}j=true;b.add(h.id,"change",g);b.remove(h.id,"blur",k)});if(e.isWebKit&&(l.keyCode==37||l.keyCode==39)){return b.prevent(l)}if(l.keyCode==13||l.keyCode==32){g(l);return b.cancel(l)}});h.onPostRender.dispatch(h,d.get(h.id))}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.MenuButton:tinymce.ui.Button",{MenuButton:function(g,f,e){this.parent(g,f,e);this.onRenderMenu=new c.util.Dispatcher(this);f.menu_container=f.menu_container||b.doc.body},showMenu:function(){var g=this,j,i,h=b.get(g.id),f;if(g.isDisabled()){return}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}if(g.isMenuVisible){return g.hideMenu()}j=b.getPos(g.settings.menu_container);i=b.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.vp_offset_x=i.x;f.settings.vp_offset_y=i.y;f.settings.keyboard_focus=g._focused;f.showMenu(0,h.firstChild.clientHeight);a.add(b.doc,"mousedown",g.hideMenu,g);g.setState("Selected",1);g.isMenuVisible=1},renderMenu:function(){var f=this,e;e=f.settings.control_manager.createDropMenu(f.id+"_menu",{menu_line:1,"class":this.classPrefix+"Menu",icons:f.settings.icons});e.onHideMenu.add(function(){f.hideMenu();f.focus()});f.onRenderMenu.dispatch(f,e);f.menu=e},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&b.getParent(g.target,function(h){return h.id===f.id||h.id===f.id+"_open"})){return}if(!g||!b.getParent(g.target,".mceMenu")){f.setState("Selected",0);a.remove(b.doc,"mousedown",f.hideMenu,f);if(f.menu){f.menu.hideMenu()}}f.isMenuVisible=0},postRender:function(){var e=this,f=e.settings;a.add(e.id,"click",function(){if(!e.isDisabled()){if(f.onclick){f.onclick(e.value)}e.showMenu()}})}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.SplitButton:tinymce.ui.MenuButton",{SplitButton:function(g,f,e){this.parent(g,f,e);this.classPrefix="mceSplitButton"},renderHTML:function(){var i,f=this,g=f.settings,e;i="";if(g.image){e=b.createHTML("img ",{src:g.image,role:"presentation","class":"mceAction "+g["class"]})}else{e=b.createHTML("span",{"class":"mceAction "+g["class"]},"")}e+=b.createHTML("span",{"class":"mceVoiceLabel mceIconOnly",id:f.id+"_voice",style:"display:none;"},g.title);i+=""+b.createHTML("a",{role:"button",id:f.id+"_action",tabindex:"-1",href:"javascript:;","class":"mceAction "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"";e=b.createHTML("span",{"class":"mceOpen "+g["class"]},'');i+=""+b.createHTML("a",{role:"button",id:f.id+"_open",tabindex:"-1",href:"javascript:;","class":"mceOpen "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"";i+="";i=b.createHTML("table",{role:"presentation","class":"mceSplitButton mceSplitButtonEnabled "+g["class"],cellpadding:"0",cellspacing:"0",title:g.title},i);return b.createHTML("div",{id:f.id,role:"button",tabindex:"0","aria-labelledby":f.id+"_voice","aria-haspopup":"true"},i)},postRender:function(){var e=this,g=e.settings,f;if(g.onclick){f=function(h){if(!e.isDisabled()){g.onclick(e.value);a.cancel(h)}};a.add(e.id+"_action","click",f);a.add(e.id,["click","keydown"],function(h){var k=32,m=14,i=13,j=38,l=40;if((h.keyCode===32||h.keyCode===13||h.keyCode===14)&&!h.altKey&&!h.ctrlKey&&!h.metaKey){f();a.cancel(h)}else{if(h.type==="click"||h.keyCode===l){e.showMenu();a.cancel(h)}}})}a.add(e.id+"_open","click",function(h){e.showMenu();a.cancel(h)});a.add([e.id,e.id+"_open"],"focus",function(){e._focused=1});a.add([e.id,e.id+"_open"],"blur",function(){e._focused=0});if(c.isIE6||!b.boxModel){a.add(e.id,"mouseover",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.addClass(e.id,"mceSplitButtonHover")}});a.add(e.id,"mouseout",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.removeClass(e.id,"mceSplitButtonHover")}})}},destroy:function(){this.parent();a.clear(this.id+"_action");a.clear(this.id+"_open");a.clear(this.id)}})})(tinymce);(function(d){var c=d.DOM,a=d.dom.Event,b=d.is,e=d.each;d.create("tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton",{ColorSplitButton:function(i,h,f){var g=this;g.parent(i,h,f);g.settings=h=d.extend({colors:"000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF",grid_width:8,default_color:"#888888"},g.settings);g.onShowMenu=new d.util.Dispatcher(g);g.onHideMenu=new d.util.Dispatcher(g);g.value=h.default_color},showMenu:function(){var f=this,g,j,i,h;if(f.isDisabled()){return}if(!f.isMenuRendered){f.renderMenu();f.isMenuRendered=true}if(f.isMenuVisible){return f.hideMenu()}i=c.get(f.id);c.show(f.id+"_menu");c.addClass(i,"mceSplitButtonSelected");h=c.getPos(i);c.setStyles(f.id+"_menu",{left:h.x,top:h.y+i.firstChild.clientHeight,zIndex:200000});i=0;a.add(c.doc,"mousedown",f.hideMenu,f);f.onShowMenu.dispatch(f);if(f._focused){f._keyHandler=a.add(f.id+"_menu","keydown",function(k){if(k.keyCode==27){f.hideMenu()}});c.select("a",f.id+"_menu")[0].focus()}f.isMenuVisible=1},hideMenu:function(g){var f=this;if(f.isMenuVisible){if(g&&g.type=="mousedown"&&c.getParent(g.target,function(h){return h.id===f.id+"_open"})){return}if(!g||!c.getParent(g.target,".mceSplitButtonMenu")){c.removeClass(f.id,"mceSplitButtonSelected");a.remove(c.doc,"mousedown",f.hideMenu,f);a.remove(f.id+"_menu","keydown",f._keyHandler);c.hide(f.id+"_menu")}f.isMenuVisible=0;f.onHideMenu.dispatch()}},renderMenu:function(){var p=this,h,k=0,q=p.settings,g,j,l,o,f;o=c.add(q.menu_container,"div",{role:"listbox",id:p.id+"_menu","class":q.menu_class+" "+q["class"],style:"position:absolute;left:0;top:-1000px;"});h=c.add(o,"div",{"class":q["class"]+" mceSplitButtonMenu"});c.add(h,"span",{"class":"mceMenuLine"});g=c.add(h,"table",{role:"presentation","class":"mceColorSplitMenu"});j=c.add(g,"tbody");k=0;e(b(q.colors,"array")?q.colors:q.colors.split(","),function(m){m=m.replace(/^#/,"");if(!k--){l=c.add(j,"tr");k=q.grid_width-1}g=c.add(l,"td");var i={href:"javascript:;",style:{backgroundColor:"#"+m},title:p.editor.getLang("colors."+m,m),"data-mce-color":"#"+m};if(!d.isIE){i.role="option"}g=c.add(g,"a",i);if(p.editor.forcedHighContrastMode){g=c.add(g,"canvas",{width:16,height:16,"aria-hidden":"true"});if(g.getContext&&(f=g.getContext("2d"))){f.fillStyle="#"+m;f.fillRect(0,0,16,16)}else{c.remove(g)}}});if(q.more_colors_func){g=c.add(j,"tr");g=c.add(g,"td",{colspan:q.grid_width,"class":"mceMoreColors"});g=c.add(g,"a",{role:"option",id:p.id+"_more",href:"javascript:;",onclick:"return false;","class":"mceMoreColors"},q.more_colors_title);a.add(g,"click",function(i){q.more_colors_func.call(q.more_colors_scope||this);return a.cancel(i)})}c.addClass(h,"mceColorSplitMenu");new d.ui.KeyboardNavigation({root:p.id+"_menu",items:c.select("a",p.id+"_menu"),onCancel:function(){p.hideMenu();p.focus()}});a.add(p.id+"_menu","mousedown",function(i){return a.cancel(i)});a.add(p.id+"_menu","click",function(i){var m;i=c.getParent(i.target,"a",j);if(i&&i.nodeName.toLowerCase()=="a"&&(m=i.getAttribute("data-mce-color"))){p.setColor(m)}return false});return o},setColor:function(f){this.displayColor(f);this.hideMenu();this.settings.onselect(f)},displayColor:function(g){var f=this;c.setStyle(f.id+"_preview","backgroundColor",g);f.value=g},postRender:function(){var f=this,g=f.id;f.parent();c.add(g+"_action","div",{id:g+"_preview","class":"mceColorPreview"});c.setStyle(f.id+"_preview","backgroundColor",f.value)},destroy:function(){this.parent();a.clear(this.id+"_menu");a.clear(this.id+"_more");c.remove(this.id+"_menu")}})})(tinymce);(function(b){var d=b.DOM,c=b.each,a=b.dom.Event;b.create("tinymce.ui.ToolbarGroup:tinymce.ui.Container",{renderHTML:function(){var f=this,i=[],e=f.controls,j=b.each,g=f.settings;i.push('
                    ');i.push("");i.push('");j(e,function(h){i.push(h.renderHTML())});i.push("");i.push("
                    ");return i.join("")},focus:function(){var e=this;d.get(e.id).focus()},postRender:function(){var f=this,e=[];c(f.controls,function(g){c(g.controls,function(h){if(h.id){e.push(h)}})});f.keyNav=new b.ui.KeyboardNavigation({root:f.id,items:e,onCancel:function(){if(b.isWebKit){d.get(f.editor.id+"_ifr").focus()}f.editor.focus()},excludeFromTabOrder:!f.settings.tab_focus_toolbar})},destroy:function(){var e=this;e.parent();e.keyNav.destroy();a.clear(e.id)}})})(tinymce);(function(a){var c=a.DOM,b=a.each;a.create("tinymce.ui.Toolbar:tinymce.ui.Container",{renderHTML:function(){var m=this,f="",j,k,n=m.settings,e,d,g,l;l=m.controls;for(e=0;e"))}if(d&&k.ListBox){if(d.Button||d.SplitButton){f+=c.createHTML("td",{"class":"mceToolbarEnd"},c.createHTML("span",null,""))}}if(c.stdMode){f+=''+k.renderHTML()+""}else{f+=""+k.renderHTML()+""}if(g&&k.ListBox){if(g.Button||g.SplitButton){f+=c.createHTML("td",{"class":"mceToolbarStart"},c.createHTML("span",null,""))}}}j="mceToolbarEnd";if(k.Button){j+=" mceToolbarEndButton"}else{if(k.SplitButton){j+=" mceToolbarEndSplitButton"}else{if(k.ListBox){j+=" mceToolbarEndListBox"}}}f+=c.createHTML("td",{"class":j},c.createHTML("span",null,""));return c.createHTML("table",{id:m.id,"class":"mceToolbar"+(n["class"]?" "+n["class"]:""),cellpadding:"0",cellspacing:"0",align:m.settings.align||"",role:"presentation",tabindex:"-1"},""+f+"")}})})(tinymce);(function(b){var a=b.util.Dispatcher,c=b.each;b.create("tinymce.AddOnManager",{AddOnManager:function(){var d=this;d.items=[];d.urls={};d.lookup={};d.onAdd=new a(d)},get:function(d){if(this.lookup[d]){return this.lookup[d].instance}else{return undefined}},dependencies:function(e){var d;if(this.lookup[e]){d=this.lookup[e].dependencies}return d||[]},requireLangPack:function(e){return;var d=b.settings;if(d&&d.language&&d.language_load!==false){b.ScriptLoader.add(this.urls[e]+"/langs/"+d.language+".js")}},add:function(f,e,d){this.items.push(e);this.lookup[f]={instance:e,dependencies:d};this.onAdd.dispatch(this,f,e);return e},createUrl:function(d,e){if(typeof e==="object"){return e}else{return{prefix:d.prefix,resource:e,suffix:d.suffix}}},addComponents:function(f,d){var e=this.urls[f];b.each(d,function(g){b.ScriptLoader.add(e+"/"+g)})},load:function(j,f,d,h){var g=this,e=f;function i(){var k=g.dependencies(j);b.each(k,function(m){var l=g.createUrl(f,m);g.load(l.resource,l,undefined,undefined)});if(d){if(h){d.call(h)}else{d.call(b.ScriptLoader)}}}if(g.urls[j]){return}if(typeof f==="object"){e=f.prefix+f.resource+f.suffix}if(e.indexOf("/")!==0&&e.indexOf("://")==-1){e=b.baseURL+"/"+e}g.urls[j]=e.substring(0,e.lastIndexOf("/"));if(g.lookup[j]){i()}else{b.ScriptLoader.add(e,i,h)}}});b.PluginManager=new b.AddOnManager();b.ThemeManager=new b.AddOnManager()}(tinymce));(function(j){var g=j.each,d=j.extend,k=j.DOM,i=j.dom.Event,f=j.ThemeManager,b=j.PluginManager,e=j.explode,h=j.util.Dispatcher,a,c=0;j.documentBaseURL=window.location.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,"");if(!/[\/\\]$/.test(j.documentBaseURL)){j.documentBaseURL+="/"}j.baseURL=new j.util.URI(j.documentBaseURL).toAbsolute(j.baseURL);j.baseURI=new j.util.URI(j.baseURL);j.onBeforeUnload=new h(j);i.add(window,"beforeunload",function(l){j.onBeforeUnload.dispatch(j,l)});j.onAddEditor=new h(j);j.onRemoveEditor=new h(j);j.EditorManager=d(j,{editors:[],i18n:{},activeEditor:null,init:function(x){var v=this,o,n=j.ScriptLoader,u,l=[],r;function q(t){var s=t.id;if(!s){s=t.name;if(s&&!k.get(s)){s=t.name}else{s=k.uniqueId()}t.setAttribute("id",s)}return s}function m(z,A,t){var y=z[A];if(!y){return}if(j.is(y,"string")){t=y.replace(/\.\w+$/,"");t=t?j.resolve(t):0;y=j.resolve(y)}return y.apply(t||this,Array.prototype.slice.call(arguments,2))}function p(t,s){return s.constructor===RegExp?s.test(t.className):k.hasClass(t,s)}x=d({theme:"simple",language:"en"},x);v.settings=x;i.bind(window,"ready",function(){var s,t;m(x,"onpageload");switch(x.mode){case"exact":s=x.elements||"";if(s.length>0){g(e(s),function(y){if(k.get(y)){r=new j.Editor(y,x);l.push(r);r.render(1)}else{g(document.forms,function(z){g(z.elements,function(A){if(A.name===y){y="mce_editor_"+c++;k.setAttrib(A,"id",y);r=new j.Editor(y,x);l.push(r);r.render(1)}})})}})}break;case"textareas":case"specific_textareas":g(k.select("textarea"),function(y){if(x.editor_deselector&&p(y,x.editor_deselector)){return}if(!x.editor_selector||p(y,x.editor_selector)){r=new j.Editor(q(y),x);l.push(r);r.render(1)}});break;default:if(x.types){g(x.types,function(y){g(k.select(y.selector),function(A){var z=new j.Editor(q(A),j.extend({},x,y));l.push(z);z.render(1)})})}else{if(x.selector){g(k.select(x.selector),function(z){var y=new j.Editor(q(z),x);l.push(y);y.render(1)})}}}if(x.oninit){s=t=0;g(l,function(y){t++;if(!y.initialized){y.onInit.add(function(){s++;if(s==t){m(x,"oninit")}})}else{s++}if(s==t){m(x,"oninit")}})}})},get:function(l){if(l===a){return this.editors}return this.editors[l]},getInstanceById:function(l){return this.get(l)},add:function(m){var l=this,n=l.editors;n[m.id]=m;n.push(m);l._setActive(m);l.onAddEditor.dispatch(l,m);return m},remove:function(n){var m=this,l,o=m.editors;if(!o[n.id]){return null}delete o[n.id];for(l=0;l':"",visual:n,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",apply_source_formatting:n,directionality:"ltr",forced_root_block:"p",hidden_input:n,padd_empty_editor:n,render_ui:n,indentation:"30px",fix_table_elements:n,inline_styles:n,convert_fonts_to_spans:n,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist",validate:n,entity_encoding:"named",url_converter:m.convertURL,url_converter_scope:m,ie7_compat:n},o);m.id=m.editorId=p;m.isNotDirty=false;m.plugins={};m.documentBaseURI=new k.util.URI(o.document_base_url||k.documentBaseURL,{base_uri:tinyMCE.baseURI});m.baseURI=k.baseURI;m.contentCSS=[];m.setupEvents();m.execCommands={};m.queryStateCommands={};m.queryValueCommands={};m.execCallback("setup",m)},render:function(o){var p=this,q=p.settings,r=p.id,m=k.ScriptLoader;if(!j.domLoaded){j.add(window,"ready",function(){p.render()});return}tinyMCE.settings=q;if(!p.getElement()){return}if(k.isIDevice&&!k.isIOS5){return}if(!/TEXTAREA|INPUT/i.test(p.getElement().nodeName)&&q.hidden_input&&l.getParent(r,"form")){l.insertAfter(l.create("input",{type:"hidden",name:r}),r)}p.orgVisibility=p.getElement().style.visibility;p.getElement().style.visibility="hidden";if(k.WindowManager){p.windowManager=new k.WindowManager(p)}if(q.encoding=="xml"){p.onGetContent.add(function(s,t){if(t.save){t.content=l.encode(t.content)}})}if(q.add_form_submit_trigger){p.onSubmit.addToTop(function(){if(p.initialized){p.save();p.isNotDirty=1}})}if(q.add_unload_trigger){p._beforeUnload=tinyMCE.onBeforeUnload.add(function(){if(p.initialized&&!p.destroyed&&!p.isHidden()){p.save({format:"raw",no_events:true})}})}k.addUnload(p.destroy,p);if(q.submit_patch){p.onBeforeRenderUI.add(function(){var s=p.getElement().form;if(!s){return}if(s._mceOldSubmit){return}if(!s.submit.nodeType&&!s.submit.length){p.formElement=s;s._mceOldSubmit=s.submit;s.submit=function(){k.triggerSave();p.isNotDirty=1;return p.formElement._mceOldSubmit(p.formElement)}}s=null})}function n(){if(q.language&&q.language_load!==false){m.add(k.baseURL+"/../../extra/strings.php?elanguage="+q.language+"ðeme="+q.theme)}if(q.theme&&typeof q.theme!="function"&&q.theme.charAt(0)!="-"&&!h.urls[q.theme]){h.load(q.theme,"themes/"+q.theme+"/editor_template"+k.suffix+".js")}i(g(q.plugins),function(t){if(t&&!c.urls[t]){if(t.charAt(0)=="-"){t=t.substr(1,t.length);var s=c.dependencies(t);i(s,function(v){var u={prefix:"plugins/",resource:v,suffix:"/editor_plugin"+k.suffix+".js"};v=c.createUrl(u,v);c.load(v.resource,v)})}else{if(t=="safari"){return}c.load(t,{prefix:"plugins/",resource:t,suffix:"/editor_plugin"+k.suffix+".js"})}}});m.loadQueue(function(){if(!p.removed){p.init()}})}n()},init:function(){var q,F=this,G=F.settings,C,y,B=F.getElement(),p,m,D,v,A,E,x,r=[];k.add(F);G.aria_label=G.aria_label||l.getAttrib(B,"aria-label",F.getLang("aria.rich_text_area"));if(G.theme){if(typeof G.theme!="function"){G.theme=G.theme.replace(/-/,"");p=h.get(G.theme);F.theme=new p();if(F.theme.init){F.theme.init(F,h.urls[G.theme]||k.documentBaseURL.replace(/\/$/,""))}}else{F.theme=G.theme}}function z(s){var t=c.get(s),o=c.urls[s]||k.documentBaseURL.replace(/\/$/,""),n;if(t&&k.inArray(r,s)===-1){i(c.dependencies(s),function(u){z(u)});n=new t(F,o);F.plugins[s]=n;if(n.init){n.init(F,o);r.push(s)}}}i(g(G.plugins.replace(/\-/g,"")),z);if(G.popup_css!==false){if(G.popup_css){G.popup_css=F.documentBaseURI.toAbsolute(G.popup_css)}else{G.popup_css=F.baseURI.toAbsolute("themes/"+G.theme+"/skins/"+G.skin+"/dialog.css")}}if(G.popup_css_add){G.popup_css+=","+F.documentBaseURI.toAbsolute(G.popup_css_add)}F.controlManager=new k.ControlManager(F);F.onExecCommand.add(function(n,o){if(!/^(FontName|FontSize)$/.test(o)){F.nodeChanged()}});F.onBeforeRenderUI.dispatch(F,F.controlManager);if(G.render_ui&&F.theme){F.orgDisplay=B.style.display;if(typeof G.theme!="function"){C=G.width||B.style.width||B.offsetWidth;y=G.height||B.style.height||B.offsetHeight;E=/^[0-9\.]+(|px)$/i;if(E.test(""+C)){C=Math.max(parseInt(C,10)+(p.deltaWidth||0),100)}if(E.test(""+y)){y=Math.max(parseInt(y)+(p.deltaHeight||0),G.theme_advanced_resizing_min_height||100)}p=F.theme.renderUI({targetNode:B,width:C,height:y,deltaWidth:G.delta_width,deltaHeight:G.delta_height});l.setStyles(p.sizeContainer||p.editorContainer,{width:C,height:y});y=(p.iframeHeight||y)+(typeof(y)=="number"?(p.deltaHeight||0):"");if(y<(G.theme_advanced_resizing_min_height||100)){y=G.theme_advanced_resizing_min_height||100}}else{p=G.theme(F,B);if(p.editorContainer.nodeType){p.editorContainer=p.editorContainer.id=p.editorContainer.id||F.id+"_parent"}if(p.iframeContainer.nodeType){p.iframeContainer=p.iframeContainer.id=p.iframeContainer.id||F.id+"_iframecontainer"}y=p.iframeHeight||B.offsetHeight}F.editorContainer=p.editorContainer}if(G.content_css){i(g(G.content_css),function(n){F.contentCSS.push(F.documentBaseURI.toAbsolute(n))})}if(G.content_editable){B=q=p=null;return F.initContentBody()}if(document.domain&&location.hostname!=document.domain){k.relaxedDomain=document.domain}F.iframeHTML=G.doctype+'';if(G.document_base_url!=k.documentBaseURL){F.iframeHTML+=''}if(G.ie7_compat){F.iframeHTML+=''}else{F.iframeHTML+=''}F.iframeHTML+='';for(x=0;x'}F.contentCSS=[];v=G.body_id||"tinymce";if(v.indexOf("=")!=-1){v=F.getParam("body_id","","hash");v=v[F.id]||v}A=G.body_class||"";if(A.indexOf("=")!=-1){A=F.getParam("body_class","","hash");A=A[F.id]||""}F.iframeHTML+='
                    ";if(k.relaxedDomain&&(b||(k.isOpera&&parseFloat(opera.version())<11))){D='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinyMCE.get("'+F.id+'");document.write(ed.iframeHTML);document.close();ed.initContentBody();})()'}q=l.add(p.iframeContainer,"iframe",{id:F.id+"_ifr",src:D||'javascript:""',frameBorder:"0",allowTransparency:"true",title:G.aria_label,style:{width:"100%",height:y,display:"block"}});F.contentAreaContainer=p.iframeContainer;if(p.editorContainer){l.get(p.editorContainer).style.display=F.orgDisplay}B.style.visibility=F.orgVisibility;l.get(F.id).style.display="none";l.setAttrib(F.id,"aria-hidden",true);if(!k.relaxedDomain||!D){F.initContentBody()}B=q=p=null},initContentBody:function(){var n=this,p=n.settings,q=l.get(n.id),r=n.getDoc(),o,m;if((!b||!k.relaxedDomain)&&!p.content_editable){r.open();r.write(n.iframeHTML);r.close();if(k.relaxedDomain){r.domain=k.relaxedDomain}}if(p.content_editable){l.addClass(q,"mceContentBody");n.contentDocument=r=p.content_document||document;n.contentWindow=p.content_window||window;n.bodyElement=q;p.content_document=p.content_window=null}m=n.getBody();m.disabled=true;if(!p.readonly){m.contentEditable=n.getParam("content_editable_state",true)}m.disabled=false;n.schema=new k.html.Schema(p);n.dom=new k.dom.DOMUtils(r,{keep_values:true,url_converter:n.convertURL,url_converter_scope:n,hex_colors:p.force_hex_style_colors,class_filter:p.class_filter,update_styles:true,root_element:p.content_editable?n.id:null,schema:n.schema});n.parser=new k.html.DomParser(p,n.schema);n.parser.addAttributeFilter("src,href,style",function(s,t){var u=s.length,x,z=n.dom,y,v;while(u--){x=s[u];y=x.attr(t);v="data-mce-"+t;if(!x.attributes.map[v]){if(t==="style"){x.attr(v,z.serializeStyle(z.parseStyle(y),x.name))}else{x.attr(v,n.convertURL(y,t,x.name))}}}});n.parser.addNodeFilter("script",function(s,t){var u=s.length,v;while(u--){v=s[u];v.attr("type","mce-"+(v.attr("type")||"text/javascript"))}});n.parser.addNodeFilter("#cdata",function(s,t){var u=s.length,v;while(u--){v=s[u];v.type=8;v.name="#comment";v.value="[CDATA["+v.value+"]]"}});n.parser.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(t,u){var v=t.length,x,s=n.schema.getNonEmptyElements();while(v--){x=t[v];if(x.isEmpty(s)){x.empty().append(new k.html.Node("br",1)).shortEnded=true}}});n.serializer=new k.dom.Serializer(p,n.dom,n.schema);n.selection=new k.dom.Selection(n.dom,n.getWin(),n.serializer);n.formatter=new k.Formatter(n);n.undoManager=new k.UndoManager(n);n.forceBlocks=new k.ForceBlocks(n);n.enterKey=new k.EnterKey(n);n.editorCommands=new k.EditorCommands(n);n.serializer.onPreProcess.add(function(s,t){return n.onPreProcess.dispatch(n,t,s)});n.serializer.onPostProcess.add(function(s,t){return n.onPostProcess.dispatch(n,t,s)});n.onPreInit.dispatch(n);if(!p.gecko_spellcheck){r.body.spellcheck=false}if(!p.readonly){n.bindNativeEvents()}n.controlManager.onPostRender.dispatch(n,n.controlManager);n.onPostRender.dispatch(n);n.quirks=k.util.Quirks(n);if(p.directionality){m.dir=p.directionality}if(p.nowrap){m.style.whiteSpace="nowrap"}if(p.protect){n.onBeforeSetContent.add(function(s,t){i(p.protect,function(u){t.content=t.content.replace(u,function(v){return""})})})}n.onSetContent.add(function(){n.addVisual(n.getBody())});if(p.padd_empty_editor){n.onPostProcess.add(function(s,t){t.content=t.content.replace(/^(]*>( | |\s|\u00a0|)<\/p>[\r\n]*|
                    [\r\n]*)$/,"")})}n.load({initial:true,format:"html"});n.startContent=n.getContent({format:"raw"});n.initialized=true;n.onInit.dispatch(n);n.execCallback("setupcontent_callback",n.id,m,r);n.execCallback("init_instance_callback",n);n.focus(true);n.nodeChanged({initial:true});i(n.contentCSS,function(s){n.dom.loadCSS(s)});if(p.auto_focus){setTimeout(function(){var s=k.get(p.auto_focus);s.selection.select(s.getBody(),1);s.selection.collapse(1);s.getBody().focus();s.getWin().focus()},100)}q=r=m=null},focus:function(p){var o,u=this,t=u.selection,q=u.settings.content_editable,n,r,s=u.getDoc(),m;if(!p){n=t.getRng();if(n.item){r=n.item(0)}u._refreshContentEditable();if(!q){u.getWin().focus()}if(k.isGecko||q){m=u.getBody();if(m.setActive){m.setActive()}else{m.focus()}if(q){t.normalize()}}if(r&&r.ownerDocument==s){n=s.body.createControlRange();n.addElement(r);n.select()}}if(k.activeEditor!=u){if((o=k.activeEditor)!=null){o.onDeactivate.dispatch(o,u)}u.onActivate.dispatch(u,o)}k._setActive(u)},execCallback:function(q){var m=this,p=m.settings[q],o;if(!p){return}if(m.callbackLookup&&(o=m.callbackLookup[q])){p=o.func;o=o.scope}if(d(p,"string")){o=p.replace(/\.\w+$/,"");o=o?k.resolve(o):0;p=k.resolve(p);m.callbackLookup=m.callbackLookup||{};m.callbackLookup[q]={func:p,scope:o}}return p.apply(o||m,Array.prototype.slice.call(arguments,1))},translate:function(m){var o=this.settings.language||"en",n=k.i18n;if(!m){return""}return n[o+"."+m]||m.replace(/\{\#([^\}]+)\}/g,function(q,p){return n[o+"."+p]||"{#"+p+"}"})},getLang:function(o,m){return k.i18n[(this.settings.language||"en")+"."+o]||(d(m)?m:"{#"+o+"}")},getParam:function(t,q,m){var r=k.trim,p=d(this.settings[t])?this.settings[t]:q,s;if(m==="hash"){s={};if(d(p,"string")){i(p.indexOf("=")>0?p.split(/[;,](?![^=;,]*(?:[;,]|$))/):p.split(","),function(n){n=n.split("=");if(n.length>1){s[r(n[0])]=r(n[1])}else{s[r(n[0])]=r(n)}})}else{s=p}return s}return p},nodeChanged:function(q){var m=this,n=m.selection,p;if(m.initialized){q=q||{};p=n.getStart()||m.getBody();p=b&&p.ownerDocument!=m.getDoc()?m.getBody():p;q.parents=[];m.dom.getParent(p,function(o){if(o.nodeName=="BODY"){return true}q.parents.push(o)});m.onNodeChange.dispatch(m,q?q.controlManager||m.controlManager:m.controlManager,p,n.isCollapsed(),q)}},addButton:function(n,o){var m=this;m.buttons=m.buttons||{};m.buttons[n]=o},addCommand:function(m,o,n){this.execCommands[m]={func:o,scope:n||this}},addQueryStateHandler:function(m,o,n){this.queryStateCommands[m]={func:o,scope:n||this}},addQueryValueHandler:function(m,o,n){this.queryValueCommands[m]={func:o,scope:n||this}},addShortcut:function(o,q,m,p){var n=this,r;if(n.settings.custom_shortcuts===false){return false}n.shortcuts=n.shortcuts||{};if(d(m,"string")){r=m;m=function(){n.execCommand(r,false,null)}}if(d(m,"object")){r=m;m=function(){n.execCommand(r[0],r[1],r[2])}}i(g(o),function(s){var t={func:m,scope:p||this,desc:n.translate(q),alt:false,ctrl:false,shift:false};i(g(s,"+"),function(u){switch(u){case"alt":case"ctrl":case"shift":t[u]=true;break;default:t.charCode=u.charCodeAt(0);t.keyCode=u.toUpperCase().charCodeAt(0)}});n.shortcuts[(t.ctrl?"ctrl":"")+","+(t.alt?"alt":"")+","+(t.shift?"shift":"")+","+t.keyCode]=t});return true},execCommand:function(u,r,x,m){var p=this,q=0,v,n;if(!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(u)&&(!m||!m.skip_focus)){p.focus()}m=f({},m);p.onBeforeExecCommand.dispatch(p,u,r,x,m);if(m.terminate){return false}if(p.execCallback("execcommand_callback",p.id,p.selection.getNode(),u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);return true}if(v=p.execCommands[u]){n=v.func.call(v.scope,r,x);if(n!==true){p.onExecCommand.dispatch(p,u,r,x,m);return n}}i(p.plugins,function(o){if(o.execCommand&&o.execCommand(u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);q=1;return false}});if(q){return true}if(p.theme&&p.theme.execCommand&&p.theme.execCommand(u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);return true}if(p.editorCommands.execCommand(u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);return true}p.getDoc().execCommand(u,r,x);p.onExecCommand.dispatch(p,u,r,x,m)},queryCommandState:function(q){var n=this,r,p;if(n._isHidden()){return}if(r=n.queryStateCommands[q]){p=r.func.call(r.scope);if(p!==true){return p}}r=n.editorCommands.queryCommandState(q);if(r!==-1){return r}try{return this.getDoc().queryCommandState(q)}catch(m){}},queryCommandValue:function(r){var n=this,q,p;if(n._isHidden()){return}if(q=n.queryValueCommands[r]){p=q.func.call(q.scope);if(p!==true){return p}}q=n.editorCommands.queryCommandValue(r);if(d(q)){return q}try{return this.getDoc().queryCommandValue(r)}catch(m){}},show:function(){var m=this;l.show(m.getContainer());l.hide(m.id);m.load()},hide:function(){var m=this,n=m.getDoc();if(b&&n){n.execCommand("SelectAll")}m.save();l.hide(m.getContainer());l.setStyle(m.id,"display",m.orgDisplay)},isHidden:function(){return !l.isHidden(this.id)},setProgressState:function(m,n,p){this.onSetProgressState.dispatch(this,m,n,p);return m},load:function(q){var m=this,p=m.getElement(),n;if(p){q=q||{};q.load=true;n=m.setContent(d(p.value)?p.value:p.innerHTML,q);q.element=p;if(!q.no_events){m.onLoadContent.dispatch(m,q)}q.element=p=null;return n}},save:function(r){var m=this,q=m.getElement(),n,p;if(!q||!m.initialized){return}r=r||{};r.save=true;r.element=q;n=r.content=m.getContent(r);if(!r.no_events){m.onSaveContent.dispatch(m,r)}n=r.content;if(!/TEXTAREA|INPUT/i.test(q.nodeName)){q.innerHTML=n;if(p=l.getParent(m.id,"form")){i(p.elements,function(o){if(o.name==m.id){o.value=n;return false}})}}else{q.value=n}r.element=q=null;return n},setContent:function(r,p){var o=this,n,m=o.getBody(),q;p=p||{};p.format=p.format||"html";p.set=true;p.content=r;if(!p.no_events){o.onBeforeSetContent.dispatch(o,p)}r=p.content;if(!k.isIE&&(r.length===0||/^\s+$/.test(r))){q=o.settings.forced_root_block;if(q){r="<"+q+'>
                    "}else{r='
                    '}m.innerHTML=r;o.selection.select(m,true);o.selection.collapse(true);return}if(p.format!=="raw"){r=new k.html.Serializer({},o.schema).serialize(o.parser.parse(r))}p.content=k.trim(r);o.dom.setHTML(m,p.content);if(!p.no_events){o.onSetContent.dispatch(o,p)}o.selection.normalize();return p.content},getContent:function(n){var m=this,o;n=n||{};n.format=n.format||"html";n.get=true;n.getInner=true;if(!n.no_events){m.onBeforeGetContent.dispatch(m,n)}if(n.format=="raw"){o=m.getBody().innerHTML}else{o=m.serializer.serialize(m.getBody(),n)}n.content=k.trim(o);if(!n.no_events){m.onGetContent.dispatch(m,n)}return n.content},isDirty:function(){var m=this;return k.trim(m.startContent)!=k.trim(m.getContent({format:"raw",no_events:1}))&&!m.isNotDirty},getContainer:function(){var m=this;if(!m.container){m.container=l.get(m.editorContainer||m.id+"_parent")}return m.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return l.get(this.settings.content_element||this.id)},getWin:function(){var m=this,n;if(!m.contentWindow){n=l.get(m.id+"_ifr");if(n){m.contentWindow=n.contentWindow}}return m.contentWindow},getDoc:function(){var m=this,n;if(!m.contentDocument){n=m.getWin();if(n){m.contentDocument=n.document}}return m.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(o,n,q){var m=this,p=m.settings;if(p.urlconverter_callback){return m.execCallback("urlconverter_callback",o,q,true,n)}if(!p.convert_urls||(q&&q.nodeName=="LINK")||o.indexOf("file:")===0){return o}if(p.relative_urls){return m.documentBaseURI.toRelative(o)}o=m.documentBaseURI.toAbsolute(o,p.remove_script_host);return o},addVisual:function(q){var n=this,o=n.settings,p=n.dom,m;q=q||n.getBody();if(!d(n.hasVisual)){n.hasVisual=o.visual}i(p.select("table,a",q),function(s){var r;switch(s.nodeName){case"TABLE":m=o.visual_table_class||"mceItemTable";r=p.getAttrib(s,"border");if(!r||r=="0"){if(n.hasVisual){p.addClass(s,m)}else{p.removeClass(s,m)}}return;case"A":if(!s.href){r=p.getAttrib(s,"name")||s.id;m="mceItemAnchor";if(r){if(n.hasVisual){p.addClass(s,m)}else{p.removeClass(s,m)}}}return}});n.onVisualAid.dispatch(n,q,n.hasVisual)},remove:function(){var m=this,n=m.getContainer();if(!m.removed){m.removed=1;m.hide();if(!m.settings.content_editable){j.clear(m.getWin());j.clear(m.getDoc())}j.clear(m.getBody());j.clear(m.formElement);j.unbind(n);m.execCallback("remove_instance_callback",m);m.onRemove.dispatch(m);m.onExecCommand.listeners=[];k.remove(m);l.remove(n)}},destroy:function(n){var m=this;if(m.destroyed){return}if(a){j.unbind(m.getDoc());j.unbind(m.getWin());j.unbind(m.getBody())}if(!n){k.removeUnload(m.destroy);tinyMCE.onBeforeUnload.remove(m._beforeUnload);if(m.theme&&m.theme.destroy){m.theme.destroy()}m.controlManager.destroy();m.selection.destroy();m.dom.destroy()}if(m.formElement){m.formElement.submit=m.formElement._mceOldSubmit;m.formElement._mceOldSubmit=null}m.contentAreaContainer=m.formElement=m.container=m.settings.content_element=m.bodyElement=m.contentDocument=m.contentWindow=null;if(m.selection){m.selection=m.selection.win=m.selection.dom=m.selection.dom.doc=null}m.destroyed=1},_refreshContentEditable:function(){var n=this,m,o;if(n._isHidden()){m=n.getBody();o=m.parentNode;o.removeChild(m);o.appendChild(m);m.focus()}},_isHidden:function(){var m;if(!a){return 0}m=this.selection.getSel();return(!m||!m.rangeCount||m.rangeCount===0)}})})(tinymce);(function(a){var b=a.each;a.Editor.prototype.setupEvents=function(){var c=this,d=c.settings;b(["onPreInit","onBeforeRenderUI","onPostRender","onLoad","onInit","onRemove","onActivate","onDeactivate","onClick","onEvent","onMouseUp","onMouseDown","onDblClick","onKeyDown","onKeyUp","onKeyPress","onContextMenu","onSubmit","onReset","onPaste","onPreProcess","onPostProcess","onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent","onLoadContent","onSaveContent","onNodeChange","onChange","onBeforeExecCommand","onExecCommand","onUndo","onRedo","onVisualAid","onSetProgressState","onSetAttrib"],function(e){c[e]=new a.util.Dispatcher(c)});if(d.cleanup_callback){c.onBeforeSetContent.add(function(e,f){f.content=e.execCallback("cleanup_callback","insert_to_editor",f.content,f)});c.onPreProcess.add(function(e,f){if(f.set){e.execCallback("cleanup_callback","insert_to_editor_dom",f.node,f)}if(f.get){e.execCallback("cleanup_callback","get_from_editor_dom",f.node,f)}});c.onPostProcess.add(function(e,f){if(f.set){f.content=e.execCallback("cleanup_callback","insert_to_editor",f.content,f)}if(f.get){f.content=e.execCallback("cleanup_callback","get_from_editor",f.content,f)}})}if(d.save_callback){c.onGetContent.add(function(e,f){if(f.save){f.content=e.execCallback("save_callback",e.id,f.content,e.getBody())}})}if(d.handle_event_callback){c.onEvent.add(function(f,g,h){if(c.execCallback("handle_event_callback",g,f,h)===false){Event.cancel(g)}})}if(d.handle_node_change_callback){c.onNodeChange.add(function(f,e,g){f.execCallback("handle_node_change_callback",f.id,g,-1,-1,true,f.selection.isCollapsed())})}if(d.save_callback){c.onSaveContent.add(function(e,g){var f=e.execCallback("save_callback",e.id,g.content,e.getBody());if(f){g.content=f}})}if(d.onchange_callback){c.onChange.add(function(f,e){f.execCallback("onchange_callback",f,e)})}};a.Editor.prototype.bindNativeEvents=function(){var l=this,f,d=l.settings,e=l.dom,h;h={mouseup:"onMouseUp",mousedown:"onMouseDown",click:"onClick",keyup:"onKeyUp",keydown:"onKeyDown",keypress:"onKeyPress",submit:"onSubmit",reset:"onReset",contextmenu:"onContextMenu",dblclick:"onDblClick",paste:"onPaste"};function c(i,m){var n=i.type;if(l.removed){return}if(l.onEvent.dispatch(l,i,m)!==false){l[h[i.fakeType||i.type]].dispatch(l,i,m)}}function j(i){l.focus(true)}function k(){l.selection.normalize();l.nodeChanged()}b(h,function(m,n){var i=d.content_editable?l.getBody():l.getDoc();switch(n){case"contextmenu":e.bind(i,n,c);break;case"paste":e.bind(l.getBody(),n,c);break;case"submit":case"reset":e.bind(l.getElement().form||a.DOM.getParent(l.id,"form"),n,c);break;default:e.bind(i,n,c)}});e.bind(d.content_editable?l.getBody():(a.isGecko?l.getDoc():l.getWin()),"focus",function(i){l.focus(true)});if(d.content_editable&&a.isOpera){e.bind(l.getBody(),"click",j);e.bind(l.getBody(),"keydown",j)}l.onMouseUp.add(k);l.onKeyUp.add(function(i,n){var m=n.keyCode;if((m>=33&&m<=36)||(m>=37&&m<=40)||m==13||m==45||m==46||m==8||(a.isMac&&(m==91||m==93))||n.ctrlKey){k()}});l.onReset.add(function(){l.setContent(l.startContent,{format:"raw"})});function g(m,i){if(m.altKey||m.ctrlKey||m.metaKey){b(l.shortcuts,function(n){var o=a.isMac?m.metaKey:m.ctrlKey;if(n.ctrl!=o||n.alt!=m.altKey||n.shift!=m.shiftKey){return}if(m.keyCode==n.keyCode||(m.charCode&&m.charCode==n.charCode)){m.preventDefault();if(i){n.func.call(n.scope)}return true}})}}l.onKeyUp.add(function(i,m){g(m)});l.onKeyPress.add(function(i,m){g(m)});l.onKeyDown.add(function(i,m){g(m,true)});if(a.isOpera){l.onClick.add(function(i,m){m.preventDefault()})}}})(tinymce);(function(d){var e=d.each,b,a=true,c=false;d.EditorCommands=function(n){var m=n.dom,p=n.selection,j={state:{},exec:{},value:{}},k=n.settings,q=n.formatter,o;function r(z,y,x){var v;z=z.toLowerCase();if(v=j.exec[z]){v(z,y,x);return a}return c}function l(x){var v;x=x.toLowerCase();if(v=j.state[x]){return v(x)}return -1}function h(x){var v;x=x.toLowerCase();if(v=j.value[x]){return v(x)}return c}function u(v,x){x=x||"exec";e(v,function(z,y){e(y.toLowerCase().split(","),function(A){j[x][A]=z})})}d.extend(this,{execCommand:r,queryCommandState:l,queryCommandValue:h,addCommands:u});function f(y,x,v){if(x===b){x=c}if(v===b){v=null}return n.getDoc().execCommand(y,x,v)}function t(v){return q.match(v)}function s(v,x){q.toggle(v,x?{value:x}:b)}function i(v){o=p.getBookmark(v)}function g(){p.moveToBookmark(o)}u({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){n.undoManager.add()},"Cut,Copy,Paste":function(z){var y=n.getDoc(),v;try{f(z)}catch(x){v=a}if(v||!y.queryCommandSupported(z)){if(d.isGecko){n.windowManager.confirm(n.getLang("clipboard_msg"),function(A){if(A){open("http://www.mozilla.org/editor/midasdemo/securityprefs.html","_blank")}})}else{n.windowManager.alert(n.getLang("clipboard_no_support"))}}},unlink:function(v){if(p.isCollapsed()){p.select(p.getNode())}f(v);p.collapse(c)},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(v){var x=v.substring(7);e("left,center,right,full".split(","),function(y){if(x!=y){q.remove("align"+y)}});s("align"+x);r("mceRepaint")},"InsertUnorderedList,InsertOrderedList":function(y){var v,x;f(y);v=m.getParent(p.getNode(),"ol,ul");if(v){x=v.parentNode;if(/^(H[1-6]|P|ADDRESS|PRE)$/.test(x.nodeName)){i();m.split(x,v);g()}}},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(v){s(v)},"ForeColor,HiliteColor,FontName":function(y,x,v){s(y,v)},FontSize:function(z,y,x){var v,A;if(x>=1&&x<=7){A=d.explode(k.font_size_style_values);v=d.explode(k.font_size_classes);if(v){x=v[x-1]||x}else{x=A[x-1]||x}}s(z,x)},RemoveFormat:function(v){q.remove(v)},mceBlockQuote:function(v){s("blockquote")},FormatBlock:function(y,x,v){return s(v||"p")},mceCleanup:function(){var v=p.getBookmark();n.setContent(n.getContent({cleanup:a}),{cleanup:a});p.moveToBookmark(v)},mceRemoveNode:function(z,y,x){var v=x||p.getNode();if(v!=n.getBody()){i();n.dom.remove(v,a);g()}},mceSelectNodeDepth:function(z,y,x){var v=0;m.getParent(p.getNode(),function(A){if(A.nodeType==1&&v++==x){p.select(A);return c}},n.getBody())},mceSelectNode:function(y,x,v){p.select(v)},mceInsertContent:function(B,I,K){var y,J,E,z,F,G,D,C,L,x,A,M,v,H;y=n.parser;J=new d.html.Serializer({},n.schema);v='\uFEFF';G={content:K,format:"html"};p.onBeforeSetContent.dispatch(p,G);K=G.content;if(K.indexOf("{$caret}")==-1){K+="{$caret}"}K=K.replace(/\{\$caret\}/,v);if(!p.isCollapsed()){n.getDoc().execCommand("Delete",false,null)}E=p.getNode();G={context:E.nodeName.toLowerCase()};F=y.parse(K,G);A=F.lastChild;if(A.attr("id")=="mce_marker"){D=A;for(A=A.prev;A;A=A.walk(true)){if(A.type==3||!m.isBlock(A.name)){A.parent.insert(D,A,A.name==="br");break}}}if(!G.invalid){K=J.serialize(F);A=E.firstChild;M=E.lastChild;if(!A||(A===M&&A.nodeName==="BR")){m.setHTML(E,K)}else{p.setContent(K)}}else{p.setContent(v);E=n.selection.getNode();z=n.getBody();if(E.nodeType==9){E=A=z}else{A=E}while(A!==z){E=A;A=A.parentNode}K=E==z?z.innerHTML:m.getOuterHTML(E);K=J.serialize(y.parse(K.replace(//i,function(){return J.serialize(F)})));if(E==z){m.setHTML(z,K)}else{m.setOuterHTML(E,K)}}D=m.get("mce_marker");C=m.getRect(D);L=m.getViewPort(n.getWin());if((C.y+C.h>L.y+L.h||C.yL.x+L.w||C.x")},mceToggleVisualAid:function(){n.hasVisual=!n.hasVisual;n.addVisual()},mceReplaceContent:function(y,x,v){n.execCommand("mceInsertContent",false,v.replace(/\{\$selection\}/g,p.getContent({format:"text"})))},mceInsertLink:function(z,y,x){var v;if(typeof(x)=="string"){x={href:x}}v=m.getParent(p.getNode(),"a");x.href=x.href.replace(" ","%20");if(!v||!x.href){q.remove("link")}if(x.href){q.apply("link",x,v)}},selectAll:function(){var x=m.getRoot(),v=m.createRng();v.setStart(x,0);v.setEnd(x,x.childNodes.length);n.selection.setRng(v)}});u({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(z){var x="align"+z.substring(7);var v=p.isCollapsed()?[m.getParent(p.getNode(),m.isBlock)]:p.getSelectedBlocks();var y=d.map(v,function(A){return !!q.matchNode(A,x)});return d.inArray(y,a)!==-1},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(v){return t(v)},mceBlockQuote:function(){return t("blockquote")},Outdent:function(){var v;if(k.inline_styles){if((v=m.getParent(p.getStart(),m.isBlock))&&parseInt(v.style.paddingLeft)>0){return a}if((v=m.getParent(p.getEnd(),m.isBlock))&&parseInt(v.style.paddingLeft)>0){return a}}return l("InsertUnorderedList")||l("InsertOrderedList")||(!k.inline_styles&&!!m.getParent(p.getNode(),"BLOCKQUOTE"))},"InsertUnorderedList,InsertOrderedList":function(v){return m.getParent(p.getNode(),v=="insertunorderedlist"?"UL":"OL")}},"state");u({"FontSize,FontName":function(y){var x=0,v;if(v=m.getParent(p.getNode(),"span")){if(y=="fontsize"){x=v.style.fontSize}else{x=v.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()}}return x}},"value");u({Undo:function(){n.undoManager.undo()},Redo:function(){n.undoManager.redo()}})}})(tinymce);(function(b){var a=b.util.Dispatcher;b.UndoManager=function(h){var l,i=0,e=[],g,k,j,f;function c(){return b.trim(h.getContent({format:"raw",no_events:1}).replace(/]+data-mce-bogus[^>]+>[\u200B\uFEFF]+<\/span>/g,""))}function d(){l.typing=false;l.add()}onBeforeAdd=new a(l);k=new a(l);j=new a(l);f=new a(l);k.add(function(m,n){if(m.hasUndo()){return h.onChange.dispatch(h,n,m)}});j.add(function(m,n){return h.onUndo.dispatch(h,n,m)});f.add(function(m,n){return h.onRedo.dispatch(h,n,m)});h.onInit.add(function(){l.add()});h.onBeforeExecCommand.add(function(m,p,o,q,n){if(p!="Undo"&&p!="Redo"&&p!="mceRepaint"&&(!n||!n.skip_undo)){l.beforeChange()}});h.onExecCommand.add(function(m,p,o,q,n){if(p!="Undo"&&p!="Redo"&&p!="mceRepaint"&&(!n||!n.skip_undo)){l.add()}});h.onSaveContent.add(d);h.dom.bind(h.dom.getRoot(),"dragend",d);h.dom.bind(h.getDoc(),b.isGecko?"blur":"focusout",function(m){if(!h.removed&&l.typing){d()}});h.onKeyUp.add(function(m,o){var n=o.keyCode;if((n>=33&&n<=36)||(n>=37&&n<=40)||n==45||n==13||o.ctrlKey){d()}});h.onKeyDown.add(function(m,o){var n=o.keyCode;if((n>=33&&n<=36)||(n>=37&&n<=40)||n==45){if(l.typing){d()}return}if((n<16||n>20)&&n!=224&&n!=91&&!l.typing){l.beforeChange();l.typing=true;l.add()}});h.onMouseDown.add(function(m,n){if(l.typing){d()}});h.addShortcut("ctrl+z","undo_desc","Undo");h.addShortcut("ctrl+y","redo_desc","Redo");l={data:e,typing:false,onBeforeAdd:onBeforeAdd,onAdd:k,onUndo:j,onRedo:f,beforeChange:function(){g=h.selection.getBookmark(2,true)},add:function(p){var m,n=h.settings,o;p=p||{};p.content=c();l.onBeforeAdd.dispatch(l,p);o=e[i];if(o&&o.content==p.content){return null}if(e[i]){e[i].beforeBookmark=g}if(n.custom_undo_redo_levels){if(e.length>n.custom_undo_redo_levels){for(m=0;m0){n=e[--i];h.setContent(n.content,{format:"raw"});h.selection.moveToBookmark(n.beforeBookmark);l.onUndo.dispatch(l,n)}return n},redo:function(){var m;if(i0||this.typing},hasRedo:function(){return i0){g.moveEnd("character",q)}g.select()}catch(n){}}if(p){c.nodeChanged()}}if(b.forced_root_block){c.onKeyUp.add(f);c.onNodeChange.add(f)}};(function(c){var b=c.DOM,a=c.dom.Event,d=c.each,e=c.extend;c.create("tinymce.ControlManager",{ControlManager:function(f,j){var h=this,g;j=j||{};h.editor=f;h.controls={};h.onAdd=new c.util.Dispatcher(h);h.onPostRender=new c.util.Dispatcher(h);h.prefix=j.prefix||f.id+"_";h._cls={};h.onPostRender.add(function(){d(h.controls,function(i){i.postRender()})})},get:function(f){return this.controls[this.prefix+f]||this.controls[f]},setActive:function(h,f){var g=null;if(g=this.get(h)){g.setActive(f)}return g},setDisabled:function(h,f){var g=null;if(g=this.get(h)){g.setDisabled(f)}return g},add:function(g){var f=this;if(g){f.controls[g.id]=g;f.onAdd.dispatch(g,f)}return g},createControl:function(j){var o,k,g,h=this,m=h.editor,n,f;if(!h.controlFactories){h.controlFactories=[];d(m.plugins,function(i){if(i.createControl){h.controlFactories.push(i)}})}n=h.controlFactories;for(k=0,g=n.length;k1||ae==aw||ae.tagName=="BR"){return ae}}}var ao=Y.selection.getRng();var at=ao.startContainer;var an=ao.endContainer;if(at!=an&&ao.endOffset===0){var ar=ap(at,an);var aq=ar.nodeType==3?ar.length:ar.childNodes.length;ao.setEnd(ar,aq)}return ao}function ab(aq,aw,au,at,ao){var an=[],ap=-1,av,ay=-1,ar=-1,ax;R(aq.childNodes,function(aA,az){if(aA.nodeName==="UL"||aA.nodeName==="OL"){ap=az;av=aA;return false}});R(aq.childNodes,function(aA,az){if(aA.nodeName==="SPAN"&&c.getAttrib(aA,"data-mce-type")=="bookmark"){if(aA.id==aw.id+"_start"){ay=az}else{if(aA.id==aw.id+"_end"){ar=az}}}});if(ap<=0||(ayap)){R(a.grep(aq.childNodes),ao);return 0}else{ax=c.clone(au,V);R(a.grep(aq.childNodes),function(aA,az){if((ayap&&az>ap)){an.push(aA);aA.parentNode.removeChild(aA)}});if(ayap){aq.insertBefore(ax,av.nextSibling)}}at.push(ax);R(an,function(az){ax.appendChild(az)});return ax}}function al(ao,aq,au){var an=[],at,ap,ar=true;at=ak.inline||ak.block;ap=c.create(at);Z(ap);M.walk(ao,function(av){var aw;function ax(ay){var aD,aB,az,aA,aC;aC=ar;aD=ay.nodeName.toLowerCase();aB=ay.parentNode.nodeName.toLowerCase();if(ay.nodeType===1&&x(ay)){aC=ar;ar=x(ay)==="true";aA=true}if(g(aD,"br")){aw=0;if(ak.block){c.remove(ay)}return}if(ak.wrapper&&y(ay,ac,aj)){aw=0;return}if(ar&&!aA&&ak.block&&!ak.wrapper&&I(aD)){ay=c.rename(ay,at);Z(ay);an.push(ay);aw=0;return}if(ak.selector){R(af,function(aE){if("collapsed" in aE&&aE.collapsed!==ag){return}if(c.is(ay,aE.selector)&&!b(ay)){Z(ay,aE);az=true}});if(!ak.inline||az){aw=0;return}}if(ar&&!aA&&d(at,aD)&&d(aB,at)&&!(!au&&ay.nodeType===3&&ay.nodeValue.length===1&&ay.nodeValue.charCodeAt(0)===65279)&&!b(ay)){if(!aw){aw=c.clone(ap,V);ay.parentNode.insertBefore(aw,ay);an.push(aw)}aw.appendChild(ay)}else{if(aD=="li"&&aq){aw=ab(ay,aq,ap,an,ax)}else{aw=0;R(a.grep(ay.childNodes),ax);if(aA){ar=aC}aw=0}}}R(av,ax)});if(ak.wrap_links===false){R(an,function(av){function aw(aA){var az,ay,ax;if(aA.nodeName==="A"){ay=c.clone(ap,V);an.push(ay);ax=a.grep(aA.childNodes);for(az=0;az1||!H(ax))&&av===0){c.remove(ax,1);return}if(ak.inline||ak.wrapper){if(!ak.exact&&av===1){ax=aw(ax)}R(af,function(az){R(c.select(az.inline,ax),function(aB){var aA;if(az.wrap_links===false){aA=aB.parentNode;do{if(aA.nodeName==="A"){return}}while(aA=aA.parentNode)}X(az,aj,aB,az.exact?aB:null)})});if(y(ax.parentNode,ac,aj)){c.remove(ax,1);ax=0;return C}if(ak.merge_with_parents){c.getParent(ax.parentNode,function(az){if(y(az,ac,aj)){c.remove(ax,1);ax=0;return C}})}if(ax&&ak.merge_siblings!==false){ax=u(E(ax),ax);ax=u(ax,E(ax,C))}}})}if(ak){if(ae){if(ae.nodeType){aa=c.createRng();aa.setStartBefore(ae);aa.setEndAfter(ae);al(p(aa,af),null,true)}else{al(ae,null,true)}}else{if(!ag||!ak.inline||c.select("td.mceSelected,th.mceSelected").length){var am=Y.selection.getNode();if(!m&&af[0].defaultBlock&&!c.getParent(am,c.isBlock)){W(af[0].defaultBlock)}Y.selection.setRng(ad());ai=r.getBookmark();al(p(r.getRng(C),af),ai);if(ak.styles&&(ak.styles.color||ak.styles.textDecoration)){a.walk(am,K,"childNodes");K(am)}r.moveToBookmark(ai);P(r.getRng(C));Y.nodeChanged()}else{S("apply",ac,aj)}}}}function B(ab,ak,ad){var ae=T(ab),am=ae[0],ai,ah,aa,aj=true;function ac(at){var ar,aq,ap,ao,av,au;if(at.nodeType===1&&x(at)){av=aj;aj=x(at)==="true";au=true}ar=a.grep(at.childNodes);if(aj&&!au){for(aq=0,ap=ae.length;aq=0;aa--){Z=af[aa].selector;if(!Z){return C}for(ae=ab.length-1;ae>=0;ae--){if(c.is(ab[ae],Z)){return C}}}}return V}a.extend(this,{get:T,register:l,apply:W,remove:B,toggle:F,match:k,matchAll:v,matchNode:y,canApply:z});j();U();function h(Z,aa){if(g(Z,aa.inline)){return C}if(g(Z,aa.block)){return C}if(aa.selector){return c.is(Z,aa.selector)}}function g(aa,Z){aa=aa||"";Z=Z||"";aa=""+(aa.nodeName||aa);Z=""+(Z.nodeName||Z);return aa.toLowerCase()==Z.toLowerCase()}function N(aa,Z){var ab=c.getStyle(aa,Z);if(Z=="color"||Z=="backgroundColor"){ab=c.toHex(ab)}if(Z=="fontWeight"&&ab==700){ab="bold"}return""+ab}function q(Z,aa){if(typeof(Z)!="string"){Z=Z(aa)}else{if(aa){Z=Z.replace(/%(\w+)/g,function(ac,ab){return aa[ab]||ac})}}return Z}function f(Z){return Z&&Z.nodeType===3&&/^([\t \r\n]+|)$/.test(Z.nodeValue)}function Q(ab,aa,Z){var ac=c.create(aa,Z);ab.parentNode.insertBefore(ac,ab);ac.appendChild(ab);return ac}function p(Z,ak,ac){var an,al,af,aj,ab=Z.startContainer,ag=Z.startOffset,ap=Z.endContainer,ai=Z.endOffset;function am(ax){var ar,av,aw,au,at,aq;ar=av=ax?ab:ap;at=ax?"previousSibling":"nextSibling";aq=c.getRoot();if(ar.nodeType==3&&!f(ar)){if(ax?ag>0:aial?al:ag];if(ab.nodeType==3){ag=0}}if(ap.nodeType==1&&ap.hasChildNodes()){al=ap.childNodes.length-1;ap=ap.childNodes[ai>al?al:ai-1];if(ap.nodeType==3){ai=ap.nodeValue.length}}function ao(ar){var aq=ar;while(aq){if(aq.nodeType===1&&x(aq)){return x(aq)==="false"?aq:ar}aq=aq.parentNode}return ar}function ah(ar,aw,ay){var av,at,ax,aq;function au(aA,aC){var aD,az,aB=aA.nodeValue;if(typeof(aC)=="undefined"){aC=ay?aB.length:0}if(ay){aD=aB.lastIndexOf(" ",aC);az=aB.lastIndexOf("\u00a0",aC);aD=aD>az?aD:az;if(aD!==-1&&!ac){aD++}}else{aD=aB.indexOf(" ",aC);az=aB.indexOf("\u00a0",aC);aD=aD!==-1&&(az===-1||aD0&&af.node.nodeType===3&&af.node.nodeValue.charAt(af.offset-1)===" "){if(af.offset>1){ap=af.node;ap.splitText(af.offset-1)}}}}if(ak[0].inline||ak[0].block_expand){if(!ak[0].inline||(ab.nodeType!=3||ag===0)){ab=am(true)}if(!ak[0].inline||(ap.nodeType!=3||ai===ap.nodeValue.length)){ap=am()}}if(ak[0].selector&&ak[0].expand!==V&&!ak[0].inline){ab=ad(ab,"previousSibling");ap=ad(ap,"nextSibling")}if(ak[0].block||ak[0].selector){ab=aa(ab,"previousSibling");ap=aa(ap,"nextSibling");if(ak[0].block){if(!H(ab)){ab=am(true)}if(!H(ap)){ap=am()}}}if(ab.nodeType==1){ag=s(ab);ab=ab.parentNode}if(ap.nodeType==1){ai=s(ap)+1;ap=ap.parentNode}return{startContainer:ab,startOffset:ag,endContainer:ap,endOffset:ai}}function X(af,ae,ac,Z){var ab,aa,ad;if(!h(ac,af)){return V}if(af.remove!="all"){R(af.styles,function(ah,ag){ah=q(ah,ae);if(typeof(ag)==="number"){ag=ah;Z=0}if(!Z||g(N(Z,ag),ah)){c.setStyle(ac,ag,"")}ad=1});if(ad&&c.getAttrib(ac,"style")==""){ac.removeAttribute("style");ac.removeAttribute("data-mce-style")}R(af.attributes,function(ai,ag){var ah;ai=q(ai,ae);if(typeof(ag)==="number"){ag=ai;Z=0}if(!Z||g(c.getAttrib(Z,ag),ai)){if(ag=="class"){ai=c.getAttrib(ac,ag);if(ai){ah="";R(ai.split(/\s+/),function(aj){if(/mce\w+/.test(aj)){ah+=(ah?" ":"")+aj}});if(ah){c.setAttrib(ac,ag,ah);return}}}if(ag=="class"){ac.removeAttribute("className")}if(e.test(ag)){ac.removeAttribute("data-mce-"+ag)}ac.removeAttribute(ag)}});R(af.classes,function(ag){ag=q(ag,ae);if(!Z||c.hasClass(Z,ag)){c.removeClass(ac,ag)}});aa=c.getAttribs(ac);for(ab=0;abab?ab:ad]}if(Z.nodeType===3&&ae&&ad>=Z.nodeValue.length){Z=new t(Z,Y.getBody()).next()||Z}if(Z.nodeType===3&&!ae&&ad===0){Z=new t(Z,Y.getBody()).prev()||Z}return Z}function S(ai,Z,ag){var aj="_mce_caret",aa=Y.settings.caret_debug;function ab(an){var am=c.create("span",{id:aj,"data-mce-bogus":true,style:aa?"color:red":""});if(an){am.appendChild(Y.getDoc().createTextNode(G))}return am}function ah(an,am){while(an){if((an.nodeType===3&&an.nodeValue!==G)||an.childNodes.length>1){return false}if(am&&an.nodeType===1){am.push(an)}an=an.firstChild}return true}function ae(am){while(am){if(am.id===aj){return am}am=am.parentNode}}function ad(am){var an;if(am){an=new t(am,am);for(am=an.current();am;am=an.next()){if(am.nodeType===3){return am}}}}function ac(ao,an){var ap,am;if(!ao){ao=ae(r.getStart());if(!ao){while(ao=c.get(aj)){ac(ao,false)}}}else{am=r.getRng(true);if(ah(ao)){if(an!==false){am.setStartBefore(ao);am.setEndBefore(ao)}c.remove(ao)}else{ap=ad(ao);if(ap.nodeValue.charAt(0)===G){ap=ap.deleteData(0,1)}c.remove(ao,1)}r.setRng(am)}}function af(){var ao,am,at,ar,ap,an,aq;ao=r.getRng(true);ar=ao.startOffset;an=ao.startContainer;aq=an.nodeValue;am=ae(r.getStart());if(am){at=ad(am)}if(aq&&ar>0&&ar=0;aq--){ao.appendChild(c.clone(av[aq],false));ao=ao.firstChild}ao.appendChild(c.doc.createTextNode(G));ao=ao.firstChild;c.insertAfter(au,aw);r.setCursorLocation(ao,1)}}function al(){var an,am,ao;am=ae(r.getStart());if(am&&!c.isEmpty(am)){a.walk(am,function(ap){if(ap.nodeType==1&&ap.id!==aj&&!c.isEmpty(ap)){c.setAttrib(ap,"data-mce-bogus",null)}},"childNodes")}}if(!self._hasCaretEvents){Y.onBeforeGetContent.addToTop(function(){var am=[],an;if(ah(ae(r.getStart()),am)){an=am.length;while(an--){c.setAttrib(am[an],"data-mce-bogus","1")}}});a.each("onMouseUp onKeyUp".split(" "),function(am){Y[am].addToTop(function(){ac();al()})});Y.onKeyDown.addToTop(function(am,ao){var an=ao.keyCode;if(an==8||an==37||an==39){ac(ae(r.getStart()))}al()});r.onSetContent.add(al);self._hasCaretEvents=true}if(ai=="apply"){af()}else{ak()}}function P(aa){var Z=aa.startContainer,ag=aa.startOffset,ac,af,ae,ab,ad;if(Z.nodeType==3&&ag>=Z.nodeValue.length){ag=s(Z);Z=Z.parentNode;ac=true}if(Z.nodeType==1){ab=Z.childNodes;Z=ab[Math.min(ag,ab.length-1)];af=new t(Z,c.getParent(Z,c.isBlock));if(ag>ab.length-1||ac){af.next()}for(ae=af.current();ae;ae=af.next()){if(ae.nodeType==3&&!f(ae)){ad=c.create("a",null,G);ae.parentNode.insertBefore(ad,ae);aa.setStart(ae,0);r.setRng(aa);c.remove(ad);return}}}}}})(tinymce);tinymce.onAddEditor.add(function(e,a){var d,h,g,c=a.settings;function b(j,i){e.each(i,function(l,k){if(l){g.setStyle(j,k,l)}});g.rename(j,"span")}function f(i,j){g=i.dom;if(c.convert_fonts_to_spans){e.each(g.select("font,u,strike",j.node),function(k){d[k.nodeName.toLowerCase()](a.dom,k)})}}if(c.inline_styles){h=e.explode(c.font_size_legacy_values);d={font:function(j,i){b(i,{backgroundColor:i.style.backgroundColor,color:i.color,fontFamily:i.face,fontSize:h[parseInt(i.size,10)-1]})},u:function(j,i){b(i,{textDecoration:"underline"})},strike:function(j,i){b(i,{textDecoration:"line-through"})}};a.onPreProcess.add(f);a.onSetContent.add(f);a.onInit.add(function(){a.selection.onSetContent.add(f)})}});(function(b){var a=b.dom.TreeWalker;b.EnterKey=function(e){var h=e.dom,d=e.selection,c=e.settings,g=e.undoManager;function f(y){var u=d.getRng(true),C,i,x,t,o,H,n,j,l,s,E,v,z;function B(I){return I&&h.isBlock(I)&&!/^(TD|TH|CAPTION)$/.test(I.nodeName)&&!/^(fixed|absolute)/i.test(I.style.position)&&h.getContentEditable(I)!=="true"}function m(J){var O,M,I,P,N,L=J,K;I=h.createRng();if(J.hasChildNodes()){O=new a(J,J);while(M=O.current()){if(M.nodeType==3){I.setStart(M,0);I.setEnd(M,0);break}if(/^(BR|IMG)$/.test(M.nodeName)){I.setStartBefore(M);I.setEndBefore(M);break}L=M;M=O.next()}if(!M){I.setStart(L,0);I.setEnd(L,0)}}else{if(J.nodeName=="BR"){if(J.nextSibling&&h.isBlock(J.nextSibling)){if(!H||H<9){K=h.create("br");J.parentNode.insertBefore(K,J)}I.setStartBefore(J);I.setEndBefore(J)}else{I.setStartAfter(J);I.setEndAfter(J)}}else{I.setStart(J,0);I.setEnd(J,0)}}d.setRng(I);h.remove(K);N=h.getViewPort(e.getWin());P=h.getPos(J).y;if(PN.y+N.h){e.getWin().scrollTo(0,P"}return M}function p(L){var K,J,I;if(x.nodeType==3&&(L?t>0:t=x.nodeValue.length){if(!b.isIE&&!A()){J=h.create("br");u.insertNode(J);u.setStartAfter(J);u.setEndAfter(J);I=true}}J=h.create("br");u.insertNode(J);if(b.isIE&&s=="PRE"&&(!H||H<8)){J.parentNode.insertBefore(h.doc.createTextNode("\r"),J)}if(!I){u.setStartAfter(J);u.setEndAfter(J)}else{u.setStartBefore(J);u.setEndBefore(J)}d.setRng(u);g.add()}function r(I){do{if(I.nodeType===3){I.nodeValue=I.nodeValue.replace(/^[\r\n]+/,"")}I=I.firstChild}while(I)}function F(K){var I=h.getRoot(),J,L;J=K;while(J!==I&&h.getContentEditable(J)!=="false"){if(h.getContentEditable(J)==="true"){L=J}J=J.parentNode}return J!==I?L:I}if(!u.collapsed){e.execCommand("Delete");return}if(y.isDefaultPrevented()){return}x=u.startContainer;t=u.startOffset;v=c.forced_root_block;v=v?v.toUpperCase():"";H=h.doc.documentMode;if(x.nodeType==1&&x.hasChildNodes()){z=t>x.childNodes.length-1;x=x.childNodes[Math.min(t,x.childNodes.length-1)]||x;t=0}i=F(x);if(!i){return}g.beforeChange();if(!h.isBlock(i)&&i!=h.getRoot()){if(!v||y.shiftKey){G()}return}if((v&&!y.shiftKey)||(!v&&y.shiftKey)){x=k(x,t)}o=h.getParent(x,h.isBlock);l=o?h.getParent(o.parentNode,h.isBlock):null;s=o?o.nodeName.toUpperCase():"";E=l?l.nodeName.toUpperCase():"";if(s=="LI"&&h.isEmpty(o)){if(/^(UL|OL|LI)$/.test(l.parentNode.nodeName)){return false}D();return}if(s=="PRE"&&c.br_in_pre!==false){if(!y.shiftKey){G();return}}else{if((!v&&!y.shiftKey&&s!="LI")||(v&&y.shiftKey)){G();return}}v=v||"P";if(p()){if(/^(H[1-6]|PRE)$/.test(s)&&E!="HGROUP"){n=q(v)}else{n=q()}if(c.end_container_on_empty_block&&B(l)&&h.isEmpty(o)){n=h.split(l,o)}else{h.insertAfter(n,o)}}else{if(p(true)){n=o.parentNode.insertBefore(q(),o)}else{C=u.cloneRange();C.setEndAfter(o);j=C.extractContents();r(j);n=j.firstChild;h.insertAfter(j,o)}}h.setAttrib(n,"id","");m(n);g.add()}e.onKeyDown.add(function(j,i){if(i.keyCode==13){if(f(i)!==false){i.preventDefault()}}})}})(tinymce); \ No newline at end of file diff --git a/lib/editor/tinymce/tiny_mce/3.5/tiny_mce_dev.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/tiny_mce_dev.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/tiny_mce_dev.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/tiny_mce_dev.js diff --git a/lib/editor/tinymce/tiny_mce/3.5.1.1/tiny_mce_jquery.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/tiny_mce_jquery.js new file mode 100644 index 00000000000..e29f2ce9491 --- /dev/null +++ b/lib/editor/tinymce/tiny_mce/3.5.1.1/tiny_mce_jquery.js @@ -0,0 +1 @@ +(function(e){var a=/^\s*|\s*$/g,b,d="B".replace(/A(.)|B/,"$1")==="$1";var c={majorVersion:"@@tinymce_major_version@@",minorVersion:"@@tinymce_minor_version@@",releaseDate:"@@tinymce_release_date@@",_init:function(){var s=this,q=document,o=navigator,g=o.userAgent,m,f,l,k,j,r;s.isOpera=e.opera&&opera.buildNumber;s.isWebKit=/WebKit/.test(g);s.isIE=!s.isWebKit&&!s.isOpera&&(/MSIE/gi).test(g)&&(/Explorer/gi).test(o.appName);s.isIE6=s.isIE&&/MSIE [56]/.test(g);s.isIE7=s.isIE&&/MSIE [7]/.test(g);s.isIE8=s.isIE&&/MSIE [8]/.test(g);s.isIE9=s.isIE&&/MSIE [9]/.test(g);s.isGecko=!s.isWebKit&&/Gecko/.test(g);s.isMac=g.indexOf("Mac")!=-1;s.isAir=/adobeair/i.test(g);s.isIDevice=/(iPad|iPhone)/.test(g);s.isIOS5=s.isIDevice&&g.match(/AppleWebKit\/(\d*)/)[1]>=534;if(e.tinyMCEPreInit){s.suffix=tinyMCEPreInit.suffix;s.baseURL=tinyMCEPreInit.base;s.query=tinyMCEPreInit.query;return}s.suffix="";f=q.getElementsByTagName("base");for(m=0;m0?b:[f.scope]);if(e===false){break}}a.inDispatch=false;return e}});(function(){var a=tinymce.each;tinymce.create("tinymce.util.URI",{URI:function(e,g){var f=this,i,d,c,h;e=tinymce.trim(e);g=f.settings=g||{};if(/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e)){f.source=e;return}if(e.indexOf("/")===0&&e.indexOf("//")!==0){e=(g.base_uri?g.base_uri.protocol||"http":"http")+"://mce_host"+e}if(!/^[\w\-]*:?\/\//.test(e)){h=g.base_uri?g.base_uri.path:new tinymce.util.URI(location.href).directory;e=((g.base_uri&&g.base_uri.protocol)||"http")+"://mce_host"+f.toAbsPath(h,e)}e=e.replace(/@@/g,"(mce_at)");e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);a(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(b,j){var k=e[j];if(k){k=k.replace(/\(mce_at\)/g,"@@")}f[b]=k});c=g.base_uri;if(c){if(!f.protocol){f.protocol=c.protocol}if(!f.userInfo){f.userInfo=c.userInfo}if(!f.port&&f.host==="mce_host"){f.port=c.port}if(!f.host||f.host==="mce_host"){f.host=c.host}f.source=""}},setPath:function(c){var b=this;c=/^(.*?)\/?(\w+)?$/.exec(c);b.path=c[0];b.directory=c[1];b.file=c[2];b.source="";b.getURI()},toRelative:function(b){var d=this,f;if(b==="./"){return b}b=new tinymce.util.URI(b,{base_uri:d});if((b.host!="mce_host"&&d.host!=b.host&&b.host)||d.port!=b.port||d.protocol!=b.protocol){return b.getURI()}var c=d.getURI(),e=b.getURI();if(c==e||(c.charAt(c.length-1)=="/"&&c.substr(0,c.length-1)==e)){return c}f=d.toRelPath(d.path,b.path);if(b.query){f+="?"+b.query}if(b.anchor){f+="#"+b.anchor}return f},toAbsolute:function(b,c){b=new tinymce.util.URI(b,{base_uri:this});return b.getURI(this.host==b.host&&this.protocol==b.protocol?c:0)},toRelPath:function(g,h){var c,f=0,d="",e,b;g=g.substring(0,g.lastIndexOf("/"));g=g.split("/");c=h.split("/");if(g.length>=c.length){for(e=0,b=g.length;e=c.length||g[e]!=c[e]){f=e+1;break}}}if(g.length=g.length||g[e]!=c[e]){f=e+1;break}}}if(f===1){return h}for(e=0,b=g.length-(f-1);e=0;c--){if(f[c].length===0||f[c]==="."){continue}if(f[c]===".."){b++;continue}if(b>0){b--;continue}h.push(f[c])}c=e.length-b;if(c<=0){g=h.reverse().join("/")}else{g=e.slice(0,c).join("/")+"/"+h.reverse().join("/")}if(g.indexOf("/")!==0){g="/"+g}if(d&&g.lastIndexOf("/")!==g.length-1){g+=d}return g},getURI:function(d){var c,b=this;if(!b.source||d){c="";if(!d){if(b.protocol){c+=b.protocol+"://"}if(b.userInfo){c+=b.userInfo+"@"}if(b.host){c+=b.host}if(b.port){c+=":"+b.port}}if(b.path){c+=b.path}if(b.query){c+="?"+b.query}if(b.anchor){c+="#"+b.anchor}b.source=c}return b.source}})})();(function(){var a=tinymce.each;tinymce.create("static tinymce.util.Cookie",{getHash:function(d){var b=this.get(d),c;if(b){a(b.split("&"),function(e){e=e.split("=");c=c||{};c[unescape(e[0])]=unescape(e[1])})}return c},setHash:function(j,b,g,f,i,c){var h="";a(b,function(e,d){h+=(!h?"":"&")+escape(d)+"="+escape(e)});this.set(j,h,g,f,i,c)},get:function(i){var h=document.cookie,g,f=i+"=",d;if(!h){return}d=h.indexOf("; "+f);if(d==-1){d=h.indexOf(f);if(d!==0){return null}}else{d+=2}g=h.indexOf(";",d);if(g==-1){g=h.length}return unescape(h.substring(d+f.length,g))},set:function(i,b,g,f,h,c){document.cookie=i+"="+escape(b)+((g)?"; expires="+g.toGMTString():"")+((f)?"; path="+escape(f):"")+((h)?"; domain="+h:"")+((c)?"; secure":"")},remove:function(e,b){var c=new Date();c.setTime(c.getTime()-1000);this.set(e,"",c,b,c)}})})();(function(){function serialize(o,quote){var i,v,t,name;quote=quote||'"';if(o==null){return"null"}t=typeof o;if(t=="string"){v="\bb\tt\nn\ff\rr\"\"''\\\\";return quote+o.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(a,b){if(quote==='"'&&a==="'"){return a}i=v.indexOf(b);if(i+1){return"\\"+v.charAt(i+1)}a=b.charCodeAt().toString(16);return"\\u"+"0000".substring(a.length)+a})+quote}if(t=="object"){if(o.hasOwnProperty&&o instanceof Array){for(i=0,v="[";i0?",":"")+serialize(o[i],quote)}return v+"]"}v="{";for(name in o){if(o.hasOwnProperty(name)){v+=typeof o[name]!="function"?(v.length>1?","+quote:quote)+name+quote+":"+serialize(o[name],quote):""}}return v+"}"}return""+o}tinymce.util.JSON={serialize:serialize,parse:function(s){try{return eval("("+s+")")}catch(ex){}}}})();tinymce.create("static tinymce.util.XHR",{send:function(g){var a,e,b=window,h=0;function f(){if(!g.async||a.readyState==4||h++>10000){if(g.success&&h<10000&&a.status==200){g.success.call(g.success_scope,""+a.responseText,a,g)}else{if(g.error){g.error.call(g.error_scope,h>10000?"TIMED_OUT":"GENERAL",a,g)}}a=null}else{b.setTimeout(f,10)}}g.scope=g.scope||this;g.success_scope=g.success_scope||g.scope;g.error_scope=g.error_scope||g.scope;g.async=g.async===false?false:true;g.data=g.data||"";function d(i){a=0;try{a=new ActiveXObject(i)}catch(c){}return a}a=b.XMLHttpRequest?new XMLHttpRequest():d("Microsoft.XMLHTTP")||d("Msxml2.XMLHTTP");if(a){if(a.overrideMimeType){a.overrideMimeType(g.content_type)}a.open(g.type||(g.data?"POST":"GET"),g.url,g.async);if(g.content_type){a.setRequestHeader("Content-Type",g.content_type)}a.setRequestHeader("X-Requested-With","XMLHttpRequest");a.send(g.data);if(!g.async){return f()}e=b.setTimeout(f,10)}}});(function(){var c=tinymce.extend,b=tinymce.util.JSON,a=tinymce.util.XHR;tinymce.create("tinymce.util.JSONRequest",{JSONRequest:function(d){this.settings=c({},d);this.count=0},send:function(f){var e=f.error,d=f.success;f=c(this.settings,f);f.success=function(h,g){h=b.parse(h);if(typeof(h)=="undefined"){h={error:"JSON Parse error."}}if(h.error){e.call(f.error_scope||f.scope,h.error,g)}else{d.call(f.success_scope||f.scope,h.result)}};f.error=function(h,g){if(e){e.call(f.error_scope||f.scope,h,g)}};f.data=b.serialize({id:f.id||"c"+(this.count++),method:f.method,params:f.params});f.content_type="application/json";a.send(f)},"static":{sendRPC:function(d){return new tinymce.util.JSONRequest().send(d)}}})}());(function(a){a.VK={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,modifierPressed:function(b){return b.shiftKey||b.ctrlKey||b.altKey}}})(tinymce);tinymce.util.Quirks=function(d){var l=tinymce.VK,r=l.BACKSPACE,s=l.DELETE,o=d.dom,A=d.selection,q=d.settings;function c(E,D){try{d.getDoc().execCommand(E,false,D)}catch(C){}}function h(){function C(F){var D,H,E,G;D=A.getRng();H=o.getParent(D.startContainer,o.isBlock);if(F){H=o.getNext(H,o.isBlock)}if(H){E=H.firstChild;while(E&&E.nodeType==3&&E.nodeValue.length===0){E=E.nextSibling}if(E&&E.nodeName==="SPAN"){G=E.cloneNode(false)}}d.getDoc().execCommand(F?"ForwardDelete":"Delete",false,null);H=o.getParent(D.startContainer,o.isBlock);tinymce.each(o.select("span.Apple-style-span,font.Apple-style-span",H),function(I){var J=A.getBookmark();if(G){o.replace(G.cloneNode(false),I,true)}else{o.remove(I,true)}A.moveToBookmark(J)})}d.onKeyDown.add(function(D,F){var E;E=F.keyCode==s;if(!F.isDefaultPrevented()&&(E||F.keyCode==r)&&!l.modifierPressed(F)){F.preventDefault();C(E)}});d.addCommand("Delete",function(){C()})}function B(){function D(F,I){var E,H,G=I?"start":"end";E=F[G+"Container"];H=F[G+"Offset"];if(E.nodeType==1&&E.hasChildNodes()){E=E.childNodes[Math.min(I?H:(H>0?H-1:0),E.childNodes.length-1)]}return E}function C(H,L){var G,K,F,I,J=L?"start":"end",E;G=H[J+"Container"];K=H[J+"Offset"];F=o.getRoot();if(G.nodeType==1){E=K>=G.childNodes.length;G=D(H,L);if(G.nodeType==3){K=L&&!E?0:G.nodeValue.length}}if(G.nodeType==3&&((L&&K>0)||(!L&&K7){return}c("RespectVisibilityInDesign",true);o.addClass(d.getBody(),"mceHideBrInPre");d.parser.addNodeFilter("pre",function(D,F){var G=D.length,I,E,J,H;while(G--){I=D[G].getAll("br");E=I.length;while(E--){J=I[E];H=J.prev;if(H&&H.type===3&&H.value.charAt(H.value-1)!="\n"){H.value+="\n"}else{J.parent.insert(new tinymce.html.Node("#text",3),J,true).value="\n"}}}});d.serializer.addNodeFilter("pre",function(D,F){var G=D.length,I,E,J,H;while(G--){I=D[G].getAll("br");E=I.length;while(E--){J=I[E];H=J.prev;if(H&&H.type==3){H.value=H.value.replace(/\r?\n$/,"")}}}})}function f(){o.bind(d.getBody(),"mouseup",function(E){var D,C=A.getNode();if(C.nodeName=="IMG"){if(D=o.getStyle(C,"width")){o.setAttrib(C,"width",D.replace(/[^0-9%]+/g,""));o.setStyle(C,"width","")}if(D=o.getStyle(C,"height")){o.setAttrib(C,"height",D.replace(/[^0-9%]+/g,""));o.setStyle(C,"height","")}}})}function p(){d.onKeyDown.add(function(I,J){var H,C,D,F,G,K,E;H=J.keyCode==s;if(!J.isDefaultPrevented()&&(H||J.keyCode==r)&&!l.modifierPressed(J)){C=A.getRng();D=C.startContainer;F=C.startOffset;E=C.collapsed;if(D.nodeType==3&&D.nodeValue.length>0&&((F===0&&!E)||(E&&F===(H?0:1)))){nonEmptyElements=I.schema.getNonEmptyElements();J.preventDefault();G=o.create("br",{id:"__tmp"});D.parentNode.insertBefore(G,D);I.getDoc().execCommand(H?"ForwardDelete":"Delete",false,null);D=A.getRng().startContainer;K=D.previousSibling;if(K&&K.nodeType==1&&!o.isBlock(K)&&o.isEmpty(K)&&!nonEmptyElements[K.nodeName.toLowerCase()]){o.remove(K)}o.remove("__tmp")}}})}function e(){d.onKeyDown.add(function(G,H){var E,D,I,C,F;if(H.isDefaultPrevented()||H.keyCode!=l.BACKSPACE){return}E=A.getRng();D=E.startContainer;I=E.startOffset;C=o.getRoot();F=D;if(!E.collapsed||I!==0){return}while(F&&F.parentNode&&F.parentNode.firstChild==F&&F.parentNode!=C){F=F.parentNode}if(F.tagName==="BLOCKQUOTE"){G.formatter.toggle("blockquote",null,F);E.setStart(D,0);E.setEnd(D,0);A.setRng(E);A.collapse(false)}})}function k(){function C(){d._refreshContentEditable();c("StyleWithCSS",false);c("enableInlineTableEditing",false);if(!q.object_resizing){c("enableObjectResizing",false)}}if(!q.readonly){d.onBeforeExecCommand.add(C);d.onMouseDown.add(C)}}function n(){function C(D,E){tinymce.each(o.select("a"),function(H){var F=H.parentNode,G=o.getRoot();if(F.lastChild===H){while(F&&!o.isBlock(F)){if(F.parentNode.lastChild!==F||F===G){return}F=F.parentNode}o.add(F,"br",{"data-mce-bogus":1})}})}d.onExecCommand.add(function(D,E){if(E==="CreateLink"){C(D)}});d.onSetContent.add(A.onSetContent.add(C))}function t(){if(q.forced_root_block){d.onInit.add(function(){c("DefaultParagraphSeparator",q.forced_root_block)})}}function a(){function C(E,D){if(!E||!D.initial){d.execCommand("mceRepaint")}}d.onUndo.add(C);d.onRedo.add(C);d.onSetContent.add(C)}function j(){d.onKeyDown.add(function(C,D){if(!D.isDefaultPrevented()&&D.keyCode==8&&A.getNode().nodeName=="IMG"){D.preventDefault();C.undoManager.beforeChange();o.remove(A.getNode());C.undoManager.add()}})}v();e();B();if(tinymce.isWebKit){p();h();u();x();t();if(tinymce.isIDevice){i()}}if(tinymce.isIE){m();z();g();f();j()}if(tinymce.isGecko){m();b();y();k();n();a()}};(function(j){var a,g,d,k=/[&<>\"\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,b=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,f=/[<>&\"\']/g,c=/&(#x|#)?([\w]+);/g,i={128:"\u20AC",130:"\u201A",131:"\u0192",132:"\u201E",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02C6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017D",145:"\u2018",146:"\u2019",147:"\u201C",148:"\u201D",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02DC",153:"\u2122",154:"\u0161",155:"\u203A",156:"\u0153",158:"\u017E",159:"\u0178"};g={'"':""","'":"'","<":"<",">":">","&":"&"};d={"<":"<",">":">","&":"&",""":'"',"'":"'"};function h(l){var m;m=document.createElement("div");m.innerHTML=l;return m.textContent||m.innerText||l}function e(m,p){var n,o,l,q={};if(m){m=m.split(",");p=p||10;for(n=0;n1){return"&#"+(((n.charCodeAt(0)-55296)*1024)+(n.charCodeAt(1)-56320)+65536)+";"}return g[n]||"&#"+n.charCodeAt(0)+";"})},encodeNamed:function(n,l,m){m=m||a;return n.replace(l?k:b,function(o){return g[o]||m[o]||o})},getEncodeFunc:function(l,o){var p=j.html.Entities;o=e(o)||a;function m(r,q){return r.replace(q?k:b,function(s){return g[s]||o[s]||"&#"+s.charCodeAt(0)+";"||s})}function n(r,q){return p.encodeNamed(r,q,o)}l=j.makeMap(l.replace(/\+/g,","));if(l.named&&l.numeric){return m}if(l.named){if(o){return n}return p.encodeNamed}if(l.numeric){return p.encodeNumeric}return p.encodeRaw},decode:function(l){return l.replace(c,function(n,m,o){if(m){o=parseInt(o,m.length===2?16:10);if(o>65535){o-=65536;return String.fromCharCode(55296+(o>>10),56320+(o&1023))}else{return i[o]||String.fromCharCode(o)}}return d[n]||a[n]||h(n)})}}})(tinymce);tinymce.html.Styles=function(d,f){var k=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,h=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,b=/\s*([^:]+):\s*([^;]+);?/g,l=/\s+$/,m=/rgb/,e,g,a={},j;d=d||{};j="\\\" \\' \\; \\: ; : \uFEFF".split(" ");for(g=0;g1?r:"0"+r}return"#"+o(q)+o(p)+o(i)}return{toHex:function(i){return i.replace(k,c)},parse:function(s){var z={},q,n,x,r,v=d.url_converter,y=d.url_converter_scope||this;function p(D,G){var F,C,B,E;F=z[D+"-top"+G];if(!F){return}C=z[D+"-right"+G];if(F!=C){return}B=z[D+"-bottom"+G];if(C!=B){return}E=z[D+"-left"+G];if(B!=E){return}z[D+G]=E;delete z[D+"-top"+G];delete z[D+"-right"+G];delete z[D+"-bottom"+G];delete z[D+"-left"+G]}function u(C){var D=z[C],B;if(!D||D.indexOf(" ")<0){return}D=D.split(" ");B=D.length;while(B--){if(D[B]!==D[0]){return false}}z[C]=D[0];return true}function A(D,C,B,E){if(!u(C)){return}if(!u(B)){return}if(!u(E)){return}z[D]=z[C]+" "+z[B]+" "+z[E];delete z[C];delete z[B];delete z[E]}function t(B){r=true;return a[B]}function i(C,B){if(r){C=C.replace(/\uFEFF[0-9]/g,function(D){return a[D]})}if(!B){C=C.replace(/\\([\'\";:])/g,"$1")}return C}function o(C,B,F,E,G,D){G=G||D;if(G){G=i(G);return"'"+G.replace(/\'/g,"\\'")+"'"}B=i(B||F||E);if(v){B=v.call(y,B,"style")}return"url('"+B.replace(/\'/g,"\\'")+"')"}if(s){s=s.replace(/\\[\"\';:\uFEFF]/g,t).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(B){return B.replace(/[;:]/g,t)});while(q=b.exec(s)){n=q[1].replace(l,"").toLowerCase();x=q[2].replace(l,"");if(n&&x.length>0){if(n==="font-weight"&&x==="700"){x="bold"}else{if(n==="color"||n==="background-color"){x=x.toLowerCase()}}x=x.replace(k,c);x=x.replace(h,o);z[n]=r?i(x,true):x}b.lastIndex=q.index+q[0].length}p("border","");p("border","-width");p("border","-color");p("border","-style");p("padding","");p("margin","");A("border","border-width","border-style","border-color");if(z.border==="medium none"){delete z.border}}return z},serialize:function(p,r){var o="",n,q;function i(t){var x,u,s,v;x=f.styles[t];if(x){for(u=0,s=x.length;u0){o+=(o.length>0?" ":"")+t+": "+v+";"}}}}if(r&&f&&f.styles){i("*");i(r)}else{for(n in p){q=p[n];if(q!==e&&q.length>0){o+=(o.length>0?" ":"")+n+": "+q+";"}}}return o}}};(function(f){var a={},e=f.makeMap,g=f.each;function d(j,i){return j.split(i||",")}function h(m,l){var j,k={};function i(n){return n.replace(/[A-Z]+/g,function(o){return i(m[o])})}for(j in m){if(m.hasOwnProperty(j)){m[j]=i(m[j])}}i(l).replace(/#/g,"#text").replace(/(\w+)\[([^\]]+)\]\[([^\]]*)\]/g,function(q,o,n,p){n=d(n,"|");k[o]={attributes:e(n),attributesOrder:n,children:e(p,"|",{"#comment":{}})}});return k}function b(){var i=a.html5;if(!i){i=a.html5=h({A:"id|accesskey|class|dir|draggable|item|hidden|itemprop|role|spellcheck|style|subject|title",B:"#|a|abbr|area|audio|b|bdo|br|button|canvas|cite|code|command|datalist|del|dfn|em|embed|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|meta|meter|noscript|object|output|progress|q|ruby|samp|script|select|small|span|strong|sub|sup|svg|textarea|time|var|video",C:"#|a|abbr|area|address|article|aside|audio|b|bdo|blockquote|br|button|canvas|cite|code|command|datalist|del|details|dfn|dialog|div|dl|em|embed|fieldset|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|menu|meta|meter|nav|noscript|ol|object|output|p|pre|progress|q|ruby|samp|script|section|select|small|span|strong|style|sub|sup|svg|table|textarea|time|ul|var|video"},"html[A|manifest][body|head]head[A][base|command|link|meta|noscript|script|style|title]title[A][#]base[A|href|target][]link[A|href|rel|media|type|sizes][]meta[A|http-equiv|name|content|charset][]style[A|type|media|scoped][#]script[A|charset|type|src|defer|async][#]noscript[A][C]body[A][C]section[A][C]nav[A][C]article[A][C]aside[A][C]h1[A][B]h2[A][B]h3[A][B]h4[A][B]h5[A][B]h6[A][B]hgroup[A][h1|h2|h3|h4|h5|h6]header[A][C]footer[A][C]address[A][C]p[A][B]br[A][]pre[A][B]dialog[A][dd|dt]blockquote[A|cite][C]ol[A|start|reversed][li]ul[A][li]li[A|value][C]dl[A][dd|dt]dt[A][B]dd[A][C]a[A|href|target|ping|rel|media|type][B]em[A][B]strong[A][B]small[A][B]cite[A][B]q[A|cite][B]dfn[A][B]abbr[A][B]code[A][B]var[A][B]samp[A][B]kbd[A][B]sub[A][B]sup[A][B]i[A][B]b[A][B]mark[A][B]progress[A|value|max][B]meter[A|value|min|max|low|high|optimum][B]time[A|datetime][B]ruby[A][B|rt|rp]rt[A][B]rp[A][B]bdo[A][B]span[A][B]ins[A|cite|datetime][B]del[A|cite|datetime][B]figure[A][C|legend|figcaption]figcaption[A][C]img[A|alt|src|height|width|usemap|ismap][]iframe[A|name|src|height|width|sandbox|seamless][]embed[A|src|height|width|type][]object[A|data|type|height|width|usemap|name|form|classid][param]param[A|name|value][]details[A|open][C|legend]command[A|type|label|icon|disabled|checked|radiogroup][]menu[A|type|label][C|li]legend[A][C|B]div[A][C]source[A|src|type|media][]audio[A|src|autobuffer|autoplay|loop|controls][source]video[A|src|autobuffer|autoplay|loop|controls|width|height|poster][source]hr[A][]form[A|accept-charset|action|autocomplete|enctype|method|name|novalidate|target][C]fieldset[A|disabled|form|name][C|legend]label[A|form|for][B]input[A|type|accept|alt|autocomplete|checked|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|height|list|max|maxlength|min|multiple|pattern|placeholder|readonly|required|size|src|step|width|files|value|name][]button[A|autofocus|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|name|value|type][B]select[A|autofocus|disabled|form|multiple|name|size][option|optgroup]datalist[A][B|option]optgroup[A|disabled|label][option]option[A|disabled|selected|label|value][]textarea[A|autofocus|disabled|form|maxlength|name|placeholder|readonly|required|rows|cols|wrap][]keygen[A|autofocus|challenge|disabled|form|keytype|name][]output[A|for|form|name][B]canvas[A|width|height][]map[A|name][B|C]area[A|shape|coords|href|alt|target|media|rel|ping|type][]mathml[A][]svg[A][]table[A|summary][caption|colgroup|thead|tfoot|tbody|tr]caption[A][C]colgroup[A|span][col]col[A|span][]thead[A][tr]tfoot[A][tr]tbody[A][tr]tr[A][th|td]th[A|headers|rowspan|colspan|scope][B]td[A|headers|rowspan|colspan][C]")}return i}function c(){var i=a.html4;if(!i){i=a.html4=h({Z:"H|K|N|O|P",Y:"X|form|R|Q",ZG:"E|span|width|align|char|charoff|valign",X:"p|T|div|U|W|isindex|fieldset|table",ZF:"E|align|char|charoff|valign",W:"pre|hr|blockquote|address|center|noframes",ZE:"abbr|axis|headers|scope|rowspan|colspan|align|char|charoff|valign|nowrap|bgcolor|width|height",ZD:"[E][S]",U:"ul|ol|dl|menu|dir",ZC:"p|Y|div|U|W|table|br|span|bdo|object|applet|img|map|K|N|Q",T:"h1|h2|h3|h4|h5|h6",ZB:"X|S|Q",S:"R|P",ZA:"a|G|J|M|O|P",R:"a|H|K|N|O",Q:"noscript|P",P:"ins|del|script",O:"input|select|textarea|label|button",N:"M|L",M:"em|strong|dfn|code|q|samp|kbd|var|cite|abbr|acronym",L:"sub|sup",K:"J|I",J:"tt|i|b|u|s|strike",I:"big|small|font|basefont",H:"G|F",G:"br|span|bdo",F:"object|applet|img|map|iframe",E:"A|B|C",D:"accesskey|tabindex|onfocus|onblur",C:"onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup",B:"lang|xml:lang|dir",A:"id|class|style|title"},"script[id|charset|type|language|src|defer|xml:space][]style[B|id|type|media|title|xml:space][]object[E|declare|classid|codebase|data|type|codetype|archive|standby|width|height|usemap|name|tabindex|align|border|hspace|vspace][#|param|Y]param[id|name|value|valuetype|type][]p[E|align][#|S]a[E|D|charset|type|name|href|hreflang|rel|rev|shape|coords|target][#|Z]br[A|clear][]span[E][#|S]bdo[A|C|B][#|S]applet[A|codebase|archive|code|object|alt|name|width|height|align|hspace|vspace][#|param|Y]h1[E|align][#|S]img[E|src|alt|name|longdesc|width|height|usemap|ismap|align|border|hspace|vspace][]map[B|C|A|name][X|form|Q|area]h2[E|align][#|S]iframe[A|longdesc|name|src|frameborder|marginwidth|marginheight|scrolling|align|width|height][#|Y]h3[E|align][#|S]tt[E][#|S]i[E][#|S]b[E][#|S]u[E][#|S]s[E][#|S]strike[E][#|S]big[E][#|S]small[E][#|S]font[A|B|size|color|face][#|S]basefont[id|size|color|face][]em[E][#|S]strong[E][#|S]dfn[E][#|S]code[E][#|S]q[E|cite][#|S]samp[E][#|S]kbd[E][#|S]var[E][#|S]cite[E][#|S]abbr[E][#|S]acronym[E][#|S]sub[E][#|S]sup[E][#|S]input[E|D|type|name|value|checked|disabled|readonly|size|maxlength|src|alt|usemap|onselect|onchange|accept|align][]select[E|name|size|multiple|disabled|tabindex|onfocus|onblur|onchange][optgroup|option]optgroup[E|disabled|label][option]option[E|selected|disabled|label|value][]textarea[E|D|name|rows|cols|disabled|readonly|onselect|onchange][]label[E|for|accesskey|onfocus|onblur][#|S]button[E|D|name|value|type|disabled][#|p|T|div|U|W|table|G|object|applet|img|map|K|N|Q]h4[E|align][#|S]ins[E|cite|datetime][#|Y]h5[E|align][#|S]del[E|cite|datetime][#|Y]h6[E|align][#|S]div[E|align][#|Y]ul[E|type|compact][li]li[E|type|value][#|Y]ol[E|type|compact|start][li]dl[E|compact][dt|dd]dt[E][#|S]dd[E][#|Y]menu[E|compact][li]dir[E|compact][li]pre[E|width|xml:space][#|ZA]hr[E|align|noshade|size|width][]blockquote[E|cite][#|Y]address[E][#|S|p]center[E][#|Y]noframes[E][#|Y]isindex[A|B|prompt][]fieldset[E][#|legend|Y]legend[E|accesskey|align][#|S]table[E|summary|width|border|frame|rules|cellspacing|cellpadding|align|bgcolor][caption|col|colgroup|thead|tfoot|tbody|tr]caption[E|align][#|S]col[ZG][]colgroup[ZG][col]thead[ZF][tr]tr[ZF|bgcolor][th|td]th[E|ZE][#|Y]form[E|action|method|name|enctype|onsubmit|onreset|accept|accept-charset|target][#|X|R|Q]noscript[E][#|Y]td[E|ZE][#|Y]tfoot[ZF][tr]tbody[ZF][tr]area[E|D|shape|coords|href|nohref|alt|target][]base[id|href|target][]body[E|onload|onunload|background|bgcolor|text|link|vlink|alink][#|Y]")}return i}f.html.Schema=function(A){var u=this,s={},k={},j=[],D,y;var o,q,z,r,v,n,p={};function m(F,E,H){var G=A[F];if(!G){G=a[F];if(!G){G=e(E," ",e(E.toUpperCase()," "));G=f.extend(G,H);a[F]=G}}else{G=e(G,",",e(G.toUpperCase()," "))}return G}A=A||{};y=A.schema=="html5"?b():c();if(A.verify_html===false){A.valid_elements="*[*]"}if(A.valid_styles){D={};g(A.valid_styles,function(F,E){D[E]=f.explode(F)})}o=m("whitespace_elements","pre script style textarea");q=m("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr");z=m("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source");r=m("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls");n=m("non_empty_elements","td th iframe video audio object",z);v=m("block_elements","h1 h2 h3 h4 h5 h6 hr p div address pre form table tbody thead tfoot th tr td li ol ul caption blockquote center dl dt dd dir fieldset noscript menu isindex samp header footer article section hgroup aside nav figure option datalist select optgroup");function i(E){return new RegExp("^"+E.replace(/([?+*])/g,".$1")+"$")}function C(L){var K,G,Z,V,aa,F,I,U,X,Q,Y,ac,O,J,W,E,S,H,ab,ad,P,T,N=/^([#+\-])?([^\[\/]+)(?:\/([^\[]+))?(?:\[([^\]]+)\])?$/,R=/^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,M=/[*?+]/;if(L){L=d(L);if(s["@"]){S=s["@"].attributes;H=s["@"].attributesOrder}for(K=0,G=L.length;K=0){for(U=A.length-1;U>=V;U--){T=A[U];if(T.valid){n.end(T.name)}}A.length=V}}function p(U,T,Y,X,W){var Z,V;T=T.toLowerCase();Y=T in H?T:j(Y||X||W||"");if(v&&!z&&T.indexOf("data-")!==0){Z=P[T];if(!Z&&F){V=F.length;while(V--){Z=F[V];if(Z.pattern.test(T)){break}}if(V===-1){Z=null}}if(!Z){return}if(Z.validValues&&!(Y in Z.validValues)){return}}N.map[T]=Y;N.push({name:T,value:Y})}l=new RegExp("<(?:(?:!--([\\w\\W]*?)-->)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([^>]+)>)|(?:([A-Za-z0-9\\-\\:]+)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g");D=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:\\.|[^\"])*)\")|(?:\'((?:\\.|[^\'])*)\')|([^>\s]+)))?/g;K={script:/<\/script[^>]*>/gi,style:/<\/style[^>]*>/gi,noscript:/<\/noscript[^>]*>/gi};M=e.getShortEndedElements();J=c.self_closing_elements||e.getSelfClosingElements();H=e.getBoolAttrs();v=c.validate;s=c.remove_internals;y=c.fix_self_closing;q=a.isIE;o=/^:/;while(g=l.exec(E)){if(G0&&A[A.length-1].name===I){u(I)}if(!v||(m=e.getElementRule(I))){k=true;if(v){P=m.attributes;F=m.attributePatterns}if(R=g[8]){z=R.indexOf("data-mce-type")!==-1;if(z&&s){k=false}N=[];N.map={};R.replace(D,p)}else{N=[];N.map={}}if(v&&!z){S=m.attributesRequired;L=m.attributesDefault;f=m.attributesForced;if(f){Q=f.length;while(Q--){t=f[Q];r=t.name;h=t.value;if(h==="{$uid}"){h="mce_"+x++}N.map[r]=h;N.push({name:r,value:h})}}if(L){Q=L.length;while(Q--){t=L[Q];r=t.name;if(!(r in N.map)){h=t.value;if(h==="{$uid}"){h="mce_"+x++}N.map[r]=h;N.push({name:r,value:h})}}}if(S){Q=S.length;while(Q--){if(S[Q] in N.map){break}}if(Q===-1){k=false}}if(N.map["data-mce-bogus"]){k=false}}if(k){n.start(I,N,O)}}else{k=false}if(B=K[I]){B.lastIndex=G=g.index+g[0].length;if(g=B.exec(E)){if(k){C=E.substr(G,g.index-G)}G=g.index+g[0].length}else{C=E.substr(G);G=E.length}if(k&&C.length>0){n.text(C,true)}if(k){n.end(I)}l.lastIndex=G;continue}if(!O){if(!R||R.indexOf("/")!=R.length-1){A.push({name:I,valid:k})}else{if(k){n.end(I)}}}}else{if(I=g[1]){n.comment(I)}else{if(I=g[2]){n.cdata(I)}else{if(I=g[3]){n.doctype(I)}else{if(I=g[4]){n.pi(I,g[5])}}}}}}G=g.index+g[0].length}if(G=0;Q--){I=A[Q];if(I.valid){n.end(I.name)}}}}})(tinymce);(function(d){var c=/^[ \t\r\n]*$/,e={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11};function a(k,l,j){var i,h,f=j?"lastChild":"firstChild",g=j?"prev":"next";if(k[f]){return k[f]}if(k!==l){i=k[g];if(i){return i}for(h=k.parent;h&&h!==l;h=h.parent){i=h[g];if(i){return i}}}}function b(f,g){this.name=f;this.type=g;if(g===1){this.attributes=[];this.attributes.map={}}}d.extend(b.prototype,{replace:function(g){var f=this;if(g.parent){g.remove()}f.insert(g,f);f.remove();return f},attr:function(h,l){var f=this,g,j,k;if(typeof h!=="string"){for(j in h){f.attr(j,h[j])}return f}if(g=f.attributes){if(l!==k){if(l===null){if(h in g.map){delete g.map[h];j=g.length;while(j--){if(g[j].name===h){g=g.splice(j,1);return f}}}return f}if(h in g.map){j=g.length;while(j--){if(g[j].name===h){g[j].value=l;break}}}else{g.push({name:h,value:l})}g.map[h]=l;return f}else{return g.map[h]}}},clone:function(){var g=this,n=new b(g.name,g.type),h,f,m,j,k;if(m=g.attributes){k=[];k.map={};for(h=0,f=m.length;h1){v.reverse();z=n=f.filterNode(v[0].clone());for(t=0;t0){Q.value=l;Q=Q.prev}else{O=Q.prev;Q.remove();Q=O}}}function H(O){var P,l={};for(P in O){if(P!=="li"&&P!="p"){l[P]=O[P]}}return l}n=new b.html.SaxParser({validate:z,self_closing_elements:H(h.getSelfClosingElements()),cdata:function(l){B.append(K("#cdata",4)).value=l},text:function(P,l){var O;if(!L){P=P.replace(k," ");if(B.lastChild&&o[B.lastChild.name]){P=P.replace(E,"")}}if(P.length!==0){O=K("#text",3);O.raw=!!l;B.append(O).value=P}},comment:function(l){B.append(K("#comment",8)).value=l},pi:function(l,O){B.append(K(l,7)).value=O;I(B)},doctype:function(O){var l;l=B.append(K("#doctype",10));l.value=O;I(B)},start:function(l,W,P){var U,R,Q,O,S,X,V,T;Q=z?h.getElementRule(l):{};if(Q){U=K(Q.outputName||l,1);U.attributes=W;U.shortEnded=P;B.append(U);T=p[B.name];if(T&&p[U.name]&&!T[U.name]){M.push(U)}R=d.length;while(R--){S=d[R].name;if(S in W.map){F=c[S];if(F){F.push(U)}else{c[S]=[U]}}}if(o[l]){I(U)}if(!P){B=U}if(!L&&s[l]){L=true}}},end:function(l){var S,P,R,O,Q;P=z?h.getElementRule(l):{};if(P){if(o[l]){if(!L){S=B.firstChild;if(S&&S.type===3){R=S.value.replace(E,"");if(R.length>0){S.value=R;S=S.next}else{O=S.next;S.remove();S=O}while(S&&S.type===3){R=S.value;O=S.next;if(R.length===0||y.test(R)){S.remove();S=O}S=O}}S=B.lastChild;if(S&&S.type===3){R=S.value.replace(t,"");if(R.length>0){S.value=R;S=S.prev}else{O=S.prev;S.remove();S=O}while(S&&S.type===3){R=S.value;O=S.prev;if(R.length===0||y.test(R)){S.remove();S=O}S=O}}}S=B.prev;if(S&&S.type===3){R=S.value.replace(E,"");if(R.length>0){S.value=R}else{S.remove()}}}if(L&&s[l]){L=false}if(P.removeEmpty||P.paddEmpty){if(B.isEmpty(u)){if(P.paddEmpty){B.empty().append(new a("#text","3")).value="\u00a0"}else{if(!B.attributes.map.name&&!B.attributes.map.id){Q=B.parent;B.empty().remove();B=Q;return}}}}B=B.parent}}},h);J=B=new a(m.context||g.root_name,11);n.parse(v);if(z&&M.length){if(!m.context){j(M)}else{m.invalid=true}}if(q&&J.name=="body"){G()}if(!m.invalid){for(N in i){F=e[N];A=i[N];x=A.length;while(x--){if(!A[x].parent){A.splice(x,1)}}for(D=0,C=F.length;D0){o=c[c.length-1];if(o.length>0&&o!=="\n"){c.push("\n")}}c.push("<",m);if(k){for(n=0,j=k.length;n0){o=c[c.length-1];if(o.length>0&&o!=="\n"){c.push("\n")}}},end:function(h){var i;c.push("");if(a&&d[h]&&c.length>0){i=c[c.length-1];if(i.length>0&&i!=="\n"){c.push("\n")}}},text:function(i,h){if(i.length>0){c[c.length]=h?i:f(i)}},cdata:function(h){c.push("")},comment:function(h){c.push("")},pi:function(h,i){if(i){c.push("")}else{c.push("")}if(a){c.push("\n")}},doctype:function(h){c.push("",a?"\n":"")},reset:function(){c.length=0},getContent:function(){return c.join("").replace(/\n$/,"")}}};(function(a){a.html.Serializer=function(c,d){var b=this,e=new a.html.Writer(c);c=c||{};c.validate="validate" in c?c.validate:true;b.schema=d=d||new a.html.Schema();b.writer=e;b.serialize=function(h){var g,i;i=c.validate;g={3:function(k,j){e.text(k.value,k.raw)},8:function(j){e.comment(j.value)},7:function(j){e.pi(j.name,j.value)},10:function(j){e.doctype(j.value)},4:function(j){e.cdata(j.value)},11:function(j){if((j=j.firstChild)){do{f(j)}while(j=j.next)}}};e.reset();function f(k){var t=g[k.type],j,o,s,r,p,u,n,m,q;if(!t){j=k.name;o=k.shortEnded;s=k.attributes;if(i&&s&&s.length>1){u=[];u.map={};q=d.getElementRule(k.name);for(n=0,m=q.attributesOrder.length;n=8;k.boxModel=!e.isIE||o.compatMode=="CSS1Compat"||k.stdMode;k.hasOuterHTML="outerHTML" in o.createElement("a");k.settings=l=e.extend({keep_values:false,hex_colors:1},l);k.schema=l.schema;k.styles=new e.html.Styles({url_converter:l.url_converter,url_converter_scope:l.url_converter_scope},l.schema);if(e.isIE6){try{o.execCommand("BackgroundImageCache",false,true)}catch(m){k.cssFlicker=true}}k.fixDoc(o);k.events=l.ownEvents?new e.dom.EventUtils(l.proxy):e.dom.Event;e.addUnload(k.destroy,k);n=l.schema?l.schema.getBlockElements():{};k.isBlock=function(q){var p=q.nodeType;if(p){return !!(p===1&&n[q.nodeName])}return !!n[q]}},fixDoc:function(k){var j=this.settings,i;if(b&&j.schema){("abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video").replace(/\w+/g,function(l){k.createElement(l)});for(i in j.schema.getCustomElements()){k.createElement(i)}}},clone:function(k,i){var j=this,m,l;if(!b||k.nodeType!==1||i){return k.cloneNode(i)}l=j.doc;if(!i){m=l.createElement(k.nodeName);g(j.getAttribs(k),function(n){j.setAttrib(m,n.nodeName,j.getAttrib(k,n.nodeName))});return m}return m.firstChild},getRoot:function(){var i=this,j=i.settings;return(j&&i.get(j.root_element))||i.doc.body},getViewPort:function(j){var k,i;j=!j?this.win:j;k=j.document;i=this.boxModel?k.documentElement:k.body;return{x:j.pageXOffset||i.scrollLeft,y:j.pageYOffset||i.scrollTop,w:j.innerWidth||i.clientWidth,h:j.innerHeight||i.clientHeight}},getRect:function(l){var k,i=this,j;l=i.get(l);k=i.getPos(l);j=i.getSize(l);return{x:k.x,y:k.y,w:j.w,h:j.h}},getSize:function(l){var j=this,i,k;l=j.get(l);i=j.getStyle(l,"width");k=j.getStyle(l,"height");if(i.indexOf("px")===-1){i=0}if(k.indexOf("px")===-1){k=0}return{w:parseInt(i,10)||l.offsetWidth||l.clientWidth,h:parseInt(k,10)||l.offsetHeight||l.clientHeight}},getParent:function(k,j,i){return this.getParents(k,j,i,false)},getParents:function(s,m,k,q){var j=this,i,l=j.settings,p=[];s=j.get(s);q=q===undefined;if(l.strict_root){k=k||j.getRoot()}if(d(m,"string")){i=m;if(m==="*"){m=function(o){return o.nodeType==1}}else{m=function(o){return j.is(o,i)}}}while(s){if(s==k||!s.nodeType||s.nodeType===9){break}if(!m||m(s)){if(q){p.push(s)}else{return s}}s=s.parentNode}return q?p:null},get:function(i){var j;if(i&&this.doc&&typeof(i)=="string"){j=i;i=this.doc.getElementById(i);if(i&&i.id!==j){return this.doc.getElementsByName(j)[1]}}return i},getNext:function(j,i){return this._findSib(j,i,"nextSibling")},getPrev:function(j,i){return this._findSib(j,i,"previousSibling")},add:function(l,o,i,k,m){var j=this;return this.run(l,function(r){var q,n;q=d(o,"string")?j.doc.createElement(o):o;j.setAttribs(q,i);if(k){if(k.nodeType){q.appendChild(k)}else{j.setHTML(q,k)}}return !m?r.appendChild(q):q})},create:function(k,i,j){return this.add(this.doc.createElement(k),k,i,j,1)},createHTML:function(q,i,m){var p="",l=this,j;p+="<"+q;for(j in i){if(i.hasOwnProperty(j)){p+=" "+j+'="'+l.encode(i[j])+'"'}}if(typeof(m)!="undefined"){return p+">"+m+""}return p+" />"},remove:function(i,j){return this.run(i,function(l){var m,k=l.parentNode;if(!k){return null}if(j){while(m=l.firstChild){if(!e.isIE||m.nodeType!==3||m.nodeValue){k.insertBefore(m,l)}else{l.removeChild(m)}}}return k.removeChild(l)})},setStyle:function(l,i,j){var k=this;return k.run(l,function(o){var n,m;n=o.style;i=i.replace(/-(\D)/g,function(q,p){return p.toUpperCase()});if(k.pixelStyles.test(i)&&(e.is(j,"number")||/^[\-0-9\.]+$/.test(j))){j+="px"}switch(i){case"opacity":if(b){n.filter=j===""?"":"alpha(opacity="+(j*100)+")";if(!l.currentStyle||!l.currentStyle.hasLayout){n.display="inline-block"}}n[i]=n["-moz-opacity"]=n["-khtml-opacity"]=j||"";break;case"float":b?n.styleFloat=j:n.cssFloat=j;break;default:n[i]=j||""}if(k.settings.update_styles){k.setAttrib(o,"data-mce-style")}})},getStyle:function(l,i,k){l=this.get(l);if(!l){return}if(this.doc.defaultView&&k){i=i.replace(/[A-Z]/g,function(m){return"-"+m});try{return this.doc.defaultView.getComputedStyle(l,null).getPropertyValue(i)}catch(j){return null}}i=i.replace(/-(\D)/g,function(n,m){return m.toUpperCase()});if(i=="float"){i=b?"styleFloat":"cssFloat"}if(l.currentStyle&&k){return l.currentStyle[i]}return l.style?l.style[i]:undefined},setStyles:function(l,m){var j=this,k=j.settings,i;i=k.update_styles;k.update_styles=0;g(m,function(o,p){j.setStyle(l,p,o)});k.update_styles=i;if(k.update_styles){j.setAttrib(l,k.cssText)}},removeAllAttribs:function(i){return this.run(i,function(l){var k,j=l.attributes;for(k=j.length-1;k>=0;k--){l.removeAttributeNode(j.item(k))}})},setAttrib:function(k,l,i){var j=this;if(!k||!l){return}if(j.settings.strict){l=l.toLowerCase()}return this.run(k,function(p){var o=j.settings;var m=p.getAttribute(l);if(i!==null){switch(l){case"style":if(!d(i,"string")){g(i,function(q,r){j.setStyle(p,r,q)});return}if(o.keep_values){if(i&&!j._isRes(i)){p.setAttribute("data-mce-style",i,2)}else{p.removeAttribute("data-mce-style",2)}}p.style.cssText=i;break;case"class":p.className=i||"";break;case"src":case"href":if(o.keep_values){if(o.url_converter){i=o.url_converter.call(o.url_converter_scope||j,i,l,p)}j.setAttrib(p,"data-mce-"+l,i,2)}break;case"shape":p.setAttribute("data-mce-style",i);break}}if(d(i)&&i!==null&&i.length!==0){p.setAttribute(l,""+i,2)}else{p.removeAttribute(l,2)}if(tinyMCE.activeEditor&&m!=i){var n=tinyMCE.activeEditor;n.onSetAttrib.dispatch(n,p,l,i)}})},setAttribs:function(j,k){var i=this;return this.run(j,function(l){g(k,function(m,o){i.setAttrib(l,o,m)})})},getAttrib:function(m,o,k){var i,j=this,l;m=j.get(m);if(!m||m.nodeType!==1){return k===l?false:k}if(!d(k)){k=""}if(/^(src|href|style|coords|shape)$/.test(o)){i=m.getAttribute("data-mce-"+o);if(i){return i}}if(b&&j.props[o]){i=m[j.props[o]];i=i&&i.nodeValue?i.nodeValue:i}if(!i){i=m.getAttribute(o,2)}if(/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(o)){if(m[j.props[o]]===true&&i===""){return o}return i?o:""}if(m.nodeName==="FORM"&&m.getAttributeNode(o)){return m.getAttributeNode(o).nodeValue}if(o==="style"){i=i||m.style.cssText;if(i){i=j.serializeStyle(j.parseStyle(i),m.nodeName);if(j.settings.keep_values&&!j._isRes(i)){m.setAttribute("data-mce-style",i)}}}if(f&&o==="class"&&i){i=i.replace(/(apple|webkit)\-[a-z\-]+/gi,"")}if(b){switch(o){case"rowspan":case"colspan":if(i===1){i=""}break;case"size":if(i==="+0"||i===20||i===0){i=""}break;case"width":case"height":case"vspace":case"checked":case"disabled":case"readonly":if(i===0){i=""}break;case"hspace":if(i===-1){i=""}break;case"maxlength":case"tabindex":if(i===32768||i===2147483647||i==="32768"){i=""}break;case"multiple":case"compact":case"noshade":case"nowrap":if(i===65535){return o}return k;case"shape":i=i.toLowerCase();break;default:if(o.indexOf("on")===0&&i){i=e._replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/,"$1",""+i)}}}return(i!==l&&i!==null&&i!=="")?""+i:k},getPos:function(q,l){var j=this,i=0,p=0,m,o=j.doc,k;q=j.get(q);l=l||o.body;if(q){if(q.getBoundingClientRect){q=q.getBoundingClientRect();m=j.boxModel?o.documentElement:o.body;i=q.left+(o.documentElement.scrollLeft||o.body.scrollLeft)-m.clientTop;p=q.top+(o.documentElement.scrollTop||o.body.scrollTop)-m.clientLeft;return{x:i,y:p}}k=q;while(k&&k!=l&&k.nodeType){i+=k.offsetLeft||0;p+=k.offsetTop||0;k=k.offsetParent}k=q.parentNode;while(k&&k!=l&&k.nodeType){i-=k.scrollLeft||0;p-=k.scrollTop||0;k=k.parentNode}}return{x:i,y:p}},parseStyle:function(i){return this.styles.parse(i)},serializeStyle:function(j,i){return this.styles.serialize(j,i)},loadCSS:function(i){var k=this,l=k.doc,j;if(!i){i=""}j=l.getElementsByTagName("head")[0];g(i.split(","),function(m){var n;if(k.files[m]){return}k.files[m]=true;n=k.create("link",{rel:"stylesheet",href:e._addVer(m)});if(b&&l.documentMode&&l.recalc){n.onload=function(){if(l.recalc){l.recalc()}n.onload=null}}j.appendChild(n)})},addClass:function(i,j){return this.run(i,function(k){var l;if(!j){return 0}if(this.hasClass(k,j)){return k.className}l=this.removeClass(k,j);return k.className=(l!=""?(l+" "):"")+j})},removeClass:function(k,l){var i=this,j;return i.run(k,function(n){var m;if(i.hasClass(n,l)){if(!j){j=new RegExp("(^|\\s+)"+l+"(\\s+|$)","g")}m=n.className.replace(j," ");m=e.trim(m!=" "?m:"");n.className=m;if(!m){n.removeAttribute("class");n.removeAttribute("className")}return m}return n.className})},hasClass:function(j,i){j=this.get(j);if(!j||!i){return false}return(" "+j.className+" ").indexOf(" "+i+" ")!==-1},show:function(i){return this.setStyle(i,"display","block")},hide:function(i){return this.setStyle(i,"display","none")},isHidden:function(i){i=this.get(i);return !i||i.style.display=="none"||this.getStyle(i,"display")=="none"},uniqueId:function(i){return(!i?"mce_":i)+(this.counter++)},setHTML:function(k,j){var i=this;return i.run(k,function(m){if(b){while(m.firstChild){m.removeChild(m.firstChild)}try{m.innerHTML="
                    "+j;m.removeChild(m.firstChild)}catch(l){m=i.create("div");m.innerHTML="
                    "+j;g(m.childNodes,function(o,n){if(n){m.appendChild(o)}})}}else{m.innerHTML=j}return j})},getOuterHTML:function(k){var j,i=this;k=i.get(k);if(!k){return null}if(k.nodeType===1&&i.hasOuterHTML){return k.outerHTML}j=(k.ownerDocument||i.doc).createElement("body");j.appendChild(k.cloneNode(true));return j.innerHTML},setOuterHTML:function(l,j,m){var i=this;function k(p,o,r){var s,q;q=r.createElement("body");q.innerHTML=o;s=q.lastChild;while(s){i.insertAfter(s.cloneNode(true),p);s=s.previousSibling}i.remove(p)}return this.run(l,function(o){o=i.get(o);if(o.nodeType==1){m=m||o.ownerDocument||i.doc;if(b){try{if(b&&o.nodeType==1){o.outerHTML=j}else{k(o,j,m)}}catch(n){k(o,j,m)}}else{k(o,j,m)}}})},decode:h.decode,encode:h.encodeAllRaw,insertAfter:function(i,j){j=this.get(j);return this.run(i,function(l){var k,m;k=j.parentNode;m=j.nextSibling;if(m){k.insertBefore(l,m)}else{k.appendChild(l)}return l})},replace:function(m,l,i){var j=this;if(d(l,"array")){m=m.cloneNode(true)}return j.run(l,function(k){if(i){g(e.grep(k.childNodes),function(n){m.appendChild(n)})}return k.parentNode.replaceChild(m,k)})},rename:function(l,i){var k=this,j;if(l.nodeName!=i.toUpperCase()){j=k.create(i);g(k.getAttribs(l),function(m){k.setAttrib(j,m.nodeName,k.getAttrib(l,m.nodeName))});k.replace(j,l,1)}return j||l},findCommonAncestor:function(k,i){var l=k,j;while(l){j=i;while(j&&l!=j){j=j.parentNode}if(l==j){break}l=l.parentNode}if(!l&&k.ownerDocument){return k.ownerDocument.documentElement}return l},toHex:function(i){var k=/^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(i);function j(l){l=parseInt(l,10).toString(16);return l.length>1?l:"0"+l}if(k){i="#"+j(k[1])+j(k[2])+j(k[3]);return i}return i},getClasses:function(){var n=this,j=[],m,o={},p=n.settings.class_filter,l;if(n.classes){return n.classes}function q(i){g(i.imports,function(s){q(s)});g(i.cssRules||i.rules,function(s){switch(s.type||1){case 1:if(s.selectorText){g(s.selectorText.split(","),function(r){r=r.replace(/^\s*|\s*$|^\s\./g,"");if(/\.mce/.test(r)||!/\.[\w\-]+$/.test(r)){return}l=r;r=e._replace(/.*\.([a-z0-9_\-]+).*/i,"$1",r);if(p&&!(r=p(r,l))){return}if(!o[r]){j.push({"class":r});o[r]=1}})}break;case 3:q(s.styleSheet);break}})}try{g(n.doc.styleSheets,q)}catch(k){}if(j.length>0){n.classes=j}return j},run:function(l,k,j){var i=this,m;if(i.doc&&typeof(l)==="string"){l=i.get(l)}if(!l){return false}j=j||this;if(!l.nodeType&&(l.length||l.length===0)){m=[];g(l,function(o,n){if(o){if(typeof(o)=="string"){o=i.doc.getElementById(o)}m.push(k.call(j,o,n))}});return m}return k.call(j,l)},getAttribs:function(j){var i;j=this.get(j);if(!j){return[]}if(b){i=[];if(j.nodeName=="OBJECT"){return j.attributes}if(j.nodeName==="OPTION"&&this.getAttrib(j,"selected")){i.push({specified:1,nodeName:"selected"})}j.cloneNode(false).outerHTML.replace(/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi,"").replace(/[\w:\-]+/gi,function(k){i.push({specified:1,nodeName:k})});return i}return j.attributes},isEmpty:function(m,k){var r=this,o,n,q,j,l,p=0;m=m.firstChild;if(m){j=new e.dom.TreeWalker(m,m.parentNode);k=k||r.schema?r.schema.getNonEmptyElements():null;do{q=m.nodeType;if(q===1){if(m.getAttribute("data-mce-bogus")){continue}l=m.nodeName.toLowerCase();if(k&&k[l]){if(l==="br"){p++;continue}return false}n=r.getAttribs(m);o=m.attributes.length;while(o--){l=m.attributes[o].nodeName;if(l==="name"||l==="data-mce-bookmark"){return false}}}if(q==8){return false}if((q===3&&!a.test(m.nodeValue))){return false}}while(m=j.next())}return p<=1},destroy:function(j){var i=this;i.win=i.doc=i.root=i.events=i.frag=null;if(!j){e.removeUnload(i.destroy)}},createRng:function(){var i=this.doc;return i.createRange?i.createRange():new e.dom.Range(this)},nodeIndex:function(m,n){var i=0,k,l,j;if(m){for(k=m.nodeType,m=m.previousSibling,l=m;m;m=m.previousSibling){j=m.nodeType;if(n&&j==3){if(j==k||!m.nodeValue.length){continue}}i++;k=j}}return i},split:function(m,l,p){var q=this,i=q.createRng(),n,k,o;function j(v){var t,s=v.childNodes,u=v.nodeType;function x(A){var z=A.previousSibling&&A.previousSibling.nodeName=="SPAN";var y=A.nextSibling&&A.nextSibling.nodeName=="SPAN";return z&&y}if(u==1&&v.getAttribute("data-mce-type")=="bookmark"){return}for(t=s.length-1;t>=0;t--){j(s[t])}if(u!=9){if(u==3&&v.nodeValue.length>0){var r=e.trim(v.nodeValue).length;if(!q.isBlock(v.parentNode)||r>0||r===0&&x(v)){return}}else{if(u==1){s=v.childNodes;if(s.length==1&&s[0]&&s[0].nodeType==1&&s[0].getAttribute("data-mce-type")=="bookmark"){v.parentNode.insertBefore(s[0],v)}if(s.length||/^(br|hr|input|img)$/i.test(v.nodeName)){return}}}q.remove(v)}return v}if(m&&l){i.setStart(m.parentNode,q.nodeIndex(m));i.setEnd(l.parentNode,q.nodeIndex(l));n=i.extractContents();i=q.createRng();i.setStart(l.parentNode,q.nodeIndex(l)+1);i.setEnd(m.parentNode,q.nodeIndex(m)+1);k=i.extractContents();o=m.parentNode;o.insertBefore(j(n),m);if(p){o.replaceChild(p,l)}else{o.insertBefore(l,m)}o.insertBefore(j(k),m);q.remove(m);return p||l}},bind:function(l,i,k,j){return this.events.add(l,i,k,j||this)},unbind:function(k,i,j){return this.events.remove(k,i,j)},fire:function(k,j,i){return this.events.fire(k,j,i)},getContentEditable:function(j){var i;if(j.nodeType!=1){return null}i=j.getAttribute("data-mce-contenteditable");if(i&&i!=="inherit"){return i}return j.contentEditable!=="inherit"?j.contentEditable:null},_findSib:function(l,i,j){var k=this,m=i;if(l){if(d(m,"string")){m=function(n){return k.is(n,i)}}for(l=l[j];l;l=l[j]){if(m(l)){return l}}}return null},_isRes:function(i){return/^(top|left|bottom|right|width|height)/i.test(i)||/;\s*(top|left|bottom|right|width|height)/i.test(i)}});e.DOM=new e.dom.DOMUtils(document,{process_html:0})})(tinymce);(function(a){function b(c){var O=this,e=c.doc,U=0,F=1,j=2,E=true,S=false,W="startOffset",h="startContainer",Q="endContainer",A="endOffset",k=tinymce.extend,n=c.nodeIndex;k(O,{startContainer:e,startOffset:0,endContainer:e,endOffset:0,collapsed:E,commonAncestorContainer:e,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:q,setEnd:s,setStartBefore:g,setStartAfter:J,setEndBefore:K,setEndAfter:u,collapse:B,selectNode:y,selectNodeContents:G,compareBoundaryPoints:v,deleteContents:p,extractContents:I,cloneContents:d,insertNode:D,surroundContents:N,cloneRange:L,toStringIE:T});function x(){return e.createDocumentFragment()}function q(X,t){C(E,X,t)}function s(X,t){C(S,X,t)}function g(t){q(t.parentNode,n(t))}function J(t){q(t.parentNode,n(t)+1)}function K(t){s(t.parentNode,n(t))}function u(t){s(t.parentNode,n(t)+1)}function B(t){if(t){O[Q]=O[h];O[A]=O[W]}else{O[h]=O[Q];O[W]=O[A]}O.collapsed=E}function y(t){g(t);u(t)}function G(t){q(t,0);s(t,t.nodeType===1?t.childNodes.length:t.nodeValue.length)}function v(aa,t){var ad=O[h],Y=O[W],ac=O[Q],X=O[A],ab=t.startContainer,af=t.startOffset,Z=t.endContainer,ae=t.endOffset;if(aa===0){return H(ad,Y,ab,af)}if(aa===1){return H(ac,X,ab,af)}if(aa===2){return H(ac,X,Z,ae)}if(aa===3){return H(ad,Y,Z,ae)}}function p(){l(j)}function I(){return l(U)}function d(){return l(F)}function D(aa){var X=this[h],t=this[W],Z,Y;if((X.nodeType===3||X.nodeType===4)&&X.nodeValue){if(!t){X.parentNode.insertBefore(aa,X)}else{if(t>=X.nodeValue.length){c.insertAfter(aa,X)}else{Z=X.splitText(t);X.parentNode.insertBefore(aa,Z)}}}else{if(X.childNodes.length>0){Y=X.childNodes[t]}if(Y){X.insertBefore(aa,Y)}else{X.appendChild(aa)}}}function N(X){var t=O.extractContents();O.insertNode(X);X.appendChild(t);O.selectNode(X)}function L(){return k(new b(c),{startContainer:O[h],startOffset:O[W],endContainer:O[Q],endOffset:O[A],collapsed:O.collapsed,commonAncestorContainer:O.commonAncestorContainer})}function P(t,X){var Y;if(t.nodeType==3){return t}if(X<0){return t}Y=t.firstChild;while(Y&&X>0){--X;Y=Y.nextSibling}if(Y){return Y}return t}function m(){return(O[h]==O[Q]&&O[W]==O[A])}function H(Z,ab,X,aa){var ac,Y,t,ad,af,ae;if(Z==X){if(ab==aa){return 0}if(ab0){O.collapse(X)}}else{O.collapse(X)}O.collapsed=m();O.commonAncestorContainer=c.findCommonAncestor(O[h],O[Q])}function l(ad){var ac,Z=0,af=0,X,ab,Y,aa,t,ae;if(O[h]==O[Q]){return f(ad)}for(ac=O[Q],X=ac.parentNode;X;ac=X,X=X.parentNode){if(X==O[h]){return r(ac,ad)}++Z}for(ac=O[h],X=ac.parentNode;X;ac=X,X=X.parentNode){if(X==O[Q]){return V(ac,ad)}++af}ab=af-Z;Y=O[h];while(ab>0){Y=Y.parentNode;ab--}aa=O[Q];while(ab<0){aa=aa.parentNode;ab++}for(t=Y.parentNode,ae=aa.parentNode;t!=ae;t=t.parentNode,ae=ae.parentNode){Y=t;aa=ae}return o(Y,aa,ad)}function f(ac){var ae,af,t,Y,Z,ad,aa,X,ab;if(ac!=j){ae=x()}if(O[W]==O[A]){return ae}if(O[h].nodeType==3){af=O[h].nodeValue;t=af.substring(O[W],O[A]);if(ac!=F){Y=O[h];X=O[W];ab=O[A]-O[W];if(X===0&&ab>=Y.nodeValue.length-1){Y.parentNode.removeChild(Y)}else{Y.deleteData(X,ab)}O.collapse(E)}if(ac==j){return}if(t.length>0){ae.appendChild(e.createTextNode(t))}return ae}Y=P(O[h],O[W]);Z=O[A]-O[W];while(Y&&Z>0){ad=Y.nextSibling;aa=z(Y,ac);if(ae){ae.appendChild(aa)}--Z;Y=ad}if(ac!=F){O.collapse(E)}return ae}function r(ad,aa){var ac,ab,X,t,Z,Y;if(aa!=j){ac=x()}ab=i(ad,aa);if(ac){ac.appendChild(ab)}X=n(ad);t=X-O[W];if(t<=0){if(aa!=F){O.setEndBefore(ad);O.collapse(S)}return ac}ab=ad.previousSibling;while(t>0){Z=ab.previousSibling;Y=z(ab,aa);if(ac){ac.insertBefore(Y,ac.firstChild)}--t;ab=Z}if(aa!=F){O.setEndBefore(ad);O.collapse(S)}return ac}function V(ab,aa){var ad,X,ac,t,Z,Y;if(aa!=j){ad=x()}ac=R(ab,aa);if(ad){ad.appendChild(ac)}X=n(ab);++X;t=O[A]-X;ac=ab.nextSibling;while(ac&&t>0){Z=ac.nextSibling;Y=z(ac,aa);if(ad){ad.appendChild(Y)}--t;ac=Z}if(aa!=F){O.setStartAfter(ab);O.collapse(E)}return ad}function o(ab,t,ae){var Y,ag,aa,ac,ad,X,af,Z;if(ae!=j){ag=x()}Y=R(ab,ae);if(ag){ag.appendChild(Y)}aa=ab.parentNode;ac=n(ab);ad=n(t);++ac;X=ad-ac;af=ab.nextSibling;while(X>0){Z=af.nextSibling;Y=z(af,ae);if(ag){ag.appendChild(Y)}af=Z;--X}Y=i(t,ae);if(ag){ag.appendChild(Y)}if(ae!=F){O.setStartAfter(ab);O.collapse(E)}return ag}function i(ac,ad){var Y=P(O[Q],O[A]-1),ae,ab,aa,t,X,Z=Y!=O[Q];if(Y==ac){return M(Y,Z,S,ad)}ae=Y.parentNode;ab=M(ae,S,S,ad);while(ae){while(Y){aa=Y.previousSibling;t=M(Y,Z,S,ad);if(ad!=j){ab.insertBefore(t,ab.firstChild)}Z=E;Y=aa}if(ae==ac){return ab}Y=ae.previousSibling;ae=ae.parentNode;X=M(ae,S,S,ad);if(ad!=j){X.appendChild(ab)}ab=X}}function R(ac,ad){var Z=P(O[h],O[W]),aa=Z!=O[h],ae,ab,Y,t,X;if(Z==ac){return M(Z,aa,E,ad)}ae=Z.parentNode;ab=M(ae,S,E,ad);while(ae){while(Z){Y=Z.nextSibling;t=M(Z,aa,E,ad);if(ad!=j){ab.appendChild(t)}aa=E;Z=Y}if(ae==ac){return ab}Z=ae.nextSibling;ae=ae.parentNode;X=M(ae,S,E,ad);if(ad!=j){X.appendChild(ab)}ab=X}}function M(t,aa,ad,ae){var Z,Y,ab,X,ac;if(aa){return z(t,ae)}if(t.nodeType==3){Z=t.nodeValue;if(ad){X=O[W];Y=Z.substring(X);ab=Z.substring(0,X)}else{X=O[A];Y=Z.substring(0,X);ab=Z.substring(X)}if(ae!=F){t.nodeValue=ab}if(ae==j){return}ac=c.clone(t,S);ac.nodeValue=Y;return ac}if(ae==j){return}return c.clone(t,S)}function z(X,t){if(t!=j){return t==F?c.clone(X,E):X}X.parentNode.removeChild(X)}function T(){return c.create("body",null,d()).outerText}return O}a.Range=b;b.prototype.toString=function(){return this.toStringIE()}})(tinymce.dom);(function(){function a(d){var b=this,h=d.dom,c=true,f=false;function e(i,j){var k,t=0,q,n,m,l,o,r,p=-1,s;k=i.duplicate();k.collapse(j);s=k.parentElement();if(s.ownerDocument!==d.dom.doc){return}while(s.contentEditable==="false"){s=s.parentNode}if(!s.hasChildNodes()){return{node:s,inside:1}}m=s.children;q=m.length-1;while(t<=q){r=Math.floor((t+q)/2);l=m[r];k.moveToElementText(l);p=k.compareEndPoints(j?"StartToStart":"EndToEnd",i);if(p>0){q=r-1}else{if(p<0){t=r+1}else{return{node:l}}}}if(p<0){if(!l){k.moveToElementText(s);k.collapse(true);l=s;n=true}else{k.collapse(false)}o=0;while(k.compareEndPoints(j?"StartToStart":"StartToEnd",i)!==0){if(k.move("character",1)===0||s!=k.parentElement()){break}o++}}else{k.collapse(true);o=0;while(k.compareEndPoints(j?"StartToStart":"StartToEnd",i)!==0){if(k.move("character",-1)===0||s!=k.parentElement()){break}o++}}return{node:l,position:p,offset:o,inside:n}}function g(){var i=d.getRng(),r=h.createRng(),l,k,p,q,m,j;l=i.item?i.item(0):i.parentElement();if(l.ownerDocument!=h.doc){return r}k=d.isCollapsed();if(i.item){r.setStart(l.parentNode,h.nodeIndex(l));r.setEnd(r.startContainer,r.startOffset+1);return r}function o(A){var u=e(i,A),s,y,z=0,x,v,t;s=u.node;y=u.offset;if(u.inside&&!s.hasChildNodes()){r[A?"setStart":"setEnd"](s,0);return}if(y===v){r[A?"setStartBefore":"setEndAfter"](s);return}if(u.position<0){x=u.inside?s.firstChild:s.nextSibling;if(!x){r[A?"setStartAfter":"setEndAfter"](s);return}if(!y){if(x.nodeType==3){r[A?"setStart":"setEnd"](x,0)}else{r[A?"setStartBefore":"setEndBefore"](x)}return}while(x){t=x.nodeValue;z+=t.length;if(z>=y){s=x;z-=y;z=t.length-z;break}x=x.nextSibling}}else{x=s.previousSibling;if(!x){return r[A?"setStartBefore":"setEndBefore"](s)}if(!y){if(s.nodeType==3){r[A?"setStart":"setEnd"](x,s.nodeValue.length)}else{r[A?"setStartAfter":"setEndAfter"](x)}return}while(x){z+=x.nodeValue.length;if(z>=y){s=x;z-=y;break}x=x.previousSibling}}r[A?"setStart":"setEnd"](s,z)}try{o(true);if(!k){o()}}catch(n){if(n.number==-2147024809){m=b.getBookmark(2);p=i.duplicate();p.collapse(true);l=p.parentElement();if(!k){p=i.duplicate();p.collapse(false);q=p.parentElement();q.innerHTML=q.innerHTML}l.innerHTML=l.innerHTML;b.moveToBookmark(m);i=d.getRng();o(true);if(!k){o()}}else{throw n}}return r}this.getBookmark=function(m){var j=d.getRng(),o,i,l={};function n(u){var t,p,s,r,q=[];t=u.parentNode;p=h.getRoot().parentNode;while(t!=p&&t.nodeType!==9){s=t.children;r=s.length;while(r--){if(u===s[r]){q.push(r);break}}u=t;t=t.parentNode}return q}function k(q){var p;p=e(j,q);if(p){return{position:p.position,offset:p.offset,indexes:n(p.node),inside:p.inside}}}if(m===2){if(!j.item){l.start=k(true);if(!d.isCollapsed()){l.end=k()}}else{l.start={ctrl:true,indexes:n(j.item(0))}}}return l};this.moveToBookmark=function(k){var j,i=h.doc.body;function m(o){var r,q,n,p;r=h.getRoot();for(q=o.length-1;q>=0;q--){p=r.children;n=o[q];if(n<=p.length-1){r=p[n]}}return r}function l(r){var n=k[r?"start":"end"],q,p,o;if(n){q=n.position>0;p=i.createTextRange();p.moveToElementText(m(n.indexes));offset=n.offset;if(offset!==o){p.collapse(n.inside||q);p.moveStart("character",q?-offset:offset)}else{p.collapse(r)}j.setEndPoint(r?"StartToStart":"EndToStart",p);if(r){j.collapse(true)}}}if(k.start){if(k.start.ctrl){j=i.createControlRange();j.addElement(m(k.start.indexes));j.select()}else{j=i.createTextRange();l(true);l();j.select()}}};this.addRange=function(i){var n,l,k,p,t,q,s,r=d.dom.doc,m=r.body;function j(A){var v,z,u,y,x;u=h.create("a");v=A?k:t;z=A?p:q;y=n.duplicate();if(v==r||v==r.documentElement){v=m;z=0}if(v.nodeType==3){v.parentNode.insertBefore(u,v);y.moveToElementText(u);y.moveStart("character",z);h.remove(u);n.setEndPoint(A?"StartToStart":"EndToEnd",y)}else{x=v.childNodes;if(x.length){if(z>=x.length){h.insertAfter(u,x[x.length-1])}else{v.insertBefore(u,x[z])}y.moveToElementText(u)}else{if(v.canHaveHTML){v.innerHTML="\uFEFF";u=v.firstChild;y.moveToElementText(u);y.collapse(f)}}n.setEndPoint(A?"StartToStart":"EndToEnd",y);h.remove(u)}}k=i.startContainer;p=i.startOffset;t=i.endContainer;q=i.endOffset;n=m.createTextRange();if(k==t&&k.nodeType==1){if(p==q&&!k.hasChildNodes()){if(k.canHaveHTML){s=k.previousSibling;if(s&&!s.hasChildNodes()&&h.isBlock(s)){s.innerHTML="\uFEFF"}else{s=null}k.innerHTML="\uFEFF\uFEFF";n.moveToElementText(k.lastChild);n.select();h.doc.selection.clear();k.innerHTML="";if(s){s.innerHTML=""}return}else{p=h.nodeIndex(k);k=k.parentNode}}if(p==q-1){try{l=m.createControlRange();l.addElement(k.childNodes[p]);l.select();return}catch(o){}}}j(true);j();n.select()};this.getRangeAt=g}tinymce.dom.TridentSelection=a})();(function(a){a.dom.Element=function(f,d){var b=this,e,c;b.settings=d=d||{};b.id=f;b.dom=e=d.dom||a.DOM;if(!a.isIE){c=e.get(b.id)}a.each(("getPos,getRect,getParent,add,setStyle,getStyle,setStyles,setAttrib,setAttribs,getAttrib,addClass,removeClass,hasClass,getOuterHTML,setOuterHTML,remove,show,hide,isHidden,setHTML,get").split(/,/),function(g){b[g]=function(){var h=[f],j;for(j=0;j"+(i.item?i.item(0).outerHTML:i.htmlText);m.removeChild(m.firstChild)}else{m.innerHTML=i.toString()}}if(/^\s/.test(m.innerHTML)){j=" "}if(/\s+$/.test(m.innerHTML)){l=" "}h.getInner=true;h.content=g.isCollapsed()?"":j+g.serializer.serialize(m,h)+l;g.onGetContent.dispatch(g,h);return h.content},setContent:function(h,j){var o=this,g=o.getRng(),k,l=o.win.document,n,m;j=j||{format:"html"};j.set=true;h=j.content=h;if(!j.no_events){o.onBeforeSetContent.dispatch(o,j)}h=j.content;if(g.insertNode){h+='_';if(g.startContainer==l&&g.endContainer==l){l.body.innerHTML=h}else{g.deleteContents();if(l.body.childNodes.length===0){l.body.innerHTML=h}else{if(g.createContextualFragment){g.insertNode(g.createContextualFragment(h))}else{n=l.createDocumentFragment();m=l.createElement("div");n.appendChild(m);m.outerHTML=h;g.insertNode(n)}}}k=o.dom.get("__caret");g=l.createRange();g.setStartBefore(k);g.setEndBefore(k);o.setRng(g);o.dom.remove("__caret");try{o.setRng(g)}catch(i){}}else{if(g.item){l.execCommand("Delete",false,null);g=o.getRng()}if(/^\s+/.test(h)){g.pasteHTML('_'+h);o.dom.remove("__mce_tmp")}else{g.pasteHTML(h)}}if(!j.no_events){o.onSetContent.dispatch(o,j)}},getStart:function(){var h=this.getRng(),i,g,k,j;if(h.duplicate||h.item){if(h.item){return h.item(0)}k=h.duplicate();k.collapse(1);i=k.parentElement();g=j=h.parentElement();while(j=j.parentNode){if(j==i){i=g;break}}return i}else{i=h.startContainer;if(i.nodeType==1&&i.hasChildNodes()){i=i.childNodes[Math.min(i.childNodes.length-1,h.startOffset)]}if(i&&i.nodeType==3){return i.parentNode}return i}},getEnd:function(){var h=this,i=h.getRng(),j,g;if(i.duplicate||i.item){if(i.item){return i.item(0)}i=i.duplicate();i.collapse(0);j=i.parentElement();if(j&&j.nodeName=="BODY"){return j.lastChild||j}return j}else{j=i.endContainer;g=i.endOffset;if(j.nodeType==1&&j.hasChildNodes()){j=j.childNodes[g>0?g-1:g]}if(j&&j.nodeType==3){return j.parentNode}return j}},getBookmark:function(s,v){var y=this,n=y.dom,h,k,j,o,i,p,q,m="\uFEFF",x;function g(z,A){var t=0;e(n.select(z),function(C,B){if(C==A){t=B}});return t}function u(t){function z(E){var A,D,C,B=E?"start":"end";A=t[B+"Container"];D=t[B+"Offset"];if(A.nodeType==1&&A.nodeName=="TR"){C=A.childNodes;A=C[Math.min(E?D:D-1,C.length-1)];if(A){D=E?0:A.childNodes.length;t["set"+(E?"Start":"End")](A,D)}}}z(true);z();return t}function l(){var z=y.getRng(true),t=n.getRoot(),A={};function B(E,J){var D=E[J?"startContainer":"endContainer"],I=E[J?"startOffset":"endOffset"],C=[],F,H,G=0;if(D.nodeType==3){if(v){for(F=D.previousSibling;F&&F.nodeType==3;F=F.previousSibling){I+=F.nodeValue.length}}C.push(I)}else{H=D.childNodes;if(I>=H.length&&H.length){G=1;I=Math.max(0,H.length-1)}C.push(y.dom.nodeIndex(H[I],v)+G)}for(;D&&D!=t;D=D.parentNode){C.push(y.dom.nodeIndex(D,v))}return C}A.start=B(z,true);if(!y.isCollapsed()){A.end=B(z)}return A}if(s==2){if(y.tridentSel){return y.tridentSel.getBookmark(s)}return l()}if(s){return{rng:y.getRng()}}h=y.getRng();j=n.uniqueId();o=tinyMCE.activeEditor.selection.isCollapsed();x="overflow:hidden;line-height:0px";if(h.duplicate||h.item){if(!h.item){k=h.duplicate();try{h.collapse();h.pasteHTML(''+m+"");if(!o){k.collapse(false);h.moveToElementText(k.parentElement());if(h.compareEndPoints("StartToEnd",k)===0){k.move("character",-1)}k.pasteHTML(''+m+"")}}catch(r){return null}}else{p=h.item(0);i=p.nodeName;return{name:i,index:g(i,p)}}}else{p=y.getNode();i=p.nodeName;if(i=="IMG"){return{name:i,index:g(i,p)}}k=u(h.cloneRange());if(!o){k.collapse(false);k.insertNode(n.create("span",{"data-mce-type":"bookmark",id:j+"_end",style:x},m))}h=u(h);h.collapse(true);h.insertNode(n.create("span",{"data-mce-type":"bookmark",id:j+"_start",style:x},m))}y.moveToBookmark({id:j,keep:1});return{id:j}},moveToBookmark:function(o){var s=this,m=s.dom,j,i,g,r,k,u,p,q;function h(A){var t=o[A?"start":"end"],x,y,z,v;if(t){z=t[0];for(y=r,x=t.length-1;x>=1;x--){v=y.childNodes;if(t[x]>v.length-1){return}y=v[t[x]]}if(y.nodeType===3){z=Math.min(t[0],y.nodeValue.length)}if(y.nodeType===1){z=Math.min(t[0],y.childNodes.length)}if(A){g.setStart(y,z)}else{g.setEnd(y,z)}}return true}function l(B){var v=m.get(o.id+"_"+B),A,t,y,z,x=o.keep;if(v){A=v.parentNode;if(B=="start"){if(!x){t=m.nodeIndex(v)}else{A=v.firstChild;t=1}k=u=A;p=q=t}else{if(!x){t=m.nodeIndex(v)}else{A=v.firstChild;t=1}u=A;q=t}if(!x){z=v.previousSibling;y=v.nextSibling;e(d.grep(v.childNodes),function(C){if(C.nodeType==3){C.nodeValue=C.nodeValue.replace(/\uFEFF/g,"")}});while(v=m.get(o.id+"_"+B)){m.remove(v,1)}if(z&&y&&z.nodeType==y.nodeType&&z.nodeType==3&&!d.isOpera){t=z.nodeValue.length;z.appendData(y.nodeValue);m.remove(y);if(B=="start"){k=u=z;p=q=t}else{u=z;q=t}}}}}function n(t){if(m.isBlock(t)&&!t.innerHTML&&!b){t.innerHTML='
                    '}return t}if(o){if(o.start){g=m.createRng();r=m.getRoot();if(s.tridentSel){return s.tridentSel.moveToBookmark(o)}if(h(true)&&h()){s.setRng(g)}}else{if(o.id){l("start");l("end");if(k){g=m.createRng();g.setStart(n(k),p);g.setEnd(n(u),q);s.setRng(g)}}else{if(o.name){s.select(m.select(o.name)[o.index])}else{if(o.rng){s.setRng(o.rng)}}}}}},select:function(l,k){var j=this,m=j.dom,h=m.createRng(),g;function i(n,p){var o=new a(n,n);do{if(n.nodeType==3&&d.trim(n.nodeValue).length!==0){if(p){h.setStart(n,0)}else{h.setEnd(n,n.nodeValue.length)}return}if(n.nodeName=="BR"){if(p){h.setStartBefore(n)}else{h.setEndBefore(n)}return}}while(n=(p?o.next():o.prev()))}if(l){g=m.nodeIndex(l);h.setStart(l.parentNode,g);h.setEnd(l.parentNode,g+1);if(k){i(l,1);i(l)}j.setRng(h)}return l},isCollapsed:function(){var g=this,i=g.getRng(),h=g.getSel();if(!i||i.item){return false}if(i.compareEndPoints){return i.compareEndPoints("StartToEnd",i)===0}return !h||i.collapsed},collapse:function(g){var i=this,h=i.getRng(),j;if(h.item){j=h.item(0);h=i.win.document.body.createTextRange();h.moveToElementText(j)}h.collapse(!!g);i.setRng(h)},getSel:function(){var h=this,g=this.win;return g.getSelection?g.getSelection():g.document.selection},getRng:function(m){var h=this,j,g,l,k=h.win.document;if(m&&h.tridentSel){return h.tridentSel.getRangeAt(0)}try{if(j=h.getSel()){g=j.rangeCount>0?j.getRangeAt(0):(j.createRange?j.createRange():k.createRange())}}catch(i){}if(d.isIE&&g&&g.setStart&&k.selection.createRange().item){l=k.selection.createRange().item(0);g=k.createRange();g.setStartBefore(l);g.setEndAfter(l)}if(!g){g=k.createRange?k.createRange():k.body.createTextRange()}if(g.setStart&&g.startContainer.nodeType===9&&g.collapsed){l=h.dom.getRoot();g.setStart(l,0);g.setEnd(l,0)}if(h.selectedRange&&h.explicitRange){if(g.compareBoundaryPoints(g.START_TO_START,h.selectedRange)===0&&g.compareBoundaryPoints(g.END_TO_END,h.selectedRange)===0){g=h.explicitRange}else{h.selectedRange=null;h.explicitRange=null}}return g},setRng:function(k,g){var j,i=this;if(!i.tridentSel){j=i.getSel();if(j){i.explicitRange=k;try{j.removeAllRanges()}catch(h){}j.addRange(k);if(g===false&&j.extend){j.collapse(k.endContainer,k.endOffset);j.extend(k.startContainer,k.startOffset)}i.selectedRange=j.rangeCount>0?j.getRangeAt(0):null}}else{if(k.cloneRange){try{i.tridentSel.addRange(k);return}catch(h){}}try{k.select()}catch(h){}}},setNode:function(h){var g=this;g.setContent(g.dom.getOuterHTML(h));return h},getNode:function(){var i=this,h=i.getRng(),j=i.getSel(),m,l=h.startContainer,g=h.endContainer;function k(q,o){var p=q;while(q&&q.nodeType===3&&q.length===0){q=o?q.nextSibling:q.previousSibling}return q||p}if(!h){return i.dom.getRoot()}if(h.setStart){m=h.commonAncestorContainer;if(!h.collapsed){if(h.startContainer==h.endContainer){if(h.endOffset-h.startOffset<2){if(h.startContainer.hasChildNodes()){m=h.startContainer.childNodes[h.startOffset]}}}if(l.nodeType===3&&g.nodeType===3){if(l.length===h.startOffset){l=k(l.nextSibling,true)}else{l=l.parentNode}if(h.endOffset===0){g=k(g.previousSibling,false)}else{g=g.parentNode}if(l&&l===g){return l}}}if(m&&m.nodeType==3){return m.parentNode}return m}return h.item?h.item(0):h.parentElement()},getSelectedBlocks:function(p,h){var o=this,k=o.dom,m,l,i,j=[];m=k.getParent(p||o.getStart(),k.isBlock);l=k.getParent(h||o.getEnd(),k.isBlock);if(m){j.push(m)}if(m&&l&&m!=l){i=m;var g=new a(m,k.getRoot());while((i=g.next())&&i!=l){if(k.isBlock(i)){j.push(i)}}}if(l&&m!=l){j.push(l)}return j},isForward:function(){var i=this.dom,g=this.getSel(),j,h;if(!g||g.anchorNode==null||g.focusNode==null){return true}j=i.createRng();j.setStart(g.anchorNode,g.anchorOffset);j.collapse(true);h=i.createRng();h.setStart(g.focusNode,g.focusOffset);h.collapse(true);return j.compareBoundaryPoints(j.START_TO_START,h)<=0},normalize:function(){var h=this,g,m,l,j,i;function k(p){var o,r,n,s=h.dom,u=s.getRoot(),q,t,v;function y(z,A){var B=new a(z,s.getParent(z.parentNode,s.isBlock)||u);while(z=B[A?"prev":"next"]()){if(z.nodeName==="BR"){return true}}}function x(B,z){var C,A;z=z||o;C=new a(z,s.getParent(z.parentNode,s.isBlock)||u);while(q=C[B?"prev":"next"]()){if(q.nodeType===3&&q.nodeValue.length>0){o=q;r=B?q.nodeValue.length:0;m=true;return}if(s.isBlock(q)||t[q.nodeName.toLowerCase()]){return}A=q}if(l&&A){o=A;m=true;r=0}}o=g[(p?"start":"end")+"Container"];r=g[(p?"start":"end")+"Offset"];t=s.schema.getNonEmptyElements();if(o.nodeType===9){o=s.getRoot();r=0}if(o===u){if(p){q=o.childNodes[r>0?r-1:0];if(q){v=q.nodeName.toLowerCase();if(t[q.nodeName]||q.nodeName=="TABLE"){return}}}if(o.hasChildNodes()){o=o.childNodes[Math.min(!p&&r>0?r-1:r,o.childNodes.length-1)];r=0;if(o.hasChildNodes()&&!/TABLE/.test(o.nodeName)){q=o;n=new a(o,u);do{if(q.nodeType===3&&q.nodeValue.length>0){r=p?0:q.nodeValue.length;o=q;m=true;break}if(t[q.nodeName.toLowerCase()]){r=s.nodeIndex(q);o=q.parentNode;if(q.nodeName=="IMG"&&!p){r++}m=true;break}}while(q=(p?n.next():n.prev()))}}}if(l){if(o.nodeType===3&&r===0){x(true)}if(o.nodeType===1){q=o.childNodes[r];if(q&&q.nodeName==="BR"&&!y(q)&&!y(q,true)){x(true,o.childNodes[r])}}}if(p&&!l&&o.nodeType===3&&r===o.nodeValue.length){x(false)}if(m){g["set"+(p?"Start":"End")](o,r)}}if(d.isIE){return}g=h.getRng();l=g.collapsed;k(true);if(!l){k()}if(m){if(l){g.collapse(true)}h.setRng(g,h.isForward())}},destroy:function(h){var g=this;g.win=null;if(!h){d.removeUnload(g.destroy)}},_fixIESelection:function(){var h=this.dom,n=h.doc,i=n.body,k,o,g;function j(p,s){var q=i.createTextRange();try{q.moveToPoint(p,s)}catch(r){q=null}return q}function m(q){var p;if(q.button){p=j(q.x,q.y);if(p){if(p.compareEndPoints("StartToStart",o)>0){p.setEndPoint("StartToStart",o)}else{p.setEndPoint("EndToEnd",o)}p.select()}}else{l()}}function l(){var p=n.selection.createRange();if(o&&!p.item&&p.compareEndPoints("StartToEnd",p)===0){o.select()}h.unbind(n,"mouseup",l);h.unbind(n,"mousemove",m);o=k=0}n.documentElement.unselectable=true;h.bind(n,["mousedown","contextmenu"],function(p){if(p.target.nodeName==="HTML"){if(k){l()}g=n.documentElement;if(g.scrollHeight>g.clientHeight){return}k=1;o=j(p.x,p.y);if(o){h.bind(n,"mouseup",l);h.bind(n,"mousemove",m);h.win.focus();o.select()}}})}})})(tinymce);(function(a){a.dom.Serializer=function(e,i,f){var h,b,d=a.isIE,g=a.each,c;if(!e.apply_source_formatting){e.indent=false}i=i||a.DOM;f=f||new a.html.Schema(e);e.entity_encoding=e.entity_encoding||"named";e.remove_trailing_brs="remove_trailing_brs" in e?e.remove_trailing_brs:true;h=new a.util.Dispatcher(self);b=new a.util.Dispatcher(self);c=new a.html.DomParser(e,f);c.addAttributeFilter("src,href,style",function(k,j){var o=k.length,l,q,n="data-mce-"+j,p=e.url_converter,r=e.url_converter_scope,m;while(o--){l=k[o];q=l.attributes.map[n];if(q!==m){l.attr(j,q.length>0?q:null);l.attr(n,null)}else{q=l.attributes.map[j];if(j==="style"){q=i.serializeStyle(i.parseStyle(q),l.name)}else{if(p){q=p.call(r,q,j,l.name)}}l.attr(j,q.length>0?q:null)}}});c.addAttributeFilter("class",function(j,k){var l=j.length,m,n;while(l--){m=j[l];n=m.attr("class").replace(/(?:^|\s)mce(Item\w+|Selected)(?!\S)/g,"");m.attr("class",n.length>0?n:null)}});c.addAttributeFilter("data-mce-type",function(j,l,k){var m=j.length,n;while(m--){n=j[m];if(n.attributes.map["data-mce-type"]==="bookmark"&&!k.cleanup){n.remove()}}});c.addAttributeFilter("data-mce-expando",function(j,l,k){var m=j.length;while(m--){j[m].attr(l,null)}});c.addNodeFilter("script,style",function(k,l){var m=k.length,n,o;function j(p){return p.replace(/()/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*(()?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")}while(m--){n=k[m];o=n.firstChild?n.firstChild.value:"";if(l==="script"){n.attr("type",(n.attr("type")||"text/javascript").replace(/^mce\-/,""));if(o.length>0){n.firstChild.value="// "}}else{if(o.length>0){n.firstChild.value=""}}}});c.addNodeFilter("#comment",function(j,k){var l=j.length,m;while(l--){m=j[l];if(m.value.indexOf("[CDATA[")===0){m.name="#cdata";m.type=4;m.value=m.value.replace(/^\[CDATA\[|\]\]$/g,"")}else{if(m.value.indexOf("mce:protected ")===0){m.name="#text";m.type=3;m.raw=true;m.value=unescape(m.value).substr(14)}}}});c.addNodeFilter("xml:namespace,input",function(j,k){var l=j.length,m;while(l--){m=j[l];if(m.type===7){m.remove()}else{if(m.type===1){if(k==="input"&&!("type" in m.attributes.map)){m.attr("type","text")}}}}});if(e.fix_list_elements){c.addNodeFilter("ul,ol",function(k,l){var m=k.length,n,j;while(m--){n=k[m];j=n.parent;if(j.name==="ul"||j.name==="ol"){if(n.prev&&n.prev.name==="li"){n.prev.append(n)}}}})}c.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style",function(j,k){var l=j.length;while(l--){j[l].attr(k,null)}});return{schema:f,addNodeFilter:c.addNodeFilter,addAttributeFilter:c.addAttributeFilter,onPreProcess:h,onPostProcess:b,serialize:function(o,m){var l,p,k,j,n;if(d&&i.select("script,style,select,map").length>0){n=o.innerHTML;o=o.cloneNode(false);i.setHTML(o,n)}else{o=o.cloneNode(true)}l=o.ownerDocument.implementation;if(l.createHTMLDocument){p=l.createHTMLDocument("");g(o.nodeName=="BODY"?o.childNodes:[o],function(q){p.body.appendChild(p.importNode(q,true))});if(o.nodeName!="BODY"){o=p.body.firstChild}else{o=p.body}k=i.doc;i.doc=p}m=m||{};m.format=m.format||"html";if(!m.no_events){m.node=o;h.dispatch(self,m)}j=new a.html.Serializer(e,f);m.content=j.serialize(c.parse(a.trim(m.getInner?o.innerHTML:i.getOuterHTML(o)),m));if(!m.cleanup){m.content=m.content.replace(/\uFEFF|\u200B/g,"")}if(!m.no_events){b.dispatch(self,m)}if(k){i.doc=k}m.node=null;return m.content},addRules:function(j){f.addValidElements(j)},setRules:function(j){f.setValidElements(j)}}}})(tinymce);(function(a){a.dom.ScriptLoader=function(h){var c=0,k=1,i=2,l={},j=[],e={},d=[],g=0,f;function b(m,v){var x=this,q=a.DOM,s,o,r,n;function p(){q.remove(n);if(s){s.onreadystatechange=s.onload=s=null}v()}function u(){if(typeof(console)!=="undefined"&&console.log){console.log("Failed to load: "+m)}}n=q.uniqueId();if(a.isIE6){o=new a.util.URI(m);r=location;if(o.host==r.hostname&&o.port==r.port&&(o.protocol+":")==r.protocol&&o.protocol.toLowerCase()!="file"){a.util.XHR.send({url:a._addVer(o.getURI()),success:function(y){var t=q.create("script",{type:"text/javascript"});t.text=y;document.getElementsByTagName("head")[0].appendChild(t);q.remove(t);p()},error:u});return}}s=document.createElement("script");s.id=n;s.type="text/javascript";s.src=a._addVer(m);if(!a.isIE){s.onload=p}s.onerror=u;if(!a.isOpera){s.onreadystatechange=function(){var t=s.readyState;if(t=="complete"||t=="loaded"){p()}}}(document.getElementsByTagName("head")[0]||document.body).appendChild(s)}this.isDone=function(m){return l[m]==i};this.markDone=function(m){l[m]=i};this.add=this.load=function(m,q,n){var o,p=l[m];if(p==f){j.push(m);l[m]=c}if(q){if(!e[m]){e[m]=[]}e[m].push({func:q,scope:n||this})}};this.loadQueue=function(n,m){this.loadScripts(j,n,m)};this.loadScripts=function(m,q,p){var o;function n(r){a.each(e[r],function(s){s.func.call(s.scope)});e[r]=f}d.push({func:q,scope:p||this});o=function(){var r=a.grep(m);m.length=0;a.each(r,function(s){if(l[s]==i){n(s);return}if(l[s]!=k){l[s]=k;g++;b(s,function(){l[s]=i;g--;n(s);o()})}});if(!g){a.each(d,function(s){s.func.call(s.scope)});d.length=0}};o()}};a.ScriptLoader=new a.dom.ScriptLoader()})(tinymce);(function(a){a.dom.RangeUtils=function(c){var b="\uFEFF";this.walk=function(d,s){var i=d.startContainer,l=d.startOffset,t=d.endContainer,m=d.endOffset,j,g,o,h,r,q,e;e=c.select("td.mceSelected,th.mceSelected");if(e.length>0){a.each(e,function(u){s([u])});return}function f(u){var v;v=u[0];if(v.nodeType===3&&v===i&&l>=v.nodeValue.length){u.splice(0,1)}v=u[u.length-1];if(m===0&&u.length>0&&v===t&&v.nodeType===3){u.splice(u.length-1,1)}return u}function p(x,v,u){var y=[];for(;x&&x!=u;x=x[v]){y.push(x)}return y}function n(v,u){do{if(v.parentNode==u){return v}v=v.parentNode}while(v)}function k(x,v,y){var u=y?"nextSibling":"previousSibling";for(h=x,r=h.parentNode;h&&h!=v;h=r){r=h.parentNode;q=p(h==x?h:h[u],u);if(q.length){if(!y){q.reverse()}s(f(q))}}}if(i.nodeType==1&&i.hasChildNodes()){i=i.childNodes[l]}if(t.nodeType==1&&t.hasChildNodes()){t=t.childNodes[Math.min(m-1,t.childNodes.length-1)]}if(i==t){return s(f([i]))}j=c.findCommonAncestor(i,t);for(h=i;h;h=h.parentNode){if(h===t){return k(i,j,true)}if(h===j){break}}for(h=t;h;h=h.parentNode){if(h===i){return k(t,j)}if(h===j){break}}g=n(i,j)||i;o=n(t,j)||t;k(i,g,true);q=p(g==i?g:g.nextSibling,"nextSibling",o==t?o.nextSibling:o);if(q.length){s(f(q))}k(t,o)};this.split=function(e){var h=e.startContainer,d=e.startOffset,i=e.endContainer,g=e.endOffset;function f(j,k){return j.splitText(k)}if(h==i&&h.nodeType==3){if(d>0&&dd){g=g-d;h=i=f(i,g).previousSibling;g=i.nodeValue.length;d=0}else{g=0}}}else{if(h.nodeType==3&&d>0&&d0&&g=m.length){r=0}}t=m[r];f.setAttrib(g,"tabindex","-1");f.setAttrib(t.id,"tabindex","0");f.get(t.id).focus();if(e.actOnFocus){e.onAction(t.id)}if(s){a.cancel(s)}};p=function(z){var v=37,u=39,y=38,A=40,r=27,t=14,s=13,x=32;switch(z.keyCode){case v:if(i){q.moveFocus(-1)}break;case u:if(i){q.moveFocus(1)}break;case y:if(o){q.moveFocus(-1)}break;case A:if(o){q.moveFocus(1)}break;case r:if(e.onCancel){e.onCancel();a.cancel(z)}break;case t:case s:case x:if(e.onAction){e.onAction(g);a.cancel(z)}break}};c(m,function(t,r){var s,u;if(!t.id){t.id=f.uniqueId("_mce_item_")}u=f.get(t.id);if(l){f.bind(u,"blur",h);s="-1"}else{s=(r===0?"0":"-1")}u.setAttribute("tabindex",s);f.bind(u,"focus",k)});if(m[0]){g=m[0].id}f.setAttrib(n,"tabindex","-1");var j=f.get(n);f.bind(j,"focus",d);f.bind(j,"keydown",p)}})})(tinymce);(function(c){var b=c.DOM,a=c.is;c.create("tinymce.ui.Control",{Control:function(f,e,d){this.id=f;this.settings=e=e||{};this.rendered=false;this.onRender=new c.util.Dispatcher(this);this.classPrefix="";this.scope=e.scope||this;this.disabled=0;this.active=0;this.editor=d},setAriaProperty:function(f,e){var d=b.get(this.id+"_aria")||b.get(this.id);if(d){b.setAttrib(d,"aria-"+f,!!e)}},focus:function(){b.get(this.id).focus()},setDisabled:function(d){if(d!=this.disabled){this.setAriaProperty("disabled",d);this.setState("Disabled",d);this.setState("Enabled",!d);this.disabled=d}},isDisabled:function(){return this.disabled},setActive:function(d){if(d!=this.active){this.setState("Active",d);this.active=d;this.setAriaProperty("pressed",d)}},isActive:function(){return this.active},setState:function(f,d){var e=b.get(this.id);f=this.classPrefix+f;if(d){b.addClass(e,f)}else{b.removeClass(e,f)}},isRendered:function(){return this.rendered},renderHTML:function(){},renderTo:function(d){b.setHTML(d,this.renderHTML())},postRender:function(){var e=this,d;if(a(e.disabled)){d=e.disabled;e.disabled=-1;e.setDisabled(d)}if(a(e.active)){d=e.active;e.active=-1;e.setActive(d)}},remove:function(){b.remove(this.id);this.destroy()},destroy:function(){c.dom.Event.clear(this.id)}})})(tinymce);tinymce.create("tinymce.ui.Container:tinymce.ui.Control",{Container:function(c,b,a){this.parent(c,b,a);this.controls=[];this.lookup={}},add:function(a){this.lookup[a.id]=a;this.controls.push(a);return a},get:function(a){return this.lookup[a]}});tinymce.create("tinymce.ui.Separator:tinymce.ui.Control",{Separator:function(b,a){this.parent(b,a);this.classPrefix="mceSeparator";this.setDisabled(true)},renderHTML:function(){return tinymce.DOM.createHTML("span",{"class":this.classPrefix,role:"separator","aria-orientation":"vertical",tabindex:"-1"})}});(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.MenuItem:tinymce.ui.Control",{MenuItem:function(g,f){this.parent(g,f);this.classPrefix="mceMenuItem"},setSelected:function(f){this.setState("Selected",f);this.setAriaProperty("checked",!!f);this.selected=f},isSelected:function(){return this.selected},postRender:function(){var f=this;f.parent();if(c(f.selected)){f.setSelected(f.selected)}}})})(tinymce);(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.Menu:tinymce.ui.MenuItem",{Menu:function(h,g){var f=this;f.parent(h,g);f.items={};f.collapsed=false;f.menuCount=0;f.onAddItem=new d.util.Dispatcher(this)},expand:function(g){var f=this;if(g){a(f,function(h){if(h.expand){h.expand()}},"items",f)}f.collapsed=false},collapse:function(g){var f=this;if(g){a(f,function(h){if(h.collapse){h.collapse()}},"items",f)}f.collapsed=true},isCollapsed:function(){return this.collapsed},add:function(f){if(!f.settings){f=new d.ui.MenuItem(f.id||b.uniqueId(),f)}this.onAddItem.dispatch(this,f);return this.items[f.id]=f},addSeparator:function(){return this.add({separator:true})},addMenu:function(f){if(!f.collapse){f=this.createMenu(f)}this.menuCount++;return this.add(f)},hasMenus:function(){return this.menuCount!==0},remove:function(f){delete this.items[f.id]},removeAll:function(){var f=this;a(f,function(g){if(g.removeAll){g.removeAll()}else{g.remove()}g.destroy()},"items",f);f.items={}},createMenu:function(g){var f=new d.ui.Menu(g.id||b.uniqueId(),g);f.onAddItem.add(this.onAddItem.dispatch,this.onAddItem);return f}})})(tinymce);(function(e){var d=e.is,c=e.DOM,f=e.each,a=e.dom.Event,b=e.dom.Element;e.create("tinymce.ui.DropMenu:tinymce.ui.Menu",{DropMenu:function(h,g){g=g||{};g.container=g.container||c.doc.body;g.offset_x=g.offset_x||0;g.offset_y=g.offset_y||0;g.vp_offset_x=g.vp_offset_x||0;g.vp_offset_y=g.vp_offset_y||0;if(d(g.icons)&&!g.icons){g["class"]+=" mceNoIcons"}this.parent(h,g);this.onShowMenu=new e.util.Dispatcher(this);this.onHideMenu=new e.util.Dispatcher(this);this.classPrefix="mceMenu"},createMenu:function(j){var h=this,i=h.settings,g;j.container=j.container||i.container;j.parent=h;j.constrain=j.constrain||i.constrain;j["class"]=j["class"]||i["class"];j.vp_offset_x=j.vp_offset_x||i.vp_offset_x;j.vp_offset_y=j.vp_offset_y||i.vp_offset_y;j.keyboard_focus=i.keyboard_focus;g=new e.ui.DropMenu(j.id||c.uniqueId(),j);g.onAddItem.add(h.onAddItem.dispatch,h.onAddItem);return g},focus:function(){var g=this;if(g.keyboardNav){g.keyboardNav.focus()}},update:function(){var i=this,j=i.settings,g=c.get("menu_"+i.id+"_tbl"),l=c.get("menu_"+i.id+"_co"),h,k;h=j.max_width?Math.min(g.offsetWidth,j.max_width):g.offsetWidth;k=j.max_height?Math.min(g.offsetHeight,j.max_height):g.offsetHeight;if(!c.boxModel){i.element.setStyles({width:h+2,height:k+2})}else{i.element.setStyles({width:h,height:k})}if(j.max_width){c.setStyle(l,"width",h)}if(j.max_height){c.setStyle(l,"height",k);if(g.clientHeightv){p=r?r-u:Math.max(0,(v-A.vp_offset_x)-u)}if((n+A.vp_offset_y+l)>q){n=Math.max(0,(q-A.vp_offset_y)-l)}}c.setStyles(o,{left:p,top:n});z.element.update();z.isMenuVisible=1;z.mouseClickFunc=a.add(o,"click",function(s){var h;s=s.target;if(s&&(s=c.getParent(s,"tr"))&&!c.hasClass(s,m+"ItemSub")){h=z.items[s.id];if(h.isDisabled()){return}k=z;while(k){if(k.hideMenu){k.hideMenu()}k=k.settings.parent}if(h.settings.onclick){h.settings.onclick(s)}return false}});if(z.hasMenus()){z.mouseOverFunc=a.add(o,"mouseover",function(x){var h,t,s;x=x.target;if(x&&(x=c.getParent(x,"tr"))){h=z.items[x.id];if(z.lastMenu){z.lastMenu.collapse(1)}if(h.isDisabled()){return}if(x&&c.hasClass(x,m+"ItemSub")){t=c.getRect(x);h.showMenu((t.x+t.w-i),t.y-i,t.x);z.lastMenu=h;c.addClass(c.get(h.id).firstChild,m+"ItemActive")}}})}a.add(o,"keydown",z._keyHandler,z);z.onShowMenu.dispatch(z);if(A.keyboard_focus){z._setupKeyboardNav()}},hideMenu:function(j){var g=this,i=c.get("menu_"+g.id),h;if(!g.isMenuVisible){return}if(g.keyboardNav){g.keyboardNav.destroy()}a.remove(i,"mouseover",g.mouseOverFunc);a.remove(i,"click",g.mouseClickFunc);a.remove(i,"keydown",g._keyHandler);c.hide(i);g.isMenuVisible=0;if(!j){g.collapse(1)}if(g.element){g.element.hide()}if(h=c.get(g.id)){c.removeClass(h.firstChild,g.classPrefix+"ItemActive")}g.onHideMenu.dispatch(g)},add:function(i){var g=this,h;i=g.parent(i);if(g.isRendered&&(h=c.get("menu_"+g.id))){g._add(c.select("tbody",h)[0],i)}return i},collapse:function(g){this.parent(g);this.hideMenu(1)},remove:function(g){c.remove(g.id);this.destroy();return this.parent(g)},destroy:function(){var g=this,h=c.get("menu_"+g.id);if(g.keyboardNav){g.keyboardNav.destroy()}a.remove(h,"mouseover",g.mouseOverFunc);a.remove(c.select("a",h),"focus",g.mouseOverFunc);a.remove(h,"click",g.mouseClickFunc);a.remove(h,"keydown",g._keyHandler);if(g.element){g.element.remove()}c.remove(h)},renderNode:function(){var i=this,j=i.settings,l,h,k,g;g=c.create("div",{role:"listbox",id:"menu_"+i.id,"class":j["class"],style:"position:absolute;left:0;top:0;z-index:200000;outline:0"});if(i.settings.parent){c.setAttrib(g,"aria-parent","menu_"+i.settings.parent.id)}k=c.add(g,"div",{role:"presentation",id:"menu_"+i.id+"_co","class":i.classPrefix+(j["class"]?" "+j["class"]:"")});i.element=new b("menu_"+i.id,{blocker:1,container:j.container});if(j.menu_line){c.add(k,"span",{"class":i.classPrefix+"Line"})}l=c.add(k,"table",{role:"presentation",id:"menu_"+i.id+"_tbl",border:0,cellPadding:0,cellSpacing:0});h=c.add(l,"tbody");f(i.items,function(m){i._add(h,m)});i.rendered=true;return g},_setupKeyboardNav:function(){var i,h,g=this;i=c.get("menu_"+g.id);h=c.select("a[role=option]","menu_"+g.id);h.splice(0,0,i);g.keyboardNav=new e.ui.KeyboardNavigation({root:"menu_"+g.id,items:h,onCancel:function(){g.hideMenu()},enableUpDown:true});i.focus()},_keyHandler:function(g){var h=this,i;switch(g.keyCode){case 37:if(h.settings.parent){h.hideMenu();h.settings.parent.focus();a.cancel(g)}break;case 39:if(h.mouseOverFunc){h.mouseOverFunc(g)}break}},_add:function(j,h){var i,q=h.settings,p,l,k,m=this.classPrefix,g;if(q.separator){l=c.add(j,"tr",{id:h.id,"class":m+"ItemSeparator"});c.add(l,"td",{"class":m+"ItemSeparator"});if(i=l.previousSibling){c.addClass(i,"mceLast")}return}i=l=c.add(j,"tr",{id:h.id,"class":m+"Item "+m+"ItemEnabled"});i=k=c.add(i,q.titleItem?"th":"td");i=p=c.add(i,"a",{id:h.id+"_aria",role:q.titleItem?"presentation":"option",href:"javascript:;",onclick:"return false;",onmousedown:"return false;"});if(q.parent){c.setAttrib(p,"aria-haspopup","true");c.setAttrib(p,"aria-owns","menu_"+h.id)}c.addClass(k,q["class"]);g=c.add(i,"span",{"class":"mceIcon"+(q.icon?" mce_"+q.icon:"")});if(q.icon_src){c.add(g,"img",{src:q.icon_src})}i=c.add(i,q.element||"span",{"class":"mceText",title:h.settings.title},h.settings.title);if(h.settings.style){if(typeof h.settings.style=="function"){h.settings.style=h.settings.style()}c.setAttrib(i,"style",h.settings.style)}if(j.childNodes.length==1){c.addClass(l,"mceFirst")}if((i=l.previousSibling)&&c.hasClass(i,m+"ItemSeparator")){c.addClass(l,"mceFirst")}if(h.collapse){c.addClass(l,m+"ItemSub")}if(i=l.previousSibling){c.removeClass(i,"mceLast")}c.addClass(l,"mceLast")}})})(tinymce);(function(b){var a=b.DOM;b.create("tinymce.ui.Button:tinymce.ui.Control",{Button:function(e,d,c){this.parent(e,d,c);this.classPrefix="mceButton"},renderHTML:function(){var f=this.classPrefix,e=this.settings,d,c;c=a.encode(e.label||"");d='';if(e.image&&!(this.editor&&this.editor.forcedHighContrastMode)){d+=''+a.encode(e.title)+''+c}else{d+=''+(c?''+c+"":"")}d+='";d+="";return d},postRender:function(){var d=this,e=d.settings,c;if(b.isIE&&d.editor){b.dom.Event.add(d.id,"mousedown",function(f){var g=d.editor.selection.getNode().nodeName;c=g==="IMG"?d.editor.selection.getBookmark():null})}b.dom.Event.add(d.id,"click",function(f){if(!d.isDisabled()){if(b.isIE&&d.editor&&c!==null){d.editor.selection.moveToBookmark(c)}return e.onclick.call(e.scope,f)}});b.dom.Event.add(d.id,"keyup",function(f){if(!d.isDisabled()&&f.keyCode==b.VK.SPACEBAR){return e.onclick.call(e.scope,f)}})}})})(tinymce);(function(e){var d=e.DOM,b=e.dom.Event,f=e.each,a=e.util.Dispatcher,c;e.create("tinymce.ui.ListBox:tinymce.ui.Control",{ListBox:function(j,i,g){var h=this;h.parent(j,i,g);h.items=[];h.onChange=new a(h);h.onPostRender=new a(h);h.onAdd=new a(h);h.onRenderMenu=new e.util.Dispatcher(this);h.classPrefix="mceListBox";h.marked={}},select:function(h){var g=this,j,i;g.marked={};if(h==c){return g.selectByIndex(-1)}if(h&&typeof(h)=="function"){i=h}else{i=function(k){return k==h}}if(h!=g.selectedValue){f(g.items,function(l,k){if(i(l.value)){j=1;g.selectByIndex(k);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(g){var i=this,j,k,h;i.marked={};if(g!=i.selectedIndex){j=d.get(i.id+"_text");h=d.get(i.id+"_voiceDesc");k=i.items[g];if(k){i.selectedValue=k.value;i.selectedIndex=g;d.setHTML(j,d.encode(k.title));d.setHTML(h,i.settings.title+" - "+k.title);d.removeClass(j,"mceTitle");d.setAttrib(i.id,"aria-valuenow",k.title)}else{d.setHTML(j,d.encode(i.settings.title));d.setHTML(h,d.encode(i.settings.title));d.addClass(j,"mceTitle");i.selectedValue=i.selectedIndex=null;d.setAttrib(i.id,"aria-valuenow",i.settings.title)}j=0}},mark:function(g){this.marked[g]=true},add:function(j,g,i){var h=this;i=i||{};i=e.extend(i,{title:j,value:g});h.items.push(i);h.onAdd.dispatch(h,i)},getLength:function(){return this.items.length},renderHTML:function(){var j="",g=this,i=g.settings,k=g.classPrefix;j='';j+="";j+="";j+="";return j},showMenu:function(){var h=this,j,i=d.get(this.id),g;if(h.isDisabled()||h.items.length===0){return}if(h.menu&&h.menu.isMenuVisible){return h.hideMenu()}if(!h.isMenuRendered){h.renderMenu();h.isMenuRendered=true}j=d.getPos(i);g=h.menu;g.settings.offset_x=j.x;g.settings.offset_y=j.y;g.settings.keyboard_focus=!e.isOpera;f(h.items,function(k){if(g.items[k.id]){g.items[k.id].setSelected(0)}});f(h.items,function(k){if(g.items[k.id]&&h.marked[k.value]){g.items[k.id].setSelected(1)}if(k.value===h.selectedValue){g.items[k.id].setSelected(1)}});g.showMenu(0,i.clientHeight);b.add(d.doc,"mousedown",h.hideMenu,h);d.addClass(h.id,h.classPrefix+"Selected")},hideMenu:function(h){var g=this;if(g.menu&&g.menu.isMenuVisible){d.removeClass(g.id,g.classPrefix+"Selected");if(h&&h.type=="mousedown"&&(h.target.id==g.id+"_text"||h.target.id==g.id+"_open")){return}if(!h||!d.getParent(h.target,".mceMenu")){d.removeClass(g.id,g.classPrefix+"Selected");b.remove(d.doc,"mousedown",g.hideMenu,g);g.menu.hideMenu()}}},renderMenu:function(){var h=this,g;g=h.settings.control_manager.createDropMenu(h.id+"_menu",{menu_line:1,"class":h.classPrefix+"Menu mceNoIcons",max_width:250,max_height:150});g.onHideMenu.add(function(){h.hideMenu();h.focus()});g.add({title:h.settings.title,"class":"mceMenuItemTitle",onclick:function(){if(h.settings.onselect("")!==false){h.select("")}}});f(h.items,function(i){if(i.value===c){g.add({title:i.title,role:"option","class":"mceMenuItemTitle",onclick:function(){if(h.settings.onselect("")!==false){h.select("")}}})}else{i.id=d.uniqueId();i.role="option";i.onclick=function(){if(h.settings.onselect(i.value)!==false){h.select(i.value)}};g.add(i)}});h.onRenderMenu.dispatch(h,g);h.menu=g},postRender:function(){var g=this,h=g.classPrefix;b.add(g.id,"click",g.showMenu,g);b.add(g.id,"keydown",function(i){if(i.keyCode==32){g.showMenu(i);b.cancel(i)}});b.add(g.id,"focus",function(){if(!g._focused){g.keyDownHandler=b.add(g.id,"keydown",function(i){if(i.keyCode==40){g.showMenu();b.cancel(i)}});g.keyPressHandler=b.add(g.id,"keypress",function(j){var i;if(j.keyCode==13){i=g.selectedValue;g.selectedValue=null;b.cancel(j);g.settings.onselect(i)}})}g._focused=1});b.add(g.id,"blur",function(){b.remove(g.id,"keydown",g.keyDownHandler);b.remove(g.id,"keypress",g.keyPressHandler);g._focused=0});if(e.isIE6||!d.boxModel){b.add(g.id,"mouseover",function(){if(!d.hasClass(g.id,h+"Disabled")){d.addClass(g.id,h+"Hover")}});b.add(g.id,"mouseout",function(){if(!d.hasClass(g.id,h+"Disabled")){d.removeClass(g.id,h+"Hover")}})}g.onPostRender.dispatch(g,d.get(g.id))},destroy:function(){this.parent();b.clear(this.id+"_text");b.clear(this.id+"_open")}})})(tinymce);(function(e){var d=e.DOM,b=e.dom.Event,f=e.each,a=e.util.Dispatcher,c;e.create("tinymce.ui.NativeListBox:tinymce.ui.ListBox",{NativeListBox:function(h,g){this.parent(h,g);this.classPrefix="mceNativeListBox"},setDisabled:function(g){d.get(this.id).disabled=g;this.setAriaProperty("disabled",g)},isDisabled:function(){return d.get(this.id).disabled},select:function(h){var g=this,j,i;if(h==c){return g.selectByIndex(-1)}if(h&&typeof(h)=="function"){i=h}else{i=function(k){return k==h}}if(h!=g.selectedValue){f(g.items,function(l,k){if(i(l.value)){j=1;g.selectByIndex(k);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(g){d.get(this.id).selectedIndex=g+1;this.selectedValue=this.items[g]?this.items[g].value:null},add:function(k,h,g){var j,i=this;g=g||{};g.value=h;if(i.isRendered()){d.add(d.get(this.id),"option",g,k)}j={title:k,value:h,attribs:g};i.items.push(j);i.onAdd.dispatch(i,j)},getLength:function(){return this.items.length},renderHTML:function(){var i,g=this;i=d.createHTML("option",{value:""},"-- "+g.settings.title+" --");f(g.items,function(h){i+=d.createHTML("option",{value:h.value},h.title)});i=d.createHTML("select",{id:g.id,"class":"mceNativeListBox","aria-labelledby":g.id+"_aria"},i);i+=d.createHTML("span",{id:g.id+"_aria",style:"display: none"},g.settings.title);return i},postRender:function(){var h=this,i,j=true;h.rendered=true;function g(l){var k=h.items[l.target.selectedIndex-1];if(k&&(k=k.value)){h.onChange.dispatch(h,k);if(h.settings.onselect){h.settings.onselect(k)}}}b.add(h.id,"change",g);b.add(h.id,"keydown",function(l){var k;b.remove(h.id,"change",i);j=false;k=b.add(h.id,"blur",function(){if(j){return}j=true;b.add(h.id,"change",g);b.remove(h.id,"blur",k)});if(e.isWebKit&&(l.keyCode==37||l.keyCode==39)){return b.prevent(l)}if(l.keyCode==13||l.keyCode==32){g(l);return b.cancel(l)}});h.onPostRender.dispatch(h,d.get(h.id))}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.MenuButton:tinymce.ui.Button",{MenuButton:function(g,f,e){this.parent(g,f,e);this.onRenderMenu=new c.util.Dispatcher(this);f.menu_container=f.menu_container||b.doc.body},showMenu:function(){var g=this,j,i,h=b.get(g.id),f;if(g.isDisabled()){return}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}if(g.isMenuVisible){return g.hideMenu()}j=b.getPos(g.settings.menu_container);i=b.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.vp_offset_x=i.x;f.settings.vp_offset_y=i.y;f.settings.keyboard_focus=g._focused;f.showMenu(0,h.firstChild.clientHeight);a.add(b.doc,"mousedown",g.hideMenu,g);g.setState("Selected",1);g.isMenuVisible=1},renderMenu:function(){var f=this,e;e=f.settings.control_manager.createDropMenu(f.id+"_menu",{menu_line:1,"class":this.classPrefix+"Menu",icons:f.settings.icons});e.onHideMenu.add(function(){f.hideMenu();f.focus()});f.onRenderMenu.dispatch(f,e);f.menu=e},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&b.getParent(g.target,function(h){return h.id===f.id||h.id===f.id+"_open"})){return}if(!g||!b.getParent(g.target,".mceMenu")){f.setState("Selected",0);a.remove(b.doc,"mousedown",f.hideMenu,f);if(f.menu){f.menu.hideMenu()}}f.isMenuVisible=0},postRender:function(){var e=this,f=e.settings;a.add(e.id,"click",function(){if(!e.isDisabled()){if(f.onclick){f.onclick(e.value)}e.showMenu()}})}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.SplitButton:tinymce.ui.MenuButton",{SplitButton:function(g,f,e){this.parent(g,f,e);this.classPrefix="mceSplitButton"},renderHTML:function(){var i,f=this,g=f.settings,e;i="";if(g.image){e=b.createHTML("img ",{src:g.image,role:"presentation","class":"mceAction "+g["class"]})}else{e=b.createHTML("span",{"class":"mceAction "+g["class"]},"")}e+=b.createHTML("span",{"class":"mceVoiceLabel mceIconOnly",id:f.id+"_voice",style:"display:none;"},g.title);i+=""+b.createHTML("a",{role:"button",id:f.id+"_action",tabindex:"-1",href:"javascript:;","class":"mceAction "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"";e=b.createHTML("span",{"class":"mceOpen "+g["class"]},'');i+=""+b.createHTML("a",{role:"button",id:f.id+"_open",tabindex:"-1",href:"javascript:;","class":"mceOpen "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"";i+="";i=b.createHTML("table",{role:"presentation","class":"mceSplitButton mceSplitButtonEnabled "+g["class"],cellpadding:"0",cellspacing:"0",title:g.title},i);return b.createHTML("div",{id:f.id,role:"button",tabindex:"0","aria-labelledby":f.id+"_voice","aria-haspopup":"true"},i)},postRender:function(){var e=this,g=e.settings,f;if(g.onclick){f=function(h){if(!e.isDisabled()){g.onclick(e.value);a.cancel(h)}};a.add(e.id+"_action","click",f);a.add(e.id,["click","keydown"],function(h){var k=32,m=14,i=13,j=38,l=40;if((h.keyCode===32||h.keyCode===13||h.keyCode===14)&&!h.altKey&&!h.ctrlKey&&!h.metaKey){f();a.cancel(h)}else{if(h.type==="click"||h.keyCode===l){e.showMenu();a.cancel(h)}}})}a.add(e.id+"_open","click",function(h){e.showMenu();a.cancel(h)});a.add([e.id,e.id+"_open"],"focus",function(){e._focused=1});a.add([e.id,e.id+"_open"],"blur",function(){e._focused=0});if(c.isIE6||!b.boxModel){a.add(e.id,"mouseover",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.addClass(e.id,"mceSplitButtonHover")}});a.add(e.id,"mouseout",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.removeClass(e.id,"mceSplitButtonHover")}})}},destroy:function(){this.parent();a.clear(this.id+"_action");a.clear(this.id+"_open");a.clear(this.id)}})})(tinymce);(function(d){var c=d.DOM,a=d.dom.Event,b=d.is,e=d.each;d.create("tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton",{ColorSplitButton:function(i,h,f){var g=this;g.parent(i,h,f);g.settings=h=d.extend({colors:"000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF",grid_width:8,default_color:"#888888"},g.settings);g.onShowMenu=new d.util.Dispatcher(g);g.onHideMenu=new d.util.Dispatcher(g);g.value=h.default_color},showMenu:function(){var f=this,g,j,i,h;if(f.isDisabled()){return}if(!f.isMenuRendered){f.renderMenu();f.isMenuRendered=true}if(f.isMenuVisible){return f.hideMenu()}i=c.get(f.id);c.show(f.id+"_menu");c.addClass(i,"mceSplitButtonSelected");h=c.getPos(i);c.setStyles(f.id+"_menu",{left:h.x,top:h.y+i.firstChild.clientHeight,zIndex:200000});i=0;a.add(c.doc,"mousedown",f.hideMenu,f);f.onShowMenu.dispatch(f);if(f._focused){f._keyHandler=a.add(f.id+"_menu","keydown",function(k){if(k.keyCode==27){f.hideMenu()}});c.select("a",f.id+"_menu")[0].focus()}f.isMenuVisible=1},hideMenu:function(g){var f=this;if(f.isMenuVisible){if(g&&g.type=="mousedown"&&c.getParent(g.target,function(h){return h.id===f.id+"_open"})){return}if(!g||!c.getParent(g.target,".mceSplitButtonMenu")){c.removeClass(f.id,"mceSplitButtonSelected");a.remove(c.doc,"mousedown",f.hideMenu,f);a.remove(f.id+"_menu","keydown",f._keyHandler);c.hide(f.id+"_menu")}f.isMenuVisible=0;f.onHideMenu.dispatch()}},renderMenu:function(){var p=this,h,k=0,q=p.settings,g,j,l,o,f;o=c.add(q.menu_container,"div",{role:"listbox",id:p.id+"_menu","class":q.menu_class+" "+q["class"],style:"position:absolute;left:0;top:-1000px;"});h=c.add(o,"div",{"class":q["class"]+" mceSplitButtonMenu"});c.add(h,"span",{"class":"mceMenuLine"});g=c.add(h,"table",{role:"presentation","class":"mceColorSplitMenu"});j=c.add(g,"tbody");k=0;e(b(q.colors,"array")?q.colors:q.colors.split(","),function(m){m=m.replace(/^#/,"");if(!k--){l=c.add(j,"tr");k=q.grid_width-1}g=c.add(l,"td");var i={href:"javascript:;",style:{backgroundColor:"#"+m},title:p.editor.getLang("colors."+m,m),"data-mce-color":"#"+m};if(!d.isIE){i.role="option"}g=c.add(g,"a",i);if(p.editor.forcedHighContrastMode){g=c.add(g,"canvas",{width:16,height:16,"aria-hidden":"true"});if(g.getContext&&(f=g.getContext("2d"))){f.fillStyle="#"+m;f.fillRect(0,0,16,16)}else{c.remove(g)}}});if(q.more_colors_func){g=c.add(j,"tr");g=c.add(g,"td",{colspan:q.grid_width,"class":"mceMoreColors"});g=c.add(g,"a",{role:"option",id:p.id+"_more",href:"javascript:;",onclick:"return false;","class":"mceMoreColors"},q.more_colors_title);a.add(g,"click",function(i){q.more_colors_func.call(q.more_colors_scope||this);return a.cancel(i)})}c.addClass(h,"mceColorSplitMenu");new d.ui.KeyboardNavigation({root:p.id+"_menu",items:c.select("a",p.id+"_menu"),onCancel:function(){p.hideMenu();p.focus()}});a.add(p.id+"_menu","mousedown",function(i){return a.cancel(i)});a.add(p.id+"_menu","click",function(i){var m;i=c.getParent(i.target,"a",j);if(i&&i.nodeName.toLowerCase()=="a"&&(m=i.getAttribute("data-mce-color"))){p.setColor(m)}return false});return o},setColor:function(f){this.displayColor(f);this.hideMenu();this.settings.onselect(f)},displayColor:function(g){var f=this;c.setStyle(f.id+"_preview","backgroundColor",g);f.value=g},postRender:function(){var f=this,g=f.id;f.parent();c.add(g+"_action","div",{id:g+"_preview","class":"mceColorPreview"});c.setStyle(f.id+"_preview","backgroundColor",f.value)},destroy:function(){this.parent();a.clear(this.id+"_menu");a.clear(this.id+"_more");c.remove(this.id+"_menu")}})})(tinymce);(function(b){var d=b.DOM,c=b.each,a=b.dom.Event;b.create("tinymce.ui.ToolbarGroup:tinymce.ui.Container",{renderHTML:function(){var f=this,i=[],e=f.controls,j=b.each,g=f.settings;i.push('
                    ');i.push("");i.push('");j(e,function(h){i.push(h.renderHTML())});i.push("");i.push("
                    ");return i.join("")},focus:function(){var e=this;d.get(e.id).focus()},postRender:function(){var f=this,e=[];c(f.controls,function(g){c(g.controls,function(h){if(h.id){e.push(h)}})});f.keyNav=new b.ui.KeyboardNavigation({root:f.id,items:e,onCancel:function(){if(b.isWebKit){d.get(f.editor.id+"_ifr").focus()}f.editor.focus()},excludeFromTabOrder:!f.settings.tab_focus_toolbar})},destroy:function(){var e=this;e.parent();e.keyNav.destroy();a.clear(e.id)}})})(tinymce);(function(a){var c=a.DOM,b=a.each;a.create("tinymce.ui.Toolbar:tinymce.ui.Container",{renderHTML:function(){var m=this,f="",j,k,n=m.settings,e,d,g,l;l=m.controls;for(e=0;e"))}if(d&&k.ListBox){if(d.Button||d.SplitButton){f+=c.createHTML("td",{"class":"mceToolbarEnd"},c.createHTML("span",null,""))}}if(c.stdMode){f+=''+k.renderHTML()+""}else{f+=""+k.renderHTML()+""}if(g&&k.ListBox){if(g.Button||g.SplitButton){f+=c.createHTML("td",{"class":"mceToolbarStart"},c.createHTML("span",null,""))}}}j="mceToolbarEnd";if(k.Button){j+=" mceToolbarEndButton"}else{if(k.SplitButton){j+=" mceToolbarEndSplitButton"}else{if(k.ListBox){j+=" mceToolbarEndListBox"}}}f+=c.createHTML("td",{"class":j},c.createHTML("span",null,""));return c.createHTML("table",{id:m.id,"class":"mceToolbar"+(n["class"]?" "+n["class"]:""),cellpadding:"0",cellspacing:"0",align:m.settings.align||"",role:"presentation",tabindex:"-1"},""+f+"")}})})(tinymce);(function(b){var a=b.util.Dispatcher,c=b.each;b.create("tinymce.AddOnManager",{AddOnManager:function(){var d=this;d.items=[];d.urls={};d.lookup={};d.onAdd=new a(d)},get:function(d){if(this.lookup[d]){return this.lookup[d].instance}else{return undefined}},dependencies:function(e){var d;if(this.lookup[e]){d=this.lookup[e].dependencies}return d||[]},requireLangPack:function(e){return;var d=b.settings;if(d&&d.language&&d.language_load!==false){b.ScriptLoader.add(this.urls[e]+"/langs/"+d.language+".js")}},add:function(f,e,d){this.items.push(e);this.lookup[f]={instance:e,dependencies:d};this.onAdd.dispatch(this,f,e);return e},createUrl:function(d,e){if(typeof e==="object"){return e}else{return{prefix:d.prefix,resource:e,suffix:d.suffix}}},addComponents:function(f,d){var e=this.urls[f];b.each(d,function(g){b.ScriptLoader.add(e+"/"+g)})},load:function(j,f,d,h){var g=this,e=f;function i(){var k=g.dependencies(j);b.each(k,function(m){var l=g.createUrl(f,m);g.load(l.resource,l,undefined,undefined)});if(d){if(h){d.call(h)}else{d.call(b.ScriptLoader)}}}if(g.urls[j]){return}if(typeof f==="object"){e=f.prefix+f.resource+f.suffix}if(e.indexOf("/")!==0&&e.indexOf("://")==-1){e=b.baseURL+"/"+e}g.urls[j]=e.substring(0,e.lastIndexOf("/"));if(g.lookup[j]){i()}else{b.ScriptLoader.add(e,i,h)}}});b.PluginManager=new b.AddOnManager();b.ThemeManager=new b.AddOnManager()}(tinymce));(function(j){var g=j.each,d=j.extend,k=j.DOM,i=j.dom.Event,f=j.ThemeManager,b=j.PluginManager,e=j.explode,h=j.util.Dispatcher,a,c=0;j.documentBaseURL=window.location.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,"");if(!/[\/\\]$/.test(j.documentBaseURL)){j.documentBaseURL+="/"}j.baseURL=new j.util.URI(j.documentBaseURL).toAbsolute(j.baseURL);j.baseURI=new j.util.URI(j.baseURL);j.onBeforeUnload=new h(j);i.add(window,"beforeunload",function(l){j.onBeforeUnload.dispatch(j,l)});j.onAddEditor=new h(j);j.onRemoveEditor=new h(j);j.EditorManager=d(j,{editors:[],i18n:{},activeEditor:null,init:function(x){var v=this,o,n=j.ScriptLoader,u,l=[],r;function q(t){var s=t.id;if(!s){s=t.name;if(s&&!k.get(s)){s=t.name}else{s=k.uniqueId()}t.setAttribute("id",s)}return s}function m(z,A,t){var y=z[A];if(!y){return}if(j.is(y,"string")){t=y.replace(/\.\w+$/,"");t=t?j.resolve(t):0;y=j.resolve(y)}return y.apply(t||this,Array.prototype.slice.call(arguments,2))}function p(t,s){return s.constructor===RegExp?s.test(t.className):k.hasClass(t,s)}x=d({theme:"simple",language:"en"},x);v.settings=x;i.bind(window,"ready",function(){var s,t;m(x,"onpageload");switch(x.mode){case"exact":s=x.elements||"";if(s.length>0){g(e(s),function(y){if(k.get(y)){r=new j.Editor(y,x);l.push(r);r.render(1)}else{g(document.forms,function(z){g(z.elements,function(A){if(A.name===y){y="mce_editor_"+c++;k.setAttrib(A,"id",y);r=new j.Editor(y,x);l.push(r);r.render(1)}})})}})}break;case"textareas":case"specific_textareas":g(k.select("textarea"),function(y){if(x.editor_deselector&&p(y,x.editor_deselector)){return}if(!x.editor_selector||p(y,x.editor_selector)){r=new j.Editor(q(y),x);l.push(r);r.render(1)}});break;default:if(x.types){g(x.types,function(y){g(k.select(y.selector),function(A){var z=new j.Editor(q(A),j.extend({},x,y));l.push(z);z.render(1)})})}else{if(x.selector){g(k.select(x.selector),function(z){var y=new j.Editor(q(z),x);l.push(y);y.render(1)})}}}if(x.oninit){s=t=0;g(l,function(y){t++;if(!y.initialized){y.onInit.add(function(){s++;if(s==t){m(x,"oninit")}})}else{s++}if(s==t){m(x,"oninit")}})}})},get:function(l){if(l===a){return this.editors}return this.editors[l]},getInstanceById:function(l){return this.get(l)},add:function(m){var l=this,n=l.editors;n[m.id]=m;n.push(m);l._setActive(m);l.onAddEditor.dispatch(l,m);if(j.adapter){j.adapter.patchEditor(m)}return m},remove:function(n){var m=this,l,o=m.editors;if(!o[n.id]){return null}delete o[n.id];for(l=0;l':"",visual:n,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",apply_source_formatting:n,directionality:"ltr",forced_root_block:"p",hidden_input:n,padd_empty_editor:n,render_ui:n,indentation:"30px",fix_table_elements:n,inline_styles:n,convert_fonts_to_spans:n,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist",validate:n,entity_encoding:"named",url_converter:m.convertURL,url_converter_scope:m,ie7_compat:n},o);m.id=m.editorId=p;m.isNotDirty=false;m.plugins={};m.documentBaseURI=new k.util.URI(o.document_base_url||k.documentBaseURL,{base_uri:tinyMCE.baseURI});m.baseURI=k.baseURI;m.contentCSS=[];m.setupEvents();m.execCommands={};m.queryStateCommands={};m.queryValueCommands={};m.execCallback("setup",m)},render:function(o){var p=this,q=p.settings,r=p.id,m=k.ScriptLoader;if(!j.domLoaded){j.add(window,"ready",function(){p.render()});return}tinyMCE.settings=q;if(!p.getElement()){return}if(k.isIDevice&&!k.isIOS5){return}if(!/TEXTAREA|INPUT/i.test(p.getElement().nodeName)&&q.hidden_input&&l.getParent(r,"form")){l.insertAfter(l.create("input",{type:"hidden",name:r}),r)}p.orgVisibility=p.getElement().style.visibility;p.getElement().style.visibility="hidden";if(k.WindowManager){p.windowManager=new k.WindowManager(p)}if(q.encoding=="xml"){p.onGetContent.add(function(s,t){if(t.save){t.content=l.encode(t.content)}})}if(q.add_form_submit_trigger){p.onSubmit.addToTop(function(){if(p.initialized){p.save();p.isNotDirty=1}})}if(q.add_unload_trigger){p._beforeUnload=tinyMCE.onBeforeUnload.add(function(){if(p.initialized&&!p.destroyed&&!p.isHidden()){p.save({format:"raw",no_events:true})}})}k.addUnload(p.destroy,p);if(q.submit_patch){p.onBeforeRenderUI.add(function(){var s=p.getElement().form;if(!s){return}if(s._mceOldSubmit){return}if(!s.submit.nodeType&&!s.submit.length){p.formElement=s;s._mceOldSubmit=s.submit;s.submit=function(){k.triggerSave();p.isNotDirty=1;return p.formElement._mceOldSubmit(p.formElement)}}s=null})}function n(){if(q.language&&q.language_load!==false){m.add(k.baseURL+"/../../extra/strings.php?elanguage="+q.language+"ðeme="+q.theme)}if(q.theme&&typeof q.theme!="function"&&q.theme.charAt(0)!="-"&&!h.urls[q.theme]){h.load(q.theme,"themes/"+q.theme+"/editor_template"+k.suffix+".js")}i(g(q.plugins),function(t){if(t&&!c.urls[t]){if(t.charAt(0)=="-"){t=t.substr(1,t.length);var s=c.dependencies(t);i(s,function(v){var u={prefix:"plugins/",resource:v,suffix:"/editor_plugin"+k.suffix+".js"};v=c.createUrl(u,v);c.load(v.resource,v)})}else{if(t=="safari"){return}c.load(t,{prefix:"plugins/",resource:t,suffix:"/editor_plugin"+k.suffix+".js"})}}});m.loadQueue(function(){if(!p.removed){p.init()}})}n()},init:function(){var q,F=this,G=F.settings,C,y,B=F.getElement(),p,m,D,v,A,E,x,r=[];k.add(F);G.aria_label=G.aria_label||l.getAttrib(B,"aria-label",F.getLang("aria.rich_text_area"));if(G.theme){if(typeof G.theme!="function"){G.theme=G.theme.replace(/-/,"");p=h.get(G.theme);F.theme=new p();if(F.theme.init){F.theme.init(F,h.urls[G.theme]||k.documentBaseURL.replace(/\/$/,""))}}else{F.theme=G.theme}}function z(s){var t=c.get(s),o=c.urls[s]||k.documentBaseURL.replace(/\/$/,""),n;if(t&&k.inArray(r,s)===-1){i(c.dependencies(s),function(u){z(u)});n=new t(F,o);F.plugins[s]=n;if(n.init){n.init(F,o);r.push(s)}}}i(g(G.plugins.replace(/\-/g,"")),z);if(G.popup_css!==false){if(G.popup_css){G.popup_css=F.documentBaseURI.toAbsolute(G.popup_css)}else{G.popup_css=F.baseURI.toAbsolute("themes/"+G.theme+"/skins/"+G.skin+"/dialog.css")}}if(G.popup_css_add){G.popup_css+=","+F.documentBaseURI.toAbsolute(G.popup_css_add)}F.controlManager=new k.ControlManager(F);F.onExecCommand.add(function(n,o){if(!/^(FontName|FontSize)$/.test(o)){F.nodeChanged()}});F.onBeforeRenderUI.dispatch(F,F.controlManager);if(G.render_ui&&F.theme){F.orgDisplay=B.style.display;if(typeof G.theme!="function"){C=G.width||B.style.width||B.offsetWidth;y=G.height||B.style.height||B.offsetHeight;E=/^[0-9\.]+(|px)$/i;if(E.test(""+C)){C=Math.max(parseInt(C,10)+(p.deltaWidth||0),100)}if(E.test(""+y)){y=Math.max(parseInt(y)+(p.deltaHeight||0),G.theme_advanced_resizing_min_height||100)}p=F.theme.renderUI({targetNode:B,width:C,height:y,deltaWidth:G.delta_width,deltaHeight:G.delta_height});l.setStyles(p.sizeContainer||p.editorContainer,{width:C,height:y});y=(p.iframeHeight||y)+(typeof(y)=="number"?(p.deltaHeight||0):"");if(y<(G.theme_advanced_resizing_min_height||100)){y=G.theme_advanced_resizing_min_height||100}}else{p=G.theme(F,B);if(p.editorContainer.nodeType){p.editorContainer=p.editorContainer.id=p.editorContainer.id||F.id+"_parent"}if(p.iframeContainer.nodeType){p.iframeContainer=p.iframeContainer.id=p.iframeContainer.id||F.id+"_iframecontainer"}y=p.iframeHeight||B.offsetHeight}F.editorContainer=p.editorContainer}if(G.content_css){i(g(G.content_css),function(n){F.contentCSS.push(F.documentBaseURI.toAbsolute(n))})}if(G.content_editable){B=q=p=null;return F.initContentBody()}if(document.domain&&location.hostname!=document.domain){k.relaxedDomain=document.domain}F.iframeHTML=G.doctype+'';if(G.document_base_url!=k.documentBaseURL){F.iframeHTML+=''}if(G.ie7_compat){F.iframeHTML+=''}else{F.iframeHTML+=''}F.iframeHTML+='';for(x=0;x'}F.contentCSS=[];v=G.body_id||"tinymce";if(v.indexOf("=")!=-1){v=F.getParam("body_id","","hash");v=v[F.id]||v}A=G.body_class||"";if(A.indexOf("=")!=-1){A=F.getParam("body_class","","hash");A=A[F.id]||""}F.iframeHTML+='
                    ";if(k.relaxedDomain&&(b||(k.isOpera&&parseFloat(opera.version())<11))){D='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinyMCE.get("'+F.id+'");document.write(ed.iframeHTML);document.close();ed.initContentBody();})()'}q=l.add(p.iframeContainer,"iframe",{id:F.id+"_ifr",src:D||'javascript:""',frameBorder:"0",allowTransparency:"true",title:G.aria_label,style:{width:"100%",height:y,display:"block"}});F.contentAreaContainer=p.iframeContainer;if(p.editorContainer){l.get(p.editorContainer).style.display=F.orgDisplay}B.style.visibility=F.orgVisibility;l.get(F.id).style.display="none";l.setAttrib(F.id,"aria-hidden",true);if(!k.relaxedDomain||!D){F.initContentBody()}B=q=p=null},initContentBody:function(){var n=this,p=n.settings,q=l.get(n.id),r=n.getDoc(),o,m;if((!b||!k.relaxedDomain)&&!p.content_editable){r.open();r.write(n.iframeHTML);r.close();if(k.relaxedDomain){r.domain=k.relaxedDomain}}if(p.content_editable){l.addClass(q,"mceContentBody");n.contentDocument=r=p.content_document||document;n.contentWindow=p.content_window||window;n.bodyElement=q;p.content_document=p.content_window=null}m=n.getBody();m.disabled=true;if(!p.readonly){m.contentEditable=n.getParam("content_editable_state",true)}m.disabled=false;n.schema=new k.html.Schema(p);n.dom=new k.dom.DOMUtils(r,{keep_values:true,url_converter:n.convertURL,url_converter_scope:n,hex_colors:p.force_hex_style_colors,class_filter:p.class_filter,update_styles:true,root_element:p.content_editable?n.id:null,schema:n.schema});n.parser=new k.html.DomParser(p,n.schema);n.parser.addAttributeFilter("src,href,style",function(s,t){var u=s.length,x,z=n.dom,y,v;while(u--){x=s[u];y=x.attr(t);v="data-mce-"+t;if(!x.attributes.map[v]){if(t==="style"){x.attr(v,z.serializeStyle(z.parseStyle(y),x.name))}else{x.attr(v,n.convertURL(y,t,x.name))}}}});n.parser.addNodeFilter("script",function(s,t){var u=s.length,v;while(u--){v=s[u];v.attr("type","mce-"+(v.attr("type")||"text/javascript"))}});n.parser.addNodeFilter("#cdata",function(s,t){var u=s.length,v;while(u--){v=s[u];v.type=8;v.name="#comment";v.value="[CDATA["+v.value+"]]"}});n.parser.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(t,u){var v=t.length,x,s=n.schema.getNonEmptyElements();while(v--){x=t[v];if(x.isEmpty(s)){x.empty().append(new k.html.Node("br",1)).shortEnded=true}}});n.serializer=new k.dom.Serializer(p,n.dom,n.schema);n.selection=new k.dom.Selection(n.dom,n.getWin(),n.serializer);n.formatter=new k.Formatter(n);n.undoManager=new k.UndoManager(n);n.forceBlocks=new k.ForceBlocks(n);n.enterKey=new k.EnterKey(n);n.editorCommands=new k.EditorCommands(n);n.serializer.onPreProcess.add(function(s,t){return n.onPreProcess.dispatch(n,t,s)});n.serializer.onPostProcess.add(function(s,t){return n.onPostProcess.dispatch(n,t,s)});n.onPreInit.dispatch(n);if(!p.gecko_spellcheck){r.body.spellcheck=false}if(!p.readonly){n.bindNativeEvents()}n.controlManager.onPostRender.dispatch(n,n.controlManager);n.onPostRender.dispatch(n);n.quirks=k.util.Quirks(n);if(p.directionality){m.dir=p.directionality}if(p.nowrap){m.style.whiteSpace="nowrap"}if(p.protect){n.onBeforeSetContent.add(function(s,t){i(p.protect,function(u){t.content=t.content.replace(u,function(v){return""})})})}n.onSetContent.add(function(){n.addVisual(n.getBody())});if(p.padd_empty_editor){n.onPostProcess.add(function(s,t){t.content=t.content.replace(/^(]*>( | |\s|\u00a0|)<\/p>[\r\n]*|
                    [\r\n]*)$/,"")})}n.load({initial:true,format:"html"});n.startContent=n.getContent({format:"raw"});n.initialized=true;n.onInit.dispatch(n);n.execCallback("setupcontent_callback",n.id,m,r);n.execCallback("init_instance_callback",n);n.focus(true);n.nodeChanged({initial:true});i(n.contentCSS,function(s){n.dom.loadCSS(s)});if(p.auto_focus){setTimeout(function(){var s=k.get(p.auto_focus);s.selection.select(s.getBody(),1);s.selection.collapse(1);s.getBody().focus();s.getWin().focus()},100)}q=r=m=null},focus:function(p){var o,u=this,t=u.selection,q=u.settings.content_editable,n,r,s=u.getDoc(),m;if(!p){n=t.getRng();if(n.item){r=n.item(0)}u._refreshContentEditable();if(!q){u.getWin().focus()}if(k.isGecko||q){m=u.getBody();if(m.setActive){m.setActive()}else{m.focus()}if(q){t.normalize()}}if(r&&r.ownerDocument==s){n=s.body.createControlRange();n.addElement(r);n.select()}}if(k.activeEditor!=u){if((o=k.activeEditor)!=null){o.onDeactivate.dispatch(o,u)}u.onActivate.dispatch(u,o)}k._setActive(u)},execCallback:function(q){var m=this,p=m.settings[q],o;if(!p){return}if(m.callbackLookup&&(o=m.callbackLookup[q])){p=o.func;o=o.scope}if(d(p,"string")){o=p.replace(/\.\w+$/,"");o=o?k.resolve(o):0;p=k.resolve(p);m.callbackLookup=m.callbackLookup||{};m.callbackLookup[q]={func:p,scope:o}}return p.apply(o||m,Array.prototype.slice.call(arguments,1))},translate:function(m){var o=this.settings.language||"en",n=k.i18n;if(!m){return""}return n[o+"."+m]||m.replace(/\{\#([^\}]+)\}/g,function(q,p){return n[o+"."+p]||"{#"+p+"}"})},getLang:function(o,m){return k.i18n[(this.settings.language||"en")+"."+o]||(d(m)?m:"{#"+o+"}")},getParam:function(t,q,m){var r=k.trim,p=d(this.settings[t])?this.settings[t]:q,s;if(m==="hash"){s={};if(d(p,"string")){i(p.indexOf("=")>0?p.split(/[;,](?![^=;,]*(?:[;,]|$))/):p.split(","),function(n){n=n.split("=");if(n.length>1){s[r(n[0])]=r(n[1])}else{s[r(n[0])]=r(n)}})}else{s=p}return s}return p},nodeChanged:function(q){var m=this,n=m.selection,p;if(m.initialized){q=q||{};p=n.getStart()||m.getBody();p=b&&p.ownerDocument!=m.getDoc()?m.getBody():p;q.parents=[];m.dom.getParent(p,function(o){if(o.nodeName=="BODY"){return true}q.parents.push(o)});m.onNodeChange.dispatch(m,q?q.controlManager||m.controlManager:m.controlManager,p,n.isCollapsed(),q)}},addButton:function(n,o){var m=this;m.buttons=m.buttons||{};m.buttons[n]=o},addCommand:function(m,o,n){this.execCommands[m]={func:o,scope:n||this}},addQueryStateHandler:function(m,o,n){this.queryStateCommands[m]={func:o,scope:n||this}},addQueryValueHandler:function(m,o,n){this.queryValueCommands[m]={func:o,scope:n||this}},addShortcut:function(o,q,m,p){var n=this,r;if(n.settings.custom_shortcuts===false){return false}n.shortcuts=n.shortcuts||{};if(d(m,"string")){r=m;m=function(){n.execCommand(r,false,null)}}if(d(m,"object")){r=m;m=function(){n.execCommand(r[0],r[1],r[2])}}i(g(o),function(s){var t={func:m,scope:p||this,desc:n.translate(q),alt:false,ctrl:false,shift:false};i(g(s,"+"),function(u){switch(u){case"alt":case"ctrl":case"shift":t[u]=true;break;default:t.charCode=u.charCodeAt(0);t.keyCode=u.toUpperCase().charCodeAt(0)}});n.shortcuts[(t.ctrl?"ctrl":"")+","+(t.alt?"alt":"")+","+(t.shift?"shift":"")+","+t.keyCode]=t});return true},execCommand:function(u,r,x,m){var p=this,q=0,v,n;if(!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(u)&&(!m||!m.skip_focus)){p.focus()}m=f({},m);p.onBeforeExecCommand.dispatch(p,u,r,x,m);if(m.terminate){return false}if(p.execCallback("execcommand_callback",p.id,p.selection.getNode(),u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);return true}if(v=p.execCommands[u]){n=v.func.call(v.scope,r,x);if(n!==true){p.onExecCommand.dispatch(p,u,r,x,m);return n}}i(p.plugins,function(o){if(o.execCommand&&o.execCommand(u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);q=1;return false}});if(q){return true}if(p.theme&&p.theme.execCommand&&p.theme.execCommand(u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);return true}if(p.editorCommands.execCommand(u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);return true}p.getDoc().execCommand(u,r,x);p.onExecCommand.dispatch(p,u,r,x,m)},queryCommandState:function(q){var n=this,r,p;if(n._isHidden()){return}if(r=n.queryStateCommands[q]){p=r.func.call(r.scope);if(p!==true){return p}}r=n.editorCommands.queryCommandState(q);if(r!==-1){return r}try{return this.getDoc().queryCommandState(q)}catch(m){}},queryCommandValue:function(r){var n=this,q,p;if(n._isHidden()){return}if(q=n.queryValueCommands[r]){p=q.func.call(q.scope);if(p!==true){return p}}q=n.editorCommands.queryCommandValue(r);if(d(q)){return q}try{return this.getDoc().queryCommandValue(r)}catch(m){}},show:function(){var m=this;l.show(m.getContainer());l.hide(m.id);m.load()},hide:function(){var m=this,n=m.getDoc();if(b&&n){n.execCommand("SelectAll")}m.save();l.hide(m.getContainer());l.setStyle(m.id,"display",m.orgDisplay)},isHidden:function(){return !l.isHidden(this.id)},setProgressState:function(m,n,p){this.onSetProgressState.dispatch(this,m,n,p);return m},load:function(q){var m=this,p=m.getElement(),n;if(p){q=q||{};q.load=true;n=m.setContent(d(p.value)?p.value:p.innerHTML,q);q.element=p;if(!q.no_events){m.onLoadContent.dispatch(m,q)}q.element=p=null;return n}},save:function(r){var m=this,q=m.getElement(),n,p;if(!q||!m.initialized){return}r=r||{};r.save=true;r.element=q;n=r.content=m.getContent(r);if(!r.no_events){m.onSaveContent.dispatch(m,r)}n=r.content;if(!/TEXTAREA|INPUT/i.test(q.nodeName)){q.innerHTML=n;if(p=l.getParent(m.id,"form")){i(p.elements,function(o){if(o.name==m.id){o.value=n;return false}})}}else{q.value=n}r.element=q=null;return n},setContent:function(r,p){var o=this,n,m=o.getBody(),q;p=p||{};p.format=p.format||"html";p.set=true;p.content=r;if(!p.no_events){o.onBeforeSetContent.dispatch(o,p)}r=p.content;if(!k.isIE&&(r.length===0||/^\s+$/.test(r))){q=o.settings.forced_root_block;if(q){r="<"+q+'>
                    "}else{r='
                    '}m.innerHTML=r;o.selection.select(m,true);o.selection.collapse(true);return}if(p.format!=="raw"){r=new k.html.Serializer({},o.schema).serialize(o.parser.parse(r))}p.content=k.trim(r);o.dom.setHTML(m,p.content);if(!p.no_events){o.onSetContent.dispatch(o,p)}o.selection.normalize();return p.content},getContent:function(n){var m=this,o;n=n||{};n.format=n.format||"html";n.get=true;n.getInner=true;if(!n.no_events){m.onBeforeGetContent.dispatch(m,n)}if(n.format=="raw"){o=m.getBody().innerHTML}else{o=m.serializer.serialize(m.getBody(),n)}n.content=k.trim(o);if(!n.no_events){m.onGetContent.dispatch(m,n)}return n.content},isDirty:function(){var m=this;return k.trim(m.startContent)!=k.trim(m.getContent({format:"raw",no_events:1}))&&!m.isNotDirty},getContainer:function(){var m=this;if(!m.container){m.container=l.get(m.editorContainer||m.id+"_parent")}return m.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return l.get(this.settings.content_element||this.id)},getWin:function(){var m=this,n;if(!m.contentWindow){n=l.get(m.id+"_ifr");if(n){m.contentWindow=n.contentWindow}}return m.contentWindow},getDoc:function(){var m=this,n;if(!m.contentDocument){n=m.getWin();if(n){m.contentDocument=n.document}}return m.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(o,n,q){var m=this,p=m.settings;if(p.urlconverter_callback){return m.execCallback("urlconverter_callback",o,q,true,n)}if(!p.convert_urls||(q&&q.nodeName=="LINK")||o.indexOf("file:")===0){return o}if(p.relative_urls){return m.documentBaseURI.toRelative(o)}o=m.documentBaseURI.toAbsolute(o,p.remove_script_host);return o},addVisual:function(q){var n=this,o=n.settings,p=n.dom,m;q=q||n.getBody();if(!d(n.hasVisual)){n.hasVisual=o.visual}i(p.select("table,a",q),function(s){var r;switch(s.nodeName){case"TABLE":m=o.visual_table_class||"mceItemTable";r=p.getAttrib(s,"border");if(!r||r=="0"){if(n.hasVisual){p.addClass(s,m)}else{p.removeClass(s,m)}}return;case"A":if(!s.href){r=p.getAttrib(s,"name")||s.id;m="mceItemAnchor";if(r){if(n.hasVisual){p.addClass(s,m)}else{p.removeClass(s,m)}}}return}});n.onVisualAid.dispatch(n,q,n.hasVisual)},remove:function(){var m=this,n=m.getContainer();if(!m.removed){m.removed=1;m.hide();if(!m.settings.content_editable){j.clear(m.getWin());j.clear(m.getDoc())}j.clear(m.getBody());j.clear(m.formElement);j.unbind(n);m.execCallback("remove_instance_callback",m);m.onRemove.dispatch(m);m.onExecCommand.listeners=[];k.remove(m);l.remove(n)}},destroy:function(n){var m=this;if(m.destroyed){return}if(a){j.unbind(m.getDoc());j.unbind(m.getWin());j.unbind(m.getBody())}if(!n){k.removeUnload(m.destroy);tinyMCE.onBeforeUnload.remove(m._beforeUnload);if(m.theme&&m.theme.destroy){m.theme.destroy()}m.controlManager.destroy();m.selection.destroy();m.dom.destroy()}if(m.formElement){m.formElement.submit=m.formElement._mceOldSubmit;m.formElement._mceOldSubmit=null}m.contentAreaContainer=m.formElement=m.container=m.settings.content_element=m.bodyElement=m.contentDocument=m.contentWindow=null;if(m.selection){m.selection=m.selection.win=m.selection.dom=m.selection.dom.doc=null}m.destroyed=1},_refreshContentEditable:function(){var n=this,m,o;if(n._isHidden()){m=n.getBody();o=m.parentNode;o.removeChild(m);o.appendChild(m);m.focus()}},_isHidden:function(){var m;if(!a){return 0}m=this.selection.getSel();return(!m||!m.rangeCount||m.rangeCount===0)}})})(tinymce);(function(a){var b=a.each;a.Editor.prototype.setupEvents=function(){var c=this,d=c.settings;b(["onPreInit","onBeforeRenderUI","onPostRender","onLoad","onInit","onRemove","onActivate","onDeactivate","onClick","onEvent","onMouseUp","onMouseDown","onDblClick","onKeyDown","onKeyUp","onKeyPress","onContextMenu","onSubmit","onReset","onPaste","onPreProcess","onPostProcess","onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent","onLoadContent","onSaveContent","onNodeChange","onChange","onBeforeExecCommand","onExecCommand","onUndo","onRedo","onVisualAid","onSetProgressState","onSetAttrib"],function(e){c[e]=new a.util.Dispatcher(c)});if(d.cleanup_callback){c.onBeforeSetContent.add(function(e,f){f.content=e.execCallback("cleanup_callback","insert_to_editor",f.content,f)});c.onPreProcess.add(function(e,f){if(f.set){e.execCallback("cleanup_callback","insert_to_editor_dom",f.node,f)}if(f.get){e.execCallback("cleanup_callback","get_from_editor_dom",f.node,f)}});c.onPostProcess.add(function(e,f){if(f.set){f.content=e.execCallback("cleanup_callback","insert_to_editor",f.content,f)}if(f.get){f.content=e.execCallback("cleanup_callback","get_from_editor",f.content,f)}})}if(d.save_callback){c.onGetContent.add(function(e,f){if(f.save){f.content=e.execCallback("save_callback",e.id,f.content,e.getBody())}})}if(d.handle_event_callback){c.onEvent.add(function(f,g,h){if(c.execCallback("handle_event_callback",g,f,h)===false){Event.cancel(g)}})}if(d.handle_node_change_callback){c.onNodeChange.add(function(f,e,g){f.execCallback("handle_node_change_callback",f.id,g,-1,-1,true,f.selection.isCollapsed())})}if(d.save_callback){c.onSaveContent.add(function(e,g){var f=e.execCallback("save_callback",e.id,g.content,e.getBody());if(f){g.content=f}})}if(d.onchange_callback){c.onChange.add(function(f,e){f.execCallback("onchange_callback",f,e)})}};a.Editor.prototype.bindNativeEvents=function(){var l=this,f,d=l.settings,e=l.dom,h;h={mouseup:"onMouseUp",mousedown:"onMouseDown",click:"onClick",keyup:"onKeyUp",keydown:"onKeyDown",keypress:"onKeyPress",submit:"onSubmit",reset:"onReset",contextmenu:"onContextMenu",dblclick:"onDblClick",paste:"onPaste"};function c(i,m){var n=i.type;if(l.removed){return}if(l.onEvent.dispatch(l,i,m)!==false){l[h[i.fakeType||i.type]].dispatch(l,i,m)}}function j(i){l.focus(true)}function k(){l.selection.normalize();l.nodeChanged()}b(h,function(m,n){var i=d.content_editable?l.getBody():l.getDoc();switch(n){case"contextmenu":e.bind(i,n,c);break;case"paste":e.bind(l.getBody(),n,c);break;case"submit":case"reset":e.bind(l.getElement().form||a.DOM.getParent(l.id,"form"),n,c);break;default:e.bind(i,n,c)}});e.bind(d.content_editable?l.getBody():(a.isGecko?l.getDoc():l.getWin()),"focus",function(i){l.focus(true)});if(d.content_editable&&a.isOpera){e.bind(l.getBody(),"click",j);e.bind(l.getBody(),"keydown",j)}l.onMouseUp.add(k);l.onKeyUp.add(function(i,n){var m=n.keyCode;if((m>=33&&m<=36)||(m>=37&&m<=40)||m==13||m==45||m==46||m==8||(a.isMac&&(m==91||m==93))||n.ctrlKey){k()}});l.onReset.add(function(){l.setContent(l.startContent,{format:"raw"})});function g(m,i){if(m.altKey||m.ctrlKey||m.metaKey){b(l.shortcuts,function(n){var o=a.isMac?m.metaKey:m.ctrlKey;if(n.ctrl!=o||n.alt!=m.altKey||n.shift!=m.shiftKey){return}if(m.keyCode==n.keyCode||(m.charCode&&m.charCode==n.charCode)){m.preventDefault();if(i){n.func.call(n.scope)}return true}})}}l.onKeyUp.add(function(i,m){g(m)});l.onKeyPress.add(function(i,m){g(m)});l.onKeyDown.add(function(i,m){g(m,true)});if(a.isOpera){l.onClick.add(function(i,m){m.preventDefault()})}}})(tinymce);(function(d){var e=d.each,b,a=true,c=false;d.EditorCommands=function(n){var m=n.dom,p=n.selection,j={state:{},exec:{},value:{}},k=n.settings,q=n.formatter,o;function r(z,y,x){var v;z=z.toLowerCase();if(v=j.exec[z]){v(z,y,x);return a}return c}function l(x){var v;x=x.toLowerCase();if(v=j.state[x]){return v(x)}return -1}function h(x){var v;x=x.toLowerCase();if(v=j.value[x]){return v(x)}return c}function u(v,x){x=x||"exec";e(v,function(z,y){e(y.toLowerCase().split(","),function(A){j[x][A]=z})})}d.extend(this,{execCommand:r,queryCommandState:l,queryCommandValue:h,addCommands:u});function f(y,x,v){if(x===b){x=c}if(v===b){v=null}return n.getDoc().execCommand(y,x,v)}function t(v){return q.match(v)}function s(v,x){q.toggle(v,x?{value:x}:b)}function i(v){o=p.getBookmark(v)}function g(){p.moveToBookmark(o)}u({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){n.undoManager.add()},"Cut,Copy,Paste":function(z){var y=n.getDoc(),v;try{f(z)}catch(x){v=a}if(v||!y.queryCommandSupported(z)){if(d.isGecko){n.windowManager.confirm(n.getLang("clipboard_msg"),function(A){if(A){open("http://www.mozilla.org/editor/midasdemo/securityprefs.html","_blank")}})}else{n.windowManager.alert(n.getLang("clipboard_no_support"))}}},unlink:function(v){if(p.isCollapsed()){p.select(p.getNode())}f(v);p.collapse(c)},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(v){var x=v.substring(7);e("left,center,right,full".split(","),function(y){if(x!=y){q.remove("align"+y)}});s("align"+x);r("mceRepaint")},"InsertUnorderedList,InsertOrderedList":function(y){var v,x;f(y);v=m.getParent(p.getNode(),"ol,ul");if(v){x=v.parentNode;if(/^(H[1-6]|P|ADDRESS|PRE)$/.test(x.nodeName)){i();m.split(x,v);g()}}},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(v){s(v)},"ForeColor,HiliteColor,FontName":function(y,x,v){s(y,v)},FontSize:function(z,y,x){var v,A;if(x>=1&&x<=7){A=d.explode(k.font_size_style_values);v=d.explode(k.font_size_classes);if(v){x=v[x-1]||x}else{x=A[x-1]||x}}s(z,x)},RemoveFormat:function(v){q.remove(v)},mceBlockQuote:function(v){s("blockquote")},FormatBlock:function(y,x,v){return s(v||"p")},mceCleanup:function(){var v=p.getBookmark();n.setContent(n.getContent({cleanup:a}),{cleanup:a});p.moveToBookmark(v)},mceRemoveNode:function(z,y,x){var v=x||p.getNode();if(v!=n.getBody()){i();n.dom.remove(v,a);g()}},mceSelectNodeDepth:function(z,y,x){var v=0;m.getParent(p.getNode(),function(A){if(A.nodeType==1&&v++==x){p.select(A);return c}},n.getBody())},mceSelectNode:function(y,x,v){p.select(v)},mceInsertContent:function(B,I,K){var y,J,E,z,F,G,D,C,L,x,A,M,v,H;y=n.parser;J=new d.html.Serializer({},n.schema);v='\uFEFF';G={content:K,format:"html"};p.onBeforeSetContent.dispatch(p,G);K=G.content;if(K.indexOf("{$caret}")==-1){K+="{$caret}"}K=K.replace(/\{\$caret\}/,v);if(!p.isCollapsed()){n.getDoc().execCommand("Delete",false,null)}E=p.getNode();G={context:E.nodeName.toLowerCase()};F=y.parse(K,G);A=F.lastChild;if(A.attr("id")=="mce_marker"){D=A;for(A=A.prev;A;A=A.walk(true)){if(A.type==3||!m.isBlock(A.name)){A.parent.insert(D,A,A.name==="br");break}}}if(!G.invalid){K=J.serialize(F);A=E.firstChild;M=E.lastChild;if(!A||(A===M&&A.nodeName==="BR")){m.setHTML(E,K)}else{p.setContent(K)}}else{p.setContent(v);E=n.selection.getNode();z=n.getBody();if(E.nodeType==9){E=A=z}else{A=E}while(A!==z){E=A;A=A.parentNode}K=E==z?z.innerHTML:m.getOuterHTML(E);K=J.serialize(y.parse(K.replace(//i,function(){return J.serialize(F)})));if(E==z){m.setHTML(z,K)}else{m.setOuterHTML(E,K)}}D=m.get("mce_marker");C=m.getRect(D);L=m.getViewPort(n.getWin());if((C.y+C.h>L.y+L.h||C.yL.x+L.w||C.x")},mceToggleVisualAid:function(){n.hasVisual=!n.hasVisual;n.addVisual()},mceReplaceContent:function(y,x,v){n.execCommand("mceInsertContent",false,v.replace(/\{\$selection\}/g,p.getContent({format:"text"})))},mceInsertLink:function(z,y,x){var v;if(typeof(x)=="string"){x={href:x}}v=m.getParent(p.getNode(),"a");x.href=x.href.replace(" ","%20");if(!v||!x.href){q.remove("link")}if(x.href){q.apply("link",x,v)}},selectAll:function(){var x=m.getRoot(),v=m.createRng();v.setStart(x,0);v.setEnd(x,x.childNodes.length);n.selection.setRng(v)}});u({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(z){var x="align"+z.substring(7);var v=p.isCollapsed()?[m.getParent(p.getNode(),m.isBlock)]:p.getSelectedBlocks();var y=d.map(v,function(A){return !!q.matchNode(A,x)});return d.inArray(y,a)!==-1},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(v){return t(v)},mceBlockQuote:function(){return t("blockquote")},Outdent:function(){var v;if(k.inline_styles){if((v=m.getParent(p.getStart(),m.isBlock))&&parseInt(v.style.paddingLeft)>0){return a}if((v=m.getParent(p.getEnd(),m.isBlock))&&parseInt(v.style.paddingLeft)>0){return a}}return l("InsertUnorderedList")||l("InsertOrderedList")||(!k.inline_styles&&!!m.getParent(p.getNode(),"BLOCKQUOTE"))},"InsertUnorderedList,InsertOrderedList":function(v){return m.getParent(p.getNode(),v=="insertunorderedlist"?"UL":"OL")}},"state");u({"FontSize,FontName":function(y){var x=0,v;if(v=m.getParent(p.getNode(),"span")){if(y=="fontsize"){x=v.style.fontSize}else{x=v.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()}}return x}},"value");u({Undo:function(){n.undoManager.undo()},Redo:function(){n.undoManager.redo()}})}})(tinymce);(function(b){var a=b.util.Dispatcher;b.UndoManager=function(h){var l,i=0,e=[],g,k,j,f;function c(){return b.trim(h.getContent({format:"raw",no_events:1}).replace(/]+data-mce-bogus[^>]+>[\u200B\uFEFF]+<\/span>/g,""))}function d(){l.typing=false;l.add()}onBeforeAdd=new a(l);k=new a(l);j=new a(l);f=new a(l);k.add(function(m,n){if(m.hasUndo()){return h.onChange.dispatch(h,n,m)}});j.add(function(m,n){return h.onUndo.dispatch(h,n,m)});f.add(function(m,n){return h.onRedo.dispatch(h,n,m)});h.onInit.add(function(){l.add()});h.onBeforeExecCommand.add(function(m,p,o,q,n){if(p!="Undo"&&p!="Redo"&&p!="mceRepaint"&&(!n||!n.skip_undo)){l.beforeChange()}});h.onExecCommand.add(function(m,p,o,q,n){if(p!="Undo"&&p!="Redo"&&p!="mceRepaint"&&(!n||!n.skip_undo)){l.add()}});h.onSaveContent.add(d);h.dom.bind(h.dom.getRoot(),"dragend",d);h.dom.bind(h.getDoc(),b.isGecko?"blur":"focusout",function(m){if(!h.removed&&l.typing){d()}});h.onKeyUp.add(function(m,o){var n=o.keyCode;if((n>=33&&n<=36)||(n>=37&&n<=40)||n==45||n==13||o.ctrlKey){d()}});h.onKeyDown.add(function(m,o){var n=o.keyCode;if((n>=33&&n<=36)||(n>=37&&n<=40)||n==45){if(l.typing){d()}return}if((n<16||n>20)&&n!=224&&n!=91&&!l.typing){l.beforeChange();l.typing=true;l.add()}});h.onMouseDown.add(function(m,n){if(l.typing){d()}});h.addShortcut("ctrl+z","undo_desc","Undo");h.addShortcut("ctrl+y","redo_desc","Redo");l={data:e,typing:false,onBeforeAdd:onBeforeAdd,onAdd:k,onUndo:j,onRedo:f,beforeChange:function(){g=h.selection.getBookmark(2,true)},add:function(p){var m,n=h.settings,o;p=p||{};p.content=c();l.onBeforeAdd.dispatch(l,p);o=e[i];if(o&&o.content==p.content){return null}if(e[i]){e[i].beforeBookmark=g}if(n.custom_undo_redo_levels){if(e.length>n.custom_undo_redo_levels){for(m=0;m0){n=e[--i];h.setContent(n.content,{format:"raw"});h.selection.moveToBookmark(n.beforeBookmark);l.onUndo.dispatch(l,n)}return n},redo:function(){var m;if(i0||this.typing},hasRedo:function(){return i0){g.moveEnd("character",q)}g.select()}catch(n){}}if(p){c.nodeChanged()}}if(b.forced_root_block){c.onKeyUp.add(f);c.onNodeChange.add(f)}};(function(c){var b=c.DOM,a=c.dom.Event,d=c.each,e=c.extend;c.create("tinymce.ControlManager",{ControlManager:function(f,j){var h=this,g;j=j||{};h.editor=f;h.controls={};h.onAdd=new c.util.Dispatcher(h);h.onPostRender=new c.util.Dispatcher(h);h.prefix=j.prefix||f.id+"_";h._cls={};h.onPostRender.add(function(){d(h.controls,function(i){i.postRender()})})},get:function(f){return this.controls[this.prefix+f]||this.controls[f]},setActive:function(h,f){var g=null;if(g=this.get(h)){g.setActive(f)}return g},setDisabled:function(h,f){var g=null;if(g=this.get(h)){g.setDisabled(f)}return g},add:function(g){var f=this;if(g){f.controls[g.id]=g;f.onAdd.dispatch(g,f)}return g},createControl:function(j){var o,k,g,h=this,m=h.editor,n,f;if(!h.controlFactories){h.controlFactories=[];d(m.plugins,function(i){if(i.createControl){h.controlFactories.push(i)}})}n=h.controlFactories;for(k=0,g=n.length;k1||ae==aw||ae.tagName=="BR"){return ae}}}var ao=Y.selection.getRng();var at=ao.startContainer;var an=ao.endContainer;if(at!=an&&ao.endOffset===0){var ar=ap(at,an);var aq=ar.nodeType==3?ar.length:ar.childNodes.length;ao.setEnd(ar,aq)}return ao}function ab(aq,aw,au,at,ao){var an=[],ap=-1,av,ay=-1,ar=-1,ax;R(aq.childNodes,function(aA,az){if(aA.nodeName==="UL"||aA.nodeName==="OL"){ap=az;av=aA;return false}});R(aq.childNodes,function(aA,az){if(aA.nodeName==="SPAN"&&c.getAttrib(aA,"data-mce-type")=="bookmark"){if(aA.id==aw.id+"_start"){ay=az}else{if(aA.id==aw.id+"_end"){ar=az}}}});if(ap<=0||(ayap)){R(a.grep(aq.childNodes),ao);return 0}else{ax=c.clone(au,V);R(a.grep(aq.childNodes),function(aA,az){if((ayap&&az>ap)){an.push(aA);aA.parentNode.removeChild(aA)}});if(ayap){aq.insertBefore(ax,av.nextSibling)}}at.push(ax);R(an,function(az){ax.appendChild(az)});return ax}}function al(ao,aq,au){var an=[],at,ap,ar=true;at=ak.inline||ak.block;ap=c.create(at);Z(ap);M.walk(ao,function(av){var aw;function ax(ay){var aD,aB,az,aA,aC;aC=ar;aD=ay.nodeName.toLowerCase();aB=ay.parentNode.nodeName.toLowerCase();if(ay.nodeType===1&&x(ay)){aC=ar;ar=x(ay)==="true";aA=true}if(g(aD,"br")){aw=0;if(ak.block){c.remove(ay)}return}if(ak.wrapper&&y(ay,ac,aj)){aw=0;return}if(ar&&!aA&&ak.block&&!ak.wrapper&&I(aD)){ay=c.rename(ay,at);Z(ay);an.push(ay);aw=0;return}if(ak.selector){R(af,function(aE){if("collapsed" in aE&&aE.collapsed!==ag){return}if(c.is(ay,aE.selector)&&!b(ay)){Z(ay,aE);az=true}});if(!ak.inline||az){aw=0;return}}if(ar&&!aA&&d(at,aD)&&d(aB,at)&&!(!au&&ay.nodeType===3&&ay.nodeValue.length===1&&ay.nodeValue.charCodeAt(0)===65279)&&!b(ay)){if(!aw){aw=c.clone(ap,V);ay.parentNode.insertBefore(aw,ay);an.push(aw)}aw.appendChild(ay)}else{if(aD=="li"&&aq){aw=ab(ay,aq,ap,an,ax)}else{aw=0;R(a.grep(ay.childNodes),ax);if(aA){ar=aC}aw=0}}}R(av,ax)});if(ak.wrap_links===false){R(an,function(av){function aw(aA){var az,ay,ax;if(aA.nodeName==="A"){ay=c.clone(ap,V);an.push(ay);ax=a.grep(aA.childNodes);for(az=0;az1||!H(ax))&&av===0){c.remove(ax,1);return}if(ak.inline||ak.wrapper){if(!ak.exact&&av===1){ax=aw(ax)}R(af,function(az){R(c.select(az.inline,ax),function(aB){var aA;if(az.wrap_links===false){aA=aB.parentNode;do{if(aA.nodeName==="A"){return}}while(aA=aA.parentNode)}X(az,aj,aB,az.exact?aB:null)})});if(y(ax.parentNode,ac,aj)){c.remove(ax,1);ax=0;return C}if(ak.merge_with_parents){c.getParent(ax.parentNode,function(az){if(y(az,ac,aj)){c.remove(ax,1);ax=0;return C}})}if(ax&&ak.merge_siblings!==false){ax=u(E(ax),ax);ax=u(ax,E(ax,C))}}})}if(ak){if(ae){if(ae.nodeType){aa=c.createRng();aa.setStartBefore(ae);aa.setEndAfter(ae);al(p(aa,af),null,true)}else{al(ae,null,true)}}else{if(!ag||!ak.inline||c.select("td.mceSelected,th.mceSelected").length){var am=Y.selection.getNode();if(!m&&af[0].defaultBlock&&!c.getParent(am,c.isBlock)){W(af[0].defaultBlock)}Y.selection.setRng(ad());ai=r.getBookmark();al(p(r.getRng(C),af),ai);if(ak.styles&&(ak.styles.color||ak.styles.textDecoration)){a.walk(am,K,"childNodes");K(am)}r.moveToBookmark(ai);P(r.getRng(C));Y.nodeChanged()}else{S("apply",ac,aj)}}}}function B(ab,ak,ad){var ae=T(ab),am=ae[0],ai,ah,aa,aj=true;function ac(at){var ar,aq,ap,ao,av,au;if(at.nodeType===1&&x(at)){av=aj;aj=x(at)==="true";au=true}ar=a.grep(at.childNodes);if(aj&&!au){for(aq=0,ap=ae.length;aq=0;aa--){Z=af[aa].selector;if(!Z){return C}for(ae=ab.length-1;ae>=0;ae--){if(c.is(ab[ae],Z)){return C}}}}return V}a.extend(this,{get:T,register:l,apply:W,remove:B,toggle:F,match:k,matchAll:v,matchNode:y,canApply:z});j();U();function h(Z,aa){if(g(Z,aa.inline)){return C}if(g(Z,aa.block)){return C}if(aa.selector){return c.is(Z,aa.selector)}}function g(aa,Z){aa=aa||"";Z=Z||"";aa=""+(aa.nodeName||aa);Z=""+(Z.nodeName||Z);return aa.toLowerCase()==Z.toLowerCase()}function N(aa,Z){var ab=c.getStyle(aa,Z);if(Z=="color"||Z=="backgroundColor"){ab=c.toHex(ab)}if(Z=="fontWeight"&&ab==700){ab="bold"}return""+ab}function q(Z,aa){if(typeof(Z)!="string"){Z=Z(aa)}else{if(aa){Z=Z.replace(/%(\w+)/g,function(ac,ab){return aa[ab]||ac})}}return Z}function f(Z){return Z&&Z.nodeType===3&&/^([\t \r\n]+|)$/.test(Z.nodeValue)}function Q(ab,aa,Z){var ac=c.create(aa,Z);ab.parentNode.insertBefore(ac,ab);ac.appendChild(ab);return ac}function p(Z,ak,ac){var an,al,af,aj,ab=Z.startContainer,ag=Z.startOffset,ap=Z.endContainer,ai=Z.endOffset;function am(ax){var ar,av,aw,au,at,aq;ar=av=ax?ab:ap;at=ax?"previousSibling":"nextSibling";aq=c.getRoot();if(ar.nodeType==3&&!f(ar)){if(ax?ag>0:aial?al:ag];if(ab.nodeType==3){ag=0}}if(ap.nodeType==1&&ap.hasChildNodes()){al=ap.childNodes.length-1;ap=ap.childNodes[ai>al?al:ai-1];if(ap.nodeType==3){ai=ap.nodeValue.length}}function ao(ar){var aq=ar;while(aq){if(aq.nodeType===1&&x(aq)){return x(aq)==="false"?aq:ar}aq=aq.parentNode}return ar}function ah(ar,aw,ay){var av,at,ax,aq;function au(aA,aC){var aD,az,aB=aA.nodeValue;if(typeof(aC)=="undefined"){aC=ay?aB.length:0}if(ay){aD=aB.lastIndexOf(" ",aC);az=aB.lastIndexOf("\u00a0",aC);aD=aD>az?aD:az;if(aD!==-1&&!ac){aD++}}else{aD=aB.indexOf(" ",aC);az=aB.indexOf("\u00a0",aC);aD=aD!==-1&&(az===-1||aD0&&af.node.nodeType===3&&af.node.nodeValue.charAt(af.offset-1)===" "){if(af.offset>1){ap=af.node;ap.splitText(af.offset-1)}}}}if(ak[0].inline||ak[0].block_expand){if(!ak[0].inline||(ab.nodeType!=3||ag===0)){ab=am(true)}if(!ak[0].inline||(ap.nodeType!=3||ai===ap.nodeValue.length)){ap=am()}}if(ak[0].selector&&ak[0].expand!==V&&!ak[0].inline){ab=ad(ab,"previousSibling");ap=ad(ap,"nextSibling")}if(ak[0].block||ak[0].selector){ab=aa(ab,"previousSibling");ap=aa(ap,"nextSibling");if(ak[0].block){if(!H(ab)){ab=am(true)}if(!H(ap)){ap=am()}}}if(ab.nodeType==1){ag=s(ab);ab=ab.parentNode}if(ap.nodeType==1){ai=s(ap)+1;ap=ap.parentNode}return{startContainer:ab,startOffset:ag,endContainer:ap,endOffset:ai}}function X(af,ae,ac,Z){var ab,aa,ad;if(!h(ac,af)){return V}if(af.remove!="all"){R(af.styles,function(ah,ag){ah=q(ah,ae);if(typeof(ag)==="number"){ag=ah;Z=0}if(!Z||g(N(Z,ag),ah)){c.setStyle(ac,ag,"")}ad=1});if(ad&&c.getAttrib(ac,"style")==""){ac.removeAttribute("style");ac.removeAttribute("data-mce-style")}R(af.attributes,function(ai,ag){var ah;ai=q(ai,ae);if(typeof(ag)==="number"){ag=ai;Z=0}if(!Z||g(c.getAttrib(Z,ag),ai)){if(ag=="class"){ai=c.getAttrib(ac,ag);if(ai){ah="";R(ai.split(/\s+/),function(aj){if(/mce\w+/.test(aj)){ah+=(ah?" ":"")+aj}});if(ah){c.setAttrib(ac,ag,ah);return}}}if(ag=="class"){ac.removeAttribute("className")}if(e.test(ag)){ac.removeAttribute("data-mce-"+ag)}ac.removeAttribute(ag)}});R(af.classes,function(ag){ag=q(ag,ae);if(!Z||c.hasClass(Z,ag)){c.removeClass(ac,ag)}});aa=c.getAttribs(ac);for(ab=0;abab?ab:ad]}if(Z.nodeType===3&&ae&&ad>=Z.nodeValue.length){Z=new t(Z,Y.getBody()).next()||Z}if(Z.nodeType===3&&!ae&&ad===0){Z=new t(Z,Y.getBody()).prev()||Z}return Z}function S(ai,Z,ag){var aj="_mce_caret",aa=Y.settings.caret_debug;function ab(an){var am=c.create("span",{id:aj,"data-mce-bogus":true,style:aa?"color:red":""});if(an){am.appendChild(Y.getDoc().createTextNode(G))}return am}function ah(an,am){while(an){if((an.nodeType===3&&an.nodeValue!==G)||an.childNodes.length>1){return false}if(am&&an.nodeType===1){am.push(an)}an=an.firstChild}return true}function ae(am){while(am){if(am.id===aj){return am}am=am.parentNode}}function ad(am){var an;if(am){an=new t(am,am);for(am=an.current();am;am=an.next()){if(am.nodeType===3){return am}}}}function ac(ao,an){var ap,am;if(!ao){ao=ae(r.getStart());if(!ao){while(ao=c.get(aj)){ac(ao,false)}}}else{am=r.getRng(true);if(ah(ao)){if(an!==false){am.setStartBefore(ao);am.setEndBefore(ao)}c.remove(ao)}else{ap=ad(ao);if(ap.nodeValue.charAt(0)===G){ap=ap.deleteData(0,1)}c.remove(ao,1)}r.setRng(am)}}function af(){var ao,am,at,ar,ap,an,aq;ao=r.getRng(true);ar=ao.startOffset;an=ao.startContainer;aq=an.nodeValue;am=ae(r.getStart());if(am){at=ad(am)}if(aq&&ar>0&&ar=0;aq--){ao.appendChild(c.clone(av[aq],false));ao=ao.firstChild}ao.appendChild(c.doc.createTextNode(G));ao=ao.firstChild;c.insertAfter(au,aw);r.setCursorLocation(ao,1)}}function al(){var an,am,ao;am=ae(r.getStart());if(am&&!c.isEmpty(am)){a.walk(am,function(ap){if(ap.nodeType==1&&ap.id!==aj&&!c.isEmpty(ap)){c.setAttrib(ap,"data-mce-bogus",null)}},"childNodes")}}if(!self._hasCaretEvents){Y.onBeforeGetContent.addToTop(function(){var am=[],an;if(ah(ae(r.getStart()),am)){an=am.length;while(an--){c.setAttrib(am[an],"data-mce-bogus","1")}}});a.each("onMouseUp onKeyUp".split(" "),function(am){Y[am].addToTop(function(){ac();al()})});Y.onKeyDown.addToTop(function(am,ao){var an=ao.keyCode;if(an==8||an==37||an==39){ac(ae(r.getStart()))}al()});r.onSetContent.add(al);self._hasCaretEvents=true}if(ai=="apply"){af()}else{ak()}}function P(aa){var Z=aa.startContainer,ag=aa.startOffset,ac,af,ae,ab,ad;if(Z.nodeType==3&&ag>=Z.nodeValue.length){ag=s(Z);Z=Z.parentNode;ac=true}if(Z.nodeType==1){ab=Z.childNodes;Z=ab[Math.min(ag,ab.length-1)];af=new t(Z,c.getParent(Z,c.isBlock));if(ag>ab.length-1||ac){af.next()}for(ae=af.current();ae;ae=af.next()){if(ae.nodeType==3&&!f(ae)){ad=c.create("a",null,G);ae.parentNode.insertBefore(ad,ae);aa.setStart(ae,0);r.setRng(aa);c.remove(ad);return}}}}}})(tinymce);tinymce.onAddEditor.add(function(e,a){var d,h,g,c=a.settings;function b(j,i){e.each(i,function(l,k){if(l){g.setStyle(j,k,l)}});g.rename(j,"span")}function f(i,j){g=i.dom;if(c.convert_fonts_to_spans){e.each(g.select("font,u,strike",j.node),function(k){d[k.nodeName.toLowerCase()](a.dom,k)})}}if(c.inline_styles){h=e.explode(c.font_size_legacy_values);d={font:function(j,i){b(i,{backgroundColor:i.style.backgroundColor,color:i.color,fontFamily:i.face,fontSize:h[parseInt(i.size,10)-1]})},u:function(j,i){b(i,{textDecoration:"underline"})},strike:function(j,i){b(i,{textDecoration:"line-through"})}};a.onPreProcess.add(f);a.onSetContent.add(f);a.onInit.add(function(){a.selection.onSetContent.add(f)})}});(function(b){var a=b.dom.TreeWalker;b.EnterKey=function(e){var h=e.dom,d=e.selection,c=e.settings,g=e.undoManager;function f(y){var u=d.getRng(true),C,i,x,t,o,H,n,j,l,s,E,v,z;function B(I){return I&&h.isBlock(I)&&!/^(TD|TH|CAPTION)$/.test(I.nodeName)&&!/^(fixed|absolute)/i.test(I.style.position)&&h.getContentEditable(I)!=="true"}function m(J){var O,M,I,P,N,L=J,K;I=h.createRng();if(J.hasChildNodes()){O=new a(J,J);while(M=O.current()){if(M.nodeType==3){I.setStart(M,0);I.setEnd(M,0);break}if(/^(BR|IMG)$/.test(M.nodeName)){I.setStartBefore(M);I.setEndBefore(M);break}L=M;M=O.next()}if(!M){I.setStart(L,0);I.setEnd(L,0)}}else{if(J.nodeName=="BR"){if(J.nextSibling&&h.isBlock(J.nextSibling)){if(!H||H<9){K=h.create("br");J.parentNode.insertBefore(K,J)}I.setStartBefore(J);I.setEndBefore(J)}else{I.setStartAfter(J);I.setEndAfter(J)}}else{I.setStart(J,0);I.setEnd(J,0)}}d.setRng(I);h.remove(K);N=h.getViewPort(e.getWin());P=h.getPos(J).y;if(PN.y+N.h){e.getWin().scrollTo(0,P"}return M}function p(L){var K,J,I;if(x.nodeType==3&&(L?t>0:t=x.nodeValue.length){if(!b.isIE&&!A()){J=h.create("br");u.insertNode(J);u.setStartAfter(J);u.setEndAfter(J);I=true}}J=h.create("br");u.insertNode(J);if(b.isIE&&s=="PRE"&&(!H||H<8)){J.parentNode.insertBefore(h.doc.createTextNode("\r"),J)}if(!I){u.setStartAfter(J);u.setEndAfter(J)}else{u.setStartBefore(J);u.setEndBefore(J)}d.setRng(u);g.add()}function r(I){do{if(I.nodeType===3){I.nodeValue=I.nodeValue.replace(/^[\r\n]+/,"")}I=I.firstChild}while(I)}function F(K){var I=h.getRoot(),J,L;J=K;while(J!==I&&h.getContentEditable(J)!=="false"){if(h.getContentEditable(J)==="true"){L=J}J=J.parentNode}return J!==I?L:I}if(!u.collapsed){e.execCommand("Delete");return}if(y.isDefaultPrevented()){return}x=u.startContainer;t=u.startOffset;v=c.forced_root_block;v=v?v.toUpperCase():"";H=h.doc.documentMode;if(x.nodeType==1&&x.hasChildNodes()){z=t>x.childNodes.length-1;x=x.childNodes[Math.min(t,x.childNodes.length-1)]||x;t=0}i=F(x);if(!i){return}g.beforeChange();if(!h.isBlock(i)&&i!=h.getRoot()){if(!v||y.shiftKey){G()}return}if((v&&!y.shiftKey)||(!v&&y.shiftKey)){x=k(x,t)}o=h.getParent(x,h.isBlock);l=o?h.getParent(o.parentNode,h.isBlock):null;s=o?o.nodeName.toUpperCase():"";E=l?l.nodeName.toUpperCase():"";if(s=="LI"&&h.isEmpty(o)){if(/^(UL|OL|LI)$/.test(l.parentNode.nodeName)){return false}D();return}if(s=="PRE"&&c.br_in_pre!==false){if(!y.shiftKey){G();return}}else{if((!v&&!y.shiftKey&&s!="LI")||(v&&y.shiftKey)){G();return}}v=v||"P";if(p()){if(/^(H[1-6]|PRE)$/.test(s)&&E!="HGROUP"){n=q(v)}else{n=q()}if(c.end_container_on_empty_block&&B(l)&&h.isEmpty(o)){n=h.split(l,o)}else{h.insertAfter(n,o)}}else{if(p(true)){n=o.parentNode.insertBefore(q(),o)}else{C=u.cloneRange();C.setEndAfter(o);j=C.extractContents();r(j);n=j.firstChild;h.insertAfter(j,o)}}h.setAttrib(n,"id","");m(n);g.add()}e.onKeyDown.add(function(j,i){if(i.keyCode==13){if(f(i)!==false){i.preventDefault()}}})}})(tinymce); \ No newline at end of file diff --git a/lib/editor/tinymce/tiny_mce/3.5/tiny_mce_jquery_src.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/tiny_mce_jquery_src.js similarity index 98% rename from lib/editor/tinymce/tiny_mce/3.5/tiny_mce_jquery_src.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/tiny_mce_jquery_src.js index 04a6c215d6d..d4e8353b095 100644 --- a/lib/editor/tinymce/tiny_mce/3.5/tiny_mce_jquery_src.js +++ b/lib/editor/tinymce/tiny_mce/3.5.1.1/tiny_mce_jquery_src.js @@ -1831,6 +1831,14 @@ tinymce.util.Quirks = function(editor) { editor.onSetContent.add(selection.onSetContent.add(fixLinks)); }; + function setDefaultBlockType() { + if (settings.forced_root_block) { + editor.onInit.add(function() { + setEditorCommandState('DefaultParagraphSeparator', settings.forced_root_block); + }); + } + } + function removeGhostSelection() { function repaint(sender, args) { if (!sender || !args.initial) { @@ -1865,6 +1873,7 @@ tinymce.util.Quirks = function(editor) { cleanupStylesWhenDeleting(); inputMethodFocus(); selectControlElements(); + setDefaultBlockType(); // iOS if (tinymce.isIDevice) { @@ -2340,8 +2349,11 @@ tinymce.html.Styles = function(settings, schema) { if (!html5) { html5 = mapCache.html5 = unpack({ A : 'id|accesskey|class|dir|draggable|item|hidden|itemprop|role|spellcheck|style|subject|title', - B : '#|a|abbr|area|audio|b|bdo|br|button|canvas|cite|code|command|datalist|del|dfn|em|embed|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|meta|meter|noscript|object|output|progress|q|ruby|samp|script|select|small|span|strong|sub|sup|svg|textarea|time|var|video', - C : '#|a|abbr|area|address|article|aside|audio|b|bdo|blockquote|br|button|canvas|cite|code|command|datalist|del|details|dfn|dialog|div|dl|em|embed|fieldset|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|menu|meta|meter|nav|noscript|ol|object|output|p|pre|progress|q|ruby|samp|script|section|select|small|span|strong|style|sub|sup|svg|table|textarea|time|ul|var|video' + B : '#|a|abbr|area|audio|b|bdo|br|button|canvas|cite|code|command|datalist|del|dfn|em|embed|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|meta|' + + 'meter|noscript|object|output|progress|q|ruby|samp|script|select|small|span|strong|sub|sup|svg|textarea|time|var|video', + C : '#|a|abbr|area|address|article|aside|audio|b|bdo|blockquote|br|button|canvas|cite|code|command|datalist|del|details|dfn|dialog|div|dl|em|embed|fieldset|' + + 'figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|menu|meta|meter|nav|noscript|ol|object|output|' + + 'p|pre|progress|q|ruby|samp|script|section|select|small|span|strong|style|sub|sup|svg|table|textarea|time|ul|var|video' }, 'html[A|manifest][body|head]' + 'head[A][base|command|link|meta|noscript|script|style|title]' + 'title[A][#]' + @@ -2377,7 +2389,7 @@ tinymce.html.Styles = function(settings, schema) { 'dl[A][dd|dt]' + 'dt[A][B]' + 'dd[A][C]' + - 'a[A|href|target|ping|rel|media|type][C]' + + 'a[A|href|target|ping|rel|media|type][B]' + 'em[A][B]' + 'strong[A][B]' + 'small[A][B]' + @@ -2423,7 +2435,8 @@ tinymce.html.Styles = function(settings, schema) { 'form[A|accept-charset|action|autocomplete|enctype|method|name|novalidate|target][C]' + 'fieldset[A|disabled|form|name][C|legend]' + 'label[A|form|for][B]' + - 'input[A|type|accept|alt|autocomplete|checked|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|height|list|max|maxlength|min|multiple|pattern|placeholder|readonly|required|size|src|step|width|files|value][]' + + 'input[A|type|accept|alt|autocomplete|checked|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|height|list|max|maxlength|min|' + + 'multiple|pattern|placeholder|readonly|required|size|src|step|width|files|value|name][]' + 'button[A|autofocus|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|name|value|type][B]' + 'select[A|autofocus|disabled|form|multiple|name|size][option|optgroup]' + 'datalist[A][B|option]' + @@ -2626,13 +2639,13 @@ tinymce.html.Styles = function(settings, schema) { // Setup map objects whiteSpaceElementsMap = createLookupTable('whitespace_elements', 'pre script style textarea'); - selfClosingElementsMap = createLookupTable('self_closing_elements', 'colgroup dd dt li options p td tfoot th thead tr'); + selfClosingElementsMap = createLookupTable('self_closing_elements', 'colgroup dd dt li option p td tfoot th thead tr'); shortEndedElementsMap = createLookupTable('short_ended_elements', 'area base basefont br col frame hr img input isindex link meta param embed source'); boolAttrMap = createLookupTable('boolean_attributes', 'checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls'); nonEmptyElementsMap = createLookupTable('non_empty_elements', 'td th iframe video audio object', shortEndedElementsMap); blockElementsMap = createLookupTable('block_elements', 'h1 h2 h3 h4 h5 h6 hr p div address pre form table tbody thead tfoot ' + 'th tr td li ol ul caption blockquote center dl dt dd dir fieldset ' + - 'noscript menu isindex samp header footer article section hgroup aside nav figure'); + 'noscript menu isindex samp header footer article section hgroup aside nav figure option datalist select optgroup'); // Converts a wildcard expression string to a regexp for example *a will become /.*a/. function patternToRegExp(str) { @@ -3076,7 +3089,7 @@ tinymce.html.Styles = function(settings, schema) { // Setup lookup tables for empty elements and boolean attributes shortEndedElements = schema.getShortEndedElements(); - selfClosing = schema.getSelfClosingElements(); + selfClosing = settings.self_closing_elements || schema.getSelfClosingElements(); fillAttrsMap = schema.getBoolAttrs(); validate = settings.validate; removeInternalElements = settings.remove_internals; @@ -3822,9 +3835,23 @@ tinymce.html.Styles = function(settings, schema) { } }; + function cloneAndExcludeBlocks(input) { + var name, output = {}; + + for (name in input) { + if (name !== 'li' && name != 'p') { + output[name] = input[name]; + } + } + + return output; + }; + parser = new tinymce.html.SaxParser({ validate : validate, - fix_self_closing : !validate, // Let the DOM parser handle
                  5. in
                  6. or

                    in

                    for better results + + // Exclude P and LI from DOM parsing since it's treated better by the DOM parser + self_closing_elements: cloneAndExcludeBlocks(schema.getSelfClosingElements()), cdata: function(text) { node.append(createNode('#cdata', 4)).value = text; @@ -4002,7 +4029,7 @@ tinymce.html.Styles = function(settings, schema) { node.empty().append(new Node('#text', '3')).value = '\u00a0'; else { // Leave nodes that have a name like - if (!node.attributes.map.name) { + if (!node.attributes.map.name && !node.attributes.map.id) { tempNode = node.parent; node.empty().remove(); node = tempNode; @@ -4154,12 +4181,12 @@ tinymce.html.Styles = function(settings, schema) { // Force anchor names closed, unless the setting "allow_html_in_named_anchor" is explicitly included. if (!settings.allow_html_in_named_anchor) { - self.addAttributeFilter('name', function(nodes, name) { + self.addAttributeFilter('id,name', function(nodes, name) { var i = nodes.length, sibling, prevSibling, parent, node; while (i--) { node = nodes[i]; - if (node.name === 'a' && node.firstChild) { + if (node.name === 'a' && node.firstChild && !node.attr('href')) { parent = node.parent; // Move children after current node @@ -6357,7 +6384,8 @@ tinymce.dom.TreeWalker = function(start_node, root_node) { cloneContents : cloneContents, insertNode : insertNode, surroundContents : surroundContents, - cloneRange : cloneRange + cloneRange : cloneRange, + toStringIE : toStringIE }); function createDocumentFragment() { @@ -6997,9 +7025,20 @@ tinymce.dom.TreeWalker = function(start_node, root_node) { n.parentNode.removeChild(n); }; + + function toStringIE() { + return dom.create('body', null, cloneContents()).outerText; + } + + return t; }; ns.Range = Range; + + // Older IE versions doesn't let you override toString by it's constructor so we have to stick it in the prototype + Range.prototype.toString = function() { + return this.toStringIE(); + }; })(tinymce.dom); (function() { function Selection(selection) { @@ -7354,7 +7393,7 @@ tinymce.dom.TreeWalker = function(start_node, root_node) { }; this.addRange = function(rng) { - var ieRng, ctrlRng, startContainer, startOffset, endContainer, endOffset, doc = selection.dom.doc, body = doc.body; + var ieRng, ctrlRng, startContainer, startOffset, endContainer, endOffset, sibling, doc = selection.dom.doc, body = doc.body; function setEndPoint(start) { var container, offset, marker, tmpRng, nodes; @@ -7412,11 +7451,25 @@ tinymce.dom.TreeWalker = function(start_node, root_node) { // Trick to place the caret inside an empty block element like

                    if (startOffset == endOffset && !startContainer.hasChildNodes()) { if (startContainer.canHaveHTML) { + // Check if previous sibling is an empty block if it is then we need to render it + // IE would otherwise move the caret into the sibling instead of the empty startContainer see: #5236 + // Example this:

                    |

                    would become this:

                    |

                    + sibling = startContainer.previousSibling; + if (sibling && !sibling.hasChildNodes() && dom.isBlock(sibling)) { + sibling.innerHTML = '\uFEFF'; + } else { + sibling = null; + } + startContainer.innerHTML = '\uFEFF\uFEFF'; ieRng.moveToElementText(startContainer.lastChild); ieRng.select(); dom.doc.selection.clear(); startContainer.innerHTML = ''; + + if (sibling) { + sibling.innerHTML = ''; + } return; } else { startOffset = dom.nodeIndex(startContainer); @@ -8958,11 +9011,10 @@ tinymce.dom.TreeWalker = function(start_node, root_node) { } // Create new script element - elm = dom.create('script', { - id : id, - type : 'text/javascript', - src : tinymce._addVer(url) - }); + elm = document.createElement('script'); + elm.id = id; + elm.type = 'text/javascript'; + elm.src = tinymce._addVer(url); // Add onload listener for non IE browsers since IE9 // fires onload event before the script is parsed and executed @@ -9324,12 +9376,15 @@ tinymce.dom.TreeWalker = function(start_node, root_node) { t.destroy = function() { each(items, function(item) { - dom.unbind(dom.get(item.id), 'focus', itemFocussed); - dom.unbind(dom.get(item.id), 'blur', itemBlurred); + var elm = dom.get(item.id); + + dom.unbind(elm, 'focus', itemFocussed); + dom.unbind(elm, 'blur', itemBlurred); }); - dom.unbind(dom.get(root), 'focus', rootFocussed); - dom.unbind(dom.get(root), 'keydown', rootKeydown); + var rootElm = dom.get(root); + dom.unbind(rootElm, 'focus', rootFocussed); + dom.unbind(rootElm, 'keydown', rootKeydown); items = dom = root = t.focus = itemFocussed = itemBlurred = rootKeydown = rootFocussed = null; t.destroy = function() {}; @@ -9408,21 +9463,23 @@ tinymce.dom.TreeWalker = function(start_node, root_node) { // Set up state and listeners for each item. each(items, function(item, idx) { - var tabindex; + var tabindex, elm; if (!item.id) { item.id = dom.uniqueId('_mce_item_'); } + elm = dom.get(item.id); + if (excludeFromTabOrder) { - dom.bind(item.id, 'blur', itemBlurred); + dom.bind(elm, 'blur', itemBlurred); tabindex = '-1'; } else { tabindex = (idx === 0 ? '0' : '-1'); } - dom.setAttrib(item.id, 'tabindex', tabindex); - dom.bind(dom.get(item.id), 'focus', itemFocussed); + elm.setAttribute('tabindex', tabindex); + dom.bind(elm, 'focus', itemFocussed); }); // Setup initial state for root element. @@ -9431,10 +9488,11 @@ tinymce.dom.TreeWalker = function(start_node, root_node) { } dom.setAttrib(root, 'tabindex', '-1'); - + // Setup listeners for root element. - dom.bind(dom.get(root), 'focus', rootFocussed); - dom.bind(dom.get(root), 'keydown', rootKeydown); + var rootElm = dom.get(root); + dom.bind(rootElm, 'focus', rootFocussed); + dom.bind(rootElm, 'keydown', rootKeydown); } }); })(tinymce); @@ -11541,8 +11599,8 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { inline_styles : TRUE, convert_fonts_to_spans : TRUE, indent : 'simple', - indent_before : 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure', - indent_after : 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure', + indent_before : 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist', + indent_after : 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist', validate : TRUE, entity_encoding : 'named', url_converter : self.convertURL, @@ -11602,6 +11660,10 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { if (!/TEXTAREA|INPUT/i.test(t.getElement().nodeName) && s.hidden_input && DOM.getParent(id, 'form')) DOM.insertAfter(DOM.create('input', {type : 'hidden', name : id}), id); + // Hide target element early to prevent content flashing + t.orgVisibility = t.getElement().style.visibility; + t.getElement().style.visibility = 'hidden'; + if (tinymce.WindowManager) t.windowManager = new tinymce.WindowManager(t); @@ -11664,7 +11726,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { //sl.add(tinymce.baseURL + '/langs/' + s.language + '.js'); sl.add(tinymce.baseURL + '/../../extra/strings.php?elanguage=' + s.language + 'ðeme=' + s.theme); // Moodle modification - load one huge strings file - if (s.theme && s.theme.charAt(0) != '-' && !ThemeManager.urls[s.theme]) + if (s.theme && typeof s.theme != "function" && s.theme.charAt(0) != '-' && !ThemeManager.urls[s.theme]) ThemeManager.load(s.theme, 'themes/' + s.theme + '/editor_template' + tinymce.suffix + '.js'); each(explode(s.plugins), function(p) { @@ -11705,13 +11767,18 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { s.aria_label = s.aria_label || DOM.getAttrib(e, 'aria-label', t.getLang('aria.rich_text_area')); if (s.theme) { - s.theme = s.theme.replace(/-/, ''); - o = ThemeManager.get(s.theme); - t.theme = new o(); + if (typeof s.theme != "function") { + s.theme = s.theme.replace(/-/, ''); + o = ThemeManager.get(s.theme); + t.theme = new o(); - if (t.theme.init) - t.theme.init(t, ThemeManager.urls[s.theme] || tinymce.documentBaseURL.replace(/\/$/, '')); + if (t.theme.init) + t.theme.init(t, ThemeManager.urls[s.theme] || tinymce.documentBaseURL.replace(/\/$/, '')); + } else { + t.theme = s.theme; + } } + function initPlugin(p) { var c = PluginManager.get(p), u = PluginManager.urls[p] || tinymce.documentBaseURL.replace(/\/$/, ''), po; if (c && tinymce.inArray(initializedPlugins,p) === -1) { @@ -11756,26 +11823,57 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { // Measure box if (s.render_ui && t.theme) { - w = s.width || e.style.width || e.offsetWidth; - h = s.height || e.style.height || e.offsetHeight; t.orgDisplay = e.style.display; - re = /^[0-9\.]+(|px)$/i; - if (re.test('' + w)) - w = Math.max(parseInt(w, 10) + (o.deltaWidth || 0), 100); + if (typeof s.theme != "function") { + w = s.width || e.style.width || e.offsetWidth; + h = s.height || e.style.height || e.offsetHeight; + re = /^[0-9\.]+(|px)$/i; - if (re.test('' + h)) - //h = Math.max(parseInt(h, 10) + (o.deltaHeight || 0), 100); - h = Math.max(parseInt(h) + (o.deltaHeight || 0), s.theme_advanced_resizing_min_height || 100); // Moodle hack + if (re.test('' + w)) + w = Math.max(parseInt(w, 10) + (o.deltaWidth || 0), 100); - // Render UI - o = t.theme.renderUI({ - targetNode : e, - width : w, - height : h, - deltaWidth : s.delta_width, - deltaHeight : s.delta_height - }); + if (re.test('' + h)) + //h = Math.max(parseInt(h, 10) + (o.deltaHeight || 0), 100); + h = Math.max(parseInt(h) + (o.deltaHeight || 0), s.theme_advanced_resizing_min_height || 100); // Moodle hack + + // Render UI + o = t.theme.renderUI({ + targetNode : e, + width : w, + height : h, + deltaWidth : s.delta_width, + deltaHeight : s.delta_height + }); + + // Resize editor + DOM.setStyles(o.sizeContainer || o.editorContainer, { + width : w, + height : h + }); + + h = (o.iframeHeight || h) + (typeof(h) == 'number' ? (o.deltaHeight || 0) : ''); + //if (h < 100) + // h = 100; + if (h < (s.theme_advanced_resizing_min_height || 100)) // Moodle hack + h = s.theme_advanced_resizing_min_height || 100; // Moodle hack + + } else { + o = s.theme(t, e); + + // Convert element type to id:s + if (o.editorContainer.nodeType) { + o.editorContainer = o.editorContainer.id = o.editorContainer.id || t.id + "_parent"; + } + + // Convert element type to id:s + if (o.iframeContainer.nodeType) { + o.iframeContainer = o.iframeContainer.id = o.iframeContainer.id || t.id + "_iframecontainer"; + } + + // Use specified iframe height or the targets offsetHeight + h = o.iframeHeight || e.offsetHeight; + } t.editorContainer = o.editorContainer; } @@ -11797,18 +11895,6 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { if (document.domain && location.hostname != document.domain) tinymce.relaxedDomain = document.domain; - // Resize editor - DOM.setStyles(o.sizeContainer || o.editorContainer, { - width : w, - height : h - }); - - h = (o.iframeHeight || h) + (typeof(h) == 'number' ? (o.deltaHeight || 0) : ''); - //if (h < 100) - // h = 100; - if (h < (s.theme_advanced_resizing_min_height || 100)) // Moodle hack - h = s.theme_advanced_resizing_min_height || 100; // Moodle hack - t.iframeHTML = s.doctype + ''; // We only need to override paths if we have to @@ -11867,7 +11953,14 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { }); t.contentAreaContainer = o.iframeContainer; - DOM.get(o.editorContainer).style.display = t.orgDisplay; + + if (o.editorContainer) { + DOM.get(o.editorContainer).style.display = t.orgDisplay; + } + + // Restore visibility on target element + e.style.visibility = t.orgVisibility; + DOM.get(t.id).style.display = 'none'; DOM.setAttrib(t.id, 'aria-hidden', true); @@ -12192,9 +12285,6 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { if (self.initialized) { o = o || {}; - // Normalize selection for example a|a becomes a|a - selection.normalize(); - // Get start node node = selection.getStart() || self.getBody(); node = isIE && node.ownerDocument != self.getDoc() ? self.getBody() : node; // Fix for IE initial state @@ -12672,14 +12762,16 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { return; case 'A': - value = dom.getAttrib(elm, 'name'); - cls = 'mceItemAnchor'; + if (!elm.href) { + value = dom.getAttrib(elm, 'name') || elm.id; + cls = 'mceItemAnchor'; - if (value) { - if (self.hasVisual) - dom.addClass(elm, cls); - else - dom.removeClass(elm, cls); + if (value) { + if (self.hasVisual) + dom.addClass(elm, cls); + else + dom.removeClass(elm, cls); + } } return; @@ -12974,6 +13066,12 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { self.focus(true); }; + function nodeChanged() { + // Normalize selection for example a|a becomes a|a + self.selection.normalize(); + self.nodeChanged(); + } + // Add DOM events each(nativeToDispatcherMap, function(dispatcherName, nativeName) { var root = settings.content_editable ? self.getBody() : self.getDoc(); @@ -13008,13 +13106,13 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { } // Add node change handler - self.onMouseUp.add(self.nodeChanged); + self.onMouseUp.add(nodeChanged); self.onKeyUp.add(function(ed, e) { var keyCode = e.keyCode; if ((keyCode >= 33 && keyCode <= 36) || (keyCode >= 37 && keyCode <= 40) || keyCode == 13 || keyCode == 45 || keyCode == 46 || keyCode == 8 || (tinymce.isMac && (keyCode == 91 || keyCode == 93)) || e.ctrlKey) - self.nodeChanged(); + nodeChanged(); }); // Add reset handler @@ -13621,9 +13719,10 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { }; // Create event instances - onAdd = new Dispatcher(self); - onUndo = new Dispatcher(self); - onRedo = new Dispatcher(self); + onBeforeAdd = new Dispatcher(self); + onAdd = new Dispatcher(self); + onUndo = new Dispatcher(self); + onRedo = new Dispatcher(self); // Pass though onAdd event from UndoManager to Editor as onChange onAdd.add(function(undoman, level) { @@ -13712,6 +13811,8 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { data : data, typing : false, + + onBeforeAdd: onBeforeAdd, onAdd : onAdd, @@ -13728,6 +13829,8 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { level = level || {}; level.content = getContent(); + + self.onBeforeAdd.dispatch(self, level); // Add undo level if needed lastLevel = data[index]; @@ -13828,7 +13931,7 @@ tinymce.ForceBlocks = function(editor) { return; // Check if node is wrapped in block - while (node != rootNode) { + while (node && node != rootNode) { if (blockElements[node.nodeName]) return; @@ -13968,28 +14071,40 @@ tinymce.ForceBlocks = function(editor) { return c; }, - createControl : function(n) { - var c, t = this, ed = t.editor; + createControl : function(name) { + var ctrl, i, l, self = this, editor = self.editor, factories, ctrlName; - each(ed.plugins, function(p) { - if (p.createControl) { - c = p.createControl(n, t); - - if (c) - return false; - } - }); - - switch (n) { - case "|": - case "separator": - return t.createSeparator(); + // Build control factory cache + if (!self.controlFactories) { + self.controlFactories = []; + each(editor.plugins, function(plugin) { + if (plugin.createControl) { + self.controlFactories.push(plugin); + } + }); } - if (!c && ed.buttons && (c = ed.buttons[n])) - return t.createButton(n, c); + // Create controls by asking cached factories + factories = self.controlFactories; + for (i = 0, l = factories.length; i < l; i++) { + ctrl = factories[i].createControl(name, self); - return t.add(c); + if (ctrl) { + return self.add(ctrl); + } + } + + // Create sepearator + if (name === "|" || name === "separator") { + return self.createSeparator(); + } + + // Create control from button collection + if (editor.buttons && (ctrl = editor.buttons[name])) { + return self.createButton(name, ctrl); + } + + return self.add(ctrl); }, createDropMenu : function(id, s, cc) { @@ -16249,6 +16364,21 @@ tinymce.ForceBlocks = function(editor) { } }; + // Checks if the parent caret container node isn't empty if that is the case it + // will remove the bogus state on all children that isn't empty + function unmarkBogusCaretParents() { + var i, caretContainer, node; + + caretContainer = getParentCaretContainer(selection.getStart()); + if (caretContainer && !dom.isEmpty(caretContainer)) { + tinymce.walk(caretContainer, function(node) { + if (node.nodeType == 1 && node.id !== caretContainerId && !dom.isEmpty(node)) { + dom.setAttrib(node, 'data-mce-bogus', null); + } + }, 'childNodes'); + } + }; + // Only bind the caret events once if (!self._hasCaretEvents) { // Mark current caret container elements as bogus when getting the contents so we don't end up with empty elements @@ -16268,6 +16398,7 @@ tinymce.ForceBlocks = function(editor) { tinymce.each('onMouseUp onKeyUp'.split(' '), function(name) { ed[name].addToTop(function() { removeCaretContainer(); + unmarkBogusCaretParents(); }); }); @@ -16278,16 +16409,12 @@ tinymce.ForceBlocks = function(editor) { if (keyCode == 8 || keyCode == 37 || keyCode == 39) { removeCaretContainer(getParentCaretContainer(selection.getStart())); } + + unmarkBogusCaretParents(); }); // Remove bogus state if they got filled by contents using editor.selection.setContent - selection.onSetContent.add(function() { - dom.getParent(selection.getStart(), function(node) { - if (node.id !== caretContainerId && dom.getAttrib(node, 'data-mce-bogus') && !dom.isEmpty(node)) { - dom.setAttrib(node, 'data-mce-bogus', null); - } - }); - }); + selection.onSetContent.add(unmarkBogusCaretParents); self._hasCaretEvents = true; } diff --git a/lib/editor/tinymce/tiny_mce/3.5/tiny_mce_popup.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/tiny_mce_popup.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/tiny_mce_popup.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/tiny_mce_popup.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/tiny_mce_popup_src.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/tiny_mce_popup_src.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/tiny_mce_popup_src.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/tiny_mce_popup_src.js diff --git a/lib/editor/tinymce/tiny_mce/3.5.1.1/tiny_mce_prototype.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/tiny_mce_prototype.js new file mode 100644 index 00000000000..f0b0b2a4315 --- /dev/null +++ b/lib/editor/tinymce/tiny_mce/3.5.1.1/tiny_mce_prototype.js @@ -0,0 +1 @@ +(function(e){var a=/^\s*|\s*$/g,b,d="B".replace(/A(.)|B/,"$1")==="$1";var c={majorVersion:"@@tinymce_major_version@@",minorVersion:"@@tinymce_minor_version@@",releaseDate:"@@tinymce_release_date@@",_init:function(){var s=this,q=document,o=navigator,g=o.userAgent,m,f,l,k,j,r;s.isOpera=e.opera&&opera.buildNumber;s.isWebKit=/WebKit/.test(g);s.isIE=!s.isWebKit&&!s.isOpera&&(/MSIE/gi).test(g)&&(/Explorer/gi).test(o.appName);s.isIE6=s.isIE&&/MSIE [56]/.test(g);s.isIE7=s.isIE&&/MSIE [7]/.test(g);s.isIE8=s.isIE&&/MSIE [8]/.test(g);s.isIE9=s.isIE&&/MSIE [9]/.test(g);s.isGecko=!s.isWebKit&&/Gecko/.test(g);s.isMac=g.indexOf("Mac")!=-1;s.isAir=/adobeair/i.test(g);s.isIDevice=/(iPad|iPhone)/.test(g);s.isIOS5=s.isIDevice&&g.match(/AppleWebKit\/(\d*)/)[1]>=534;if(e.tinyMCEPreInit){s.suffix=tinyMCEPreInit.suffix;s.baseURL=tinyMCEPreInit.base;s.query=tinyMCEPreInit.query;return}s.suffix="";f=q.getElementsByTagName("base");for(m=0;m0?b:[f.scope]);if(e===false){break}}a.inDispatch=false;return e}});(function(){var a=tinymce.each;tinymce.create("tinymce.util.URI",{URI:function(e,g){var f=this,i,d,c,h;e=tinymce.trim(e);g=f.settings=g||{};if(/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e)){f.source=e;return}if(e.indexOf("/")===0&&e.indexOf("//")!==0){e=(g.base_uri?g.base_uri.protocol||"http":"http")+"://mce_host"+e}if(!/^[\w\-]*:?\/\//.test(e)){h=g.base_uri?g.base_uri.path:new tinymce.util.URI(location.href).directory;e=((g.base_uri&&g.base_uri.protocol)||"http")+"://mce_host"+f.toAbsPath(h,e)}e=e.replace(/@@/g,"(mce_at)");e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);a(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(b,j){var k=e[j];if(k){k=k.replace(/\(mce_at\)/g,"@@")}f[b]=k});c=g.base_uri;if(c){if(!f.protocol){f.protocol=c.protocol}if(!f.userInfo){f.userInfo=c.userInfo}if(!f.port&&f.host==="mce_host"){f.port=c.port}if(!f.host||f.host==="mce_host"){f.host=c.host}f.source=""}},setPath:function(c){var b=this;c=/^(.*?)\/?(\w+)?$/.exec(c);b.path=c[0];b.directory=c[1];b.file=c[2];b.source="";b.getURI()},toRelative:function(b){var d=this,f;if(b==="./"){return b}b=new tinymce.util.URI(b,{base_uri:d});if((b.host!="mce_host"&&d.host!=b.host&&b.host)||d.port!=b.port||d.protocol!=b.protocol){return b.getURI()}var c=d.getURI(),e=b.getURI();if(c==e||(c.charAt(c.length-1)=="/"&&c.substr(0,c.length-1)==e)){return c}f=d.toRelPath(d.path,b.path);if(b.query){f+="?"+b.query}if(b.anchor){f+="#"+b.anchor}return f},toAbsolute:function(b,c){b=new tinymce.util.URI(b,{base_uri:this});return b.getURI(this.host==b.host&&this.protocol==b.protocol?c:0)},toRelPath:function(g,h){var c,f=0,d="",e,b;g=g.substring(0,g.lastIndexOf("/"));g=g.split("/");c=h.split("/");if(g.length>=c.length){for(e=0,b=g.length;e=c.length||g[e]!=c[e]){f=e+1;break}}}if(g.length=g.length||g[e]!=c[e]){f=e+1;break}}}if(f===1){return h}for(e=0,b=g.length-(f-1);e=0;c--){if(f[c].length===0||f[c]==="."){continue}if(f[c]===".."){b++;continue}if(b>0){b--;continue}h.push(f[c])}c=e.length-b;if(c<=0){g=h.reverse().join("/")}else{g=e.slice(0,c).join("/")+"/"+h.reverse().join("/")}if(g.indexOf("/")!==0){g="/"+g}if(d&&g.lastIndexOf("/")!==g.length-1){g+=d}return g},getURI:function(d){var c,b=this;if(!b.source||d){c="";if(!d){if(b.protocol){c+=b.protocol+"://"}if(b.userInfo){c+=b.userInfo+"@"}if(b.host){c+=b.host}if(b.port){c+=":"+b.port}}if(b.path){c+=b.path}if(b.query){c+="?"+b.query}if(b.anchor){c+="#"+b.anchor}b.source=c}return b.source}})})();(function(){var a=tinymce.each;tinymce.create("static tinymce.util.Cookie",{getHash:function(d){var b=this.get(d),c;if(b){a(b.split("&"),function(e){e=e.split("=");c=c||{};c[unescape(e[0])]=unescape(e[1])})}return c},setHash:function(j,b,g,f,i,c){var h="";a(b,function(e,d){h+=(!h?"":"&")+escape(d)+"="+escape(e)});this.set(j,h,g,f,i,c)},get:function(i){var h=document.cookie,g,f=i+"=",d;if(!h){return}d=h.indexOf("; "+f);if(d==-1){d=h.indexOf(f);if(d!==0){return null}}else{d+=2}g=h.indexOf(";",d);if(g==-1){g=h.length}return unescape(h.substring(d+f.length,g))},set:function(i,b,g,f,h,c){document.cookie=i+"="+escape(b)+((g)?"; expires="+g.toGMTString():"")+((f)?"; path="+escape(f):"")+((h)?"; domain="+h:"")+((c)?"; secure":"")},remove:function(e,b){var c=new Date();c.setTime(c.getTime()-1000);this.set(e,"",c,b,c)}})})();(function(){function serialize(o,quote){var i,v,t,name;quote=quote||'"';if(o==null){return"null"}t=typeof o;if(t=="string"){v="\bb\tt\nn\ff\rr\"\"''\\\\";return quote+o.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(a,b){if(quote==='"'&&a==="'"){return a}i=v.indexOf(b);if(i+1){return"\\"+v.charAt(i+1)}a=b.charCodeAt().toString(16);return"\\u"+"0000".substring(a.length)+a})+quote}if(t=="object"){if(o.hasOwnProperty&&o instanceof Array){for(i=0,v="[";i0?",":"")+serialize(o[i],quote)}return v+"]"}v="{";for(name in o){if(o.hasOwnProperty(name)){v+=typeof o[name]!="function"?(v.length>1?","+quote:quote)+name+quote+":"+serialize(o[name],quote):""}}return v+"}"}return""+o}tinymce.util.JSON={serialize:serialize,parse:function(s){try{return eval("("+s+")")}catch(ex){}}}})();tinymce.create("static tinymce.util.XHR",{send:function(g){var a,e,b=window,h=0;function f(){if(!g.async||a.readyState==4||h++>10000){if(g.success&&h<10000&&a.status==200){g.success.call(g.success_scope,""+a.responseText,a,g)}else{if(g.error){g.error.call(g.error_scope,h>10000?"TIMED_OUT":"GENERAL",a,g)}}a=null}else{b.setTimeout(f,10)}}g.scope=g.scope||this;g.success_scope=g.success_scope||g.scope;g.error_scope=g.error_scope||g.scope;g.async=g.async===false?false:true;g.data=g.data||"";function d(i){a=0;try{a=new ActiveXObject(i)}catch(c){}return a}a=b.XMLHttpRequest?new XMLHttpRequest():d("Microsoft.XMLHTTP")||d("Msxml2.XMLHTTP");if(a){if(a.overrideMimeType){a.overrideMimeType(g.content_type)}a.open(g.type||(g.data?"POST":"GET"),g.url,g.async);if(g.content_type){a.setRequestHeader("Content-Type",g.content_type)}a.setRequestHeader("X-Requested-With","XMLHttpRequest");a.send(g.data);if(!g.async){return f()}e=b.setTimeout(f,10)}}});(function(){var c=tinymce.extend,b=tinymce.util.JSON,a=tinymce.util.XHR;tinymce.create("tinymce.util.JSONRequest",{JSONRequest:function(d){this.settings=c({},d);this.count=0},send:function(f){var e=f.error,d=f.success;f=c(this.settings,f);f.success=function(h,g){h=b.parse(h);if(typeof(h)=="undefined"){h={error:"JSON Parse error."}}if(h.error){e.call(f.error_scope||f.scope,h.error,g)}else{d.call(f.success_scope||f.scope,h.result)}};f.error=function(h,g){if(e){e.call(f.error_scope||f.scope,h,g)}};f.data=b.serialize({id:f.id||"c"+(this.count++),method:f.method,params:f.params});f.content_type="application/json";a.send(f)},"static":{sendRPC:function(d){return new tinymce.util.JSONRequest().send(d)}}})}());(function(a){a.VK={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,modifierPressed:function(b){return b.shiftKey||b.ctrlKey||b.altKey}}})(tinymce);tinymce.util.Quirks=function(d){var l=tinymce.VK,r=l.BACKSPACE,s=l.DELETE,o=d.dom,A=d.selection,q=d.settings;function c(E,D){try{d.getDoc().execCommand(E,false,D)}catch(C){}}function h(){function C(F){var D,H,E,G;D=A.getRng();H=o.getParent(D.startContainer,o.isBlock);if(F){H=o.getNext(H,o.isBlock)}if(H){E=H.firstChild;while(E&&E.nodeType==3&&E.nodeValue.length===0){E=E.nextSibling}if(E&&E.nodeName==="SPAN"){G=E.cloneNode(false)}}d.getDoc().execCommand(F?"ForwardDelete":"Delete",false,null);H=o.getParent(D.startContainer,o.isBlock);tinymce.each(o.select("span.Apple-style-span,font.Apple-style-span",H),function(I){var J=A.getBookmark();if(G){o.replace(G.cloneNode(false),I,true)}else{o.remove(I,true)}A.moveToBookmark(J)})}d.onKeyDown.add(function(D,F){var E;E=F.keyCode==s;if(!F.isDefaultPrevented()&&(E||F.keyCode==r)&&!l.modifierPressed(F)){F.preventDefault();C(E)}});d.addCommand("Delete",function(){C()})}function B(){function D(F,I){var E,H,G=I?"start":"end";E=F[G+"Container"];H=F[G+"Offset"];if(E.nodeType==1&&E.hasChildNodes()){E=E.childNodes[Math.min(I?H:(H>0?H-1:0),E.childNodes.length-1)]}return E}function C(H,L){var G,K,F,I,J=L?"start":"end",E;G=H[J+"Container"];K=H[J+"Offset"];F=o.getRoot();if(G.nodeType==1){E=K>=G.childNodes.length;G=D(H,L);if(G.nodeType==3){K=L&&!E?0:G.nodeValue.length}}if(G.nodeType==3&&((L&&K>0)||(!L&&K7){return}c("RespectVisibilityInDesign",true);o.addClass(d.getBody(),"mceHideBrInPre");d.parser.addNodeFilter("pre",function(D,F){var G=D.length,I,E,J,H;while(G--){I=D[G].getAll("br");E=I.length;while(E--){J=I[E];H=J.prev;if(H&&H.type===3&&H.value.charAt(H.value-1)!="\n"){H.value+="\n"}else{J.parent.insert(new tinymce.html.Node("#text",3),J,true).value="\n"}}}});d.serializer.addNodeFilter("pre",function(D,F){var G=D.length,I,E,J,H;while(G--){I=D[G].getAll("br");E=I.length;while(E--){J=I[E];H=J.prev;if(H&&H.type==3){H.value=H.value.replace(/\r?\n$/,"")}}}})}function f(){o.bind(d.getBody(),"mouseup",function(E){var D,C=A.getNode();if(C.nodeName=="IMG"){if(D=o.getStyle(C,"width")){o.setAttrib(C,"width",D.replace(/[^0-9%]+/g,""));o.setStyle(C,"width","")}if(D=o.getStyle(C,"height")){o.setAttrib(C,"height",D.replace(/[^0-9%]+/g,""));o.setStyle(C,"height","")}}})}function p(){d.onKeyDown.add(function(I,J){var H,C,D,F,G,K,E;H=J.keyCode==s;if(!J.isDefaultPrevented()&&(H||J.keyCode==r)&&!l.modifierPressed(J)){C=A.getRng();D=C.startContainer;F=C.startOffset;E=C.collapsed;if(D.nodeType==3&&D.nodeValue.length>0&&((F===0&&!E)||(E&&F===(H?0:1)))){nonEmptyElements=I.schema.getNonEmptyElements();J.preventDefault();G=o.create("br",{id:"__tmp"});D.parentNode.insertBefore(G,D);I.getDoc().execCommand(H?"ForwardDelete":"Delete",false,null);D=A.getRng().startContainer;K=D.previousSibling;if(K&&K.nodeType==1&&!o.isBlock(K)&&o.isEmpty(K)&&!nonEmptyElements[K.nodeName.toLowerCase()]){o.remove(K)}o.remove("__tmp")}}})}function e(){d.onKeyDown.add(function(G,H){var E,D,I,C,F;if(H.isDefaultPrevented()||H.keyCode!=l.BACKSPACE){return}E=A.getRng();D=E.startContainer;I=E.startOffset;C=o.getRoot();F=D;if(!E.collapsed||I!==0){return}while(F&&F.parentNode&&F.parentNode.firstChild==F&&F.parentNode!=C){F=F.parentNode}if(F.tagName==="BLOCKQUOTE"){G.formatter.toggle("blockquote",null,F);E.setStart(D,0);E.setEnd(D,0);A.setRng(E);A.collapse(false)}})}function k(){function C(){d._refreshContentEditable();c("StyleWithCSS",false);c("enableInlineTableEditing",false);if(!q.object_resizing){c("enableObjectResizing",false)}}if(!q.readonly){d.onBeforeExecCommand.add(C);d.onMouseDown.add(C)}}function n(){function C(D,E){tinymce.each(o.select("a"),function(H){var F=H.parentNode,G=o.getRoot();if(F.lastChild===H){while(F&&!o.isBlock(F)){if(F.parentNode.lastChild!==F||F===G){return}F=F.parentNode}o.add(F,"br",{"data-mce-bogus":1})}})}d.onExecCommand.add(function(D,E){if(E==="CreateLink"){C(D)}});d.onSetContent.add(A.onSetContent.add(C))}function t(){if(q.forced_root_block){d.onInit.add(function(){c("DefaultParagraphSeparator",q.forced_root_block)})}}function a(){function C(E,D){if(!E||!D.initial){d.execCommand("mceRepaint")}}d.onUndo.add(C);d.onRedo.add(C);d.onSetContent.add(C)}function j(){d.onKeyDown.add(function(C,D){if(!D.isDefaultPrevented()&&D.keyCode==8&&A.getNode().nodeName=="IMG"){D.preventDefault();C.undoManager.beforeChange();o.remove(A.getNode());C.undoManager.add()}})}v();e();B();if(tinymce.isWebKit){p();h();u();x();t();if(tinymce.isIDevice){i()}}if(tinymce.isIE){m();z();g();f();j()}if(tinymce.isGecko){m();b();y();k();n();a()}};(function(j){var a,g,d,k=/[&<>\"\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,b=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,f=/[<>&\"\']/g,c=/&(#x|#)?([\w]+);/g,i={128:"\u20AC",130:"\u201A",131:"\u0192",132:"\u201E",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02C6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017D",145:"\u2018",146:"\u2019",147:"\u201C",148:"\u201D",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02DC",153:"\u2122",154:"\u0161",155:"\u203A",156:"\u0153",158:"\u017E",159:"\u0178"};g={'"':""","'":"'","<":"<",">":">","&":"&"};d={"<":"<",">":">","&":"&",""":'"',"'":"'"};function h(l){var m;m=document.createElement("div");m.innerHTML=l;return m.textContent||m.innerText||l}function e(m,p){var n,o,l,q={};if(m){m=m.split(",");p=p||10;for(n=0;n1){return"&#"+(((n.charCodeAt(0)-55296)*1024)+(n.charCodeAt(1)-56320)+65536)+";"}return g[n]||"&#"+n.charCodeAt(0)+";"})},encodeNamed:function(n,l,m){m=m||a;return n.replace(l?k:b,function(o){return g[o]||m[o]||o})},getEncodeFunc:function(l,o){var p=j.html.Entities;o=e(o)||a;function m(r,q){return r.replace(q?k:b,function(s){return g[s]||o[s]||"&#"+s.charCodeAt(0)+";"||s})}function n(r,q){return p.encodeNamed(r,q,o)}l=j.makeMap(l.replace(/\+/g,","));if(l.named&&l.numeric){return m}if(l.named){if(o){return n}return p.encodeNamed}if(l.numeric){return p.encodeNumeric}return p.encodeRaw},decode:function(l){return l.replace(c,function(n,m,o){if(m){o=parseInt(o,m.length===2?16:10);if(o>65535){o-=65536;return String.fromCharCode(55296+(o>>10),56320+(o&1023))}else{return i[o]||String.fromCharCode(o)}}return d[n]||a[n]||h(n)})}}})(tinymce);tinymce.html.Styles=function(d,f){var k=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,h=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,b=/\s*([^:]+):\s*([^;]+);?/g,l=/\s+$/,m=/rgb/,e,g,a={},j;d=d||{};j="\\\" \\' \\; \\: ; : \uFEFF".split(" ");for(g=0;g1?r:"0"+r}return"#"+o(q)+o(p)+o(i)}return{toHex:function(i){return i.replace(k,c)},parse:function(s){var z={},q,n,x,r,v=d.url_converter,y=d.url_converter_scope||this;function p(D,G){var F,C,B,E;F=z[D+"-top"+G];if(!F){return}C=z[D+"-right"+G];if(F!=C){return}B=z[D+"-bottom"+G];if(C!=B){return}E=z[D+"-left"+G];if(B!=E){return}z[D+G]=E;delete z[D+"-top"+G];delete z[D+"-right"+G];delete z[D+"-bottom"+G];delete z[D+"-left"+G]}function u(C){var D=z[C],B;if(!D||D.indexOf(" ")<0){return}D=D.split(" ");B=D.length;while(B--){if(D[B]!==D[0]){return false}}z[C]=D[0];return true}function A(D,C,B,E){if(!u(C)){return}if(!u(B)){return}if(!u(E)){return}z[D]=z[C]+" "+z[B]+" "+z[E];delete z[C];delete z[B];delete z[E]}function t(B){r=true;return a[B]}function i(C,B){if(r){C=C.replace(/\uFEFF[0-9]/g,function(D){return a[D]})}if(!B){C=C.replace(/\\([\'\";:])/g,"$1")}return C}function o(C,B,F,E,G,D){G=G||D;if(G){G=i(G);return"'"+G.replace(/\'/g,"\\'")+"'"}B=i(B||F||E);if(v){B=v.call(y,B,"style")}return"url('"+B.replace(/\'/g,"\\'")+"')"}if(s){s=s.replace(/\\[\"\';:\uFEFF]/g,t).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(B){return B.replace(/[;:]/g,t)});while(q=b.exec(s)){n=q[1].replace(l,"").toLowerCase();x=q[2].replace(l,"");if(n&&x.length>0){if(n==="font-weight"&&x==="700"){x="bold"}else{if(n==="color"||n==="background-color"){x=x.toLowerCase()}}x=x.replace(k,c);x=x.replace(h,o);z[n]=r?i(x,true):x}b.lastIndex=q.index+q[0].length}p("border","");p("border","-width");p("border","-color");p("border","-style");p("padding","");p("margin","");A("border","border-width","border-style","border-color");if(z.border==="medium none"){delete z.border}}return z},serialize:function(p,r){var o="",n,q;function i(t){var x,u,s,v;x=f.styles[t];if(x){for(u=0,s=x.length;u0){o+=(o.length>0?" ":"")+t+": "+v+";"}}}}if(r&&f&&f.styles){i("*");i(r)}else{for(n in p){q=p[n];if(q!==e&&q.length>0){o+=(o.length>0?" ":"")+n+": "+q+";"}}}return o}}};(function(f){var a={},e=f.makeMap,g=f.each;function d(j,i){return j.split(i||",")}function h(m,l){var j,k={};function i(n){return n.replace(/[A-Z]+/g,function(o){return i(m[o])})}for(j in m){if(m.hasOwnProperty(j)){m[j]=i(m[j])}}i(l).replace(/#/g,"#text").replace(/(\w+)\[([^\]]+)\]\[([^\]]*)\]/g,function(q,o,n,p){n=d(n,"|");k[o]={attributes:e(n),attributesOrder:n,children:e(p,"|",{"#comment":{}})}});return k}function b(){var i=a.html5;if(!i){i=a.html5=h({A:"id|accesskey|class|dir|draggable|item|hidden|itemprop|role|spellcheck|style|subject|title",B:"#|a|abbr|area|audio|b|bdo|br|button|canvas|cite|code|command|datalist|del|dfn|em|embed|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|meta|meter|noscript|object|output|progress|q|ruby|samp|script|select|small|span|strong|sub|sup|svg|textarea|time|var|video",C:"#|a|abbr|area|address|article|aside|audio|b|bdo|blockquote|br|button|canvas|cite|code|command|datalist|del|details|dfn|dialog|div|dl|em|embed|fieldset|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|menu|meta|meter|nav|noscript|ol|object|output|p|pre|progress|q|ruby|samp|script|section|select|small|span|strong|style|sub|sup|svg|table|textarea|time|ul|var|video"},"html[A|manifest][body|head]head[A][base|command|link|meta|noscript|script|style|title]title[A][#]base[A|href|target][]link[A|href|rel|media|type|sizes][]meta[A|http-equiv|name|content|charset][]style[A|type|media|scoped][#]script[A|charset|type|src|defer|async][#]noscript[A][C]body[A][C]section[A][C]nav[A][C]article[A][C]aside[A][C]h1[A][B]h2[A][B]h3[A][B]h4[A][B]h5[A][B]h6[A][B]hgroup[A][h1|h2|h3|h4|h5|h6]header[A][C]footer[A][C]address[A][C]p[A][B]br[A][]pre[A][B]dialog[A][dd|dt]blockquote[A|cite][C]ol[A|start|reversed][li]ul[A][li]li[A|value][C]dl[A][dd|dt]dt[A][B]dd[A][C]a[A|href|target|ping|rel|media|type][B]em[A][B]strong[A][B]small[A][B]cite[A][B]q[A|cite][B]dfn[A][B]abbr[A][B]code[A][B]var[A][B]samp[A][B]kbd[A][B]sub[A][B]sup[A][B]i[A][B]b[A][B]mark[A][B]progress[A|value|max][B]meter[A|value|min|max|low|high|optimum][B]time[A|datetime][B]ruby[A][B|rt|rp]rt[A][B]rp[A][B]bdo[A][B]span[A][B]ins[A|cite|datetime][B]del[A|cite|datetime][B]figure[A][C|legend|figcaption]figcaption[A][C]img[A|alt|src|height|width|usemap|ismap][]iframe[A|name|src|height|width|sandbox|seamless][]embed[A|src|height|width|type][]object[A|data|type|height|width|usemap|name|form|classid][param]param[A|name|value][]details[A|open][C|legend]command[A|type|label|icon|disabled|checked|radiogroup][]menu[A|type|label][C|li]legend[A][C|B]div[A][C]source[A|src|type|media][]audio[A|src|autobuffer|autoplay|loop|controls][source]video[A|src|autobuffer|autoplay|loop|controls|width|height|poster][source]hr[A][]form[A|accept-charset|action|autocomplete|enctype|method|name|novalidate|target][C]fieldset[A|disabled|form|name][C|legend]label[A|form|for][B]input[A|type|accept|alt|autocomplete|checked|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|height|list|max|maxlength|min|multiple|pattern|placeholder|readonly|required|size|src|step|width|files|value|name][]button[A|autofocus|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|name|value|type][B]select[A|autofocus|disabled|form|multiple|name|size][option|optgroup]datalist[A][B|option]optgroup[A|disabled|label][option]option[A|disabled|selected|label|value][]textarea[A|autofocus|disabled|form|maxlength|name|placeholder|readonly|required|rows|cols|wrap][]keygen[A|autofocus|challenge|disabled|form|keytype|name][]output[A|for|form|name][B]canvas[A|width|height][]map[A|name][B|C]area[A|shape|coords|href|alt|target|media|rel|ping|type][]mathml[A][]svg[A][]table[A|summary][caption|colgroup|thead|tfoot|tbody|tr]caption[A][C]colgroup[A|span][col]col[A|span][]thead[A][tr]tfoot[A][tr]tbody[A][tr]tr[A][th|td]th[A|headers|rowspan|colspan|scope][B]td[A|headers|rowspan|colspan][C]")}return i}function c(){var i=a.html4;if(!i){i=a.html4=h({Z:"H|K|N|O|P",Y:"X|form|R|Q",ZG:"E|span|width|align|char|charoff|valign",X:"p|T|div|U|W|isindex|fieldset|table",ZF:"E|align|char|charoff|valign",W:"pre|hr|blockquote|address|center|noframes",ZE:"abbr|axis|headers|scope|rowspan|colspan|align|char|charoff|valign|nowrap|bgcolor|width|height",ZD:"[E][S]",U:"ul|ol|dl|menu|dir",ZC:"p|Y|div|U|W|table|br|span|bdo|object|applet|img|map|K|N|Q",T:"h1|h2|h3|h4|h5|h6",ZB:"X|S|Q",S:"R|P",ZA:"a|G|J|M|O|P",R:"a|H|K|N|O",Q:"noscript|P",P:"ins|del|script",O:"input|select|textarea|label|button",N:"M|L",M:"em|strong|dfn|code|q|samp|kbd|var|cite|abbr|acronym",L:"sub|sup",K:"J|I",J:"tt|i|b|u|s|strike",I:"big|small|font|basefont",H:"G|F",G:"br|span|bdo",F:"object|applet|img|map|iframe",E:"A|B|C",D:"accesskey|tabindex|onfocus|onblur",C:"onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup",B:"lang|xml:lang|dir",A:"id|class|style|title"},"script[id|charset|type|language|src|defer|xml:space][]style[B|id|type|media|title|xml:space][]object[E|declare|classid|codebase|data|type|codetype|archive|standby|width|height|usemap|name|tabindex|align|border|hspace|vspace][#|param|Y]param[id|name|value|valuetype|type][]p[E|align][#|S]a[E|D|charset|type|name|href|hreflang|rel|rev|shape|coords|target][#|Z]br[A|clear][]span[E][#|S]bdo[A|C|B][#|S]applet[A|codebase|archive|code|object|alt|name|width|height|align|hspace|vspace][#|param|Y]h1[E|align][#|S]img[E|src|alt|name|longdesc|width|height|usemap|ismap|align|border|hspace|vspace][]map[B|C|A|name][X|form|Q|area]h2[E|align][#|S]iframe[A|longdesc|name|src|frameborder|marginwidth|marginheight|scrolling|align|width|height][#|Y]h3[E|align][#|S]tt[E][#|S]i[E][#|S]b[E][#|S]u[E][#|S]s[E][#|S]strike[E][#|S]big[E][#|S]small[E][#|S]font[A|B|size|color|face][#|S]basefont[id|size|color|face][]em[E][#|S]strong[E][#|S]dfn[E][#|S]code[E][#|S]q[E|cite][#|S]samp[E][#|S]kbd[E][#|S]var[E][#|S]cite[E][#|S]abbr[E][#|S]acronym[E][#|S]sub[E][#|S]sup[E][#|S]input[E|D|type|name|value|checked|disabled|readonly|size|maxlength|src|alt|usemap|onselect|onchange|accept|align][]select[E|name|size|multiple|disabled|tabindex|onfocus|onblur|onchange][optgroup|option]optgroup[E|disabled|label][option]option[E|selected|disabled|label|value][]textarea[E|D|name|rows|cols|disabled|readonly|onselect|onchange][]label[E|for|accesskey|onfocus|onblur][#|S]button[E|D|name|value|type|disabled][#|p|T|div|U|W|table|G|object|applet|img|map|K|N|Q]h4[E|align][#|S]ins[E|cite|datetime][#|Y]h5[E|align][#|S]del[E|cite|datetime][#|Y]h6[E|align][#|S]div[E|align][#|Y]ul[E|type|compact][li]li[E|type|value][#|Y]ol[E|type|compact|start][li]dl[E|compact][dt|dd]dt[E][#|S]dd[E][#|Y]menu[E|compact][li]dir[E|compact][li]pre[E|width|xml:space][#|ZA]hr[E|align|noshade|size|width][]blockquote[E|cite][#|Y]address[E][#|S|p]center[E][#|Y]noframes[E][#|Y]isindex[A|B|prompt][]fieldset[E][#|legend|Y]legend[E|accesskey|align][#|S]table[E|summary|width|border|frame|rules|cellspacing|cellpadding|align|bgcolor][caption|col|colgroup|thead|tfoot|tbody|tr]caption[E|align][#|S]col[ZG][]colgroup[ZG][col]thead[ZF][tr]tr[ZF|bgcolor][th|td]th[E|ZE][#|Y]form[E|action|method|name|enctype|onsubmit|onreset|accept|accept-charset|target][#|X|R|Q]noscript[E][#|Y]td[E|ZE][#|Y]tfoot[ZF][tr]tbody[ZF][tr]area[E|D|shape|coords|href|nohref|alt|target][]base[id|href|target][]body[E|onload|onunload|background|bgcolor|text|link|vlink|alink][#|Y]")}return i}f.html.Schema=function(A){var u=this,s={},k={},j=[],D,y;var o,q,z,r,v,n,p={};function m(F,E,H){var G=A[F];if(!G){G=a[F];if(!G){G=e(E," ",e(E.toUpperCase()," "));G=f.extend(G,H);a[F]=G}}else{G=e(G,",",e(G.toUpperCase()," "))}return G}A=A||{};y=A.schema=="html5"?b():c();if(A.verify_html===false){A.valid_elements="*[*]"}if(A.valid_styles){D={};g(A.valid_styles,function(F,E){D[E]=f.explode(F)})}o=m("whitespace_elements","pre script style textarea");q=m("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr");z=m("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source");r=m("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls");n=m("non_empty_elements","td th iframe video audio object",z);v=m("block_elements","h1 h2 h3 h4 h5 h6 hr p div address pre form table tbody thead tfoot th tr td li ol ul caption blockquote center dl dt dd dir fieldset noscript menu isindex samp header footer article section hgroup aside nav figure option datalist select optgroup");function i(E){return new RegExp("^"+E.replace(/([?+*])/g,".$1")+"$")}function C(L){var K,G,Z,V,aa,F,I,U,X,Q,Y,ac,O,J,W,E,S,H,ab,ad,P,T,N=/^([#+\-])?([^\[\/]+)(?:\/([^\[]+))?(?:\[([^\]]+)\])?$/,R=/^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,M=/[*?+]/;if(L){L=d(L);if(s["@"]){S=s["@"].attributes;H=s["@"].attributesOrder}for(K=0,G=L.length;K=0){for(U=A.length-1;U>=V;U--){T=A[U];if(T.valid){n.end(T.name)}}A.length=V}}function p(U,T,Y,X,W){var Z,V;T=T.toLowerCase();Y=T in H?T:j(Y||X||W||"");if(v&&!z&&T.indexOf("data-")!==0){Z=P[T];if(!Z&&F){V=F.length;while(V--){Z=F[V];if(Z.pattern.test(T)){break}}if(V===-1){Z=null}}if(!Z){return}if(Z.validValues&&!(Y in Z.validValues)){return}}N.map[T]=Y;N.push({name:T,value:Y})}l=new RegExp("<(?:(?:!--([\\w\\W]*?)-->)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([^>]+)>)|(?:([A-Za-z0-9\\-\\:]+)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g");D=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:\\.|[^\"])*)\")|(?:\'((?:\\.|[^\'])*)\')|([^>\s]+)))?/g;K={script:/<\/script[^>]*>/gi,style:/<\/style[^>]*>/gi,noscript:/<\/noscript[^>]*>/gi};M=e.getShortEndedElements();J=c.self_closing_elements||e.getSelfClosingElements();H=e.getBoolAttrs();v=c.validate;s=c.remove_internals;y=c.fix_self_closing;q=a.isIE;o=/^:/;while(g=l.exec(E)){if(G0&&A[A.length-1].name===I){u(I)}if(!v||(m=e.getElementRule(I))){k=true;if(v){P=m.attributes;F=m.attributePatterns}if(R=g[8]){z=R.indexOf("data-mce-type")!==-1;if(z&&s){k=false}N=[];N.map={};R.replace(D,p)}else{N=[];N.map={}}if(v&&!z){S=m.attributesRequired;L=m.attributesDefault;f=m.attributesForced;if(f){Q=f.length;while(Q--){t=f[Q];r=t.name;h=t.value;if(h==="{$uid}"){h="mce_"+x++}N.map[r]=h;N.push({name:r,value:h})}}if(L){Q=L.length;while(Q--){t=L[Q];r=t.name;if(!(r in N.map)){h=t.value;if(h==="{$uid}"){h="mce_"+x++}N.map[r]=h;N.push({name:r,value:h})}}}if(S){Q=S.length;while(Q--){if(S[Q] in N.map){break}}if(Q===-1){k=false}}if(N.map["data-mce-bogus"]){k=false}}if(k){n.start(I,N,O)}}else{k=false}if(B=K[I]){B.lastIndex=G=g.index+g[0].length;if(g=B.exec(E)){if(k){C=E.substr(G,g.index-G)}G=g.index+g[0].length}else{C=E.substr(G);G=E.length}if(k&&C.length>0){n.text(C,true)}if(k){n.end(I)}l.lastIndex=G;continue}if(!O){if(!R||R.indexOf("/")!=R.length-1){A.push({name:I,valid:k})}else{if(k){n.end(I)}}}}else{if(I=g[1]){n.comment(I)}else{if(I=g[2]){n.cdata(I)}else{if(I=g[3]){n.doctype(I)}else{if(I=g[4]){n.pi(I,g[5])}}}}}}G=g.index+g[0].length}if(G=0;Q--){I=A[Q];if(I.valid){n.end(I.name)}}}}})(tinymce);(function(d){var c=/^[ \t\r\n]*$/,e={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11};function a(k,l,j){var i,h,f=j?"lastChild":"firstChild",g=j?"prev":"next";if(k[f]){return k[f]}if(k!==l){i=k[g];if(i){return i}for(h=k.parent;h&&h!==l;h=h.parent){i=h[g];if(i){return i}}}}function b(f,g){this.name=f;this.type=g;if(g===1){this.attributes=[];this.attributes.map={}}}d.extend(b.prototype,{replace:function(g){var f=this;if(g.parent){g.remove()}f.insert(g,f);f.remove();return f},attr:function(h,l){var f=this,g,j,k;if(typeof h!=="string"){for(j in h){f.attr(j,h[j])}return f}if(g=f.attributes){if(l!==k){if(l===null){if(h in g.map){delete g.map[h];j=g.length;while(j--){if(g[j].name===h){g=g.splice(j,1);return f}}}return f}if(h in g.map){j=g.length;while(j--){if(g[j].name===h){g[j].value=l;break}}}else{g.push({name:h,value:l})}g.map[h]=l;return f}else{return g.map[h]}}},clone:function(){var g=this,n=new b(g.name,g.type),h,f,m,j,k;if(m=g.attributes){k=[];k.map={};for(h=0,f=m.length;h1){v.reverse();z=n=f.filterNode(v[0].clone());for(t=0;t0){Q.value=l;Q=Q.prev}else{O=Q.prev;Q.remove();Q=O}}}function H(O){var P,l={};for(P in O){if(P!=="li"&&P!="p"){l[P]=O[P]}}return l}n=new b.html.SaxParser({validate:z,self_closing_elements:H(h.getSelfClosingElements()),cdata:function(l){B.append(K("#cdata",4)).value=l},text:function(P,l){var O;if(!L){P=P.replace(k," ");if(B.lastChild&&o[B.lastChild.name]){P=P.replace(E,"")}}if(P.length!==0){O=K("#text",3);O.raw=!!l;B.append(O).value=P}},comment:function(l){B.append(K("#comment",8)).value=l},pi:function(l,O){B.append(K(l,7)).value=O;I(B)},doctype:function(O){var l;l=B.append(K("#doctype",10));l.value=O;I(B)},start:function(l,W,P){var U,R,Q,O,S,X,V,T;Q=z?h.getElementRule(l):{};if(Q){U=K(Q.outputName||l,1);U.attributes=W;U.shortEnded=P;B.append(U);T=p[B.name];if(T&&p[U.name]&&!T[U.name]){M.push(U)}R=d.length;while(R--){S=d[R].name;if(S in W.map){F=c[S];if(F){F.push(U)}else{c[S]=[U]}}}if(o[l]){I(U)}if(!P){B=U}if(!L&&s[l]){L=true}}},end:function(l){var S,P,R,O,Q;P=z?h.getElementRule(l):{};if(P){if(o[l]){if(!L){S=B.firstChild;if(S&&S.type===3){R=S.value.replace(E,"");if(R.length>0){S.value=R;S=S.next}else{O=S.next;S.remove();S=O}while(S&&S.type===3){R=S.value;O=S.next;if(R.length===0||y.test(R)){S.remove();S=O}S=O}}S=B.lastChild;if(S&&S.type===3){R=S.value.replace(t,"");if(R.length>0){S.value=R;S=S.prev}else{O=S.prev;S.remove();S=O}while(S&&S.type===3){R=S.value;O=S.prev;if(R.length===0||y.test(R)){S.remove();S=O}S=O}}}S=B.prev;if(S&&S.type===3){R=S.value.replace(E,"");if(R.length>0){S.value=R}else{S.remove()}}}if(L&&s[l]){L=false}if(P.removeEmpty||P.paddEmpty){if(B.isEmpty(u)){if(P.paddEmpty){B.empty().append(new a("#text","3")).value="\u00a0"}else{if(!B.attributes.map.name&&!B.attributes.map.id){Q=B.parent;B.empty().remove();B=Q;return}}}}B=B.parent}}},h);J=B=new a(m.context||g.root_name,11);n.parse(v);if(z&&M.length){if(!m.context){j(M)}else{m.invalid=true}}if(q&&J.name=="body"){G()}if(!m.invalid){for(N in i){F=e[N];A=i[N];x=A.length;while(x--){if(!A[x].parent){A.splice(x,1)}}for(D=0,C=F.length;D0){o=c[c.length-1];if(o.length>0&&o!=="\n"){c.push("\n")}}c.push("<",m);if(k){for(n=0,j=k.length;n0){o=c[c.length-1];if(o.length>0&&o!=="\n"){c.push("\n")}}},end:function(h){var i;c.push("");if(a&&d[h]&&c.length>0){i=c[c.length-1];if(i.length>0&&i!=="\n"){c.push("\n")}}},text:function(i,h){if(i.length>0){c[c.length]=h?i:f(i)}},cdata:function(h){c.push("")},comment:function(h){c.push("")},pi:function(h,i){if(i){c.push("")}else{c.push("")}if(a){c.push("\n")}},doctype:function(h){c.push("",a?"\n":"")},reset:function(){c.length=0},getContent:function(){return c.join("").replace(/\n$/,"")}}};(function(a){a.html.Serializer=function(c,d){var b=this,e=new a.html.Writer(c);c=c||{};c.validate="validate" in c?c.validate:true;b.schema=d=d||new a.html.Schema();b.writer=e;b.serialize=function(h){var g,i;i=c.validate;g={3:function(k,j){e.text(k.value,k.raw)},8:function(j){e.comment(j.value)},7:function(j){e.pi(j.name,j.value)},10:function(j){e.doctype(j.value)},4:function(j){e.cdata(j.value)},11:function(j){if((j=j.firstChild)){do{f(j)}while(j=j.next)}}};e.reset();function f(k){var t=g[k.type],j,o,s,r,p,u,n,m,q;if(!t){j=k.name;o=k.shortEnded;s=k.attributes;if(i&&s&&s.length>1){u=[];u.map={};q=d.getElementRule(k.name);for(n=0,m=q.attributesOrder.length;n=8;k.boxModel=!e.isIE||o.compatMode=="CSS1Compat"||k.stdMode;k.hasOuterHTML="outerHTML" in o.createElement("a");k.settings=l=e.extend({keep_values:false,hex_colors:1},l);k.schema=l.schema;k.styles=new e.html.Styles({url_converter:l.url_converter,url_converter_scope:l.url_converter_scope},l.schema);if(e.isIE6){try{o.execCommand("BackgroundImageCache",false,true)}catch(m){k.cssFlicker=true}}k.fixDoc(o);k.events=l.ownEvents?new e.dom.EventUtils(l.proxy):e.dom.Event;e.addUnload(k.destroy,k);n=l.schema?l.schema.getBlockElements():{};k.isBlock=function(q){var p=q.nodeType;if(p){return !!(p===1&&n[q.nodeName])}return !!n[q]}},fixDoc:function(k){var j=this.settings,i;if(b&&j.schema){("abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video").replace(/\w+/g,function(l){k.createElement(l)});for(i in j.schema.getCustomElements()){k.createElement(i)}}},clone:function(k,i){var j=this,m,l;if(!b||k.nodeType!==1||i){return k.cloneNode(i)}l=j.doc;if(!i){m=l.createElement(k.nodeName);g(j.getAttribs(k),function(n){j.setAttrib(m,n.nodeName,j.getAttrib(k,n.nodeName))});return m}return m.firstChild},getRoot:function(){var i=this,j=i.settings;return(j&&i.get(j.root_element))||i.doc.body},getViewPort:function(j){var k,i;j=!j?this.win:j;k=j.document;i=this.boxModel?k.documentElement:k.body;return{x:j.pageXOffset||i.scrollLeft,y:j.pageYOffset||i.scrollTop,w:j.innerWidth||i.clientWidth,h:j.innerHeight||i.clientHeight}},getRect:function(l){var k,i=this,j;l=i.get(l);k=i.getPos(l);j=i.getSize(l);return{x:k.x,y:k.y,w:j.w,h:j.h}},getSize:function(l){var j=this,i,k;l=j.get(l);i=j.getStyle(l,"width");k=j.getStyle(l,"height");if(i.indexOf("px")===-1){i=0}if(k.indexOf("px")===-1){k=0}return{w:parseInt(i,10)||l.offsetWidth||l.clientWidth,h:parseInt(k,10)||l.offsetHeight||l.clientHeight}},getParent:function(k,j,i){return this.getParents(k,j,i,false)},getParents:function(s,m,k,q){var j=this,i,l=j.settings,p=[];s=j.get(s);q=q===undefined;if(l.strict_root){k=k||j.getRoot()}if(d(m,"string")){i=m;if(m==="*"){m=function(o){return o.nodeType==1}}else{m=function(o){return j.is(o,i)}}}while(s){if(s==k||!s.nodeType||s.nodeType===9){break}if(!m||m(s)){if(q){p.push(s)}else{return s}}s=s.parentNode}return q?p:null},get:function(i){var j;if(i&&this.doc&&typeof(i)=="string"){j=i;i=this.doc.getElementById(i);if(i&&i.id!==j){return this.doc.getElementsByName(j)[1]}}return i},getNext:function(j,i){return this._findSib(j,i,"nextSibling")},getPrev:function(j,i){return this._findSib(j,i,"previousSibling")},select:function(k,j){var i=this;return e.dom.Sizzle(k,i.get(j)||i.get(i.settings.root_element)||i.doc,[])},is:function(l,j){var k;if(l.length===undefined){if(j==="*"){return l.nodeType==1}if(c.test(j)){j=j.toLowerCase().split(/,/);l=l.nodeName.toLowerCase();for(k=j.length-1;k>=0;k--){if(j[k]==l){return true}}return false}}return e.dom.Sizzle.matches(j,l.nodeType?[l]:l).length>0},add:function(l,o,i,k,m){var j=this;return this.run(l,function(r){var q,n;q=d(o,"string")?j.doc.createElement(o):o;j.setAttribs(q,i);if(k){if(k.nodeType){q.appendChild(k)}else{j.setHTML(q,k)}}return !m?r.appendChild(q):q})},create:function(k,i,j){return this.add(this.doc.createElement(k),k,i,j,1)},createHTML:function(q,i,m){var p="",l=this,j;p+="<"+q;for(j in i){if(i.hasOwnProperty(j)){p+=" "+j+'="'+l.encode(i[j])+'"'}}if(typeof(m)!="undefined"){return p+">"+m+""}return p+" />"},remove:function(i,j){return this.run(i,function(l){var m,k=l.parentNode;if(!k){return null}if(j){while(m=l.firstChild){if(!e.isIE||m.nodeType!==3||m.nodeValue){k.insertBefore(m,l)}else{l.removeChild(m)}}}return k.removeChild(l)})},setStyle:function(l,i,j){var k=this;return k.run(l,function(o){var n,m;n=o.style;i=i.replace(/-(\D)/g,function(q,p){return p.toUpperCase()});if(k.pixelStyles.test(i)&&(e.is(j,"number")||/^[\-0-9\.]+$/.test(j))){j+="px"}switch(i){case"opacity":if(b){n.filter=j===""?"":"alpha(opacity="+(j*100)+")";if(!l.currentStyle||!l.currentStyle.hasLayout){n.display="inline-block"}}n[i]=n["-moz-opacity"]=n["-khtml-opacity"]=j||"";break;case"float":b?n.styleFloat=j:n.cssFloat=j;break;default:n[i]=j||""}if(k.settings.update_styles){k.setAttrib(o,"data-mce-style")}})},getStyle:function(l,i,k){l=this.get(l);if(!l){return}if(this.doc.defaultView&&k){i=i.replace(/[A-Z]/g,function(m){return"-"+m});try{return this.doc.defaultView.getComputedStyle(l,null).getPropertyValue(i)}catch(j){return null}}i=i.replace(/-(\D)/g,function(n,m){return m.toUpperCase()});if(i=="float"){i=b?"styleFloat":"cssFloat"}if(l.currentStyle&&k){return l.currentStyle[i]}return l.style?l.style[i]:undefined},setStyles:function(l,m){var j=this,k=j.settings,i;i=k.update_styles;k.update_styles=0;g(m,function(o,p){j.setStyle(l,p,o)});k.update_styles=i;if(k.update_styles){j.setAttrib(l,k.cssText)}},removeAllAttribs:function(i){return this.run(i,function(l){var k,j=l.attributes;for(k=j.length-1;k>=0;k--){l.removeAttributeNode(j.item(k))}})},setAttrib:function(k,l,i){var j=this;if(!k||!l){return}if(j.settings.strict){l=l.toLowerCase()}return this.run(k,function(p){var o=j.settings;var m=p.getAttribute(l);if(i!==null){switch(l){case"style":if(!d(i,"string")){g(i,function(q,r){j.setStyle(p,r,q)});return}if(o.keep_values){if(i&&!j._isRes(i)){p.setAttribute("data-mce-style",i,2)}else{p.removeAttribute("data-mce-style",2)}}p.style.cssText=i;break;case"class":p.className=i||"";break;case"src":case"href":if(o.keep_values){if(o.url_converter){i=o.url_converter.call(o.url_converter_scope||j,i,l,p)}j.setAttrib(p,"data-mce-"+l,i,2)}break;case"shape":p.setAttribute("data-mce-style",i);break}}if(d(i)&&i!==null&&i.length!==0){p.setAttribute(l,""+i,2)}else{p.removeAttribute(l,2)}if(tinyMCE.activeEditor&&m!=i){var n=tinyMCE.activeEditor;n.onSetAttrib.dispatch(n,p,l,i)}})},setAttribs:function(j,k){var i=this;return this.run(j,function(l){g(k,function(m,o){i.setAttrib(l,o,m)})})},getAttrib:function(m,o,k){var i,j=this,l;m=j.get(m);if(!m||m.nodeType!==1){return k===l?false:k}if(!d(k)){k=""}if(/^(src|href|style|coords|shape)$/.test(o)){i=m.getAttribute("data-mce-"+o);if(i){return i}}if(b&&j.props[o]){i=m[j.props[o]];i=i&&i.nodeValue?i.nodeValue:i}if(!i){i=m.getAttribute(o,2)}if(/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(o)){if(m[j.props[o]]===true&&i===""){return o}return i?o:""}if(m.nodeName==="FORM"&&m.getAttributeNode(o)){return m.getAttributeNode(o).nodeValue}if(o==="style"){i=i||m.style.cssText;if(i){i=j.serializeStyle(j.parseStyle(i),m.nodeName);if(j.settings.keep_values&&!j._isRes(i)){m.setAttribute("data-mce-style",i)}}}if(f&&o==="class"&&i){i=i.replace(/(apple|webkit)\-[a-z\-]+/gi,"")}if(b){switch(o){case"rowspan":case"colspan":if(i===1){i=""}break;case"size":if(i==="+0"||i===20||i===0){i=""}break;case"width":case"height":case"vspace":case"checked":case"disabled":case"readonly":if(i===0){i=""}break;case"hspace":if(i===-1){i=""}break;case"maxlength":case"tabindex":if(i===32768||i===2147483647||i==="32768"){i=""}break;case"multiple":case"compact":case"noshade":case"nowrap":if(i===65535){return o}return k;case"shape":i=i.toLowerCase();break;default:if(o.indexOf("on")===0&&i){i=e._replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/,"$1",""+i)}}}return(i!==l&&i!==null&&i!=="")?""+i:k},getPos:function(q,l){var j=this,i=0,p=0,m,o=j.doc,k;q=j.get(q);l=l||o.body;if(q){if(q.getBoundingClientRect){q=q.getBoundingClientRect();m=j.boxModel?o.documentElement:o.body;i=q.left+(o.documentElement.scrollLeft||o.body.scrollLeft)-m.clientTop;p=q.top+(o.documentElement.scrollTop||o.body.scrollTop)-m.clientLeft;return{x:i,y:p}}k=q;while(k&&k!=l&&k.nodeType){i+=k.offsetLeft||0;p+=k.offsetTop||0;k=k.offsetParent}k=q.parentNode;while(k&&k!=l&&k.nodeType){i-=k.scrollLeft||0;p-=k.scrollTop||0;k=k.parentNode}}return{x:i,y:p}},parseStyle:function(i){return this.styles.parse(i)},serializeStyle:function(j,i){return this.styles.serialize(j,i)},loadCSS:function(i){var k=this,l=k.doc,j;if(!i){i=""}j=l.getElementsByTagName("head")[0];g(i.split(","),function(m){var n;if(k.files[m]){return}k.files[m]=true;n=k.create("link",{rel:"stylesheet",href:e._addVer(m)});if(b&&l.documentMode&&l.recalc){n.onload=function(){if(l.recalc){l.recalc()}n.onload=null}}j.appendChild(n)})},addClass:function(i,j){return this.run(i,function(k){var l;if(!j){return 0}if(this.hasClass(k,j)){return k.className}l=this.removeClass(k,j);return k.className=(l!=""?(l+" "):"")+j})},removeClass:function(k,l){var i=this,j;return i.run(k,function(n){var m;if(i.hasClass(n,l)){if(!j){j=new RegExp("(^|\\s+)"+l+"(\\s+|$)","g")}m=n.className.replace(j," ");m=e.trim(m!=" "?m:"");n.className=m;if(!m){n.removeAttribute("class");n.removeAttribute("className")}return m}return n.className})},hasClass:function(j,i){j=this.get(j);if(!j||!i){return false}return(" "+j.className+" ").indexOf(" "+i+" ")!==-1},show:function(i){return this.setStyle(i,"display","block")},hide:function(i){return this.setStyle(i,"display","none")},isHidden:function(i){i=this.get(i);return !i||i.style.display=="none"||this.getStyle(i,"display")=="none"},uniqueId:function(i){return(!i?"mce_":i)+(this.counter++)},setHTML:function(k,j){var i=this;return i.run(k,function(m){if(b){while(m.firstChild){m.removeChild(m.firstChild)}try{m.innerHTML="
                    "+j;m.removeChild(m.firstChild)}catch(l){m=i.create("div");m.innerHTML="
                    "+j;g(m.childNodes,function(o,n){if(n){m.appendChild(o)}})}}else{m.innerHTML=j}return j})},getOuterHTML:function(k){var j,i=this;k=i.get(k);if(!k){return null}if(k.nodeType===1&&i.hasOuterHTML){return k.outerHTML}j=(k.ownerDocument||i.doc).createElement("body");j.appendChild(k.cloneNode(true));return j.innerHTML},setOuterHTML:function(l,j,m){var i=this;function k(p,o,r){var s,q;q=r.createElement("body");q.innerHTML=o;s=q.lastChild;while(s){i.insertAfter(s.cloneNode(true),p);s=s.previousSibling}i.remove(p)}return this.run(l,function(o){o=i.get(o);if(o.nodeType==1){m=m||o.ownerDocument||i.doc;if(b){try{if(b&&o.nodeType==1){o.outerHTML=j}else{k(o,j,m)}}catch(n){k(o,j,m)}}else{k(o,j,m)}}})},decode:h.decode,encode:h.encodeAllRaw,insertAfter:function(i,j){j=this.get(j);return this.run(i,function(l){var k,m;k=j.parentNode;m=j.nextSibling;if(m){k.insertBefore(l,m)}else{k.appendChild(l)}return l})},replace:function(m,l,i){var j=this;if(d(l,"array")){m=m.cloneNode(true)}return j.run(l,function(k){if(i){g(e.grep(k.childNodes),function(n){m.appendChild(n)})}return k.parentNode.replaceChild(m,k)})},rename:function(l,i){var k=this,j;if(l.nodeName!=i.toUpperCase()){j=k.create(i);g(k.getAttribs(l),function(m){k.setAttrib(j,m.nodeName,k.getAttrib(l,m.nodeName))});k.replace(j,l,1)}return j||l},findCommonAncestor:function(k,i){var l=k,j;while(l){j=i;while(j&&l!=j){j=j.parentNode}if(l==j){break}l=l.parentNode}if(!l&&k.ownerDocument){return k.ownerDocument.documentElement}return l},toHex:function(i){var k=/^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(i);function j(l){l=parseInt(l,10).toString(16);return l.length>1?l:"0"+l}if(k){i="#"+j(k[1])+j(k[2])+j(k[3]);return i}return i},getClasses:function(){var n=this,j=[],m,o={},p=n.settings.class_filter,l;if(n.classes){return n.classes}function q(i){g(i.imports,function(s){q(s)});g(i.cssRules||i.rules,function(s){switch(s.type||1){case 1:if(s.selectorText){g(s.selectorText.split(","),function(r){r=r.replace(/^\s*|\s*$|^\s\./g,"");if(/\.mce/.test(r)||!/\.[\w\-]+$/.test(r)){return}l=r;r=e._replace(/.*\.([a-z0-9_\-]+).*/i,"$1",r);if(p&&!(r=p(r,l))){return}if(!o[r]){j.push({"class":r});o[r]=1}})}break;case 3:q(s.styleSheet);break}})}try{g(n.doc.styleSheets,q)}catch(k){}if(j.length>0){n.classes=j}return j},run:function(l,k,j){var i=this,m;if(i.doc&&typeof(l)==="string"){l=i.get(l)}if(!l){return false}j=j||this;if(!l.nodeType&&(l.length||l.length===0)){m=[];g(l,function(o,n){if(o){if(typeof(o)=="string"){o=i.doc.getElementById(o)}m.push(k.call(j,o,n))}});return m}return k.call(j,l)},getAttribs:function(j){var i;j=this.get(j);if(!j){return[]}if(b){i=[];if(j.nodeName=="OBJECT"){return j.attributes}if(j.nodeName==="OPTION"&&this.getAttrib(j,"selected")){i.push({specified:1,nodeName:"selected"})}j.cloneNode(false).outerHTML.replace(/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi,"").replace(/[\w:\-]+/gi,function(k){i.push({specified:1,nodeName:k})});return i}return j.attributes},isEmpty:function(m,k){var r=this,o,n,q,j,l,p=0;m=m.firstChild;if(m){j=new e.dom.TreeWalker(m,m.parentNode);k=k||r.schema?r.schema.getNonEmptyElements():null;do{q=m.nodeType;if(q===1){if(m.getAttribute("data-mce-bogus")){continue}l=m.nodeName.toLowerCase();if(k&&k[l]){if(l==="br"){p++;continue}return false}n=r.getAttribs(m);o=m.attributes.length;while(o--){l=m.attributes[o].nodeName;if(l==="name"||l==="data-mce-bookmark"){return false}}}if(q==8){return false}if((q===3&&!a.test(m.nodeValue))){return false}}while(m=j.next())}return p<=1},destroy:function(j){var i=this;i.win=i.doc=i.root=i.events=i.frag=null;if(!j){e.removeUnload(i.destroy)}},createRng:function(){var i=this.doc;return i.createRange?i.createRange():new e.dom.Range(this)},nodeIndex:function(m,n){var i=0,k,l,j;if(m){for(k=m.nodeType,m=m.previousSibling,l=m;m;m=m.previousSibling){j=m.nodeType;if(n&&j==3){if(j==k||!m.nodeValue.length){continue}}i++;k=j}}return i},split:function(m,l,p){var q=this,i=q.createRng(),n,k,o;function j(v){var t,s=v.childNodes,u=v.nodeType;function x(A){var z=A.previousSibling&&A.previousSibling.nodeName=="SPAN";var y=A.nextSibling&&A.nextSibling.nodeName=="SPAN";return z&&y}if(u==1&&v.getAttribute("data-mce-type")=="bookmark"){return}for(t=s.length-1;t>=0;t--){j(s[t])}if(u!=9){if(u==3&&v.nodeValue.length>0){var r=e.trim(v.nodeValue).length;if(!q.isBlock(v.parentNode)||r>0||r===0&&x(v)){return}}else{if(u==1){s=v.childNodes;if(s.length==1&&s[0]&&s[0].nodeType==1&&s[0].getAttribute("data-mce-type")=="bookmark"){v.parentNode.insertBefore(s[0],v)}if(s.length||/^(br|hr|input|img)$/i.test(v.nodeName)){return}}}q.remove(v)}return v}if(m&&l){i.setStart(m.parentNode,q.nodeIndex(m));i.setEnd(l.parentNode,q.nodeIndex(l));n=i.extractContents();i=q.createRng();i.setStart(l.parentNode,q.nodeIndex(l)+1);i.setEnd(m.parentNode,q.nodeIndex(m)+1);k=i.extractContents();o=m.parentNode;o.insertBefore(j(n),m);if(p){o.replaceChild(p,l)}else{o.insertBefore(l,m)}o.insertBefore(j(k),m);q.remove(m);return p||l}},bind:function(l,i,k,j){return this.events.add(l,i,k,j||this)},unbind:function(k,i,j){return this.events.remove(k,i,j)},fire:function(k,j,i){return this.events.fire(k,j,i)},getContentEditable:function(j){var i;if(j.nodeType!=1){return null}i=j.getAttribute("data-mce-contenteditable");if(i&&i!=="inherit"){return i}return j.contentEditable!=="inherit"?j.contentEditable:null},_findSib:function(l,i,j){var k=this,m=i;if(l){if(d(m,"string")){m=function(n){return k.is(n,i)}}for(l=l[j];l;l=l[j]){if(m(l)){return l}}}return null},_isRes:function(i){return/^(top|left|bottom|right|width|height)/i.test(i)||/;\s*(top|left|bottom|right|width|height)/i.test(i)}});e.DOM=new e.dom.DOMUtils(document,{process_html:0})})(tinymce);(function(a){function b(c){var O=this,e=c.doc,U=0,F=1,j=2,E=true,S=false,W="startOffset",h="startContainer",Q="endContainer",A="endOffset",k=tinymce.extend,n=c.nodeIndex;k(O,{startContainer:e,startOffset:0,endContainer:e,endOffset:0,collapsed:E,commonAncestorContainer:e,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:q,setEnd:s,setStartBefore:g,setStartAfter:J,setEndBefore:K,setEndAfter:u,collapse:B,selectNode:y,selectNodeContents:G,compareBoundaryPoints:v,deleteContents:p,extractContents:I,cloneContents:d,insertNode:D,surroundContents:N,cloneRange:L,toStringIE:T});function x(){return e.createDocumentFragment()}function q(X,t){C(E,X,t)}function s(X,t){C(S,X,t)}function g(t){q(t.parentNode,n(t))}function J(t){q(t.parentNode,n(t)+1)}function K(t){s(t.parentNode,n(t))}function u(t){s(t.parentNode,n(t)+1)}function B(t){if(t){O[Q]=O[h];O[A]=O[W]}else{O[h]=O[Q];O[W]=O[A]}O.collapsed=E}function y(t){g(t);u(t)}function G(t){q(t,0);s(t,t.nodeType===1?t.childNodes.length:t.nodeValue.length)}function v(aa,t){var ad=O[h],Y=O[W],ac=O[Q],X=O[A],ab=t.startContainer,af=t.startOffset,Z=t.endContainer,ae=t.endOffset;if(aa===0){return H(ad,Y,ab,af)}if(aa===1){return H(ac,X,ab,af)}if(aa===2){return H(ac,X,Z,ae)}if(aa===3){return H(ad,Y,Z,ae)}}function p(){l(j)}function I(){return l(U)}function d(){return l(F)}function D(aa){var X=this[h],t=this[W],Z,Y;if((X.nodeType===3||X.nodeType===4)&&X.nodeValue){if(!t){X.parentNode.insertBefore(aa,X)}else{if(t>=X.nodeValue.length){c.insertAfter(aa,X)}else{Z=X.splitText(t);X.parentNode.insertBefore(aa,Z)}}}else{if(X.childNodes.length>0){Y=X.childNodes[t]}if(Y){X.insertBefore(aa,Y)}else{X.appendChild(aa)}}}function N(X){var t=O.extractContents();O.insertNode(X);X.appendChild(t);O.selectNode(X)}function L(){return k(new b(c),{startContainer:O[h],startOffset:O[W],endContainer:O[Q],endOffset:O[A],collapsed:O.collapsed,commonAncestorContainer:O.commonAncestorContainer})}function P(t,X){var Y;if(t.nodeType==3){return t}if(X<0){return t}Y=t.firstChild;while(Y&&X>0){--X;Y=Y.nextSibling}if(Y){return Y}return t}function m(){return(O[h]==O[Q]&&O[W]==O[A])}function H(Z,ab,X,aa){var ac,Y,t,ad,af,ae;if(Z==X){if(ab==aa){return 0}if(ab0){O.collapse(X)}}else{O.collapse(X)}O.collapsed=m();O.commonAncestorContainer=c.findCommonAncestor(O[h],O[Q])}function l(ad){var ac,Z=0,af=0,X,ab,Y,aa,t,ae;if(O[h]==O[Q]){return f(ad)}for(ac=O[Q],X=ac.parentNode;X;ac=X,X=X.parentNode){if(X==O[h]){return r(ac,ad)}++Z}for(ac=O[h],X=ac.parentNode;X;ac=X,X=X.parentNode){if(X==O[Q]){return V(ac,ad)}++af}ab=af-Z;Y=O[h];while(ab>0){Y=Y.parentNode;ab--}aa=O[Q];while(ab<0){aa=aa.parentNode;ab++}for(t=Y.parentNode,ae=aa.parentNode;t!=ae;t=t.parentNode,ae=ae.parentNode){Y=t;aa=ae}return o(Y,aa,ad)}function f(ac){var ae,af,t,Y,Z,ad,aa,X,ab;if(ac!=j){ae=x()}if(O[W]==O[A]){return ae}if(O[h].nodeType==3){af=O[h].nodeValue;t=af.substring(O[W],O[A]);if(ac!=F){Y=O[h];X=O[W];ab=O[A]-O[W];if(X===0&&ab>=Y.nodeValue.length-1){Y.parentNode.removeChild(Y)}else{Y.deleteData(X,ab)}O.collapse(E)}if(ac==j){return}if(t.length>0){ae.appendChild(e.createTextNode(t))}return ae}Y=P(O[h],O[W]);Z=O[A]-O[W];while(Y&&Z>0){ad=Y.nextSibling;aa=z(Y,ac);if(ae){ae.appendChild(aa)}--Z;Y=ad}if(ac!=F){O.collapse(E)}return ae}function r(ad,aa){var ac,ab,X,t,Z,Y;if(aa!=j){ac=x()}ab=i(ad,aa);if(ac){ac.appendChild(ab)}X=n(ad);t=X-O[W];if(t<=0){if(aa!=F){O.setEndBefore(ad);O.collapse(S)}return ac}ab=ad.previousSibling;while(t>0){Z=ab.previousSibling;Y=z(ab,aa);if(ac){ac.insertBefore(Y,ac.firstChild)}--t;ab=Z}if(aa!=F){O.setEndBefore(ad);O.collapse(S)}return ac}function V(ab,aa){var ad,X,ac,t,Z,Y;if(aa!=j){ad=x()}ac=R(ab,aa);if(ad){ad.appendChild(ac)}X=n(ab);++X;t=O[A]-X;ac=ab.nextSibling;while(ac&&t>0){Z=ac.nextSibling;Y=z(ac,aa);if(ad){ad.appendChild(Y)}--t;ac=Z}if(aa!=F){O.setStartAfter(ab);O.collapse(E)}return ad}function o(ab,t,ae){var Y,ag,aa,ac,ad,X,af,Z;if(ae!=j){ag=x()}Y=R(ab,ae);if(ag){ag.appendChild(Y)}aa=ab.parentNode;ac=n(ab);ad=n(t);++ac;X=ad-ac;af=ab.nextSibling;while(X>0){Z=af.nextSibling;Y=z(af,ae);if(ag){ag.appendChild(Y)}af=Z;--X}Y=i(t,ae);if(ag){ag.appendChild(Y)}if(ae!=F){O.setStartAfter(ab);O.collapse(E)}return ag}function i(ac,ad){var Y=P(O[Q],O[A]-1),ae,ab,aa,t,X,Z=Y!=O[Q];if(Y==ac){return M(Y,Z,S,ad)}ae=Y.parentNode;ab=M(ae,S,S,ad);while(ae){while(Y){aa=Y.previousSibling;t=M(Y,Z,S,ad);if(ad!=j){ab.insertBefore(t,ab.firstChild)}Z=E;Y=aa}if(ae==ac){return ab}Y=ae.previousSibling;ae=ae.parentNode;X=M(ae,S,S,ad);if(ad!=j){X.appendChild(ab)}ab=X}}function R(ac,ad){var Z=P(O[h],O[W]),aa=Z!=O[h],ae,ab,Y,t,X;if(Z==ac){return M(Z,aa,E,ad)}ae=Z.parentNode;ab=M(ae,S,E,ad);while(ae){while(Z){Y=Z.nextSibling;t=M(Z,aa,E,ad);if(ad!=j){ab.appendChild(t)}aa=E;Z=Y}if(ae==ac){return ab}Z=ae.nextSibling;ae=ae.parentNode;X=M(ae,S,E,ad);if(ad!=j){X.appendChild(ab)}ab=X}}function M(t,aa,ad,ae){var Z,Y,ab,X,ac;if(aa){return z(t,ae)}if(t.nodeType==3){Z=t.nodeValue;if(ad){X=O[W];Y=Z.substring(X);ab=Z.substring(0,X)}else{X=O[A];Y=Z.substring(0,X);ab=Z.substring(X)}if(ae!=F){t.nodeValue=ab}if(ae==j){return}ac=c.clone(t,S);ac.nodeValue=Y;return ac}if(ae==j){return}return c.clone(t,S)}function z(X,t){if(t!=j){return t==F?c.clone(X,E):X}X.parentNode.removeChild(X)}function T(){return c.create("body",null,d()).outerText}return O}a.Range=b;b.prototype.toString=function(){return this.toStringIE()}})(tinymce.dom);(function(){function a(d){var b=this,h=d.dom,c=true,f=false;function e(i,j){var k,t=0,q,n,m,l,o,r,p=-1,s;k=i.duplicate();k.collapse(j);s=k.parentElement();if(s.ownerDocument!==d.dom.doc){return}while(s.contentEditable==="false"){s=s.parentNode}if(!s.hasChildNodes()){return{node:s,inside:1}}m=s.children;q=m.length-1;while(t<=q){r=Math.floor((t+q)/2);l=m[r];k.moveToElementText(l);p=k.compareEndPoints(j?"StartToStart":"EndToEnd",i);if(p>0){q=r-1}else{if(p<0){t=r+1}else{return{node:l}}}}if(p<0){if(!l){k.moveToElementText(s);k.collapse(true);l=s;n=true}else{k.collapse(false)}o=0;while(k.compareEndPoints(j?"StartToStart":"StartToEnd",i)!==0){if(k.move("character",1)===0||s!=k.parentElement()){break}o++}}else{k.collapse(true);o=0;while(k.compareEndPoints(j?"StartToStart":"StartToEnd",i)!==0){if(k.move("character",-1)===0||s!=k.parentElement()){break}o++}}return{node:l,position:p,offset:o,inside:n}}function g(){var i=d.getRng(),r=h.createRng(),l,k,p,q,m,j;l=i.item?i.item(0):i.parentElement();if(l.ownerDocument!=h.doc){return r}k=d.isCollapsed();if(i.item){r.setStart(l.parentNode,h.nodeIndex(l));r.setEnd(r.startContainer,r.startOffset+1);return r}function o(A){var u=e(i,A),s,y,z=0,x,v,t;s=u.node;y=u.offset;if(u.inside&&!s.hasChildNodes()){r[A?"setStart":"setEnd"](s,0);return}if(y===v){r[A?"setStartBefore":"setEndAfter"](s);return}if(u.position<0){x=u.inside?s.firstChild:s.nextSibling;if(!x){r[A?"setStartAfter":"setEndAfter"](s);return}if(!y){if(x.nodeType==3){r[A?"setStart":"setEnd"](x,0)}else{r[A?"setStartBefore":"setEndBefore"](x)}return}while(x){t=x.nodeValue;z+=t.length;if(z>=y){s=x;z-=y;z=t.length-z;break}x=x.nextSibling}}else{x=s.previousSibling;if(!x){return r[A?"setStartBefore":"setEndBefore"](s)}if(!y){if(s.nodeType==3){r[A?"setStart":"setEnd"](x,s.nodeValue.length)}else{r[A?"setStartAfter":"setEndAfter"](x)}return}while(x){z+=x.nodeValue.length;if(z>=y){s=x;z-=y;break}x=x.previousSibling}}r[A?"setStart":"setEnd"](s,z)}try{o(true);if(!k){o()}}catch(n){if(n.number==-2147024809){m=b.getBookmark(2);p=i.duplicate();p.collapse(true);l=p.parentElement();if(!k){p=i.duplicate();p.collapse(false);q=p.parentElement();q.innerHTML=q.innerHTML}l.innerHTML=l.innerHTML;b.moveToBookmark(m);i=d.getRng();o(true);if(!k){o()}}else{throw n}}return r}this.getBookmark=function(m){var j=d.getRng(),o,i,l={};function n(u){var t,p,s,r,q=[];t=u.parentNode;p=h.getRoot().parentNode;while(t!=p&&t.nodeType!==9){s=t.children;r=s.length;while(r--){if(u===s[r]){q.push(r);break}}u=t;t=t.parentNode}return q}function k(q){var p;p=e(j,q);if(p){return{position:p.position,offset:p.offset,indexes:n(p.node),inside:p.inside}}}if(m===2){if(!j.item){l.start=k(true);if(!d.isCollapsed()){l.end=k()}}else{l.start={ctrl:true,indexes:n(j.item(0))}}}return l};this.moveToBookmark=function(k){var j,i=h.doc.body;function m(o){var r,q,n,p;r=h.getRoot();for(q=o.length-1;q>=0;q--){p=r.children;n=o[q];if(n<=p.length-1){r=p[n]}}return r}function l(r){var n=k[r?"start":"end"],q,p,o;if(n){q=n.position>0;p=i.createTextRange();p.moveToElementText(m(n.indexes));offset=n.offset;if(offset!==o){p.collapse(n.inside||q);p.moveStart("character",q?-offset:offset)}else{p.collapse(r)}j.setEndPoint(r?"StartToStart":"EndToStart",p);if(r){j.collapse(true)}}}if(k.start){if(k.start.ctrl){j=i.createControlRange();j.addElement(m(k.start.indexes));j.select()}else{j=i.createTextRange();l(true);l();j.select()}}};this.addRange=function(i){var n,l,k,p,t,q,s,r=d.dom.doc,m=r.body;function j(A){var v,z,u,y,x;u=h.create("a");v=A?k:t;z=A?p:q;y=n.duplicate();if(v==r||v==r.documentElement){v=m;z=0}if(v.nodeType==3){v.parentNode.insertBefore(u,v);y.moveToElementText(u);y.moveStart("character",z);h.remove(u);n.setEndPoint(A?"StartToStart":"EndToEnd",y)}else{x=v.childNodes;if(x.length){if(z>=x.length){h.insertAfter(u,x[x.length-1])}else{v.insertBefore(u,x[z])}y.moveToElementText(u)}else{if(v.canHaveHTML){v.innerHTML="\uFEFF";u=v.firstChild;y.moveToElementText(u);y.collapse(f)}}n.setEndPoint(A?"StartToStart":"EndToEnd",y);h.remove(u)}}k=i.startContainer;p=i.startOffset;t=i.endContainer;q=i.endOffset;n=m.createTextRange();if(k==t&&k.nodeType==1){if(p==q&&!k.hasChildNodes()){if(k.canHaveHTML){s=k.previousSibling;if(s&&!s.hasChildNodes()&&h.isBlock(s)){s.innerHTML="\uFEFF"}else{s=null}k.innerHTML="\uFEFF\uFEFF";n.moveToElementText(k.lastChild);n.select();h.doc.selection.clear();k.innerHTML="";if(s){s.innerHTML=""}return}else{p=h.nodeIndex(k);k=k.parentNode}}if(p==q-1){try{l=m.createControlRange();l.addElement(k.childNodes[p]);l.select();return}catch(o){}}}j(true);j();n.select()};this.getRangeAt=g}tinymce.dom.TridentSelection=a})();(function(){var n=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,i="sizcache",o=0,r=Object.prototype.toString,h=false,g=true,q=/\\/g,u=/\r\n/g,x=/\W/;[0,0].sort(function(){g=false;return 0});var d=function(C,e,F,G){F=F||[];e=e||document;var I=e;if(e.nodeType!==1&&e.nodeType!==9){return[]}if(!C||typeof C!=="string"){return F}var z,K,N,y,J,M,L,E,B=true,A=d.isXML(e),D=[],H=C;do{n.exec("");z=n.exec(H);if(z){H=z[3];D.push(z[1]);if(z[2]){y=z[3];break}}}while(z);if(D.length>1&&j.exec(C)){if(D.length===2&&k.relative[D[0]]){K=s(D[0]+D[1],e,G)}else{K=k.relative[D[0]]?[e]:d(D.shift(),e);while(D.length){C=D.shift();if(k.relative[C]){C+=D.shift()}K=s(C,K,G)}}}else{if(!G&&D.length>1&&e.nodeType===9&&!A&&k.match.ID.test(D[0])&&!k.match.ID.test(D[D.length-1])){J=d.find(D.shift(),e,A);e=J.expr?d.filter(J.expr,J.set)[0]:J.set[0]}if(e){J=G?{expr:D.pop(),set:l(G)}:d.find(D.pop(),D.length===1&&(D[0]==="~"||D[0]==="+")&&e.parentNode?e.parentNode:e,A);K=J.expr?d.filter(J.expr,J.set):J.set;if(D.length>0){N=l(K)}else{B=false}while(D.length){M=D.pop();L=M;if(!k.relative[M]){M=""}else{L=D.pop()}if(L==null){L=e}k.relative[M](N,L,A)}}else{N=D=[]}}if(!N){N=K}if(!N){d.error(M||C)}if(r.call(N)==="[object Array]"){if(!B){F.push.apply(F,N)}else{if(e&&e.nodeType===1){for(E=0;N[E]!=null;E++){if(N[E]&&(N[E]===true||N[E].nodeType===1&&d.contains(e,N[E]))){F.push(K[E])}}}else{for(E=0;N[E]!=null;E++){if(N[E]&&N[E].nodeType===1){F.push(K[E])}}}}}else{l(N,F)}if(y){d(y,I,F,G);d.uniqueSort(F)}return F};d.uniqueSort=function(y){if(p){h=g;y.sort(p);if(h){for(var e=1;e0};d.find=function(E,e,F){var D,z,B,A,C,y;if(!E){return[]}for(z=0,B=k.order.length;z":function(D,y){var C,B=typeof y==="string",z=0,e=D.length;if(B&&!x.test(y)){y=y.toLowerCase();for(;z=0)){if(!z){e.push(C)}}else{if(z){y[B]=false}}}}return false},ID:function(e){return e[1].replace(q,"")},TAG:function(y,e){return y[1].replace(q,"").toLowerCase()},CHILD:function(e){if(e[1]==="nth"){if(!e[2]){d.error(e[0])}e[2]=e[2].replace(/^\+|\s*/g,"");var y=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(e[2]==="even"&&"2n"||e[2]==="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(y[1]+(y[2]||1))-0;e[3]=y[3]-0}else{if(e[2]){d.error(e[0])}}e[0]=o++;return e},ATTR:function(B,y,z,e,C,D){var A=B[1]=B[1].replace(q,"");if(!D&&k.attrMap[A]){B[1]=k.attrMap[A]}B[4]=(B[4]||B[5]||"").replace(q,"");if(B[2]==="~="){B[4]=" "+B[4]+" "}return B},PSEUDO:function(B,y,z,e,C){if(B[1]==="not"){if((n.exec(B[3])||"").length>1||/^\w/.test(B[3])){B[3]=d(B[3],null,null,y)}else{var A=d.filter(B[3],y,z,true^C);if(!z){e.push.apply(e,A)}return false}}else{if(k.match.POS.test(B[0])||k.match.CHILD.test(B[0])){return true}}return B},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){if(e.parentNode){e.parentNode.selectedIndex}return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(z,y,e){return !!d(e[3],z).length},header:function(e){return(/h\d/i).test(e.nodeName)},text:function(z){var e=z.getAttribute("type"),y=z.type;return z.nodeName.toLowerCase()==="input"&&"text"===y&&(e===y||e===null)},radio:function(e){return e.nodeName.toLowerCase()==="input"&&"radio"===e.type},checkbox:function(e){return e.nodeName.toLowerCase()==="input"&&"checkbox"===e.type},file:function(e){return e.nodeName.toLowerCase()==="input"&&"file"===e.type},password:function(e){return e.nodeName.toLowerCase()==="input"&&"password"===e.type},submit:function(y){var e=y.nodeName.toLowerCase();return(e==="input"||e==="button")&&"submit"===y.type},image:function(e){return e.nodeName.toLowerCase()==="input"&&"image"===e.type},reset:function(y){var e=y.nodeName.toLowerCase();return(e==="input"||e==="button")&&"reset"===y.type},button:function(y){var e=y.nodeName.toLowerCase();return e==="input"&&"button"===y.type||e==="button"},input:function(e){return(/input|select|textarea|button/i).test(e.nodeName)},focus:function(e){return e===e.ownerDocument.activeElement}},setFilters:{first:function(y,e){return e===0},last:function(z,y,e,A){return y===A.length-1},even:function(y,e){return e%2===0},odd:function(y,e){return e%2===1},lt:function(z,y,e){return ye[3]-0},nth:function(z,y,e){return e[3]-0===y},eq:function(z,y,e){return e[3]-0===y}},filter:{PSEUDO:function(z,E,D,F){var e=E[1],y=k.filters[e];if(y){return y(z,D,E,F)}else{if(e==="contains"){return(z.textContent||z.innerText||b([z])||"").indexOf(E[3])>=0}else{if(e==="not"){var A=E[3];for(var C=0,B=A.length;C=0)}}},ID:function(y,e){return y.nodeType===1&&y.getAttribute("id")===e},TAG:function(y,e){return(e==="*"&&y.nodeType===1)||!!y.nodeName&&y.nodeName.toLowerCase()===e},CLASS:function(y,e){return(" "+(y.className||y.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(C,A){var z=A[1],e=d.attr?d.attr(C,z):k.attrHandle[z]?k.attrHandle[z](C):C[z]!=null?C[z]:C.getAttribute(z),D=e+"",B=A[2],y=A[4];return e==null?B==="!=":!B&&d.attr?e!=null:B==="="?D===y:B==="*="?D.indexOf(y)>=0:B==="~="?(" "+D+" ").indexOf(y)>=0:!y?D&&e!==false:B==="!="?D!==y:B==="^="?D.indexOf(y)===0:B==="$="?D.substr(D.length-y.length)===y:B==="|="?D===y||D.substr(0,y.length+1)===y+"-":false},POS:function(B,y,z,C){var e=y[2],A=k.setFilters[e];if(A){return A(B,z,y,C)}}}};var j=k.match.POS,c=function(y,e){return"\\"+(e-0+1)};for(var f in k.match){k.match[f]=new RegExp(k.match[f].source+(/(?![^\[]*\])(?![^\(]*\))/.source));k.leftMatch[f]=new RegExp(/(^(?:.|\r|\n)*?)/.source+k.match[f].source.replace(/\\(\d+)/g,c))}k.match.globalPOS=j;var l=function(y,e){y=Array.prototype.slice.call(y,0);if(e){e.push.apply(e,y);return e}return y};try{Array.prototype.slice.call(document.documentElement.childNodes,0)[0].nodeType}catch(v){l=function(B,A){var z=0,y=A||[];if(r.call(B)==="[object Array]"){Array.prototype.push.apply(y,B)}else{if(typeof B.length==="number"){for(var e=B.length;z";e.insertBefore(y,e.firstChild);if(document.getElementById(z)){k.find.ID=function(B,C,D){if(typeof C.getElementById!=="undefined"&&!D){var A=C.getElementById(B[1]);return A?A.id===B[1]||typeof A.getAttributeNode!=="undefined"&&A.getAttributeNode("id").nodeValue===B[1]?[A]:undefined:[]}};k.filter.ID=function(C,A){var B=typeof C.getAttributeNode!=="undefined"&&C.getAttributeNode("id");return C.nodeType===1&&B&&B.nodeValue===A}}e.removeChild(y);e=y=null})();(function(){var e=document.createElement("div");e.appendChild(document.createComment(""));if(e.getElementsByTagName("*").length>0){k.find.TAG=function(y,C){var B=C.getElementsByTagName(y[1]);if(y[1]==="*"){var A=[];for(var z=0;B[z];z++){if(B[z].nodeType===1){A.push(B[z])}}B=A}return B}}e.innerHTML="
                    ";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){k.attrHandle.href=function(y){return y.getAttribute("href",2)}}e=null})();if(document.querySelectorAll){(function(){var e=d,A=document.createElement("div"),z="__sizzle__";A.innerHTML="

                    ";if(A.querySelectorAll&&A.querySelectorAll(".TEST").length===0){return}d=function(L,C,G,K){C=C||document;if(!K&&!d.isXML(C)){var J=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(L);if(J&&(C.nodeType===1||C.nodeType===9)){if(J[1]){return l(C.getElementsByTagName(L),G)}else{if(J[2]&&k.find.CLASS&&C.getElementsByClassName){return l(C.getElementsByClassName(J[2]),G)}}}if(C.nodeType===9){if(L==="body"&&C.body){return l([C.body],G)}else{if(J&&J[3]){var F=C.getElementById(J[3]);if(F&&F.parentNode){if(F.id===J[3]){return l([F],G)}}else{return l([],G)}}}try{return l(C.querySelectorAll(L),G)}catch(H){}}else{if(C.nodeType===1&&C.nodeName.toLowerCase()!=="object"){var D=C,E=C.getAttribute("id"),B=E||z,N=C.parentNode,M=/^\s*[+~]/.test(L);if(!E){C.setAttribute("id",B)}else{B=B.replace(/'/g,"\\$&")}if(M&&N){C=C.parentNode}try{if(!M||N){return l(C.querySelectorAll("[id='"+B+"'] "+L),G)}}catch(I){}finally{if(!E){D.removeAttribute("id")}}}}}return e(L,C,G,K)};for(var y in e){d[y]=e[y]}A=null})()}(function(){var e=document.documentElement,z=e.matchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.msMatchesSelector;if(z){var B=!z.call(document.createElement("div"),"div"),y=false;try{z.call(document.documentElement,"[test!='']:sizzle")}catch(A){y=true}d.matchesSelector=function(D,F){F=F.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!d.isXML(D)){try{if(y||!k.match.PSEUDO.test(F)&&!/!=/.test(F)){var C=z.call(D,F);if(C||!B||D.document&&D.document.nodeType!==11){return C}}}catch(E){}}return d(F,null,null,[D]).length>0}}})();(function(){var e=document.createElement("div");e.innerHTML="
                    ";if(!e.getElementsByClassName||e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}k.order.splice(1,0,"CLASS");k.find.CLASS=function(y,z,A){if(typeof z.getElementsByClassName!=="undefined"&&!A){return z.getElementsByClassName(y[1])}};e=null})();function a(y,D,C,G,E,F){for(var A=0,z=G.length;A0){B=e;break}}}e=e[y]}G[A]=B}}}if(document.documentElement.contains){d.contains=function(y,e){return y!==e&&(y.contains?y.contains(e):true)}}else{if(document.documentElement.compareDocumentPosition){d.contains=function(y,e){return !!(y.compareDocumentPosition(e)&16)}}else{d.contains=function(){return false}}}d.isXML=function(e){var y=(e?e.ownerDocument||e:0).documentElement;return y?y.nodeName!=="HTML":false};var s=function(z,e,D){var C,E=[],B="",F=e.nodeType?[e]:e;while((C=k.match.PSEUDO.exec(z))){B+=C[0];z=z.replace(k.match.PSEUDO,"")}z=k.relative[z]?z+"*":z;for(var A=0,y=F.length;A"+(i.item?i.item(0).outerHTML:i.htmlText);m.removeChild(m.firstChild)}else{m.innerHTML=i.toString()}}if(/^\s/.test(m.innerHTML)){j=" "}if(/\s+$/.test(m.innerHTML)){l=" "}h.getInner=true;h.content=g.isCollapsed()?"":j+g.serializer.serialize(m,h)+l;g.onGetContent.dispatch(g,h);return h.content},setContent:function(h,j){var o=this,g=o.getRng(),k,l=o.win.document,n,m;j=j||{format:"html"};j.set=true;h=j.content=h;if(!j.no_events){o.onBeforeSetContent.dispatch(o,j)}h=j.content;if(g.insertNode){h+='_';if(g.startContainer==l&&g.endContainer==l){l.body.innerHTML=h}else{g.deleteContents();if(l.body.childNodes.length===0){l.body.innerHTML=h}else{if(g.createContextualFragment){g.insertNode(g.createContextualFragment(h))}else{n=l.createDocumentFragment();m=l.createElement("div");n.appendChild(m);m.outerHTML=h;g.insertNode(n)}}}k=o.dom.get("__caret");g=l.createRange();g.setStartBefore(k);g.setEndBefore(k);o.setRng(g);o.dom.remove("__caret");try{o.setRng(g)}catch(i){}}else{if(g.item){l.execCommand("Delete",false,null);g=o.getRng()}if(/^\s+/.test(h)){g.pasteHTML('_'+h);o.dom.remove("__mce_tmp")}else{g.pasteHTML(h)}}if(!j.no_events){o.onSetContent.dispatch(o,j)}},getStart:function(){var h=this.getRng(),i,g,k,j;if(h.duplicate||h.item){if(h.item){return h.item(0)}k=h.duplicate();k.collapse(1);i=k.parentElement();g=j=h.parentElement();while(j=j.parentNode){if(j==i){i=g;break}}return i}else{i=h.startContainer;if(i.nodeType==1&&i.hasChildNodes()){i=i.childNodes[Math.min(i.childNodes.length-1,h.startOffset)]}if(i&&i.nodeType==3){return i.parentNode}return i}},getEnd:function(){var h=this,i=h.getRng(),j,g;if(i.duplicate||i.item){if(i.item){return i.item(0)}i=i.duplicate();i.collapse(0);j=i.parentElement();if(j&&j.nodeName=="BODY"){return j.lastChild||j}return j}else{j=i.endContainer;g=i.endOffset;if(j.nodeType==1&&j.hasChildNodes()){j=j.childNodes[g>0?g-1:g]}if(j&&j.nodeType==3){return j.parentNode}return j}},getBookmark:function(s,v){var y=this,n=y.dom,h,k,j,o,i,p,q,m="\uFEFF",x;function g(z,A){var t=0;e(n.select(z),function(C,B){if(C==A){t=B}});return t}function u(t){function z(E){var A,D,C,B=E?"start":"end";A=t[B+"Container"];D=t[B+"Offset"];if(A.nodeType==1&&A.nodeName=="TR"){C=A.childNodes;A=C[Math.min(E?D:D-1,C.length-1)];if(A){D=E?0:A.childNodes.length;t["set"+(E?"Start":"End")](A,D)}}}z(true);z();return t}function l(){var z=y.getRng(true),t=n.getRoot(),A={};function B(E,J){var D=E[J?"startContainer":"endContainer"],I=E[J?"startOffset":"endOffset"],C=[],F,H,G=0;if(D.nodeType==3){if(v){for(F=D.previousSibling;F&&F.nodeType==3;F=F.previousSibling){I+=F.nodeValue.length}}C.push(I)}else{H=D.childNodes;if(I>=H.length&&H.length){G=1;I=Math.max(0,H.length-1)}C.push(y.dom.nodeIndex(H[I],v)+G)}for(;D&&D!=t;D=D.parentNode){C.push(y.dom.nodeIndex(D,v))}return C}A.start=B(z,true);if(!y.isCollapsed()){A.end=B(z)}return A}if(s==2){if(y.tridentSel){return y.tridentSel.getBookmark(s)}return l()}if(s){return{rng:y.getRng()}}h=y.getRng();j=n.uniqueId();o=tinyMCE.activeEditor.selection.isCollapsed();x="overflow:hidden;line-height:0px";if(h.duplicate||h.item){if(!h.item){k=h.duplicate();try{h.collapse();h.pasteHTML(''+m+"");if(!o){k.collapse(false);h.moveToElementText(k.parentElement());if(h.compareEndPoints("StartToEnd",k)===0){k.move("character",-1)}k.pasteHTML(''+m+"")}}catch(r){return null}}else{p=h.item(0);i=p.nodeName;return{name:i,index:g(i,p)}}}else{p=y.getNode();i=p.nodeName;if(i=="IMG"){return{name:i,index:g(i,p)}}k=u(h.cloneRange());if(!o){k.collapse(false);k.insertNode(n.create("span",{"data-mce-type":"bookmark",id:j+"_end",style:x},m))}h=u(h);h.collapse(true);h.insertNode(n.create("span",{"data-mce-type":"bookmark",id:j+"_start",style:x},m))}y.moveToBookmark({id:j,keep:1});return{id:j}},moveToBookmark:function(o){var s=this,m=s.dom,j,i,g,r,k,u,p,q;function h(A){var t=o[A?"start":"end"],x,y,z,v;if(t){z=t[0];for(y=r,x=t.length-1;x>=1;x--){v=y.childNodes;if(t[x]>v.length-1){return}y=v[t[x]]}if(y.nodeType===3){z=Math.min(t[0],y.nodeValue.length)}if(y.nodeType===1){z=Math.min(t[0],y.childNodes.length)}if(A){g.setStart(y,z)}else{g.setEnd(y,z)}}return true}function l(B){var v=m.get(o.id+"_"+B),A,t,y,z,x=o.keep;if(v){A=v.parentNode;if(B=="start"){if(!x){t=m.nodeIndex(v)}else{A=v.firstChild;t=1}k=u=A;p=q=t}else{if(!x){t=m.nodeIndex(v)}else{A=v.firstChild;t=1}u=A;q=t}if(!x){z=v.previousSibling;y=v.nextSibling;e(d.grep(v.childNodes),function(C){if(C.nodeType==3){C.nodeValue=C.nodeValue.replace(/\uFEFF/g,"")}});while(v=m.get(o.id+"_"+B)){m.remove(v,1)}if(z&&y&&z.nodeType==y.nodeType&&z.nodeType==3&&!d.isOpera){t=z.nodeValue.length;z.appendData(y.nodeValue);m.remove(y);if(B=="start"){k=u=z;p=q=t}else{u=z;q=t}}}}}function n(t){if(m.isBlock(t)&&!t.innerHTML&&!b){t.innerHTML='
                    '}return t}if(o){if(o.start){g=m.createRng();r=m.getRoot();if(s.tridentSel){return s.tridentSel.moveToBookmark(o)}if(h(true)&&h()){s.setRng(g)}}else{if(o.id){l("start");l("end");if(k){g=m.createRng();g.setStart(n(k),p);g.setEnd(n(u),q);s.setRng(g)}}else{if(o.name){s.select(m.select(o.name)[o.index])}else{if(o.rng){s.setRng(o.rng)}}}}}},select:function(l,k){var j=this,m=j.dom,h=m.createRng(),g;function i(n,p){var o=new a(n,n);do{if(n.nodeType==3&&d.trim(n.nodeValue).length!==0){if(p){h.setStart(n,0)}else{h.setEnd(n,n.nodeValue.length)}return}if(n.nodeName=="BR"){if(p){h.setStartBefore(n)}else{h.setEndBefore(n)}return}}while(n=(p?o.next():o.prev()))}if(l){g=m.nodeIndex(l);h.setStart(l.parentNode,g);h.setEnd(l.parentNode,g+1);if(k){i(l,1);i(l)}j.setRng(h)}return l},isCollapsed:function(){var g=this,i=g.getRng(),h=g.getSel();if(!i||i.item){return false}if(i.compareEndPoints){return i.compareEndPoints("StartToEnd",i)===0}return !h||i.collapsed},collapse:function(g){var i=this,h=i.getRng(),j;if(h.item){j=h.item(0);h=i.win.document.body.createTextRange();h.moveToElementText(j)}h.collapse(!!g);i.setRng(h)},getSel:function(){var h=this,g=this.win;return g.getSelection?g.getSelection():g.document.selection},getRng:function(m){var h=this,j,g,l,k=h.win.document;if(m&&h.tridentSel){return h.tridentSel.getRangeAt(0)}try{if(j=h.getSel()){g=j.rangeCount>0?j.getRangeAt(0):(j.createRange?j.createRange():k.createRange())}}catch(i){}if(d.isIE&&g&&g.setStart&&k.selection.createRange().item){l=k.selection.createRange().item(0);g=k.createRange();g.setStartBefore(l);g.setEndAfter(l)}if(!g){g=k.createRange?k.createRange():k.body.createTextRange()}if(g.setStart&&g.startContainer.nodeType===9&&g.collapsed){l=h.dom.getRoot();g.setStart(l,0);g.setEnd(l,0)}if(h.selectedRange&&h.explicitRange){if(g.compareBoundaryPoints(g.START_TO_START,h.selectedRange)===0&&g.compareBoundaryPoints(g.END_TO_END,h.selectedRange)===0){g=h.explicitRange}else{h.selectedRange=null;h.explicitRange=null}}return g},setRng:function(k,g){var j,i=this;if(!i.tridentSel){j=i.getSel();if(j){i.explicitRange=k;try{j.removeAllRanges()}catch(h){}j.addRange(k);if(g===false&&j.extend){j.collapse(k.endContainer,k.endOffset);j.extend(k.startContainer,k.startOffset)}i.selectedRange=j.rangeCount>0?j.getRangeAt(0):null}}else{if(k.cloneRange){try{i.tridentSel.addRange(k);return}catch(h){}}try{k.select()}catch(h){}}},setNode:function(h){var g=this;g.setContent(g.dom.getOuterHTML(h));return h},getNode:function(){var i=this,h=i.getRng(),j=i.getSel(),m,l=h.startContainer,g=h.endContainer;function k(q,o){var p=q;while(q&&q.nodeType===3&&q.length===0){q=o?q.nextSibling:q.previousSibling}return q||p}if(!h){return i.dom.getRoot()}if(h.setStart){m=h.commonAncestorContainer;if(!h.collapsed){if(h.startContainer==h.endContainer){if(h.endOffset-h.startOffset<2){if(h.startContainer.hasChildNodes()){m=h.startContainer.childNodes[h.startOffset]}}}if(l.nodeType===3&&g.nodeType===3){if(l.length===h.startOffset){l=k(l.nextSibling,true)}else{l=l.parentNode}if(h.endOffset===0){g=k(g.previousSibling,false)}else{g=g.parentNode}if(l&&l===g){return l}}}if(m&&m.nodeType==3){return m.parentNode}return m}return h.item?h.item(0):h.parentElement()},getSelectedBlocks:function(p,h){var o=this,k=o.dom,m,l,i,j=[];m=k.getParent(p||o.getStart(),k.isBlock);l=k.getParent(h||o.getEnd(),k.isBlock);if(m){j.push(m)}if(m&&l&&m!=l){i=m;var g=new a(m,k.getRoot());while((i=g.next())&&i!=l){if(k.isBlock(i)){j.push(i)}}}if(l&&m!=l){j.push(l)}return j},isForward:function(){var i=this.dom,g=this.getSel(),j,h;if(!g||g.anchorNode==null||g.focusNode==null){return true}j=i.createRng();j.setStart(g.anchorNode,g.anchorOffset);j.collapse(true);h=i.createRng();h.setStart(g.focusNode,g.focusOffset);h.collapse(true);return j.compareBoundaryPoints(j.START_TO_START,h)<=0},normalize:function(){var h=this,g,m,l,j,i;function k(p){var o,r,n,s=h.dom,u=s.getRoot(),q,t,v;function y(z,A){var B=new a(z,s.getParent(z.parentNode,s.isBlock)||u);while(z=B[A?"prev":"next"]()){if(z.nodeName==="BR"){return true}}}function x(B,z){var C,A;z=z||o;C=new a(z,s.getParent(z.parentNode,s.isBlock)||u);while(q=C[B?"prev":"next"]()){if(q.nodeType===3&&q.nodeValue.length>0){o=q;r=B?q.nodeValue.length:0;m=true;return}if(s.isBlock(q)||t[q.nodeName.toLowerCase()]){return}A=q}if(l&&A){o=A;m=true;r=0}}o=g[(p?"start":"end")+"Container"];r=g[(p?"start":"end")+"Offset"];t=s.schema.getNonEmptyElements();if(o.nodeType===9){o=s.getRoot();r=0}if(o===u){if(p){q=o.childNodes[r>0?r-1:0];if(q){v=q.nodeName.toLowerCase();if(t[q.nodeName]||q.nodeName=="TABLE"){return}}}if(o.hasChildNodes()){o=o.childNodes[Math.min(!p&&r>0?r-1:r,o.childNodes.length-1)];r=0;if(o.hasChildNodes()&&!/TABLE/.test(o.nodeName)){q=o;n=new a(o,u);do{if(q.nodeType===3&&q.nodeValue.length>0){r=p?0:q.nodeValue.length;o=q;m=true;break}if(t[q.nodeName.toLowerCase()]){r=s.nodeIndex(q);o=q.parentNode;if(q.nodeName=="IMG"&&!p){r++}m=true;break}}while(q=(p?n.next():n.prev()))}}}if(l){if(o.nodeType===3&&r===0){x(true)}if(o.nodeType===1){q=o.childNodes[r];if(q&&q.nodeName==="BR"&&!y(q)&&!y(q,true)){x(true,o.childNodes[r])}}}if(p&&!l&&o.nodeType===3&&r===o.nodeValue.length){x(false)}if(m){g["set"+(p?"Start":"End")](o,r)}}if(d.isIE){return}g=h.getRng();l=g.collapsed;k(true);if(!l){k()}if(m){if(l){g.collapse(true)}h.setRng(g,h.isForward())}},destroy:function(h){var g=this;g.win=null;if(!h){d.removeUnload(g.destroy)}},_fixIESelection:function(){var h=this.dom,n=h.doc,i=n.body,k,o,g;function j(p,s){var q=i.createTextRange();try{q.moveToPoint(p,s)}catch(r){q=null}return q}function m(q){var p;if(q.button){p=j(q.x,q.y);if(p){if(p.compareEndPoints("StartToStart",o)>0){p.setEndPoint("StartToStart",o)}else{p.setEndPoint("EndToEnd",o)}p.select()}}else{l()}}function l(){var p=n.selection.createRange();if(o&&!p.item&&p.compareEndPoints("StartToEnd",p)===0){o.select()}h.unbind(n,"mouseup",l);h.unbind(n,"mousemove",m);o=k=0}n.documentElement.unselectable=true;h.bind(n,["mousedown","contextmenu"],function(p){if(p.target.nodeName==="HTML"){if(k){l()}g=n.documentElement;if(g.scrollHeight>g.clientHeight){return}k=1;o=j(p.x,p.y);if(o){h.bind(n,"mouseup",l);h.bind(n,"mousemove",m);h.win.focus();o.select()}}})}})})(tinymce);(function(a){a.dom.Serializer=function(e,i,f){var h,b,d=a.isIE,g=a.each,c;if(!e.apply_source_formatting){e.indent=false}i=i||a.DOM;f=f||new a.html.Schema(e);e.entity_encoding=e.entity_encoding||"named";e.remove_trailing_brs="remove_trailing_brs" in e?e.remove_trailing_brs:true;h=new a.util.Dispatcher(self);b=new a.util.Dispatcher(self);c=new a.html.DomParser(e,f);c.addAttributeFilter("src,href,style",function(k,j){var o=k.length,l,q,n="data-mce-"+j,p=e.url_converter,r=e.url_converter_scope,m;while(o--){l=k[o];q=l.attributes.map[n];if(q!==m){l.attr(j,q.length>0?q:null);l.attr(n,null)}else{q=l.attributes.map[j];if(j==="style"){q=i.serializeStyle(i.parseStyle(q),l.name)}else{if(p){q=p.call(r,q,j,l.name)}}l.attr(j,q.length>0?q:null)}}});c.addAttributeFilter("class",function(j,k){var l=j.length,m,n;while(l--){m=j[l];n=m.attr("class").replace(/(?:^|\s)mce(Item\w+|Selected)(?!\S)/g,"");m.attr("class",n.length>0?n:null)}});c.addAttributeFilter("data-mce-type",function(j,l,k){var m=j.length,n;while(m--){n=j[m];if(n.attributes.map["data-mce-type"]==="bookmark"&&!k.cleanup){n.remove()}}});c.addAttributeFilter("data-mce-expando",function(j,l,k){var m=j.length;while(m--){j[m].attr(l,null)}});c.addNodeFilter("script,style",function(k,l){var m=k.length,n,o;function j(p){return p.replace(/()/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*(()?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")}while(m--){n=k[m];o=n.firstChild?n.firstChild.value:"";if(l==="script"){n.attr("type",(n.attr("type")||"text/javascript").replace(/^mce\-/,""));if(o.length>0){n.firstChild.value="// "}}else{if(o.length>0){n.firstChild.value=""}}}});c.addNodeFilter("#comment",function(j,k){var l=j.length,m;while(l--){m=j[l];if(m.value.indexOf("[CDATA[")===0){m.name="#cdata";m.type=4;m.value=m.value.replace(/^\[CDATA\[|\]\]$/g,"")}else{if(m.value.indexOf("mce:protected ")===0){m.name="#text";m.type=3;m.raw=true;m.value=unescape(m.value).substr(14)}}}});c.addNodeFilter("xml:namespace,input",function(j,k){var l=j.length,m;while(l--){m=j[l];if(m.type===7){m.remove()}else{if(m.type===1){if(k==="input"&&!("type" in m.attributes.map)){m.attr("type","text")}}}}});if(e.fix_list_elements){c.addNodeFilter("ul,ol",function(k,l){var m=k.length,n,j;while(m--){n=k[m];j=n.parent;if(j.name==="ul"||j.name==="ol"){if(n.prev&&n.prev.name==="li"){n.prev.append(n)}}}})}c.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style",function(j,k){var l=j.length;while(l--){j[l].attr(k,null)}});return{schema:f,addNodeFilter:c.addNodeFilter,addAttributeFilter:c.addAttributeFilter,onPreProcess:h,onPostProcess:b,serialize:function(o,m){var l,p,k,j,n;if(d&&i.select("script,style,select,map").length>0){n=o.innerHTML;o=o.cloneNode(false);i.setHTML(o,n)}else{o=o.cloneNode(true)}l=o.ownerDocument.implementation;if(l.createHTMLDocument){p=l.createHTMLDocument("");g(o.nodeName=="BODY"?o.childNodes:[o],function(q){p.body.appendChild(p.importNode(q,true))});if(o.nodeName!="BODY"){o=p.body.firstChild}else{o=p.body}k=i.doc;i.doc=p}m=m||{};m.format=m.format||"html";if(!m.no_events){m.node=o;h.dispatch(self,m)}j=new a.html.Serializer(e,f);m.content=j.serialize(c.parse(a.trim(m.getInner?o.innerHTML:i.getOuterHTML(o)),m));if(!m.cleanup){m.content=m.content.replace(/\uFEFF|\u200B/g,"")}if(!m.no_events){b.dispatch(self,m)}if(k){i.doc=k}m.node=null;return m.content},addRules:function(j){f.addValidElements(j)},setRules:function(j){f.setValidElements(j)}}}})(tinymce);(function(a){a.dom.ScriptLoader=function(h){var c=0,k=1,i=2,l={},j=[],e={},d=[],g=0,f;function b(m,v){var x=this,q=a.DOM,s,o,r,n;function p(){q.remove(n);if(s){s.onreadystatechange=s.onload=s=null}v()}function u(){if(typeof(console)!=="undefined"&&console.log){console.log("Failed to load: "+m)}}n=q.uniqueId();if(a.isIE6){o=new a.util.URI(m);r=location;if(o.host==r.hostname&&o.port==r.port&&(o.protocol+":")==r.protocol&&o.protocol.toLowerCase()!="file"){a.util.XHR.send({url:a._addVer(o.getURI()),success:function(y){var t=q.create("script",{type:"text/javascript"});t.text=y;document.getElementsByTagName("head")[0].appendChild(t);q.remove(t);p()},error:u});return}}s=document.createElement("script");s.id=n;s.type="text/javascript";s.src=a._addVer(m);if(!a.isIE){s.onload=p}s.onerror=u;if(!a.isOpera){s.onreadystatechange=function(){var t=s.readyState;if(t=="complete"||t=="loaded"){p()}}}(document.getElementsByTagName("head")[0]||document.body).appendChild(s)}this.isDone=function(m){return l[m]==i};this.markDone=function(m){l[m]=i};this.add=this.load=function(m,q,n){var o,p=l[m];if(p==f){j.push(m);l[m]=c}if(q){if(!e[m]){e[m]=[]}e[m].push({func:q,scope:n||this})}};this.loadQueue=function(n,m){this.loadScripts(j,n,m)};this.loadScripts=function(m,q,p){var o;function n(r){a.each(e[r],function(s){s.func.call(s.scope)});e[r]=f}d.push({func:q,scope:p||this});o=function(){var r=a.grep(m);m.length=0;a.each(r,function(s){if(l[s]==i){n(s);return}if(l[s]!=k){l[s]=k;g++;b(s,function(){l[s]=i;g--;n(s);o()})}});if(!g){a.each(d,function(s){s.func.call(s.scope)});d.length=0}};o()}};a.ScriptLoader=new a.dom.ScriptLoader()})(tinymce);(function(a){a.dom.RangeUtils=function(c){var b="\uFEFF";this.walk=function(d,s){var i=d.startContainer,l=d.startOffset,t=d.endContainer,m=d.endOffset,j,g,o,h,r,q,e;e=c.select("td.mceSelected,th.mceSelected");if(e.length>0){a.each(e,function(u){s([u])});return}function f(u){var v;v=u[0];if(v.nodeType===3&&v===i&&l>=v.nodeValue.length){u.splice(0,1)}v=u[u.length-1];if(m===0&&u.length>0&&v===t&&v.nodeType===3){u.splice(u.length-1,1)}return u}function p(x,v,u){var y=[];for(;x&&x!=u;x=x[v]){y.push(x)}return y}function n(v,u){do{if(v.parentNode==u){return v}v=v.parentNode}while(v)}function k(x,v,y){var u=y?"nextSibling":"previousSibling";for(h=x,r=h.parentNode;h&&h!=v;h=r){r=h.parentNode;q=p(h==x?h:h[u],u);if(q.length){if(!y){q.reverse()}s(f(q))}}}if(i.nodeType==1&&i.hasChildNodes()){i=i.childNodes[l]}if(t.nodeType==1&&t.hasChildNodes()){t=t.childNodes[Math.min(m-1,t.childNodes.length-1)]}if(i==t){return s(f([i]))}j=c.findCommonAncestor(i,t);for(h=i;h;h=h.parentNode){if(h===t){return k(i,j,true)}if(h===j){break}}for(h=t;h;h=h.parentNode){if(h===i){return k(t,j)}if(h===j){break}}g=n(i,j)||i;o=n(t,j)||t;k(i,g,true);q=p(g==i?g:g.nextSibling,"nextSibling",o==t?o.nextSibling:o);if(q.length){s(f(q))}k(t,o)};this.split=function(e){var h=e.startContainer,d=e.startOffset,i=e.endContainer,g=e.endOffset;function f(j,k){return j.splitText(k)}if(h==i&&h.nodeType==3){if(d>0&&dd){g=g-d;h=i=f(i,g).previousSibling;g=i.nodeValue.length;d=0}else{g=0}}}else{if(h.nodeType==3&&d>0&&d0&&g=m.length){r=0}}t=m[r];f.setAttrib(g,"tabindex","-1");f.setAttrib(t.id,"tabindex","0");f.get(t.id).focus();if(e.actOnFocus){e.onAction(t.id)}if(s){a.cancel(s)}};p=function(z){var v=37,u=39,y=38,A=40,r=27,t=14,s=13,x=32;switch(z.keyCode){case v:if(i){q.moveFocus(-1)}break;case u:if(i){q.moveFocus(1)}break;case y:if(o){q.moveFocus(-1)}break;case A:if(o){q.moveFocus(1)}break;case r:if(e.onCancel){e.onCancel();a.cancel(z)}break;case t:case s:case x:if(e.onAction){e.onAction(g);a.cancel(z)}break}};c(m,function(t,r){var s,u;if(!t.id){t.id=f.uniqueId("_mce_item_")}u=f.get(t.id);if(l){f.bind(u,"blur",h);s="-1"}else{s=(r===0?"0":"-1")}u.setAttribute("tabindex",s);f.bind(u,"focus",k)});if(m[0]){g=m[0].id}f.setAttrib(n,"tabindex","-1");var j=f.get(n);f.bind(j,"focus",d);f.bind(j,"keydown",p)}})})(tinymce);(function(c){var b=c.DOM,a=c.is;c.create("tinymce.ui.Control",{Control:function(f,e,d){this.id=f;this.settings=e=e||{};this.rendered=false;this.onRender=new c.util.Dispatcher(this);this.classPrefix="";this.scope=e.scope||this;this.disabled=0;this.active=0;this.editor=d},setAriaProperty:function(f,e){var d=b.get(this.id+"_aria")||b.get(this.id);if(d){b.setAttrib(d,"aria-"+f,!!e)}},focus:function(){b.get(this.id).focus()},setDisabled:function(d){if(d!=this.disabled){this.setAriaProperty("disabled",d);this.setState("Disabled",d);this.setState("Enabled",!d);this.disabled=d}},isDisabled:function(){return this.disabled},setActive:function(d){if(d!=this.active){this.setState("Active",d);this.active=d;this.setAriaProperty("pressed",d)}},isActive:function(){return this.active},setState:function(f,d){var e=b.get(this.id);f=this.classPrefix+f;if(d){b.addClass(e,f)}else{b.removeClass(e,f)}},isRendered:function(){return this.rendered},renderHTML:function(){},renderTo:function(d){b.setHTML(d,this.renderHTML())},postRender:function(){var e=this,d;if(a(e.disabled)){d=e.disabled;e.disabled=-1;e.setDisabled(d)}if(a(e.active)){d=e.active;e.active=-1;e.setActive(d)}},remove:function(){b.remove(this.id);this.destroy()},destroy:function(){c.dom.Event.clear(this.id)}})})(tinymce);tinymce.create("tinymce.ui.Container:tinymce.ui.Control",{Container:function(c,b,a){this.parent(c,b,a);this.controls=[];this.lookup={}},add:function(a){this.lookup[a.id]=a;this.controls.push(a);return a},get:function(a){return this.lookup[a]}});tinymce.create("tinymce.ui.Separator:tinymce.ui.Control",{Separator:function(b,a){this.parent(b,a);this.classPrefix="mceSeparator";this.setDisabled(true)},renderHTML:function(){return tinymce.DOM.createHTML("span",{"class":this.classPrefix,role:"separator","aria-orientation":"vertical",tabindex:"-1"})}});(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.MenuItem:tinymce.ui.Control",{MenuItem:function(g,f){this.parent(g,f);this.classPrefix="mceMenuItem"},setSelected:function(f){this.setState("Selected",f);this.setAriaProperty("checked",!!f);this.selected=f},isSelected:function(){return this.selected},postRender:function(){var f=this;f.parent();if(c(f.selected)){f.setSelected(f.selected)}}})})(tinymce);(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.Menu:tinymce.ui.MenuItem",{Menu:function(h,g){var f=this;f.parent(h,g);f.items={};f.collapsed=false;f.menuCount=0;f.onAddItem=new d.util.Dispatcher(this)},expand:function(g){var f=this;if(g){a(f,function(h){if(h.expand){h.expand()}},"items",f)}f.collapsed=false},collapse:function(g){var f=this;if(g){a(f,function(h){if(h.collapse){h.collapse()}},"items",f)}f.collapsed=true},isCollapsed:function(){return this.collapsed},add:function(f){if(!f.settings){f=new d.ui.MenuItem(f.id||b.uniqueId(),f)}this.onAddItem.dispatch(this,f);return this.items[f.id]=f},addSeparator:function(){return this.add({separator:true})},addMenu:function(f){if(!f.collapse){f=this.createMenu(f)}this.menuCount++;return this.add(f)},hasMenus:function(){return this.menuCount!==0},remove:function(f){delete this.items[f.id]},removeAll:function(){var f=this;a(f,function(g){if(g.removeAll){g.removeAll()}else{g.remove()}g.destroy()},"items",f);f.items={}},createMenu:function(g){var f=new d.ui.Menu(g.id||b.uniqueId(),g);f.onAddItem.add(this.onAddItem.dispatch,this.onAddItem);return f}})})(tinymce);(function(e){var d=e.is,c=e.DOM,f=e.each,a=e.dom.Event,b=e.dom.Element;e.create("tinymce.ui.DropMenu:tinymce.ui.Menu",{DropMenu:function(h,g){g=g||{};g.container=g.container||c.doc.body;g.offset_x=g.offset_x||0;g.offset_y=g.offset_y||0;g.vp_offset_x=g.vp_offset_x||0;g.vp_offset_y=g.vp_offset_y||0;if(d(g.icons)&&!g.icons){g["class"]+=" mceNoIcons"}this.parent(h,g);this.onShowMenu=new e.util.Dispatcher(this);this.onHideMenu=new e.util.Dispatcher(this);this.classPrefix="mceMenu"},createMenu:function(j){var h=this,i=h.settings,g;j.container=j.container||i.container;j.parent=h;j.constrain=j.constrain||i.constrain;j["class"]=j["class"]||i["class"];j.vp_offset_x=j.vp_offset_x||i.vp_offset_x;j.vp_offset_y=j.vp_offset_y||i.vp_offset_y;j.keyboard_focus=i.keyboard_focus;g=new e.ui.DropMenu(j.id||c.uniqueId(),j);g.onAddItem.add(h.onAddItem.dispatch,h.onAddItem);return g},focus:function(){var g=this;if(g.keyboardNav){g.keyboardNav.focus()}},update:function(){var i=this,j=i.settings,g=c.get("menu_"+i.id+"_tbl"),l=c.get("menu_"+i.id+"_co"),h,k;h=j.max_width?Math.min(g.offsetWidth,j.max_width):g.offsetWidth;k=j.max_height?Math.min(g.offsetHeight,j.max_height):g.offsetHeight;if(!c.boxModel){i.element.setStyles({width:h+2,height:k+2})}else{i.element.setStyles({width:h,height:k})}if(j.max_width){c.setStyle(l,"width",h)}if(j.max_height){c.setStyle(l,"height",k);if(g.clientHeightv){p=r?r-u:Math.max(0,(v-A.vp_offset_x)-u)}if((n+A.vp_offset_y+l)>q){n=Math.max(0,(q-A.vp_offset_y)-l)}}c.setStyles(o,{left:p,top:n});z.element.update();z.isMenuVisible=1;z.mouseClickFunc=a.add(o,"click",function(s){var h;s=s.target;if(s&&(s=c.getParent(s,"tr"))&&!c.hasClass(s,m+"ItemSub")){h=z.items[s.id];if(h.isDisabled()){return}k=z;while(k){if(k.hideMenu){k.hideMenu()}k=k.settings.parent}if(h.settings.onclick){h.settings.onclick(s)}return false}});if(z.hasMenus()){z.mouseOverFunc=a.add(o,"mouseover",function(x){var h,t,s;x=x.target;if(x&&(x=c.getParent(x,"tr"))){h=z.items[x.id];if(z.lastMenu){z.lastMenu.collapse(1)}if(h.isDisabled()){return}if(x&&c.hasClass(x,m+"ItemSub")){t=c.getRect(x);h.showMenu((t.x+t.w-i),t.y-i,t.x);z.lastMenu=h;c.addClass(c.get(h.id).firstChild,m+"ItemActive")}}})}a.add(o,"keydown",z._keyHandler,z);z.onShowMenu.dispatch(z);if(A.keyboard_focus){z._setupKeyboardNav()}},hideMenu:function(j){var g=this,i=c.get("menu_"+g.id),h;if(!g.isMenuVisible){return}if(g.keyboardNav){g.keyboardNav.destroy()}a.remove(i,"mouseover",g.mouseOverFunc);a.remove(i,"click",g.mouseClickFunc);a.remove(i,"keydown",g._keyHandler);c.hide(i);g.isMenuVisible=0;if(!j){g.collapse(1)}if(g.element){g.element.hide()}if(h=c.get(g.id)){c.removeClass(h.firstChild,g.classPrefix+"ItemActive")}g.onHideMenu.dispatch(g)},add:function(i){var g=this,h;i=g.parent(i);if(g.isRendered&&(h=c.get("menu_"+g.id))){g._add(c.select("tbody",h)[0],i)}return i},collapse:function(g){this.parent(g);this.hideMenu(1)},remove:function(g){c.remove(g.id);this.destroy();return this.parent(g)},destroy:function(){var g=this,h=c.get("menu_"+g.id);if(g.keyboardNav){g.keyboardNav.destroy()}a.remove(h,"mouseover",g.mouseOverFunc);a.remove(c.select("a",h),"focus",g.mouseOverFunc);a.remove(h,"click",g.mouseClickFunc);a.remove(h,"keydown",g._keyHandler);if(g.element){g.element.remove()}c.remove(h)},renderNode:function(){var i=this,j=i.settings,l,h,k,g;g=c.create("div",{role:"listbox",id:"menu_"+i.id,"class":j["class"],style:"position:absolute;left:0;top:0;z-index:200000;outline:0"});if(i.settings.parent){c.setAttrib(g,"aria-parent","menu_"+i.settings.parent.id)}k=c.add(g,"div",{role:"presentation",id:"menu_"+i.id+"_co","class":i.classPrefix+(j["class"]?" "+j["class"]:"")});i.element=new b("menu_"+i.id,{blocker:1,container:j.container});if(j.menu_line){c.add(k,"span",{"class":i.classPrefix+"Line"})}l=c.add(k,"table",{role:"presentation",id:"menu_"+i.id+"_tbl",border:0,cellPadding:0,cellSpacing:0});h=c.add(l,"tbody");f(i.items,function(m){i._add(h,m)});i.rendered=true;return g},_setupKeyboardNav:function(){var i,h,g=this;i=c.get("menu_"+g.id);h=c.select("a[role=option]","menu_"+g.id);h.splice(0,0,i);g.keyboardNav=new e.ui.KeyboardNavigation({root:"menu_"+g.id,items:h,onCancel:function(){g.hideMenu()},enableUpDown:true});i.focus()},_keyHandler:function(g){var h=this,i;switch(g.keyCode){case 37:if(h.settings.parent){h.hideMenu();h.settings.parent.focus();a.cancel(g)}break;case 39:if(h.mouseOverFunc){h.mouseOverFunc(g)}break}},_add:function(j,h){var i,q=h.settings,p,l,k,m=this.classPrefix,g;if(q.separator){l=c.add(j,"tr",{id:h.id,"class":m+"ItemSeparator"});c.add(l,"td",{"class":m+"ItemSeparator"});if(i=l.previousSibling){c.addClass(i,"mceLast")}return}i=l=c.add(j,"tr",{id:h.id,"class":m+"Item "+m+"ItemEnabled"});i=k=c.add(i,q.titleItem?"th":"td");i=p=c.add(i,"a",{id:h.id+"_aria",role:q.titleItem?"presentation":"option",href:"javascript:;",onclick:"return false;",onmousedown:"return false;"});if(q.parent){c.setAttrib(p,"aria-haspopup","true");c.setAttrib(p,"aria-owns","menu_"+h.id)}c.addClass(k,q["class"]);g=c.add(i,"span",{"class":"mceIcon"+(q.icon?" mce_"+q.icon:"")});if(q.icon_src){c.add(g,"img",{src:q.icon_src})}i=c.add(i,q.element||"span",{"class":"mceText",title:h.settings.title},h.settings.title);if(h.settings.style){if(typeof h.settings.style=="function"){h.settings.style=h.settings.style()}c.setAttrib(i,"style",h.settings.style)}if(j.childNodes.length==1){c.addClass(l,"mceFirst")}if((i=l.previousSibling)&&c.hasClass(i,m+"ItemSeparator")){c.addClass(l,"mceFirst")}if(h.collapse){c.addClass(l,m+"ItemSub")}if(i=l.previousSibling){c.removeClass(i,"mceLast")}c.addClass(l,"mceLast")}})})(tinymce);(function(b){var a=b.DOM;b.create("tinymce.ui.Button:tinymce.ui.Control",{Button:function(e,d,c){this.parent(e,d,c);this.classPrefix="mceButton"},renderHTML:function(){var f=this.classPrefix,e=this.settings,d,c;c=a.encode(e.label||"");d='';if(e.image&&!(this.editor&&this.editor.forcedHighContrastMode)){d+=''+a.encode(e.title)+''+c}else{d+=''+(c?''+c+"":"")}d+='";d+="";return d},postRender:function(){var d=this,e=d.settings,c;if(b.isIE&&d.editor){b.dom.Event.add(d.id,"mousedown",function(f){var g=d.editor.selection.getNode().nodeName;c=g==="IMG"?d.editor.selection.getBookmark():null})}b.dom.Event.add(d.id,"click",function(f){if(!d.isDisabled()){if(b.isIE&&d.editor&&c!==null){d.editor.selection.moveToBookmark(c)}return e.onclick.call(e.scope,f)}});b.dom.Event.add(d.id,"keyup",function(f){if(!d.isDisabled()&&f.keyCode==b.VK.SPACEBAR){return e.onclick.call(e.scope,f)}})}})})(tinymce);(function(e){var d=e.DOM,b=e.dom.Event,f=e.each,a=e.util.Dispatcher,c;e.create("tinymce.ui.ListBox:tinymce.ui.Control",{ListBox:function(j,i,g){var h=this;h.parent(j,i,g);h.items=[];h.onChange=new a(h);h.onPostRender=new a(h);h.onAdd=new a(h);h.onRenderMenu=new e.util.Dispatcher(this);h.classPrefix="mceListBox";h.marked={}},select:function(h){var g=this,j,i;g.marked={};if(h==c){return g.selectByIndex(-1)}if(h&&typeof(h)=="function"){i=h}else{i=function(k){return k==h}}if(h!=g.selectedValue){f(g.items,function(l,k){if(i(l.value)){j=1;g.selectByIndex(k);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(g){var i=this,j,k,h;i.marked={};if(g!=i.selectedIndex){j=d.get(i.id+"_text");h=d.get(i.id+"_voiceDesc");k=i.items[g];if(k){i.selectedValue=k.value;i.selectedIndex=g;d.setHTML(j,d.encode(k.title));d.setHTML(h,i.settings.title+" - "+k.title);d.removeClass(j,"mceTitle");d.setAttrib(i.id,"aria-valuenow",k.title)}else{d.setHTML(j,d.encode(i.settings.title));d.setHTML(h,d.encode(i.settings.title));d.addClass(j,"mceTitle");i.selectedValue=i.selectedIndex=null;d.setAttrib(i.id,"aria-valuenow",i.settings.title)}j=0}},mark:function(g){this.marked[g]=true},add:function(j,g,i){var h=this;i=i||{};i=e.extend(i,{title:j,value:g});h.items.push(i);h.onAdd.dispatch(h,i)},getLength:function(){return this.items.length},renderHTML:function(){var j="",g=this,i=g.settings,k=g.classPrefix;j='';j+="";j+="";j+="";return j},showMenu:function(){var h=this,j,i=d.get(this.id),g;if(h.isDisabled()||h.items.length===0){return}if(h.menu&&h.menu.isMenuVisible){return h.hideMenu()}if(!h.isMenuRendered){h.renderMenu();h.isMenuRendered=true}j=d.getPos(i);g=h.menu;g.settings.offset_x=j.x;g.settings.offset_y=j.y;g.settings.keyboard_focus=!e.isOpera;f(h.items,function(k){if(g.items[k.id]){g.items[k.id].setSelected(0)}});f(h.items,function(k){if(g.items[k.id]&&h.marked[k.value]){g.items[k.id].setSelected(1)}if(k.value===h.selectedValue){g.items[k.id].setSelected(1)}});g.showMenu(0,i.clientHeight);b.add(d.doc,"mousedown",h.hideMenu,h);d.addClass(h.id,h.classPrefix+"Selected")},hideMenu:function(h){var g=this;if(g.menu&&g.menu.isMenuVisible){d.removeClass(g.id,g.classPrefix+"Selected");if(h&&h.type=="mousedown"&&(h.target.id==g.id+"_text"||h.target.id==g.id+"_open")){return}if(!h||!d.getParent(h.target,".mceMenu")){d.removeClass(g.id,g.classPrefix+"Selected");b.remove(d.doc,"mousedown",g.hideMenu,g);g.menu.hideMenu()}}},renderMenu:function(){var h=this,g;g=h.settings.control_manager.createDropMenu(h.id+"_menu",{menu_line:1,"class":h.classPrefix+"Menu mceNoIcons",max_width:250,max_height:150});g.onHideMenu.add(function(){h.hideMenu();h.focus()});g.add({title:h.settings.title,"class":"mceMenuItemTitle",onclick:function(){if(h.settings.onselect("")!==false){h.select("")}}});f(h.items,function(i){if(i.value===c){g.add({title:i.title,role:"option","class":"mceMenuItemTitle",onclick:function(){if(h.settings.onselect("")!==false){h.select("")}}})}else{i.id=d.uniqueId();i.role="option";i.onclick=function(){if(h.settings.onselect(i.value)!==false){h.select(i.value)}};g.add(i)}});h.onRenderMenu.dispatch(h,g);h.menu=g},postRender:function(){var g=this,h=g.classPrefix;b.add(g.id,"click",g.showMenu,g);b.add(g.id,"keydown",function(i){if(i.keyCode==32){g.showMenu(i);b.cancel(i)}});b.add(g.id,"focus",function(){if(!g._focused){g.keyDownHandler=b.add(g.id,"keydown",function(i){if(i.keyCode==40){g.showMenu();b.cancel(i)}});g.keyPressHandler=b.add(g.id,"keypress",function(j){var i;if(j.keyCode==13){i=g.selectedValue;g.selectedValue=null;b.cancel(j);g.settings.onselect(i)}})}g._focused=1});b.add(g.id,"blur",function(){b.remove(g.id,"keydown",g.keyDownHandler);b.remove(g.id,"keypress",g.keyPressHandler);g._focused=0});if(e.isIE6||!d.boxModel){b.add(g.id,"mouseover",function(){if(!d.hasClass(g.id,h+"Disabled")){d.addClass(g.id,h+"Hover")}});b.add(g.id,"mouseout",function(){if(!d.hasClass(g.id,h+"Disabled")){d.removeClass(g.id,h+"Hover")}})}g.onPostRender.dispatch(g,d.get(g.id))},destroy:function(){this.parent();b.clear(this.id+"_text");b.clear(this.id+"_open")}})})(tinymce);(function(e){var d=e.DOM,b=e.dom.Event,f=e.each,a=e.util.Dispatcher,c;e.create("tinymce.ui.NativeListBox:tinymce.ui.ListBox",{NativeListBox:function(h,g){this.parent(h,g);this.classPrefix="mceNativeListBox"},setDisabled:function(g){d.get(this.id).disabled=g;this.setAriaProperty("disabled",g)},isDisabled:function(){return d.get(this.id).disabled},select:function(h){var g=this,j,i;if(h==c){return g.selectByIndex(-1)}if(h&&typeof(h)=="function"){i=h}else{i=function(k){return k==h}}if(h!=g.selectedValue){f(g.items,function(l,k){if(i(l.value)){j=1;g.selectByIndex(k);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(g){d.get(this.id).selectedIndex=g+1;this.selectedValue=this.items[g]?this.items[g].value:null},add:function(k,h,g){var j,i=this;g=g||{};g.value=h;if(i.isRendered()){d.add(d.get(this.id),"option",g,k)}j={title:k,value:h,attribs:g};i.items.push(j);i.onAdd.dispatch(i,j)},getLength:function(){return this.items.length},renderHTML:function(){var i,g=this;i=d.createHTML("option",{value:""},"-- "+g.settings.title+" --");f(g.items,function(h){i+=d.createHTML("option",{value:h.value},h.title)});i=d.createHTML("select",{id:g.id,"class":"mceNativeListBox","aria-labelledby":g.id+"_aria"},i);i+=d.createHTML("span",{id:g.id+"_aria",style:"display: none"},g.settings.title);return i},postRender:function(){var h=this,i,j=true;h.rendered=true;function g(l){var k=h.items[l.target.selectedIndex-1];if(k&&(k=k.value)){h.onChange.dispatch(h,k);if(h.settings.onselect){h.settings.onselect(k)}}}b.add(h.id,"change",g);b.add(h.id,"keydown",function(l){var k;b.remove(h.id,"change",i);j=false;k=b.add(h.id,"blur",function(){if(j){return}j=true;b.add(h.id,"change",g);b.remove(h.id,"blur",k)});if(e.isWebKit&&(l.keyCode==37||l.keyCode==39)){return b.prevent(l)}if(l.keyCode==13||l.keyCode==32){g(l);return b.cancel(l)}});h.onPostRender.dispatch(h,d.get(h.id))}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.MenuButton:tinymce.ui.Button",{MenuButton:function(g,f,e){this.parent(g,f,e);this.onRenderMenu=new c.util.Dispatcher(this);f.menu_container=f.menu_container||b.doc.body},showMenu:function(){var g=this,j,i,h=b.get(g.id),f;if(g.isDisabled()){return}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}if(g.isMenuVisible){return g.hideMenu()}j=b.getPos(g.settings.menu_container);i=b.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.vp_offset_x=i.x;f.settings.vp_offset_y=i.y;f.settings.keyboard_focus=g._focused;f.showMenu(0,h.firstChild.clientHeight);a.add(b.doc,"mousedown",g.hideMenu,g);g.setState("Selected",1);g.isMenuVisible=1},renderMenu:function(){var f=this,e;e=f.settings.control_manager.createDropMenu(f.id+"_menu",{menu_line:1,"class":this.classPrefix+"Menu",icons:f.settings.icons});e.onHideMenu.add(function(){f.hideMenu();f.focus()});f.onRenderMenu.dispatch(f,e);f.menu=e},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&b.getParent(g.target,function(h){return h.id===f.id||h.id===f.id+"_open"})){return}if(!g||!b.getParent(g.target,".mceMenu")){f.setState("Selected",0);a.remove(b.doc,"mousedown",f.hideMenu,f);if(f.menu){f.menu.hideMenu()}}f.isMenuVisible=0},postRender:function(){var e=this,f=e.settings;a.add(e.id,"click",function(){if(!e.isDisabled()){if(f.onclick){f.onclick(e.value)}e.showMenu()}})}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.SplitButton:tinymce.ui.MenuButton",{SplitButton:function(g,f,e){this.parent(g,f,e);this.classPrefix="mceSplitButton"},renderHTML:function(){var i,f=this,g=f.settings,e;i="";if(g.image){e=b.createHTML("img ",{src:g.image,role:"presentation","class":"mceAction "+g["class"]})}else{e=b.createHTML("span",{"class":"mceAction "+g["class"]},"")}e+=b.createHTML("span",{"class":"mceVoiceLabel mceIconOnly",id:f.id+"_voice",style:"display:none;"},g.title);i+=""+b.createHTML("a",{role:"button",id:f.id+"_action",tabindex:"-1",href:"javascript:;","class":"mceAction "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"";e=b.createHTML("span",{"class":"mceOpen "+g["class"]},'');i+=""+b.createHTML("a",{role:"button",id:f.id+"_open",tabindex:"-1",href:"javascript:;","class":"mceOpen "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"";i+="";i=b.createHTML("table",{role:"presentation","class":"mceSplitButton mceSplitButtonEnabled "+g["class"],cellpadding:"0",cellspacing:"0",title:g.title},i);return b.createHTML("div",{id:f.id,role:"button",tabindex:"0","aria-labelledby":f.id+"_voice","aria-haspopup":"true"},i)},postRender:function(){var e=this,g=e.settings,f;if(g.onclick){f=function(h){if(!e.isDisabled()){g.onclick(e.value);a.cancel(h)}};a.add(e.id+"_action","click",f);a.add(e.id,["click","keydown"],function(h){var k=32,m=14,i=13,j=38,l=40;if((h.keyCode===32||h.keyCode===13||h.keyCode===14)&&!h.altKey&&!h.ctrlKey&&!h.metaKey){f();a.cancel(h)}else{if(h.type==="click"||h.keyCode===l){e.showMenu();a.cancel(h)}}})}a.add(e.id+"_open","click",function(h){e.showMenu();a.cancel(h)});a.add([e.id,e.id+"_open"],"focus",function(){e._focused=1});a.add([e.id,e.id+"_open"],"blur",function(){e._focused=0});if(c.isIE6||!b.boxModel){a.add(e.id,"mouseover",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.addClass(e.id,"mceSplitButtonHover")}});a.add(e.id,"mouseout",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.removeClass(e.id,"mceSplitButtonHover")}})}},destroy:function(){this.parent();a.clear(this.id+"_action");a.clear(this.id+"_open");a.clear(this.id)}})})(tinymce);(function(d){var c=d.DOM,a=d.dom.Event,b=d.is,e=d.each;d.create("tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton",{ColorSplitButton:function(i,h,f){var g=this;g.parent(i,h,f);g.settings=h=d.extend({colors:"000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF",grid_width:8,default_color:"#888888"},g.settings);g.onShowMenu=new d.util.Dispatcher(g);g.onHideMenu=new d.util.Dispatcher(g);g.value=h.default_color},showMenu:function(){var f=this,g,j,i,h;if(f.isDisabled()){return}if(!f.isMenuRendered){f.renderMenu();f.isMenuRendered=true}if(f.isMenuVisible){return f.hideMenu()}i=c.get(f.id);c.show(f.id+"_menu");c.addClass(i,"mceSplitButtonSelected");h=c.getPos(i);c.setStyles(f.id+"_menu",{left:h.x,top:h.y+i.firstChild.clientHeight,zIndex:200000});i=0;a.add(c.doc,"mousedown",f.hideMenu,f);f.onShowMenu.dispatch(f);if(f._focused){f._keyHandler=a.add(f.id+"_menu","keydown",function(k){if(k.keyCode==27){f.hideMenu()}});c.select("a",f.id+"_menu")[0].focus()}f.isMenuVisible=1},hideMenu:function(g){var f=this;if(f.isMenuVisible){if(g&&g.type=="mousedown"&&c.getParent(g.target,function(h){return h.id===f.id+"_open"})){return}if(!g||!c.getParent(g.target,".mceSplitButtonMenu")){c.removeClass(f.id,"mceSplitButtonSelected");a.remove(c.doc,"mousedown",f.hideMenu,f);a.remove(f.id+"_menu","keydown",f._keyHandler);c.hide(f.id+"_menu")}f.isMenuVisible=0;f.onHideMenu.dispatch()}},renderMenu:function(){var p=this,h,k=0,q=p.settings,g,j,l,o,f;o=c.add(q.menu_container,"div",{role:"listbox",id:p.id+"_menu","class":q.menu_class+" "+q["class"],style:"position:absolute;left:0;top:-1000px;"});h=c.add(o,"div",{"class":q["class"]+" mceSplitButtonMenu"});c.add(h,"span",{"class":"mceMenuLine"});g=c.add(h,"table",{role:"presentation","class":"mceColorSplitMenu"});j=c.add(g,"tbody");k=0;e(b(q.colors,"array")?q.colors:q.colors.split(","),function(m){m=m.replace(/^#/,"");if(!k--){l=c.add(j,"tr");k=q.grid_width-1}g=c.add(l,"td");var i={href:"javascript:;",style:{backgroundColor:"#"+m},title:p.editor.getLang("colors."+m,m),"data-mce-color":"#"+m};if(!d.isIE){i.role="option"}g=c.add(g,"a",i);if(p.editor.forcedHighContrastMode){g=c.add(g,"canvas",{width:16,height:16,"aria-hidden":"true"});if(g.getContext&&(f=g.getContext("2d"))){f.fillStyle="#"+m;f.fillRect(0,0,16,16)}else{c.remove(g)}}});if(q.more_colors_func){g=c.add(j,"tr");g=c.add(g,"td",{colspan:q.grid_width,"class":"mceMoreColors"});g=c.add(g,"a",{role:"option",id:p.id+"_more",href:"javascript:;",onclick:"return false;","class":"mceMoreColors"},q.more_colors_title);a.add(g,"click",function(i){q.more_colors_func.call(q.more_colors_scope||this);return a.cancel(i)})}c.addClass(h,"mceColorSplitMenu");new d.ui.KeyboardNavigation({root:p.id+"_menu",items:c.select("a",p.id+"_menu"),onCancel:function(){p.hideMenu();p.focus()}});a.add(p.id+"_menu","mousedown",function(i){return a.cancel(i)});a.add(p.id+"_menu","click",function(i){var m;i=c.getParent(i.target,"a",j);if(i&&i.nodeName.toLowerCase()=="a"&&(m=i.getAttribute("data-mce-color"))){p.setColor(m)}return false});return o},setColor:function(f){this.displayColor(f);this.hideMenu();this.settings.onselect(f)},displayColor:function(g){var f=this;c.setStyle(f.id+"_preview","backgroundColor",g);f.value=g},postRender:function(){var f=this,g=f.id;f.parent();c.add(g+"_action","div",{id:g+"_preview","class":"mceColorPreview"});c.setStyle(f.id+"_preview","backgroundColor",f.value)},destroy:function(){this.parent();a.clear(this.id+"_menu");a.clear(this.id+"_more");c.remove(this.id+"_menu")}})})(tinymce);(function(b){var d=b.DOM,c=b.each,a=b.dom.Event;b.create("tinymce.ui.ToolbarGroup:tinymce.ui.Container",{renderHTML:function(){var f=this,i=[],e=f.controls,j=b.each,g=f.settings;i.push('
                    ');i.push("");i.push('");j(e,function(h){i.push(h.renderHTML())});i.push("");i.push("
                    ");return i.join("")},focus:function(){var e=this;d.get(e.id).focus()},postRender:function(){var f=this,e=[];c(f.controls,function(g){c(g.controls,function(h){if(h.id){e.push(h)}})});f.keyNav=new b.ui.KeyboardNavigation({root:f.id,items:e,onCancel:function(){if(b.isWebKit){d.get(f.editor.id+"_ifr").focus()}f.editor.focus()},excludeFromTabOrder:!f.settings.tab_focus_toolbar})},destroy:function(){var e=this;e.parent();e.keyNav.destroy();a.clear(e.id)}})})(tinymce);(function(a){var c=a.DOM,b=a.each;a.create("tinymce.ui.Toolbar:tinymce.ui.Container",{renderHTML:function(){var m=this,f="",j,k,n=m.settings,e,d,g,l;l=m.controls;for(e=0;e"))}if(d&&k.ListBox){if(d.Button||d.SplitButton){f+=c.createHTML("td",{"class":"mceToolbarEnd"},c.createHTML("span",null,""))}}if(c.stdMode){f+=''+k.renderHTML()+""}else{f+=""+k.renderHTML()+""}if(g&&k.ListBox){if(g.Button||g.SplitButton){f+=c.createHTML("td",{"class":"mceToolbarStart"},c.createHTML("span",null,""))}}}j="mceToolbarEnd";if(k.Button){j+=" mceToolbarEndButton"}else{if(k.SplitButton){j+=" mceToolbarEndSplitButton"}else{if(k.ListBox){j+=" mceToolbarEndListBox"}}}f+=c.createHTML("td",{"class":j},c.createHTML("span",null,""));return c.createHTML("table",{id:m.id,"class":"mceToolbar"+(n["class"]?" "+n["class"]:""),cellpadding:"0",cellspacing:"0",align:m.settings.align||"",role:"presentation",tabindex:"-1"},""+f+"")}})})(tinymce);(function(b){var a=b.util.Dispatcher,c=b.each;b.create("tinymce.AddOnManager",{AddOnManager:function(){var d=this;d.items=[];d.urls={};d.lookup={};d.onAdd=new a(d)},get:function(d){if(this.lookup[d]){return this.lookup[d].instance}else{return undefined}},dependencies:function(e){var d;if(this.lookup[e]){d=this.lookup[e].dependencies}return d||[]},requireLangPack:function(e){return;var d=b.settings;if(d&&d.language&&d.language_load!==false){b.ScriptLoader.add(this.urls[e]+"/langs/"+d.language+".js")}},add:function(f,e,d){this.items.push(e);this.lookup[f]={instance:e,dependencies:d};this.onAdd.dispatch(this,f,e);return e},createUrl:function(d,e){if(typeof e==="object"){return e}else{return{prefix:d.prefix,resource:e,suffix:d.suffix}}},addComponents:function(f,d){var e=this.urls[f];b.each(d,function(g){b.ScriptLoader.add(e+"/"+g)})},load:function(j,f,d,h){var g=this,e=f;function i(){var k=g.dependencies(j);b.each(k,function(m){var l=g.createUrl(f,m);g.load(l.resource,l,undefined,undefined)});if(d){if(h){d.call(h)}else{d.call(b.ScriptLoader)}}}if(g.urls[j]){return}if(typeof f==="object"){e=f.prefix+f.resource+f.suffix}if(e.indexOf("/")!==0&&e.indexOf("://")==-1){e=b.baseURL+"/"+e}g.urls[j]=e.substring(0,e.lastIndexOf("/"));if(g.lookup[j]){i()}else{b.ScriptLoader.add(e,i,h)}}});b.PluginManager=new b.AddOnManager();b.ThemeManager=new b.AddOnManager()}(tinymce));(function(j){var g=j.each,d=j.extend,k=j.DOM,i=j.dom.Event,f=j.ThemeManager,b=j.PluginManager,e=j.explode,h=j.util.Dispatcher,a,c=0;j.documentBaseURL=window.location.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,"");if(!/[\/\\]$/.test(j.documentBaseURL)){j.documentBaseURL+="/"}j.baseURL=new j.util.URI(j.documentBaseURL).toAbsolute(j.baseURL);j.baseURI=new j.util.URI(j.baseURL);j.onBeforeUnload=new h(j);i.add(window,"beforeunload",function(l){j.onBeforeUnload.dispatch(j,l)});j.onAddEditor=new h(j);j.onRemoveEditor=new h(j);j.EditorManager=d(j,{editors:[],i18n:{},activeEditor:null,init:function(x){var v=this,o,n=j.ScriptLoader,u,l=[],r;function q(t){var s=t.id;if(!s){s=t.name;if(s&&!k.get(s)){s=t.name}else{s=k.uniqueId()}t.setAttribute("id",s)}return s}function m(z,A,t){var y=z[A];if(!y){return}if(j.is(y,"string")){t=y.replace(/\.\w+$/,"");t=t?j.resolve(t):0;y=j.resolve(y)}return y.apply(t||this,Array.prototype.slice.call(arguments,2))}function p(t,s){return s.constructor===RegExp?s.test(t.className):k.hasClass(t,s)}x=d({theme:"simple",language:"en"},x);v.settings=x;i.bind(window,"ready",function(){var s,t;m(x,"onpageload");switch(x.mode){case"exact":s=x.elements||"";if(s.length>0){g(e(s),function(y){if(k.get(y)){r=new j.Editor(y,x);l.push(r);r.render(1)}else{g(document.forms,function(z){g(z.elements,function(A){if(A.name===y){y="mce_editor_"+c++;k.setAttrib(A,"id",y);r=new j.Editor(y,x);l.push(r);r.render(1)}})})}})}break;case"textareas":case"specific_textareas":g(k.select("textarea"),function(y){if(x.editor_deselector&&p(y,x.editor_deselector)){return}if(!x.editor_selector||p(y,x.editor_selector)){r=new j.Editor(q(y),x);l.push(r);r.render(1)}});break;default:if(x.types){g(x.types,function(y){g(k.select(y.selector),function(A){var z=new j.Editor(q(A),j.extend({},x,y));l.push(z);z.render(1)})})}else{if(x.selector){g(k.select(x.selector),function(z){var y=new j.Editor(q(z),x);l.push(y);y.render(1)})}}}if(x.oninit){s=t=0;g(l,function(y){t++;if(!y.initialized){y.onInit.add(function(){s++;if(s==t){m(x,"oninit")}})}else{s++}if(s==t){m(x,"oninit")}})}})},get:function(l){if(l===a){return this.editors}return this.editors[l]},getInstanceById:function(l){return this.get(l)},add:function(m){var l=this,n=l.editors;n[m.id]=m;n.push(m);l._setActive(m);l.onAddEditor.dispatch(l,m);return m},remove:function(n){var m=this,l,o=m.editors;if(!o[n.id]){return null}delete o[n.id];for(l=0;l':"",visual:n,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",apply_source_formatting:n,directionality:"ltr",forced_root_block:"p",hidden_input:n,padd_empty_editor:n,render_ui:n,indentation:"30px",fix_table_elements:n,inline_styles:n,convert_fonts_to_spans:n,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist",validate:n,entity_encoding:"named",url_converter:m.convertURL,url_converter_scope:m,ie7_compat:n},o);m.id=m.editorId=p;m.isNotDirty=false;m.plugins={};m.documentBaseURI=new k.util.URI(o.document_base_url||k.documentBaseURL,{base_uri:tinyMCE.baseURI});m.baseURI=k.baseURI;m.contentCSS=[];m.setupEvents();m.execCommands={};m.queryStateCommands={};m.queryValueCommands={};m.execCallback("setup",m)},render:function(o){var p=this,q=p.settings,r=p.id,m=k.ScriptLoader;if(!j.domLoaded){j.add(window,"ready",function(){p.render()});return}tinyMCE.settings=q;if(!p.getElement()){return}if(k.isIDevice&&!k.isIOS5){return}if(!/TEXTAREA|INPUT/i.test(p.getElement().nodeName)&&q.hidden_input&&l.getParent(r,"form")){l.insertAfter(l.create("input",{type:"hidden",name:r}),r)}p.orgVisibility=p.getElement().style.visibility;p.getElement().style.visibility="hidden";if(k.WindowManager){p.windowManager=new k.WindowManager(p)}if(q.encoding=="xml"){p.onGetContent.add(function(s,t){if(t.save){t.content=l.encode(t.content)}})}if(q.add_form_submit_trigger){p.onSubmit.addToTop(function(){if(p.initialized){p.save();p.isNotDirty=1}})}if(q.add_unload_trigger){p._beforeUnload=tinyMCE.onBeforeUnload.add(function(){if(p.initialized&&!p.destroyed&&!p.isHidden()){p.save({format:"raw",no_events:true})}})}k.addUnload(p.destroy,p);if(q.submit_patch){p.onBeforeRenderUI.add(function(){var s=p.getElement().form;if(!s){return}if(s._mceOldSubmit){return}if(!s.submit.nodeType&&!s.submit.length){p.formElement=s;s._mceOldSubmit=s.submit;s.submit=function(){k.triggerSave();p.isNotDirty=1;return p.formElement._mceOldSubmit(p.formElement)}}s=null})}function n(){if(q.language&&q.language_load!==false){m.add(k.baseURL+"/../../extra/strings.php?elanguage="+q.language+"ðeme="+q.theme)}if(q.theme&&typeof q.theme!="function"&&q.theme.charAt(0)!="-"&&!h.urls[q.theme]){h.load(q.theme,"themes/"+q.theme+"/editor_template"+k.suffix+".js")}i(g(q.plugins),function(t){if(t&&!c.urls[t]){if(t.charAt(0)=="-"){t=t.substr(1,t.length);var s=c.dependencies(t);i(s,function(v){var u={prefix:"plugins/",resource:v,suffix:"/editor_plugin"+k.suffix+".js"};v=c.createUrl(u,v);c.load(v.resource,v)})}else{if(t=="safari"){return}c.load(t,{prefix:"plugins/",resource:t,suffix:"/editor_plugin"+k.suffix+".js"})}}});m.loadQueue(function(){if(!p.removed){p.init()}})}n()},init:function(){var q,F=this,G=F.settings,C,y,B=F.getElement(),p,m,D,v,A,E,x,r=[];k.add(F);G.aria_label=G.aria_label||l.getAttrib(B,"aria-label",F.getLang("aria.rich_text_area"));if(G.theme){if(typeof G.theme!="function"){G.theme=G.theme.replace(/-/,"");p=h.get(G.theme);F.theme=new p();if(F.theme.init){F.theme.init(F,h.urls[G.theme]||k.documentBaseURL.replace(/\/$/,""))}}else{F.theme=G.theme}}function z(s){var t=c.get(s),o=c.urls[s]||k.documentBaseURL.replace(/\/$/,""),n;if(t&&k.inArray(r,s)===-1){i(c.dependencies(s),function(u){z(u)});n=new t(F,o);F.plugins[s]=n;if(n.init){n.init(F,o);r.push(s)}}}i(g(G.plugins.replace(/\-/g,"")),z);if(G.popup_css!==false){if(G.popup_css){G.popup_css=F.documentBaseURI.toAbsolute(G.popup_css)}else{G.popup_css=F.baseURI.toAbsolute("themes/"+G.theme+"/skins/"+G.skin+"/dialog.css")}}if(G.popup_css_add){G.popup_css+=","+F.documentBaseURI.toAbsolute(G.popup_css_add)}F.controlManager=new k.ControlManager(F);F.onExecCommand.add(function(n,o){if(!/^(FontName|FontSize)$/.test(o)){F.nodeChanged()}});F.onBeforeRenderUI.dispatch(F,F.controlManager);if(G.render_ui&&F.theme){F.orgDisplay=B.style.display;if(typeof G.theme!="function"){C=G.width||B.style.width||B.offsetWidth;y=G.height||B.style.height||B.offsetHeight;E=/^[0-9\.]+(|px)$/i;if(E.test(""+C)){C=Math.max(parseInt(C,10)+(p.deltaWidth||0),100)}if(E.test(""+y)){y=Math.max(parseInt(y)+(p.deltaHeight||0),G.theme_advanced_resizing_min_height||100)}p=F.theme.renderUI({targetNode:B,width:C,height:y,deltaWidth:G.delta_width,deltaHeight:G.delta_height});l.setStyles(p.sizeContainer||p.editorContainer,{width:C,height:y});y=(p.iframeHeight||y)+(typeof(y)=="number"?(p.deltaHeight||0):"");if(y<(G.theme_advanced_resizing_min_height||100)){y=G.theme_advanced_resizing_min_height||100}}else{p=G.theme(F,B);if(p.editorContainer.nodeType){p.editorContainer=p.editorContainer.id=p.editorContainer.id||F.id+"_parent"}if(p.iframeContainer.nodeType){p.iframeContainer=p.iframeContainer.id=p.iframeContainer.id||F.id+"_iframecontainer"}y=p.iframeHeight||B.offsetHeight}F.editorContainer=p.editorContainer}if(G.content_css){i(g(G.content_css),function(n){F.contentCSS.push(F.documentBaseURI.toAbsolute(n))})}if(G.content_editable){B=q=p=null;return F.initContentBody()}if(document.domain&&location.hostname!=document.domain){k.relaxedDomain=document.domain}F.iframeHTML=G.doctype+'';if(G.document_base_url!=k.documentBaseURL){F.iframeHTML+=''}if(G.ie7_compat){F.iframeHTML+=''}else{F.iframeHTML+=''}F.iframeHTML+='';for(x=0;x'}F.contentCSS=[];v=G.body_id||"tinymce";if(v.indexOf("=")!=-1){v=F.getParam("body_id","","hash");v=v[F.id]||v}A=G.body_class||"";if(A.indexOf("=")!=-1){A=F.getParam("body_class","","hash");A=A[F.id]||""}F.iframeHTML+='
                    ";if(k.relaxedDomain&&(b||(k.isOpera&&parseFloat(opera.version())<11))){D='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinyMCE.get("'+F.id+'");document.write(ed.iframeHTML);document.close();ed.initContentBody();})()'}q=l.add(p.iframeContainer,"iframe",{id:F.id+"_ifr",src:D||'javascript:""',frameBorder:"0",allowTransparency:"true",title:G.aria_label,style:{width:"100%",height:y,display:"block"}});F.contentAreaContainer=p.iframeContainer;if(p.editorContainer){l.get(p.editorContainer).style.display=F.orgDisplay}B.style.visibility=F.orgVisibility;l.get(F.id).style.display="none";l.setAttrib(F.id,"aria-hidden",true);if(!k.relaxedDomain||!D){F.initContentBody()}B=q=p=null},initContentBody:function(){var n=this,p=n.settings,q=l.get(n.id),r=n.getDoc(),o,m;if((!b||!k.relaxedDomain)&&!p.content_editable){r.open();r.write(n.iframeHTML);r.close();if(k.relaxedDomain){r.domain=k.relaxedDomain}}if(p.content_editable){l.addClass(q,"mceContentBody");n.contentDocument=r=p.content_document||document;n.contentWindow=p.content_window||window;n.bodyElement=q;p.content_document=p.content_window=null}m=n.getBody();m.disabled=true;if(!p.readonly){m.contentEditable=n.getParam("content_editable_state",true)}m.disabled=false;n.schema=new k.html.Schema(p);n.dom=new k.dom.DOMUtils(r,{keep_values:true,url_converter:n.convertURL,url_converter_scope:n,hex_colors:p.force_hex_style_colors,class_filter:p.class_filter,update_styles:true,root_element:p.content_editable?n.id:null,schema:n.schema});n.parser=new k.html.DomParser(p,n.schema);n.parser.addAttributeFilter("src,href,style",function(s,t){var u=s.length,x,z=n.dom,y,v;while(u--){x=s[u];y=x.attr(t);v="data-mce-"+t;if(!x.attributes.map[v]){if(t==="style"){x.attr(v,z.serializeStyle(z.parseStyle(y),x.name))}else{x.attr(v,n.convertURL(y,t,x.name))}}}});n.parser.addNodeFilter("script",function(s,t){var u=s.length,v;while(u--){v=s[u];v.attr("type","mce-"+(v.attr("type")||"text/javascript"))}});n.parser.addNodeFilter("#cdata",function(s,t){var u=s.length,v;while(u--){v=s[u];v.type=8;v.name="#comment";v.value="[CDATA["+v.value+"]]"}});n.parser.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(t,u){var v=t.length,x,s=n.schema.getNonEmptyElements();while(v--){x=t[v];if(x.isEmpty(s)){x.empty().append(new k.html.Node("br",1)).shortEnded=true}}});n.serializer=new k.dom.Serializer(p,n.dom,n.schema);n.selection=new k.dom.Selection(n.dom,n.getWin(),n.serializer);n.formatter=new k.Formatter(n);n.undoManager=new k.UndoManager(n);n.forceBlocks=new k.ForceBlocks(n);n.enterKey=new k.EnterKey(n);n.editorCommands=new k.EditorCommands(n);n.serializer.onPreProcess.add(function(s,t){return n.onPreProcess.dispatch(n,t,s)});n.serializer.onPostProcess.add(function(s,t){return n.onPostProcess.dispatch(n,t,s)});n.onPreInit.dispatch(n);if(!p.gecko_spellcheck){r.body.spellcheck=false}if(!p.readonly){n.bindNativeEvents()}n.controlManager.onPostRender.dispatch(n,n.controlManager);n.onPostRender.dispatch(n);n.quirks=k.util.Quirks(n);if(p.directionality){m.dir=p.directionality}if(p.nowrap){m.style.whiteSpace="nowrap"}if(p.protect){n.onBeforeSetContent.add(function(s,t){i(p.protect,function(u){t.content=t.content.replace(u,function(v){return""})})})}n.onSetContent.add(function(){n.addVisual(n.getBody())});if(p.padd_empty_editor){n.onPostProcess.add(function(s,t){t.content=t.content.replace(/^(]*>( | |\s|\u00a0|)<\/p>[\r\n]*|
                    [\r\n]*)$/,"")})}n.load({initial:true,format:"html"});n.startContent=n.getContent({format:"raw"});n.initialized=true;n.onInit.dispatch(n);n.execCallback("setupcontent_callback",n.id,m,r);n.execCallback("init_instance_callback",n);n.focus(true);n.nodeChanged({initial:true});i(n.contentCSS,function(s){n.dom.loadCSS(s)});if(p.auto_focus){setTimeout(function(){var s=k.get(p.auto_focus);s.selection.select(s.getBody(),1);s.selection.collapse(1);s.getBody().focus();s.getWin().focus()},100)}q=r=m=null},focus:function(p){var o,u=this,t=u.selection,q=u.settings.content_editable,n,r,s=u.getDoc(),m;if(!p){n=t.getRng();if(n.item){r=n.item(0)}u._refreshContentEditable();if(!q){u.getWin().focus()}if(k.isGecko||q){m=u.getBody();if(m.setActive){m.setActive()}else{m.focus()}if(q){t.normalize()}}if(r&&r.ownerDocument==s){n=s.body.createControlRange();n.addElement(r);n.select()}}if(k.activeEditor!=u){if((o=k.activeEditor)!=null){o.onDeactivate.dispatch(o,u)}u.onActivate.dispatch(u,o)}k._setActive(u)},execCallback:function(q){var m=this,p=m.settings[q],o;if(!p){return}if(m.callbackLookup&&(o=m.callbackLookup[q])){p=o.func;o=o.scope}if(d(p,"string")){o=p.replace(/\.\w+$/,"");o=o?k.resolve(o):0;p=k.resolve(p);m.callbackLookup=m.callbackLookup||{};m.callbackLookup[q]={func:p,scope:o}}return p.apply(o||m,Array.prototype.slice.call(arguments,1))},translate:function(m){var o=this.settings.language||"en",n=k.i18n;if(!m){return""}return n[o+"."+m]||m.replace(/\{\#([^\}]+)\}/g,function(q,p){return n[o+"."+p]||"{#"+p+"}"})},getLang:function(o,m){return k.i18n[(this.settings.language||"en")+"."+o]||(d(m)?m:"{#"+o+"}")},getParam:function(t,q,m){var r=k.trim,p=d(this.settings[t])?this.settings[t]:q,s;if(m==="hash"){s={};if(d(p,"string")){i(p.indexOf("=")>0?p.split(/[;,](?![^=;,]*(?:[;,]|$))/):p.split(","),function(n){n=n.split("=");if(n.length>1){s[r(n[0])]=r(n[1])}else{s[r(n[0])]=r(n)}})}else{s=p}return s}return p},nodeChanged:function(q){var m=this,n=m.selection,p;if(m.initialized){q=q||{};p=n.getStart()||m.getBody();p=b&&p.ownerDocument!=m.getDoc()?m.getBody():p;q.parents=[];m.dom.getParent(p,function(o){if(o.nodeName=="BODY"){return true}q.parents.push(o)});m.onNodeChange.dispatch(m,q?q.controlManager||m.controlManager:m.controlManager,p,n.isCollapsed(),q)}},addButton:function(n,o){var m=this;m.buttons=m.buttons||{};m.buttons[n]=o},addCommand:function(m,o,n){this.execCommands[m]={func:o,scope:n||this}},addQueryStateHandler:function(m,o,n){this.queryStateCommands[m]={func:o,scope:n||this}},addQueryValueHandler:function(m,o,n){this.queryValueCommands[m]={func:o,scope:n||this}},addShortcut:function(o,q,m,p){var n=this,r;if(n.settings.custom_shortcuts===false){return false}n.shortcuts=n.shortcuts||{};if(d(m,"string")){r=m;m=function(){n.execCommand(r,false,null)}}if(d(m,"object")){r=m;m=function(){n.execCommand(r[0],r[1],r[2])}}i(g(o),function(s){var t={func:m,scope:p||this,desc:n.translate(q),alt:false,ctrl:false,shift:false};i(g(s,"+"),function(u){switch(u){case"alt":case"ctrl":case"shift":t[u]=true;break;default:t.charCode=u.charCodeAt(0);t.keyCode=u.toUpperCase().charCodeAt(0)}});n.shortcuts[(t.ctrl?"ctrl":"")+","+(t.alt?"alt":"")+","+(t.shift?"shift":"")+","+t.keyCode]=t});return true},execCommand:function(u,r,x,m){var p=this,q=0,v,n;if(!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(u)&&(!m||!m.skip_focus)){p.focus()}m=f({},m);p.onBeforeExecCommand.dispatch(p,u,r,x,m);if(m.terminate){return false}if(p.execCallback("execcommand_callback",p.id,p.selection.getNode(),u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);return true}if(v=p.execCommands[u]){n=v.func.call(v.scope,r,x);if(n!==true){p.onExecCommand.dispatch(p,u,r,x,m);return n}}i(p.plugins,function(o){if(o.execCommand&&o.execCommand(u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);q=1;return false}});if(q){return true}if(p.theme&&p.theme.execCommand&&p.theme.execCommand(u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);return true}if(p.editorCommands.execCommand(u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);return true}p.getDoc().execCommand(u,r,x);p.onExecCommand.dispatch(p,u,r,x,m)},queryCommandState:function(q){var n=this,r,p;if(n._isHidden()){return}if(r=n.queryStateCommands[q]){p=r.func.call(r.scope);if(p!==true){return p}}r=n.editorCommands.queryCommandState(q);if(r!==-1){return r}try{return this.getDoc().queryCommandState(q)}catch(m){}},queryCommandValue:function(r){var n=this,q,p;if(n._isHidden()){return}if(q=n.queryValueCommands[r]){p=q.func.call(q.scope);if(p!==true){return p}}q=n.editorCommands.queryCommandValue(r);if(d(q)){return q}try{return this.getDoc().queryCommandValue(r)}catch(m){}},show:function(){var m=this;l.show(m.getContainer());l.hide(m.id);m.load()},hide:function(){var m=this,n=m.getDoc();if(b&&n){n.execCommand("SelectAll")}m.save();l.hide(m.getContainer());l.setStyle(m.id,"display",m.orgDisplay)},isHidden:function(){return !l.isHidden(this.id)},setProgressState:function(m,n,p){this.onSetProgressState.dispatch(this,m,n,p);return m},load:function(q){var m=this,p=m.getElement(),n;if(p){q=q||{};q.load=true;n=m.setContent(d(p.value)?p.value:p.innerHTML,q);q.element=p;if(!q.no_events){m.onLoadContent.dispatch(m,q)}q.element=p=null;return n}},save:function(r){var m=this,q=m.getElement(),n,p;if(!q||!m.initialized){return}r=r||{};r.save=true;r.element=q;n=r.content=m.getContent(r);if(!r.no_events){m.onSaveContent.dispatch(m,r)}n=r.content;if(!/TEXTAREA|INPUT/i.test(q.nodeName)){q.innerHTML=n;if(p=l.getParent(m.id,"form")){i(p.elements,function(o){if(o.name==m.id){o.value=n;return false}})}}else{q.value=n}r.element=q=null;return n},setContent:function(r,p){var o=this,n,m=o.getBody(),q;p=p||{};p.format=p.format||"html";p.set=true;p.content=r;if(!p.no_events){o.onBeforeSetContent.dispatch(o,p)}r=p.content;if(!k.isIE&&(r.length===0||/^\s+$/.test(r))){q=o.settings.forced_root_block;if(q){r="<"+q+'>
                    "}else{r='
                    '}m.innerHTML=r;o.selection.select(m,true);o.selection.collapse(true);return}if(p.format!=="raw"){r=new k.html.Serializer({},o.schema).serialize(o.parser.parse(r))}p.content=k.trim(r);o.dom.setHTML(m,p.content);if(!p.no_events){o.onSetContent.dispatch(o,p)}o.selection.normalize();return p.content},getContent:function(n){var m=this,o;n=n||{};n.format=n.format||"html";n.get=true;n.getInner=true;if(!n.no_events){m.onBeforeGetContent.dispatch(m,n)}if(n.format=="raw"){o=m.getBody().innerHTML}else{o=m.serializer.serialize(m.getBody(),n)}n.content=k.trim(o);if(!n.no_events){m.onGetContent.dispatch(m,n)}return n.content},isDirty:function(){var m=this;return k.trim(m.startContent)!=k.trim(m.getContent({format:"raw",no_events:1}))&&!m.isNotDirty},getContainer:function(){var m=this;if(!m.container){m.container=l.get(m.editorContainer||m.id+"_parent")}return m.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return l.get(this.settings.content_element||this.id)},getWin:function(){var m=this,n;if(!m.contentWindow){n=l.get(m.id+"_ifr");if(n){m.contentWindow=n.contentWindow}}return m.contentWindow},getDoc:function(){var m=this,n;if(!m.contentDocument){n=m.getWin();if(n){m.contentDocument=n.document}}return m.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(o,n,q){var m=this,p=m.settings;if(p.urlconverter_callback){return m.execCallback("urlconverter_callback",o,q,true,n)}if(!p.convert_urls||(q&&q.nodeName=="LINK")||o.indexOf("file:")===0){return o}if(p.relative_urls){return m.documentBaseURI.toRelative(o)}o=m.documentBaseURI.toAbsolute(o,p.remove_script_host);return o},addVisual:function(q){var n=this,o=n.settings,p=n.dom,m;q=q||n.getBody();if(!d(n.hasVisual)){n.hasVisual=o.visual}i(p.select("table,a",q),function(s){var r;switch(s.nodeName){case"TABLE":m=o.visual_table_class||"mceItemTable";r=p.getAttrib(s,"border");if(!r||r=="0"){if(n.hasVisual){p.addClass(s,m)}else{p.removeClass(s,m)}}return;case"A":if(!s.href){r=p.getAttrib(s,"name")||s.id;m="mceItemAnchor";if(r){if(n.hasVisual){p.addClass(s,m)}else{p.removeClass(s,m)}}}return}});n.onVisualAid.dispatch(n,q,n.hasVisual)},remove:function(){var m=this,n=m.getContainer();if(!m.removed){m.removed=1;m.hide();if(!m.settings.content_editable){j.clear(m.getWin());j.clear(m.getDoc())}j.clear(m.getBody());j.clear(m.formElement);j.unbind(n);m.execCallback("remove_instance_callback",m);m.onRemove.dispatch(m);m.onExecCommand.listeners=[];k.remove(m);l.remove(n)}},destroy:function(n){var m=this;if(m.destroyed){return}if(a){j.unbind(m.getDoc());j.unbind(m.getWin());j.unbind(m.getBody())}if(!n){k.removeUnload(m.destroy);tinyMCE.onBeforeUnload.remove(m._beforeUnload);if(m.theme&&m.theme.destroy){m.theme.destroy()}m.controlManager.destroy();m.selection.destroy();m.dom.destroy()}if(m.formElement){m.formElement.submit=m.formElement._mceOldSubmit;m.formElement._mceOldSubmit=null}m.contentAreaContainer=m.formElement=m.container=m.settings.content_element=m.bodyElement=m.contentDocument=m.contentWindow=null;if(m.selection){m.selection=m.selection.win=m.selection.dom=m.selection.dom.doc=null}m.destroyed=1},_refreshContentEditable:function(){var n=this,m,o;if(n._isHidden()){m=n.getBody();o=m.parentNode;o.removeChild(m);o.appendChild(m);m.focus()}},_isHidden:function(){var m;if(!a){return 0}m=this.selection.getSel();return(!m||!m.rangeCount||m.rangeCount===0)}})})(tinymce);(function(a){var b=a.each;a.Editor.prototype.setupEvents=function(){var c=this,d=c.settings;b(["onPreInit","onBeforeRenderUI","onPostRender","onLoad","onInit","onRemove","onActivate","onDeactivate","onClick","onEvent","onMouseUp","onMouseDown","onDblClick","onKeyDown","onKeyUp","onKeyPress","onContextMenu","onSubmit","onReset","onPaste","onPreProcess","onPostProcess","onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent","onLoadContent","onSaveContent","onNodeChange","onChange","onBeforeExecCommand","onExecCommand","onUndo","onRedo","onVisualAid","onSetProgressState","onSetAttrib"],function(e){c[e]=new a.util.Dispatcher(c)});if(d.cleanup_callback){c.onBeforeSetContent.add(function(e,f){f.content=e.execCallback("cleanup_callback","insert_to_editor",f.content,f)});c.onPreProcess.add(function(e,f){if(f.set){e.execCallback("cleanup_callback","insert_to_editor_dom",f.node,f)}if(f.get){e.execCallback("cleanup_callback","get_from_editor_dom",f.node,f)}});c.onPostProcess.add(function(e,f){if(f.set){f.content=e.execCallback("cleanup_callback","insert_to_editor",f.content,f)}if(f.get){f.content=e.execCallback("cleanup_callback","get_from_editor",f.content,f)}})}if(d.save_callback){c.onGetContent.add(function(e,f){if(f.save){f.content=e.execCallback("save_callback",e.id,f.content,e.getBody())}})}if(d.handle_event_callback){c.onEvent.add(function(f,g,h){if(c.execCallback("handle_event_callback",g,f,h)===false){Event.cancel(g)}})}if(d.handle_node_change_callback){c.onNodeChange.add(function(f,e,g){f.execCallback("handle_node_change_callback",f.id,g,-1,-1,true,f.selection.isCollapsed())})}if(d.save_callback){c.onSaveContent.add(function(e,g){var f=e.execCallback("save_callback",e.id,g.content,e.getBody());if(f){g.content=f}})}if(d.onchange_callback){c.onChange.add(function(f,e){f.execCallback("onchange_callback",f,e)})}};a.Editor.prototype.bindNativeEvents=function(){var l=this,f,d=l.settings,e=l.dom,h;h={mouseup:"onMouseUp",mousedown:"onMouseDown",click:"onClick",keyup:"onKeyUp",keydown:"onKeyDown",keypress:"onKeyPress",submit:"onSubmit",reset:"onReset",contextmenu:"onContextMenu",dblclick:"onDblClick",paste:"onPaste"};function c(i,m){var n=i.type;if(l.removed){return}if(l.onEvent.dispatch(l,i,m)!==false){l[h[i.fakeType||i.type]].dispatch(l,i,m)}}function j(i){l.focus(true)}function k(){l.selection.normalize();l.nodeChanged()}b(h,function(m,n){var i=d.content_editable?l.getBody():l.getDoc();switch(n){case"contextmenu":e.bind(i,n,c);break;case"paste":e.bind(l.getBody(),n,c);break;case"submit":case"reset":e.bind(l.getElement().form||a.DOM.getParent(l.id,"form"),n,c);break;default:e.bind(i,n,c)}});e.bind(d.content_editable?l.getBody():(a.isGecko?l.getDoc():l.getWin()),"focus",function(i){l.focus(true)});if(d.content_editable&&a.isOpera){e.bind(l.getBody(),"click",j);e.bind(l.getBody(),"keydown",j)}l.onMouseUp.add(k);l.onKeyUp.add(function(i,n){var m=n.keyCode;if((m>=33&&m<=36)||(m>=37&&m<=40)||m==13||m==45||m==46||m==8||(a.isMac&&(m==91||m==93))||n.ctrlKey){k()}});l.onReset.add(function(){l.setContent(l.startContent,{format:"raw"})});function g(m,i){if(m.altKey||m.ctrlKey||m.metaKey){b(l.shortcuts,function(n){var o=a.isMac?m.metaKey:m.ctrlKey;if(n.ctrl!=o||n.alt!=m.altKey||n.shift!=m.shiftKey){return}if(m.keyCode==n.keyCode||(m.charCode&&m.charCode==n.charCode)){m.preventDefault();if(i){n.func.call(n.scope)}return true}})}}l.onKeyUp.add(function(i,m){g(m)});l.onKeyPress.add(function(i,m){g(m)});l.onKeyDown.add(function(i,m){g(m,true)});if(a.isOpera){l.onClick.add(function(i,m){m.preventDefault()})}}})(tinymce);(function(d){var e=d.each,b,a=true,c=false;d.EditorCommands=function(n){var m=n.dom,p=n.selection,j={state:{},exec:{},value:{}},k=n.settings,q=n.formatter,o;function r(z,y,x){var v;z=z.toLowerCase();if(v=j.exec[z]){v(z,y,x);return a}return c}function l(x){var v;x=x.toLowerCase();if(v=j.state[x]){return v(x)}return -1}function h(x){var v;x=x.toLowerCase();if(v=j.value[x]){return v(x)}return c}function u(v,x){x=x||"exec";e(v,function(z,y){e(y.toLowerCase().split(","),function(A){j[x][A]=z})})}d.extend(this,{execCommand:r,queryCommandState:l,queryCommandValue:h,addCommands:u});function f(y,x,v){if(x===b){x=c}if(v===b){v=null}return n.getDoc().execCommand(y,x,v)}function t(v){return q.match(v)}function s(v,x){q.toggle(v,x?{value:x}:b)}function i(v){o=p.getBookmark(v)}function g(){p.moveToBookmark(o)}u({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){n.undoManager.add()},"Cut,Copy,Paste":function(z){var y=n.getDoc(),v;try{f(z)}catch(x){v=a}if(v||!y.queryCommandSupported(z)){if(d.isGecko){n.windowManager.confirm(n.getLang("clipboard_msg"),function(A){if(A){open("http://www.mozilla.org/editor/midasdemo/securityprefs.html","_blank")}})}else{n.windowManager.alert(n.getLang("clipboard_no_support"))}}},unlink:function(v){if(p.isCollapsed()){p.select(p.getNode())}f(v);p.collapse(c)},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(v){var x=v.substring(7);e("left,center,right,full".split(","),function(y){if(x!=y){q.remove("align"+y)}});s("align"+x);r("mceRepaint")},"InsertUnorderedList,InsertOrderedList":function(y){var v,x;f(y);v=m.getParent(p.getNode(),"ol,ul");if(v){x=v.parentNode;if(/^(H[1-6]|P|ADDRESS|PRE)$/.test(x.nodeName)){i();m.split(x,v);g()}}},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(v){s(v)},"ForeColor,HiliteColor,FontName":function(y,x,v){s(y,v)},FontSize:function(z,y,x){var v,A;if(x>=1&&x<=7){A=d.explode(k.font_size_style_values);v=d.explode(k.font_size_classes);if(v){x=v[x-1]||x}else{x=A[x-1]||x}}s(z,x)},RemoveFormat:function(v){q.remove(v)},mceBlockQuote:function(v){s("blockquote")},FormatBlock:function(y,x,v){return s(v||"p")},mceCleanup:function(){var v=p.getBookmark();n.setContent(n.getContent({cleanup:a}),{cleanup:a});p.moveToBookmark(v)},mceRemoveNode:function(z,y,x){var v=x||p.getNode();if(v!=n.getBody()){i();n.dom.remove(v,a);g()}},mceSelectNodeDepth:function(z,y,x){var v=0;m.getParent(p.getNode(),function(A){if(A.nodeType==1&&v++==x){p.select(A);return c}},n.getBody())},mceSelectNode:function(y,x,v){p.select(v)},mceInsertContent:function(B,I,K){var y,J,E,z,F,G,D,C,L,x,A,M,v,H;y=n.parser;J=new d.html.Serializer({},n.schema);v='\uFEFF';G={content:K,format:"html"};p.onBeforeSetContent.dispatch(p,G);K=G.content;if(K.indexOf("{$caret}")==-1){K+="{$caret}"}K=K.replace(/\{\$caret\}/,v);if(!p.isCollapsed()){n.getDoc().execCommand("Delete",false,null)}E=p.getNode();G={context:E.nodeName.toLowerCase()};F=y.parse(K,G);A=F.lastChild;if(A.attr("id")=="mce_marker"){D=A;for(A=A.prev;A;A=A.walk(true)){if(A.type==3||!m.isBlock(A.name)){A.parent.insert(D,A,A.name==="br");break}}}if(!G.invalid){K=J.serialize(F);A=E.firstChild;M=E.lastChild;if(!A||(A===M&&A.nodeName==="BR")){m.setHTML(E,K)}else{p.setContent(K)}}else{p.setContent(v);E=n.selection.getNode();z=n.getBody();if(E.nodeType==9){E=A=z}else{A=E}while(A!==z){E=A;A=A.parentNode}K=E==z?z.innerHTML:m.getOuterHTML(E);K=J.serialize(y.parse(K.replace(//i,function(){return J.serialize(F)})));if(E==z){m.setHTML(z,K)}else{m.setOuterHTML(E,K)}}D=m.get("mce_marker");C=m.getRect(D);L=m.getViewPort(n.getWin());if((C.y+C.h>L.y+L.h||C.yL.x+L.w||C.x")},mceToggleVisualAid:function(){n.hasVisual=!n.hasVisual;n.addVisual()},mceReplaceContent:function(y,x,v){n.execCommand("mceInsertContent",false,v.replace(/\{\$selection\}/g,p.getContent({format:"text"})))},mceInsertLink:function(z,y,x){var v;if(typeof(x)=="string"){x={href:x}}v=m.getParent(p.getNode(),"a");x.href=x.href.replace(" ","%20");if(!v||!x.href){q.remove("link")}if(x.href){q.apply("link",x,v)}},selectAll:function(){var x=m.getRoot(),v=m.createRng();v.setStart(x,0);v.setEnd(x,x.childNodes.length);n.selection.setRng(v)}});u({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(z){var x="align"+z.substring(7);var v=p.isCollapsed()?[m.getParent(p.getNode(),m.isBlock)]:p.getSelectedBlocks();var y=d.map(v,function(A){return !!q.matchNode(A,x)});return d.inArray(y,a)!==-1},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(v){return t(v)},mceBlockQuote:function(){return t("blockquote")},Outdent:function(){var v;if(k.inline_styles){if((v=m.getParent(p.getStart(),m.isBlock))&&parseInt(v.style.paddingLeft)>0){return a}if((v=m.getParent(p.getEnd(),m.isBlock))&&parseInt(v.style.paddingLeft)>0){return a}}return l("InsertUnorderedList")||l("InsertOrderedList")||(!k.inline_styles&&!!m.getParent(p.getNode(),"BLOCKQUOTE"))},"InsertUnorderedList,InsertOrderedList":function(v){return m.getParent(p.getNode(),v=="insertunorderedlist"?"UL":"OL")}},"state");u({"FontSize,FontName":function(y){var x=0,v;if(v=m.getParent(p.getNode(),"span")){if(y=="fontsize"){x=v.style.fontSize}else{x=v.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()}}return x}},"value");u({Undo:function(){n.undoManager.undo()},Redo:function(){n.undoManager.redo()}})}})(tinymce);(function(b){var a=b.util.Dispatcher;b.UndoManager=function(h){var l,i=0,e=[],g,k,j,f;function c(){return b.trim(h.getContent({format:"raw",no_events:1}).replace(/]+data-mce-bogus[^>]+>[\u200B\uFEFF]+<\/span>/g,""))}function d(){l.typing=false;l.add()}onBeforeAdd=new a(l);k=new a(l);j=new a(l);f=new a(l);k.add(function(m,n){if(m.hasUndo()){return h.onChange.dispatch(h,n,m)}});j.add(function(m,n){return h.onUndo.dispatch(h,n,m)});f.add(function(m,n){return h.onRedo.dispatch(h,n,m)});h.onInit.add(function(){l.add()});h.onBeforeExecCommand.add(function(m,p,o,q,n){if(p!="Undo"&&p!="Redo"&&p!="mceRepaint"&&(!n||!n.skip_undo)){l.beforeChange()}});h.onExecCommand.add(function(m,p,o,q,n){if(p!="Undo"&&p!="Redo"&&p!="mceRepaint"&&(!n||!n.skip_undo)){l.add()}});h.onSaveContent.add(d);h.dom.bind(h.dom.getRoot(),"dragend",d);h.dom.bind(h.getDoc(),b.isGecko?"blur":"focusout",function(m){if(!h.removed&&l.typing){d()}});h.onKeyUp.add(function(m,o){var n=o.keyCode;if((n>=33&&n<=36)||(n>=37&&n<=40)||n==45||n==13||o.ctrlKey){d()}});h.onKeyDown.add(function(m,o){var n=o.keyCode;if((n>=33&&n<=36)||(n>=37&&n<=40)||n==45){if(l.typing){d()}return}if((n<16||n>20)&&n!=224&&n!=91&&!l.typing){l.beforeChange();l.typing=true;l.add()}});h.onMouseDown.add(function(m,n){if(l.typing){d()}});h.addShortcut("ctrl+z","undo_desc","Undo");h.addShortcut("ctrl+y","redo_desc","Redo");l={data:e,typing:false,onBeforeAdd:onBeforeAdd,onAdd:k,onUndo:j,onRedo:f,beforeChange:function(){g=h.selection.getBookmark(2,true)},add:function(p){var m,n=h.settings,o;p=p||{};p.content=c();l.onBeforeAdd.dispatch(l,p);o=e[i];if(o&&o.content==p.content){return null}if(e[i]){e[i].beforeBookmark=g}if(n.custom_undo_redo_levels){if(e.length>n.custom_undo_redo_levels){for(m=0;m0){n=e[--i];h.setContent(n.content,{format:"raw"});h.selection.moveToBookmark(n.beforeBookmark);l.onUndo.dispatch(l,n)}return n},redo:function(){var m;if(i0||this.typing},hasRedo:function(){return i0){g.moveEnd("character",q)}g.select()}catch(n){}}if(p){c.nodeChanged()}}if(b.forced_root_block){c.onKeyUp.add(f);c.onNodeChange.add(f)}};(function(c){var b=c.DOM,a=c.dom.Event,d=c.each,e=c.extend;c.create("tinymce.ControlManager",{ControlManager:function(f,j){var h=this,g;j=j||{};h.editor=f;h.controls={};h.onAdd=new c.util.Dispatcher(h);h.onPostRender=new c.util.Dispatcher(h);h.prefix=j.prefix||f.id+"_";h._cls={};h.onPostRender.add(function(){d(h.controls,function(i){i.postRender()})})},get:function(f){return this.controls[this.prefix+f]||this.controls[f]},setActive:function(h,f){var g=null;if(g=this.get(h)){g.setActive(f)}return g},setDisabled:function(h,f){var g=null;if(g=this.get(h)){g.setDisabled(f)}return g},add:function(g){var f=this;if(g){f.controls[g.id]=g;f.onAdd.dispatch(g,f)}return g},createControl:function(j){var o,k,g,h=this,m=h.editor,n,f;if(!h.controlFactories){h.controlFactories=[];d(m.plugins,function(i){if(i.createControl){h.controlFactories.push(i)}})}n=h.controlFactories;for(k=0,g=n.length;k1||ae==aw||ae.tagName=="BR"){return ae}}}var ao=Y.selection.getRng();var at=ao.startContainer;var an=ao.endContainer;if(at!=an&&ao.endOffset===0){var ar=ap(at,an);var aq=ar.nodeType==3?ar.length:ar.childNodes.length;ao.setEnd(ar,aq)}return ao}function ab(aq,aw,au,at,ao){var an=[],ap=-1,av,ay=-1,ar=-1,ax;R(aq.childNodes,function(aA,az){if(aA.nodeName==="UL"||aA.nodeName==="OL"){ap=az;av=aA;return false}});R(aq.childNodes,function(aA,az){if(aA.nodeName==="SPAN"&&c.getAttrib(aA,"data-mce-type")=="bookmark"){if(aA.id==aw.id+"_start"){ay=az}else{if(aA.id==aw.id+"_end"){ar=az}}}});if(ap<=0||(ayap)){R(a.grep(aq.childNodes),ao);return 0}else{ax=c.clone(au,V);R(a.grep(aq.childNodes),function(aA,az){if((ayap&&az>ap)){an.push(aA);aA.parentNode.removeChild(aA)}});if(ayap){aq.insertBefore(ax,av.nextSibling)}}at.push(ax);R(an,function(az){ax.appendChild(az)});return ax}}function al(ao,aq,au){var an=[],at,ap,ar=true;at=ak.inline||ak.block;ap=c.create(at);Z(ap);M.walk(ao,function(av){var aw;function ax(ay){var aD,aB,az,aA,aC;aC=ar;aD=ay.nodeName.toLowerCase();aB=ay.parentNode.nodeName.toLowerCase();if(ay.nodeType===1&&x(ay)){aC=ar;ar=x(ay)==="true";aA=true}if(g(aD,"br")){aw=0;if(ak.block){c.remove(ay)}return}if(ak.wrapper&&y(ay,ac,aj)){aw=0;return}if(ar&&!aA&&ak.block&&!ak.wrapper&&I(aD)){ay=c.rename(ay,at);Z(ay);an.push(ay);aw=0;return}if(ak.selector){R(af,function(aE){if("collapsed" in aE&&aE.collapsed!==ag){return}if(c.is(ay,aE.selector)&&!b(ay)){Z(ay,aE);az=true}});if(!ak.inline||az){aw=0;return}}if(ar&&!aA&&d(at,aD)&&d(aB,at)&&!(!au&&ay.nodeType===3&&ay.nodeValue.length===1&&ay.nodeValue.charCodeAt(0)===65279)&&!b(ay)){if(!aw){aw=c.clone(ap,V);ay.parentNode.insertBefore(aw,ay);an.push(aw)}aw.appendChild(ay)}else{if(aD=="li"&&aq){aw=ab(ay,aq,ap,an,ax)}else{aw=0;R(a.grep(ay.childNodes),ax);if(aA){ar=aC}aw=0}}}R(av,ax)});if(ak.wrap_links===false){R(an,function(av){function aw(aA){var az,ay,ax;if(aA.nodeName==="A"){ay=c.clone(ap,V);an.push(ay);ax=a.grep(aA.childNodes);for(az=0;az1||!H(ax))&&av===0){c.remove(ax,1);return}if(ak.inline||ak.wrapper){if(!ak.exact&&av===1){ax=aw(ax)}R(af,function(az){R(c.select(az.inline,ax),function(aB){var aA;if(az.wrap_links===false){aA=aB.parentNode;do{if(aA.nodeName==="A"){return}}while(aA=aA.parentNode)}X(az,aj,aB,az.exact?aB:null)})});if(y(ax.parentNode,ac,aj)){c.remove(ax,1);ax=0;return C}if(ak.merge_with_parents){c.getParent(ax.parentNode,function(az){if(y(az,ac,aj)){c.remove(ax,1);ax=0;return C}})}if(ax&&ak.merge_siblings!==false){ax=u(E(ax),ax);ax=u(ax,E(ax,C))}}})}if(ak){if(ae){if(ae.nodeType){aa=c.createRng();aa.setStartBefore(ae);aa.setEndAfter(ae);al(p(aa,af),null,true)}else{al(ae,null,true)}}else{if(!ag||!ak.inline||c.select("td.mceSelected,th.mceSelected").length){var am=Y.selection.getNode();if(!m&&af[0].defaultBlock&&!c.getParent(am,c.isBlock)){W(af[0].defaultBlock)}Y.selection.setRng(ad());ai=r.getBookmark();al(p(r.getRng(C),af),ai);if(ak.styles&&(ak.styles.color||ak.styles.textDecoration)){a.walk(am,K,"childNodes");K(am)}r.moveToBookmark(ai);P(r.getRng(C));Y.nodeChanged()}else{S("apply",ac,aj)}}}}function B(ab,ak,ad){var ae=T(ab),am=ae[0],ai,ah,aa,aj=true;function ac(at){var ar,aq,ap,ao,av,au;if(at.nodeType===1&&x(at)){av=aj;aj=x(at)==="true";au=true}ar=a.grep(at.childNodes);if(aj&&!au){for(aq=0,ap=ae.length;aq=0;aa--){Z=af[aa].selector;if(!Z){return C}for(ae=ab.length-1;ae>=0;ae--){if(c.is(ab[ae],Z)){return C}}}}return V}a.extend(this,{get:T,register:l,apply:W,remove:B,toggle:F,match:k,matchAll:v,matchNode:y,canApply:z});j();U();function h(Z,aa){if(g(Z,aa.inline)){return C}if(g(Z,aa.block)){return C}if(aa.selector){return c.is(Z,aa.selector)}}function g(aa,Z){aa=aa||"";Z=Z||"";aa=""+(aa.nodeName||aa);Z=""+(Z.nodeName||Z);return aa.toLowerCase()==Z.toLowerCase()}function N(aa,Z){var ab=c.getStyle(aa,Z);if(Z=="color"||Z=="backgroundColor"){ab=c.toHex(ab)}if(Z=="fontWeight"&&ab==700){ab="bold"}return""+ab}function q(Z,aa){if(typeof(Z)!="string"){Z=Z(aa)}else{if(aa){Z=Z.replace(/%(\w+)/g,function(ac,ab){return aa[ab]||ac})}}return Z}function f(Z){return Z&&Z.nodeType===3&&/^([\t \r\n]+|)$/.test(Z.nodeValue)}function Q(ab,aa,Z){var ac=c.create(aa,Z);ab.parentNode.insertBefore(ac,ab);ac.appendChild(ab);return ac}function p(Z,ak,ac){var an,al,af,aj,ab=Z.startContainer,ag=Z.startOffset,ap=Z.endContainer,ai=Z.endOffset;function am(ax){var ar,av,aw,au,at,aq;ar=av=ax?ab:ap;at=ax?"previousSibling":"nextSibling";aq=c.getRoot();if(ar.nodeType==3&&!f(ar)){if(ax?ag>0:aial?al:ag];if(ab.nodeType==3){ag=0}}if(ap.nodeType==1&&ap.hasChildNodes()){al=ap.childNodes.length-1;ap=ap.childNodes[ai>al?al:ai-1];if(ap.nodeType==3){ai=ap.nodeValue.length}}function ao(ar){var aq=ar;while(aq){if(aq.nodeType===1&&x(aq)){return x(aq)==="false"?aq:ar}aq=aq.parentNode}return ar}function ah(ar,aw,ay){var av,at,ax,aq;function au(aA,aC){var aD,az,aB=aA.nodeValue;if(typeof(aC)=="undefined"){aC=ay?aB.length:0}if(ay){aD=aB.lastIndexOf(" ",aC);az=aB.lastIndexOf("\u00a0",aC);aD=aD>az?aD:az;if(aD!==-1&&!ac){aD++}}else{aD=aB.indexOf(" ",aC);az=aB.indexOf("\u00a0",aC);aD=aD!==-1&&(az===-1||aD0&&af.node.nodeType===3&&af.node.nodeValue.charAt(af.offset-1)===" "){if(af.offset>1){ap=af.node;ap.splitText(af.offset-1)}}}}if(ak[0].inline||ak[0].block_expand){if(!ak[0].inline||(ab.nodeType!=3||ag===0)){ab=am(true)}if(!ak[0].inline||(ap.nodeType!=3||ai===ap.nodeValue.length)){ap=am()}}if(ak[0].selector&&ak[0].expand!==V&&!ak[0].inline){ab=ad(ab,"previousSibling");ap=ad(ap,"nextSibling")}if(ak[0].block||ak[0].selector){ab=aa(ab,"previousSibling");ap=aa(ap,"nextSibling");if(ak[0].block){if(!H(ab)){ab=am(true)}if(!H(ap)){ap=am()}}}if(ab.nodeType==1){ag=s(ab);ab=ab.parentNode}if(ap.nodeType==1){ai=s(ap)+1;ap=ap.parentNode}return{startContainer:ab,startOffset:ag,endContainer:ap,endOffset:ai}}function X(af,ae,ac,Z){var ab,aa,ad;if(!h(ac,af)){return V}if(af.remove!="all"){R(af.styles,function(ah,ag){ah=q(ah,ae);if(typeof(ag)==="number"){ag=ah;Z=0}if(!Z||g(N(Z,ag),ah)){c.setStyle(ac,ag,"")}ad=1});if(ad&&c.getAttrib(ac,"style")==""){ac.removeAttribute("style");ac.removeAttribute("data-mce-style")}R(af.attributes,function(ai,ag){var ah;ai=q(ai,ae);if(typeof(ag)==="number"){ag=ai;Z=0}if(!Z||g(c.getAttrib(Z,ag),ai)){if(ag=="class"){ai=c.getAttrib(ac,ag);if(ai){ah="";R(ai.split(/\s+/),function(aj){if(/mce\w+/.test(aj)){ah+=(ah?" ":"")+aj}});if(ah){c.setAttrib(ac,ag,ah);return}}}if(ag=="class"){ac.removeAttribute("className")}if(e.test(ag)){ac.removeAttribute("data-mce-"+ag)}ac.removeAttribute(ag)}});R(af.classes,function(ag){ag=q(ag,ae);if(!Z||c.hasClass(Z,ag)){c.removeClass(ac,ag)}});aa=c.getAttribs(ac);for(ab=0;abab?ab:ad]}if(Z.nodeType===3&&ae&&ad>=Z.nodeValue.length){Z=new t(Z,Y.getBody()).next()||Z}if(Z.nodeType===3&&!ae&&ad===0){Z=new t(Z,Y.getBody()).prev()||Z}return Z}function S(ai,Z,ag){var aj="_mce_caret",aa=Y.settings.caret_debug;function ab(an){var am=c.create("span",{id:aj,"data-mce-bogus":true,style:aa?"color:red":""});if(an){am.appendChild(Y.getDoc().createTextNode(G))}return am}function ah(an,am){while(an){if((an.nodeType===3&&an.nodeValue!==G)||an.childNodes.length>1){return false}if(am&&an.nodeType===1){am.push(an)}an=an.firstChild}return true}function ae(am){while(am){if(am.id===aj){return am}am=am.parentNode}}function ad(am){var an;if(am){an=new t(am,am);for(am=an.current();am;am=an.next()){if(am.nodeType===3){return am}}}}function ac(ao,an){var ap,am;if(!ao){ao=ae(r.getStart());if(!ao){while(ao=c.get(aj)){ac(ao,false)}}}else{am=r.getRng(true);if(ah(ao)){if(an!==false){am.setStartBefore(ao);am.setEndBefore(ao)}c.remove(ao)}else{ap=ad(ao);if(ap.nodeValue.charAt(0)===G){ap=ap.deleteData(0,1)}c.remove(ao,1)}r.setRng(am)}}function af(){var ao,am,at,ar,ap,an,aq;ao=r.getRng(true);ar=ao.startOffset;an=ao.startContainer;aq=an.nodeValue;am=ae(r.getStart());if(am){at=ad(am)}if(aq&&ar>0&&ar=0;aq--){ao.appendChild(c.clone(av[aq],false));ao=ao.firstChild}ao.appendChild(c.doc.createTextNode(G));ao=ao.firstChild;c.insertAfter(au,aw);r.setCursorLocation(ao,1)}}function al(){var an,am,ao;am=ae(r.getStart());if(am&&!c.isEmpty(am)){a.walk(am,function(ap){if(ap.nodeType==1&&ap.id!==aj&&!c.isEmpty(ap)){c.setAttrib(ap,"data-mce-bogus",null)}},"childNodes")}}if(!self._hasCaretEvents){Y.onBeforeGetContent.addToTop(function(){var am=[],an;if(ah(ae(r.getStart()),am)){an=am.length;while(an--){c.setAttrib(am[an],"data-mce-bogus","1")}}});a.each("onMouseUp onKeyUp".split(" "),function(am){Y[am].addToTop(function(){ac();al()})});Y.onKeyDown.addToTop(function(am,ao){var an=ao.keyCode;if(an==8||an==37||an==39){ac(ae(r.getStart()))}al()});r.onSetContent.add(al);self._hasCaretEvents=true}if(ai=="apply"){af()}else{ak()}}function P(aa){var Z=aa.startContainer,ag=aa.startOffset,ac,af,ae,ab,ad;if(Z.nodeType==3&&ag>=Z.nodeValue.length){ag=s(Z);Z=Z.parentNode;ac=true}if(Z.nodeType==1){ab=Z.childNodes;Z=ab[Math.min(ag,ab.length-1)];af=new t(Z,c.getParent(Z,c.isBlock));if(ag>ab.length-1||ac){af.next()}for(ae=af.current();ae;ae=af.next()){if(ae.nodeType==3&&!f(ae)){ad=c.create("a",null,G);ae.parentNode.insertBefore(ad,ae);aa.setStart(ae,0);r.setRng(aa);c.remove(ad);return}}}}}})(tinymce);tinymce.onAddEditor.add(function(e,a){var d,h,g,c=a.settings;function b(j,i){e.each(i,function(l,k){if(l){g.setStyle(j,k,l)}});g.rename(j,"span")}function f(i,j){g=i.dom;if(c.convert_fonts_to_spans){e.each(g.select("font,u,strike",j.node),function(k){d[k.nodeName.toLowerCase()](a.dom,k)})}}if(c.inline_styles){h=e.explode(c.font_size_legacy_values);d={font:function(j,i){b(i,{backgroundColor:i.style.backgroundColor,color:i.color,fontFamily:i.face,fontSize:h[parseInt(i.size,10)-1]})},u:function(j,i){b(i,{textDecoration:"underline"})},strike:function(j,i){b(i,{textDecoration:"line-through"})}};a.onPreProcess.add(f);a.onSetContent.add(f);a.onInit.add(function(){a.selection.onSetContent.add(f)})}});(function(b){var a=b.dom.TreeWalker;b.EnterKey=function(e){var h=e.dom,d=e.selection,c=e.settings,g=e.undoManager;function f(y){var u=d.getRng(true),C,i,x,t,o,H,n,j,l,s,E,v,z;function B(I){return I&&h.isBlock(I)&&!/^(TD|TH|CAPTION)$/.test(I.nodeName)&&!/^(fixed|absolute)/i.test(I.style.position)&&h.getContentEditable(I)!=="true"}function m(J){var O,M,I,P,N,L=J,K;I=h.createRng();if(J.hasChildNodes()){O=new a(J,J);while(M=O.current()){if(M.nodeType==3){I.setStart(M,0);I.setEnd(M,0);break}if(/^(BR|IMG)$/.test(M.nodeName)){I.setStartBefore(M);I.setEndBefore(M);break}L=M;M=O.next()}if(!M){I.setStart(L,0);I.setEnd(L,0)}}else{if(J.nodeName=="BR"){if(J.nextSibling&&h.isBlock(J.nextSibling)){if(!H||H<9){K=h.create("br");J.parentNode.insertBefore(K,J)}I.setStartBefore(J);I.setEndBefore(J)}else{I.setStartAfter(J);I.setEndAfter(J)}}else{I.setStart(J,0);I.setEnd(J,0)}}d.setRng(I);h.remove(K);N=h.getViewPort(e.getWin());P=h.getPos(J).y;if(PN.y+N.h){e.getWin().scrollTo(0,P"}return M}function p(L){var K,J,I;if(x.nodeType==3&&(L?t>0:t=x.nodeValue.length){if(!b.isIE&&!A()){J=h.create("br");u.insertNode(J);u.setStartAfter(J);u.setEndAfter(J);I=true}}J=h.create("br");u.insertNode(J);if(b.isIE&&s=="PRE"&&(!H||H<8)){J.parentNode.insertBefore(h.doc.createTextNode("\r"),J)}if(!I){u.setStartAfter(J);u.setEndAfter(J)}else{u.setStartBefore(J);u.setEndBefore(J)}d.setRng(u);g.add()}function r(I){do{if(I.nodeType===3){I.nodeValue=I.nodeValue.replace(/^[\r\n]+/,"")}I=I.firstChild}while(I)}function F(K){var I=h.getRoot(),J,L;J=K;while(J!==I&&h.getContentEditable(J)!=="false"){if(h.getContentEditable(J)==="true"){L=J}J=J.parentNode}return J!==I?L:I}if(!u.collapsed){e.execCommand("Delete");return}if(y.isDefaultPrevented()){return}x=u.startContainer;t=u.startOffset;v=c.forced_root_block;v=v?v.toUpperCase():"";H=h.doc.documentMode;if(x.nodeType==1&&x.hasChildNodes()){z=t>x.childNodes.length-1;x=x.childNodes[Math.min(t,x.childNodes.length-1)]||x;t=0}i=F(x);if(!i){return}g.beforeChange();if(!h.isBlock(i)&&i!=h.getRoot()){if(!v||y.shiftKey){G()}return}if((v&&!y.shiftKey)||(!v&&y.shiftKey)){x=k(x,t)}o=h.getParent(x,h.isBlock);l=o?h.getParent(o.parentNode,h.isBlock):null;s=o?o.nodeName.toUpperCase():"";E=l?l.nodeName.toUpperCase():"";if(s=="LI"&&h.isEmpty(o)){if(/^(UL|OL|LI)$/.test(l.parentNode.nodeName)){return false}D();return}if(s=="PRE"&&c.br_in_pre!==false){if(!y.shiftKey){G();return}}else{if((!v&&!y.shiftKey&&s!="LI")||(v&&y.shiftKey)){G();return}}v=v||"P";if(p()){if(/^(H[1-6]|PRE)$/.test(s)&&E!="HGROUP"){n=q(v)}else{n=q()}if(c.end_container_on_empty_block&&B(l)&&h.isEmpty(o)){n=h.split(l,o)}else{h.insertAfter(n,o)}}else{if(p(true)){n=o.parentNode.insertBefore(q(),o)}else{C=u.cloneRange();C.setEndAfter(o);j=C.extractContents();r(j);n=j.firstChild;h.insertAfter(j,o)}}h.setAttrib(n,"id","");m(n);g.add()}e.onKeyDown.add(function(j,i){if(i.keyCode==13){if(f(i)!==false){i.preventDefault()}}})}})(tinymce); \ No newline at end of file diff --git a/lib/editor/tinymce/tiny_mce/3.5/tiny_mce_prototype_src.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/tiny_mce_prototype_src.js similarity index 98% rename from lib/editor/tinymce/tiny_mce/3.5/tiny_mce_prototype_src.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/tiny_mce_prototype_src.js index 7406a2a47b0..e882b7ef9f3 100644 --- a/lib/editor/tinymce/tiny_mce/3.5/tiny_mce_prototype_src.js +++ b/lib/editor/tinymce/tiny_mce/3.5.1.1/tiny_mce_prototype_src.js @@ -1606,6 +1606,14 @@ tinymce.util.Quirks = function(editor) { editor.onSetContent.add(selection.onSetContent.add(fixLinks)); }; + function setDefaultBlockType() { + if (settings.forced_root_block) { + editor.onInit.add(function() { + setEditorCommandState('DefaultParagraphSeparator', settings.forced_root_block); + }); + } + } + function removeGhostSelection() { function repaint(sender, args) { if (!sender || !args.initial) { @@ -1640,6 +1648,7 @@ tinymce.util.Quirks = function(editor) { cleanupStylesWhenDeleting(); inputMethodFocus(); selectControlElements(); + setDefaultBlockType(); // iOS if (tinymce.isIDevice) { @@ -2115,8 +2124,11 @@ tinymce.html.Styles = function(settings, schema) { if (!html5) { html5 = mapCache.html5 = unpack({ A : 'id|accesskey|class|dir|draggable|item|hidden|itemprop|role|spellcheck|style|subject|title', - B : '#|a|abbr|area|audio|b|bdo|br|button|canvas|cite|code|command|datalist|del|dfn|em|embed|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|meta|meter|noscript|object|output|progress|q|ruby|samp|script|select|small|span|strong|sub|sup|svg|textarea|time|var|video', - C : '#|a|abbr|area|address|article|aside|audio|b|bdo|blockquote|br|button|canvas|cite|code|command|datalist|del|details|dfn|dialog|div|dl|em|embed|fieldset|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|menu|meta|meter|nav|noscript|ol|object|output|p|pre|progress|q|ruby|samp|script|section|select|small|span|strong|style|sub|sup|svg|table|textarea|time|ul|var|video' + B : '#|a|abbr|area|audio|b|bdo|br|button|canvas|cite|code|command|datalist|del|dfn|em|embed|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|meta|' + + 'meter|noscript|object|output|progress|q|ruby|samp|script|select|small|span|strong|sub|sup|svg|textarea|time|var|video', + C : '#|a|abbr|area|address|article|aside|audio|b|bdo|blockquote|br|button|canvas|cite|code|command|datalist|del|details|dfn|dialog|div|dl|em|embed|fieldset|' + + 'figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|menu|meta|meter|nav|noscript|ol|object|output|' + + 'p|pre|progress|q|ruby|samp|script|section|select|small|span|strong|style|sub|sup|svg|table|textarea|time|ul|var|video' }, 'html[A|manifest][body|head]' + 'head[A][base|command|link|meta|noscript|script|style|title]' + 'title[A][#]' + @@ -2152,7 +2164,7 @@ tinymce.html.Styles = function(settings, schema) { 'dl[A][dd|dt]' + 'dt[A][B]' + 'dd[A][C]' + - 'a[A|href|target|ping|rel|media|type][C]' + + 'a[A|href|target|ping|rel|media|type][B]' + 'em[A][B]' + 'strong[A][B]' + 'small[A][B]' + @@ -2198,7 +2210,8 @@ tinymce.html.Styles = function(settings, schema) { 'form[A|accept-charset|action|autocomplete|enctype|method|name|novalidate|target][C]' + 'fieldset[A|disabled|form|name][C|legend]' + 'label[A|form|for][B]' + - 'input[A|type|accept|alt|autocomplete|checked|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|height|list|max|maxlength|min|multiple|pattern|placeholder|readonly|required|size|src|step|width|files|value][]' + + 'input[A|type|accept|alt|autocomplete|checked|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|height|list|max|maxlength|min|' + + 'multiple|pattern|placeholder|readonly|required|size|src|step|width|files|value|name][]' + 'button[A|autofocus|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|name|value|type][B]' + 'select[A|autofocus|disabled|form|multiple|name|size][option|optgroup]' + 'datalist[A][B|option]' + @@ -2401,13 +2414,13 @@ tinymce.html.Styles = function(settings, schema) { // Setup map objects whiteSpaceElementsMap = createLookupTable('whitespace_elements', 'pre script style textarea'); - selfClosingElementsMap = createLookupTable('self_closing_elements', 'colgroup dd dt li options p td tfoot th thead tr'); + selfClosingElementsMap = createLookupTable('self_closing_elements', 'colgroup dd dt li option p td tfoot th thead tr'); shortEndedElementsMap = createLookupTable('short_ended_elements', 'area base basefont br col frame hr img input isindex link meta param embed source'); boolAttrMap = createLookupTable('boolean_attributes', 'checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls'); nonEmptyElementsMap = createLookupTable('non_empty_elements', 'td th iframe video audio object', shortEndedElementsMap); blockElementsMap = createLookupTable('block_elements', 'h1 h2 h3 h4 h5 h6 hr p div address pre form table tbody thead tfoot ' + 'th tr td li ol ul caption blockquote center dl dt dd dir fieldset ' + - 'noscript menu isindex samp header footer article section hgroup aside nav figure'); + 'noscript menu isindex samp header footer article section hgroup aside nav figure option datalist select optgroup'); // Converts a wildcard expression string to a regexp for example *a will become /.*a/. function patternToRegExp(str) { @@ -2851,7 +2864,7 @@ tinymce.html.Styles = function(settings, schema) { // Setup lookup tables for empty elements and boolean attributes shortEndedElements = schema.getShortEndedElements(); - selfClosing = schema.getSelfClosingElements(); + selfClosing = settings.self_closing_elements || schema.getSelfClosingElements(); fillAttrsMap = schema.getBoolAttrs(); validate = settings.validate; removeInternalElements = settings.remove_internals; @@ -3597,9 +3610,23 @@ tinymce.html.Styles = function(settings, schema) { } }; + function cloneAndExcludeBlocks(input) { + var name, output = {}; + + for (name in input) { + if (name !== 'li' && name != 'p') { + output[name] = input[name]; + } + } + + return output; + }; + parser = new tinymce.html.SaxParser({ validate : validate, - fix_self_closing : !validate, // Let the DOM parser handle
                  7. in
                  8. or

                    in

                    for better results + + // Exclude P and LI from DOM parsing since it's treated better by the DOM parser + self_closing_elements: cloneAndExcludeBlocks(schema.getSelfClosingElements()), cdata: function(text) { node.append(createNode('#cdata', 4)).value = text; @@ -3777,7 +3804,7 @@ tinymce.html.Styles = function(settings, schema) { node.empty().append(new Node('#text', '3')).value = '\u00a0'; else { // Leave nodes that have a name like - if (!node.attributes.map.name) { + if (!node.attributes.map.name && !node.attributes.map.id) { tempNode = node.parent; node.empty().remove(); node = tempNode; @@ -3929,12 +3956,12 @@ tinymce.html.Styles = function(settings, schema) { // Force anchor names closed, unless the setting "allow_html_in_named_anchor" is explicitly included. if (!settings.allow_html_in_named_anchor) { - self.addAttributeFilter('name', function(nodes, name) { + self.addAttributeFilter('id,name', function(nodes, name) { var i = nodes.length, sibling, prevSibling, parent, node; while (i--) { node = nodes[i]; - if (node.name === 'a' && node.firstChild) { + if (node.name === 'a' && node.firstChild && !node.attr('href')) { parent = node.parent; // Move children after current node @@ -6165,7 +6192,8 @@ tinymce.dom.TreeWalker = function(start_node, root_node) { cloneContents : cloneContents, insertNode : insertNode, surroundContents : surroundContents, - cloneRange : cloneRange + cloneRange : cloneRange, + toStringIE : toStringIE }); function createDocumentFragment() { @@ -6805,9 +6833,20 @@ tinymce.dom.TreeWalker = function(start_node, root_node) { n.parentNode.removeChild(n); }; + + function toStringIE() { + return dom.create('body', null, cloneContents()).outerText; + } + + return t; }; ns.Range = Range; + + // Older IE versions doesn't let you override toString by it's constructor so we have to stick it in the prototype + Range.prototype.toString = function() { + return this.toStringIE(); + }; })(tinymce.dom); (function() { function Selection(selection) { @@ -7162,7 +7201,7 @@ tinymce.dom.TreeWalker = function(start_node, root_node) { }; this.addRange = function(rng) { - var ieRng, ctrlRng, startContainer, startOffset, endContainer, endOffset, doc = selection.dom.doc, body = doc.body; + var ieRng, ctrlRng, startContainer, startOffset, endContainer, endOffset, sibling, doc = selection.dom.doc, body = doc.body; function setEndPoint(start) { var container, offset, marker, tmpRng, nodes; @@ -7220,11 +7259,25 @@ tinymce.dom.TreeWalker = function(start_node, root_node) { // Trick to place the caret inside an empty block element like

                    if (startOffset == endOffset && !startContainer.hasChildNodes()) { if (startContainer.canHaveHTML) { + // Check if previous sibling is an empty block if it is then we need to render it + // IE would otherwise move the caret into the sibling instead of the empty startContainer see: #5236 + // Example this:

                    |

                    would become this:

                    |

                    + sibling = startContainer.previousSibling; + if (sibling && !sibling.hasChildNodes() && dom.isBlock(sibling)) { + sibling.innerHTML = '\uFEFF'; + } else { + sibling = null; + } + startContainer.innerHTML = '\uFEFF\uFEFF'; ieRng.moveToElementText(startContainer.lastChild); ieRng.select(); dom.doc.selection.clear(); startContainer.innerHTML = ''; + + if (sibling) { + sibling.innerHTML = ''; + } return; } else { startOffset = dom.nodeIndex(startContainer); @@ -10209,11 +10262,10 @@ window.tinymce.dom.Sizzle = Sizzle; } // Create new script element - elm = dom.create('script', { - id : id, - type : 'text/javascript', - src : tinymce._addVer(url) - }); + elm = document.createElement('script'); + elm.id = id; + elm.type = 'text/javascript'; + elm.src = tinymce._addVer(url); // Add onload listener for non IE browsers since IE9 // fires onload event before the script is parsed and executed @@ -10575,12 +10627,15 @@ window.tinymce.dom.Sizzle = Sizzle; t.destroy = function() { each(items, function(item) { - dom.unbind(dom.get(item.id), 'focus', itemFocussed); - dom.unbind(dom.get(item.id), 'blur', itemBlurred); + var elm = dom.get(item.id); + + dom.unbind(elm, 'focus', itemFocussed); + dom.unbind(elm, 'blur', itemBlurred); }); - dom.unbind(dom.get(root), 'focus', rootFocussed); - dom.unbind(dom.get(root), 'keydown', rootKeydown); + var rootElm = dom.get(root); + dom.unbind(rootElm, 'focus', rootFocussed); + dom.unbind(rootElm, 'keydown', rootKeydown); items = dom = root = t.focus = itemFocussed = itemBlurred = rootKeydown = rootFocussed = null; t.destroy = function() {}; @@ -10659,21 +10714,23 @@ window.tinymce.dom.Sizzle = Sizzle; // Set up state and listeners for each item. each(items, function(item, idx) { - var tabindex; + var tabindex, elm; if (!item.id) { item.id = dom.uniqueId('_mce_item_'); } + elm = dom.get(item.id); + if (excludeFromTabOrder) { - dom.bind(item.id, 'blur', itemBlurred); + dom.bind(elm, 'blur', itemBlurred); tabindex = '-1'; } else { tabindex = (idx === 0 ? '0' : '-1'); } - dom.setAttrib(item.id, 'tabindex', tabindex); - dom.bind(dom.get(item.id), 'focus', itemFocussed); + elm.setAttribute('tabindex', tabindex); + dom.bind(elm, 'focus', itemFocussed); }); // Setup initial state for root element. @@ -10682,10 +10739,11 @@ window.tinymce.dom.Sizzle = Sizzle; } dom.setAttrib(root, 'tabindex', '-1'); - + // Setup listeners for root element. - dom.bind(dom.get(root), 'focus', rootFocussed); - dom.bind(dom.get(root), 'keydown', rootKeydown); + var rootElm = dom.get(root); + dom.bind(rootElm, 'focus', rootFocussed); + dom.bind(rootElm, 'keydown', rootKeydown); } }); })(tinymce); @@ -12787,8 +12845,8 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { inline_styles : TRUE, convert_fonts_to_spans : TRUE, indent : 'simple', - indent_before : 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure', - indent_after : 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure', + indent_before : 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist', + indent_after : 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist', validate : TRUE, entity_encoding : 'named', url_converter : self.convertURL, @@ -12848,6 +12906,10 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { if (!/TEXTAREA|INPUT/i.test(t.getElement().nodeName) && s.hidden_input && DOM.getParent(id, 'form')) DOM.insertAfter(DOM.create('input', {type : 'hidden', name : id}), id); + // Hide target element early to prevent content flashing + t.orgVisibility = t.getElement().style.visibility; + t.getElement().style.visibility = 'hidden'; + if (tinymce.WindowManager) t.windowManager = new tinymce.WindowManager(t); @@ -12910,7 +12972,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { //sl.add(tinymce.baseURL + '/langs/' + s.language + '.js'); sl.add(tinymce.baseURL + '/../../extra/strings.php?elanguage=' + s.language + 'ðeme=' + s.theme); // Moodle modification - load one huge strings file - if (s.theme && s.theme.charAt(0) != '-' && !ThemeManager.urls[s.theme]) + if (s.theme && typeof s.theme != "function" && s.theme.charAt(0) != '-' && !ThemeManager.urls[s.theme]) ThemeManager.load(s.theme, 'themes/' + s.theme + '/editor_template' + tinymce.suffix + '.js'); each(explode(s.plugins), function(p) { @@ -12951,13 +13013,18 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { s.aria_label = s.aria_label || DOM.getAttrib(e, 'aria-label', t.getLang('aria.rich_text_area')); if (s.theme) { - s.theme = s.theme.replace(/-/, ''); - o = ThemeManager.get(s.theme); - t.theme = new o(); + if (typeof s.theme != "function") { + s.theme = s.theme.replace(/-/, ''); + o = ThemeManager.get(s.theme); + t.theme = new o(); - if (t.theme.init) - t.theme.init(t, ThemeManager.urls[s.theme] || tinymce.documentBaseURL.replace(/\/$/, '')); + if (t.theme.init) + t.theme.init(t, ThemeManager.urls[s.theme] || tinymce.documentBaseURL.replace(/\/$/, '')); + } else { + t.theme = s.theme; + } } + function initPlugin(p) { var c = PluginManager.get(p), u = PluginManager.urls[p] || tinymce.documentBaseURL.replace(/\/$/, ''), po; if (c && tinymce.inArray(initializedPlugins,p) === -1) { @@ -13002,26 +13069,57 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { // Measure box if (s.render_ui && t.theme) { - w = s.width || e.style.width || e.offsetWidth; - h = s.height || e.style.height || e.offsetHeight; t.orgDisplay = e.style.display; - re = /^[0-9\.]+(|px)$/i; - if (re.test('' + w)) - w = Math.max(parseInt(w, 10) + (o.deltaWidth || 0), 100); + if (typeof s.theme != "function") { + w = s.width || e.style.width || e.offsetWidth; + h = s.height || e.style.height || e.offsetHeight; + re = /^[0-9\.]+(|px)$/i; - if (re.test('' + h)) - //h = Math.max(parseInt(h, 10) + (o.deltaHeight || 0), 100); - h = Math.max(parseInt(h) + (o.deltaHeight || 0), s.theme_advanced_resizing_min_height || 100); // Moodle hack + if (re.test('' + w)) + w = Math.max(parseInt(w, 10) + (o.deltaWidth || 0), 100); - // Render UI - o = t.theme.renderUI({ - targetNode : e, - width : w, - height : h, - deltaWidth : s.delta_width, - deltaHeight : s.delta_height - }); + if (re.test('' + h)) + //h = Math.max(parseInt(h, 10) + (o.deltaHeight || 0), 100); + h = Math.max(parseInt(h) + (o.deltaHeight || 0), s.theme_advanced_resizing_min_height || 100); // Moodle hack + + // Render UI + o = t.theme.renderUI({ + targetNode : e, + width : w, + height : h, + deltaWidth : s.delta_width, + deltaHeight : s.delta_height + }); + + // Resize editor + DOM.setStyles(o.sizeContainer || o.editorContainer, { + width : w, + height : h + }); + + h = (o.iframeHeight || h) + (typeof(h) == 'number' ? (o.deltaHeight || 0) : ''); + //if (h < 100) + // h = 100; + if (h < (s.theme_advanced_resizing_min_height || 100)) // Moodle hack + h = s.theme_advanced_resizing_min_height || 100; // Moodle hack + + } else { + o = s.theme(t, e); + + // Convert element type to id:s + if (o.editorContainer.nodeType) { + o.editorContainer = o.editorContainer.id = o.editorContainer.id || t.id + "_parent"; + } + + // Convert element type to id:s + if (o.iframeContainer.nodeType) { + o.iframeContainer = o.iframeContainer.id = o.iframeContainer.id || t.id + "_iframecontainer"; + } + + // Use specified iframe height or the targets offsetHeight + h = o.iframeHeight || e.offsetHeight; + } t.editorContainer = o.editorContainer; } @@ -13043,18 +13141,6 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { if (document.domain && location.hostname != document.domain) tinymce.relaxedDomain = document.domain; - // Resize editor - DOM.setStyles(o.sizeContainer || o.editorContainer, { - width : w, - height : h - }); - - h = (o.iframeHeight || h) + (typeof(h) == 'number' ? (o.deltaHeight || 0) : ''); - //if (h < 100) - // h = 100; - if (h < (s.theme_advanced_resizing_min_height || 100)) // Moodle hack - h = s.theme_advanced_resizing_min_height || 100; // Moodle hack - t.iframeHTML = s.doctype + ''; // We only need to override paths if we have to @@ -13113,7 +13199,14 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { }); t.contentAreaContainer = o.iframeContainer; - DOM.get(o.editorContainer).style.display = t.orgDisplay; + + if (o.editorContainer) { + DOM.get(o.editorContainer).style.display = t.orgDisplay; + } + + // Restore visibility on target element + e.style.visibility = t.orgVisibility; + DOM.get(t.id).style.display = 'none'; DOM.setAttrib(t.id, 'aria-hidden', true); @@ -13438,9 +13531,6 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { if (self.initialized) { o = o || {}; - // Normalize selection for example a|a becomes a|a - selection.normalize(); - // Get start node node = selection.getStart() || self.getBody(); node = isIE && node.ownerDocument != self.getDoc() ? self.getBody() : node; // Fix for IE initial state @@ -13918,14 +14008,16 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { return; case 'A': - value = dom.getAttrib(elm, 'name'); - cls = 'mceItemAnchor'; + if (!elm.href) { + value = dom.getAttrib(elm, 'name') || elm.id; + cls = 'mceItemAnchor'; - if (value) { - if (self.hasVisual) - dom.addClass(elm, cls); - else - dom.removeClass(elm, cls); + if (value) { + if (self.hasVisual) + dom.addClass(elm, cls); + else + dom.removeClass(elm, cls); + } } return; @@ -14220,6 +14312,12 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { self.focus(true); }; + function nodeChanged() { + // Normalize selection for example a|a becomes a|a + self.selection.normalize(); + self.nodeChanged(); + } + // Add DOM events each(nativeToDispatcherMap, function(dispatcherName, nativeName) { var root = settings.content_editable ? self.getBody() : self.getDoc(); @@ -14254,13 +14352,13 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { } // Add node change handler - self.onMouseUp.add(self.nodeChanged); + self.onMouseUp.add(nodeChanged); self.onKeyUp.add(function(ed, e) { var keyCode = e.keyCode; if ((keyCode >= 33 && keyCode <= 36) || (keyCode >= 37 && keyCode <= 40) || keyCode == 13 || keyCode == 45 || keyCode == 46 || keyCode == 8 || (tinymce.isMac && (keyCode == 91 || keyCode == 93)) || e.ctrlKey) - self.nodeChanged(); + nodeChanged(); }); // Add reset handler @@ -14867,9 +14965,10 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { }; // Create event instances - onAdd = new Dispatcher(self); - onUndo = new Dispatcher(self); - onRedo = new Dispatcher(self); + onBeforeAdd = new Dispatcher(self); + onAdd = new Dispatcher(self); + onUndo = new Dispatcher(self); + onRedo = new Dispatcher(self); // Pass though onAdd event from UndoManager to Editor as onChange onAdd.add(function(undoman, level) { @@ -14958,6 +15057,8 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { data : data, typing : false, + + onBeforeAdd: onBeforeAdd, onAdd : onAdd, @@ -14974,6 +15075,8 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { level = level || {}; level.content = getContent(); + + self.onBeforeAdd.dispatch(self, level); // Add undo level if needed lastLevel = data[index]; @@ -15074,7 +15177,7 @@ tinymce.ForceBlocks = function(editor) { return; // Check if node is wrapped in block - while (node != rootNode) { + while (node && node != rootNode) { if (blockElements[node.nodeName]) return; @@ -15214,28 +15317,40 @@ tinymce.ForceBlocks = function(editor) { return c; }, - createControl : function(n) { - var c, t = this, ed = t.editor; + createControl : function(name) { + var ctrl, i, l, self = this, editor = self.editor, factories, ctrlName; - each(ed.plugins, function(p) { - if (p.createControl) { - c = p.createControl(n, t); - - if (c) - return false; - } - }); - - switch (n) { - case "|": - case "separator": - return t.createSeparator(); + // Build control factory cache + if (!self.controlFactories) { + self.controlFactories = []; + each(editor.plugins, function(plugin) { + if (plugin.createControl) { + self.controlFactories.push(plugin); + } + }); } - if (!c && ed.buttons && (c = ed.buttons[n])) - return t.createButton(n, c); + // Create controls by asking cached factories + factories = self.controlFactories; + for (i = 0, l = factories.length; i < l; i++) { + ctrl = factories[i].createControl(name, self); - return t.add(c); + if (ctrl) { + return self.add(ctrl); + } + } + + // Create sepearator + if (name === "|" || name === "separator") { + return self.createSeparator(); + } + + // Create control from button collection + if (editor.buttons && (ctrl = editor.buttons[name])) { + return self.createButton(name, ctrl); + } + + return self.add(ctrl); }, createDropMenu : function(id, s, cc) { @@ -17495,6 +17610,21 @@ tinymce.ForceBlocks = function(editor) { } }; + // Checks if the parent caret container node isn't empty if that is the case it + // will remove the bogus state on all children that isn't empty + function unmarkBogusCaretParents() { + var i, caretContainer, node; + + caretContainer = getParentCaretContainer(selection.getStart()); + if (caretContainer && !dom.isEmpty(caretContainer)) { + tinymce.walk(caretContainer, function(node) { + if (node.nodeType == 1 && node.id !== caretContainerId && !dom.isEmpty(node)) { + dom.setAttrib(node, 'data-mce-bogus', null); + } + }, 'childNodes'); + } + }; + // Only bind the caret events once if (!self._hasCaretEvents) { // Mark current caret container elements as bogus when getting the contents so we don't end up with empty elements @@ -17514,6 +17644,7 @@ tinymce.ForceBlocks = function(editor) { tinymce.each('onMouseUp onKeyUp'.split(' '), function(name) { ed[name].addToTop(function() { removeCaretContainer(); + unmarkBogusCaretParents(); }); }); @@ -17524,16 +17655,12 @@ tinymce.ForceBlocks = function(editor) { if (keyCode == 8 || keyCode == 37 || keyCode == 39) { removeCaretContainer(getParentCaretContainer(selection.getStart())); } + + unmarkBogusCaretParents(); }); // Remove bogus state if they got filled by contents using editor.selection.setContent - selection.onSetContent.add(function() { - dom.getParent(selection.getStart(), function(node) { - if (node.id !== caretContainerId && dom.getAttrib(node, 'data-mce-bogus') && !dom.isEmpty(node)) { - dom.setAttrib(node, 'data-mce-bogus', null); - } - }); - }); + selection.onSetContent.add(unmarkBogusCaretParents); self._hasCaretEvents = true; } diff --git a/lib/editor/tinymce/tiny_mce/3.5/tiny_mce_src.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/tiny_mce_src.js similarity index 98% rename from lib/editor/tinymce/tiny_mce/3.5/tiny_mce_src.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/tiny_mce_src.js index 18b2159a2a7..7c04a56a6a1 100644 --- a/lib/editor/tinymce/tiny_mce/3.5/tiny_mce_src.js +++ b/lib/editor/tinymce/tiny_mce/3.5.1.1/tiny_mce_src.js @@ -1579,6 +1579,14 @@ tinymce.util.Quirks = function(editor) { editor.onSetContent.add(selection.onSetContent.add(fixLinks)); }; + function setDefaultBlockType() { + if (settings.forced_root_block) { + editor.onInit.add(function() { + setEditorCommandState('DefaultParagraphSeparator', settings.forced_root_block); + }); + } + } + function removeGhostSelection() { function repaint(sender, args) { if (!sender || !args.initial) { @@ -1613,6 +1621,7 @@ tinymce.util.Quirks = function(editor) { cleanupStylesWhenDeleting(); inputMethodFocus(); selectControlElements(); + setDefaultBlockType(); // iOS if (tinymce.isIDevice) { @@ -2088,8 +2097,11 @@ tinymce.html.Styles = function(settings, schema) { if (!html5) { html5 = mapCache.html5 = unpack({ A : 'id|accesskey|class|dir|draggable|item|hidden|itemprop|role|spellcheck|style|subject|title', - B : '#|a|abbr|area|audio|b|bdo|br|button|canvas|cite|code|command|datalist|del|dfn|em|embed|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|meta|meter|noscript|object|output|progress|q|ruby|samp|script|select|small|span|strong|sub|sup|svg|textarea|time|var|video', - C : '#|a|abbr|area|address|article|aside|audio|b|bdo|blockquote|br|button|canvas|cite|code|command|datalist|del|details|dfn|dialog|div|dl|em|embed|fieldset|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|menu|meta|meter|nav|noscript|ol|object|output|p|pre|progress|q|ruby|samp|script|section|select|small|span|strong|style|sub|sup|svg|table|textarea|time|ul|var|video' + B : '#|a|abbr|area|audio|b|bdo|br|button|canvas|cite|code|command|datalist|del|dfn|em|embed|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|meta|' + + 'meter|noscript|object|output|progress|q|ruby|samp|script|select|small|span|strong|sub|sup|svg|textarea|time|var|video', + C : '#|a|abbr|area|address|article|aside|audio|b|bdo|blockquote|br|button|canvas|cite|code|command|datalist|del|details|dfn|dialog|div|dl|em|embed|fieldset|' + + 'figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|menu|meta|meter|nav|noscript|ol|object|output|' + + 'p|pre|progress|q|ruby|samp|script|section|select|small|span|strong|style|sub|sup|svg|table|textarea|time|ul|var|video' }, 'html[A|manifest][body|head]' + 'head[A][base|command|link|meta|noscript|script|style|title]' + 'title[A][#]' + @@ -2125,7 +2137,7 @@ tinymce.html.Styles = function(settings, schema) { 'dl[A][dd|dt]' + 'dt[A][B]' + 'dd[A][C]' + - 'a[A|href|target|ping|rel|media|type][C]' + + 'a[A|href|target|ping|rel|media|type][B]' + 'em[A][B]' + 'strong[A][B]' + 'small[A][B]' + @@ -2171,7 +2183,8 @@ tinymce.html.Styles = function(settings, schema) { 'form[A|accept-charset|action|autocomplete|enctype|method|name|novalidate|target][C]' + 'fieldset[A|disabled|form|name][C|legend]' + 'label[A|form|for][B]' + - 'input[A|type|accept|alt|autocomplete|checked|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|height|list|max|maxlength|min|multiple|pattern|placeholder|readonly|required|size|src|step|width|files|value][]' + + 'input[A|type|accept|alt|autocomplete|checked|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|height|list|max|maxlength|min|' + + 'multiple|pattern|placeholder|readonly|required|size|src|step|width|files|value|name][]' + 'button[A|autofocus|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|name|value|type][B]' + 'select[A|autofocus|disabled|form|multiple|name|size][option|optgroup]' + 'datalist[A][B|option]' + @@ -2374,13 +2387,13 @@ tinymce.html.Styles = function(settings, schema) { // Setup map objects whiteSpaceElementsMap = createLookupTable('whitespace_elements', 'pre script style textarea'); - selfClosingElementsMap = createLookupTable('self_closing_elements', 'colgroup dd dt li options p td tfoot th thead tr'); + selfClosingElementsMap = createLookupTable('self_closing_elements', 'colgroup dd dt li option p td tfoot th thead tr'); shortEndedElementsMap = createLookupTable('short_ended_elements', 'area base basefont br col frame hr img input isindex link meta param embed source'); boolAttrMap = createLookupTable('boolean_attributes', 'checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls'); nonEmptyElementsMap = createLookupTable('non_empty_elements', 'td th iframe video audio object', shortEndedElementsMap); blockElementsMap = createLookupTable('block_elements', 'h1 h2 h3 h4 h5 h6 hr p div address pre form table tbody thead tfoot ' + 'th tr td li ol ul caption blockquote center dl dt dd dir fieldset ' + - 'noscript menu isindex samp header footer article section hgroup aside nav figure'); + 'noscript menu isindex samp header footer article section hgroup aside nav figure option datalist select optgroup'); // Converts a wildcard expression string to a regexp for example *a will become /.*a/. function patternToRegExp(str) { @@ -2824,7 +2837,7 @@ tinymce.html.Styles = function(settings, schema) { // Setup lookup tables for empty elements and boolean attributes shortEndedElements = schema.getShortEndedElements(); - selfClosing = schema.getSelfClosingElements(); + selfClosing = settings.self_closing_elements || schema.getSelfClosingElements(); fillAttrsMap = schema.getBoolAttrs(); validate = settings.validate; removeInternalElements = settings.remove_internals; @@ -3570,9 +3583,23 @@ tinymce.html.Styles = function(settings, schema) { } }; + function cloneAndExcludeBlocks(input) { + var name, output = {}; + + for (name in input) { + if (name !== 'li' && name != 'p') { + output[name] = input[name]; + } + } + + return output; + }; + parser = new tinymce.html.SaxParser({ validate : validate, - fix_self_closing : !validate, // Let the DOM parser handle
                  9. in
                  10. or

                    in

                    for better results + + // Exclude P and LI from DOM parsing since it's treated better by the DOM parser + self_closing_elements: cloneAndExcludeBlocks(schema.getSelfClosingElements()), cdata: function(text) { node.append(createNode('#cdata', 4)).value = text; @@ -3750,7 +3777,7 @@ tinymce.html.Styles = function(settings, schema) { node.empty().append(new Node('#text', '3')).value = '\u00a0'; else { // Leave nodes that have a name like - if (!node.attributes.map.name) { + if (!node.attributes.map.name && !node.attributes.map.id) { tempNode = node.parent; node.empty().remove(); node = tempNode; @@ -3902,12 +3929,12 @@ tinymce.html.Styles = function(settings, schema) { // Force anchor names closed, unless the setting "allow_html_in_named_anchor" is explicitly included. if (!settings.allow_html_in_named_anchor) { - self.addAttributeFilter('name', function(nodes, name) { + self.addAttributeFilter('id,name', function(nodes, name) { var i = nodes.length, sibling, prevSibling, parent, node; while (i--) { node = nodes[i]; - if (node.name === 'a' && node.firstChild) { + if (node.name === 'a' && node.firstChild && !node.attr('href')) { parent = node.parent; // Move children after current node @@ -6138,7 +6165,8 @@ tinymce.dom.TreeWalker = function(start_node, root_node) { cloneContents : cloneContents, insertNode : insertNode, surroundContents : surroundContents, - cloneRange : cloneRange + cloneRange : cloneRange, + toStringIE : toStringIE }); function createDocumentFragment() { @@ -6778,9 +6806,20 @@ tinymce.dom.TreeWalker = function(start_node, root_node) { n.parentNode.removeChild(n); }; + + function toStringIE() { + return dom.create('body', null, cloneContents()).outerText; + } + + return t; }; ns.Range = Range; + + // Older IE versions doesn't let you override toString by it's constructor so we have to stick it in the prototype + Range.prototype.toString = function() { + return this.toStringIE(); + }; })(tinymce.dom); (function() { function Selection(selection) { @@ -7135,7 +7174,7 @@ tinymce.dom.TreeWalker = function(start_node, root_node) { }; this.addRange = function(rng) { - var ieRng, ctrlRng, startContainer, startOffset, endContainer, endOffset, doc = selection.dom.doc, body = doc.body; + var ieRng, ctrlRng, startContainer, startOffset, endContainer, endOffset, sibling, doc = selection.dom.doc, body = doc.body; function setEndPoint(start) { var container, offset, marker, tmpRng, nodes; @@ -7193,11 +7232,25 @@ tinymce.dom.TreeWalker = function(start_node, root_node) { // Trick to place the caret inside an empty block element like

                    if (startOffset == endOffset && !startContainer.hasChildNodes()) { if (startContainer.canHaveHTML) { + // Check if previous sibling is an empty block if it is then we need to render it + // IE would otherwise move the caret into the sibling instead of the empty startContainer see: #5236 + // Example this:

                    |

                    would become this:

                    |

                    + sibling = startContainer.previousSibling; + if (sibling && !sibling.hasChildNodes() && dom.isBlock(sibling)) { + sibling.innerHTML = '\uFEFF'; + } else { + sibling = null; + } + startContainer.innerHTML = '\uFEFF\uFEFF'; ieRng.moveToElementText(startContainer.lastChild); ieRng.select(); dom.doc.selection.clear(); startContainer.innerHTML = ''; + + if (sibling) { + sibling.innerHTML = ''; + } return; } else { startOffset = dom.nodeIndex(startContainer); @@ -10182,11 +10235,10 @@ window.tinymce.dom.Sizzle = Sizzle; } // Create new script element - elm = dom.create('script', { - id : id, - type : 'text/javascript', - src : tinymce._addVer(url) - }); + elm = document.createElement('script'); + elm.id = id; + elm.type = 'text/javascript'; + elm.src = tinymce._addVer(url); // Add onload listener for non IE browsers since IE9 // fires onload event before the script is parsed and executed @@ -10548,12 +10600,15 @@ window.tinymce.dom.Sizzle = Sizzle; t.destroy = function() { each(items, function(item) { - dom.unbind(dom.get(item.id), 'focus', itemFocussed); - dom.unbind(dom.get(item.id), 'blur', itemBlurred); + var elm = dom.get(item.id); + + dom.unbind(elm, 'focus', itemFocussed); + dom.unbind(elm, 'blur', itemBlurred); }); - dom.unbind(dom.get(root), 'focus', rootFocussed); - dom.unbind(dom.get(root), 'keydown', rootKeydown); + var rootElm = dom.get(root); + dom.unbind(rootElm, 'focus', rootFocussed); + dom.unbind(rootElm, 'keydown', rootKeydown); items = dom = root = t.focus = itemFocussed = itemBlurred = rootKeydown = rootFocussed = null; t.destroy = function() {}; @@ -10632,21 +10687,23 @@ window.tinymce.dom.Sizzle = Sizzle; // Set up state and listeners for each item. each(items, function(item, idx) { - var tabindex; + var tabindex, elm; if (!item.id) { item.id = dom.uniqueId('_mce_item_'); } + elm = dom.get(item.id); + if (excludeFromTabOrder) { - dom.bind(item.id, 'blur', itemBlurred); + dom.bind(elm, 'blur', itemBlurred); tabindex = '-1'; } else { tabindex = (idx === 0 ? '0' : '-1'); } - dom.setAttrib(item.id, 'tabindex', tabindex); - dom.bind(dom.get(item.id), 'focus', itemFocussed); + elm.setAttribute('tabindex', tabindex); + dom.bind(elm, 'focus', itemFocussed); }); // Setup initial state for root element. @@ -10655,10 +10712,11 @@ window.tinymce.dom.Sizzle = Sizzle; } dom.setAttrib(root, 'tabindex', '-1'); - + // Setup listeners for root element. - dom.bind(dom.get(root), 'focus', rootFocussed); - dom.bind(dom.get(root), 'keydown', rootKeydown); + var rootElm = dom.get(root); + dom.bind(rootElm, 'focus', rootFocussed); + dom.bind(rootElm, 'keydown', rootKeydown); } }); })(tinymce); @@ -12760,8 +12818,8 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { inline_styles : TRUE, convert_fonts_to_spans : TRUE, indent : 'simple', - indent_before : 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure', - indent_after : 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure', + indent_before : 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist', + indent_after : 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist', validate : TRUE, entity_encoding : 'named', url_converter : self.convertURL, @@ -12821,6 +12879,10 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { if (!/TEXTAREA|INPUT/i.test(t.getElement().nodeName) && s.hidden_input && DOM.getParent(id, 'form')) DOM.insertAfter(DOM.create('input', {type : 'hidden', name : id}), id); + // Hide target element early to prevent content flashing + t.orgVisibility = t.getElement().style.visibility; + t.getElement().style.visibility = 'hidden'; + if (tinymce.WindowManager) t.windowManager = new tinymce.WindowManager(t); @@ -12883,7 +12945,7 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { //sl.add(tinymce.baseURL + '/langs/' + s.language + '.js'); sl.add(tinymce.baseURL + '/../../extra/strings.php?elanguage=' + s.language + 'ðeme=' + s.theme); // Moodle modification - load one huge strings file - if (s.theme && s.theme.charAt(0) != '-' && !ThemeManager.urls[s.theme]) + if (s.theme && typeof s.theme != "function" && s.theme.charAt(0) != '-' && !ThemeManager.urls[s.theme]) ThemeManager.load(s.theme, 'themes/' + s.theme + '/editor_template' + tinymce.suffix + '.js'); each(explode(s.plugins), function(p) { @@ -12924,13 +12986,18 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { s.aria_label = s.aria_label || DOM.getAttrib(e, 'aria-label', t.getLang('aria.rich_text_area')); if (s.theme) { - s.theme = s.theme.replace(/-/, ''); - o = ThemeManager.get(s.theme); - t.theme = new o(); + if (typeof s.theme != "function") { + s.theme = s.theme.replace(/-/, ''); + o = ThemeManager.get(s.theme); + t.theme = new o(); - if (t.theme.init) - t.theme.init(t, ThemeManager.urls[s.theme] || tinymce.documentBaseURL.replace(/\/$/, '')); + if (t.theme.init) + t.theme.init(t, ThemeManager.urls[s.theme] || tinymce.documentBaseURL.replace(/\/$/, '')); + } else { + t.theme = s.theme; + } } + function initPlugin(p) { var c = PluginManager.get(p), u = PluginManager.urls[p] || tinymce.documentBaseURL.replace(/\/$/, ''), po; if (c && tinymce.inArray(initializedPlugins,p) === -1) { @@ -12975,26 +13042,57 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { // Measure box if (s.render_ui && t.theme) { - w = s.width || e.style.width || e.offsetWidth; - h = s.height || e.style.height || e.offsetHeight; t.orgDisplay = e.style.display; - re = /^[0-9\.]+(|px)$/i; - if (re.test('' + w)) - w = Math.max(parseInt(w, 10) + (o.deltaWidth || 0), 100); + if (typeof s.theme != "function") { + w = s.width || e.style.width || e.offsetWidth; + h = s.height || e.style.height || e.offsetHeight; + re = /^[0-9\.]+(|px)$/i; - if (re.test('' + h)) - //h = Math.max(parseInt(h, 10) + (o.deltaHeight || 0), 100); - h = Math.max(parseInt(h) + (o.deltaHeight || 0), s.theme_advanced_resizing_min_height || 100); // Moodle hack + if (re.test('' + w)) + w = Math.max(parseInt(w, 10) + (o.deltaWidth || 0), 100); - // Render UI - o = t.theme.renderUI({ - targetNode : e, - width : w, - height : h, - deltaWidth : s.delta_width, - deltaHeight : s.delta_height - }); + if (re.test('' + h)) + //h = Math.max(parseInt(h, 10) + (o.deltaHeight || 0), 100); + h = Math.max(parseInt(h) + (o.deltaHeight || 0), s.theme_advanced_resizing_min_height || 100); // Moodle hack + + // Render UI + o = t.theme.renderUI({ + targetNode : e, + width : w, + height : h, + deltaWidth : s.delta_width, + deltaHeight : s.delta_height + }); + + // Resize editor + DOM.setStyles(o.sizeContainer || o.editorContainer, { + width : w, + height : h + }); + + h = (o.iframeHeight || h) + (typeof(h) == 'number' ? (o.deltaHeight || 0) : ''); + //if (h < 100) + // h = 100; + if (h < (s.theme_advanced_resizing_min_height || 100)) // Moodle hack + h = s.theme_advanced_resizing_min_height || 100; // Moodle hack + + } else { + o = s.theme(t, e); + + // Convert element type to id:s + if (o.editorContainer.nodeType) { + o.editorContainer = o.editorContainer.id = o.editorContainer.id || t.id + "_parent"; + } + + // Convert element type to id:s + if (o.iframeContainer.nodeType) { + o.iframeContainer = o.iframeContainer.id = o.iframeContainer.id || t.id + "_iframecontainer"; + } + + // Use specified iframe height or the targets offsetHeight + h = o.iframeHeight || e.offsetHeight; + } t.editorContainer = o.editorContainer; } @@ -13016,18 +13114,6 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { if (document.domain && location.hostname != document.domain) tinymce.relaxedDomain = document.domain; - // Resize editor - DOM.setStyles(o.sizeContainer || o.editorContainer, { - width : w, - height : h - }); - - h = (o.iframeHeight || h) + (typeof(h) == 'number' ? (o.deltaHeight || 0) : ''); - //if (h < 100) - // h = 100; - if (h < (s.theme_advanced_resizing_min_height || 100)) // Moodle hack - h = s.theme_advanced_resizing_min_height || 100; // Moodle hack - t.iframeHTML = s.doctype + ''; // We only need to override paths if we have to @@ -13086,7 +13172,14 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { }); t.contentAreaContainer = o.iframeContainer; - DOM.get(o.editorContainer).style.display = t.orgDisplay; + + if (o.editorContainer) { + DOM.get(o.editorContainer).style.display = t.orgDisplay; + } + + // Restore visibility on target element + e.style.visibility = t.orgVisibility; + DOM.get(t.id).style.display = 'none'; DOM.setAttrib(t.id, 'aria-hidden', true); @@ -13411,9 +13504,6 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { if (self.initialized) { o = o || {}; - // Normalize selection for example a|a becomes a|a - selection.normalize(); - // Get start node node = selection.getStart() || self.getBody(); node = isIE && node.ownerDocument != self.getDoc() ? self.getBody() : node; // Fix for IE initial state @@ -13891,14 +13981,16 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { return; case 'A': - value = dom.getAttrib(elm, 'name'); - cls = 'mceItemAnchor'; + if (!elm.href) { + value = dom.getAttrib(elm, 'name') || elm.id; + cls = 'mceItemAnchor'; - if (value) { - if (self.hasVisual) - dom.addClass(elm, cls); - else - dom.removeClass(elm, cls); + if (value) { + if (self.hasVisual) + dom.addClass(elm, cls); + else + dom.removeClass(elm, cls); + } } return; @@ -14193,6 +14285,12 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { self.focus(true); }; + function nodeChanged() { + // Normalize selection for example a|a becomes a|a + self.selection.normalize(); + self.nodeChanged(); + } + // Add DOM events each(nativeToDispatcherMap, function(dispatcherName, nativeName) { var root = settings.content_editable ? self.getBody() : self.getDoc(); @@ -14227,13 +14325,13 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { } // Add node change handler - self.onMouseUp.add(self.nodeChanged); + self.onMouseUp.add(nodeChanged); self.onKeyUp.add(function(ed, e) { var keyCode = e.keyCode; if ((keyCode >= 33 && keyCode <= 36) || (keyCode >= 37 && keyCode <= 40) || keyCode == 13 || keyCode == 45 || keyCode == 46 || keyCode == 8 || (tinymce.isMac && (keyCode == 91 || keyCode == 93)) || e.ctrlKey) - self.nodeChanged(); + nodeChanged(); }); // Add reset handler @@ -14840,9 +14938,10 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { }; // Create event instances - onAdd = new Dispatcher(self); - onUndo = new Dispatcher(self); - onRedo = new Dispatcher(self); + onBeforeAdd = new Dispatcher(self); + onAdd = new Dispatcher(self); + onUndo = new Dispatcher(self); + onRedo = new Dispatcher(self); // Pass though onAdd event from UndoManager to Editor as onChange onAdd.add(function(undoman, level) { @@ -14931,6 +15030,8 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { data : data, typing : false, + + onBeforeAdd: onBeforeAdd, onAdd : onAdd, @@ -14947,6 +15048,8 @@ tinymce.create('tinymce.ui.Toolbar:tinymce.ui.Container', { level = level || {}; level.content = getContent(); + + self.onBeforeAdd.dispatch(self, level); // Add undo level if needed lastLevel = data[index]; @@ -15047,7 +15150,7 @@ tinymce.ForceBlocks = function(editor) { return; // Check if node is wrapped in block - while (node != rootNode) { + while (node && node != rootNode) { if (blockElements[node.nodeName]) return; @@ -15187,28 +15290,40 @@ tinymce.ForceBlocks = function(editor) { return c; }, - createControl : function(n) { - var c, t = this, ed = t.editor; + createControl : function(name) { + var ctrl, i, l, self = this, editor = self.editor, factories, ctrlName; - each(ed.plugins, function(p) { - if (p.createControl) { - c = p.createControl(n, t); - - if (c) - return false; - } - }); - - switch (n) { - case "|": - case "separator": - return t.createSeparator(); + // Build control factory cache + if (!self.controlFactories) { + self.controlFactories = []; + each(editor.plugins, function(plugin) { + if (plugin.createControl) { + self.controlFactories.push(plugin); + } + }); } - if (!c && ed.buttons && (c = ed.buttons[n])) - return t.createButton(n, c); + // Create controls by asking cached factories + factories = self.controlFactories; + for (i = 0, l = factories.length; i < l; i++) { + ctrl = factories[i].createControl(name, self); - return t.add(c); + if (ctrl) { + return self.add(ctrl); + } + } + + // Create sepearator + if (name === "|" || name === "separator") { + return self.createSeparator(); + } + + // Create control from button collection + if (editor.buttons && (ctrl = editor.buttons[name])) { + return self.createButton(name, ctrl); + } + + return self.add(ctrl); }, createDropMenu : function(id, s, cc) { @@ -17468,6 +17583,21 @@ tinymce.ForceBlocks = function(editor) { } }; + // Checks if the parent caret container node isn't empty if that is the case it + // will remove the bogus state on all children that isn't empty + function unmarkBogusCaretParents() { + var i, caretContainer, node; + + caretContainer = getParentCaretContainer(selection.getStart()); + if (caretContainer && !dom.isEmpty(caretContainer)) { + tinymce.walk(caretContainer, function(node) { + if (node.nodeType == 1 && node.id !== caretContainerId && !dom.isEmpty(node)) { + dom.setAttrib(node, 'data-mce-bogus', null); + } + }, 'childNodes'); + } + }; + // Only bind the caret events once if (!self._hasCaretEvents) { // Mark current caret container elements as bogus when getting the contents so we don't end up with empty elements @@ -17487,6 +17617,7 @@ tinymce.ForceBlocks = function(editor) { tinymce.each('onMouseUp onKeyUp'.split(' '), function(name) { ed[name].addToTop(function() { removeCaretContainer(); + unmarkBogusCaretParents(); }); }); @@ -17497,16 +17628,12 @@ tinymce.ForceBlocks = function(editor) { if (keyCode == 8 || keyCode == 37 || keyCode == 39) { removeCaretContainer(getParentCaretContainer(selection.getStart())); } + + unmarkBogusCaretParents(); }); // Remove bogus state if they got filled by contents using editor.selection.setContent - selection.onSetContent.add(function() { - dom.getParent(selection.getStart(), function(node) { - if (node.id !== caretContainerId && dom.getAttrib(node, 'data-mce-bogus') && !dom.isEmpty(node)) { - dom.setAttrib(node, 'data-mce-bogus', null); - } - }); - }); + selection.onSetContent.add(unmarkBogusCaretParents); self._hasCaretEvents = true; } diff --git a/lib/editor/tinymce/tiny_mce/3.5/utils/editable_selects.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/utils/editable_selects.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/utils/editable_selects.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/utils/editable_selects.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/utils/form_utils.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/utils/form_utils.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/utils/form_utils.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/utils/form_utils.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/utils/mctabs.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/utils/mctabs.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/utils/mctabs.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/utils/mctabs.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/utils/validate.js b/lib/editor/tinymce/tiny_mce/3.5.1.1/utils/validate.js similarity index 100% rename from lib/editor/tinymce/tiny_mce/3.5/utils/validate.js rename to lib/editor/tinymce/tiny_mce/3.5.1.1/utils/validate.js diff --git a/lib/editor/tinymce/tiny_mce/3.5/plugins/autolink/editor_plugin.js b/lib/editor/tinymce/tiny_mce/3.5/plugins/autolink/editor_plugin.js deleted file mode 100644 index daac3b32660..00000000000 --- a/lib/editor/tinymce/tiny_mce/3.5/plugins/autolink/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){tinymce.create("tinymce.plugins.AutolinkPlugin",{init:function(a,b){var c=this;a.onKeyDown.addToTop(function(d,f){if(f.keyCode==13){return c.handleEnter(d)}});if(tinyMCE.isIE){return}a.onKeyPress.add(function(d,f){if(f.which==41){return c.handleEclipse(d)}});a.onKeyUp.add(function(d,f){if(f.keyCode==32){return c.handleSpacebar(d)}})},handleEclipse:function(a){this.parseCurrentLine(a,-1,"(",true)},handleSpacebar:function(a){this.parseCurrentLine(a,0,"",true)},handleEnter:function(a){this.parseCurrentLine(a,-1,"",false)},parseCurrentLine:function(i,d,b,g){var a,f,c,n,k,m,h,e,j;a=i.selection.getRng().cloneRange();if(a.startOffset<5){e=a.endContainer.previousSibling;if(e==null){if(a.endContainer.firstChild==null||a.endContainer.firstChild.nextSibling==null){return}e=a.endContainer.firstChild.nextSibling}j=e.length;a.setStart(e,j);a.setEnd(e,j);if(a.endOffset<5){return}f=a.endOffset;n=e}else{n=a.endContainer;if(n.nodeType!=3&&n.firstChild){while(n.nodeType!=3&&n.firstChild){n=n.firstChild}a.setStart(n,0);a.setEnd(n,n.nodeValue.length)}if(a.endOffset==1){f=2}else{f=a.endOffset-1-d}}c=f;do{a.setStart(n,f-2);a.setEnd(n,f-1);f-=1}while(a.toString()!=" "&&a.toString()!=""&&a.toString().charCodeAt(0)!=160&&(f-2)>=0&&a.toString()!=b);if(a.toString()==b||a.toString().charCodeAt(0)==160){a.setStart(n,f);a.setEnd(n,c);f+=1}else{if(a.startOffset==0){a.setStart(n,0);a.setEnd(n,c)}else{a.setStart(n,f);a.setEnd(n,c)}}m=a.toString();h=m.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|[A-Z0-9._%+-]+@)(.+)$/i);if(h){if(h[1]=="www."){h[1]="http://www."}else{if(/@$/.test(h[1])){h[1]="mailto:"+h[1]}}k=i.selection.getBookmark();i.selection.setRng(a);tinyMCE.execCommand("createlink",false,h[1]+h[2]);i.selection.moveToBookmark(k);if(tinyMCE.isWebKit){i.selection.collapse(false);var l=Math.min(n.length,c+1);a.setStart(n,l);a.setEnd(n,l);i.selection.setRng(a)}}},getInfo:function(){return{longname:"Autolink",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autolink",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("autolink",tinymce.plugins.AutolinkPlugin)})(); \ No newline at end of file diff --git a/lib/editor/tinymce/tiny_mce/3.5/tiny_mce.js b/lib/editor/tinymce/tiny_mce/3.5/tiny_mce.js deleted file mode 100644 index 751c1ab48f3..00000000000 --- a/lib/editor/tinymce/tiny_mce/3.5/tiny_mce.js +++ /dev/null @@ -1 +0,0 @@ -(function(e){var a=/^\s*|\s*$/g,b,d="B".replace(/A(.)|B/,"$1")==="$1";var c={majorVersion:"@@tinymce_major_version@@",minorVersion:"@@tinymce_minor_version@@",releaseDate:"@@tinymce_release_date@@",_init:function(){var s=this,q=document,o=navigator,g=o.userAgent,m,f,l,k,j,r;s.isOpera=e.opera&&opera.buildNumber;s.isWebKit=/WebKit/.test(g);s.isIE=!s.isWebKit&&!s.isOpera&&(/MSIE/gi).test(g)&&(/Explorer/gi).test(o.appName);s.isIE6=s.isIE&&/MSIE [56]/.test(g);s.isIE7=s.isIE&&/MSIE [7]/.test(g);s.isIE8=s.isIE&&/MSIE [8]/.test(g);s.isIE9=s.isIE&&/MSIE [9]/.test(g);s.isGecko=!s.isWebKit&&/Gecko/.test(g);s.isMac=g.indexOf("Mac")!=-1;s.isAir=/adobeair/i.test(g);s.isIDevice=/(iPad|iPhone)/.test(g);s.isIOS5=s.isIDevice&&g.match(/AppleWebKit\/(\d*)/)[1]>=534;if(e.tinyMCEPreInit){s.suffix=tinyMCEPreInit.suffix;s.baseURL=tinyMCEPreInit.base;s.query=tinyMCEPreInit.query;return}s.suffix="";f=q.getElementsByTagName("base");for(m=0;m0?b:[f.scope]);if(e===false){break}}a.inDispatch=false;return e}});(function(){var a=tinymce.each;tinymce.create("tinymce.util.URI",{URI:function(e,g){var f=this,i,d,c,h;e=tinymce.trim(e);g=f.settings=g||{};if(/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e)){f.source=e;return}if(e.indexOf("/")===0&&e.indexOf("//")!==0){e=(g.base_uri?g.base_uri.protocol||"http":"http")+"://mce_host"+e}if(!/^[\w\-]*:?\/\//.test(e)){h=g.base_uri?g.base_uri.path:new tinymce.util.URI(location.href).directory;e=((g.base_uri&&g.base_uri.protocol)||"http")+"://mce_host"+f.toAbsPath(h,e)}e=e.replace(/@@/g,"(mce_at)");e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);a(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(b,j){var k=e[j];if(k){k=k.replace(/\(mce_at\)/g,"@@")}f[b]=k});c=g.base_uri;if(c){if(!f.protocol){f.protocol=c.protocol}if(!f.userInfo){f.userInfo=c.userInfo}if(!f.port&&f.host==="mce_host"){f.port=c.port}if(!f.host||f.host==="mce_host"){f.host=c.host}f.source=""}},setPath:function(c){var b=this;c=/^(.*?)\/?(\w+)?$/.exec(c);b.path=c[0];b.directory=c[1];b.file=c[2];b.source="";b.getURI()},toRelative:function(b){var d=this,f;if(b==="./"){return b}b=new tinymce.util.URI(b,{base_uri:d});if((b.host!="mce_host"&&d.host!=b.host&&b.host)||d.port!=b.port||d.protocol!=b.protocol){return b.getURI()}var c=d.getURI(),e=b.getURI();if(c==e||(c.charAt(c.length-1)=="/"&&c.substr(0,c.length-1)==e)){return c}f=d.toRelPath(d.path,b.path);if(b.query){f+="?"+b.query}if(b.anchor){f+="#"+b.anchor}return f},toAbsolute:function(b,c){b=new tinymce.util.URI(b,{base_uri:this});return b.getURI(this.host==b.host&&this.protocol==b.protocol?c:0)},toRelPath:function(g,h){var c,f=0,d="",e,b;g=g.substring(0,g.lastIndexOf("/"));g=g.split("/");c=h.split("/");if(g.length>=c.length){for(e=0,b=g.length;e=c.length||g[e]!=c[e]){f=e+1;break}}}if(g.length=g.length||g[e]!=c[e]){f=e+1;break}}}if(f===1){return h}for(e=0,b=g.length-(f-1);e=0;c--){if(f[c].length===0||f[c]==="."){continue}if(f[c]===".."){b++;continue}if(b>0){b--;continue}h.push(f[c])}c=e.length-b;if(c<=0){g=h.reverse().join("/")}else{g=e.slice(0,c).join("/")+"/"+h.reverse().join("/")}if(g.indexOf("/")!==0){g="/"+g}if(d&&g.lastIndexOf("/")!==g.length-1){g+=d}return g},getURI:function(d){var c,b=this;if(!b.source||d){c="";if(!d){if(b.protocol){c+=b.protocol+"://"}if(b.userInfo){c+=b.userInfo+"@"}if(b.host){c+=b.host}if(b.port){c+=":"+b.port}}if(b.path){c+=b.path}if(b.query){c+="?"+b.query}if(b.anchor){c+="#"+b.anchor}b.source=c}return b.source}})})();(function(){var a=tinymce.each;tinymce.create("static tinymce.util.Cookie",{getHash:function(d){var b=this.get(d),c;if(b){a(b.split("&"),function(e){e=e.split("=");c=c||{};c[unescape(e[0])]=unescape(e[1])})}return c},setHash:function(j,b,g,f,i,c){var h="";a(b,function(e,d){h+=(!h?"":"&")+escape(d)+"="+escape(e)});this.set(j,h,g,f,i,c)},get:function(i){var h=document.cookie,g,f=i+"=",d;if(!h){return}d=h.indexOf("; "+f);if(d==-1){d=h.indexOf(f);if(d!==0){return null}}else{d+=2}g=h.indexOf(";",d);if(g==-1){g=h.length}return unescape(h.substring(d+f.length,g))},set:function(i,b,g,f,h,c){document.cookie=i+"="+escape(b)+((g)?"; expires="+g.toGMTString():"")+((f)?"; path="+escape(f):"")+((h)?"; domain="+h:"")+((c)?"; secure":"")},remove:function(e,b){var c=new Date();c.setTime(c.getTime()-1000);this.set(e,"",c,b,c)}})})();(function(){function serialize(o,quote){var i,v,t,name;quote=quote||'"';if(o==null){return"null"}t=typeof o;if(t=="string"){v="\bb\tt\nn\ff\rr\"\"''\\\\";return quote+o.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(a,b){if(quote==='"'&&a==="'"){return a}i=v.indexOf(b);if(i+1){return"\\"+v.charAt(i+1)}a=b.charCodeAt().toString(16);return"\\u"+"0000".substring(a.length)+a})+quote}if(t=="object"){if(o.hasOwnProperty&&o instanceof Array){for(i=0,v="[";i0?",":"")+serialize(o[i],quote)}return v+"]"}v="{";for(name in o){if(o.hasOwnProperty(name)){v+=typeof o[name]!="function"?(v.length>1?","+quote:quote)+name+quote+":"+serialize(o[name],quote):""}}return v+"}"}return""+o}tinymce.util.JSON={serialize:serialize,parse:function(s){try{return eval("("+s+")")}catch(ex){}}}})();tinymce.create("static tinymce.util.XHR",{send:function(g){var a,e,b=window,h=0;function f(){if(!g.async||a.readyState==4||h++>10000){if(g.success&&h<10000&&a.status==200){g.success.call(g.success_scope,""+a.responseText,a,g)}else{if(g.error){g.error.call(g.error_scope,h>10000?"TIMED_OUT":"GENERAL",a,g)}}a=null}else{b.setTimeout(f,10)}}g.scope=g.scope||this;g.success_scope=g.success_scope||g.scope;g.error_scope=g.error_scope||g.scope;g.async=g.async===false?false:true;g.data=g.data||"";function d(i){a=0;try{a=new ActiveXObject(i)}catch(c){}return a}a=b.XMLHttpRequest?new XMLHttpRequest():d("Microsoft.XMLHTTP")||d("Msxml2.XMLHTTP");if(a){if(a.overrideMimeType){a.overrideMimeType(g.content_type)}a.open(g.type||(g.data?"POST":"GET"),g.url,g.async);if(g.content_type){a.setRequestHeader("Content-Type",g.content_type)}a.setRequestHeader("X-Requested-With","XMLHttpRequest");a.send(g.data);if(!g.async){return f()}e=b.setTimeout(f,10)}}});(function(){var c=tinymce.extend,b=tinymce.util.JSON,a=tinymce.util.XHR;tinymce.create("tinymce.util.JSONRequest",{JSONRequest:function(d){this.settings=c({},d);this.count=0},send:function(f){var e=f.error,d=f.success;f=c(this.settings,f);f.success=function(h,g){h=b.parse(h);if(typeof(h)=="undefined"){h={error:"JSON Parse error."}}if(h.error){e.call(f.error_scope||f.scope,h.error,g)}else{d.call(f.success_scope||f.scope,h.result)}};f.error=function(h,g){if(e){e.call(f.error_scope||f.scope,h,g)}};f.data=b.serialize({id:f.id||"c"+(this.count++),method:f.method,params:f.params});f.content_type="application/json";a.send(f)},"static":{sendRPC:function(d){return new tinymce.util.JSONRequest().send(d)}}})}());(function(a){a.VK={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,modifierPressed:function(b){return b.shiftKey||b.ctrlKey||b.altKey}}})(tinymce);tinymce.util.Quirks=function(d){var l=tinymce.VK,r=l.BACKSPACE,s=l.DELETE,o=d.dom,z=d.selection,q=d.settings;function c(D,C){try{d.getDoc().execCommand(D,false,C)}catch(B){}}function h(){function B(E){var C,G,D,F;C=z.getRng();G=o.getParent(C.startContainer,o.isBlock);if(E){G=o.getNext(G,o.isBlock)}if(G){D=G.firstChild;while(D&&D.nodeType==3&&D.nodeValue.length===0){D=D.nextSibling}if(D&&D.nodeName==="SPAN"){F=D.cloneNode(false)}}d.getDoc().execCommand(E?"ForwardDelete":"Delete",false,null);G=o.getParent(C.startContainer,o.isBlock);tinymce.each(o.select("span.Apple-style-span,font.Apple-style-span",G),function(H){var I=z.getBookmark();if(F){o.replace(F.cloneNode(false),H,true)}else{o.remove(H,true)}z.moveToBookmark(I)})}d.onKeyDown.add(function(C,E){var D;D=E.keyCode==s;if(!E.isDefaultPrevented()&&(D||E.keyCode==r)&&!l.modifierPressed(E)){E.preventDefault();B(D)}});d.addCommand("Delete",function(){B()})}function A(){function C(E,H){var D,G,F=H?"start":"end";D=E[F+"Container"];G=E[F+"Offset"];if(D.nodeType==1&&D.hasChildNodes()){D=D.childNodes[Math.min(H?G:(G>0?G-1:0),D.childNodes.length-1)]}return D}function B(G,K){var F,J,E,H,I=K?"start":"end",D;F=G[I+"Container"];J=G[I+"Offset"];E=o.getRoot();if(F.nodeType==1){D=J>=F.childNodes.length;F=C(G,K);if(F.nodeType==3){J=K&&!D?0:F.nodeValue.length}}if(F.nodeType==3&&((K&&J>0)||(!K&&J7){return}c("RespectVisibilityInDesign",true);o.addClass(d.getBody(),"mceHideBrInPre");d.parser.addNodeFilter("pre",function(C,E){var F=C.length,H,D,I,G;while(F--){H=C[F].getAll("br");D=H.length;while(D--){I=H[D];G=I.prev;if(G&&G.type===3&&G.value.charAt(G.value-1)!="\n"){G.value+="\n"}else{I.parent.insert(new tinymce.html.Node("#text",3),I,true).value="\n"}}}});d.serializer.addNodeFilter("pre",function(C,E){var F=C.length,H,D,I,G;while(F--){H=C[F].getAll("br");D=H.length;while(D--){I=H[D];G=I.prev;if(G&&G.type==3){G.value=G.value.replace(/\r?\n$/,"")}}}})}function f(){o.bind(d.getBody(),"mouseup",function(D){var C,B=z.getNode();if(B.nodeName=="IMG"){if(C=o.getStyle(B,"width")){o.setAttrib(B,"width",C.replace(/[^0-9%]+/g,""));o.setStyle(B,"width","")}if(C=o.getStyle(B,"height")){o.setAttrib(B,"height",C.replace(/[^0-9%]+/g,""));o.setStyle(B,"height","")}}})}function p(){d.onKeyDown.add(function(H,I){var G,B,C,E,F,J,D;G=I.keyCode==s;if(!I.isDefaultPrevented()&&(G||I.keyCode==r)&&!l.modifierPressed(I)){B=z.getRng();C=B.startContainer;E=B.startOffset;D=B.collapsed;if(C.nodeType==3&&C.nodeValue.length>0&&((E===0&&!D)||(D&&E===(G?0:1)))){nonEmptyElements=H.schema.getNonEmptyElements();I.preventDefault();F=o.create("br",{id:"__tmp"});C.parentNode.insertBefore(F,C);H.getDoc().execCommand(G?"ForwardDelete":"Delete",false,null);C=z.getRng().startContainer;J=C.previousSibling;if(J&&J.nodeType==1&&!o.isBlock(J)&&o.isEmpty(J)&&!nonEmptyElements[J.nodeName.toLowerCase()]){o.remove(J)}o.remove("__tmp")}}})}function e(){d.onKeyDown.add(function(F,G){var D,C,H,B,E;if(G.isDefaultPrevented()||G.keyCode!=l.BACKSPACE){return}D=z.getRng();C=D.startContainer;H=D.startOffset;B=o.getRoot();E=C;if(!D.collapsed||H!==0){return}while(E&&E.parentNode&&E.parentNode.firstChild==E&&E.parentNode!=B){E=E.parentNode}if(E.tagName==="BLOCKQUOTE"){F.formatter.toggle("blockquote",null,E);D.setStart(C,0);D.setEnd(C,0);z.setRng(D);z.collapse(false)}})}function k(){function B(){d._refreshContentEditable();c("StyleWithCSS",false);c("enableInlineTableEditing",false);if(!q.object_resizing){c("enableObjectResizing",false)}}if(!q.readonly){d.onBeforeExecCommand.add(B);d.onMouseDown.add(B)}}function n(){function B(C,D){tinymce.each(o.select("a"),function(G){var E=G.parentNode,F=o.getRoot();if(E.lastChild===G){while(E&&!o.isBlock(E)){if(E.parentNode.lastChild!==E||E===F){return}E=E.parentNode}o.add(E,"br",{"data-mce-bogus":1})}})}d.onExecCommand.add(function(C,D){if(D==="CreateLink"){B(C)}});d.onSetContent.add(z.onSetContent.add(B))}function a(){function B(D,C){if(!D||!C.initial){d.execCommand("mceRepaint")}}d.onUndo.add(B);d.onRedo.add(B);d.onSetContent.add(B)}function j(){d.onKeyDown.add(function(B,C){if(!C.isDefaultPrevented()&&C.keyCode==8&&z.getNode().nodeName=="IMG"){C.preventDefault();B.undoManager.beforeChange();o.remove(z.getNode());B.undoManager.add()}})}u();e();A();if(tinymce.isWebKit){p();h();t();v();if(tinymce.isIDevice){i()}}if(tinymce.isIE){m();y();g();f();j()}if(tinymce.isGecko){m();b();x();k();n();a()}};(function(j){var a,g,d,k=/[&<>\"\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,b=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,f=/[<>&\"\']/g,c=/&(#x|#)?([\w]+);/g,i={128:"\u20AC",130:"\u201A",131:"\u0192",132:"\u201E",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02C6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017D",145:"\u2018",146:"\u2019",147:"\u201C",148:"\u201D",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02DC",153:"\u2122",154:"\u0161",155:"\u203A",156:"\u0153",158:"\u017E",159:"\u0178"};g={'"':""","'":"'","<":"<",">":">","&":"&"};d={"<":"<",">":">","&":"&",""":'"',"'":"'"};function h(l){var m;m=document.createElement("div");m.innerHTML=l;return m.textContent||m.innerText||l}function e(m,p){var n,o,l,q={};if(m){m=m.split(",");p=p||10;for(n=0;n1){return"&#"+(((n.charCodeAt(0)-55296)*1024)+(n.charCodeAt(1)-56320)+65536)+";"}return g[n]||"&#"+n.charCodeAt(0)+";"})},encodeNamed:function(n,l,m){m=m||a;return n.replace(l?k:b,function(o){return g[o]||m[o]||o})},getEncodeFunc:function(l,o){var p=j.html.Entities;o=e(o)||a;function m(r,q){return r.replace(q?k:b,function(s){return g[s]||o[s]||"&#"+s.charCodeAt(0)+";"||s})}function n(r,q){return p.encodeNamed(r,q,o)}l=j.makeMap(l.replace(/\+/g,","));if(l.named&&l.numeric){return m}if(l.named){if(o){return n}return p.encodeNamed}if(l.numeric){return p.encodeNumeric}return p.encodeRaw},decode:function(l){return l.replace(c,function(n,m,o){if(m){o=parseInt(o,m.length===2?16:10);if(o>65535){o-=65536;return String.fromCharCode(55296+(o>>10),56320+(o&1023))}else{return i[o]||String.fromCharCode(o)}}return d[n]||a[n]||h(n)})}}})(tinymce);tinymce.html.Styles=function(d,f){var k=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,h=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,b=/\s*([^:]+):\s*([^;]+);?/g,l=/\s+$/,m=/rgb/,e,g,a={},j;d=d||{};j="\\\" \\' \\; \\: ; : \uFEFF".split(" ");for(g=0;g1?r:"0"+r}return"#"+o(q)+o(p)+o(i)}return{toHex:function(i){return i.replace(k,c)},parse:function(s){var z={},q,n,x,r,v=d.url_converter,y=d.url_converter_scope||this;function p(D,G){var F,C,B,E;F=z[D+"-top"+G];if(!F){return}C=z[D+"-right"+G];if(F!=C){return}B=z[D+"-bottom"+G];if(C!=B){return}E=z[D+"-left"+G];if(B!=E){return}z[D+G]=E;delete z[D+"-top"+G];delete z[D+"-right"+G];delete z[D+"-bottom"+G];delete z[D+"-left"+G]}function u(C){var D=z[C],B;if(!D||D.indexOf(" ")<0){return}D=D.split(" ");B=D.length;while(B--){if(D[B]!==D[0]){return false}}z[C]=D[0];return true}function A(D,C,B,E){if(!u(C)){return}if(!u(B)){return}if(!u(E)){return}z[D]=z[C]+" "+z[B]+" "+z[E];delete z[C];delete z[B];delete z[E]}function t(B){r=true;return a[B]}function i(C,B){if(r){C=C.replace(/\uFEFF[0-9]/g,function(D){return a[D]})}if(!B){C=C.replace(/\\([\'\";:])/g,"$1")}return C}function o(C,B,F,E,G,D){G=G||D;if(G){G=i(G);return"'"+G.replace(/\'/g,"\\'")+"'"}B=i(B||F||E);if(v){B=v.call(y,B,"style")}return"url('"+B.replace(/\'/g,"\\'")+"')"}if(s){s=s.replace(/\\[\"\';:\uFEFF]/g,t).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(B){return B.replace(/[;:]/g,t)});while(q=b.exec(s)){n=q[1].replace(l,"").toLowerCase();x=q[2].replace(l,"");if(n&&x.length>0){if(n==="font-weight"&&x==="700"){x="bold"}else{if(n==="color"||n==="background-color"){x=x.toLowerCase()}}x=x.replace(k,c);x=x.replace(h,o);z[n]=r?i(x,true):x}b.lastIndex=q.index+q[0].length}p("border","");p("border","-width");p("border","-color");p("border","-style");p("padding","");p("margin","");A("border","border-width","border-style","border-color");if(z.border==="medium none"){delete z.border}}return z},serialize:function(p,r){var o="",n,q;function i(t){var x,u,s,v;x=f.styles[t];if(x){for(u=0,s=x.length;u0){o+=(o.length>0?" ":"")+t+": "+v+";"}}}}if(r&&f&&f.styles){i("*");i(r)}else{for(n in p){q=p[n];if(q!==e&&q.length>0){o+=(o.length>0?" ":"")+n+": "+q+";"}}}return o}}};(function(f){var a={},e=f.makeMap,g=f.each;function d(j,i){return j.split(i||",")}function h(m,l){var j,k={};function i(n){return n.replace(/[A-Z]+/g,function(o){return i(m[o])})}for(j in m){if(m.hasOwnProperty(j)){m[j]=i(m[j])}}i(l).replace(/#/g,"#text").replace(/(\w+)\[([^\]]+)\]\[([^\]]*)\]/g,function(q,o,n,p){n=d(n,"|");k[o]={attributes:e(n),attributesOrder:n,children:e(p,"|",{"#comment":{}})}});return k}function b(){var i=a.html5;if(!i){i=a.html5=h({A:"id|accesskey|class|dir|draggable|item|hidden|itemprop|role|spellcheck|style|subject|title",B:"#|a|abbr|area|audio|b|bdo|br|button|canvas|cite|code|command|datalist|del|dfn|em|embed|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|meta|meter|noscript|object|output|progress|q|ruby|samp|script|select|small|span|strong|sub|sup|svg|textarea|time|var|video",C:"#|a|abbr|area|address|article|aside|audio|b|bdo|blockquote|br|button|canvas|cite|code|command|datalist|del|details|dfn|dialog|div|dl|em|embed|fieldset|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|menu|meta|meter|nav|noscript|ol|object|output|p|pre|progress|q|ruby|samp|script|section|select|small|span|strong|style|sub|sup|svg|table|textarea|time|ul|var|video"},"html[A|manifest][body|head]head[A][base|command|link|meta|noscript|script|style|title]title[A][#]base[A|href|target][]link[A|href|rel|media|type|sizes][]meta[A|http-equiv|name|content|charset][]style[A|type|media|scoped][#]script[A|charset|type|src|defer|async][#]noscript[A][C]body[A][C]section[A][C]nav[A][C]article[A][C]aside[A][C]h1[A][B]h2[A][B]h3[A][B]h4[A][B]h5[A][B]h6[A][B]hgroup[A][h1|h2|h3|h4|h5|h6]header[A][C]footer[A][C]address[A][C]p[A][B]br[A][]pre[A][B]dialog[A][dd|dt]blockquote[A|cite][C]ol[A|start|reversed][li]ul[A][li]li[A|value][C]dl[A][dd|dt]dt[A][B]dd[A][C]a[A|href|target|ping|rel|media|type][C]em[A][B]strong[A][B]small[A][B]cite[A][B]q[A|cite][B]dfn[A][B]abbr[A][B]code[A][B]var[A][B]samp[A][B]kbd[A][B]sub[A][B]sup[A][B]i[A][B]b[A][B]mark[A][B]progress[A|value|max][B]meter[A|value|min|max|low|high|optimum][B]time[A|datetime][B]ruby[A][B|rt|rp]rt[A][B]rp[A][B]bdo[A][B]span[A][B]ins[A|cite|datetime][B]del[A|cite|datetime][B]figure[A][C|legend|figcaption]figcaption[A][C]img[A|alt|src|height|width|usemap|ismap][]iframe[A|name|src|height|width|sandbox|seamless][]embed[A|src|height|width|type][]object[A|data|type|height|width|usemap|name|form|classid][param]param[A|name|value][]details[A|open][C|legend]command[A|type|label|icon|disabled|checked|radiogroup][]menu[A|type|label][C|li]legend[A][C|B]div[A][C]source[A|src|type|media][]audio[A|src|autobuffer|autoplay|loop|controls][source]video[A|src|autobuffer|autoplay|loop|controls|width|height|poster][source]hr[A][]form[A|accept-charset|action|autocomplete|enctype|method|name|novalidate|target][C]fieldset[A|disabled|form|name][C|legend]label[A|form|for][B]input[A|type|accept|alt|autocomplete|checked|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|height|list|max|maxlength|min|multiple|pattern|placeholder|readonly|required|size|src|step|width|files|value][]button[A|autofocus|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|name|value|type][B]select[A|autofocus|disabled|form|multiple|name|size][option|optgroup]datalist[A][B|option]optgroup[A|disabled|label][option]option[A|disabled|selected|label|value][]textarea[A|autofocus|disabled|form|maxlength|name|placeholder|readonly|required|rows|cols|wrap][]keygen[A|autofocus|challenge|disabled|form|keytype|name][]output[A|for|form|name][B]canvas[A|width|height][]map[A|name][B|C]area[A|shape|coords|href|alt|target|media|rel|ping|type][]mathml[A][]svg[A][]table[A|summary][caption|colgroup|thead|tfoot|tbody|tr]caption[A][C]colgroup[A|span][col]col[A|span][]thead[A][tr]tfoot[A][tr]tbody[A][tr]tr[A][th|td]th[A|headers|rowspan|colspan|scope][B]td[A|headers|rowspan|colspan][C]")}return i}function c(){var i=a.html4;if(!i){i=a.html4=h({Z:"H|K|N|O|P",Y:"X|form|R|Q",ZG:"E|span|width|align|char|charoff|valign",X:"p|T|div|U|W|isindex|fieldset|table",ZF:"E|align|char|charoff|valign",W:"pre|hr|blockquote|address|center|noframes",ZE:"abbr|axis|headers|scope|rowspan|colspan|align|char|charoff|valign|nowrap|bgcolor|width|height",ZD:"[E][S]",U:"ul|ol|dl|menu|dir",ZC:"p|Y|div|U|W|table|br|span|bdo|object|applet|img|map|K|N|Q",T:"h1|h2|h3|h4|h5|h6",ZB:"X|S|Q",S:"R|P",ZA:"a|G|J|M|O|P",R:"a|H|K|N|O",Q:"noscript|P",P:"ins|del|script",O:"input|select|textarea|label|button",N:"M|L",M:"em|strong|dfn|code|q|samp|kbd|var|cite|abbr|acronym",L:"sub|sup",K:"J|I",J:"tt|i|b|u|s|strike",I:"big|small|font|basefont",H:"G|F",G:"br|span|bdo",F:"object|applet|img|map|iframe",E:"A|B|C",D:"accesskey|tabindex|onfocus|onblur",C:"onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup",B:"lang|xml:lang|dir",A:"id|class|style|title"},"script[id|charset|type|language|src|defer|xml:space][]style[B|id|type|media|title|xml:space][]object[E|declare|classid|codebase|data|type|codetype|archive|standby|width|height|usemap|name|tabindex|align|border|hspace|vspace][#|param|Y]param[id|name|value|valuetype|type][]p[E|align][#|S]a[E|D|charset|type|name|href|hreflang|rel|rev|shape|coords|target][#|Z]br[A|clear][]span[E][#|S]bdo[A|C|B][#|S]applet[A|codebase|archive|code|object|alt|name|width|height|align|hspace|vspace][#|param|Y]h1[E|align][#|S]img[E|src|alt|name|longdesc|width|height|usemap|ismap|align|border|hspace|vspace][]map[B|C|A|name][X|form|Q|area]h2[E|align][#|S]iframe[A|longdesc|name|src|frameborder|marginwidth|marginheight|scrolling|align|width|height][#|Y]h3[E|align][#|S]tt[E][#|S]i[E][#|S]b[E][#|S]u[E][#|S]s[E][#|S]strike[E][#|S]big[E][#|S]small[E][#|S]font[A|B|size|color|face][#|S]basefont[id|size|color|face][]em[E][#|S]strong[E][#|S]dfn[E][#|S]code[E][#|S]q[E|cite][#|S]samp[E][#|S]kbd[E][#|S]var[E][#|S]cite[E][#|S]abbr[E][#|S]acronym[E][#|S]sub[E][#|S]sup[E][#|S]input[E|D|type|name|value|checked|disabled|readonly|size|maxlength|src|alt|usemap|onselect|onchange|accept|align][]select[E|name|size|multiple|disabled|tabindex|onfocus|onblur|onchange][optgroup|option]optgroup[E|disabled|label][option]option[E|selected|disabled|label|value][]textarea[E|D|name|rows|cols|disabled|readonly|onselect|onchange][]label[E|for|accesskey|onfocus|onblur][#|S]button[E|D|name|value|type|disabled][#|p|T|div|U|W|table|G|object|applet|img|map|K|N|Q]h4[E|align][#|S]ins[E|cite|datetime][#|Y]h5[E|align][#|S]del[E|cite|datetime][#|Y]h6[E|align][#|S]div[E|align][#|Y]ul[E|type|compact][li]li[E|type|value][#|Y]ol[E|type|compact|start][li]dl[E|compact][dt|dd]dt[E][#|S]dd[E][#|Y]menu[E|compact][li]dir[E|compact][li]pre[E|width|xml:space][#|ZA]hr[E|align|noshade|size|width][]blockquote[E|cite][#|Y]address[E][#|S|p]center[E][#|Y]noframes[E][#|Y]isindex[A|B|prompt][]fieldset[E][#|legend|Y]legend[E|accesskey|align][#|S]table[E|summary|width|border|frame|rules|cellspacing|cellpadding|align|bgcolor][caption|col|colgroup|thead|tfoot|tbody|tr]caption[E|align][#|S]col[ZG][]colgroup[ZG][col]thead[ZF][tr]tr[ZF|bgcolor][th|td]th[E|ZE][#|Y]form[E|action|method|name|enctype|onsubmit|onreset|accept|accept-charset|target][#|X|R|Q]noscript[E][#|Y]td[E|ZE][#|Y]tfoot[ZF][tr]tbody[ZF][tr]area[E|D|shape|coords|href|nohref|alt|target][]base[id|href|target][]body[E|onload|onunload|background|bgcolor|text|link|vlink|alink][#|Y]")}return i}f.html.Schema=function(A){var u=this,s={},k={},j=[],D,y;var o,q,z,r,v,n,p={};function m(F,E,H){var G=A[F];if(!G){G=a[F];if(!G){G=e(E," ",e(E.toUpperCase()," "));G=f.extend(G,H);a[F]=G}}else{G=e(G,",",e(G.toUpperCase()," "))}return G}A=A||{};y=A.schema=="html5"?b():c();if(A.verify_html===false){A.valid_elements="*[*]"}if(A.valid_styles){D={};g(A.valid_styles,function(F,E){D[E]=f.explode(F)})}o=m("whitespace_elements","pre script style textarea");q=m("self_closing_elements","colgroup dd dt li options p td tfoot th thead tr");z=m("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source");r=m("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls");n=m("non_empty_elements","td th iframe video audio object",z);v=m("block_elements","h1 h2 h3 h4 h5 h6 hr p div address pre form table tbody thead tfoot th tr td li ol ul caption blockquote center dl dt dd dir fieldset noscript menu isindex samp header footer article section hgroup aside nav figure");function i(E){return new RegExp("^"+E.replace(/([?+*])/g,".$1")+"$")}function C(L){var K,G,Z,V,aa,F,I,U,X,Q,Y,ac,O,J,W,E,S,H,ab,ad,P,T,N=/^([#+\-])?([^\[\/]+)(?:\/([^\[]+))?(?:\[([^\]]+)\])?$/,R=/^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,M=/[*?+]/;if(L){L=d(L);if(s["@"]){S=s["@"].attributes;H=s["@"].attributesOrder}for(K=0,G=L.length;K=0){for(U=A.length-1;U>=V;U--){T=A[U];if(T.valid){n.end(T.name)}}A.length=V}}function p(U,T,Y,X,W){var Z,V;T=T.toLowerCase();Y=T in H?T:j(Y||X||W||"");if(v&&!z&&T.indexOf("data-")!==0){Z=P[T];if(!Z&&F){V=F.length;while(V--){Z=F[V];if(Z.pattern.test(T)){break}}if(V===-1){Z=null}}if(!Z){return}if(Z.validValues&&!(Y in Z.validValues)){return}}N.map[T]=Y;N.push({name:T,value:Y})}l=new RegExp("<(?:(?:!--([\\w\\W]*?)-->)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([^>]+)>)|(?:([A-Za-z0-9\\-\\:]+)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g");D=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:\\.|[^\"])*)\")|(?:\'((?:\\.|[^\'])*)\')|([^>\s]+)))?/g;K={script:/<\/script[^>]*>/gi,style:/<\/style[^>]*>/gi,noscript:/<\/noscript[^>]*>/gi};M=e.getShortEndedElements();J=e.getSelfClosingElements();H=e.getBoolAttrs();v=c.validate;s=c.remove_internals;y=c.fix_self_closing;q=a.isIE;o=/^:/;while(g=l.exec(E)){if(G0&&A[A.length-1].name===I){u(I)}if(!v||(m=e.getElementRule(I))){k=true;if(v){P=m.attributes;F=m.attributePatterns}if(R=g[8]){z=R.indexOf("data-mce-type")!==-1;if(z&&s){k=false}N=[];N.map={};R.replace(D,p)}else{N=[];N.map={}}if(v&&!z){S=m.attributesRequired;L=m.attributesDefault;f=m.attributesForced;if(f){Q=f.length;while(Q--){t=f[Q];r=t.name;h=t.value;if(h==="{$uid}"){h="mce_"+x++}N.map[r]=h;N.push({name:r,value:h})}}if(L){Q=L.length;while(Q--){t=L[Q];r=t.name;if(!(r in N.map)){h=t.value;if(h==="{$uid}"){h="mce_"+x++}N.map[r]=h;N.push({name:r,value:h})}}}if(S){Q=S.length;while(Q--){if(S[Q] in N.map){break}}if(Q===-1){k=false}}if(N.map["data-mce-bogus"]){k=false}}if(k){n.start(I,N,O)}}else{k=false}if(B=K[I]){B.lastIndex=G=g.index+g[0].length;if(g=B.exec(E)){if(k){C=E.substr(G,g.index-G)}G=g.index+g[0].length}else{C=E.substr(G);G=E.length}if(k&&C.length>0){n.text(C,true)}if(k){n.end(I)}l.lastIndex=G;continue}if(!O){if(!R||R.indexOf("/")!=R.length-1){A.push({name:I,valid:k})}else{if(k){n.end(I)}}}}else{if(I=g[1]){n.comment(I)}else{if(I=g[2]){n.cdata(I)}else{if(I=g[3]){n.doctype(I)}else{if(I=g[4]){n.pi(I,g[5])}}}}}}G=g.index+g[0].length}if(G=0;Q--){I=A[Q];if(I.valid){n.end(I.name)}}}}})(tinymce);(function(d){var c=/^[ \t\r\n]*$/,e={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11};function a(k,l,j){var i,h,f=j?"lastChild":"firstChild",g=j?"prev":"next";if(k[f]){return k[f]}if(k!==l){i=k[g];if(i){return i}for(h=k.parent;h&&h!==l;h=h.parent){i=h[g];if(i){return i}}}}function b(f,g){this.name=f;this.type=g;if(g===1){this.attributes=[];this.attributes.map={}}}d.extend(b.prototype,{replace:function(g){var f=this;if(g.parent){g.remove()}f.insert(g,f);f.remove();return f},attr:function(h,l){var f=this,g,j,k;if(typeof h!=="string"){for(j in h){f.attr(j,h[j])}return f}if(g=f.attributes){if(l!==k){if(l===null){if(h in g.map){delete g.map[h];j=g.length;while(j--){if(g[j].name===h){g=g.splice(j,1);return f}}}return f}if(h in g.map){j=g.length;while(j--){if(g[j].name===h){g[j].value=l;break}}}else{g.push({name:h,value:l})}g.map[h]=l;return f}else{return g.map[h]}}},clone:function(){var g=this,n=new b(g.name,g.type),h,f,m,j,k;if(m=g.attributes){k=[];k.map={};for(h=0,f=m.length;h1){v.reverse();z=n=f.filterNode(v[0].clone());for(t=0;t0){P.value=l;P=P.prev}else{N=P.prev;P.remove();P=N}}}n=new b.html.SaxParser({validate:z,fix_self_closing:!z,cdata:function(l){B.append(J("#cdata",4)).value=l},text:function(O,l){var N;if(!K){O=O.replace(k," ");if(B.lastChild&&o[B.lastChild.name]){O=O.replace(E,"")}}if(O.length!==0){N=J("#text",3);N.raw=!!l;B.append(N).value=O}},comment:function(l){B.append(J("#comment",8)).value=l},pi:function(l,N){B.append(J(l,7)).value=N;H(B)},doctype:function(N){var l;l=B.append(J("#doctype",10));l.value=N;H(B)},start:function(l,V,O){var T,Q,P,N,R,W,U,S;P=z?h.getElementRule(l):{};if(P){T=J(P.outputName||l,1);T.attributes=V;T.shortEnded=O;B.append(T);S=p[B.name];if(S&&p[T.name]&&!S[T.name]){L.push(T)}Q=d.length;while(Q--){R=d[Q].name;if(R in V.map){F=c[R];if(F){F.push(T)}else{c[R]=[T]}}}if(o[l]){H(T)}if(!O){B=T}if(!K&&s[l]){K=true}}},end:function(l){var R,O,Q,N,P;O=z?h.getElementRule(l):{};if(O){if(o[l]){if(!K){R=B.firstChild;if(R&&R.type===3){Q=R.value.replace(E,"");if(Q.length>0){R.value=Q;R=R.next}else{N=R.next;R.remove();R=N}while(R&&R.type===3){Q=R.value;N=R.next;if(Q.length===0||y.test(Q)){R.remove();R=N}R=N}}R=B.lastChild;if(R&&R.type===3){Q=R.value.replace(t,"");if(Q.length>0){R.value=Q;R=R.prev}else{N=R.prev;R.remove();R=N}while(R&&R.type===3){Q=R.value;N=R.prev;if(Q.length===0||y.test(Q)){R.remove();R=N}R=N}}}R=B.prev;if(R&&R.type===3){Q=R.value.replace(E,"");if(Q.length>0){R.value=Q}else{R.remove()}}}if(K&&s[l]){K=false}if(O.removeEmpty||O.paddEmpty){if(B.isEmpty(u)){if(O.paddEmpty){B.empty().append(new a("#text","3")).value="\u00a0"}else{if(!B.attributes.map.name){P=B.parent;B.empty().remove();B=P;return}}}}B=B.parent}}},h);I=B=new a(m.context||g.root_name,11);n.parse(v);if(z&&L.length){if(!m.context){j(L)}else{m.invalid=true}}if(q&&I.name=="body"){G()}if(!m.invalid){for(M in i){F=e[M];A=i[M];x=A.length;while(x--){if(!A[x].parent){A.splice(x,1)}}for(D=0,C=F.length;D0){o=c[c.length-1];if(o.length>0&&o!=="\n"){c.push("\n")}}c.push("<",m);if(k){for(n=0,j=k.length;n0){o=c[c.length-1];if(o.length>0&&o!=="\n"){c.push("\n")}}},end:function(h){var i;c.push("");if(a&&d[h]&&c.length>0){i=c[c.length-1];if(i.length>0&&i!=="\n"){c.push("\n")}}},text:function(i,h){if(i.length>0){c[c.length]=h?i:f(i)}},cdata:function(h){c.push("")},comment:function(h){c.push("")},pi:function(h,i){if(i){c.push("")}else{c.push("")}if(a){c.push("\n")}},doctype:function(h){c.push("",a?"\n":"")},reset:function(){c.length=0},getContent:function(){return c.join("").replace(/\n$/,"")}}};(function(a){a.html.Serializer=function(c,d){var b=this,e=new a.html.Writer(c);c=c||{};c.validate="validate" in c?c.validate:true;b.schema=d=d||new a.html.Schema();b.writer=e;b.serialize=function(h){var g,i;i=c.validate;g={3:function(k,j){e.text(k.value,k.raw)},8:function(j){e.comment(j.value)},7:function(j){e.pi(j.name,j.value)},10:function(j){e.doctype(j.value)},4:function(j){e.cdata(j.value)},11:function(j){if((j=j.firstChild)){do{f(j)}while(j=j.next)}}};e.reset();function f(k){var t=g[k.type],j,o,s,r,p,u,n,m,q;if(!t){j=k.name;o=k.shortEnded;s=k.attributes;if(i&&s&&s.length>1){u=[];u.map={};q=d.getElementRule(k.name);for(n=0,m=q.attributesOrder.length;n=8;k.boxModel=!e.isIE||o.compatMode=="CSS1Compat"||k.stdMode;k.hasOuterHTML="outerHTML" in o.createElement("a");k.settings=l=e.extend({keep_values:false,hex_colors:1},l);k.schema=l.schema;k.styles=new e.html.Styles({url_converter:l.url_converter,url_converter_scope:l.url_converter_scope},l.schema);if(e.isIE6){try{o.execCommand("BackgroundImageCache",false,true)}catch(m){k.cssFlicker=true}}k.fixDoc(o);k.events=l.ownEvents?new e.dom.EventUtils(l.proxy):e.dom.Event;e.addUnload(k.destroy,k);n=l.schema?l.schema.getBlockElements():{};k.isBlock=function(q){var p=q.nodeType;if(p){return !!(p===1&&n[q.nodeName])}return !!n[q]}},fixDoc:function(k){var j=this.settings,i;if(b&&j.schema){("abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video").replace(/\w+/g,function(l){k.createElement(l)});for(i in j.schema.getCustomElements()){k.createElement(i)}}},clone:function(k,i){var j=this,m,l;if(!b||k.nodeType!==1||i){return k.cloneNode(i)}l=j.doc;if(!i){m=l.createElement(k.nodeName);g(j.getAttribs(k),function(n){j.setAttrib(m,n.nodeName,j.getAttrib(k,n.nodeName))});return m}return m.firstChild},getRoot:function(){var i=this,j=i.settings;return(j&&i.get(j.root_element))||i.doc.body},getViewPort:function(j){var k,i;j=!j?this.win:j;k=j.document;i=this.boxModel?k.documentElement:k.body;return{x:j.pageXOffset||i.scrollLeft,y:j.pageYOffset||i.scrollTop,w:j.innerWidth||i.clientWidth,h:j.innerHeight||i.clientHeight}},getRect:function(l){var k,i=this,j;l=i.get(l);k=i.getPos(l);j=i.getSize(l);return{x:k.x,y:k.y,w:j.w,h:j.h}},getSize:function(l){var j=this,i,k;l=j.get(l);i=j.getStyle(l,"width");k=j.getStyle(l,"height");if(i.indexOf("px")===-1){i=0}if(k.indexOf("px")===-1){k=0}return{w:parseInt(i,10)||l.offsetWidth||l.clientWidth,h:parseInt(k,10)||l.offsetHeight||l.clientHeight}},getParent:function(k,j,i){return this.getParents(k,j,i,false)},getParents:function(s,m,k,q){var j=this,i,l=j.settings,p=[];s=j.get(s);q=q===undefined;if(l.strict_root){k=k||j.getRoot()}if(d(m,"string")){i=m;if(m==="*"){m=function(o){return o.nodeType==1}}else{m=function(o){return j.is(o,i)}}}while(s){if(s==k||!s.nodeType||s.nodeType===9){break}if(!m||m(s)){if(q){p.push(s)}else{return s}}s=s.parentNode}return q?p:null},get:function(i){var j;if(i&&this.doc&&typeof(i)=="string"){j=i;i=this.doc.getElementById(i);if(i&&i.id!==j){return this.doc.getElementsByName(j)[1]}}return i},getNext:function(j,i){return this._findSib(j,i,"nextSibling")},getPrev:function(j,i){return this._findSib(j,i,"previousSibling")},select:function(k,j){var i=this;return e.dom.Sizzle(k,i.get(j)||i.get(i.settings.root_element)||i.doc,[])},is:function(l,j){var k;if(l.length===undefined){if(j==="*"){return l.nodeType==1}if(c.test(j)){j=j.toLowerCase().split(/,/);l=l.nodeName.toLowerCase();for(k=j.length-1;k>=0;k--){if(j[k]==l){return true}}return false}}return e.dom.Sizzle.matches(j,l.nodeType?[l]:l).length>0},add:function(l,o,i,k,m){var j=this;return this.run(l,function(r){var q,n;q=d(o,"string")?j.doc.createElement(o):o;j.setAttribs(q,i);if(k){if(k.nodeType){q.appendChild(k)}else{j.setHTML(q,k)}}return !m?r.appendChild(q):q})},create:function(k,i,j){return this.add(this.doc.createElement(k),k,i,j,1)},createHTML:function(q,i,m){var p="",l=this,j;p+="<"+q;for(j in i){if(i.hasOwnProperty(j)){p+=" "+j+'="'+l.encode(i[j])+'"'}}if(typeof(m)!="undefined"){return p+">"+m+""}return p+" />"},remove:function(i,j){return this.run(i,function(l){var m,k=l.parentNode;if(!k){return null}if(j){while(m=l.firstChild){if(!e.isIE||m.nodeType!==3||m.nodeValue){k.insertBefore(m,l)}else{l.removeChild(m)}}}return k.removeChild(l)})},setStyle:function(l,i,j){var k=this;return k.run(l,function(o){var n,m;n=o.style;i=i.replace(/-(\D)/g,function(q,p){return p.toUpperCase()});if(k.pixelStyles.test(i)&&(e.is(j,"number")||/^[\-0-9\.]+$/.test(j))){j+="px"}switch(i){case"opacity":if(b){n.filter=j===""?"":"alpha(opacity="+(j*100)+")";if(!l.currentStyle||!l.currentStyle.hasLayout){n.display="inline-block"}}n[i]=n["-moz-opacity"]=n["-khtml-opacity"]=j||"";break;case"float":b?n.styleFloat=j:n.cssFloat=j;break;default:n[i]=j||""}if(k.settings.update_styles){k.setAttrib(o,"data-mce-style")}})},getStyle:function(l,i,k){l=this.get(l);if(!l){return}if(this.doc.defaultView&&k){i=i.replace(/[A-Z]/g,function(m){return"-"+m});try{return this.doc.defaultView.getComputedStyle(l,null).getPropertyValue(i)}catch(j){return null}}i=i.replace(/-(\D)/g,function(n,m){return m.toUpperCase()});if(i=="float"){i=b?"styleFloat":"cssFloat"}if(l.currentStyle&&k){return l.currentStyle[i]}return l.style?l.style[i]:undefined},setStyles:function(l,m){var j=this,k=j.settings,i;i=k.update_styles;k.update_styles=0;g(m,function(o,p){j.setStyle(l,p,o)});k.update_styles=i;if(k.update_styles){j.setAttrib(l,k.cssText)}},removeAllAttribs:function(i){return this.run(i,function(l){var k,j=l.attributes;for(k=j.length-1;k>=0;k--){l.removeAttributeNode(j.item(k))}})},setAttrib:function(k,l,i){var j=this;if(!k||!l){return}if(j.settings.strict){l=l.toLowerCase()}return this.run(k,function(p){var o=j.settings;var m=p.getAttribute(l);if(i!==null){switch(l){case"style":if(!d(i,"string")){g(i,function(q,r){j.setStyle(p,r,q)});return}if(o.keep_values){if(i&&!j._isRes(i)){p.setAttribute("data-mce-style",i,2)}else{p.removeAttribute("data-mce-style",2)}}p.style.cssText=i;break;case"class":p.className=i||"";break;case"src":case"href":if(o.keep_values){if(o.url_converter){i=o.url_converter.call(o.url_converter_scope||j,i,l,p)}j.setAttrib(p,"data-mce-"+l,i,2)}break;case"shape":p.setAttribute("data-mce-style",i);break}}if(d(i)&&i!==null&&i.length!==0){p.setAttribute(l,""+i,2)}else{p.removeAttribute(l,2)}if(tinyMCE.activeEditor&&m!=i){var n=tinyMCE.activeEditor;n.onSetAttrib.dispatch(n,p,l,i)}})},setAttribs:function(j,k){var i=this;return this.run(j,function(l){g(k,function(m,o){i.setAttrib(l,o,m)})})},getAttrib:function(m,o,k){var i,j=this,l;m=j.get(m);if(!m||m.nodeType!==1){return k===l?false:k}if(!d(k)){k=""}if(/^(src|href|style|coords|shape)$/.test(o)){i=m.getAttribute("data-mce-"+o);if(i){return i}}if(b&&j.props[o]){i=m[j.props[o]];i=i&&i.nodeValue?i.nodeValue:i}if(!i){i=m.getAttribute(o,2)}if(/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(o)){if(m[j.props[o]]===true&&i===""){return o}return i?o:""}if(m.nodeName==="FORM"&&m.getAttributeNode(o)){return m.getAttributeNode(o).nodeValue}if(o==="style"){i=i||m.style.cssText;if(i){i=j.serializeStyle(j.parseStyle(i),m.nodeName);if(j.settings.keep_values&&!j._isRes(i)){m.setAttribute("data-mce-style",i)}}}if(f&&o==="class"&&i){i=i.replace(/(apple|webkit)\-[a-z\-]+/gi,"")}if(b){switch(o){case"rowspan":case"colspan":if(i===1){i=""}break;case"size":if(i==="+0"||i===20||i===0){i=""}break;case"width":case"height":case"vspace":case"checked":case"disabled":case"readonly":if(i===0){i=""}break;case"hspace":if(i===-1){i=""}break;case"maxlength":case"tabindex":if(i===32768||i===2147483647||i==="32768"){i=""}break;case"multiple":case"compact":case"noshade":case"nowrap":if(i===65535){return o}return k;case"shape":i=i.toLowerCase();break;default:if(o.indexOf("on")===0&&i){i=e._replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/,"$1",""+i)}}}return(i!==l&&i!==null&&i!=="")?""+i:k},getPos:function(q,l){var j=this,i=0,p=0,m,o=j.doc,k;q=j.get(q);l=l||o.body;if(q){if(q.getBoundingClientRect){q=q.getBoundingClientRect();m=j.boxModel?o.documentElement:o.body;i=q.left+(o.documentElement.scrollLeft||o.body.scrollLeft)-m.clientTop;p=q.top+(o.documentElement.scrollTop||o.body.scrollTop)-m.clientLeft;return{x:i,y:p}}k=q;while(k&&k!=l&&k.nodeType){i+=k.offsetLeft||0;p+=k.offsetTop||0;k=k.offsetParent}k=q.parentNode;while(k&&k!=l&&k.nodeType){i-=k.scrollLeft||0;p-=k.scrollTop||0;k=k.parentNode}}return{x:i,y:p}},parseStyle:function(i){return this.styles.parse(i)},serializeStyle:function(j,i){return this.styles.serialize(j,i)},loadCSS:function(i){var k=this,l=k.doc,j;if(!i){i=""}j=l.getElementsByTagName("head")[0];g(i.split(","),function(m){var n;if(k.files[m]){return}k.files[m]=true;n=k.create("link",{rel:"stylesheet",href:e._addVer(m)});if(b&&l.documentMode&&l.recalc){n.onload=function(){if(l.recalc){l.recalc()}n.onload=null}}j.appendChild(n)})},addClass:function(i,j){return this.run(i,function(k){var l;if(!j){return 0}if(this.hasClass(k,j)){return k.className}l=this.removeClass(k,j);return k.className=(l!=""?(l+" "):"")+j})},removeClass:function(k,l){var i=this,j;return i.run(k,function(n){var m;if(i.hasClass(n,l)){if(!j){j=new RegExp("(^|\\s+)"+l+"(\\s+|$)","g")}m=n.className.replace(j," ");m=e.trim(m!=" "?m:"");n.className=m;if(!m){n.removeAttribute("class");n.removeAttribute("className")}return m}return n.className})},hasClass:function(j,i){j=this.get(j);if(!j||!i){return false}return(" "+j.className+" ").indexOf(" "+i+" ")!==-1},show:function(i){return this.setStyle(i,"display","block")},hide:function(i){return this.setStyle(i,"display","none")},isHidden:function(i){i=this.get(i);return !i||i.style.display=="none"||this.getStyle(i,"display")=="none"},uniqueId:function(i){return(!i?"mce_":i)+(this.counter++)},setHTML:function(k,j){var i=this;return i.run(k,function(m){if(b){while(m.firstChild){m.removeChild(m.firstChild)}try{m.innerHTML="
                    "+j;m.removeChild(m.firstChild)}catch(l){m=i.create("div");m.innerHTML="
                    "+j;g(m.childNodes,function(o,n){if(n){m.appendChild(o)}})}}else{m.innerHTML=j}return j})},getOuterHTML:function(k){var j,i=this;k=i.get(k);if(!k){return null}if(k.nodeType===1&&i.hasOuterHTML){return k.outerHTML}j=(k.ownerDocument||i.doc).createElement("body");j.appendChild(k.cloneNode(true));return j.innerHTML},setOuterHTML:function(l,j,m){var i=this;function k(p,o,r){var s,q;q=r.createElement("body");q.innerHTML=o;s=q.lastChild;while(s){i.insertAfter(s.cloneNode(true),p);s=s.previousSibling}i.remove(p)}return this.run(l,function(o){o=i.get(o);if(o.nodeType==1){m=m||o.ownerDocument||i.doc;if(b){try{if(b&&o.nodeType==1){o.outerHTML=j}else{k(o,j,m)}}catch(n){k(o,j,m)}}else{k(o,j,m)}}})},decode:h.decode,encode:h.encodeAllRaw,insertAfter:function(i,j){j=this.get(j);return this.run(i,function(l){var k,m;k=j.parentNode;m=j.nextSibling;if(m){k.insertBefore(l,m)}else{k.appendChild(l)}return l})},replace:function(m,l,i){var j=this;if(d(l,"array")){m=m.cloneNode(true)}return j.run(l,function(k){if(i){g(e.grep(k.childNodes),function(n){m.appendChild(n)})}return k.parentNode.replaceChild(m,k)})},rename:function(l,i){var k=this,j;if(l.nodeName!=i.toUpperCase()){j=k.create(i);g(k.getAttribs(l),function(m){k.setAttrib(j,m.nodeName,k.getAttrib(l,m.nodeName))});k.replace(j,l,1)}return j||l},findCommonAncestor:function(k,i){var l=k,j;while(l){j=i;while(j&&l!=j){j=j.parentNode}if(l==j){break}l=l.parentNode}if(!l&&k.ownerDocument){return k.ownerDocument.documentElement}return l},toHex:function(i){var k=/^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(i);function j(l){l=parseInt(l,10).toString(16);return l.length>1?l:"0"+l}if(k){i="#"+j(k[1])+j(k[2])+j(k[3]);return i}return i},getClasses:function(){var n=this,j=[],m,o={},p=n.settings.class_filter,l;if(n.classes){return n.classes}function q(i){g(i.imports,function(s){q(s)});g(i.cssRules||i.rules,function(s){switch(s.type||1){case 1:if(s.selectorText){g(s.selectorText.split(","),function(r){r=r.replace(/^\s*|\s*$|^\s\./g,"");if(/\.mce/.test(r)||!/\.[\w\-]+$/.test(r)){return}l=r;r=e._replace(/.*\.([a-z0-9_\-]+).*/i,"$1",r);if(p&&!(r=p(r,l))){return}if(!o[r]){j.push({"class":r});o[r]=1}})}break;case 3:q(s.styleSheet);break}})}try{g(n.doc.styleSheets,q)}catch(k){}if(j.length>0){n.classes=j}return j},run:function(l,k,j){var i=this,m;if(i.doc&&typeof(l)==="string"){l=i.get(l)}if(!l){return false}j=j||this;if(!l.nodeType&&(l.length||l.length===0)){m=[];g(l,function(o,n){if(o){if(typeof(o)=="string"){o=i.doc.getElementById(o)}m.push(k.call(j,o,n))}});return m}return k.call(j,l)},getAttribs:function(j){var i;j=this.get(j);if(!j){return[]}if(b){i=[];if(j.nodeName=="OBJECT"){return j.attributes}if(j.nodeName==="OPTION"&&this.getAttrib(j,"selected")){i.push({specified:1,nodeName:"selected"})}j.cloneNode(false).outerHTML.replace(/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi,"").replace(/[\w:\-]+/gi,function(k){i.push({specified:1,nodeName:k})});return i}return j.attributes},isEmpty:function(m,k){var r=this,o,n,q,j,l,p=0;m=m.firstChild;if(m){j=new e.dom.TreeWalker(m,m.parentNode);k=k||r.schema?r.schema.getNonEmptyElements():null;do{q=m.nodeType;if(q===1){if(m.getAttribute("data-mce-bogus")){continue}l=m.nodeName.toLowerCase();if(k&&k[l]){if(l==="br"){p++;continue}return false}n=r.getAttribs(m);o=m.attributes.length;while(o--){l=m.attributes[o].nodeName;if(l==="name"||l==="data-mce-bookmark"){return false}}}if(q==8){return false}if((q===3&&!a.test(m.nodeValue))){return false}}while(m=j.next())}return p<=1},destroy:function(j){var i=this;i.win=i.doc=i.root=i.events=i.frag=null;if(!j){e.removeUnload(i.destroy)}},createRng:function(){var i=this.doc;return i.createRange?i.createRange():new e.dom.Range(this)},nodeIndex:function(m,n){var i=0,k,l,j;if(m){for(k=m.nodeType,m=m.previousSibling,l=m;m;m=m.previousSibling){j=m.nodeType;if(n&&j==3){if(j==k||!m.nodeValue.length){continue}}i++;k=j}}return i},split:function(m,l,p){var q=this,i=q.createRng(),n,k,o;function j(v){var t,s=v.childNodes,u=v.nodeType;function x(A){var z=A.previousSibling&&A.previousSibling.nodeName=="SPAN";var y=A.nextSibling&&A.nextSibling.nodeName=="SPAN";return z&&y}if(u==1&&v.getAttribute("data-mce-type")=="bookmark"){return}for(t=s.length-1;t>=0;t--){j(s[t])}if(u!=9){if(u==3&&v.nodeValue.length>0){var r=e.trim(v.nodeValue).length;if(!q.isBlock(v.parentNode)||r>0||r===0&&x(v)){return}}else{if(u==1){s=v.childNodes;if(s.length==1&&s[0]&&s[0].nodeType==1&&s[0].getAttribute("data-mce-type")=="bookmark"){v.parentNode.insertBefore(s[0],v)}if(s.length||/^(br|hr|input|img)$/i.test(v.nodeName)){return}}}q.remove(v)}return v}if(m&&l){i.setStart(m.parentNode,q.nodeIndex(m));i.setEnd(l.parentNode,q.nodeIndex(l));n=i.extractContents();i=q.createRng();i.setStart(l.parentNode,q.nodeIndex(l)+1);i.setEnd(m.parentNode,q.nodeIndex(m)+1);k=i.extractContents();o=m.parentNode;o.insertBefore(j(n),m);if(p){o.replaceChild(p,l)}else{o.insertBefore(l,m)}o.insertBefore(j(k),m);q.remove(m);return p||l}},bind:function(l,i,k,j){return this.events.add(l,i,k,j||this)},unbind:function(k,i,j){return this.events.remove(k,i,j)},fire:function(k,j,i){return this.events.fire(k,j,i)},getContentEditable:function(j){var i;if(j.nodeType!=1){return null}i=j.getAttribute("data-mce-contenteditable");if(i&&i!=="inherit"){return i}return j.contentEditable!=="inherit"?j.contentEditable:null},_findSib:function(l,i,j){var k=this,m=i;if(l){if(d(m,"string")){m=function(n){return k.is(n,i)}}for(l=l[j];l;l=l[j]){if(m(l)){return l}}}return null},_isRes:function(i){return/^(top|left|bottom|right|width|height)/i.test(i)||/;\s*(top|left|bottom|right|width|height)/i.test(i)}});e.DOM=new e.dom.DOMUtils(document,{process_html:0})})(tinymce);(function(a){function b(c){var O=this,e=c.doc,T=0,F=1,j=2,E=true,S=false,V="startOffset",h="startContainer",Q="endContainer",A="endOffset",k=tinymce.extend,n=c.nodeIndex;k(O,{startContainer:e,startOffset:0,endContainer:e,endOffset:0,collapsed:E,commonAncestorContainer:e,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:q,setEnd:s,setStartBefore:g,setStartAfter:J,setEndBefore:K,setEndAfter:u,collapse:B,selectNode:y,selectNodeContents:G,compareBoundaryPoints:v,deleteContents:p,extractContents:I,cloneContents:d,insertNode:D,surroundContents:N,cloneRange:L});function x(){return e.createDocumentFragment()}function q(W,t){C(E,W,t)}function s(W,t){C(S,W,t)}function g(t){q(t.parentNode,n(t))}function J(t){q(t.parentNode,n(t)+1)}function K(t){s(t.parentNode,n(t))}function u(t){s(t.parentNode,n(t)+1)}function B(t){if(t){O[Q]=O[h];O[A]=O[V]}else{O[h]=O[Q];O[V]=O[A]}O.collapsed=E}function y(t){g(t);u(t)}function G(t){q(t,0);s(t,t.nodeType===1?t.childNodes.length:t.nodeValue.length)}function v(Z,t){var ac=O[h],X=O[V],ab=O[Q],W=O[A],aa=t.startContainer,ae=t.startOffset,Y=t.endContainer,ad=t.endOffset;if(Z===0){return H(ac,X,aa,ae)}if(Z===1){return H(ab,W,aa,ae)}if(Z===2){return H(ab,W,Y,ad)}if(Z===3){return H(ac,X,Y,ad)}}function p(){l(j)}function I(){return l(T)}function d(){return l(F)}function D(Z){var W=this[h],t=this[V],Y,X;if((W.nodeType===3||W.nodeType===4)&&W.nodeValue){if(!t){W.parentNode.insertBefore(Z,W)}else{if(t>=W.nodeValue.length){c.insertAfter(Z,W)}else{Y=W.splitText(t);W.parentNode.insertBefore(Z,Y)}}}else{if(W.childNodes.length>0){X=W.childNodes[t]}if(X){W.insertBefore(Z,X)}else{W.appendChild(Z)}}}function N(W){var t=O.extractContents();O.insertNode(W);W.appendChild(t);O.selectNode(W)}function L(){return k(new b(c),{startContainer:O[h],startOffset:O[V],endContainer:O[Q],endOffset:O[A],collapsed:O.collapsed,commonAncestorContainer:O.commonAncestorContainer})}function P(t,W){var X;if(t.nodeType==3){return t}if(W<0){return t}X=t.firstChild;while(X&&W>0){--W;X=X.nextSibling}if(X){return X}return t}function m(){return(O[h]==O[Q]&&O[V]==O[A])}function H(Y,aa,W,Z){var ab,X,t,ac,ae,ad;if(Y==W){if(aa==Z){return 0}if(aa0){O.collapse(W)}}else{O.collapse(W)}O.collapsed=m();O.commonAncestorContainer=c.findCommonAncestor(O[h],O[Q])}function l(ac){var ab,Y=0,ae=0,W,aa,X,Z,t,ad;if(O[h]==O[Q]){return f(ac)}for(ab=O[Q],W=ab.parentNode;W;ab=W,W=W.parentNode){if(W==O[h]){return r(ab,ac)}++Y}for(ab=O[h],W=ab.parentNode;W;ab=W,W=W.parentNode){if(W==O[Q]){return U(ab,ac)}++ae}aa=ae-Y;X=O[h];while(aa>0){X=X.parentNode;aa--}Z=O[Q];while(aa<0){Z=Z.parentNode;aa++}for(t=X.parentNode,ad=Z.parentNode;t!=ad;t=t.parentNode,ad=ad.parentNode){X=t;Z=ad}return o(X,Z,ac)}function f(ab){var ad,ae,t,X,Y,ac,Z,W,aa;if(ab!=j){ad=x()}if(O[V]==O[A]){return ad}if(O[h].nodeType==3){ae=O[h].nodeValue;t=ae.substring(O[V],O[A]);if(ab!=F){X=O[h];W=O[V];aa=O[A]-O[V];if(W===0&&aa>=X.nodeValue.length-1){X.parentNode.removeChild(X)}else{X.deleteData(W,aa)}O.collapse(E)}if(ab==j){return}if(t.length>0){ad.appendChild(e.createTextNode(t))}return ad}X=P(O[h],O[V]);Y=O[A]-O[V];while(X&&Y>0){ac=X.nextSibling;Z=z(X,ab);if(ad){ad.appendChild(Z)}--Y;X=ac}if(ab!=F){O.collapse(E)}return ad}function r(ac,Z){var ab,aa,W,t,Y,X;if(Z!=j){ab=x()}aa=i(ac,Z);if(ab){ab.appendChild(aa)}W=n(ac);t=W-O[V];if(t<=0){if(Z!=F){O.setEndBefore(ac);O.collapse(S)}return ab}aa=ac.previousSibling;while(t>0){Y=aa.previousSibling;X=z(aa,Z);if(ab){ab.insertBefore(X,ab.firstChild)}--t;aa=Y}if(Z!=F){O.setEndBefore(ac);O.collapse(S)}return ab}function U(aa,Z){var ac,W,ab,t,Y,X;if(Z!=j){ac=x()}ab=R(aa,Z);if(ac){ac.appendChild(ab)}W=n(aa);++W;t=O[A]-W;ab=aa.nextSibling;while(ab&&t>0){Y=ab.nextSibling;X=z(ab,Z);if(ac){ac.appendChild(X)}--t;ab=Y}if(Z!=F){O.setStartAfter(aa);O.collapse(E)}return ac}function o(aa,t,ad){var X,af,Z,ab,ac,W,ae,Y;if(ad!=j){af=x()}X=R(aa,ad);if(af){af.appendChild(X)}Z=aa.parentNode;ab=n(aa);ac=n(t);++ab;W=ac-ab;ae=aa.nextSibling;while(W>0){Y=ae.nextSibling;X=z(ae,ad);if(af){af.appendChild(X)}ae=Y;--W}X=i(t,ad);if(af){af.appendChild(X)}if(ad!=F){O.setStartAfter(aa);O.collapse(E)}return af}function i(ab,ac){var X=P(O[Q],O[A]-1),ad,aa,Z,t,W,Y=X!=O[Q];if(X==ab){return M(X,Y,S,ac)}ad=X.parentNode;aa=M(ad,S,S,ac);while(ad){while(X){Z=X.previousSibling;t=M(X,Y,S,ac);if(ac!=j){aa.insertBefore(t,aa.firstChild)}Y=E;X=Z}if(ad==ab){return aa}X=ad.previousSibling;ad=ad.parentNode;W=M(ad,S,S,ac);if(ac!=j){W.appendChild(aa)}aa=W}}function R(ab,ac){var Y=P(O[h],O[V]),Z=Y!=O[h],ad,aa,X,t,W;if(Y==ab){return M(Y,Z,E,ac)}ad=Y.parentNode;aa=M(ad,S,E,ac);while(ad){while(Y){X=Y.nextSibling;t=M(Y,Z,E,ac);if(ac!=j){aa.appendChild(t)}Z=E;Y=X}if(ad==ab){return aa}Y=ad.nextSibling;ad=ad.parentNode;W=M(ad,S,E,ac);if(ac!=j){W.appendChild(aa)}aa=W}}function M(t,Z,ac,ad){var Y,X,aa,W,ab;if(Z){return z(t,ad)}if(t.nodeType==3){Y=t.nodeValue;if(ac){W=O[V];X=Y.substring(W);aa=Y.substring(0,W)}else{W=O[A];X=Y.substring(0,W);aa=Y.substring(W)}if(ad!=F){t.nodeValue=aa}if(ad==j){return}ab=c.clone(t,S);ab.nodeValue=X;return ab}if(ad==j){return}return c.clone(t,S)}function z(W,t){if(t!=j){return t==F?c.clone(W,E):W}W.parentNode.removeChild(W)}}a.Range=b})(tinymce.dom);(function(){function a(d){var b=this,h=d.dom,c=true,f=false;function e(i,j){var k,t=0,q,n,m,l,o,r,p=-1,s;k=i.duplicate();k.collapse(j);s=k.parentElement();if(s.ownerDocument!==d.dom.doc){return}while(s.contentEditable==="false"){s=s.parentNode}if(!s.hasChildNodes()){return{node:s,inside:1}}m=s.children;q=m.length-1;while(t<=q){r=Math.floor((t+q)/2);l=m[r];k.moveToElementText(l);p=k.compareEndPoints(j?"StartToStart":"EndToEnd",i);if(p>0){q=r-1}else{if(p<0){t=r+1}else{return{node:l}}}}if(p<0){if(!l){k.moveToElementText(s);k.collapse(true);l=s;n=true}else{k.collapse(false)}o=0;while(k.compareEndPoints(j?"StartToStart":"StartToEnd",i)!==0){if(k.move("character",1)===0||s!=k.parentElement()){break}o++}}else{k.collapse(true);o=0;while(k.compareEndPoints(j?"StartToStart":"StartToEnd",i)!==0){if(k.move("character",-1)===0||s!=k.parentElement()){break}o++}}return{node:l,position:p,offset:o,inside:n}}function g(){var i=d.getRng(),r=h.createRng(),l,k,p,q,m,j;l=i.item?i.item(0):i.parentElement();if(l.ownerDocument!=h.doc){return r}k=d.isCollapsed();if(i.item){r.setStart(l.parentNode,h.nodeIndex(l));r.setEnd(r.startContainer,r.startOffset+1);return r}function o(A){var u=e(i,A),s,y,z=0,x,v,t;s=u.node;y=u.offset;if(u.inside&&!s.hasChildNodes()){r[A?"setStart":"setEnd"](s,0);return}if(y===v){r[A?"setStartBefore":"setEndAfter"](s);return}if(u.position<0){x=u.inside?s.firstChild:s.nextSibling;if(!x){r[A?"setStartAfter":"setEndAfter"](s);return}if(!y){if(x.nodeType==3){r[A?"setStart":"setEnd"](x,0)}else{r[A?"setStartBefore":"setEndBefore"](x)}return}while(x){t=x.nodeValue;z+=t.length;if(z>=y){s=x;z-=y;z=t.length-z;break}x=x.nextSibling}}else{x=s.previousSibling;if(!x){return r[A?"setStartBefore":"setEndBefore"](s)}if(!y){if(s.nodeType==3){r[A?"setStart":"setEnd"](x,s.nodeValue.length)}else{r[A?"setStartAfter":"setEndAfter"](x)}return}while(x){z+=x.nodeValue.length;if(z>=y){s=x;z-=y;break}x=x.previousSibling}}r[A?"setStart":"setEnd"](s,z)}try{o(true);if(!k){o()}}catch(n){if(n.number==-2147024809){m=b.getBookmark(2);p=i.duplicate();p.collapse(true);l=p.parentElement();if(!k){p=i.duplicate();p.collapse(false);q=p.parentElement();q.innerHTML=q.innerHTML}l.innerHTML=l.innerHTML;b.moveToBookmark(m);i=d.getRng();o(true);if(!k){o()}}else{throw n}}return r}this.getBookmark=function(m){var j=d.getRng(),o,i,l={};function n(u){var t,p,s,r,q=[];t=u.parentNode;p=h.getRoot().parentNode;while(t!=p&&t.nodeType!==9){s=t.children;r=s.length;while(r--){if(u===s[r]){q.push(r);break}}u=t;t=t.parentNode}return q}function k(q){var p;p=e(j,q);if(p){return{position:p.position,offset:p.offset,indexes:n(p.node),inside:p.inside}}}if(m===2){if(!j.item){l.start=k(true);if(!d.isCollapsed()){l.end=k()}}else{l.start={ctrl:true,indexes:n(j.item(0))}}}return l};this.moveToBookmark=function(k){var j,i=h.doc.body;function m(o){var r,q,n,p;r=h.getRoot();for(q=o.length-1;q>=0;q--){p=r.children;n=o[q];if(n<=p.length-1){r=p[n]}}return r}function l(r){var n=k[r?"start":"end"],q,p,o;if(n){q=n.position>0;p=i.createTextRange();p.moveToElementText(m(n.indexes));offset=n.offset;if(offset!==o){p.collapse(n.inside||q);p.moveStart("character",q?-offset:offset)}else{p.collapse(r)}j.setEndPoint(r?"StartToStart":"EndToStart",p);if(r){j.collapse(true)}}}if(k.start){if(k.start.ctrl){j=i.createControlRange();j.addElement(m(k.start.indexes));j.select()}else{j=i.createTextRange();l(true);l();j.select()}}};this.addRange=function(i){var n,l,k,p,s,q,r=d.dom.doc,m=r.body;function j(z){var u,y,t,x,v;t=h.create("a");u=z?k:s;y=z?p:q;x=n.duplicate();if(u==r||u==r.documentElement){u=m;y=0}if(u.nodeType==3){u.parentNode.insertBefore(t,u);x.moveToElementText(t);x.moveStart("character",y);h.remove(t);n.setEndPoint(z?"StartToStart":"EndToEnd",x)}else{v=u.childNodes;if(v.length){if(y>=v.length){h.insertAfter(t,v[v.length-1])}else{u.insertBefore(t,v[y])}x.moveToElementText(t)}else{if(u.canHaveHTML){u.innerHTML="\uFEFF";t=u.firstChild;x.moveToElementText(t);x.collapse(f)}}n.setEndPoint(z?"StartToStart":"EndToEnd",x);h.remove(t)}}k=i.startContainer;p=i.startOffset;s=i.endContainer;q=i.endOffset;n=m.createTextRange();if(k==s&&k.nodeType==1){if(p==q&&!k.hasChildNodes()){if(k.canHaveHTML){k.innerHTML="\uFEFF\uFEFF";n.moveToElementText(k.lastChild);n.select();h.doc.selection.clear();k.innerHTML="";return}else{p=h.nodeIndex(k);k=k.parentNode}}if(p==q-1){try{l=m.createControlRange();l.addElement(k.childNodes[p]);l.select();return}catch(o){}}}j(true);j();n.select()};this.getRangeAt=g}tinymce.dom.TridentSelection=a})();(function(){var n=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,i="sizcache",o=0,r=Object.prototype.toString,h=false,g=true,q=/\\/g,u=/\r\n/g,x=/\W/;[0,0].sort(function(){g=false;return 0});var d=function(C,e,F,G){F=F||[];e=e||document;var I=e;if(e.nodeType!==1&&e.nodeType!==9){return[]}if(!C||typeof C!=="string"){return F}var z,K,N,y,J,M,L,E,B=true,A=d.isXML(e),D=[],H=C;do{n.exec("");z=n.exec(H);if(z){H=z[3];D.push(z[1]);if(z[2]){y=z[3];break}}}while(z);if(D.length>1&&j.exec(C)){if(D.length===2&&k.relative[D[0]]){K=s(D[0]+D[1],e,G)}else{K=k.relative[D[0]]?[e]:d(D.shift(),e);while(D.length){C=D.shift();if(k.relative[C]){C+=D.shift()}K=s(C,K,G)}}}else{if(!G&&D.length>1&&e.nodeType===9&&!A&&k.match.ID.test(D[0])&&!k.match.ID.test(D[D.length-1])){J=d.find(D.shift(),e,A);e=J.expr?d.filter(J.expr,J.set)[0]:J.set[0]}if(e){J=G?{expr:D.pop(),set:l(G)}:d.find(D.pop(),D.length===1&&(D[0]==="~"||D[0]==="+")&&e.parentNode?e.parentNode:e,A);K=J.expr?d.filter(J.expr,J.set):J.set;if(D.length>0){N=l(K)}else{B=false}while(D.length){M=D.pop();L=M;if(!k.relative[M]){M=""}else{L=D.pop()}if(L==null){L=e}k.relative[M](N,L,A)}}else{N=D=[]}}if(!N){N=K}if(!N){d.error(M||C)}if(r.call(N)==="[object Array]"){if(!B){F.push.apply(F,N)}else{if(e&&e.nodeType===1){for(E=0;N[E]!=null;E++){if(N[E]&&(N[E]===true||N[E].nodeType===1&&d.contains(e,N[E]))){F.push(K[E])}}}else{for(E=0;N[E]!=null;E++){if(N[E]&&N[E].nodeType===1){F.push(K[E])}}}}}else{l(N,F)}if(y){d(y,I,F,G);d.uniqueSort(F)}return F};d.uniqueSort=function(y){if(p){h=g;y.sort(p);if(h){for(var e=1;e0};d.find=function(E,e,F){var D,z,B,A,C,y;if(!E){return[]}for(z=0,B=k.order.length;z":function(D,y){var C,B=typeof y==="string",z=0,e=D.length;if(B&&!x.test(y)){y=y.toLowerCase();for(;z=0)){if(!z){e.push(C)}}else{if(z){y[B]=false}}}}return false},ID:function(e){return e[1].replace(q,"")},TAG:function(y,e){return y[1].replace(q,"").toLowerCase()},CHILD:function(e){if(e[1]==="nth"){if(!e[2]){d.error(e[0])}e[2]=e[2].replace(/^\+|\s*/g,"");var y=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(e[2]==="even"&&"2n"||e[2]==="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(y[1]+(y[2]||1))-0;e[3]=y[3]-0}else{if(e[2]){d.error(e[0])}}e[0]=o++;return e},ATTR:function(B,y,z,e,C,D){var A=B[1]=B[1].replace(q,"");if(!D&&k.attrMap[A]){B[1]=k.attrMap[A]}B[4]=(B[4]||B[5]||"").replace(q,"");if(B[2]==="~="){B[4]=" "+B[4]+" "}return B},PSEUDO:function(B,y,z,e,C){if(B[1]==="not"){if((n.exec(B[3])||"").length>1||/^\w/.test(B[3])){B[3]=d(B[3],null,null,y)}else{var A=d.filter(B[3],y,z,true^C);if(!z){e.push.apply(e,A)}return false}}else{if(k.match.POS.test(B[0])||k.match.CHILD.test(B[0])){return true}}return B},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){if(e.parentNode){e.parentNode.selectedIndex}return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(z,y,e){return !!d(e[3],z).length},header:function(e){return(/h\d/i).test(e.nodeName)},text:function(z){var e=z.getAttribute("type"),y=z.type;return z.nodeName.toLowerCase()==="input"&&"text"===y&&(e===y||e===null)},radio:function(e){return e.nodeName.toLowerCase()==="input"&&"radio"===e.type},checkbox:function(e){return e.nodeName.toLowerCase()==="input"&&"checkbox"===e.type},file:function(e){return e.nodeName.toLowerCase()==="input"&&"file"===e.type},password:function(e){return e.nodeName.toLowerCase()==="input"&&"password"===e.type},submit:function(y){var e=y.nodeName.toLowerCase();return(e==="input"||e==="button")&&"submit"===y.type},image:function(e){return e.nodeName.toLowerCase()==="input"&&"image"===e.type},reset:function(y){var e=y.nodeName.toLowerCase();return(e==="input"||e==="button")&&"reset"===y.type},button:function(y){var e=y.nodeName.toLowerCase();return e==="input"&&"button"===y.type||e==="button"},input:function(e){return(/input|select|textarea|button/i).test(e.nodeName)},focus:function(e){return e===e.ownerDocument.activeElement}},setFilters:{first:function(y,e){return e===0},last:function(z,y,e,A){return y===A.length-1},even:function(y,e){return e%2===0},odd:function(y,e){return e%2===1},lt:function(z,y,e){return ye[3]-0},nth:function(z,y,e){return e[3]-0===y},eq:function(z,y,e){return e[3]-0===y}},filter:{PSEUDO:function(z,E,D,F){var e=E[1],y=k.filters[e];if(y){return y(z,D,E,F)}else{if(e==="contains"){return(z.textContent||z.innerText||b([z])||"").indexOf(E[3])>=0}else{if(e==="not"){var A=E[3];for(var C=0,B=A.length;C=0)}}},ID:function(y,e){return y.nodeType===1&&y.getAttribute("id")===e},TAG:function(y,e){return(e==="*"&&y.nodeType===1)||!!y.nodeName&&y.nodeName.toLowerCase()===e},CLASS:function(y,e){return(" "+(y.className||y.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(C,A){var z=A[1],e=d.attr?d.attr(C,z):k.attrHandle[z]?k.attrHandle[z](C):C[z]!=null?C[z]:C.getAttribute(z),D=e+"",B=A[2],y=A[4];return e==null?B==="!=":!B&&d.attr?e!=null:B==="="?D===y:B==="*="?D.indexOf(y)>=0:B==="~="?(" "+D+" ").indexOf(y)>=0:!y?D&&e!==false:B==="!="?D!==y:B==="^="?D.indexOf(y)===0:B==="$="?D.substr(D.length-y.length)===y:B==="|="?D===y||D.substr(0,y.length+1)===y+"-":false},POS:function(B,y,z,C){var e=y[2],A=k.setFilters[e];if(A){return A(B,z,y,C)}}}};var j=k.match.POS,c=function(y,e){return"\\"+(e-0+1)};for(var f in k.match){k.match[f]=new RegExp(k.match[f].source+(/(?![^\[]*\])(?![^\(]*\))/.source));k.leftMatch[f]=new RegExp(/(^(?:.|\r|\n)*?)/.source+k.match[f].source.replace(/\\(\d+)/g,c))}k.match.globalPOS=j;var l=function(y,e){y=Array.prototype.slice.call(y,0);if(e){e.push.apply(e,y);return e}return y};try{Array.prototype.slice.call(document.documentElement.childNodes,0)[0].nodeType}catch(v){l=function(B,A){var z=0,y=A||[];if(r.call(B)==="[object Array]"){Array.prototype.push.apply(y,B)}else{if(typeof B.length==="number"){for(var e=B.length;z";e.insertBefore(y,e.firstChild);if(document.getElementById(z)){k.find.ID=function(B,C,D){if(typeof C.getElementById!=="undefined"&&!D){var A=C.getElementById(B[1]);return A?A.id===B[1]||typeof A.getAttributeNode!=="undefined"&&A.getAttributeNode("id").nodeValue===B[1]?[A]:undefined:[]}};k.filter.ID=function(C,A){var B=typeof C.getAttributeNode!=="undefined"&&C.getAttributeNode("id");return C.nodeType===1&&B&&B.nodeValue===A}}e.removeChild(y);e=y=null})();(function(){var e=document.createElement("div");e.appendChild(document.createComment(""));if(e.getElementsByTagName("*").length>0){k.find.TAG=function(y,C){var B=C.getElementsByTagName(y[1]);if(y[1]==="*"){var A=[];for(var z=0;B[z];z++){if(B[z].nodeType===1){A.push(B[z])}}B=A}return B}}e.innerHTML="
                    ";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){k.attrHandle.href=function(y){return y.getAttribute("href",2)}}e=null})();if(document.querySelectorAll){(function(){var e=d,A=document.createElement("div"),z="__sizzle__";A.innerHTML="

                    ";if(A.querySelectorAll&&A.querySelectorAll(".TEST").length===0){return}d=function(L,C,G,K){C=C||document;if(!K&&!d.isXML(C)){var J=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(L);if(J&&(C.nodeType===1||C.nodeType===9)){if(J[1]){return l(C.getElementsByTagName(L),G)}else{if(J[2]&&k.find.CLASS&&C.getElementsByClassName){return l(C.getElementsByClassName(J[2]),G)}}}if(C.nodeType===9){if(L==="body"&&C.body){return l([C.body],G)}else{if(J&&J[3]){var F=C.getElementById(J[3]);if(F&&F.parentNode){if(F.id===J[3]){return l([F],G)}}else{return l([],G)}}}try{return l(C.querySelectorAll(L),G)}catch(H){}}else{if(C.nodeType===1&&C.nodeName.toLowerCase()!=="object"){var D=C,E=C.getAttribute("id"),B=E||z,N=C.parentNode,M=/^\s*[+~]/.test(L);if(!E){C.setAttribute("id",B)}else{B=B.replace(/'/g,"\\$&")}if(M&&N){C=C.parentNode}try{if(!M||N){return l(C.querySelectorAll("[id='"+B+"'] "+L),G)}}catch(I){}finally{if(!E){D.removeAttribute("id")}}}}}return e(L,C,G,K)};for(var y in e){d[y]=e[y]}A=null})()}(function(){var e=document.documentElement,z=e.matchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.msMatchesSelector;if(z){var B=!z.call(document.createElement("div"),"div"),y=false;try{z.call(document.documentElement,"[test!='']:sizzle")}catch(A){y=true}d.matchesSelector=function(D,F){F=F.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!d.isXML(D)){try{if(y||!k.match.PSEUDO.test(F)&&!/!=/.test(F)){var C=z.call(D,F);if(C||!B||D.document&&D.document.nodeType!==11){return C}}}catch(E){}}return d(F,null,null,[D]).length>0}}})();(function(){var e=document.createElement("div");e.innerHTML="
                    ";if(!e.getElementsByClassName||e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}k.order.splice(1,0,"CLASS");k.find.CLASS=function(y,z,A){if(typeof z.getElementsByClassName!=="undefined"&&!A){return z.getElementsByClassName(y[1])}};e=null})();function a(y,D,C,G,E,F){for(var A=0,z=G.length;A0){B=e;break}}}e=e[y]}G[A]=B}}}if(document.documentElement.contains){d.contains=function(y,e){return y!==e&&(y.contains?y.contains(e):true)}}else{if(document.documentElement.compareDocumentPosition){d.contains=function(y,e){return !!(y.compareDocumentPosition(e)&16)}}else{d.contains=function(){return false}}}d.isXML=function(e){var y=(e?e.ownerDocument||e:0).documentElement;return y?y.nodeName!=="HTML":false};var s=function(z,e,D){var C,E=[],B="",F=e.nodeType?[e]:e;while((C=k.match.PSEUDO.exec(z))){B+=C[0];z=z.replace(k.match.PSEUDO,"")}z=k.relative[z]?z+"*":z;for(var A=0,y=F.length;A"+(i.item?i.item(0).outerHTML:i.htmlText);m.removeChild(m.firstChild)}else{m.innerHTML=i.toString()}}if(/^\s/.test(m.innerHTML)){j=" "}if(/\s+$/.test(m.innerHTML)){l=" "}h.getInner=true;h.content=g.isCollapsed()?"":j+g.serializer.serialize(m,h)+l;g.onGetContent.dispatch(g,h);return h.content},setContent:function(h,j){var o=this,g=o.getRng(),k,l=o.win.document,n,m;j=j||{format:"html"};j.set=true;h=j.content=h;if(!j.no_events){o.onBeforeSetContent.dispatch(o,j)}h=j.content;if(g.insertNode){h+='_';if(g.startContainer==l&&g.endContainer==l){l.body.innerHTML=h}else{g.deleteContents();if(l.body.childNodes.length===0){l.body.innerHTML=h}else{if(g.createContextualFragment){g.insertNode(g.createContextualFragment(h))}else{n=l.createDocumentFragment();m=l.createElement("div");n.appendChild(m);m.outerHTML=h;g.insertNode(n)}}}k=o.dom.get("__caret");g=l.createRange();g.setStartBefore(k);g.setEndBefore(k);o.setRng(g);o.dom.remove("__caret");try{o.setRng(g)}catch(i){}}else{if(g.item){l.execCommand("Delete",false,null);g=o.getRng()}if(/^\s+/.test(h)){g.pasteHTML('_'+h);o.dom.remove("__mce_tmp")}else{g.pasteHTML(h)}}if(!j.no_events){o.onSetContent.dispatch(o,j)}},getStart:function(){var h=this.getRng(),i,g,k,j;if(h.duplicate||h.item){if(h.item){return h.item(0)}k=h.duplicate();k.collapse(1);i=k.parentElement();g=j=h.parentElement();while(j=j.parentNode){if(j==i){i=g;break}}return i}else{i=h.startContainer;if(i.nodeType==1&&i.hasChildNodes()){i=i.childNodes[Math.min(i.childNodes.length-1,h.startOffset)]}if(i&&i.nodeType==3){return i.parentNode}return i}},getEnd:function(){var h=this,i=h.getRng(),j,g;if(i.duplicate||i.item){if(i.item){return i.item(0)}i=i.duplicate();i.collapse(0);j=i.parentElement();if(j&&j.nodeName=="BODY"){return j.lastChild||j}return j}else{j=i.endContainer;g=i.endOffset;if(j.nodeType==1&&j.hasChildNodes()){j=j.childNodes[g>0?g-1:g]}if(j&&j.nodeType==3){return j.parentNode}return j}},getBookmark:function(s,v){var y=this,n=y.dom,h,k,j,o,i,p,q,m="\uFEFF",x;function g(z,A){var t=0;e(n.select(z),function(C,B){if(C==A){t=B}});return t}function u(t){function z(E){var A,D,C,B=E?"start":"end";A=t[B+"Container"];D=t[B+"Offset"];if(A.nodeType==1&&A.nodeName=="TR"){C=A.childNodes;A=C[Math.min(E?D:D-1,C.length-1)];if(A){D=E?0:A.childNodes.length;t["set"+(E?"Start":"End")](A,D)}}}z(true);z();return t}function l(){var z=y.getRng(true),t=n.getRoot(),A={};function B(E,J){var D=E[J?"startContainer":"endContainer"],I=E[J?"startOffset":"endOffset"],C=[],F,H,G=0;if(D.nodeType==3){if(v){for(F=D.previousSibling;F&&F.nodeType==3;F=F.previousSibling){I+=F.nodeValue.length}}C.push(I)}else{H=D.childNodes;if(I>=H.length&&H.length){G=1;I=Math.max(0,H.length-1)}C.push(y.dom.nodeIndex(H[I],v)+G)}for(;D&&D!=t;D=D.parentNode){C.push(y.dom.nodeIndex(D,v))}return C}A.start=B(z,true);if(!y.isCollapsed()){A.end=B(z)}return A}if(s==2){if(y.tridentSel){return y.tridentSel.getBookmark(s)}return l()}if(s){return{rng:y.getRng()}}h=y.getRng();j=n.uniqueId();o=tinyMCE.activeEditor.selection.isCollapsed();x="overflow:hidden;line-height:0px";if(h.duplicate||h.item){if(!h.item){k=h.duplicate();try{h.collapse();h.pasteHTML(''+m+"");if(!o){k.collapse(false);h.moveToElementText(k.parentElement());if(h.compareEndPoints("StartToEnd",k)===0){k.move("character",-1)}k.pasteHTML(''+m+"")}}catch(r){return null}}else{p=h.item(0);i=p.nodeName;return{name:i,index:g(i,p)}}}else{p=y.getNode();i=p.nodeName;if(i=="IMG"){return{name:i,index:g(i,p)}}k=u(h.cloneRange());if(!o){k.collapse(false);k.insertNode(n.create("span",{"data-mce-type":"bookmark",id:j+"_end",style:x},m))}h=u(h);h.collapse(true);h.insertNode(n.create("span",{"data-mce-type":"bookmark",id:j+"_start",style:x},m))}y.moveToBookmark({id:j,keep:1});return{id:j}},moveToBookmark:function(o){var s=this,m=s.dom,j,i,g,r,k,u,p,q;function h(A){var t=o[A?"start":"end"],x,y,z,v;if(t){z=t[0];for(y=r,x=t.length-1;x>=1;x--){v=y.childNodes;if(t[x]>v.length-1){return}y=v[t[x]]}if(y.nodeType===3){z=Math.min(t[0],y.nodeValue.length)}if(y.nodeType===1){z=Math.min(t[0],y.childNodes.length)}if(A){g.setStart(y,z)}else{g.setEnd(y,z)}}return true}function l(B){var v=m.get(o.id+"_"+B),A,t,y,z,x=o.keep;if(v){A=v.parentNode;if(B=="start"){if(!x){t=m.nodeIndex(v)}else{A=v.firstChild;t=1}k=u=A;p=q=t}else{if(!x){t=m.nodeIndex(v)}else{A=v.firstChild;t=1}u=A;q=t}if(!x){z=v.previousSibling;y=v.nextSibling;e(d.grep(v.childNodes),function(C){if(C.nodeType==3){C.nodeValue=C.nodeValue.replace(/\uFEFF/g,"")}});while(v=m.get(o.id+"_"+B)){m.remove(v,1)}if(z&&y&&z.nodeType==y.nodeType&&z.nodeType==3&&!d.isOpera){t=z.nodeValue.length;z.appendData(y.nodeValue);m.remove(y);if(B=="start"){k=u=z;p=q=t}else{u=z;q=t}}}}}function n(t){if(m.isBlock(t)&&!t.innerHTML&&!b){t.innerHTML='
                    '}return t}if(o){if(o.start){g=m.createRng();r=m.getRoot();if(s.tridentSel){return s.tridentSel.moveToBookmark(o)}if(h(true)&&h()){s.setRng(g)}}else{if(o.id){l("start");l("end");if(k){g=m.createRng();g.setStart(n(k),p);g.setEnd(n(u),q);s.setRng(g)}}else{if(o.name){s.select(m.select(o.name)[o.index])}else{if(o.rng){s.setRng(o.rng)}}}}}},select:function(l,k){var j=this,m=j.dom,h=m.createRng(),g;function i(n,p){var o=new a(n,n);do{if(n.nodeType==3&&d.trim(n.nodeValue).length!==0){if(p){h.setStart(n,0)}else{h.setEnd(n,n.nodeValue.length)}return}if(n.nodeName=="BR"){if(p){h.setStartBefore(n)}else{h.setEndBefore(n)}return}}while(n=(p?o.next():o.prev()))}if(l){g=m.nodeIndex(l);h.setStart(l.parentNode,g);h.setEnd(l.parentNode,g+1);if(k){i(l,1);i(l)}j.setRng(h)}return l},isCollapsed:function(){var g=this,i=g.getRng(),h=g.getSel();if(!i||i.item){return false}if(i.compareEndPoints){return i.compareEndPoints("StartToEnd",i)===0}return !h||i.collapsed},collapse:function(g){var i=this,h=i.getRng(),j;if(h.item){j=h.item(0);h=i.win.document.body.createTextRange();h.moveToElementText(j)}h.collapse(!!g);i.setRng(h)},getSel:function(){var h=this,g=this.win;return g.getSelection?g.getSelection():g.document.selection},getRng:function(m){var h=this,j,g,l,k=h.win.document;if(m&&h.tridentSel){return h.tridentSel.getRangeAt(0)}try{if(j=h.getSel()){g=j.rangeCount>0?j.getRangeAt(0):(j.createRange?j.createRange():k.createRange())}}catch(i){}if(d.isIE&&g&&g.setStart&&k.selection.createRange().item){l=k.selection.createRange().item(0);g=k.createRange();g.setStartBefore(l);g.setEndAfter(l)}if(!g){g=k.createRange?k.createRange():k.body.createTextRange()}if(g.setStart&&g.startContainer.nodeType===9&&g.collapsed){l=h.dom.getRoot();g.setStart(l,0);g.setEnd(l,0)}if(h.selectedRange&&h.explicitRange){if(g.compareBoundaryPoints(g.START_TO_START,h.selectedRange)===0&&g.compareBoundaryPoints(g.END_TO_END,h.selectedRange)===0){g=h.explicitRange}else{h.selectedRange=null;h.explicitRange=null}}return g},setRng:function(k,g){var j,i=this;if(!i.tridentSel){j=i.getSel();if(j){i.explicitRange=k;try{j.removeAllRanges()}catch(h){}j.addRange(k);if(g===false&&j.extend){j.collapse(k.endContainer,k.endOffset);j.extend(k.startContainer,k.startOffset)}i.selectedRange=j.rangeCount>0?j.getRangeAt(0):null}}else{if(k.cloneRange){try{i.tridentSel.addRange(k);return}catch(h){}}try{k.select()}catch(h){}}},setNode:function(h){var g=this;g.setContent(g.dom.getOuterHTML(h));return h},getNode:function(){var i=this,h=i.getRng(),j=i.getSel(),m,l=h.startContainer,g=h.endContainer;function k(q,o){var p=q;while(q&&q.nodeType===3&&q.length===0){q=o?q.nextSibling:q.previousSibling}return q||p}if(!h){return i.dom.getRoot()}if(h.setStart){m=h.commonAncestorContainer;if(!h.collapsed){if(h.startContainer==h.endContainer){if(h.endOffset-h.startOffset<2){if(h.startContainer.hasChildNodes()){m=h.startContainer.childNodes[h.startOffset]}}}if(l.nodeType===3&&g.nodeType===3){if(l.length===h.startOffset){l=k(l.nextSibling,true)}else{l=l.parentNode}if(h.endOffset===0){g=k(g.previousSibling,false)}else{g=g.parentNode}if(l&&l===g){return l}}}if(m&&m.nodeType==3){return m.parentNode}return m}return h.item?h.item(0):h.parentElement()},getSelectedBlocks:function(p,h){var o=this,k=o.dom,m,l,i,j=[];m=k.getParent(p||o.getStart(),k.isBlock);l=k.getParent(h||o.getEnd(),k.isBlock);if(m){j.push(m)}if(m&&l&&m!=l){i=m;var g=new a(m,k.getRoot());while((i=g.next())&&i!=l){if(k.isBlock(i)){j.push(i)}}}if(l&&m!=l){j.push(l)}return j},isForward:function(){var i=this.dom,g=this.getSel(),j,h;if(!g||g.anchorNode==null||g.focusNode==null){return true}j=i.createRng();j.setStart(g.anchorNode,g.anchorOffset);j.collapse(true);h=i.createRng();h.setStart(g.focusNode,g.focusOffset);h.collapse(true);return j.compareBoundaryPoints(j.START_TO_START,h)<=0},normalize:function(){var h=this,g,m,l,j,i;function k(p){var o,r,n,s=h.dom,u=s.getRoot(),q,t,v;function y(z,A){var B=new a(z,s.getParent(z.parentNode,s.isBlock)||u);while(z=B[A?"prev":"next"]()){if(z.nodeName==="BR"){return true}}}function x(B,z){var C,A;z=z||o;C=new a(z,s.getParent(z.parentNode,s.isBlock)||u);while(q=C[B?"prev":"next"]()){if(q.nodeType===3&&q.nodeValue.length>0){o=q;r=B?q.nodeValue.length:0;m=true;return}if(s.isBlock(q)||t[q.nodeName.toLowerCase()]){return}A=q}if(l&&A){o=A;m=true;r=0}}o=g[(p?"start":"end")+"Container"];r=g[(p?"start":"end")+"Offset"];t=s.schema.getNonEmptyElements();if(o.nodeType===9){o=s.getRoot();r=0}if(o===u){if(p){q=o.childNodes[r>0?r-1:0];if(q){v=q.nodeName.toLowerCase();if(t[q.nodeName]||q.nodeName=="TABLE"){return}}}if(o.hasChildNodes()){o=o.childNodes[Math.min(!p&&r>0?r-1:r,o.childNodes.length-1)];r=0;if(o.hasChildNodes()&&!/TABLE/.test(o.nodeName)){q=o;n=new a(o,u);do{if(q.nodeType===3&&q.nodeValue.length>0){r=p?0:q.nodeValue.length;o=q;m=true;break}if(t[q.nodeName.toLowerCase()]){r=s.nodeIndex(q);o=q.parentNode;if(q.nodeName=="IMG"&&!p){r++}m=true;break}}while(q=(p?n.next():n.prev()))}}}if(l){if(o.nodeType===3&&r===0){x(true)}if(o.nodeType===1){q=o.childNodes[r];if(q&&q.nodeName==="BR"&&!y(q)&&!y(q,true)){x(true,o.childNodes[r])}}}if(p&&!l&&o.nodeType===3&&r===o.nodeValue.length){x(false)}if(m){g["set"+(p?"Start":"End")](o,r)}}if(d.isIE){return}g=h.getRng();l=g.collapsed;k(true);if(!l){k()}if(m){if(l){g.collapse(true)}h.setRng(g,h.isForward())}},destroy:function(h){var g=this;g.win=null;if(!h){d.removeUnload(g.destroy)}},_fixIESelection:function(){var h=this.dom,n=h.doc,i=n.body,k,o,g;function j(p,s){var q=i.createTextRange();try{q.moveToPoint(p,s)}catch(r){q=null}return q}function m(q){var p;if(q.button){p=j(q.x,q.y);if(p){if(p.compareEndPoints("StartToStart",o)>0){p.setEndPoint("StartToStart",o)}else{p.setEndPoint("EndToEnd",o)}p.select()}}else{l()}}function l(){var p=n.selection.createRange();if(o&&!p.item&&p.compareEndPoints("StartToEnd",p)===0){o.select()}h.unbind(n,"mouseup",l);h.unbind(n,"mousemove",m);o=k=0}n.documentElement.unselectable=true;h.bind(n,["mousedown","contextmenu"],function(p){if(p.target.nodeName==="HTML"){if(k){l()}g=n.documentElement;if(g.scrollHeight>g.clientHeight){return}k=1;o=j(p.x,p.y);if(o){h.bind(n,"mouseup",l);h.bind(n,"mousemove",m);h.win.focus();o.select()}}})}})})(tinymce);(function(a){a.dom.Serializer=function(e,i,f){var h,b,d=a.isIE,g=a.each,c;if(!e.apply_source_formatting){e.indent=false}i=i||a.DOM;f=f||new a.html.Schema(e);e.entity_encoding=e.entity_encoding||"named";e.remove_trailing_brs="remove_trailing_brs" in e?e.remove_trailing_brs:true;h=new a.util.Dispatcher(self);b=new a.util.Dispatcher(self);c=new a.html.DomParser(e,f);c.addAttributeFilter("src,href,style",function(k,j){var o=k.length,l,q,n="data-mce-"+j,p=e.url_converter,r=e.url_converter_scope,m;while(o--){l=k[o];q=l.attributes.map[n];if(q!==m){l.attr(j,q.length>0?q:null);l.attr(n,null)}else{q=l.attributes.map[j];if(j==="style"){q=i.serializeStyle(i.parseStyle(q),l.name)}else{if(p){q=p.call(r,q,j,l.name)}}l.attr(j,q.length>0?q:null)}}});c.addAttributeFilter("class",function(j,k){var l=j.length,m,n;while(l--){m=j[l];n=m.attr("class").replace(/(?:^|\s)mce(Item\w+|Selected)(?!\S)/g,"");m.attr("class",n.length>0?n:null)}});c.addAttributeFilter("data-mce-type",function(j,l,k){var m=j.length,n;while(m--){n=j[m];if(n.attributes.map["data-mce-type"]==="bookmark"&&!k.cleanup){n.remove()}}});c.addAttributeFilter("data-mce-expando",function(j,l,k){var m=j.length;while(m--){j[m].attr(l,null)}});c.addNodeFilter("script,style",function(k,l){var m=k.length,n,o;function j(p){return p.replace(/()/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*(()?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")}while(m--){n=k[m];o=n.firstChild?n.firstChild.value:"";if(l==="script"){n.attr("type",(n.attr("type")||"text/javascript").replace(/^mce\-/,""));if(o.length>0){n.firstChild.value="// "}}else{if(o.length>0){n.firstChild.value=""}}}});c.addNodeFilter("#comment",function(j,k){var l=j.length,m;while(l--){m=j[l];if(m.value.indexOf("[CDATA[")===0){m.name="#cdata";m.type=4;m.value=m.value.replace(/^\[CDATA\[|\]\]$/g,"")}else{if(m.value.indexOf("mce:protected ")===0){m.name="#text";m.type=3;m.raw=true;m.value=unescape(m.value).substr(14)}}}});c.addNodeFilter("xml:namespace,input",function(j,k){var l=j.length,m;while(l--){m=j[l];if(m.type===7){m.remove()}else{if(m.type===1){if(k==="input"&&!("type" in m.attributes.map)){m.attr("type","text")}}}}});if(e.fix_list_elements){c.addNodeFilter("ul,ol",function(k,l){var m=k.length,n,j;while(m--){n=k[m];j=n.parent;if(j.name==="ul"||j.name==="ol"){if(n.prev&&n.prev.name==="li"){n.prev.append(n)}}}})}c.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style",function(j,k){var l=j.length;while(l--){j[l].attr(k,null)}});return{schema:f,addNodeFilter:c.addNodeFilter,addAttributeFilter:c.addAttributeFilter,onPreProcess:h,onPostProcess:b,serialize:function(o,m){var l,p,k,j,n;if(d&&i.select("script,style,select,map").length>0){n=o.innerHTML;o=o.cloneNode(false);i.setHTML(o,n)}else{o=o.cloneNode(true)}l=o.ownerDocument.implementation;if(l.createHTMLDocument){p=l.createHTMLDocument("");g(o.nodeName=="BODY"?o.childNodes:[o],function(q){p.body.appendChild(p.importNode(q,true))});if(o.nodeName!="BODY"){o=p.body.firstChild}else{o=p.body}k=i.doc;i.doc=p}m=m||{};m.format=m.format||"html";if(!m.no_events){m.node=o;h.dispatch(self,m)}j=new a.html.Serializer(e,f);m.content=j.serialize(c.parse(a.trim(m.getInner?o.innerHTML:i.getOuterHTML(o)),m));if(!m.cleanup){m.content=m.content.replace(/\uFEFF|\u200B/g,"")}if(!m.no_events){b.dispatch(self,m)}if(k){i.doc=k}m.node=null;return m.content},addRules:function(j){f.addValidElements(j)},setRules:function(j){f.setValidElements(j)}}}})(tinymce);(function(a){a.dom.ScriptLoader=function(h){var c=0,k=1,i=2,l={},j=[],e={},d=[],g=0,f;function b(m,v){var x=this,q=a.DOM,s,o,r,n;function p(){q.remove(n);if(s){s.onreadystatechange=s.onload=s=null}v()}function u(){if(typeof(console)!=="undefined"&&console.log){console.log("Failed to load: "+m)}}n=q.uniqueId();if(a.isIE6){o=new a.util.URI(m);r=location;if(o.host==r.hostname&&o.port==r.port&&(o.protocol+":")==r.protocol&&o.protocol.toLowerCase()!="file"){a.util.XHR.send({url:a._addVer(o.getURI()),success:function(y){var t=q.create("script",{type:"text/javascript"});t.text=y;document.getElementsByTagName("head")[0].appendChild(t);q.remove(t);p()},error:u});return}}s=q.create("script",{id:n,type:"text/javascript",src:a._addVer(m)});if(!a.isIE){s.onload=p}s.onerror=u;if(!a.isOpera){s.onreadystatechange=function(){var t=s.readyState;if(t=="complete"||t=="loaded"){p()}}}(document.getElementsByTagName("head")[0]||document.body).appendChild(s)}this.isDone=function(m){return l[m]==i};this.markDone=function(m){l[m]=i};this.add=this.load=function(m,q,n){var o,p=l[m];if(p==f){j.push(m);l[m]=c}if(q){if(!e[m]){e[m]=[]}e[m].push({func:q,scope:n||this})}};this.loadQueue=function(n,m){this.loadScripts(j,n,m)};this.loadScripts=function(m,q,p){var o;function n(r){a.each(e[r],function(s){s.func.call(s.scope)});e[r]=f}d.push({func:q,scope:p||this});o=function(){var r=a.grep(m);m.length=0;a.each(r,function(s){if(l[s]==i){n(s);return}if(l[s]!=k){l[s]=k;g++;b(s,function(){l[s]=i;g--;n(s);o()})}});if(!g){a.each(d,function(s){s.func.call(s.scope)});d.length=0}};o()}};a.ScriptLoader=new a.dom.ScriptLoader()})(tinymce);(function(a){a.dom.RangeUtils=function(c){var b="\uFEFF";this.walk=function(d,s){var i=d.startContainer,l=d.startOffset,t=d.endContainer,m=d.endOffset,j,g,o,h,r,q,e;e=c.select("td.mceSelected,th.mceSelected");if(e.length>0){a.each(e,function(u){s([u])});return}function f(u){var v;v=u[0];if(v.nodeType===3&&v===i&&l>=v.nodeValue.length){u.splice(0,1)}v=u[u.length-1];if(m===0&&u.length>0&&v===t&&v.nodeType===3){u.splice(u.length-1,1)}return u}function p(x,v,u){var y=[];for(;x&&x!=u;x=x[v]){y.push(x)}return y}function n(v,u){do{if(v.parentNode==u){return v}v=v.parentNode}while(v)}function k(x,v,y){var u=y?"nextSibling":"previousSibling";for(h=x,r=h.parentNode;h&&h!=v;h=r){r=h.parentNode;q=p(h==x?h:h[u],u);if(q.length){if(!y){q.reverse()}s(f(q))}}}if(i.nodeType==1&&i.hasChildNodes()){i=i.childNodes[l]}if(t.nodeType==1&&t.hasChildNodes()){t=t.childNodes[Math.min(m-1,t.childNodes.length-1)]}if(i==t){return s(f([i]))}j=c.findCommonAncestor(i,t);for(h=i;h;h=h.parentNode){if(h===t){return k(i,j,true)}if(h===j){break}}for(h=t;h;h=h.parentNode){if(h===i){return k(t,j)}if(h===j){break}}g=n(i,j)||i;o=n(t,j)||t;k(i,g,true);q=p(g==i?g:g.nextSibling,"nextSibling",o==t?o.nextSibling:o);if(q.length){s(f(q))}k(t,o)};this.split=function(e){var h=e.startContainer,d=e.startOffset,i=e.endContainer,g=e.endOffset;function f(j,k){return j.splitText(k)}if(h==i&&h.nodeType==3){if(d>0&&dd){g=g-d;h=i=f(i,g).previousSibling;g=i.nodeValue.length;d=0}else{g=0}}}else{if(h.nodeType==3&&d>0&&d0&&g=l.length){q=0}}s=l[q];f.setAttrib(g,"tabindex","-1");f.setAttrib(s.id,"tabindex","0");f.get(s.id).focus();if(e.actOnFocus){e.onAction(s.id)}if(r){a.cancel(r)}};o=function(y){var u=37,t=39,x=38,z=40,q=27,s=14,r=13,v=32;switch(y.keyCode){case u:if(i){p.moveFocus(-1)}break;case t:if(i){p.moveFocus(1)}break;case x:if(n){p.moveFocus(-1)}break;case z:if(n){p.moveFocus(1)}break;case q:if(e.onCancel){e.onCancel();a.cancel(y)}break;case s:case r:case v:if(e.onAction){e.onAction(g);a.cancel(y)}break}};c(l,function(s,q){var r;if(!s.id){s.id=f.uniqueId("_mce_item_")}if(k){f.bind(s.id,"blur",h);r="-1"}else{r=(q===0?"0":"-1")}f.setAttrib(s.id,"tabindex",r);f.bind(f.get(s.id),"focus",j)});if(l[0]){g=l[0].id}f.setAttrib(m,"tabindex","-1");f.bind(f.get(m),"focus",d);f.bind(f.get(m),"keydown",o)}})})(tinymce);(function(c){var b=c.DOM,a=c.is;c.create("tinymce.ui.Control",{Control:function(f,e,d){this.id=f;this.settings=e=e||{};this.rendered=false;this.onRender=new c.util.Dispatcher(this);this.classPrefix="";this.scope=e.scope||this;this.disabled=0;this.active=0;this.editor=d},setAriaProperty:function(f,e){var d=b.get(this.id+"_aria")||b.get(this.id);if(d){b.setAttrib(d,"aria-"+f,!!e)}},focus:function(){b.get(this.id).focus()},setDisabled:function(d){if(d!=this.disabled){this.setAriaProperty("disabled",d);this.setState("Disabled",d);this.setState("Enabled",!d);this.disabled=d}},isDisabled:function(){return this.disabled},setActive:function(d){if(d!=this.active){this.setState("Active",d);this.active=d;this.setAriaProperty("pressed",d)}},isActive:function(){return this.active},setState:function(f,d){var e=b.get(this.id);f=this.classPrefix+f;if(d){b.addClass(e,f)}else{b.removeClass(e,f)}},isRendered:function(){return this.rendered},renderHTML:function(){},renderTo:function(d){b.setHTML(d,this.renderHTML())},postRender:function(){var e=this,d;if(a(e.disabled)){d=e.disabled;e.disabled=-1;e.setDisabled(d)}if(a(e.active)){d=e.active;e.active=-1;e.setActive(d)}},remove:function(){b.remove(this.id);this.destroy()},destroy:function(){c.dom.Event.clear(this.id)}})})(tinymce);tinymce.create("tinymce.ui.Container:tinymce.ui.Control",{Container:function(c,b,a){this.parent(c,b,a);this.controls=[];this.lookup={}},add:function(a){this.lookup[a.id]=a;this.controls.push(a);return a},get:function(a){return this.lookup[a]}});tinymce.create("tinymce.ui.Separator:tinymce.ui.Control",{Separator:function(b,a){this.parent(b,a);this.classPrefix="mceSeparator";this.setDisabled(true)},renderHTML:function(){return tinymce.DOM.createHTML("span",{"class":this.classPrefix,role:"separator","aria-orientation":"vertical",tabindex:"-1"})}});(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.MenuItem:tinymce.ui.Control",{MenuItem:function(g,f){this.parent(g,f);this.classPrefix="mceMenuItem"},setSelected:function(f){this.setState("Selected",f);this.setAriaProperty("checked",!!f);this.selected=f},isSelected:function(){return this.selected},postRender:function(){var f=this;f.parent();if(c(f.selected)){f.setSelected(f.selected)}}})})(tinymce);(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.Menu:tinymce.ui.MenuItem",{Menu:function(h,g){var f=this;f.parent(h,g);f.items={};f.collapsed=false;f.menuCount=0;f.onAddItem=new d.util.Dispatcher(this)},expand:function(g){var f=this;if(g){a(f,function(h){if(h.expand){h.expand()}},"items",f)}f.collapsed=false},collapse:function(g){var f=this;if(g){a(f,function(h){if(h.collapse){h.collapse()}},"items",f)}f.collapsed=true},isCollapsed:function(){return this.collapsed},add:function(f){if(!f.settings){f=new d.ui.MenuItem(f.id||b.uniqueId(),f)}this.onAddItem.dispatch(this,f);return this.items[f.id]=f},addSeparator:function(){return this.add({separator:true})},addMenu:function(f){if(!f.collapse){f=this.createMenu(f)}this.menuCount++;return this.add(f)},hasMenus:function(){return this.menuCount!==0},remove:function(f){delete this.items[f.id]},removeAll:function(){var f=this;a(f,function(g){if(g.removeAll){g.removeAll()}else{g.remove()}g.destroy()},"items",f);f.items={}},createMenu:function(g){var f=new d.ui.Menu(g.id||b.uniqueId(),g);f.onAddItem.add(this.onAddItem.dispatch,this.onAddItem);return f}})})(tinymce);(function(e){var d=e.is,c=e.DOM,f=e.each,a=e.dom.Event,b=e.dom.Element;e.create("tinymce.ui.DropMenu:tinymce.ui.Menu",{DropMenu:function(h,g){g=g||{};g.container=g.container||c.doc.body;g.offset_x=g.offset_x||0;g.offset_y=g.offset_y||0;g.vp_offset_x=g.vp_offset_x||0;g.vp_offset_y=g.vp_offset_y||0;if(d(g.icons)&&!g.icons){g["class"]+=" mceNoIcons"}this.parent(h,g);this.onShowMenu=new e.util.Dispatcher(this);this.onHideMenu=new e.util.Dispatcher(this);this.classPrefix="mceMenu"},createMenu:function(j){var h=this,i=h.settings,g;j.container=j.container||i.container;j.parent=h;j.constrain=j.constrain||i.constrain;j["class"]=j["class"]||i["class"];j.vp_offset_x=j.vp_offset_x||i.vp_offset_x;j.vp_offset_y=j.vp_offset_y||i.vp_offset_y;j.keyboard_focus=i.keyboard_focus;g=new e.ui.DropMenu(j.id||c.uniqueId(),j);g.onAddItem.add(h.onAddItem.dispatch,h.onAddItem);return g},focus:function(){var g=this;if(g.keyboardNav){g.keyboardNav.focus()}},update:function(){var i=this,j=i.settings,g=c.get("menu_"+i.id+"_tbl"),l=c.get("menu_"+i.id+"_co"),h,k;h=j.max_width?Math.min(g.offsetWidth,j.max_width):g.offsetWidth;k=j.max_height?Math.min(g.offsetHeight,j.max_height):g.offsetHeight;if(!c.boxModel){i.element.setStyles({width:h+2,height:k+2})}else{i.element.setStyles({width:h,height:k})}if(j.max_width){c.setStyle(l,"width",h)}if(j.max_height){c.setStyle(l,"height",k);if(g.clientHeightv){p=r?r-u:Math.max(0,(v-A.vp_offset_x)-u)}if((n+A.vp_offset_y+l)>q){n=Math.max(0,(q-A.vp_offset_y)-l)}}c.setStyles(o,{left:p,top:n});z.element.update();z.isMenuVisible=1;z.mouseClickFunc=a.add(o,"click",function(s){var h;s=s.target;if(s&&(s=c.getParent(s,"tr"))&&!c.hasClass(s,m+"ItemSub")){h=z.items[s.id];if(h.isDisabled()){return}k=z;while(k){if(k.hideMenu){k.hideMenu()}k=k.settings.parent}if(h.settings.onclick){h.settings.onclick(s)}return false}});if(z.hasMenus()){z.mouseOverFunc=a.add(o,"mouseover",function(x){var h,t,s;x=x.target;if(x&&(x=c.getParent(x,"tr"))){h=z.items[x.id];if(z.lastMenu){z.lastMenu.collapse(1)}if(h.isDisabled()){return}if(x&&c.hasClass(x,m+"ItemSub")){t=c.getRect(x);h.showMenu((t.x+t.w-i),t.y-i,t.x);z.lastMenu=h;c.addClass(c.get(h.id).firstChild,m+"ItemActive")}}})}a.add(o,"keydown",z._keyHandler,z);z.onShowMenu.dispatch(z);if(A.keyboard_focus){z._setupKeyboardNav()}},hideMenu:function(j){var g=this,i=c.get("menu_"+g.id),h;if(!g.isMenuVisible){return}if(g.keyboardNav){g.keyboardNav.destroy()}a.remove(i,"mouseover",g.mouseOverFunc);a.remove(i,"click",g.mouseClickFunc);a.remove(i,"keydown",g._keyHandler);c.hide(i);g.isMenuVisible=0;if(!j){g.collapse(1)}if(g.element){g.element.hide()}if(h=c.get(g.id)){c.removeClass(h.firstChild,g.classPrefix+"ItemActive")}g.onHideMenu.dispatch(g)},add:function(i){var g=this,h;i=g.parent(i);if(g.isRendered&&(h=c.get("menu_"+g.id))){g._add(c.select("tbody",h)[0],i)}return i},collapse:function(g){this.parent(g);this.hideMenu(1)},remove:function(g){c.remove(g.id);this.destroy();return this.parent(g)},destroy:function(){var g=this,h=c.get("menu_"+g.id);if(g.keyboardNav){g.keyboardNav.destroy()}a.remove(h,"mouseover",g.mouseOverFunc);a.remove(c.select("a",h),"focus",g.mouseOverFunc);a.remove(h,"click",g.mouseClickFunc);a.remove(h,"keydown",g._keyHandler);if(g.element){g.element.remove()}c.remove(h)},renderNode:function(){var i=this,j=i.settings,l,h,k,g;g=c.create("div",{role:"listbox",id:"menu_"+i.id,"class":j["class"],style:"position:absolute;left:0;top:0;z-index:200000;outline:0"});if(i.settings.parent){c.setAttrib(g,"aria-parent","menu_"+i.settings.parent.id)}k=c.add(g,"div",{role:"presentation",id:"menu_"+i.id+"_co","class":i.classPrefix+(j["class"]?" "+j["class"]:"")});i.element=new b("menu_"+i.id,{blocker:1,container:j.container});if(j.menu_line){c.add(k,"span",{"class":i.classPrefix+"Line"})}l=c.add(k,"table",{role:"presentation",id:"menu_"+i.id+"_tbl",border:0,cellPadding:0,cellSpacing:0});h=c.add(l,"tbody");f(i.items,function(m){i._add(h,m)});i.rendered=true;return g},_setupKeyboardNav:function(){var i,h,g=this;i=c.get("menu_"+g.id);h=c.select("a[role=option]","menu_"+g.id);h.splice(0,0,i);g.keyboardNav=new e.ui.KeyboardNavigation({root:"menu_"+g.id,items:h,onCancel:function(){g.hideMenu()},enableUpDown:true});i.focus()},_keyHandler:function(g){var h=this,i;switch(g.keyCode){case 37:if(h.settings.parent){h.hideMenu();h.settings.parent.focus();a.cancel(g)}break;case 39:if(h.mouseOverFunc){h.mouseOverFunc(g)}break}},_add:function(j,h){var i,q=h.settings,p,l,k,m=this.classPrefix,g;if(q.separator){l=c.add(j,"tr",{id:h.id,"class":m+"ItemSeparator"});c.add(l,"td",{"class":m+"ItemSeparator"});if(i=l.previousSibling){c.addClass(i,"mceLast")}return}i=l=c.add(j,"tr",{id:h.id,"class":m+"Item "+m+"ItemEnabled"});i=k=c.add(i,q.titleItem?"th":"td");i=p=c.add(i,"a",{id:h.id+"_aria",role:q.titleItem?"presentation":"option",href:"javascript:;",onclick:"return false;",onmousedown:"return false;"});if(q.parent){c.setAttrib(p,"aria-haspopup","true");c.setAttrib(p,"aria-owns","menu_"+h.id)}c.addClass(k,q["class"]);g=c.add(i,"span",{"class":"mceIcon"+(q.icon?" mce_"+q.icon:"")});if(q.icon_src){c.add(g,"img",{src:q.icon_src})}i=c.add(i,q.element||"span",{"class":"mceText",title:h.settings.title},h.settings.title);if(h.settings.style){if(typeof h.settings.style=="function"){h.settings.style=h.settings.style()}c.setAttrib(i,"style",h.settings.style)}if(j.childNodes.length==1){c.addClass(l,"mceFirst")}if((i=l.previousSibling)&&c.hasClass(i,m+"ItemSeparator")){c.addClass(l,"mceFirst")}if(h.collapse){c.addClass(l,m+"ItemSub")}if(i=l.previousSibling){c.removeClass(i,"mceLast")}c.addClass(l,"mceLast")}})})(tinymce);(function(b){var a=b.DOM;b.create("tinymce.ui.Button:tinymce.ui.Control",{Button:function(e,d,c){this.parent(e,d,c);this.classPrefix="mceButton"},renderHTML:function(){var f=this.classPrefix,e=this.settings,d,c;c=a.encode(e.label||"");d='';if(e.image&&!(this.editor&&this.editor.forcedHighContrastMode)){d+=''+a.encode(e.title)+''+c}else{d+=''+(c?''+c+"":"")}d+='";d+="";return d},postRender:function(){var d=this,e=d.settings,c;if(b.isIE&&d.editor){b.dom.Event.add(d.id,"mousedown",function(f){var g=d.editor.selection.getNode().nodeName;c=g==="IMG"?d.editor.selection.getBookmark():null})}b.dom.Event.add(d.id,"click",function(f){if(!d.isDisabled()){if(b.isIE&&d.editor&&c!==null){d.editor.selection.moveToBookmark(c)}return e.onclick.call(e.scope,f)}});b.dom.Event.add(d.id,"keyup",function(f){if(!d.isDisabled()&&f.keyCode==b.VK.SPACEBAR){return e.onclick.call(e.scope,f)}})}})})(tinymce);(function(e){var d=e.DOM,b=e.dom.Event,f=e.each,a=e.util.Dispatcher,c;e.create("tinymce.ui.ListBox:tinymce.ui.Control",{ListBox:function(j,i,g){var h=this;h.parent(j,i,g);h.items=[];h.onChange=new a(h);h.onPostRender=new a(h);h.onAdd=new a(h);h.onRenderMenu=new e.util.Dispatcher(this);h.classPrefix="mceListBox";h.marked={}},select:function(h){var g=this,j,i;g.marked={};if(h==c){return g.selectByIndex(-1)}if(h&&typeof(h)=="function"){i=h}else{i=function(k){return k==h}}if(h!=g.selectedValue){f(g.items,function(l,k){if(i(l.value)){j=1;g.selectByIndex(k);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(g){var i=this,j,k,h;i.marked={};if(g!=i.selectedIndex){j=d.get(i.id+"_text");h=d.get(i.id+"_voiceDesc");k=i.items[g];if(k){i.selectedValue=k.value;i.selectedIndex=g;d.setHTML(j,d.encode(k.title));d.setHTML(h,i.settings.title+" - "+k.title);d.removeClass(j,"mceTitle");d.setAttrib(i.id,"aria-valuenow",k.title)}else{d.setHTML(j,d.encode(i.settings.title));d.setHTML(h,d.encode(i.settings.title));d.addClass(j,"mceTitle");i.selectedValue=i.selectedIndex=null;d.setAttrib(i.id,"aria-valuenow",i.settings.title)}j=0}},mark:function(g){this.marked[g]=true},add:function(j,g,i){var h=this;i=i||{};i=e.extend(i,{title:j,value:g});h.items.push(i);h.onAdd.dispatch(h,i)},getLength:function(){return this.items.length},renderHTML:function(){var j="",g=this,i=g.settings,k=g.classPrefix;j='';j+="";j+="";j+="";return j},showMenu:function(){var h=this,j,i=d.get(this.id),g;if(h.isDisabled()||h.items.length===0){return}if(h.menu&&h.menu.isMenuVisible){return h.hideMenu()}if(!h.isMenuRendered){h.renderMenu();h.isMenuRendered=true}j=d.getPos(i);g=h.menu;g.settings.offset_x=j.x;g.settings.offset_y=j.y;g.settings.keyboard_focus=!e.isOpera;f(h.items,function(k){if(g.items[k.id]){g.items[k.id].setSelected(0)}});f(h.items,function(k){if(g.items[k.id]&&h.marked[k.value]){g.items[k.id].setSelected(1)}if(k.value===h.selectedValue){g.items[k.id].setSelected(1)}});g.showMenu(0,i.clientHeight);b.add(d.doc,"mousedown",h.hideMenu,h);d.addClass(h.id,h.classPrefix+"Selected")},hideMenu:function(h){var g=this;if(g.menu&&g.menu.isMenuVisible){d.removeClass(g.id,g.classPrefix+"Selected");if(h&&h.type=="mousedown"&&(h.target.id==g.id+"_text"||h.target.id==g.id+"_open")){return}if(!h||!d.getParent(h.target,".mceMenu")){d.removeClass(g.id,g.classPrefix+"Selected");b.remove(d.doc,"mousedown",g.hideMenu,g);g.menu.hideMenu()}}},renderMenu:function(){var h=this,g;g=h.settings.control_manager.createDropMenu(h.id+"_menu",{menu_line:1,"class":h.classPrefix+"Menu mceNoIcons",max_width:250,max_height:150});g.onHideMenu.add(function(){h.hideMenu();h.focus()});g.add({title:h.settings.title,"class":"mceMenuItemTitle",onclick:function(){if(h.settings.onselect("")!==false){h.select("")}}});f(h.items,function(i){if(i.value===c){g.add({title:i.title,role:"option","class":"mceMenuItemTitle",onclick:function(){if(h.settings.onselect("")!==false){h.select("")}}})}else{i.id=d.uniqueId();i.role="option";i.onclick=function(){if(h.settings.onselect(i.value)!==false){h.select(i.value)}};g.add(i)}});h.onRenderMenu.dispatch(h,g);h.menu=g},postRender:function(){var g=this,h=g.classPrefix;b.add(g.id,"click",g.showMenu,g);b.add(g.id,"keydown",function(i){if(i.keyCode==32){g.showMenu(i);b.cancel(i)}});b.add(g.id,"focus",function(){if(!g._focused){g.keyDownHandler=b.add(g.id,"keydown",function(i){if(i.keyCode==40){g.showMenu();b.cancel(i)}});g.keyPressHandler=b.add(g.id,"keypress",function(j){var i;if(j.keyCode==13){i=g.selectedValue;g.selectedValue=null;b.cancel(j);g.settings.onselect(i)}})}g._focused=1});b.add(g.id,"blur",function(){b.remove(g.id,"keydown",g.keyDownHandler);b.remove(g.id,"keypress",g.keyPressHandler);g._focused=0});if(e.isIE6||!d.boxModel){b.add(g.id,"mouseover",function(){if(!d.hasClass(g.id,h+"Disabled")){d.addClass(g.id,h+"Hover")}});b.add(g.id,"mouseout",function(){if(!d.hasClass(g.id,h+"Disabled")){d.removeClass(g.id,h+"Hover")}})}g.onPostRender.dispatch(g,d.get(g.id))},destroy:function(){this.parent();b.clear(this.id+"_text");b.clear(this.id+"_open")}})})(tinymce);(function(e){var d=e.DOM,b=e.dom.Event,f=e.each,a=e.util.Dispatcher,c;e.create("tinymce.ui.NativeListBox:tinymce.ui.ListBox",{NativeListBox:function(h,g){this.parent(h,g);this.classPrefix="mceNativeListBox"},setDisabled:function(g){d.get(this.id).disabled=g;this.setAriaProperty("disabled",g)},isDisabled:function(){return d.get(this.id).disabled},select:function(h){var g=this,j,i;if(h==c){return g.selectByIndex(-1)}if(h&&typeof(h)=="function"){i=h}else{i=function(k){return k==h}}if(h!=g.selectedValue){f(g.items,function(l,k){if(i(l.value)){j=1;g.selectByIndex(k);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(g){d.get(this.id).selectedIndex=g+1;this.selectedValue=this.items[g]?this.items[g].value:null},add:function(k,h,g){var j,i=this;g=g||{};g.value=h;if(i.isRendered()){d.add(d.get(this.id),"option",g,k)}j={title:k,value:h,attribs:g};i.items.push(j);i.onAdd.dispatch(i,j)},getLength:function(){return this.items.length},renderHTML:function(){var i,g=this;i=d.createHTML("option",{value:""},"-- "+g.settings.title+" --");f(g.items,function(h){i+=d.createHTML("option",{value:h.value},h.title)});i=d.createHTML("select",{id:g.id,"class":"mceNativeListBox","aria-labelledby":g.id+"_aria"},i);i+=d.createHTML("span",{id:g.id+"_aria",style:"display: none"},g.settings.title);return i},postRender:function(){var h=this,i,j=true;h.rendered=true;function g(l){var k=h.items[l.target.selectedIndex-1];if(k&&(k=k.value)){h.onChange.dispatch(h,k);if(h.settings.onselect){h.settings.onselect(k)}}}b.add(h.id,"change",g);b.add(h.id,"keydown",function(l){var k;b.remove(h.id,"change",i);j=false;k=b.add(h.id,"blur",function(){if(j){return}j=true;b.add(h.id,"change",g);b.remove(h.id,"blur",k)});if(e.isWebKit&&(l.keyCode==37||l.keyCode==39)){return b.prevent(l)}if(l.keyCode==13||l.keyCode==32){g(l);return b.cancel(l)}});h.onPostRender.dispatch(h,d.get(h.id))}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.MenuButton:tinymce.ui.Button",{MenuButton:function(g,f,e){this.parent(g,f,e);this.onRenderMenu=new c.util.Dispatcher(this);f.menu_container=f.menu_container||b.doc.body},showMenu:function(){var g=this,j,i,h=b.get(g.id),f;if(g.isDisabled()){return}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}if(g.isMenuVisible){return g.hideMenu()}j=b.getPos(g.settings.menu_container);i=b.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.vp_offset_x=i.x;f.settings.vp_offset_y=i.y;f.settings.keyboard_focus=g._focused;f.showMenu(0,h.firstChild.clientHeight);a.add(b.doc,"mousedown",g.hideMenu,g);g.setState("Selected",1);g.isMenuVisible=1},renderMenu:function(){var f=this,e;e=f.settings.control_manager.createDropMenu(f.id+"_menu",{menu_line:1,"class":this.classPrefix+"Menu",icons:f.settings.icons});e.onHideMenu.add(function(){f.hideMenu();f.focus()});f.onRenderMenu.dispatch(f,e);f.menu=e},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&b.getParent(g.target,function(h){return h.id===f.id||h.id===f.id+"_open"})){return}if(!g||!b.getParent(g.target,".mceMenu")){f.setState("Selected",0);a.remove(b.doc,"mousedown",f.hideMenu,f);if(f.menu){f.menu.hideMenu()}}f.isMenuVisible=0},postRender:function(){var e=this,f=e.settings;a.add(e.id,"click",function(){if(!e.isDisabled()){if(f.onclick){f.onclick(e.value)}e.showMenu()}})}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.SplitButton:tinymce.ui.MenuButton",{SplitButton:function(g,f,e){this.parent(g,f,e);this.classPrefix="mceSplitButton"},renderHTML:function(){var i,f=this,g=f.settings,e;i="";if(g.image){e=b.createHTML("img ",{src:g.image,role:"presentation","class":"mceAction "+g["class"]})}else{e=b.createHTML("span",{"class":"mceAction "+g["class"]},"")}e+=b.createHTML("span",{"class":"mceVoiceLabel mceIconOnly",id:f.id+"_voice",style:"display:none;"},g.title);i+=""+b.createHTML("a",{role:"button",id:f.id+"_action",tabindex:"-1",href:"javascript:;","class":"mceAction "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"";e=b.createHTML("span",{"class":"mceOpen "+g["class"]},'');i+=""+b.createHTML("a",{role:"button",id:f.id+"_open",tabindex:"-1",href:"javascript:;","class":"mceOpen "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"";i+="";i=b.createHTML("table",{role:"presentation","class":"mceSplitButton mceSplitButtonEnabled "+g["class"],cellpadding:"0",cellspacing:"0",title:g.title},i);return b.createHTML("div",{id:f.id,role:"button",tabindex:"0","aria-labelledby":f.id+"_voice","aria-haspopup":"true"},i)},postRender:function(){var e=this,g=e.settings,f;if(g.onclick){f=function(h){if(!e.isDisabled()){g.onclick(e.value);a.cancel(h)}};a.add(e.id+"_action","click",f);a.add(e.id,["click","keydown"],function(h){var k=32,m=14,i=13,j=38,l=40;if((h.keyCode===32||h.keyCode===13||h.keyCode===14)&&!h.altKey&&!h.ctrlKey&&!h.metaKey){f();a.cancel(h)}else{if(h.type==="click"||h.keyCode===l){e.showMenu();a.cancel(h)}}})}a.add(e.id+"_open","click",function(h){e.showMenu();a.cancel(h)});a.add([e.id,e.id+"_open"],"focus",function(){e._focused=1});a.add([e.id,e.id+"_open"],"blur",function(){e._focused=0});if(c.isIE6||!b.boxModel){a.add(e.id,"mouseover",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.addClass(e.id,"mceSplitButtonHover")}});a.add(e.id,"mouseout",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.removeClass(e.id,"mceSplitButtonHover")}})}},destroy:function(){this.parent();a.clear(this.id+"_action");a.clear(this.id+"_open");a.clear(this.id)}})})(tinymce);(function(d){var c=d.DOM,a=d.dom.Event,b=d.is,e=d.each;d.create("tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton",{ColorSplitButton:function(i,h,f){var g=this;g.parent(i,h,f);g.settings=h=d.extend({colors:"000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF",grid_width:8,default_color:"#888888"},g.settings);g.onShowMenu=new d.util.Dispatcher(g);g.onHideMenu=new d.util.Dispatcher(g);g.value=h.default_color},showMenu:function(){var f=this,g,j,i,h;if(f.isDisabled()){return}if(!f.isMenuRendered){f.renderMenu();f.isMenuRendered=true}if(f.isMenuVisible){return f.hideMenu()}i=c.get(f.id);c.show(f.id+"_menu");c.addClass(i,"mceSplitButtonSelected");h=c.getPos(i);c.setStyles(f.id+"_menu",{left:h.x,top:h.y+i.firstChild.clientHeight,zIndex:200000});i=0;a.add(c.doc,"mousedown",f.hideMenu,f);f.onShowMenu.dispatch(f);if(f._focused){f._keyHandler=a.add(f.id+"_menu","keydown",function(k){if(k.keyCode==27){f.hideMenu()}});c.select("a",f.id+"_menu")[0].focus()}f.isMenuVisible=1},hideMenu:function(g){var f=this;if(f.isMenuVisible){if(g&&g.type=="mousedown"&&c.getParent(g.target,function(h){return h.id===f.id+"_open"})){return}if(!g||!c.getParent(g.target,".mceSplitButtonMenu")){c.removeClass(f.id,"mceSplitButtonSelected");a.remove(c.doc,"mousedown",f.hideMenu,f);a.remove(f.id+"_menu","keydown",f._keyHandler);c.hide(f.id+"_menu")}f.isMenuVisible=0;f.onHideMenu.dispatch()}},renderMenu:function(){var p=this,h,k=0,q=p.settings,g,j,l,o,f;o=c.add(q.menu_container,"div",{role:"listbox",id:p.id+"_menu","class":q.menu_class+" "+q["class"],style:"position:absolute;left:0;top:-1000px;"});h=c.add(o,"div",{"class":q["class"]+" mceSplitButtonMenu"});c.add(h,"span",{"class":"mceMenuLine"});g=c.add(h,"table",{role:"presentation","class":"mceColorSplitMenu"});j=c.add(g,"tbody");k=0;e(b(q.colors,"array")?q.colors:q.colors.split(","),function(m){m=m.replace(/^#/,"");if(!k--){l=c.add(j,"tr");k=q.grid_width-1}g=c.add(l,"td");var i={href:"javascript:;",style:{backgroundColor:"#"+m},title:p.editor.getLang("colors."+m,m),"data-mce-color":"#"+m};if(!d.isIE){i.role="option"}g=c.add(g,"a",i);if(p.editor.forcedHighContrastMode){g=c.add(g,"canvas",{width:16,height:16,"aria-hidden":"true"});if(g.getContext&&(f=g.getContext("2d"))){f.fillStyle="#"+m;f.fillRect(0,0,16,16)}else{c.remove(g)}}});if(q.more_colors_func){g=c.add(j,"tr");g=c.add(g,"td",{colspan:q.grid_width,"class":"mceMoreColors"});g=c.add(g,"a",{role:"option",id:p.id+"_more",href:"javascript:;",onclick:"return false;","class":"mceMoreColors"},q.more_colors_title);a.add(g,"click",function(i){q.more_colors_func.call(q.more_colors_scope||this);return a.cancel(i)})}c.addClass(h,"mceColorSplitMenu");new d.ui.KeyboardNavigation({root:p.id+"_menu",items:c.select("a",p.id+"_menu"),onCancel:function(){p.hideMenu();p.focus()}});a.add(p.id+"_menu","mousedown",function(i){return a.cancel(i)});a.add(p.id+"_menu","click",function(i){var m;i=c.getParent(i.target,"a",j);if(i&&i.nodeName.toLowerCase()=="a"&&(m=i.getAttribute("data-mce-color"))){p.setColor(m)}return false});return o},setColor:function(f){this.displayColor(f);this.hideMenu();this.settings.onselect(f)},displayColor:function(g){var f=this;c.setStyle(f.id+"_preview","backgroundColor",g);f.value=g},postRender:function(){var f=this,g=f.id;f.parent();c.add(g+"_action","div",{id:g+"_preview","class":"mceColorPreview"});c.setStyle(f.id+"_preview","backgroundColor",f.value)},destroy:function(){this.parent();a.clear(this.id+"_menu");a.clear(this.id+"_more");c.remove(this.id+"_menu")}})})(tinymce);(function(b){var d=b.DOM,c=b.each,a=b.dom.Event;b.create("tinymce.ui.ToolbarGroup:tinymce.ui.Container",{renderHTML:function(){var f=this,i=[],e=f.controls,j=b.each,g=f.settings;i.push('
                    ');i.push("");i.push('");j(e,function(h){i.push(h.renderHTML())});i.push("");i.push("
                    ");return i.join("")},focus:function(){var e=this;d.get(e.id).focus()},postRender:function(){var f=this,e=[];c(f.controls,function(g){c(g.controls,function(h){if(h.id){e.push(h)}})});f.keyNav=new b.ui.KeyboardNavigation({root:f.id,items:e,onCancel:function(){if(b.isWebKit){d.get(f.editor.id+"_ifr").focus()}f.editor.focus()},excludeFromTabOrder:!f.settings.tab_focus_toolbar})},destroy:function(){var e=this;e.parent();e.keyNav.destroy();a.clear(e.id)}})})(tinymce);(function(a){var c=a.DOM,b=a.each;a.create("tinymce.ui.Toolbar:tinymce.ui.Container",{renderHTML:function(){var m=this,f="",j,k,n=m.settings,e,d,g,l;l=m.controls;for(e=0;e"))}if(d&&k.ListBox){if(d.Button||d.SplitButton){f+=c.createHTML("td",{"class":"mceToolbarEnd"},c.createHTML("span",null,""))}}if(c.stdMode){f+=''+k.renderHTML()+""}else{f+=""+k.renderHTML()+""}if(g&&k.ListBox){if(g.Button||g.SplitButton){f+=c.createHTML("td",{"class":"mceToolbarStart"},c.createHTML("span",null,""))}}}j="mceToolbarEnd";if(k.Button){j+=" mceToolbarEndButton"}else{if(k.SplitButton){j+=" mceToolbarEndSplitButton"}else{if(k.ListBox){j+=" mceToolbarEndListBox"}}}f+=c.createHTML("td",{"class":j},c.createHTML("span",null,""));return c.createHTML("table",{id:m.id,"class":"mceToolbar"+(n["class"]?" "+n["class"]:""),cellpadding:"0",cellspacing:"0",align:m.settings.align||"",role:"presentation",tabindex:"-1"},""+f+"")}})})(tinymce);(function(b){var a=b.util.Dispatcher,c=b.each;b.create("tinymce.AddOnManager",{AddOnManager:function(){var d=this;d.items=[];d.urls={};d.lookup={};d.onAdd=new a(d)},get:function(d){if(this.lookup[d]){return this.lookup[d].instance}else{return undefined}},dependencies:function(e){var d;if(this.lookup[e]){d=this.lookup[e].dependencies}return d||[]},requireLangPack:function(e){return;var d=b.settings;if(d&&d.language&&d.language_load!==false){b.ScriptLoader.add(this.urls[e]+"/langs/"+d.language+".js")}},add:function(f,e,d){this.items.push(e);this.lookup[f]={instance:e,dependencies:d};this.onAdd.dispatch(this,f,e);return e},createUrl:function(d,e){if(typeof e==="object"){return e}else{return{prefix:d.prefix,resource:e,suffix:d.suffix}}},addComponents:function(f,d){var e=this.urls[f];b.each(d,function(g){b.ScriptLoader.add(e+"/"+g)})},load:function(j,f,d,h){var g=this,e=f;function i(){var k=g.dependencies(j);b.each(k,function(m){var l=g.createUrl(f,m);g.load(l.resource,l,undefined,undefined)});if(d){if(h){d.call(h)}else{d.call(b.ScriptLoader)}}}if(g.urls[j]){return}if(typeof f==="object"){e=f.prefix+f.resource+f.suffix}if(e.indexOf("/")!==0&&e.indexOf("://")==-1){e=b.baseURL+"/"+e}g.urls[j]=e.substring(0,e.lastIndexOf("/"));if(g.lookup[j]){i()}else{b.ScriptLoader.add(e,i,h)}}});b.PluginManager=new b.AddOnManager();b.ThemeManager=new b.AddOnManager()}(tinymce));(function(j){var g=j.each,d=j.extend,k=j.DOM,i=j.dom.Event,f=j.ThemeManager,b=j.PluginManager,e=j.explode,h=j.util.Dispatcher,a,c=0;j.documentBaseURL=window.location.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,"");if(!/[\/\\]$/.test(j.documentBaseURL)){j.documentBaseURL+="/"}j.baseURL=new j.util.URI(j.documentBaseURL).toAbsolute(j.baseURL);j.baseURI=new j.util.URI(j.baseURL);j.onBeforeUnload=new h(j);i.add(window,"beforeunload",function(l){j.onBeforeUnload.dispatch(j,l)});j.onAddEditor=new h(j);j.onRemoveEditor=new h(j);j.EditorManager=d(j,{editors:[],i18n:{},activeEditor:null,init:function(x){var v=this,o,n=j.ScriptLoader,u,l=[],r;function q(t){var s=t.id;if(!s){s=t.name;if(s&&!k.get(s)){s=t.name}else{s=k.uniqueId()}t.setAttribute("id",s)}return s}function m(z,A,t){var y=z[A];if(!y){return}if(j.is(y,"string")){t=y.replace(/\.\w+$/,"");t=t?j.resolve(t):0;y=j.resolve(y)}return y.apply(t||this,Array.prototype.slice.call(arguments,2))}function p(t,s){return s.constructor===RegExp?s.test(t.className):k.hasClass(t,s)}x=d({theme:"simple",language:"en"},x);v.settings=x;i.bind(window,"ready",function(){var s,t;m(x,"onpageload");switch(x.mode){case"exact":s=x.elements||"";if(s.length>0){g(e(s),function(y){if(k.get(y)){r=new j.Editor(y,x);l.push(r);r.render(1)}else{g(document.forms,function(z){g(z.elements,function(A){if(A.name===y){y="mce_editor_"+c++;k.setAttrib(A,"id",y);r=new j.Editor(y,x);l.push(r);r.render(1)}})})}})}break;case"textareas":case"specific_textareas":g(k.select("textarea"),function(y){if(x.editor_deselector&&p(y,x.editor_deselector)){return}if(!x.editor_selector||p(y,x.editor_selector)){r=new j.Editor(q(y),x);l.push(r);r.render(1)}});break;default:if(x.types){g(x.types,function(y){g(k.select(y.selector),function(A){var z=new j.Editor(q(A),j.extend({},x,y));l.push(z);z.render(1)})})}else{if(x.selector){g(k.select(x.selector),function(z){var y=new j.Editor(q(z),x);l.push(y);y.render(1)})}}}if(x.oninit){s=t=0;g(l,function(y){t++;if(!y.initialized){y.onInit.add(function(){s++;if(s==t){m(x,"oninit")}})}else{s++}if(s==t){m(x,"oninit")}})}})},get:function(l){if(l===a){return this.editors}return this.editors[l]},getInstanceById:function(l){return this.get(l)},add:function(m){var l=this,n=l.editors;n[m.id]=m;n.push(m);l._setActive(m);l.onAddEditor.dispatch(l,m);return m},remove:function(n){var m=this,l,o=m.editors;if(!o[n.id]){return null}delete o[n.id];for(l=0;l':"",visual:n,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",apply_source_formatting:n,directionality:"ltr",forced_root_block:"p",hidden_input:n,padd_empty_editor:n,render_ui:n,indentation:"30px",fix_table_elements:n,inline_styles:n,convert_fonts_to_spans:n,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure",validate:n,entity_encoding:"named",url_converter:m.convertURL,url_converter_scope:m,ie7_compat:n},o);m.id=m.editorId=p;m.isNotDirty=false;m.plugins={};m.documentBaseURI=new k.util.URI(o.document_base_url||k.documentBaseURL,{base_uri:tinyMCE.baseURI});m.baseURI=k.baseURI;m.contentCSS=[];m.setupEvents();m.execCommands={};m.queryStateCommands={};m.queryValueCommands={};m.execCallback("setup",m)},render:function(o){var p=this,q=p.settings,r=p.id,m=k.ScriptLoader;if(!j.domLoaded){j.add(window,"ready",function(){p.render()});return}tinyMCE.settings=q;if(!p.getElement()){return}if(k.isIDevice&&!k.isIOS5){return}if(!/TEXTAREA|INPUT/i.test(p.getElement().nodeName)&&q.hidden_input&&l.getParent(r,"form")){l.insertAfter(l.create("input",{type:"hidden",name:r}),r)}if(k.WindowManager){p.windowManager=new k.WindowManager(p)}if(q.encoding=="xml"){p.onGetContent.add(function(s,t){if(t.save){t.content=l.encode(t.content)}})}if(q.add_form_submit_trigger){p.onSubmit.addToTop(function(){if(p.initialized){p.save();p.isNotDirty=1}})}if(q.add_unload_trigger){p._beforeUnload=tinyMCE.onBeforeUnload.add(function(){if(p.initialized&&!p.destroyed&&!p.isHidden()){p.save({format:"raw",no_events:true})}})}k.addUnload(p.destroy,p);if(q.submit_patch){p.onBeforeRenderUI.add(function(){var s=p.getElement().form;if(!s){return}if(s._mceOldSubmit){return}if(!s.submit.nodeType&&!s.submit.length){p.formElement=s;s._mceOldSubmit=s.submit;s.submit=function(){k.triggerSave();p.isNotDirty=1;return p.formElement._mceOldSubmit(p.formElement)}}s=null})}function n(){if(q.language&&q.language_load!==false){m.add(k.baseURL+"/../../extra/strings.php?elanguage="+q.language+"ðeme="+q.theme)}if(q.theme&&q.theme.charAt(0)!="-"&&!h.urls[q.theme]){h.load(q.theme,"themes/"+q.theme+"/editor_template"+k.suffix+".js")}i(g(q.plugins),function(t){if(t&&!c.urls[t]){if(t.charAt(0)=="-"){t=t.substr(1,t.length);var s=c.dependencies(t);i(s,function(v){var u={prefix:"plugins/",resource:v,suffix:"/editor_plugin"+k.suffix+".js"};v=c.createUrl(u,v);c.load(v.resource,v)})}else{if(t=="safari"){return}c.load(t,{prefix:"plugins/",resource:t,suffix:"/editor_plugin"+k.suffix+".js"})}}});m.loadQueue(function(){if(!p.removed){p.init()}})}n()},init:function(){var q,F=this,G=F.settings,C,y,B=F.getElement(),p,m,D,v,A,E,x,r=[];k.add(F);G.aria_label=G.aria_label||l.getAttrib(B,"aria-label",F.getLang("aria.rich_text_area"));if(G.theme){G.theme=G.theme.replace(/-/,"");p=h.get(G.theme);F.theme=new p();if(F.theme.init){F.theme.init(F,h.urls[G.theme]||k.documentBaseURL.replace(/\/$/,""))}}function z(s){var t=c.get(s),o=c.urls[s]||k.documentBaseURL.replace(/\/$/,""),n;if(t&&k.inArray(r,s)===-1){i(c.dependencies(s),function(u){z(u)});n=new t(F,o);F.plugins[s]=n;if(n.init){n.init(F,o);r.push(s)}}}i(g(G.plugins.replace(/\-/g,"")),z);if(G.popup_css!==false){if(G.popup_css){G.popup_css=F.documentBaseURI.toAbsolute(G.popup_css)}else{G.popup_css=F.baseURI.toAbsolute("themes/"+G.theme+"/skins/"+G.skin+"/dialog.css")}}if(G.popup_css_add){G.popup_css+=","+F.documentBaseURI.toAbsolute(G.popup_css_add)}F.controlManager=new k.ControlManager(F);F.onExecCommand.add(function(n,o){if(!/^(FontName|FontSize)$/.test(o)){F.nodeChanged()}});F.onBeforeRenderUI.dispatch(F,F.controlManager);if(G.render_ui&&F.theme){C=G.width||B.style.width||B.offsetWidth;y=G.height||B.style.height||B.offsetHeight;F.orgDisplay=B.style.display;E=/^[0-9\.]+(|px)$/i;if(E.test(""+C)){C=Math.max(parseInt(C,10)+(p.deltaWidth||0),100)}if(E.test(""+y)){y=Math.max(parseInt(y)+(p.deltaHeight||0),G.theme_advanced_resizing_min_height||100)}p=F.theme.renderUI({targetNode:B,width:C,height:y,deltaWidth:G.delta_width,deltaHeight:G.delta_height});F.editorContainer=p.editorContainer}if(G.content_css){i(g(G.content_css),function(n){F.contentCSS.push(F.documentBaseURI.toAbsolute(n))})}if(G.content_editable){B=q=p=null;return F.initContentBody()}if(document.domain&&location.hostname!=document.domain){k.relaxedDomain=document.domain}l.setStyles(p.sizeContainer||p.editorContainer,{width:C,height:y});y=(p.iframeHeight||y)+(typeof(y)=="number"?(p.deltaHeight||0):"");if(y<(G.theme_advanced_resizing_min_height||100)){y=G.theme_advanced_resizing_min_height||100}F.iframeHTML=G.doctype+'';if(G.document_base_url!=k.documentBaseURL){F.iframeHTML+=''}if(G.ie7_compat){F.iframeHTML+=''}else{F.iframeHTML+=''}F.iframeHTML+='';for(x=0;x'}F.contentCSS=[];v=G.body_id||"tinymce";if(v.indexOf("=")!=-1){v=F.getParam("body_id","","hash");v=v[F.id]||v}A=G.body_class||"";if(A.indexOf("=")!=-1){A=F.getParam("body_class","","hash");A=A[F.id]||""}F.iframeHTML+='
                    ";if(k.relaxedDomain&&(b||(k.isOpera&&parseFloat(opera.version())<11))){D='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinyMCE.get("'+F.id+'");document.write(ed.iframeHTML);document.close();ed.initContentBody();})()'}q=l.add(p.iframeContainer,"iframe",{id:F.id+"_ifr",src:D||'javascript:""',frameBorder:"0",allowTransparency:"true",title:G.aria_label,style:{width:"100%",height:y,display:"block"}});F.contentAreaContainer=p.iframeContainer;l.get(p.editorContainer).style.display=F.orgDisplay;l.get(F.id).style.display="none";l.setAttrib(F.id,"aria-hidden",true);if(!k.relaxedDomain||!D){F.initContentBody()}B=q=p=null},initContentBody:function(){var n=this,p=n.settings,q=l.get(n.id),r=n.getDoc(),o,m;if((!b||!k.relaxedDomain)&&!p.content_editable){r.open();r.write(n.iframeHTML);r.close();if(k.relaxedDomain){r.domain=k.relaxedDomain}}if(p.content_editable){l.addClass(q,"mceContentBody");n.contentDocument=r=p.content_document||document;n.contentWindow=p.content_window||window;n.bodyElement=q;p.content_document=p.content_window=null}m=n.getBody();m.disabled=true;if(!p.readonly){m.contentEditable=n.getParam("content_editable_state",true)}m.disabled=false;n.schema=new k.html.Schema(p);n.dom=new k.dom.DOMUtils(r,{keep_values:true,url_converter:n.convertURL,url_converter_scope:n,hex_colors:p.force_hex_style_colors,class_filter:p.class_filter,update_styles:true,root_element:p.content_editable?n.id:null,schema:n.schema});n.parser=new k.html.DomParser(p,n.schema);n.parser.addAttributeFilter("src,href,style",function(s,t){var u=s.length,x,z=n.dom,y,v;while(u--){x=s[u];y=x.attr(t);v="data-mce-"+t;if(!x.attributes.map[v]){if(t==="style"){x.attr(v,z.serializeStyle(z.parseStyle(y),x.name))}else{x.attr(v,n.convertURL(y,t,x.name))}}}});n.parser.addNodeFilter("script",function(s,t){var u=s.length,v;while(u--){v=s[u];v.attr("type","mce-"+(v.attr("type")||"text/javascript"))}});n.parser.addNodeFilter("#cdata",function(s,t){var u=s.length,v;while(u--){v=s[u];v.type=8;v.name="#comment";v.value="[CDATA["+v.value+"]]"}});n.parser.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(t,u){var v=t.length,x,s=n.schema.getNonEmptyElements();while(v--){x=t[v];if(x.isEmpty(s)){x.empty().append(new k.html.Node("br",1)).shortEnded=true}}});n.serializer=new k.dom.Serializer(p,n.dom,n.schema);n.selection=new k.dom.Selection(n.dom,n.getWin(),n.serializer);n.formatter=new k.Formatter(n);n.undoManager=new k.UndoManager(n);n.forceBlocks=new k.ForceBlocks(n);n.enterKey=new k.EnterKey(n);n.editorCommands=new k.EditorCommands(n);n.serializer.onPreProcess.add(function(s,t){return n.onPreProcess.dispatch(n,t,s)});n.serializer.onPostProcess.add(function(s,t){return n.onPostProcess.dispatch(n,t,s)});n.onPreInit.dispatch(n);if(!p.gecko_spellcheck){r.body.spellcheck=false}if(!p.readonly){n.bindNativeEvents()}n.controlManager.onPostRender.dispatch(n,n.controlManager);n.onPostRender.dispatch(n);n.quirks=k.util.Quirks(n);if(p.directionality){m.dir=p.directionality}if(p.nowrap){m.style.whiteSpace="nowrap"}if(p.protect){n.onBeforeSetContent.add(function(s,t){i(p.protect,function(u){t.content=t.content.replace(u,function(v){return""})})})}n.onSetContent.add(function(){n.addVisual(n.getBody())});if(p.padd_empty_editor){n.onPostProcess.add(function(s,t){t.content=t.content.replace(/^(]*>( | |\s|\u00a0|)<\/p>[\r\n]*|
                    [\r\n]*)$/,"")})}n.load({initial:true,format:"html"});n.startContent=n.getContent({format:"raw"});n.initialized=true;n.onInit.dispatch(n);n.execCallback("setupcontent_callback",n.id,m,r);n.execCallback("init_instance_callback",n);n.focus(true);n.nodeChanged({initial:true});i(n.contentCSS,function(s){n.dom.loadCSS(s)});if(p.auto_focus){setTimeout(function(){var s=k.get(p.auto_focus);s.selection.select(s.getBody(),1);s.selection.collapse(1);s.getBody().focus();s.getWin().focus()},100)}q=r=m=null},focus:function(p){var o,u=this,t=u.selection,q=u.settings.content_editable,n,r,s=u.getDoc(),m;if(!p){n=t.getRng();if(n.item){r=n.item(0)}u._refreshContentEditable();if(!q){u.getWin().focus()}if(k.isGecko||q){m=u.getBody();if(m.setActive){m.setActive()}else{m.focus()}if(q){t.normalize()}}if(r&&r.ownerDocument==s){n=s.body.createControlRange();n.addElement(r);n.select()}}if(k.activeEditor!=u){if((o=k.activeEditor)!=null){o.onDeactivate.dispatch(o,u)}u.onActivate.dispatch(u,o)}k._setActive(u)},execCallback:function(q){var m=this,p=m.settings[q],o;if(!p){return}if(m.callbackLookup&&(o=m.callbackLookup[q])){p=o.func;o=o.scope}if(d(p,"string")){o=p.replace(/\.\w+$/,"");o=o?k.resolve(o):0;p=k.resolve(p);m.callbackLookup=m.callbackLookup||{};m.callbackLookup[q]={func:p,scope:o}}return p.apply(o||m,Array.prototype.slice.call(arguments,1))},translate:function(m){var o=this.settings.language||"en",n=k.i18n;if(!m){return""}return n[o+"."+m]||m.replace(/\{\#([^\}]+)\}/g,function(q,p){return n[o+"."+p]||"{#"+p+"}"})},getLang:function(o,m){return k.i18n[(this.settings.language||"en")+"."+o]||(d(m)?m:"{#"+o+"}")},getParam:function(t,q,m){var r=k.trim,p=d(this.settings[t])?this.settings[t]:q,s;if(m==="hash"){s={};if(d(p,"string")){i(p.indexOf("=")>0?p.split(/[;,](?![^=;,]*(?:[;,]|$))/):p.split(","),function(n){n=n.split("=");if(n.length>1){s[r(n[0])]=r(n[1])}else{s[r(n[0])]=r(n)}})}else{s=p}return s}return p},nodeChanged:function(q){var m=this,n=m.selection,p;if(m.initialized){q=q||{};n.normalize();p=n.getStart()||m.getBody();p=b&&p.ownerDocument!=m.getDoc()?m.getBody():p;q.parents=[];m.dom.getParent(p,function(o){if(o.nodeName=="BODY"){return true}q.parents.push(o)});m.onNodeChange.dispatch(m,q?q.controlManager||m.controlManager:m.controlManager,p,n.isCollapsed(),q)}},addButton:function(n,o){var m=this;m.buttons=m.buttons||{};m.buttons[n]=o},addCommand:function(m,o,n){this.execCommands[m]={func:o,scope:n||this}},addQueryStateHandler:function(m,o,n){this.queryStateCommands[m]={func:o,scope:n||this}},addQueryValueHandler:function(m,o,n){this.queryValueCommands[m]={func:o,scope:n||this}},addShortcut:function(o,q,m,p){var n=this,r;if(n.settings.custom_shortcuts===false){return false}n.shortcuts=n.shortcuts||{};if(d(m,"string")){r=m;m=function(){n.execCommand(r,false,null)}}if(d(m,"object")){r=m;m=function(){n.execCommand(r[0],r[1],r[2])}}i(g(o),function(s){var t={func:m,scope:p||this,desc:n.translate(q),alt:false,ctrl:false,shift:false};i(g(s,"+"),function(u){switch(u){case"alt":case"ctrl":case"shift":t[u]=true;break;default:t.charCode=u.charCodeAt(0);t.keyCode=u.toUpperCase().charCodeAt(0)}});n.shortcuts[(t.ctrl?"ctrl":"")+","+(t.alt?"alt":"")+","+(t.shift?"shift":"")+","+t.keyCode]=t});return true},execCommand:function(u,r,x,m){var p=this,q=0,v,n;if(!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(u)&&(!m||!m.skip_focus)){p.focus()}m=f({},m);p.onBeforeExecCommand.dispatch(p,u,r,x,m);if(m.terminate){return false}if(p.execCallback("execcommand_callback",p.id,p.selection.getNode(),u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);return true}if(v=p.execCommands[u]){n=v.func.call(v.scope,r,x);if(n!==true){p.onExecCommand.dispatch(p,u,r,x,m);return n}}i(p.plugins,function(o){if(o.execCommand&&o.execCommand(u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);q=1;return false}});if(q){return true}if(p.theme&&p.theme.execCommand&&p.theme.execCommand(u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);return true}if(p.editorCommands.execCommand(u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);return true}p.getDoc().execCommand(u,r,x);p.onExecCommand.dispatch(p,u,r,x,m)},queryCommandState:function(q){var n=this,r,p;if(n._isHidden()){return}if(r=n.queryStateCommands[q]){p=r.func.call(r.scope);if(p!==true){return p}}r=n.editorCommands.queryCommandState(q);if(r!==-1){return r}try{return this.getDoc().queryCommandState(q)}catch(m){}},queryCommandValue:function(r){var n=this,q,p;if(n._isHidden()){return}if(q=n.queryValueCommands[r]){p=q.func.call(q.scope);if(p!==true){return p}}q=n.editorCommands.queryCommandValue(r);if(d(q)){return q}try{return this.getDoc().queryCommandValue(r)}catch(m){}},show:function(){var m=this;l.show(m.getContainer());l.hide(m.id);m.load()},hide:function(){var m=this,n=m.getDoc();if(b&&n){n.execCommand("SelectAll")}m.save();l.hide(m.getContainer());l.setStyle(m.id,"display",m.orgDisplay)},isHidden:function(){return !l.isHidden(this.id)},setProgressState:function(m,n,p){this.onSetProgressState.dispatch(this,m,n,p);return m},load:function(q){var m=this,p=m.getElement(),n;if(p){q=q||{};q.load=true;n=m.setContent(d(p.value)?p.value:p.innerHTML,q);q.element=p;if(!q.no_events){m.onLoadContent.dispatch(m,q)}q.element=p=null;return n}},save:function(r){var m=this,q=m.getElement(),n,p;if(!q||!m.initialized){return}r=r||{};r.save=true;r.element=q;n=r.content=m.getContent(r);if(!r.no_events){m.onSaveContent.dispatch(m,r)}n=r.content;if(!/TEXTAREA|INPUT/i.test(q.nodeName)){q.innerHTML=n;if(p=l.getParent(m.id,"form")){i(p.elements,function(o){if(o.name==m.id){o.value=n;return false}})}}else{q.value=n}r.element=q=null;return n},setContent:function(r,p){var o=this,n,m=o.getBody(),q;p=p||{};p.format=p.format||"html";p.set=true;p.content=r;if(!p.no_events){o.onBeforeSetContent.dispatch(o,p)}r=p.content;if(!k.isIE&&(r.length===0||/^\s+$/.test(r))){q=o.settings.forced_root_block;if(q){r="<"+q+'>
                    "}else{r='
                    '}m.innerHTML=r;o.selection.select(m,true);o.selection.collapse(true);return}if(p.format!=="raw"){r=new k.html.Serializer({},o.schema).serialize(o.parser.parse(r))}p.content=k.trim(r);o.dom.setHTML(m,p.content);if(!p.no_events){o.onSetContent.dispatch(o,p)}o.selection.normalize();return p.content},getContent:function(n){var m=this,o;n=n||{};n.format=n.format||"html";n.get=true;n.getInner=true;if(!n.no_events){m.onBeforeGetContent.dispatch(m,n)}if(n.format=="raw"){o=m.getBody().innerHTML}else{o=m.serializer.serialize(m.getBody(),n)}n.content=k.trim(o);if(!n.no_events){m.onGetContent.dispatch(m,n)}return n.content},isDirty:function(){var m=this;return k.trim(m.startContent)!=k.trim(m.getContent({format:"raw",no_events:1}))&&!m.isNotDirty},getContainer:function(){var m=this;if(!m.container){m.container=l.get(m.editorContainer||m.id+"_parent")}return m.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return l.get(this.settings.content_element||this.id)},getWin:function(){var m=this,n;if(!m.contentWindow){n=l.get(m.id+"_ifr");if(n){m.contentWindow=n.contentWindow}}return m.contentWindow},getDoc:function(){var m=this,n;if(!m.contentDocument){n=m.getWin();if(n){m.contentDocument=n.document}}return m.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(o,n,q){var m=this,p=m.settings;if(p.urlconverter_callback){return m.execCallback("urlconverter_callback",o,q,true,n)}if(!p.convert_urls||(q&&q.nodeName=="LINK")||o.indexOf("file:")===0){return o}if(p.relative_urls){return m.documentBaseURI.toRelative(o)}o=m.documentBaseURI.toAbsolute(o,p.remove_script_host);return o},addVisual:function(q){var n=this,o=n.settings,p=n.dom,m;q=q||n.getBody();if(!d(n.hasVisual)){n.hasVisual=o.visual}i(p.select("table,a",q),function(s){var r;switch(s.nodeName){case"TABLE":m=o.visual_table_class||"mceItemTable";r=p.getAttrib(s,"border");if(!r||r=="0"){if(n.hasVisual){p.addClass(s,m)}else{p.removeClass(s,m)}}return;case"A":r=p.getAttrib(s,"name");m="mceItemAnchor";if(r){if(n.hasVisual){p.addClass(s,m)}else{p.removeClass(s,m)}}return}});n.onVisualAid.dispatch(n,q,n.hasVisual)},remove:function(){var m=this,n=m.getContainer();if(!m.removed){m.removed=1;m.hide();if(!m.settings.content_editable){j.clear(m.getWin());j.clear(m.getDoc())}j.clear(m.getBody());j.clear(m.formElement);j.unbind(n);m.execCallback("remove_instance_callback",m);m.onRemove.dispatch(m);m.onExecCommand.listeners=[];k.remove(m);l.remove(n)}},destroy:function(n){var m=this;if(m.destroyed){return}if(a){j.unbind(m.getDoc());j.unbind(m.getWin());j.unbind(m.getBody())}if(!n){k.removeUnload(m.destroy);tinyMCE.onBeforeUnload.remove(m._beforeUnload);if(m.theme&&m.theme.destroy){m.theme.destroy()}m.controlManager.destroy();m.selection.destroy();m.dom.destroy()}if(m.formElement){m.formElement.submit=m.formElement._mceOldSubmit;m.formElement._mceOldSubmit=null}m.contentAreaContainer=m.formElement=m.container=m.settings.content_element=m.bodyElement=m.contentDocument=m.contentWindow=null;if(m.selection){m.selection=m.selection.win=m.selection.dom=m.selection.dom.doc=null}m.destroyed=1},_refreshContentEditable:function(){var n=this,m,o;if(n._isHidden()){m=n.getBody();o=m.parentNode;o.removeChild(m);o.appendChild(m);m.focus()}},_isHidden:function(){var m;if(!a){return 0}m=this.selection.getSel();return(!m||!m.rangeCount||m.rangeCount===0)}})})(tinymce);(function(a){var b=a.each;a.Editor.prototype.setupEvents=function(){var c=this,d=c.settings;b(["onPreInit","onBeforeRenderUI","onPostRender","onLoad","onInit","onRemove","onActivate","onDeactivate","onClick","onEvent","onMouseUp","onMouseDown","onDblClick","onKeyDown","onKeyUp","onKeyPress","onContextMenu","onSubmit","onReset","onPaste","onPreProcess","onPostProcess","onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent","onLoadContent","onSaveContent","onNodeChange","onChange","onBeforeExecCommand","onExecCommand","onUndo","onRedo","onVisualAid","onSetProgressState","onSetAttrib"],function(e){c[e]=new a.util.Dispatcher(c)});if(d.cleanup_callback){c.onBeforeSetContent.add(function(e,f){f.content=e.execCallback("cleanup_callback","insert_to_editor",f.content,f)});c.onPreProcess.add(function(e,f){if(f.set){e.execCallback("cleanup_callback","insert_to_editor_dom",f.node,f)}if(f.get){e.execCallback("cleanup_callback","get_from_editor_dom",f.node,f)}});c.onPostProcess.add(function(e,f){if(f.set){f.content=e.execCallback("cleanup_callback","insert_to_editor",f.content,f)}if(f.get){f.content=e.execCallback("cleanup_callback","get_from_editor",f.content,f)}})}if(d.save_callback){c.onGetContent.add(function(e,f){if(f.save){f.content=e.execCallback("save_callback",e.id,f.content,e.getBody())}})}if(d.handle_event_callback){c.onEvent.add(function(f,g,h){if(c.execCallback("handle_event_callback",g,f,h)===false){Event.cancel(g)}})}if(d.handle_node_change_callback){c.onNodeChange.add(function(f,e,g){f.execCallback("handle_node_change_callback",f.id,g,-1,-1,true,f.selection.isCollapsed())})}if(d.save_callback){c.onSaveContent.add(function(e,g){var f=e.execCallback("save_callback",e.id,g.content,e.getBody());if(f){g.content=f}})}if(d.onchange_callback){c.onChange.add(function(f,e){f.execCallback("onchange_callback",f,e)})}};a.Editor.prototype.bindNativeEvents=function(){var c=this,f,g=c.settings,j=c.dom,k;k={mouseup:"onMouseUp",mousedown:"onMouseDown",click:"onClick",keyup:"onKeyUp",keydown:"onKeyDown",keypress:"onKeyPress",submit:"onSubmit",reset:"onReset",contextmenu:"onContextMenu",dblclick:"onDblClick",paste:"onPaste"};function e(i,l){var m=i.type;if(c.removed){return}if(c.onEvent.dispatch(c,i,l)!==false){c[k[i.fakeType||i.type]].dispatch(c,i,l)}}function h(i){c.focus(true)}b(k,function(l,m){var i=g.content_editable?c.getBody():c.getDoc();switch(m){case"contextmenu":j.bind(i,m,e);break;case"paste":j.bind(c.getBody(),m,e);break;case"submit":case"reset":j.bind(c.getElement().form||a.DOM.getParent(c.id,"form"),m,e);break;default:j.bind(i,m,e)}});j.bind(g.content_editable?c.getBody():(a.isGecko?c.getDoc():c.getWin()),"focus",function(i){c.focus(true)});if(g.content_editable&&a.isOpera){j.bind(c.getBody(),"click",h);j.bind(c.getBody(),"keydown",h)}c.onMouseUp.add(c.nodeChanged);c.onKeyUp.add(function(i,m){var l=m.keyCode;if((l>=33&&l<=36)||(l>=37&&l<=40)||l==13||l==45||l==46||l==8||(a.isMac&&(l==91||l==93))||m.ctrlKey){c.nodeChanged()}});c.onReset.add(function(){c.setContent(c.startContent,{format:"raw"})});function d(l,i){if(l.altKey||l.ctrlKey||l.metaKey){b(c.shortcuts,function(m){var n=a.isMac?l.metaKey:l.ctrlKey;if(m.ctrl!=n||m.alt!=l.altKey||m.shift!=l.shiftKey){return}if(l.keyCode==m.keyCode||(l.charCode&&l.charCode==m.charCode)){l.preventDefault();if(i){m.func.call(m.scope)}return true}})}}c.onKeyUp.add(function(i,l){d(l)});c.onKeyPress.add(function(i,l){d(l)});c.onKeyDown.add(function(i,l){d(l,true)});if(a.isOpera){c.onClick.add(function(i,l){l.preventDefault()})}}})(tinymce);(function(d){var e=d.each,b,a=true,c=false;d.EditorCommands=function(n){var m=n.dom,p=n.selection,j={state:{},exec:{},value:{}},k=n.settings,q=n.formatter,o;function r(z,y,x){var v;z=z.toLowerCase();if(v=j.exec[z]){v(z,y,x);return a}return c}function l(x){var v;x=x.toLowerCase();if(v=j.state[x]){return v(x)}return -1}function h(x){var v;x=x.toLowerCase();if(v=j.value[x]){return v(x)}return c}function u(v,x){x=x||"exec";e(v,function(z,y){e(y.toLowerCase().split(","),function(A){j[x][A]=z})})}d.extend(this,{execCommand:r,queryCommandState:l,queryCommandValue:h,addCommands:u});function f(y,x,v){if(x===b){x=c}if(v===b){v=null}return n.getDoc().execCommand(y,x,v)}function t(v){return q.match(v)}function s(v,x){q.toggle(v,x?{value:x}:b)}function i(v){o=p.getBookmark(v)}function g(){p.moveToBookmark(o)}u({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){n.undoManager.add()},"Cut,Copy,Paste":function(z){var y=n.getDoc(),v;try{f(z)}catch(x){v=a}if(v||!y.queryCommandSupported(z)){if(d.isGecko){n.windowManager.confirm(n.getLang("clipboard_msg"),function(A){if(A){open("http://www.mozilla.org/editor/midasdemo/securityprefs.html","_blank")}})}else{n.windowManager.alert(n.getLang("clipboard_no_support"))}}},unlink:function(v){if(p.isCollapsed()){p.select(p.getNode())}f(v);p.collapse(c)},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(v){var x=v.substring(7);e("left,center,right,full".split(","),function(y){if(x!=y){q.remove("align"+y)}});s("align"+x);r("mceRepaint")},"InsertUnorderedList,InsertOrderedList":function(y){var v,x;f(y);v=m.getParent(p.getNode(),"ol,ul");if(v){x=v.parentNode;if(/^(H[1-6]|P|ADDRESS|PRE)$/.test(x.nodeName)){i();m.split(x,v);g()}}},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(v){s(v)},"ForeColor,HiliteColor,FontName":function(y,x,v){s(y,v)},FontSize:function(z,y,x){var v,A;if(x>=1&&x<=7){A=d.explode(k.font_size_style_values);v=d.explode(k.font_size_classes);if(v){x=v[x-1]||x}else{x=A[x-1]||x}}s(z,x)},RemoveFormat:function(v){q.remove(v)},mceBlockQuote:function(v){s("blockquote")},FormatBlock:function(y,x,v){return s(v||"p")},mceCleanup:function(){var v=p.getBookmark();n.setContent(n.getContent({cleanup:a}),{cleanup:a});p.moveToBookmark(v)},mceRemoveNode:function(z,y,x){var v=x||p.getNode();if(v!=n.getBody()){i();n.dom.remove(v,a);g()}},mceSelectNodeDepth:function(z,y,x){var v=0;m.getParent(p.getNode(),function(A){if(A.nodeType==1&&v++==x){p.select(A);return c}},n.getBody())},mceSelectNode:function(y,x,v){p.select(v)},mceInsertContent:function(B,I,K){var y,J,E,z,F,G,D,C,L,x,A,M,v,H;y=n.parser;J=new d.html.Serializer({},n.schema);v='\uFEFF';G={content:K,format:"html"};p.onBeforeSetContent.dispatch(p,G);K=G.content;if(K.indexOf("{$caret}")==-1){K+="{$caret}"}K=K.replace(/\{\$caret\}/,v);if(!p.isCollapsed()){n.getDoc().execCommand("Delete",false,null)}E=p.getNode();G={context:E.nodeName.toLowerCase()};F=y.parse(K,G);A=F.lastChild;if(A.attr("id")=="mce_marker"){D=A;for(A=A.prev;A;A=A.walk(true)){if(A.type==3||!m.isBlock(A.name)){A.parent.insert(D,A,A.name==="br");break}}}if(!G.invalid){K=J.serialize(F);A=E.firstChild;M=E.lastChild;if(!A||(A===M&&A.nodeName==="BR")){m.setHTML(E,K)}else{p.setContent(K)}}else{p.setContent(v);E=n.selection.getNode();z=n.getBody();if(E.nodeType==9){E=A=z}else{A=E}while(A!==z){E=A;A=A.parentNode}K=E==z?z.innerHTML:m.getOuterHTML(E);K=J.serialize(y.parse(K.replace(//i,function(){return J.serialize(F)})));if(E==z){m.setHTML(z,K)}else{m.setOuterHTML(E,K)}}D=m.get("mce_marker");C=m.getRect(D);L=m.getViewPort(n.getWin());if((C.y+C.h>L.y+L.h||C.yL.x+L.w||C.x")},mceToggleVisualAid:function(){n.hasVisual=!n.hasVisual;n.addVisual()},mceReplaceContent:function(y,x,v){n.execCommand("mceInsertContent",false,v.replace(/\{\$selection\}/g,p.getContent({format:"text"})))},mceInsertLink:function(z,y,x){var v;if(typeof(x)=="string"){x={href:x}}v=m.getParent(p.getNode(),"a");x.href=x.href.replace(" ","%20");if(!v||!x.href){q.remove("link")}if(x.href){q.apply("link",x,v)}},selectAll:function(){var x=m.getRoot(),v=m.createRng();v.setStart(x,0);v.setEnd(x,x.childNodes.length);n.selection.setRng(v)}});u({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(z){var x="align"+z.substring(7);var v=p.isCollapsed()?[m.getParent(p.getNode(),m.isBlock)]:p.getSelectedBlocks();var y=d.map(v,function(A){return !!q.matchNode(A,x)});return d.inArray(y,a)!==-1},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(v){return t(v)},mceBlockQuote:function(){return t("blockquote")},Outdent:function(){var v;if(k.inline_styles){if((v=m.getParent(p.getStart(),m.isBlock))&&parseInt(v.style.paddingLeft)>0){return a}if((v=m.getParent(p.getEnd(),m.isBlock))&&parseInt(v.style.paddingLeft)>0){return a}}return l("InsertUnorderedList")||l("InsertOrderedList")||(!k.inline_styles&&!!m.getParent(p.getNode(),"BLOCKQUOTE"))},"InsertUnorderedList,InsertOrderedList":function(v){return m.getParent(p.getNode(),v=="insertunorderedlist"?"UL":"OL")}},"state");u({"FontSize,FontName":function(y){var x=0,v;if(v=m.getParent(p.getNode(),"span")){if(y=="fontsize"){x=v.style.fontSize}else{x=v.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()}}return x}},"value");u({Undo:function(){n.undoManager.undo()},Redo:function(){n.undoManager.redo()}})}})(tinymce);(function(b){var a=b.util.Dispatcher;b.UndoManager=function(h){var l,i=0,e=[],g,k,j,f;function c(){return b.trim(h.getContent({format:"raw",no_events:1}).replace(/]+data-mce-bogus[^>]+>[\u200B\uFEFF]+<\/span>/g,""))}function d(){l.typing=false;l.add()}k=new a(l);j=new a(l);f=new a(l);k.add(function(m,n){if(m.hasUndo()){return h.onChange.dispatch(h,n,m)}});j.add(function(m,n){return h.onUndo.dispatch(h,n,m)});f.add(function(m,n){return h.onRedo.dispatch(h,n,m)});h.onInit.add(function(){l.add()});h.onBeforeExecCommand.add(function(m,p,o,q,n){if(p!="Undo"&&p!="Redo"&&p!="mceRepaint"&&(!n||!n.skip_undo)){l.beforeChange()}});h.onExecCommand.add(function(m,p,o,q,n){if(p!="Undo"&&p!="Redo"&&p!="mceRepaint"&&(!n||!n.skip_undo)){l.add()}});h.onSaveContent.add(d);h.dom.bind(h.dom.getRoot(),"dragend",d);h.dom.bind(h.getDoc(),b.isGecko?"blur":"focusout",function(m){if(!h.removed&&l.typing){d()}});h.onKeyUp.add(function(m,o){var n=o.keyCode;if((n>=33&&n<=36)||(n>=37&&n<=40)||n==45||n==13||o.ctrlKey){d()}});h.onKeyDown.add(function(m,o){var n=o.keyCode;if((n>=33&&n<=36)||(n>=37&&n<=40)||n==45){if(l.typing){d()}return}if((n<16||n>20)&&n!=224&&n!=91&&!l.typing){l.beforeChange();l.typing=true;l.add()}});h.onMouseDown.add(function(m,n){if(l.typing){d()}});h.addShortcut("ctrl+z","undo_desc","Undo");h.addShortcut("ctrl+y","redo_desc","Redo");l={data:e,typing:false,onAdd:k,onUndo:j,onRedo:f,beforeChange:function(){g=h.selection.getBookmark(2,true)},add:function(p){var m,n=h.settings,o;p=p||{};p.content=c();o=e[i];if(o&&o.content==p.content){return null}if(e[i]){e[i].beforeBookmark=g}if(n.custom_undo_redo_levels){if(e.length>n.custom_undo_redo_levels){for(m=0;m0){n=e[--i];h.setContent(n.content,{format:"raw"});h.selection.moveToBookmark(n.beforeBookmark);l.onUndo.dispatch(l,n)}return n},redo:function(){var m;if(i0||this.typing},hasRedo:function(){return i0){g.moveEnd("character",q)}g.select()}catch(n){}}if(p){c.nodeChanged()}}if(b.forced_root_block){c.onKeyUp.add(f);c.onNodeChange.add(f)}};(function(c){var b=c.DOM,a=c.dom.Event,d=c.each,e=c.extend;c.create("tinymce.ControlManager",{ControlManager:function(f,j){var h=this,g;j=j||{};h.editor=f;h.controls={};h.onAdd=new c.util.Dispatcher(h);h.onPostRender=new c.util.Dispatcher(h);h.prefix=j.prefix||f.id+"_";h._cls={};h.onPostRender.add(function(){d(h.controls,function(i){i.postRender()})})},get:function(f){return this.controls[this.prefix+f]||this.controls[f]},setActive:function(h,f){var g=null;if(g=this.get(h)){g.setActive(f)}return g},setDisabled:function(h,f){var g=null;if(g=this.get(h)){g.setDisabled(f)}return g},add:function(g){var f=this;if(g){f.controls[g.id]=g;f.onAdd.dispatch(g,f)}return g},createControl:function(i){var h,g=this,f=g.editor;d(f.plugins,function(j){if(j.createControl){h=j.createControl(i,g);if(h){return false}}});switch(i){case"|":case"separator":return g.createSeparator()}if(!h&&f.buttons&&(h=f.buttons[i])){return g.createButton(i,h)}return g.add(h)},createDropMenu:function(f,n,h){var m=this,i=m.editor,j,g,k,l;n=e({"class":"mceDropDown",constrain:i.settings.constrain_menus},n);n["class"]=n["class"]+" "+i.getParam("skin")+"Skin";if(k=i.getParam("skin_variant")){n["class"]+=" "+i.getParam("skin")+"Skin"+k.substring(0,1).toUpperCase()+k.substring(1)}n["class"]+=i.settings.directionality=="rtl"?" mceRtl":"";f=m.prefix+f;l=h||m._cls.dropmenu||c.ui.DropMenu;j=m.controls[f]=new l(f,n);j.onAddItem.add(function(r,q){var p=q.settings;p.title=i.getLang(p.title,p.title);if(!p.onclick){p.onclick=function(o){if(p.cmd){i.execCommand(p.cmd,p.ui||false,p.value)}}}});i.onRemove.add(function(){j.destroy()});if(c.isIE){j.onShowMenu.add(function(){i.focus();g=i.selection.getBookmark(1)});j.onHideMenu.add(function(){if(g){i.selection.moveToBookmark(g);g=0}})}return m.add(j)},createListBox:function(f,n,h){var l=this,j=l.editor,i,k,m;if(l.get(f)){return null}n.title=j.translate(n.title);n.scope=n.scope||j;if(!n.onselect){n.onselect=function(o){j.execCommand(n.cmd,n.ui||false,o||n.value)}}n=e({title:n.title,"class":"mce_"+f,scope:n.scope,control_manager:l},n);f=l.prefix+f;function g(o){return o.settings.use_accessible_selects&&!c.isGecko}if(j.settings.use_native_selects||g(j)){k=new c.ui.NativeListBox(f,n)}else{m=h||l._cls.listbox||c.ui.ListBox;k=new m(f,n,j)}l.controls[f]=k;if(c.isWebKit){k.onPostRender.add(function(p,o){a.add(o,"mousedown",function(){j.bookmark=j.selection.getBookmark(1)});a.add(o,"focus",function(){j.selection.moveToBookmark(j.bookmark);j.bookmark=null})})}if(k.hideMenu){j.onMouseDown.add(k.hideMenu,k)}return l.add(k)},createButton:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.label=g.translate(i.label);i.scope=i.scope||g;if(!i.onclick&&!i.menu_button){i.onclick=function(){g.execCommand(i.cmd,i.ui||false,i.value)}}i=e({title:i.title,"class":"mce_"+m,unavailable_prefix:g.getLang("unavailable",""),scope:i.scope,control_manager:h},i);m=h.prefix+m;if(i.menu_button){f=l||h._cls.menubutton||c.ui.MenuButton;k=new f(m,i,g);g.onMouseDown.add(k.hideMenu,k)}else{f=h._cls.button||c.ui.Button;k=new f(m,i,g)}return h.add(k)},createMenuButton:function(h,f,g){f=f||{};f.menu_button=1;return this.createButton(h,f,g)},createSplitButton:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.scope=i.scope||g;if(!i.onclick){i.onclick=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}if(!i.onselect){i.onselect=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}i=e({title:i.title,"class":"mce_"+m,scope:i.scope,control_manager:h},i);m=h.prefix+m;f=l||h._cls.splitbutton||c.ui.SplitButton;k=h.add(new f(m,i,g));g.onMouseDown.add(k.hideMenu,k);return k},createColorSplitButton:function(f,n,h){var l=this,j=l.editor,i,k,m,g;if(l.get(f)){return null}n.title=j.translate(n.title);n.scope=n.scope||j;if(!n.onclick){n.onclick=function(o){if(c.isIE){g=j.selection.getBookmark(1)}j.execCommand(n.cmd,n.ui||false,o||n.value)}}if(!n.onselect){n.onselect=function(o){j.execCommand(n.cmd,n.ui||false,o||n.value)}}n=e({title:n.title,"class":"mce_"+f,menu_class:j.getParam("skin")+"Skin",scope:n.scope,more_colors_title:j.getLang("more_colors")},n);f=l.prefix+f;m=h||l._cls.colorsplitbutton||c.ui.ColorSplitButton;k=new m(f,n,j);j.onMouseDown.add(k.hideMenu,k);j.onRemove.add(function(){k.destroy()});if(c.isIE){k.onShowMenu.add(function(){j.focus();g=j.selection.getBookmark(1)});k.onHideMenu.add(function(){if(g){j.selection.moveToBookmark(g);g=0}})}return l.add(k)},createToolbar:function(k,h,j){var i,g=this,f;k=g.prefix+k;f=j||g._cls.toolbar||c.ui.Toolbar;i=new f(k,h,g.editor);if(g.get(k)){return null}return g.add(i)},createToolbarGroup:function(k,h,j){var i,g=this,f;k=g.prefix+k;f=j||this._cls.toolbarGroup||c.ui.ToolbarGroup;i=new f(k,h,g.editor);if(g.get(k)){return null}return g.add(i)},createSeparator:function(g){var f=g||this._cls.separator||c.ui.Separator;return new f()},setControlType:function(g,f){return this._cls[g.toLowerCase()]=f},destroy:function(){d(this.controls,function(f){f.destroy()});this.controls=null}})})(tinymce);(function(d){var a=d.util.Dispatcher,e=d.each,c=d.isIE,b=d.isOpera;d.create("tinymce.WindowManager",{WindowManager:function(f){var g=this;g.editor=f;g.onOpen=new a(g);g.onClose=new a(g);g.params={};g.features={}},open:function(z,h){var v=this,k="",n,m,i=v.editor.settings.dialog_type=="modal",q,o,j,g=d.DOM.getViewPort(),r;z=z||{};h=h||{};o=b?g.w:screen.width;j=b?g.h:screen.height;z.name=z.name||"mc_"+new Date().getTime();z.width=parseInt(z.width||320);z.height=parseInt(z.height||240);z.resizable=true;z.left=z.left||parseInt(o/2)-(z.width/2);z.top=z.top||parseInt(j/2)-(z.height/2);h.inline=false;h.mce_width=z.width;h.mce_height=z.height;h.mce_auto_focus=z.auto_focus;if(i){if(c){z.center=true;z.help=false;z.dialogWidth=z.width+"px";z.dialogHeight=z.height+"px";z.scroll=z.scrollbars||false}}e(z,function(p,f){if(d.is(p,"boolean")){p=p?"yes":"no"}if(!/^(name|url)$/.test(f)){if(c&&i){k+=(k?";":"")+f+":"+p}else{k+=(k?",":"")+f+"="+p}}});v.features=z;v.params=h;v.onOpen.dispatch(v,z,h);r=z.url||z.file;r=d._addVer(r);try{if(c&&i){q=1;window.showModalDialog(r,window,k)}else{q=window.open(r,z.name,k)}}catch(l){}if(!q){alert(v.editor.getLang("popup_blocked"))}},close:function(f){f.close();this.onClose.dispatch(this)},createInstance:function(i,h,g,m,l,k){var j=d.resolve(i);return new j(h,g,m,l,k)},confirm:function(h,f,i,g){g=g||window;f.call(i||this,g.confirm(this._decode(this.editor.getLang(h,h))))},alert:function(h,f,j,g){var i=this;g=g||window;g.alert(i._decode(i.editor.getLang(h,h)));if(f){f.call(j||i)}},resizeBy:function(f,g,h){h.resizeBy(f,g)},_decode:function(f){return d.DOM.decode(f).replace(/\\n/g,"\n")}})}(tinymce));(function(a){a.Formatter=function(Y){var O={},R=a.each,c=Y.dom,r=Y.selection,t=a.dom.TreeWalker,M=new a.dom.RangeUtils(c),d=Y.schema.isValidChild,H=c.isBlock,m=Y.settings.forced_root_block,s=c.nodeIndex,G=a.isGecko?"\u200B":"\uFEFF",e=/^(src|href|style)$/,V=false,C=true,D,x=c.getContentEditable;function A(Z){return Z instanceof Array}function n(aa,Z){return c.getParents(aa,Z,c.getRoot())}function b(Z){return Z.nodeType===1&&Z.id==="_mce_caret"}function j(){l({alignleft:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"left"},defaultBlock:"div"},{selector:"img,table",collapsed:false,styles:{"float":"left"}}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"center"},defaultBlock:"div"},{selector:"img",collapsed:false,styles:{display:"block",marginLeft:"auto",marginRight:"auto"}},{selector:"table",collapsed:false,styles:{marginLeft:"auto",marginRight:"auto"}}],alignright:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"right"},defaultBlock:"div"},{selector:"img,table",collapsed:false,styles:{"float":"right"}}],alignfull:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"justify"},defaultBlock:"div"}],bold:[{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all"}],italic:[{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all"}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:true},{inline:"u",remove:"all"}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:true},{inline:"strike",remove:"all"}],forecolor:{inline:"span",styles:{color:"%value"},wrap_links:false},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},wrap_links:false},fontname:{inline:"span",styles:{fontFamily:"%value"}},fontsize:{inline:"span",styles:{fontSize:"%value"}},fontsize_class:{inline:"span",attributes:{"class":"%value"}},blockquote:{block:"blockquote",wrapper:1,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},link:{inline:"a",selector:"a",remove:"all",split:true,deep:true,onmatch:function(Z){return true},onformat:function(ab,Z,aa){R(aa,function(ad,ac){c.setAttrib(ab,ac,ad)})}},removeformat:[{selector:"b,strong,em,i,font,u,strike",remove:"all",split:true,expand:false,block_expand:true,deep:true},{selector:"span",attributes:["style","class"],remove:"empty",split:true,expand:false,deep:true},{selector:"*",attributes:["style","class"],split:false,expand:false,deep:true}]});R("p h1 h2 h3 h4 h5 h6 div address pre div code dt dd samp".split(/\s/),function(Z){l(Z,{block:Z,remove:"all"})});l(Y.settings.formats)}function U(){Y.addShortcut("ctrl+b","bold_desc","Bold");Y.addShortcut("ctrl+i","italic_desc","Italic");Y.addShortcut("ctrl+u","underline_desc","Underline");for(var Z=1;Z<=6;Z++){Y.addShortcut("ctrl+"+Z,"",["FormatBlock",false,"h"+Z])}Y.addShortcut("ctrl+7","",["FormatBlock",false,"p"]);Y.addShortcut("ctrl+8","",["FormatBlock",false,"div"]);Y.addShortcut("ctrl+9","",["FormatBlock",false,"address"])}function T(Z){return Z?O[Z]:O}function l(Z,aa){if(Z){if(typeof(Z)!=="string"){R(Z,function(ac,ab){l(ab,ac)})}else{aa=aa.length?aa:[aa];R(aa,function(ab){if(ab.deep===D){ab.deep=!ab.selector}if(ab.split===D){ab.split=!ab.selector||ab.inline}if(ab.remove===D&&ab.selector&&!ab.inline){ab.remove="none"}if(ab.selector&&ab.inline){ab.mixed=true;ab.block_expand=true}if(typeof(ab.classes)==="string"){ab.classes=ab.classes.split(/\s+/)}});O[Z]=aa}}}var i=function(aa){var Z;Y.dom.getParent(aa,function(ab){Z=Y.dom.getStyle(ab,"text-decoration");return Z&&Z!=="none"});return Z};var K=function(Z){var aa;if(Z.nodeType===1&&Z.parentNode&&Z.parentNode.nodeType===1){aa=i(Z.parentNode);if(Y.dom.getStyle(Z,"color")&&aa){Y.dom.setStyle(Z,"text-decoration",aa)}else{if(Y.dom.getStyle(Z,"textdecoration")===aa){Y.dom.setStyle(Z,"text-decoration",null)}}}};function W(ac,aj,ae){var af=T(ac),ak=af[0],ai,aa,ah,ag=r.isCollapsed();function Z(ao,an){an=an||ak;if(ao){if(an.onformat){an.onformat(ao,an,aj,ae)}R(an.styles,function(aq,ap){c.setStyle(ao,ap,q(aq,aj))});R(an.attributes,function(aq,ap){c.setAttrib(ao,ap,q(aq,aj))});R(an.classes,function(ap){ap=q(ap,aj);if(!c.hasClass(ao,ap)){c.addClass(ao,ap)}})}}function ad(){function ap(aw,au){var av=new t(au);for(ae=av.current();ae;ae=av.prev()){if(ae.childNodes.length>1||ae==aw||ae.tagName=="BR"){return ae}}}var ao=Y.selection.getRng();var at=ao.startContainer;var an=ao.endContainer;if(at!=an&&ao.endOffset===0){var ar=ap(at,an);var aq=ar.nodeType==3?ar.length:ar.childNodes.length;ao.setEnd(ar,aq)}return ao}function ab(aq,aw,au,at,ao){var an=[],ap=-1,av,ay=-1,ar=-1,ax;R(aq.childNodes,function(aA,az){if(aA.nodeName==="UL"||aA.nodeName==="OL"){ap=az;av=aA;return false}});R(aq.childNodes,function(aA,az){if(aA.nodeName==="SPAN"&&c.getAttrib(aA,"data-mce-type")=="bookmark"){if(aA.id==aw.id+"_start"){ay=az}else{if(aA.id==aw.id+"_end"){ar=az}}}});if(ap<=0||(ayap)){R(a.grep(aq.childNodes),ao);return 0}else{ax=c.clone(au,V);R(a.grep(aq.childNodes),function(aA,az){if((ayap&&az>ap)){an.push(aA);aA.parentNode.removeChild(aA)}});if(ayap){aq.insertBefore(ax,av.nextSibling)}}at.push(ax);R(an,function(az){ax.appendChild(az)});return ax}}function al(ao,aq,au){var an=[],at,ap,ar=true;at=ak.inline||ak.block;ap=c.create(at);Z(ap);M.walk(ao,function(av){var aw;function ax(ay){var aD,aB,az,aA,aC;aC=ar;aD=ay.nodeName.toLowerCase();aB=ay.parentNode.nodeName.toLowerCase();if(ay.nodeType===1&&x(ay)){aC=ar;ar=x(ay)==="true";aA=true}if(g(aD,"br")){aw=0;if(ak.block){c.remove(ay)}return}if(ak.wrapper&&y(ay,ac,aj)){aw=0;return}if(ar&&!aA&&ak.block&&!ak.wrapper&&I(aD)){ay=c.rename(ay,at);Z(ay);an.push(ay);aw=0;return}if(ak.selector){R(af,function(aE){if("collapsed" in aE&&aE.collapsed!==ag){return}if(c.is(ay,aE.selector)&&!b(ay)){Z(ay,aE);az=true}});if(!ak.inline||az){aw=0;return}}if(ar&&!aA&&d(at,aD)&&d(aB,at)&&!(!au&&ay.nodeType===3&&ay.nodeValue.length===1&&ay.nodeValue.charCodeAt(0)===65279)&&!b(ay)){if(!aw){aw=c.clone(ap,V);ay.parentNode.insertBefore(aw,ay);an.push(aw)}aw.appendChild(ay)}else{if(aD=="li"&&aq){aw=ab(ay,aq,ap,an,ax)}else{aw=0;R(a.grep(ay.childNodes),ax);if(aA){ar=aC}aw=0}}}R(av,ax)});if(ak.wrap_links===false){R(an,function(av){function aw(aA){var az,ay,ax;if(aA.nodeName==="A"){ay=c.clone(ap,V);an.push(ay);ax=a.grep(aA.childNodes);for(az=0;az1||!H(ax))&&av===0){c.remove(ax,1);return}if(ak.inline||ak.wrapper){if(!ak.exact&&av===1){ax=aw(ax)}R(af,function(az){R(c.select(az.inline,ax),function(aB){var aA;if(az.wrap_links===false){aA=aB.parentNode;do{if(aA.nodeName==="A"){return}}while(aA=aA.parentNode)}X(az,aj,aB,az.exact?aB:null)})});if(y(ax.parentNode,ac,aj)){c.remove(ax,1);ax=0;return C}if(ak.merge_with_parents){c.getParent(ax.parentNode,function(az){if(y(az,ac,aj)){c.remove(ax,1);ax=0;return C}})}if(ax&&ak.merge_siblings!==false){ax=u(E(ax),ax);ax=u(ax,E(ax,C))}}})}if(ak){if(ae){if(ae.nodeType){aa=c.createRng();aa.setStartBefore(ae);aa.setEndAfter(ae);al(p(aa,af),null,true)}else{al(ae,null,true)}}else{if(!ag||!ak.inline||c.select("td.mceSelected,th.mceSelected").length){var am=Y.selection.getNode();if(!m&&af[0].defaultBlock&&!c.getParent(am,c.isBlock)){W(af[0].defaultBlock)}Y.selection.setRng(ad());ai=r.getBookmark();al(p(r.getRng(C),af),ai);if(ak.styles&&(ak.styles.color||ak.styles.textDecoration)){a.walk(am,K,"childNodes");K(am)}r.moveToBookmark(ai);P(r.getRng(C));Y.nodeChanged()}else{S("apply",ac,aj)}}}}function B(ab,ak,ad){var ae=T(ab),am=ae[0],ai,ah,aa,aj=true;function ac(at){var ar,aq,ap,ao,av,au;if(at.nodeType===1&&x(at)){av=aj;aj=x(at)==="true";au=true}ar=a.grep(at.childNodes);if(aj&&!au){for(aq=0,ap=ae.length;aq=0;aa--){Z=af[aa].selector;if(!Z){return C}for(ae=ab.length-1;ae>=0;ae--){if(c.is(ab[ae],Z)){return C}}}}return V}a.extend(this,{get:T,register:l,apply:W,remove:B,toggle:F,match:k,matchAll:v,matchNode:y,canApply:z});j();U();function h(Z,aa){if(g(Z,aa.inline)){return C}if(g(Z,aa.block)){return C}if(aa.selector){return c.is(Z,aa.selector)}}function g(aa,Z){aa=aa||"";Z=Z||"";aa=""+(aa.nodeName||aa);Z=""+(Z.nodeName||Z);return aa.toLowerCase()==Z.toLowerCase()}function N(aa,Z){var ab=c.getStyle(aa,Z);if(Z=="color"||Z=="backgroundColor"){ab=c.toHex(ab)}if(Z=="fontWeight"&&ab==700){ab="bold"}return""+ab}function q(Z,aa){if(typeof(Z)!="string"){Z=Z(aa)}else{if(aa){Z=Z.replace(/%(\w+)/g,function(ac,ab){return aa[ab]||ac})}}return Z}function f(Z){return Z&&Z.nodeType===3&&/^([\t \r\n]+|)$/.test(Z.nodeValue)}function Q(ab,aa,Z){var ac=c.create(aa,Z);ab.parentNode.insertBefore(ac,ab);ac.appendChild(ab);return ac}function p(Z,ak,ac){var an,al,af,aj,ab=Z.startContainer,ag=Z.startOffset,ap=Z.endContainer,ai=Z.endOffset;function am(ax){var ar,av,aw,au,at,aq;ar=av=ax?ab:ap;at=ax?"previousSibling":"nextSibling";aq=c.getRoot();if(ar.nodeType==3&&!f(ar)){if(ax?ag>0:aial?al:ag];if(ab.nodeType==3){ag=0}}if(ap.nodeType==1&&ap.hasChildNodes()){al=ap.childNodes.length-1;ap=ap.childNodes[ai>al?al:ai-1];if(ap.nodeType==3){ai=ap.nodeValue.length}}function ao(ar){var aq=ar;while(aq){if(aq.nodeType===1&&x(aq)){return x(aq)==="false"?aq:ar}aq=aq.parentNode}return ar}function ah(ar,aw,ay){var av,at,ax,aq;function au(aA,aC){var aD,az,aB=aA.nodeValue;if(typeof(aC)=="undefined"){aC=ay?aB.length:0}if(ay){aD=aB.lastIndexOf(" ",aC);az=aB.lastIndexOf("\u00a0",aC);aD=aD>az?aD:az;if(aD!==-1&&!ac){aD++}}else{aD=aB.indexOf(" ",aC);az=aB.indexOf("\u00a0",aC);aD=aD!==-1&&(az===-1||aD0&&af.node.nodeType===3&&af.node.nodeValue.charAt(af.offset-1)===" "){if(af.offset>1){ap=af.node;ap.splitText(af.offset-1)}}}}if(ak[0].inline||ak[0].block_expand){if(!ak[0].inline||(ab.nodeType!=3||ag===0)){ab=am(true)}if(!ak[0].inline||(ap.nodeType!=3||ai===ap.nodeValue.length)){ap=am()}}if(ak[0].selector&&ak[0].expand!==V&&!ak[0].inline){ab=ad(ab,"previousSibling");ap=ad(ap,"nextSibling")}if(ak[0].block||ak[0].selector){ab=aa(ab,"previousSibling");ap=aa(ap,"nextSibling");if(ak[0].block){if(!H(ab)){ab=am(true)}if(!H(ap)){ap=am()}}}if(ab.nodeType==1){ag=s(ab);ab=ab.parentNode}if(ap.nodeType==1){ai=s(ap)+1;ap=ap.parentNode}return{startContainer:ab,startOffset:ag,endContainer:ap,endOffset:ai}}function X(af,ae,ac,Z){var ab,aa,ad;if(!h(ac,af)){return V}if(af.remove!="all"){R(af.styles,function(ah,ag){ah=q(ah,ae);if(typeof(ag)==="number"){ag=ah;Z=0}if(!Z||g(N(Z,ag),ah)){c.setStyle(ac,ag,"")}ad=1});if(ad&&c.getAttrib(ac,"style")==""){ac.removeAttribute("style");ac.removeAttribute("data-mce-style")}R(af.attributes,function(ai,ag){var ah;ai=q(ai,ae);if(typeof(ag)==="number"){ag=ai;Z=0}if(!Z||g(c.getAttrib(Z,ag),ai)){if(ag=="class"){ai=c.getAttrib(ac,ag);if(ai){ah="";R(ai.split(/\s+/),function(aj){if(/mce\w+/.test(aj)){ah+=(ah?" ":"")+aj}});if(ah){c.setAttrib(ac,ag,ah);return}}}if(ag=="class"){ac.removeAttribute("className")}if(e.test(ag)){ac.removeAttribute("data-mce-"+ag)}ac.removeAttribute(ag)}});R(af.classes,function(ag){ag=q(ag,ae);if(!Z||c.hasClass(Z,ag)){c.removeClass(ac,ag)}});aa=c.getAttribs(ac);for(ab=0;abab?ab:ad]}if(Z.nodeType===3&&ae&&ad>=Z.nodeValue.length){Z=new t(Z,Y.getBody()).next()||Z}if(Z.nodeType===3&&!ae&&ad===0){Z=new t(Z,Y.getBody()).prev()||Z}return Z}function S(ai,Z,ag){var aj="_mce_caret",aa=Y.settings.caret_debug;function ab(am){var al=c.create("span",{id:aj,"data-mce-bogus":true,style:aa?"color:red":""});if(am){al.appendChild(Y.getDoc().createTextNode(G))}return al}function ah(am,al){while(am){if((am.nodeType===3&&am.nodeValue!==G)||am.childNodes.length>1){return false}if(al&&am.nodeType===1){al.push(am)}am=am.firstChild}return true}function ae(al){while(al){if(al.id===aj){return al}al=al.parentNode}}function ad(al){var am;if(al){am=new t(al,al);for(al=am.current();al;al=am.next()){if(al.nodeType===3){return al}}}}function ac(an,am){var ao,al;if(!an){an=ae(r.getStart());if(!an){while(an=c.get(aj)){ac(an,false)}}}else{al=r.getRng(true);if(ah(an)){if(am!==false){al.setStartBefore(an);al.setEndBefore(an)}c.remove(an)}else{ao=ad(an);if(ao.nodeValue.charAt(0)===G){ao=ao.deleteData(0,1)}c.remove(an,1)}r.setRng(al)}}function af(){var an,al,ar,aq,ao,am,ap;an=r.getRng(true);aq=an.startOffset;am=an.startContainer;ap=am.nodeValue;al=ae(r.getStart());if(al){ar=ad(al)}if(ap&&aq>0&&aq=0;ap--){an.appendChild(c.clone(au[ap],false));an=an.firstChild}an.appendChild(c.doc.createTextNode(G));an=an.firstChild;c.insertAfter(at,av);r.setCursorLocation(an,1)}}if(!self._hasCaretEvents){Y.onBeforeGetContent.addToTop(function(){var al=[],am;if(ah(ae(r.getStart()),al)){am=al.length;while(am--){c.setAttrib(al[am],"data-mce-bogus","1")}}});a.each("onMouseUp onKeyUp".split(" "),function(al){Y[al].addToTop(function(){ac()})});Y.onKeyDown.addToTop(function(al,an){var am=an.keyCode;if(am==8||am==37||am==39){ac(ae(r.getStart()))}});r.onSetContent.add(function(){c.getParent(r.getStart(),function(al){if(al.id!==aj&&c.getAttrib(al,"data-mce-bogus")&&!c.isEmpty(al)){c.setAttrib(al,"data-mce-bogus",null)}})});self._hasCaretEvents=true}if(ai=="apply"){af()}else{ak()}}function P(aa){var Z=aa.startContainer,ag=aa.startOffset,ac,af,ae,ab,ad;if(Z.nodeType==3&&ag>=Z.nodeValue.length){ag=s(Z);Z=Z.parentNode;ac=true}if(Z.nodeType==1){ab=Z.childNodes;Z=ab[Math.min(ag,ab.length-1)];af=new t(Z,c.getParent(Z,c.isBlock));if(ag>ab.length-1||ac){af.next()}for(ae=af.current();ae;ae=af.next()){if(ae.nodeType==3&&!f(ae)){ad=c.create("a",null,G);ae.parentNode.insertBefore(ad,ae);aa.setStart(ae,0);r.setRng(aa);c.remove(ad);return}}}}}})(tinymce);tinymce.onAddEditor.add(function(e,a){var d,h,g,c=a.settings;function b(j,i){e.each(i,function(l,k){if(l){g.setStyle(j,k,l)}});g.rename(j,"span")}function f(i,j){g=i.dom;if(c.convert_fonts_to_spans){e.each(g.select("font,u,strike",j.node),function(k){d[k.nodeName.toLowerCase()](a.dom,k)})}}if(c.inline_styles){h=e.explode(c.font_size_legacy_values);d={font:function(j,i){b(i,{backgroundColor:i.style.backgroundColor,color:i.color,fontFamily:i.face,fontSize:h[parseInt(i.size,10)-1]})},u:function(j,i){b(i,{textDecoration:"underline"})},strike:function(j,i){b(i,{textDecoration:"line-through"})}};a.onPreProcess.add(f);a.onSetContent.add(f);a.onInit.add(function(){a.selection.onSetContent.add(f)})}});(function(b){var a=b.dom.TreeWalker;b.EnterKey=function(e){var h=e.dom,d=e.selection,c=e.settings,g=e.undoManager;function f(y){var u=d.getRng(true),C,i,x,t,o,H,n,j,l,s,E,v,z;function B(I){return I&&h.isBlock(I)&&!/^(TD|TH|CAPTION)$/.test(I.nodeName)&&!/^(fixed|absolute)/i.test(I.style.position)&&h.getContentEditable(I)!=="true"}function m(J){var O,M,I,P,N,L=J,K;I=h.createRng();if(J.hasChildNodes()){O=new a(J,J);while(M=O.current()){if(M.nodeType==3){I.setStart(M,0);I.setEnd(M,0);break}if(/^(BR|IMG)$/.test(M.nodeName)){I.setStartBefore(M);I.setEndBefore(M);break}L=M;M=O.next()}if(!M){I.setStart(L,0);I.setEnd(L,0)}}else{if(J.nodeName=="BR"){if(J.nextSibling&&h.isBlock(J.nextSibling)){if(!H||H<9){K=h.create("br");J.parentNode.insertBefore(K,J)}I.setStartBefore(J);I.setEndBefore(J)}else{I.setStartAfter(J);I.setEndAfter(J)}}else{I.setStart(J,0);I.setEnd(J,0)}}d.setRng(I);h.remove(K);N=h.getViewPort(e.getWin());P=h.getPos(J).y;if(PN.y+N.h){e.getWin().scrollTo(0,P"}return M}function p(L){var K,J,I;if(x.nodeType==3&&(L?t>0:t=x.nodeValue.length){if(!b.isIE&&!A()){J=h.create("br");u.insertNode(J);u.setStartAfter(J);u.setEndAfter(J);I=true}}J=h.create("br");u.insertNode(J);if(b.isIE&&s=="PRE"&&(!H||H<8)){J.parentNode.insertBefore(h.doc.createTextNode("\r"),J)}if(!I){u.setStartAfter(J);u.setEndAfter(J)}else{u.setStartBefore(J);u.setEndBefore(J)}d.setRng(u);g.add()}function r(I){do{if(I.nodeType===3){I.nodeValue=I.nodeValue.replace(/^[\r\n]+/,"")}I=I.firstChild}while(I)}function F(K){var I=h.getRoot(),J,L;J=K;while(J!==I&&h.getContentEditable(J)!=="false"){if(h.getContentEditable(J)==="true"){L=J}J=J.parentNode}return J!==I?L:I}if(!u.collapsed){e.execCommand("Delete");return}if(y.isDefaultPrevented()){return}x=u.startContainer;t=u.startOffset;v=c.forced_root_block;v=v?v.toUpperCase():"";H=h.doc.documentMode;if(x.nodeType==1&&x.hasChildNodes()){z=t>x.childNodes.length-1;x=x.childNodes[Math.min(t,x.childNodes.length-1)]||x;t=0}i=F(x);if(!i){return}g.beforeChange();if(!h.isBlock(i)&&i!=h.getRoot()){if(!v||y.shiftKey){G()}return}if((v&&!y.shiftKey)||(!v&&y.shiftKey)){x=k(x,t)}o=h.getParent(x,h.isBlock);l=o?h.getParent(o.parentNode,h.isBlock):null;s=o?o.nodeName.toUpperCase():"";E=l?l.nodeName.toUpperCase():"";if(s=="LI"&&h.isEmpty(o)){if(/^(UL|OL|LI)$/.test(l.parentNode.nodeName)){return false}D();return}if(s=="PRE"&&c.br_in_pre!==false){if(!y.shiftKey){G();return}}else{if((!v&&!y.shiftKey&&s!="LI")||(v&&y.shiftKey)){G();return}}v=v||"P";if(p()){if(/^(H[1-6]|PRE)$/.test(s)&&E!="HGROUP"){n=q(v)}else{n=q()}if(c.end_container_on_empty_block&&B(l)&&h.isEmpty(o)){n=h.split(l,o)}else{h.insertAfter(n,o)}}else{if(p(true)){n=o.parentNode.insertBefore(q(),o)}else{C=u.cloneRange();C.setEndAfter(o);j=C.extractContents();r(j);n=j.firstChild;h.insertAfter(j,o)}}h.setAttrib(n,"id","");m(n);g.add()}e.onKeyDown.add(function(j,i){if(i.keyCode==13){if(f(i)!==false){i.preventDefault()}}})}})(tinymce); \ No newline at end of file diff --git a/lib/editor/tinymce/tiny_mce/3.5/tiny_mce_jquery.js b/lib/editor/tinymce/tiny_mce/3.5/tiny_mce_jquery.js deleted file mode 100644 index d89e5f3de08..00000000000 --- a/lib/editor/tinymce/tiny_mce/3.5/tiny_mce_jquery.js +++ /dev/null @@ -1 +0,0 @@ -(function(e){var a=/^\s*|\s*$/g,b,d="B".replace(/A(.)|B/,"$1")==="$1";var c={majorVersion:"@@tinymce_major_version@@",minorVersion:"@@tinymce_minor_version@@",releaseDate:"@@tinymce_release_date@@",_init:function(){var s=this,q=document,o=navigator,g=o.userAgent,m,f,l,k,j,r;s.isOpera=e.opera&&opera.buildNumber;s.isWebKit=/WebKit/.test(g);s.isIE=!s.isWebKit&&!s.isOpera&&(/MSIE/gi).test(g)&&(/Explorer/gi).test(o.appName);s.isIE6=s.isIE&&/MSIE [56]/.test(g);s.isIE7=s.isIE&&/MSIE [7]/.test(g);s.isIE8=s.isIE&&/MSIE [8]/.test(g);s.isIE9=s.isIE&&/MSIE [9]/.test(g);s.isGecko=!s.isWebKit&&/Gecko/.test(g);s.isMac=g.indexOf("Mac")!=-1;s.isAir=/adobeair/i.test(g);s.isIDevice=/(iPad|iPhone)/.test(g);s.isIOS5=s.isIDevice&&g.match(/AppleWebKit\/(\d*)/)[1]>=534;if(e.tinyMCEPreInit){s.suffix=tinyMCEPreInit.suffix;s.baseURL=tinyMCEPreInit.base;s.query=tinyMCEPreInit.query;return}s.suffix="";f=q.getElementsByTagName("base");for(m=0;m0?b:[f.scope]);if(e===false){break}}a.inDispatch=false;return e}});(function(){var a=tinymce.each;tinymce.create("tinymce.util.URI",{URI:function(e,g){var f=this,i,d,c,h;e=tinymce.trim(e);g=f.settings=g||{};if(/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e)){f.source=e;return}if(e.indexOf("/")===0&&e.indexOf("//")!==0){e=(g.base_uri?g.base_uri.protocol||"http":"http")+"://mce_host"+e}if(!/^[\w\-]*:?\/\//.test(e)){h=g.base_uri?g.base_uri.path:new tinymce.util.URI(location.href).directory;e=((g.base_uri&&g.base_uri.protocol)||"http")+"://mce_host"+f.toAbsPath(h,e)}e=e.replace(/@@/g,"(mce_at)");e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);a(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(b,j){var k=e[j];if(k){k=k.replace(/\(mce_at\)/g,"@@")}f[b]=k});c=g.base_uri;if(c){if(!f.protocol){f.protocol=c.protocol}if(!f.userInfo){f.userInfo=c.userInfo}if(!f.port&&f.host==="mce_host"){f.port=c.port}if(!f.host||f.host==="mce_host"){f.host=c.host}f.source=""}},setPath:function(c){var b=this;c=/^(.*?)\/?(\w+)?$/.exec(c);b.path=c[0];b.directory=c[1];b.file=c[2];b.source="";b.getURI()},toRelative:function(b){var d=this,f;if(b==="./"){return b}b=new tinymce.util.URI(b,{base_uri:d});if((b.host!="mce_host"&&d.host!=b.host&&b.host)||d.port!=b.port||d.protocol!=b.protocol){return b.getURI()}var c=d.getURI(),e=b.getURI();if(c==e||(c.charAt(c.length-1)=="/"&&c.substr(0,c.length-1)==e)){return c}f=d.toRelPath(d.path,b.path);if(b.query){f+="?"+b.query}if(b.anchor){f+="#"+b.anchor}return f},toAbsolute:function(b,c){b=new tinymce.util.URI(b,{base_uri:this});return b.getURI(this.host==b.host&&this.protocol==b.protocol?c:0)},toRelPath:function(g,h){var c,f=0,d="",e,b;g=g.substring(0,g.lastIndexOf("/"));g=g.split("/");c=h.split("/");if(g.length>=c.length){for(e=0,b=g.length;e=c.length||g[e]!=c[e]){f=e+1;break}}}if(g.length=g.length||g[e]!=c[e]){f=e+1;break}}}if(f===1){return h}for(e=0,b=g.length-(f-1);e=0;c--){if(f[c].length===0||f[c]==="."){continue}if(f[c]===".."){b++;continue}if(b>0){b--;continue}h.push(f[c])}c=e.length-b;if(c<=0){g=h.reverse().join("/")}else{g=e.slice(0,c).join("/")+"/"+h.reverse().join("/")}if(g.indexOf("/")!==0){g="/"+g}if(d&&g.lastIndexOf("/")!==g.length-1){g+=d}return g},getURI:function(d){var c,b=this;if(!b.source||d){c="";if(!d){if(b.protocol){c+=b.protocol+"://"}if(b.userInfo){c+=b.userInfo+"@"}if(b.host){c+=b.host}if(b.port){c+=":"+b.port}}if(b.path){c+=b.path}if(b.query){c+="?"+b.query}if(b.anchor){c+="#"+b.anchor}b.source=c}return b.source}})})();(function(){var a=tinymce.each;tinymce.create("static tinymce.util.Cookie",{getHash:function(d){var b=this.get(d),c;if(b){a(b.split("&"),function(e){e=e.split("=");c=c||{};c[unescape(e[0])]=unescape(e[1])})}return c},setHash:function(j,b,g,f,i,c){var h="";a(b,function(e,d){h+=(!h?"":"&")+escape(d)+"="+escape(e)});this.set(j,h,g,f,i,c)},get:function(i){var h=document.cookie,g,f=i+"=",d;if(!h){return}d=h.indexOf("; "+f);if(d==-1){d=h.indexOf(f);if(d!==0){return null}}else{d+=2}g=h.indexOf(";",d);if(g==-1){g=h.length}return unescape(h.substring(d+f.length,g))},set:function(i,b,g,f,h,c){document.cookie=i+"="+escape(b)+((g)?"; expires="+g.toGMTString():"")+((f)?"; path="+escape(f):"")+((h)?"; domain="+h:"")+((c)?"; secure":"")},remove:function(e,b){var c=new Date();c.setTime(c.getTime()-1000);this.set(e,"",c,b,c)}})})();(function(){function serialize(o,quote){var i,v,t,name;quote=quote||'"';if(o==null){return"null"}t=typeof o;if(t=="string"){v="\bb\tt\nn\ff\rr\"\"''\\\\";return quote+o.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(a,b){if(quote==='"'&&a==="'"){return a}i=v.indexOf(b);if(i+1){return"\\"+v.charAt(i+1)}a=b.charCodeAt().toString(16);return"\\u"+"0000".substring(a.length)+a})+quote}if(t=="object"){if(o.hasOwnProperty&&o instanceof Array){for(i=0,v="[";i0?",":"")+serialize(o[i],quote)}return v+"]"}v="{";for(name in o){if(o.hasOwnProperty(name)){v+=typeof o[name]!="function"?(v.length>1?","+quote:quote)+name+quote+":"+serialize(o[name],quote):""}}return v+"}"}return""+o}tinymce.util.JSON={serialize:serialize,parse:function(s){try{return eval("("+s+")")}catch(ex){}}}})();tinymce.create("static tinymce.util.XHR",{send:function(g){var a,e,b=window,h=0;function f(){if(!g.async||a.readyState==4||h++>10000){if(g.success&&h<10000&&a.status==200){g.success.call(g.success_scope,""+a.responseText,a,g)}else{if(g.error){g.error.call(g.error_scope,h>10000?"TIMED_OUT":"GENERAL",a,g)}}a=null}else{b.setTimeout(f,10)}}g.scope=g.scope||this;g.success_scope=g.success_scope||g.scope;g.error_scope=g.error_scope||g.scope;g.async=g.async===false?false:true;g.data=g.data||"";function d(i){a=0;try{a=new ActiveXObject(i)}catch(c){}return a}a=b.XMLHttpRequest?new XMLHttpRequest():d("Microsoft.XMLHTTP")||d("Msxml2.XMLHTTP");if(a){if(a.overrideMimeType){a.overrideMimeType(g.content_type)}a.open(g.type||(g.data?"POST":"GET"),g.url,g.async);if(g.content_type){a.setRequestHeader("Content-Type",g.content_type)}a.setRequestHeader("X-Requested-With","XMLHttpRequest");a.send(g.data);if(!g.async){return f()}e=b.setTimeout(f,10)}}});(function(){var c=tinymce.extend,b=tinymce.util.JSON,a=tinymce.util.XHR;tinymce.create("tinymce.util.JSONRequest",{JSONRequest:function(d){this.settings=c({},d);this.count=0},send:function(f){var e=f.error,d=f.success;f=c(this.settings,f);f.success=function(h,g){h=b.parse(h);if(typeof(h)=="undefined"){h={error:"JSON Parse error."}}if(h.error){e.call(f.error_scope||f.scope,h.error,g)}else{d.call(f.success_scope||f.scope,h.result)}};f.error=function(h,g){if(e){e.call(f.error_scope||f.scope,h,g)}};f.data=b.serialize({id:f.id||"c"+(this.count++),method:f.method,params:f.params});f.content_type="application/json";a.send(f)},"static":{sendRPC:function(d){return new tinymce.util.JSONRequest().send(d)}}})}());(function(a){a.VK={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,modifierPressed:function(b){return b.shiftKey||b.ctrlKey||b.altKey}}})(tinymce);tinymce.util.Quirks=function(d){var l=tinymce.VK,r=l.BACKSPACE,s=l.DELETE,o=d.dom,z=d.selection,q=d.settings;function c(D,C){try{d.getDoc().execCommand(D,false,C)}catch(B){}}function h(){function B(E){var C,G,D,F;C=z.getRng();G=o.getParent(C.startContainer,o.isBlock);if(E){G=o.getNext(G,o.isBlock)}if(G){D=G.firstChild;while(D&&D.nodeType==3&&D.nodeValue.length===0){D=D.nextSibling}if(D&&D.nodeName==="SPAN"){F=D.cloneNode(false)}}d.getDoc().execCommand(E?"ForwardDelete":"Delete",false,null);G=o.getParent(C.startContainer,o.isBlock);tinymce.each(o.select("span.Apple-style-span,font.Apple-style-span",G),function(H){var I=z.getBookmark();if(F){o.replace(F.cloneNode(false),H,true)}else{o.remove(H,true)}z.moveToBookmark(I)})}d.onKeyDown.add(function(C,E){var D;D=E.keyCode==s;if(!E.isDefaultPrevented()&&(D||E.keyCode==r)&&!l.modifierPressed(E)){E.preventDefault();B(D)}});d.addCommand("Delete",function(){B()})}function A(){function C(E,H){var D,G,F=H?"start":"end";D=E[F+"Container"];G=E[F+"Offset"];if(D.nodeType==1&&D.hasChildNodes()){D=D.childNodes[Math.min(H?G:(G>0?G-1:0),D.childNodes.length-1)]}return D}function B(G,K){var F,J,E,H,I=K?"start":"end",D;F=G[I+"Container"];J=G[I+"Offset"];E=o.getRoot();if(F.nodeType==1){D=J>=F.childNodes.length;F=C(G,K);if(F.nodeType==3){J=K&&!D?0:F.nodeValue.length}}if(F.nodeType==3&&((K&&J>0)||(!K&&J7){return}c("RespectVisibilityInDesign",true);o.addClass(d.getBody(),"mceHideBrInPre");d.parser.addNodeFilter("pre",function(C,E){var F=C.length,H,D,I,G;while(F--){H=C[F].getAll("br");D=H.length;while(D--){I=H[D];G=I.prev;if(G&&G.type===3&&G.value.charAt(G.value-1)!="\n"){G.value+="\n"}else{I.parent.insert(new tinymce.html.Node("#text",3),I,true).value="\n"}}}});d.serializer.addNodeFilter("pre",function(C,E){var F=C.length,H,D,I,G;while(F--){H=C[F].getAll("br");D=H.length;while(D--){I=H[D];G=I.prev;if(G&&G.type==3){G.value=G.value.replace(/\r?\n$/,"")}}}})}function f(){o.bind(d.getBody(),"mouseup",function(D){var C,B=z.getNode();if(B.nodeName=="IMG"){if(C=o.getStyle(B,"width")){o.setAttrib(B,"width",C.replace(/[^0-9%]+/g,""));o.setStyle(B,"width","")}if(C=o.getStyle(B,"height")){o.setAttrib(B,"height",C.replace(/[^0-9%]+/g,""));o.setStyle(B,"height","")}}})}function p(){d.onKeyDown.add(function(H,I){var G,B,C,E,F,J,D;G=I.keyCode==s;if(!I.isDefaultPrevented()&&(G||I.keyCode==r)&&!l.modifierPressed(I)){B=z.getRng();C=B.startContainer;E=B.startOffset;D=B.collapsed;if(C.nodeType==3&&C.nodeValue.length>0&&((E===0&&!D)||(D&&E===(G?0:1)))){nonEmptyElements=H.schema.getNonEmptyElements();I.preventDefault();F=o.create("br",{id:"__tmp"});C.parentNode.insertBefore(F,C);H.getDoc().execCommand(G?"ForwardDelete":"Delete",false,null);C=z.getRng().startContainer;J=C.previousSibling;if(J&&J.nodeType==1&&!o.isBlock(J)&&o.isEmpty(J)&&!nonEmptyElements[J.nodeName.toLowerCase()]){o.remove(J)}o.remove("__tmp")}}})}function e(){d.onKeyDown.add(function(F,G){var D,C,H,B,E;if(G.isDefaultPrevented()||G.keyCode!=l.BACKSPACE){return}D=z.getRng();C=D.startContainer;H=D.startOffset;B=o.getRoot();E=C;if(!D.collapsed||H!==0){return}while(E&&E.parentNode&&E.parentNode.firstChild==E&&E.parentNode!=B){E=E.parentNode}if(E.tagName==="BLOCKQUOTE"){F.formatter.toggle("blockquote",null,E);D.setStart(C,0);D.setEnd(C,0);z.setRng(D);z.collapse(false)}})}function k(){function B(){d._refreshContentEditable();c("StyleWithCSS",false);c("enableInlineTableEditing",false);if(!q.object_resizing){c("enableObjectResizing",false)}}if(!q.readonly){d.onBeforeExecCommand.add(B);d.onMouseDown.add(B)}}function n(){function B(C,D){tinymce.each(o.select("a"),function(G){var E=G.parentNode,F=o.getRoot();if(E.lastChild===G){while(E&&!o.isBlock(E)){if(E.parentNode.lastChild!==E||E===F){return}E=E.parentNode}o.add(E,"br",{"data-mce-bogus":1})}})}d.onExecCommand.add(function(C,D){if(D==="CreateLink"){B(C)}});d.onSetContent.add(z.onSetContent.add(B))}function a(){function B(D,C){if(!D||!C.initial){d.execCommand("mceRepaint")}}d.onUndo.add(B);d.onRedo.add(B);d.onSetContent.add(B)}function j(){d.onKeyDown.add(function(B,C){if(!C.isDefaultPrevented()&&C.keyCode==8&&z.getNode().nodeName=="IMG"){C.preventDefault();B.undoManager.beforeChange();o.remove(z.getNode());B.undoManager.add()}})}u();e();A();if(tinymce.isWebKit){p();h();t();v();if(tinymce.isIDevice){i()}}if(tinymce.isIE){m();y();g();f();j()}if(tinymce.isGecko){m();b();x();k();n();a()}};(function(j){var a,g,d,k=/[&<>\"\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,b=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,f=/[<>&\"\']/g,c=/&(#x|#)?([\w]+);/g,i={128:"\u20AC",130:"\u201A",131:"\u0192",132:"\u201E",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02C6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017D",145:"\u2018",146:"\u2019",147:"\u201C",148:"\u201D",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02DC",153:"\u2122",154:"\u0161",155:"\u203A",156:"\u0153",158:"\u017E",159:"\u0178"};g={'"':""","'":"'","<":"<",">":">","&":"&"};d={"<":"<",">":">","&":"&",""":'"',"'":"'"};function h(l){var m;m=document.createElement("div");m.innerHTML=l;return m.textContent||m.innerText||l}function e(m,p){var n,o,l,q={};if(m){m=m.split(",");p=p||10;for(n=0;n1){return"&#"+(((n.charCodeAt(0)-55296)*1024)+(n.charCodeAt(1)-56320)+65536)+";"}return g[n]||"&#"+n.charCodeAt(0)+";"})},encodeNamed:function(n,l,m){m=m||a;return n.replace(l?k:b,function(o){return g[o]||m[o]||o})},getEncodeFunc:function(l,o){var p=j.html.Entities;o=e(o)||a;function m(r,q){return r.replace(q?k:b,function(s){return g[s]||o[s]||"&#"+s.charCodeAt(0)+";"||s})}function n(r,q){return p.encodeNamed(r,q,o)}l=j.makeMap(l.replace(/\+/g,","));if(l.named&&l.numeric){return m}if(l.named){if(o){return n}return p.encodeNamed}if(l.numeric){return p.encodeNumeric}return p.encodeRaw},decode:function(l){return l.replace(c,function(n,m,o){if(m){o=parseInt(o,m.length===2?16:10);if(o>65535){o-=65536;return String.fromCharCode(55296+(o>>10),56320+(o&1023))}else{return i[o]||String.fromCharCode(o)}}return d[n]||a[n]||h(n)})}}})(tinymce);tinymce.html.Styles=function(d,f){var k=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,h=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,b=/\s*([^:]+):\s*([^;]+);?/g,l=/\s+$/,m=/rgb/,e,g,a={},j;d=d||{};j="\\\" \\' \\; \\: ; : \uFEFF".split(" ");for(g=0;g1?r:"0"+r}return"#"+o(q)+o(p)+o(i)}return{toHex:function(i){return i.replace(k,c)},parse:function(s){var z={},q,n,x,r,v=d.url_converter,y=d.url_converter_scope||this;function p(D,G){var F,C,B,E;F=z[D+"-top"+G];if(!F){return}C=z[D+"-right"+G];if(F!=C){return}B=z[D+"-bottom"+G];if(C!=B){return}E=z[D+"-left"+G];if(B!=E){return}z[D+G]=E;delete z[D+"-top"+G];delete z[D+"-right"+G];delete z[D+"-bottom"+G];delete z[D+"-left"+G]}function u(C){var D=z[C],B;if(!D||D.indexOf(" ")<0){return}D=D.split(" ");B=D.length;while(B--){if(D[B]!==D[0]){return false}}z[C]=D[0];return true}function A(D,C,B,E){if(!u(C)){return}if(!u(B)){return}if(!u(E)){return}z[D]=z[C]+" "+z[B]+" "+z[E];delete z[C];delete z[B];delete z[E]}function t(B){r=true;return a[B]}function i(C,B){if(r){C=C.replace(/\uFEFF[0-9]/g,function(D){return a[D]})}if(!B){C=C.replace(/\\([\'\";:])/g,"$1")}return C}function o(C,B,F,E,G,D){G=G||D;if(G){G=i(G);return"'"+G.replace(/\'/g,"\\'")+"'"}B=i(B||F||E);if(v){B=v.call(y,B,"style")}return"url('"+B.replace(/\'/g,"\\'")+"')"}if(s){s=s.replace(/\\[\"\';:\uFEFF]/g,t).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(B){return B.replace(/[;:]/g,t)});while(q=b.exec(s)){n=q[1].replace(l,"").toLowerCase();x=q[2].replace(l,"");if(n&&x.length>0){if(n==="font-weight"&&x==="700"){x="bold"}else{if(n==="color"||n==="background-color"){x=x.toLowerCase()}}x=x.replace(k,c);x=x.replace(h,o);z[n]=r?i(x,true):x}b.lastIndex=q.index+q[0].length}p("border","");p("border","-width");p("border","-color");p("border","-style");p("padding","");p("margin","");A("border","border-width","border-style","border-color");if(z.border==="medium none"){delete z.border}}return z},serialize:function(p,r){var o="",n,q;function i(t){var x,u,s,v;x=f.styles[t];if(x){for(u=0,s=x.length;u0){o+=(o.length>0?" ":"")+t+": "+v+";"}}}}if(r&&f&&f.styles){i("*");i(r)}else{for(n in p){q=p[n];if(q!==e&&q.length>0){o+=(o.length>0?" ":"")+n+": "+q+";"}}}return o}}};(function(f){var a={},e=f.makeMap,g=f.each;function d(j,i){return j.split(i||",")}function h(m,l){var j,k={};function i(n){return n.replace(/[A-Z]+/g,function(o){return i(m[o])})}for(j in m){if(m.hasOwnProperty(j)){m[j]=i(m[j])}}i(l).replace(/#/g,"#text").replace(/(\w+)\[([^\]]+)\]\[([^\]]*)\]/g,function(q,o,n,p){n=d(n,"|");k[o]={attributes:e(n),attributesOrder:n,children:e(p,"|",{"#comment":{}})}});return k}function b(){var i=a.html5;if(!i){i=a.html5=h({A:"id|accesskey|class|dir|draggable|item|hidden|itemprop|role|spellcheck|style|subject|title",B:"#|a|abbr|area|audio|b|bdo|br|button|canvas|cite|code|command|datalist|del|dfn|em|embed|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|meta|meter|noscript|object|output|progress|q|ruby|samp|script|select|small|span|strong|sub|sup|svg|textarea|time|var|video",C:"#|a|abbr|area|address|article|aside|audio|b|bdo|blockquote|br|button|canvas|cite|code|command|datalist|del|details|dfn|dialog|div|dl|em|embed|fieldset|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|menu|meta|meter|nav|noscript|ol|object|output|p|pre|progress|q|ruby|samp|script|section|select|small|span|strong|style|sub|sup|svg|table|textarea|time|ul|var|video"},"html[A|manifest][body|head]head[A][base|command|link|meta|noscript|script|style|title]title[A][#]base[A|href|target][]link[A|href|rel|media|type|sizes][]meta[A|http-equiv|name|content|charset][]style[A|type|media|scoped][#]script[A|charset|type|src|defer|async][#]noscript[A][C]body[A][C]section[A][C]nav[A][C]article[A][C]aside[A][C]h1[A][B]h2[A][B]h3[A][B]h4[A][B]h5[A][B]h6[A][B]hgroup[A][h1|h2|h3|h4|h5|h6]header[A][C]footer[A][C]address[A][C]p[A][B]br[A][]pre[A][B]dialog[A][dd|dt]blockquote[A|cite][C]ol[A|start|reversed][li]ul[A][li]li[A|value][C]dl[A][dd|dt]dt[A][B]dd[A][C]a[A|href|target|ping|rel|media|type][C]em[A][B]strong[A][B]small[A][B]cite[A][B]q[A|cite][B]dfn[A][B]abbr[A][B]code[A][B]var[A][B]samp[A][B]kbd[A][B]sub[A][B]sup[A][B]i[A][B]b[A][B]mark[A][B]progress[A|value|max][B]meter[A|value|min|max|low|high|optimum][B]time[A|datetime][B]ruby[A][B|rt|rp]rt[A][B]rp[A][B]bdo[A][B]span[A][B]ins[A|cite|datetime][B]del[A|cite|datetime][B]figure[A][C|legend|figcaption]figcaption[A][C]img[A|alt|src|height|width|usemap|ismap][]iframe[A|name|src|height|width|sandbox|seamless][]embed[A|src|height|width|type][]object[A|data|type|height|width|usemap|name|form|classid][param]param[A|name|value][]details[A|open][C|legend]command[A|type|label|icon|disabled|checked|radiogroup][]menu[A|type|label][C|li]legend[A][C|B]div[A][C]source[A|src|type|media][]audio[A|src|autobuffer|autoplay|loop|controls][source]video[A|src|autobuffer|autoplay|loop|controls|width|height|poster][source]hr[A][]form[A|accept-charset|action|autocomplete|enctype|method|name|novalidate|target][C]fieldset[A|disabled|form|name][C|legend]label[A|form|for][B]input[A|type|accept|alt|autocomplete|checked|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|height|list|max|maxlength|min|multiple|pattern|placeholder|readonly|required|size|src|step|width|files|value][]button[A|autofocus|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|name|value|type][B]select[A|autofocus|disabled|form|multiple|name|size][option|optgroup]datalist[A][B|option]optgroup[A|disabled|label][option]option[A|disabled|selected|label|value][]textarea[A|autofocus|disabled|form|maxlength|name|placeholder|readonly|required|rows|cols|wrap][]keygen[A|autofocus|challenge|disabled|form|keytype|name][]output[A|for|form|name][B]canvas[A|width|height][]map[A|name][B|C]area[A|shape|coords|href|alt|target|media|rel|ping|type][]mathml[A][]svg[A][]table[A|summary][caption|colgroup|thead|tfoot|tbody|tr]caption[A][C]colgroup[A|span][col]col[A|span][]thead[A][tr]tfoot[A][tr]tbody[A][tr]tr[A][th|td]th[A|headers|rowspan|colspan|scope][B]td[A|headers|rowspan|colspan][C]")}return i}function c(){var i=a.html4;if(!i){i=a.html4=h({Z:"H|K|N|O|P",Y:"X|form|R|Q",ZG:"E|span|width|align|char|charoff|valign",X:"p|T|div|U|W|isindex|fieldset|table",ZF:"E|align|char|charoff|valign",W:"pre|hr|blockquote|address|center|noframes",ZE:"abbr|axis|headers|scope|rowspan|colspan|align|char|charoff|valign|nowrap|bgcolor|width|height",ZD:"[E][S]",U:"ul|ol|dl|menu|dir",ZC:"p|Y|div|U|W|table|br|span|bdo|object|applet|img|map|K|N|Q",T:"h1|h2|h3|h4|h5|h6",ZB:"X|S|Q",S:"R|P",ZA:"a|G|J|M|O|P",R:"a|H|K|N|O",Q:"noscript|P",P:"ins|del|script",O:"input|select|textarea|label|button",N:"M|L",M:"em|strong|dfn|code|q|samp|kbd|var|cite|abbr|acronym",L:"sub|sup",K:"J|I",J:"tt|i|b|u|s|strike",I:"big|small|font|basefont",H:"G|F",G:"br|span|bdo",F:"object|applet|img|map|iframe",E:"A|B|C",D:"accesskey|tabindex|onfocus|onblur",C:"onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup",B:"lang|xml:lang|dir",A:"id|class|style|title"},"script[id|charset|type|language|src|defer|xml:space][]style[B|id|type|media|title|xml:space][]object[E|declare|classid|codebase|data|type|codetype|archive|standby|width|height|usemap|name|tabindex|align|border|hspace|vspace][#|param|Y]param[id|name|value|valuetype|type][]p[E|align][#|S]a[E|D|charset|type|name|href|hreflang|rel|rev|shape|coords|target][#|Z]br[A|clear][]span[E][#|S]bdo[A|C|B][#|S]applet[A|codebase|archive|code|object|alt|name|width|height|align|hspace|vspace][#|param|Y]h1[E|align][#|S]img[E|src|alt|name|longdesc|width|height|usemap|ismap|align|border|hspace|vspace][]map[B|C|A|name][X|form|Q|area]h2[E|align][#|S]iframe[A|longdesc|name|src|frameborder|marginwidth|marginheight|scrolling|align|width|height][#|Y]h3[E|align][#|S]tt[E][#|S]i[E][#|S]b[E][#|S]u[E][#|S]s[E][#|S]strike[E][#|S]big[E][#|S]small[E][#|S]font[A|B|size|color|face][#|S]basefont[id|size|color|face][]em[E][#|S]strong[E][#|S]dfn[E][#|S]code[E][#|S]q[E|cite][#|S]samp[E][#|S]kbd[E][#|S]var[E][#|S]cite[E][#|S]abbr[E][#|S]acronym[E][#|S]sub[E][#|S]sup[E][#|S]input[E|D|type|name|value|checked|disabled|readonly|size|maxlength|src|alt|usemap|onselect|onchange|accept|align][]select[E|name|size|multiple|disabled|tabindex|onfocus|onblur|onchange][optgroup|option]optgroup[E|disabled|label][option]option[E|selected|disabled|label|value][]textarea[E|D|name|rows|cols|disabled|readonly|onselect|onchange][]label[E|for|accesskey|onfocus|onblur][#|S]button[E|D|name|value|type|disabled][#|p|T|div|U|W|table|G|object|applet|img|map|K|N|Q]h4[E|align][#|S]ins[E|cite|datetime][#|Y]h5[E|align][#|S]del[E|cite|datetime][#|Y]h6[E|align][#|S]div[E|align][#|Y]ul[E|type|compact][li]li[E|type|value][#|Y]ol[E|type|compact|start][li]dl[E|compact][dt|dd]dt[E][#|S]dd[E][#|Y]menu[E|compact][li]dir[E|compact][li]pre[E|width|xml:space][#|ZA]hr[E|align|noshade|size|width][]blockquote[E|cite][#|Y]address[E][#|S|p]center[E][#|Y]noframes[E][#|Y]isindex[A|B|prompt][]fieldset[E][#|legend|Y]legend[E|accesskey|align][#|S]table[E|summary|width|border|frame|rules|cellspacing|cellpadding|align|bgcolor][caption|col|colgroup|thead|tfoot|tbody|tr]caption[E|align][#|S]col[ZG][]colgroup[ZG][col]thead[ZF][tr]tr[ZF|bgcolor][th|td]th[E|ZE][#|Y]form[E|action|method|name|enctype|onsubmit|onreset|accept|accept-charset|target][#|X|R|Q]noscript[E][#|Y]td[E|ZE][#|Y]tfoot[ZF][tr]tbody[ZF][tr]area[E|D|shape|coords|href|nohref|alt|target][]base[id|href|target][]body[E|onload|onunload|background|bgcolor|text|link|vlink|alink][#|Y]")}return i}f.html.Schema=function(A){var u=this,s={},k={},j=[],D,y;var o,q,z,r,v,n,p={};function m(F,E,H){var G=A[F];if(!G){G=a[F];if(!G){G=e(E," ",e(E.toUpperCase()," "));G=f.extend(G,H);a[F]=G}}else{G=e(G,",",e(G.toUpperCase()," "))}return G}A=A||{};y=A.schema=="html5"?b():c();if(A.verify_html===false){A.valid_elements="*[*]"}if(A.valid_styles){D={};g(A.valid_styles,function(F,E){D[E]=f.explode(F)})}o=m("whitespace_elements","pre script style textarea");q=m("self_closing_elements","colgroup dd dt li options p td tfoot th thead tr");z=m("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source");r=m("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls");n=m("non_empty_elements","td th iframe video audio object",z);v=m("block_elements","h1 h2 h3 h4 h5 h6 hr p div address pre form table tbody thead tfoot th tr td li ol ul caption blockquote center dl dt dd dir fieldset noscript menu isindex samp header footer article section hgroup aside nav figure");function i(E){return new RegExp("^"+E.replace(/([?+*])/g,".$1")+"$")}function C(L){var K,G,Z,V,aa,F,I,U,X,Q,Y,ac,O,J,W,E,S,H,ab,ad,P,T,N=/^([#+\-])?([^\[\/]+)(?:\/([^\[]+))?(?:\[([^\]]+)\])?$/,R=/^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,M=/[*?+]/;if(L){L=d(L);if(s["@"]){S=s["@"].attributes;H=s["@"].attributesOrder}for(K=0,G=L.length;K=0){for(U=A.length-1;U>=V;U--){T=A[U];if(T.valid){n.end(T.name)}}A.length=V}}function p(U,T,Y,X,W){var Z,V;T=T.toLowerCase();Y=T in H?T:j(Y||X||W||"");if(v&&!z&&T.indexOf("data-")!==0){Z=P[T];if(!Z&&F){V=F.length;while(V--){Z=F[V];if(Z.pattern.test(T)){break}}if(V===-1){Z=null}}if(!Z){return}if(Z.validValues&&!(Y in Z.validValues)){return}}N.map[T]=Y;N.push({name:T,value:Y})}l=new RegExp("<(?:(?:!--([\\w\\W]*?)-->)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([^>]+)>)|(?:([A-Za-z0-9\\-\\:]+)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g");D=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:\\.|[^\"])*)\")|(?:\'((?:\\.|[^\'])*)\')|([^>\s]+)))?/g;K={script:/<\/script[^>]*>/gi,style:/<\/style[^>]*>/gi,noscript:/<\/noscript[^>]*>/gi};M=e.getShortEndedElements();J=e.getSelfClosingElements();H=e.getBoolAttrs();v=c.validate;s=c.remove_internals;y=c.fix_self_closing;q=a.isIE;o=/^:/;while(g=l.exec(E)){if(G0&&A[A.length-1].name===I){u(I)}if(!v||(m=e.getElementRule(I))){k=true;if(v){P=m.attributes;F=m.attributePatterns}if(R=g[8]){z=R.indexOf("data-mce-type")!==-1;if(z&&s){k=false}N=[];N.map={};R.replace(D,p)}else{N=[];N.map={}}if(v&&!z){S=m.attributesRequired;L=m.attributesDefault;f=m.attributesForced;if(f){Q=f.length;while(Q--){t=f[Q];r=t.name;h=t.value;if(h==="{$uid}"){h="mce_"+x++}N.map[r]=h;N.push({name:r,value:h})}}if(L){Q=L.length;while(Q--){t=L[Q];r=t.name;if(!(r in N.map)){h=t.value;if(h==="{$uid}"){h="mce_"+x++}N.map[r]=h;N.push({name:r,value:h})}}}if(S){Q=S.length;while(Q--){if(S[Q] in N.map){break}}if(Q===-1){k=false}}if(N.map["data-mce-bogus"]){k=false}}if(k){n.start(I,N,O)}}else{k=false}if(B=K[I]){B.lastIndex=G=g.index+g[0].length;if(g=B.exec(E)){if(k){C=E.substr(G,g.index-G)}G=g.index+g[0].length}else{C=E.substr(G);G=E.length}if(k&&C.length>0){n.text(C,true)}if(k){n.end(I)}l.lastIndex=G;continue}if(!O){if(!R||R.indexOf("/")!=R.length-1){A.push({name:I,valid:k})}else{if(k){n.end(I)}}}}else{if(I=g[1]){n.comment(I)}else{if(I=g[2]){n.cdata(I)}else{if(I=g[3]){n.doctype(I)}else{if(I=g[4]){n.pi(I,g[5])}}}}}}G=g.index+g[0].length}if(G=0;Q--){I=A[Q];if(I.valid){n.end(I.name)}}}}})(tinymce);(function(d){var c=/^[ \t\r\n]*$/,e={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11};function a(k,l,j){var i,h,f=j?"lastChild":"firstChild",g=j?"prev":"next";if(k[f]){return k[f]}if(k!==l){i=k[g];if(i){return i}for(h=k.parent;h&&h!==l;h=h.parent){i=h[g];if(i){return i}}}}function b(f,g){this.name=f;this.type=g;if(g===1){this.attributes=[];this.attributes.map={}}}d.extend(b.prototype,{replace:function(g){var f=this;if(g.parent){g.remove()}f.insert(g,f);f.remove();return f},attr:function(h,l){var f=this,g,j,k;if(typeof h!=="string"){for(j in h){f.attr(j,h[j])}return f}if(g=f.attributes){if(l!==k){if(l===null){if(h in g.map){delete g.map[h];j=g.length;while(j--){if(g[j].name===h){g=g.splice(j,1);return f}}}return f}if(h in g.map){j=g.length;while(j--){if(g[j].name===h){g[j].value=l;break}}}else{g.push({name:h,value:l})}g.map[h]=l;return f}else{return g.map[h]}}},clone:function(){var g=this,n=new b(g.name,g.type),h,f,m,j,k;if(m=g.attributes){k=[];k.map={};for(h=0,f=m.length;h1){v.reverse();z=n=f.filterNode(v[0].clone());for(t=0;t0){P.value=l;P=P.prev}else{N=P.prev;P.remove();P=N}}}n=new b.html.SaxParser({validate:z,fix_self_closing:!z,cdata:function(l){B.append(J("#cdata",4)).value=l},text:function(O,l){var N;if(!K){O=O.replace(k," ");if(B.lastChild&&o[B.lastChild.name]){O=O.replace(E,"")}}if(O.length!==0){N=J("#text",3);N.raw=!!l;B.append(N).value=O}},comment:function(l){B.append(J("#comment",8)).value=l},pi:function(l,N){B.append(J(l,7)).value=N;H(B)},doctype:function(N){var l;l=B.append(J("#doctype",10));l.value=N;H(B)},start:function(l,V,O){var T,Q,P,N,R,W,U,S;P=z?h.getElementRule(l):{};if(P){T=J(P.outputName||l,1);T.attributes=V;T.shortEnded=O;B.append(T);S=p[B.name];if(S&&p[T.name]&&!S[T.name]){L.push(T)}Q=d.length;while(Q--){R=d[Q].name;if(R in V.map){F=c[R];if(F){F.push(T)}else{c[R]=[T]}}}if(o[l]){H(T)}if(!O){B=T}if(!K&&s[l]){K=true}}},end:function(l){var R,O,Q,N,P;O=z?h.getElementRule(l):{};if(O){if(o[l]){if(!K){R=B.firstChild;if(R&&R.type===3){Q=R.value.replace(E,"");if(Q.length>0){R.value=Q;R=R.next}else{N=R.next;R.remove();R=N}while(R&&R.type===3){Q=R.value;N=R.next;if(Q.length===0||y.test(Q)){R.remove();R=N}R=N}}R=B.lastChild;if(R&&R.type===3){Q=R.value.replace(t,"");if(Q.length>0){R.value=Q;R=R.prev}else{N=R.prev;R.remove();R=N}while(R&&R.type===3){Q=R.value;N=R.prev;if(Q.length===0||y.test(Q)){R.remove();R=N}R=N}}}R=B.prev;if(R&&R.type===3){Q=R.value.replace(E,"");if(Q.length>0){R.value=Q}else{R.remove()}}}if(K&&s[l]){K=false}if(O.removeEmpty||O.paddEmpty){if(B.isEmpty(u)){if(O.paddEmpty){B.empty().append(new a("#text","3")).value="\u00a0"}else{if(!B.attributes.map.name){P=B.parent;B.empty().remove();B=P;return}}}}B=B.parent}}},h);I=B=new a(m.context||g.root_name,11);n.parse(v);if(z&&L.length){if(!m.context){j(L)}else{m.invalid=true}}if(q&&I.name=="body"){G()}if(!m.invalid){for(M in i){F=e[M];A=i[M];x=A.length;while(x--){if(!A[x].parent){A.splice(x,1)}}for(D=0,C=F.length;D0){o=c[c.length-1];if(o.length>0&&o!=="\n"){c.push("\n")}}c.push("<",m);if(k){for(n=0,j=k.length;n0){o=c[c.length-1];if(o.length>0&&o!=="\n"){c.push("\n")}}},end:function(h){var i;c.push("");if(a&&d[h]&&c.length>0){i=c[c.length-1];if(i.length>0&&i!=="\n"){c.push("\n")}}},text:function(i,h){if(i.length>0){c[c.length]=h?i:f(i)}},cdata:function(h){c.push("")},comment:function(h){c.push("")},pi:function(h,i){if(i){c.push("")}else{c.push("")}if(a){c.push("\n")}},doctype:function(h){c.push("",a?"\n":"")},reset:function(){c.length=0},getContent:function(){return c.join("").replace(/\n$/,"")}}};(function(a){a.html.Serializer=function(c,d){var b=this,e=new a.html.Writer(c);c=c||{};c.validate="validate" in c?c.validate:true;b.schema=d=d||new a.html.Schema();b.writer=e;b.serialize=function(h){var g,i;i=c.validate;g={3:function(k,j){e.text(k.value,k.raw)},8:function(j){e.comment(j.value)},7:function(j){e.pi(j.name,j.value)},10:function(j){e.doctype(j.value)},4:function(j){e.cdata(j.value)},11:function(j){if((j=j.firstChild)){do{f(j)}while(j=j.next)}}};e.reset();function f(k){var t=g[k.type],j,o,s,r,p,u,n,m,q;if(!t){j=k.name;o=k.shortEnded;s=k.attributes;if(i&&s&&s.length>1){u=[];u.map={};q=d.getElementRule(k.name);for(n=0,m=q.attributesOrder.length;n=8;k.boxModel=!e.isIE||o.compatMode=="CSS1Compat"||k.stdMode;k.hasOuterHTML="outerHTML" in o.createElement("a");k.settings=l=e.extend({keep_values:false,hex_colors:1},l);k.schema=l.schema;k.styles=new e.html.Styles({url_converter:l.url_converter,url_converter_scope:l.url_converter_scope},l.schema);if(e.isIE6){try{o.execCommand("BackgroundImageCache",false,true)}catch(m){k.cssFlicker=true}}k.fixDoc(o);k.events=l.ownEvents?new e.dom.EventUtils(l.proxy):e.dom.Event;e.addUnload(k.destroy,k);n=l.schema?l.schema.getBlockElements():{};k.isBlock=function(q){var p=q.nodeType;if(p){return !!(p===1&&n[q.nodeName])}return !!n[q]}},fixDoc:function(k){var j=this.settings,i;if(b&&j.schema){("abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video").replace(/\w+/g,function(l){k.createElement(l)});for(i in j.schema.getCustomElements()){k.createElement(i)}}},clone:function(k,i){var j=this,m,l;if(!b||k.nodeType!==1||i){return k.cloneNode(i)}l=j.doc;if(!i){m=l.createElement(k.nodeName);g(j.getAttribs(k),function(n){j.setAttrib(m,n.nodeName,j.getAttrib(k,n.nodeName))});return m}return m.firstChild},getRoot:function(){var i=this,j=i.settings;return(j&&i.get(j.root_element))||i.doc.body},getViewPort:function(j){var k,i;j=!j?this.win:j;k=j.document;i=this.boxModel?k.documentElement:k.body;return{x:j.pageXOffset||i.scrollLeft,y:j.pageYOffset||i.scrollTop,w:j.innerWidth||i.clientWidth,h:j.innerHeight||i.clientHeight}},getRect:function(l){var k,i=this,j;l=i.get(l);k=i.getPos(l);j=i.getSize(l);return{x:k.x,y:k.y,w:j.w,h:j.h}},getSize:function(l){var j=this,i,k;l=j.get(l);i=j.getStyle(l,"width");k=j.getStyle(l,"height");if(i.indexOf("px")===-1){i=0}if(k.indexOf("px")===-1){k=0}return{w:parseInt(i,10)||l.offsetWidth||l.clientWidth,h:parseInt(k,10)||l.offsetHeight||l.clientHeight}},getParent:function(k,j,i){return this.getParents(k,j,i,false)},getParents:function(s,m,k,q){var j=this,i,l=j.settings,p=[];s=j.get(s);q=q===undefined;if(l.strict_root){k=k||j.getRoot()}if(d(m,"string")){i=m;if(m==="*"){m=function(o){return o.nodeType==1}}else{m=function(o){return j.is(o,i)}}}while(s){if(s==k||!s.nodeType||s.nodeType===9){break}if(!m||m(s)){if(q){p.push(s)}else{return s}}s=s.parentNode}return q?p:null},get:function(i){var j;if(i&&this.doc&&typeof(i)=="string"){j=i;i=this.doc.getElementById(i);if(i&&i.id!==j){return this.doc.getElementsByName(j)[1]}}return i},getNext:function(j,i){return this._findSib(j,i,"nextSibling")},getPrev:function(j,i){return this._findSib(j,i,"previousSibling")},add:function(l,o,i,k,m){var j=this;return this.run(l,function(r){var q,n;q=d(o,"string")?j.doc.createElement(o):o;j.setAttribs(q,i);if(k){if(k.nodeType){q.appendChild(k)}else{j.setHTML(q,k)}}return !m?r.appendChild(q):q})},create:function(k,i,j){return this.add(this.doc.createElement(k),k,i,j,1)},createHTML:function(q,i,m){var p="",l=this,j;p+="<"+q;for(j in i){if(i.hasOwnProperty(j)){p+=" "+j+'="'+l.encode(i[j])+'"'}}if(typeof(m)!="undefined"){return p+">"+m+""}return p+" />"},remove:function(i,j){return this.run(i,function(l){var m,k=l.parentNode;if(!k){return null}if(j){while(m=l.firstChild){if(!e.isIE||m.nodeType!==3||m.nodeValue){k.insertBefore(m,l)}else{l.removeChild(m)}}}return k.removeChild(l)})},setStyle:function(l,i,j){var k=this;return k.run(l,function(o){var n,m;n=o.style;i=i.replace(/-(\D)/g,function(q,p){return p.toUpperCase()});if(k.pixelStyles.test(i)&&(e.is(j,"number")||/^[\-0-9\.]+$/.test(j))){j+="px"}switch(i){case"opacity":if(b){n.filter=j===""?"":"alpha(opacity="+(j*100)+")";if(!l.currentStyle||!l.currentStyle.hasLayout){n.display="inline-block"}}n[i]=n["-moz-opacity"]=n["-khtml-opacity"]=j||"";break;case"float":b?n.styleFloat=j:n.cssFloat=j;break;default:n[i]=j||""}if(k.settings.update_styles){k.setAttrib(o,"data-mce-style")}})},getStyle:function(l,i,k){l=this.get(l);if(!l){return}if(this.doc.defaultView&&k){i=i.replace(/[A-Z]/g,function(m){return"-"+m});try{return this.doc.defaultView.getComputedStyle(l,null).getPropertyValue(i)}catch(j){return null}}i=i.replace(/-(\D)/g,function(n,m){return m.toUpperCase()});if(i=="float"){i=b?"styleFloat":"cssFloat"}if(l.currentStyle&&k){return l.currentStyle[i]}return l.style?l.style[i]:undefined},setStyles:function(l,m){var j=this,k=j.settings,i;i=k.update_styles;k.update_styles=0;g(m,function(o,p){j.setStyle(l,p,o)});k.update_styles=i;if(k.update_styles){j.setAttrib(l,k.cssText)}},removeAllAttribs:function(i){return this.run(i,function(l){var k,j=l.attributes;for(k=j.length-1;k>=0;k--){l.removeAttributeNode(j.item(k))}})},setAttrib:function(k,l,i){var j=this;if(!k||!l){return}if(j.settings.strict){l=l.toLowerCase()}return this.run(k,function(p){var o=j.settings;var m=p.getAttribute(l);if(i!==null){switch(l){case"style":if(!d(i,"string")){g(i,function(q,r){j.setStyle(p,r,q)});return}if(o.keep_values){if(i&&!j._isRes(i)){p.setAttribute("data-mce-style",i,2)}else{p.removeAttribute("data-mce-style",2)}}p.style.cssText=i;break;case"class":p.className=i||"";break;case"src":case"href":if(o.keep_values){if(o.url_converter){i=o.url_converter.call(o.url_converter_scope||j,i,l,p)}j.setAttrib(p,"data-mce-"+l,i,2)}break;case"shape":p.setAttribute("data-mce-style",i);break}}if(d(i)&&i!==null&&i.length!==0){p.setAttribute(l,""+i,2)}else{p.removeAttribute(l,2)}if(tinyMCE.activeEditor&&m!=i){var n=tinyMCE.activeEditor;n.onSetAttrib.dispatch(n,p,l,i)}})},setAttribs:function(j,k){var i=this;return this.run(j,function(l){g(k,function(m,o){i.setAttrib(l,o,m)})})},getAttrib:function(m,o,k){var i,j=this,l;m=j.get(m);if(!m||m.nodeType!==1){return k===l?false:k}if(!d(k)){k=""}if(/^(src|href|style|coords|shape)$/.test(o)){i=m.getAttribute("data-mce-"+o);if(i){return i}}if(b&&j.props[o]){i=m[j.props[o]];i=i&&i.nodeValue?i.nodeValue:i}if(!i){i=m.getAttribute(o,2)}if(/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(o)){if(m[j.props[o]]===true&&i===""){return o}return i?o:""}if(m.nodeName==="FORM"&&m.getAttributeNode(o)){return m.getAttributeNode(o).nodeValue}if(o==="style"){i=i||m.style.cssText;if(i){i=j.serializeStyle(j.parseStyle(i),m.nodeName);if(j.settings.keep_values&&!j._isRes(i)){m.setAttribute("data-mce-style",i)}}}if(f&&o==="class"&&i){i=i.replace(/(apple|webkit)\-[a-z\-]+/gi,"")}if(b){switch(o){case"rowspan":case"colspan":if(i===1){i=""}break;case"size":if(i==="+0"||i===20||i===0){i=""}break;case"width":case"height":case"vspace":case"checked":case"disabled":case"readonly":if(i===0){i=""}break;case"hspace":if(i===-1){i=""}break;case"maxlength":case"tabindex":if(i===32768||i===2147483647||i==="32768"){i=""}break;case"multiple":case"compact":case"noshade":case"nowrap":if(i===65535){return o}return k;case"shape":i=i.toLowerCase();break;default:if(o.indexOf("on")===0&&i){i=e._replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/,"$1",""+i)}}}return(i!==l&&i!==null&&i!=="")?""+i:k},getPos:function(q,l){var j=this,i=0,p=0,m,o=j.doc,k;q=j.get(q);l=l||o.body;if(q){if(q.getBoundingClientRect){q=q.getBoundingClientRect();m=j.boxModel?o.documentElement:o.body;i=q.left+(o.documentElement.scrollLeft||o.body.scrollLeft)-m.clientTop;p=q.top+(o.documentElement.scrollTop||o.body.scrollTop)-m.clientLeft;return{x:i,y:p}}k=q;while(k&&k!=l&&k.nodeType){i+=k.offsetLeft||0;p+=k.offsetTop||0;k=k.offsetParent}k=q.parentNode;while(k&&k!=l&&k.nodeType){i-=k.scrollLeft||0;p-=k.scrollTop||0;k=k.parentNode}}return{x:i,y:p}},parseStyle:function(i){return this.styles.parse(i)},serializeStyle:function(j,i){return this.styles.serialize(j,i)},loadCSS:function(i){var k=this,l=k.doc,j;if(!i){i=""}j=l.getElementsByTagName("head")[0];g(i.split(","),function(m){var n;if(k.files[m]){return}k.files[m]=true;n=k.create("link",{rel:"stylesheet",href:e._addVer(m)});if(b&&l.documentMode&&l.recalc){n.onload=function(){if(l.recalc){l.recalc()}n.onload=null}}j.appendChild(n)})},addClass:function(i,j){return this.run(i,function(k){var l;if(!j){return 0}if(this.hasClass(k,j)){return k.className}l=this.removeClass(k,j);return k.className=(l!=""?(l+" "):"")+j})},removeClass:function(k,l){var i=this,j;return i.run(k,function(n){var m;if(i.hasClass(n,l)){if(!j){j=new RegExp("(^|\\s+)"+l+"(\\s+|$)","g")}m=n.className.replace(j," ");m=e.trim(m!=" "?m:"");n.className=m;if(!m){n.removeAttribute("class");n.removeAttribute("className")}return m}return n.className})},hasClass:function(j,i){j=this.get(j);if(!j||!i){return false}return(" "+j.className+" ").indexOf(" "+i+" ")!==-1},show:function(i){return this.setStyle(i,"display","block")},hide:function(i){return this.setStyle(i,"display","none")},isHidden:function(i){i=this.get(i);return !i||i.style.display=="none"||this.getStyle(i,"display")=="none"},uniqueId:function(i){return(!i?"mce_":i)+(this.counter++)},setHTML:function(k,j){var i=this;return i.run(k,function(m){if(b){while(m.firstChild){m.removeChild(m.firstChild)}try{m.innerHTML="
                    "+j;m.removeChild(m.firstChild)}catch(l){m=i.create("div");m.innerHTML="
                    "+j;g(m.childNodes,function(o,n){if(n){m.appendChild(o)}})}}else{m.innerHTML=j}return j})},getOuterHTML:function(k){var j,i=this;k=i.get(k);if(!k){return null}if(k.nodeType===1&&i.hasOuterHTML){return k.outerHTML}j=(k.ownerDocument||i.doc).createElement("body");j.appendChild(k.cloneNode(true));return j.innerHTML},setOuterHTML:function(l,j,m){var i=this;function k(p,o,r){var s,q;q=r.createElement("body");q.innerHTML=o;s=q.lastChild;while(s){i.insertAfter(s.cloneNode(true),p);s=s.previousSibling}i.remove(p)}return this.run(l,function(o){o=i.get(o);if(o.nodeType==1){m=m||o.ownerDocument||i.doc;if(b){try{if(b&&o.nodeType==1){o.outerHTML=j}else{k(o,j,m)}}catch(n){k(o,j,m)}}else{k(o,j,m)}}})},decode:h.decode,encode:h.encodeAllRaw,insertAfter:function(i,j){j=this.get(j);return this.run(i,function(l){var k,m;k=j.parentNode;m=j.nextSibling;if(m){k.insertBefore(l,m)}else{k.appendChild(l)}return l})},replace:function(m,l,i){var j=this;if(d(l,"array")){m=m.cloneNode(true)}return j.run(l,function(k){if(i){g(e.grep(k.childNodes),function(n){m.appendChild(n)})}return k.parentNode.replaceChild(m,k)})},rename:function(l,i){var k=this,j;if(l.nodeName!=i.toUpperCase()){j=k.create(i);g(k.getAttribs(l),function(m){k.setAttrib(j,m.nodeName,k.getAttrib(l,m.nodeName))});k.replace(j,l,1)}return j||l},findCommonAncestor:function(k,i){var l=k,j;while(l){j=i;while(j&&l!=j){j=j.parentNode}if(l==j){break}l=l.parentNode}if(!l&&k.ownerDocument){return k.ownerDocument.documentElement}return l},toHex:function(i){var k=/^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(i);function j(l){l=parseInt(l,10).toString(16);return l.length>1?l:"0"+l}if(k){i="#"+j(k[1])+j(k[2])+j(k[3]);return i}return i},getClasses:function(){var n=this,j=[],m,o={},p=n.settings.class_filter,l;if(n.classes){return n.classes}function q(i){g(i.imports,function(s){q(s)});g(i.cssRules||i.rules,function(s){switch(s.type||1){case 1:if(s.selectorText){g(s.selectorText.split(","),function(r){r=r.replace(/^\s*|\s*$|^\s\./g,"");if(/\.mce/.test(r)||!/\.[\w\-]+$/.test(r)){return}l=r;r=e._replace(/.*\.([a-z0-9_\-]+).*/i,"$1",r);if(p&&!(r=p(r,l))){return}if(!o[r]){j.push({"class":r});o[r]=1}})}break;case 3:q(s.styleSheet);break}})}try{g(n.doc.styleSheets,q)}catch(k){}if(j.length>0){n.classes=j}return j},run:function(l,k,j){var i=this,m;if(i.doc&&typeof(l)==="string"){l=i.get(l)}if(!l){return false}j=j||this;if(!l.nodeType&&(l.length||l.length===0)){m=[];g(l,function(o,n){if(o){if(typeof(o)=="string"){o=i.doc.getElementById(o)}m.push(k.call(j,o,n))}});return m}return k.call(j,l)},getAttribs:function(j){var i;j=this.get(j);if(!j){return[]}if(b){i=[];if(j.nodeName=="OBJECT"){return j.attributes}if(j.nodeName==="OPTION"&&this.getAttrib(j,"selected")){i.push({specified:1,nodeName:"selected"})}j.cloneNode(false).outerHTML.replace(/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi,"").replace(/[\w:\-]+/gi,function(k){i.push({specified:1,nodeName:k})});return i}return j.attributes},isEmpty:function(m,k){var r=this,o,n,q,j,l,p=0;m=m.firstChild;if(m){j=new e.dom.TreeWalker(m,m.parentNode);k=k||r.schema?r.schema.getNonEmptyElements():null;do{q=m.nodeType;if(q===1){if(m.getAttribute("data-mce-bogus")){continue}l=m.nodeName.toLowerCase();if(k&&k[l]){if(l==="br"){p++;continue}return false}n=r.getAttribs(m);o=m.attributes.length;while(o--){l=m.attributes[o].nodeName;if(l==="name"||l==="data-mce-bookmark"){return false}}}if(q==8){return false}if((q===3&&!a.test(m.nodeValue))){return false}}while(m=j.next())}return p<=1},destroy:function(j){var i=this;i.win=i.doc=i.root=i.events=i.frag=null;if(!j){e.removeUnload(i.destroy)}},createRng:function(){var i=this.doc;return i.createRange?i.createRange():new e.dom.Range(this)},nodeIndex:function(m,n){var i=0,k,l,j;if(m){for(k=m.nodeType,m=m.previousSibling,l=m;m;m=m.previousSibling){j=m.nodeType;if(n&&j==3){if(j==k||!m.nodeValue.length){continue}}i++;k=j}}return i},split:function(m,l,p){var q=this,i=q.createRng(),n,k,o;function j(v){var t,s=v.childNodes,u=v.nodeType;function x(A){var z=A.previousSibling&&A.previousSibling.nodeName=="SPAN";var y=A.nextSibling&&A.nextSibling.nodeName=="SPAN";return z&&y}if(u==1&&v.getAttribute("data-mce-type")=="bookmark"){return}for(t=s.length-1;t>=0;t--){j(s[t])}if(u!=9){if(u==3&&v.nodeValue.length>0){var r=e.trim(v.nodeValue).length;if(!q.isBlock(v.parentNode)||r>0||r===0&&x(v)){return}}else{if(u==1){s=v.childNodes;if(s.length==1&&s[0]&&s[0].nodeType==1&&s[0].getAttribute("data-mce-type")=="bookmark"){v.parentNode.insertBefore(s[0],v)}if(s.length||/^(br|hr|input|img)$/i.test(v.nodeName)){return}}}q.remove(v)}return v}if(m&&l){i.setStart(m.parentNode,q.nodeIndex(m));i.setEnd(l.parentNode,q.nodeIndex(l));n=i.extractContents();i=q.createRng();i.setStart(l.parentNode,q.nodeIndex(l)+1);i.setEnd(m.parentNode,q.nodeIndex(m)+1);k=i.extractContents();o=m.parentNode;o.insertBefore(j(n),m);if(p){o.replaceChild(p,l)}else{o.insertBefore(l,m)}o.insertBefore(j(k),m);q.remove(m);return p||l}},bind:function(l,i,k,j){return this.events.add(l,i,k,j||this)},unbind:function(k,i,j){return this.events.remove(k,i,j)},fire:function(k,j,i){return this.events.fire(k,j,i)},getContentEditable:function(j){var i;if(j.nodeType!=1){return null}i=j.getAttribute("data-mce-contenteditable");if(i&&i!=="inherit"){return i}return j.contentEditable!=="inherit"?j.contentEditable:null},_findSib:function(l,i,j){var k=this,m=i;if(l){if(d(m,"string")){m=function(n){return k.is(n,i)}}for(l=l[j];l;l=l[j]){if(m(l)){return l}}}return null},_isRes:function(i){return/^(top|left|bottom|right|width|height)/i.test(i)||/;\s*(top|left|bottom|right|width|height)/i.test(i)}});e.DOM=new e.dom.DOMUtils(document,{process_html:0})})(tinymce);(function(a){function b(c){var O=this,e=c.doc,T=0,F=1,j=2,E=true,S=false,V="startOffset",h="startContainer",Q="endContainer",A="endOffset",k=tinymce.extend,n=c.nodeIndex;k(O,{startContainer:e,startOffset:0,endContainer:e,endOffset:0,collapsed:E,commonAncestorContainer:e,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:q,setEnd:s,setStartBefore:g,setStartAfter:J,setEndBefore:K,setEndAfter:u,collapse:B,selectNode:y,selectNodeContents:G,compareBoundaryPoints:v,deleteContents:p,extractContents:I,cloneContents:d,insertNode:D,surroundContents:N,cloneRange:L});function x(){return e.createDocumentFragment()}function q(W,t){C(E,W,t)}function s(W,t){C(S,W,t)}function g(t){q(t.parentNode,n(t))}function J(t){q(t.parentNode,n(t)+1)}function K(t){s(t.parentNode,n(t))}function u(t){s(t.parentNode,n(t)+1)}function B(t){if(t){O[Q]=O[h];O[A]=O[V]}else{O[h]=O[Q];O[V]=O[A]}O.collapsed=E}function y(t){g(t);u(t)}function G(t){q(t,0);s(t,t.nodeType===1?t.childNodes.length:t.nodeValue.length)}function v(Z,t){var ac=O[h],X=O[V],ab=O[Q],W=O[A],aa=t.startContainer,ae=t.startOffset,Y=t.endContainer,ad=t.endOffset;if(Z===0){return H(ac,X,aa,ae)}if(Z===1){return H(ab,W,aa,ae)}if(Z===2){return H(ab,W,Y,ad)}if(Z===3){return H(ac,X,Y,ad)}}function p(){l(j)}function I(){return l(T)}function d(){return l(F)}function D(Z){var W=this[h],t=this[V],Y,X;if((W.nodeType===3||W.nodeType===4)&&W.nodeValue){if(!t){W.parentNode.insertBefore(Z,W)}else{if(t>=W.nodeValue.length){c.insertAfter(Z,W)}else{Y=W.splitText(t);W.parentNode.insertBefore(Z,Y)}}}else{if(W.childNodes.length>0){X=W.childNodes[t]}if(X){W.insertBefore(Z,X)}else{W.appendChild(Z)}}}function N(W){var t=O.extractContents();O.insertNode(W);W.appendChild(t);O.selectNode(W)}function L(){return k(new b(c),{startContainer:O[h],startOffset:O[V],endContainer:O[Q],endOffset:O[A],collapsed:O.collapsed,commonAncestorContainer:O.commonAncestorContainer})}function P(t,W){var X;if(t.nodeType==3){return t}if(W<0){return t}X=t.firstChild;while(X&&W>0){--W;X=X.nextSibling}if(X){return X}return t}function m(){return(O[h]==O[Q]&&O[V]==O[A])}function H(Y,aa,W,Z){var ab,X,t,ac,ae,ad;if(Y==W){if(aa==Z){return 0}if(aa0){O.collapse(W)}}else{O.collapse(W)}O.collapsed=m();O.commonAncestorContainer=c.findCommonAncestor(O[h],O[Q])}function l(ac){var ab,Y=0,ae=0,W,aa,X,Z,t,ad;if(O[h]==O[Q]){return f(ac)}for(ab=O[Q],W=ab.parentNode;W;ab=W,W=W.parentNode){if(W==O[h]){return r(ab,ac)}++Y}for(ab=O[h],W=ab.parentNode;W;ab=W,W=W.parentNode){if(W==O[Q]){return U(ab,ac)}++ae}aa=ae-Y;X=O[h];while(aa>0){X=X.parentNode;aa--}Z=O[Q];while(aa<0){Z=Z.parentNode;aa++}for(t=X.parentNode,ad=Z.parentNode;t!=ad;t=t.parentNode,ad=ad.parentNode){X=t;Z=ad}return o(X,Z,ac)}function f(ab){var ad,ae,t,X,Y,ac,Z,W,aa;if(ab!=j){ad=x()}if(O[V]==O[A]){return ad}if(O[h].nodeType==3){ae=O[h].nodeValue;t=ae.substring(O[V],O[A]);if(ab!=F){X=O[h];W=O[V];aa=O[A]-O[V];if(W===0&&aa>=X.nodeValue.length-1){X.parentNode.removeChild(X)}else{X.deleteData(W,aa)}O.collapse(E)}if(ab==j){return}if(t.length>0){ad.appendChild(e.createTextNode(t))}return ad}X=P(O[h],O[V]);Y=O[A]-O[V];while(X&&Y>0){ac=X.nextSibling;Z=z(X,ab);if(ad){ad.appendChild(Z)}--Y;X=ac}if(ab!=F){O.collapse(E)}return ad}function r(ac,Z){var ab,aa,W,t,Y,X;if(Z!=j){ab=x()}aa=i(ac,Z);if(ab){ab.appendChild(aa)}W=n(ac);t=W-O[V];if(t<=0){if(Z!=F){O.setEndBefore(ac);O.collapse(S)}return ab}aa=ac.previousSibling;while(t>0){Y=aa.previousSibling;X=z(aa,Z);if(ab){ab.insertBefore(X,ab.firstChild)}--t;aa=Y}if(Z!=F){O.setEndBefore(ac);O.collapse(S)}return ab}function U(aa,Z){var ac,W,ab,t,Y,X;if(Z!=j){ac=x()}ab=R(aa,Z);if(ac){ac.appendChild(ab)}W=n(aa);++W;t=O[A]-W;ab=aa.nextSibling;while(ab&&t>0){Y=ab.nextSibling;X=z(ab,Z);if(ac){ac.appendChild(X)}--t;ab=Y}if(Z!=F){O.setStartAfter(aa);O.collapse(E)}return ac}function o(aa,t,ad){var X,af,Z,ab,ac,W,ae,Y;if(ad!=j){af=x()}X=R(aa,ad);if(af){af.appendChild(X)}Z=aa.parentNode;ab=n(aa);ac=n(t);++ab;W=ac-ab;ae=aa.nextSibling;while(W>0){Y=ae.nextSibling;X=z(ae,ad);if(af){af.appendChild(X)}ae=Y;--W}X=i(t,ad);if(af){af.appendChild(X)}if(ad!=F){O.setStartAfter(aa);O.collapse(E)}return af}function i(ab,ac){var X=P(O[Q],O[A]-1),ad,aa,Z,t,W,Y=X!=O[Q];if(X==ab){return M(X,Y,S,ac)}ad=X.parentNode;aa=M(ad,S,S,ac);while(ad){while(X){Z=X.previousSibling;t=M(X,Y,S,ac);if(ac!=j){aa.insertBefore(t,aa.firstChild)}Y=E;X=Z}if(ad==ab){return aa}X=ad.previousSibling;ad=ad.parentNode;W=M(ad,S,S,ac);if(ac!=j){W.appendChild(aa)}aa=W}}function R(ab,ac){var Y=P(O[h],O[V]),Z=Y!=O[h],ad,aa,X,t,W;if(Y==ab){return M(Y,Z,E,ac)}ad=Y.parentNode;aa=M(ad,S,E,ac);while(ad){while(Y){X=Y.nextSibling;t=M(Y,Z,E,ac);if(ac!=j){aa.appendChild(t)}Z=E;Y=X}if(ad==ab){return aa}Y=ad.nextSibling;ad=ad.parentNode;W=M(ad,S,E,ac);if(ac!=j){W.appendChild(aa)}aa=W}}function M(t,Z,ac,ad){var Y,X,aa,W,ab;if(Z){return z(t,ad)}if(t.nodeType==3){Y=t.nodeValue;if(ac){W=O[V];X=Y.substring(W);aa=Y.substring(0,W)}else{W=O[A];X=Y.substring(0,W);aa=Y.substring(W)}if(ad!=F){t.nodeValue=aa}if(ad==j){return}ab=c.clone(t,S);ab.nodeValue=X;return ab}if(ad==j){return}return c.clone(t,S)}function z(W,t){if(t!=j){return t==F?c.clone(W,E):W}W.parentNode.removeChild(W)}}a.Range=b})(tinymce.dom);(function(){function a(d){var b=this,h=d.dom,c=true,f=false;function e(i,j){var k,t=0,q,n,m,l,o,r,p=-1,s;k=i.duplicate();k.collapse(j);s=k.parentElement();if(s.ownerDocument!==d.dom.doc){return}while(s.contentEditable==="false"){s=s.parentNode}if(!s.hasChildNodes()){return{node:s,inside:1}}m=s.children;q=m.length-1;while(t<=q){r=Math.floor((t+q)/2);l=m[r];k.moveToElementText(l);p=k.compareEndPoints(j?"StartToStart":"EndToEnd",i);if(p>0){q=r-1}else{if(p<0){t=r+1}else{return{node:l}}}}if(p<0){if(!l){k.moveToElementText(s);k.collapse(true);l=s;n=true}else{k.collapse(false)}o=0;while(k.compareEndPoints(j?"StartToStart":"StartToEnd",i)!==0){if(k.move("character",1)===0||s!=k.parentElement()){break}o++}}else{k.collapse(true);o=0;while(k.compareEndPoints(j?"StartToStart":"StartToEnd",i)!==0){if(k.move("character",-1)===0||s!=k.parentElement()){break}o++}}return{node:l,position:p,offset:o,inside:n}}function g(){var i=d.getRng(),r=h.createRng(),l,k,p,q,m,j;l=i.item?i.item(0):i.parentElement();if(l.ownerDocument!=h.doc){return r}k=d.isCollapsed();if(i.item){r.setStart(l.parentNode,h.nodeIndex(l));r.setEnd(r.startContainer,r.startOffset+1);return r}function o(A){var u=e(i,A),s,y,z=0,x,v,t;s=u.node;y=u.offset;if(u.inside&&!s.hasChildNodes()){r[A?"setStart":"setEnd"](s,0);return}if(y===v){r[A?"setStartBefore":"setEndAfter"](s);return}if(u.position<0){x=u.inside?s.firstChild:s.nextSibling;if(!x){r[A?"setStartAfter":"setEndAfter"](s);return}if(!y){if(x.nodeType==3){r[A?"setStart":"setEnd"](x,0)}else{r[A?"setStartBefore":"setEndBefore"](x)}return}while(x){t=x.nodeValue;z+=t.length;if(z>=y){s=x;z-=y;z=t.length-z;break}x=x.nextSibling}}else{x=s.previousSibling;if(!x){return r[A?"setStartBefore":"setEndBefore"](s)}if(!y){if(s.nodeType==3){r[A?"setStart":"setEnd"](x,s.nodeValue.length)}else{r[A?"setStartAfter":"setEndAfter"](x)}return}while(x){z+=x.nodeValue.length;if(z>=y){s=x;z-=y;break}x=x.previousSibling}}r[A?"setStart":"setEnd"](s,z)}try{o(true);if(!k){o()}}catch(n){if(n.number==-2147024809){m=b.getBookmark(2);p=i.duplicate();p.collapse(true);l=p.parentElement();if(!k){p=i.duplicate();p.collapse(false);q=p.parentElement();q.innerHTML=q.innerHTML}l.innerHTML=l.innerHTML;b.moveToBookmark(m);i=d.getRng();o(true);if(!k){o()}}else{throw n}}return r}this.getBookmark=function(m){var j=d.getRng(),o,i,l={};function n(u){var t,p,s,r,q=[];t=u.parentNode;p=h.getRoot().parentNode;while(t!=p&&t.nodeType!==9){s=t.children;r=s.length;while(r--){if(u===s[r]){q.push(r);break}}u=t;t=t.parentNode}return q}function k(q){var p;p=e(j,q);if(p){return{position:p.position,offset:p.offset,indexes:n(p.node),inside:p.inside}}}if(m===2){if(!j.item){l.start=k(true);if(!d.isCollapsed()){l.end=k()}}else{l.start={ctrl:true,indexes:n(j.item(0))}}}return l};this.moveToBookmark=function(k){var j,i=h.doc.body;function m(o){var r,q,n,p;r=h.getRoot();for(q=o.length-1;q>=0;q--){p=r.children;n=o[q];if(n<=p.length-1){r=p[n]}}return r}function l(r){var n=k[r?"start":"end"],q,p,o;if(n){q=n.position>0;p=i.createTextRange();p.moveToElementText(m(n.indexes));offset=n.offset;if(offset!==o){p.collapse(n.inside||q);p.moveStart("character",q?-offset:offset)}else{p.collapse(r)}j.setEndPoint(r?"StartToStart":"EndToStart",p);if(r){j.collapse(true)}}}if(k.start){if(k.start.ctrl){j=i.createControlRange();j.addElement(m(k.start.indexes));j.select()}else{j=i.createTextRange();l(true);l();j.select()}}};this.addRange=function(i){var n,l,k,p,s,q,r=d.dom.doc,m=r.body;function j(z){var u,y,t,x,v;t=h.create("a");u=z?k:s;y=z?p:q;x=n.duplicate();if(u==r||u==r.documentElement){u=m;y=0}if(u.nodeType==3){u.parentNode.insertBefore(t,u);x.moveToElementText(t);x.moveStart("character",y);h.remove(t);n.setEndPoint(z?"StartToStart":"EndToEnd",x)}else{v=u.childNodes;if(v.length){if(y>=v.length){h.insertAfter(t,v[v.length-1])}else{u.insertBefore(t,v[y])}x.moveToElementText(t)}else{if(u.canHaveHTML){u.innerHTML="\uFEFF";t=u.firstChild;x.moveToElementText(t);x.collapse(f)}}n.setEndPoint(z?"StartToStart":"EndToEnd",x);h.remove(t)}}k=i.startContainer;p=i.startOffset;s=i.endContainer;q=i.endOffset;n=m.createTextRange();if(k==s&&k.nodeType==1){if(p==q&&!k.hasChildNodes()){if(k.canHaveHTML){k.innerHTML="\uFEFF\uFEFF";n.moveToElementText(k.lastChild);n.select();h.doc.selection.clear();k.innerHTML="";return}else{p=h.nodeIndex(k);k=k.parentNode}}if(p==q-1){try{l=m.createControlRange();l.addElement(k.childNodes[p]);l.select();return}catch(o){}}}j(true);j();n.select()};this.getRangeAt=g}tinymce.dom.TridentSelection=a})();(function(a){a.dom.Element=function(f,d){var b=this,e,c;b.settings=d=d||{};b.id=f;b.dom=e=d.dom||a.DOM;if(!a.isIE){c=e.get(b.id)}a.each(("getPos,getRect,getParent,add,setStyle,getStyle,setStyles,setAttrib,setAttribs,getAttrib,addClass,removeClass,hasClass,getOuterHTML,setOuterHTML,remove,show,hide,isHidden,setHTML,get").split(/,/),function(g){b[g]=function(){var h=[f],j;for(j=0;j"+(i.item?i.item(0).outerHTML:i.htmlText);m.removeChild(m.firstChild)}else{m.innerHTML=i.toString()}}if(/^\s/.test(m.innerHTML)){j=" "}if(/\s+$/.test(m.innerHTML)){l=" "}h.getInner=true;h.content=g.isCollapsed()?"":j+g.serializer.serialize(m,h)+l;g.onGetContent.dispatch(g,h);return h.content},setContent:function(h,j){var o=this,g=o.getRng(),k,l=o.win.document,n,m;j=j||{format:"html"};j.set=true;h=j.content=h;if(!j.no_events){o.onBeforeSetContent.dispatch(o,j)}h=j.content;if(g.insertNode){h+='_';if(g.startContainer==l&&g.endContainer==l){l.body.innerHTML=h}else{g.deleteContents();if(l.body.childNodes.length===0){l.body.innerHTML=h}else{if(g.createContextualFragment){g.insertNode(g.createContextualFragment(h))}else{n=l.createDocumentFragment();m=l.createElement("div");n.appendChild(m);m.outerHTML=h;g.insertNode(n)}}}k=o.dom.get("__caret");g=l.createRange();g.setStartBefore(k);g.setEndBefore(k);o.setRng(g);o.dom.remove("__caret");try{o.setRng(g)}catch(i){}}else{if(g.item){l.execCommand("Delete",false,null);g=o.getRng()}if(/^\s+/.test(h)){g.pasteHTML('_'+h);o.dom.remove("__mce_tmp")}else{g.pasteHTML(h)}}if(!j.no_events){o.onSetContent.dispatch(o,j)}},getStart:function(){var h=this.getRng(),i,g,k,j;if(h.duplicate||h.item){if(h.item){return h.item(0)}k=h.duplicate();k.collapse(1);i=k.parentElement();g=j=h.parentElement();while(j=j.parentNode){if(j==i){i=g;break}}return i}else{i=h.startContainer;if(i.nodeType==1&&i.hasChildNodes()){i=i.childNodes[Math.min(i.childNodes.length-1,h.startOffset)]}if(i&&i.nodeType==3){return i.parentNode}return i}},getEnd:function(){var h=this,i=h.getRng(),j,g;if(i.duplicate||i.item){if(i.item){return i.item(0)}i=i.duplicate();i.collapse(0);j=i.parentElement();if(j&&j.nodeName=="BODY"){return j.lastChild||j}return j}else{j=i.endContainer;g=i.endOffset;if(j.nodeType==1&&j.hasChildNodes()){j=j.childNodes[g>0?g-1:g]}if(j&&j.nodeType==3){return j.parentNode}return j}},getBookmark:function(s,v){var y=this,n=y.dom,h,k,j,o,i,p,q,m="\uFEFF",x;function g(z,A){var t=0;e(n.select(z),function(C,B){if(C==A){t=B}});return t}function u(t){function z(E){var A,D,C,B=E?"start":"end";A=t[B+"Container"];D=t[B+"Offset"];if(A.nodeType==1&&A.nodeName=="TR"){C=A.childNodes;A=C[Math.min(E?D:D-1,C.length-1)];if(A){D=E?0:A.childNodes.length;t["set"+(E?"Start":"End")](A,D)}}}z(true);z();return t}function l(){var z=y.getRng(true),t=n.getRoot(),A={};function B(E,J){var D=E[J?"startContainer":"endContainer"],I=E[J?"startOffset":"endOffset"],C=[],F,H,G=0;if(D.nodeType==3){if(v){for(F=D.previousSibling;F&&F.nodeType==3;F=F.previousSibling){I+=F.nodeValue.length}}C.push(I)}else{H=D.childNodes;if(I>=H.length&&H.length){G=1;I=Math.max(0,H.length-1)}C.push(y.dom.nodeIndex(H[I],v)+G)}for(;D&&D!=t;D=D.parentNode){C.push(y.dom.nodeIndex(D,v))}return C}A.start=B(z,true);if(!y.isCollapsed()){A.end=B(z)}return A}if(s==2){if(y.tridentSel){return y.tridentSel.getBookmark(s)}return l()}if(s){return{rng:y.getRng()}}h=y.getRng();j=n.uniqueId();o=tinyMCE.activeEditor.selection.isCollapsed();x="overflow:hidden;line-height:0px";if(h.duplicate||h.item){if(!h.item){k=h.duplicate();try{h.collapse();h.pasteHTML(''+m+"");if(!o){k.collapse(false);h.moveToElementText(k.parentElement());if(h.compareEndPoints("StartToEnd",k)===0){k.move("character",-1)}k.pasteHTML(''+m+"")}}catch(r){return null}}else{p=h.item(0);i=p.nodeName;return{name:i,index:g(i,p)}}}else{p=y.getNode();i=p.nodeName;if(i=="IMG"){return{name:i,index:g(i,p)}}k=u(h.cloneRange());if(!o){k.collapse(false);k.insertNode(n.create("span",{"data-mce-type":"bookmark",id:j+"_end",style:x},m))}h=u(h);h.collapse(true);h.insertNode(n.create("span",{"data-mce-type":"bookmark",id:j+"_start",style:x},m))}y.moveToBookmark({id:j,keep:1});return{id:j}},moveToBookmark:function(o){var s=this,m=s.dom,j,i,g,r,k,u,p,q;function h(A){var t=o[A?"start":"end"],x,y,z,v;if(t){z=t[0];for(y=r,x=t.length-1;x>=1;x--){v=y.childNodes;if(t[x]>v.length-1){return}y=v[t[x]]}if(y.nodeType===3){z=Math.min(t[0],y.nodeValue.length)}if(y.nodeType===1){z=Math.min(t[0],y.childNodes.length)}if(A){g.setStart(y,z)}else{g.setEnd(y,z)}}return true}function l(B){var v=m.get(o.id+"_"+B),A,t,y,z,x=o.keep;if(v){A=v.parentNode;if(B=="start"){if(!x){t=m.nodeIndex(v)}else{A=v.firstChild;t=1}k=u=A;p=q=t}else{if(!x){t=m.nodeIndex(v)}else{A=v.firstChild;t=1}u=A;q=t}if(!x){z=v.previousSibling;y=v.nextSibling;e(d.grep(v.childNodes),function(C){if(C.nodeType==3){C.nodeValue=C.nodeValue.replace(/\uFEFF/g,"")}});while(v=m.get(o.id+"_"+B)){m.remove(v,1)}if(z&&y&&z.nodeType==y.nodeType&&z.nodeType==3&&!d.isOpera){t=z.nodeValue.length;z.appendData(y.nodeValue);m.remove(y);if(B=="start"){k=u=z;p=q=t}else{u=z;q=t}}}}}function n(t){if(m.isBlock(t)&&!t.innerHTML&&!b){t.innerHTML='
                    '}return t}if(o){if(o.start){g=m.createRng();r=m.getRoot();if(s.tridentSel){return s.tridentSel.moveToBookmark(o)}if(h(true)&&h()){s.setRng(g)}}else{if(o.id){l("start");l("end");if(k){g=m.createRng();g.setStart(n(k),p);g.setEnd(n(u),q);s.setRng(g)}}else{if(o.name){s.select(m.select(o.name)[o.index])}else{if(o.rng){s.setRng(o.rng)}}}}}},select:function(l,k){var j=this,m=j.dom,h=m.createRng(),g;function i(n,p){var o=new a(n,n);do{if(n.nodeType==3&&d.trim(n.nodeValue).length!==0){if(p){h.setStart(n,0)}else{h.setEnd(n,n.nodeValue.length)}return}if(n.nodeName=="BR"){if(p){h.setStartBefore(n)}else{h.setEndBefore(n)}return}}while(n=(p?o.next():o.prev()))}if(l){g=m.nodeIndex(l);h.setStart(l.parentNode,g);h.setEnd(l.parentNode,g+1);if(k){i(l,1);i(l)}j.setRng(h)}return l},isCollapsed:function(){var g=this,i=g.getRng(),h=g.getSel();if(!i||i.item){return false}if(i.compareEndPoints){return i.compareEndPoints("StartToEnd",i)===0}return !h||i.collapsed},collapse:function(g){var i=this,h=i.getRng(),j;if(h.item){j=h.item(0);h=i.win.document.body.createTextRange();h.moveToElementText(j)}h.collapse(!!g);i.setRng(h)},getSel:function(){var h=this,g=this.win;return g.getSelection?g.getSelection():g.document.selection},getRng:function(m){var h=this,j,g,l,k=h.win.document;if(m&&h.tridentSel){return h.tridentSel.getRangeAt(0)}try{if(j=h.getSel()){g=j.rangeCount>0?j.getRangeAt(0):(j.createRange?j.createRange():k.createRange())}}catch(i){}if(d.isIE&&g&&g.setStart&&k.selection.createRange().item){l=k.selection.createRange().item(0);g=k.createRange();g.setStartBefore(l);g.setEndAfter(l)}if(!g){g=k.createRange?k.createRange():k.body.createTextRange()}if(g.setStart&&g.startContainer.nodeType===9&&g.collapsed){l=h.dom.getRoot();g.setStart(l,0);g.setEnd(l,0)}if(h.selectedRange&&h.explicitRange){if(g.compareBoundaryPoints(g.START_TO_START,h.selectedRange)===0&&g.compareBoundaryPoints(g.END_TO_END,h.selectedRange)===0){g=h.explicitRange}else{h.selectedRange=null;h.explicitRange=null}}return g},setRng:function(k,g){var j,i=this;if(!i.tridentSel){j=i.getSel();if(j){i.explicitRange=k;try{j.removeAllRanges()}catch(h){}j.addRange(k);if(g===false&&j.extend){j.collapse(k.endContainer,k.endOffset);j.extend(k.startContainer,k.startOffset)}i.selectedRange=j.rangeCount>0?j.getRangeAt(0):null}}else{if(k.cloneRange){try{i.tridentSel.addRange(k);return}catch(h){}}try{k.select()}catch(h){}}},setNode:function(h){var g=this;g.setContent(g.dom.getOuterHTML(h));return h},getNode:function(){var i=this,h=i.getRng(),j=i.getSel(),m,l=h.startContainer,g=h.endContainer;function k(q,o){var p=q;while(q&&q.nodeType===3&&q.length===0){q=o?q.nextSibling:q.previousSibling}return q||p}if(!h){return i.dom.getRoot()}if(h.setStart){m=h.commonAncestorContainer;if(!h.collapsed){if(h.startContainer==h.endContainer){if(h.endOffset-h.startOffset<2){if(h.startContainer.hasChildNodes()){m=h.startContainer.childNodes[h.startOffset]}}}if(l.nodeType===3&&g.nodeType===3){if(l.length===h.startOffset){l=k(l.nextSibling,true)}else{l=l.parentNode}if(h.endOffset===0){g=k(g.previousSibling,false)}else{g=g.parentNode}if(l&&l===g){return l}}}if(m&&m.nodeType==3){return m.parentNode}return m}return h.item?h.item(0):h.parentElement()},getSelectedBlocks:function(p,h){var o=this,k=o.dom,m,l,i,j=[];m=k.getParent(p||o.getStart(),k.isBlock);l=k.getParent(h||o.getEnd(),k.isBlock);if(m){j.push(m)}if(m&&l&&m!=l){i=m;var g=new a(m,k.getRoot());while((i=g.next())&&i!=l){if(k.isBlock(i)){j.push(i)}}}if(l&&m!=l){j.push(l)}return j},isForward:function(){var i=this.dom,g=this.getSel(),j,h;if(!g||g.anchorNode==null||g.focusNode==null){return true}j=i.createRng();j.setStart(g.anchorNode,g.anchorOffset);j.collapse(true);h=i.createRng();h.setStart(g.focusNode,g.focusOffset);h.collapse(true);return j.compareBoundaryPoints(j.START_TO_START,h)<=0},normalize:function(){var h=this,g,m,l,j,i;function k(p){var o,r,n,s=h.dom,u=s.getRoot(),q,t,v;function y(z,A){var B=new a(z,s.getParent(z.parentNode,s.isBlock)||u);while(z=B[A?"prev":"next"]()){if(z.nodeName==="BR"){return true}}}function x(B,z){var C,A;z=z||o;C=new a(z,s.getParent(z.parentNode,s.isBlock)||u);while(q=C[B?"prev":"next"]()){if(q.nodeType===3&&q.nodeValue.length>0){o=q;r=B?q.nodeValue.length:0;m=true;return}if(s.isBlock(q)||t[q.nodeName.toLowerCase()]){return}A=q}if(l&&A){o=A;m=true;r=0}}o=g[(p?"start":"end")+"Container"];r=g[(p?"start":"end")+"Offset"];t=s.schema.getNonEmptyElements();if(o.nodeType===9){o=s.getRoot();r=0}if(o===u){if(p){q=o.childNodes[r>0?r-1:0];if(q){v=q.nodeName.toLowerCase();if(t[q.nodeName]||q.nodeName=="TABLE"){return}}}if(o.hasChildNodes()){o=o.childNodes[Math.min(!p&&r>0?r-1:r,o.childNodes.length-1)];r=0;if(o.hasChildNodes()&&!/TABLE/.test(o.nodeName)){q=o;n=new a(o,u);do{if(q.nodeType===3&&q.nodeValue.length>0){r=p?0:q.nodeValue.length;o=q;m=true;break}if(t[q.nodeName.toLowerCase()]){r=s.nodeIndex(q);o=q.parentNode;if(q.nodeName=="IMG"&&!p){r++}m=true;break}}while(q=(p?n.next():n.prev()))}}}if(l){if(o.nodeType===3&&r===0){x(true)}if(o.nodeType===1){q=o.childNodes[r];if(q&&q.nodeName==="BR"&&!y(q)&&!y(q,true)){x(true,o.childNodes[r])}}}if(p&&!l&&o.nodeType===3&&r===o.nodeValue.length){x(false)}if(m){g["set"+(p?"Start":"End")](o,r)}}if(d.isIE){return}g=h.getRng();l=g.collapsed;k(true);if(!l){k()}if(m){if(l){g.collapse(true)}h.setRng(g,h.isForward())}},destroy:function(h){var g=this;g.win=null;if(!h){d.removeUnload(g.destroy)}},_fixIESelection:function(){var h=this.dom,n=h.doc,i=n.body,k,o,g;function j(p,s){var q=i.createTextRange();try{q.moveToPoint(p,s)}catch(r){q=null}return q}function m(q){var p;if(q.button){p=j(q.x,q.y);if(p){if(p.compareEndPoints("StartToStart",o)>0){p.setEndPoint("StartToStart",o)}else{p.setEndPoint("EndToEnd",o)}p.select()}}else{l()}}function l(){var p=n.selection.createRange();if(o&&!p.item&&p.compareEndPoints("StartToEnd",p)===0){o.select()}h.unbind(n,"mouseup",l);h.unbind(n,"mousemove",m);o=k=0}n.documentElement.unselectable=true;h.bind(n,["mousedown","contextmenu"],function(p){if(p.target.nodeName==="HTML"){if(k){l()}g=n.documentElement;if(g.scrollHeight>g.clientHeight){return}k=1;o=j(p.x,p.y);if(o){h.bind(n,"mouseup",l);h.bind(n,"mousemove",m);h.win.focus();o.select()}}})}})})(tinymce);(function(a){a.dom.Serializer=function(e,i,f){var h,b,d=a.isIE,g=a.each,c;if(!e.apply_source_formatting){e.indent=false}i=i||a.DOM;f=f||new a.html.Schema(e);e.entity_encoding=e.entity_encoding||"named";e.remove_trailing_brs="remove_trailing_brs" in e?e.remove_trailing_brs:true;h=new a.util.Dispatcher(self);b=new a.util.Dispatcher(self);c=new a.html.DomParser(e,f);c.addAttributeFilter("src,href,style",function(k,j){var o=k.length,l,q,n="data-mce-"+j,p=e.url_converter,r=e.url_converter_scope,m;while(o--){l=k[o];q=l.attributes.map[n];if(q!==m){l.attr(j,q.length>0?q:null);l.attr(n,null)}else{q=l.attributes.map[j];if(j==="style"){q=i.serializeStyle(i.parseStyle(q),l.name)}else{if(p){q=p.call(r,q,j,l.name)}}l.attr(j,q.length>0?q:null)}}});c.addAttributeFilter("class",function(j,k){var l=j.length,m,n;while(l--){m=j[l];n=m.attr("class").replace(/(?:^|\s)mce(Item\w+|Selected)(?!\S)/g,"");m.attr("class",n.length>0?n:null)}});c.addAttributeFilter("data-mce-type",function(j,l,k){var m=j.length,n;while(m--){n=j[m];if(n.attributes.map["data-mce-type"]==="bookmark"&&!k.cleanup){n.remove()}}});c.addAttributeFilter("data-mce-expando",function(j,l,k){var m=j.length;while(m--){j[m].attr(l,null)}});c.addNodeFilter("script,style",function(k,l){var m=k.length,n,o;function j(p){return p.replace(/()/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*(()?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")}while(m--){n=k[m];o=n.firstChild?n.firstChild.value:"";if(l==="script"){n.attr("type",(n.attr("type")||"text/javascript").replace(/^mce\-/,""));if(o.length>0){n.firstChild.value="// "}}else{if(o.length>0){n.firstChild.value=""}}}});c.addNodeFilter("#comment",function(j,k){var l=j.length,m;while(l--){m=j[l];if(m.value.indexOf("[CDATA[")===0){m.name="#cdata";m.type=4;m.value=m.value.replace(/^\[CDATA\[|\]\]$/g,"")}else{if(m.value.indexOf("mce:protected ")===0){m.name="#text";m.type=3;m.raw=true;m.value=unescape(m.value).substr(14)}}}});c.addNodeFilter("xml:namespace,input",function(j,k){var l=j.length,m;while(l--){m=j[l];if(m.type===7){m.remove()}else{if(m.type===1){if(k==="input"&&!("type" in m.attributes.map)){m.attr("type","text")}}}}});if(e.fix_list_elements){c.addNodeFilter("ul,ol",function(k,l){var m=k.length,n,j;while(m--){n=k[m];j=n.parent;if(j.name==="ul"||j.name==="ol"){if(n.prev&&n.prev.name==="li"){n.prev.append(n)}}}})}c.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style",function(j,k){var l=j.length;while(l--){j[l].attr(k,null)}});return{schema:f,addNodeFilter:c.addNodeFilter,addAttributeFilter:c.addAttributeFilter,onPreProcess:h,onPostProcess:b,serialize:function(o,m){var l,p,k,j,n;if(d&&i.select("script,style,select,map").length>0){n=o.innerHTML;o=o.cloneNode(false);i.setHTML(o,n)}else{o=o.cloneNode(true)}l=o.ownerDocument.implementation;if(l.createHTMLDocument){p=l.createHTMLDocument("");g(o.nodeName=="BODY"?o.childNodes:[o],function(q){p.body.appendChild(p.importNode(q,true))});if(o.nodeName!="BODY"){o=p.body.firstChild}else{o=p.body}k=i.doc;i.doc=p}m=m||{};m.format=m.format||"html";if(!m.no_events){m.node=o;h.dispatch(self,m)}j=new a.html.Serializer(e,f);m.content=j.serialize(c.parse(a.trim(m.getInner?o.innerHTML:i.getOuterHTML(o)),m));if(!m.cleanup){m.content=m.content.replace(/\uFEFF|\u200B/g,"")}if(!m.no_events){b.dispatch(self,m)}if(k){i.doc=k}m.node=null;return m.content},addRules:function(j){f.addValidElements(j)},setRules:function(j){f.setValidElements(j)}}}})(tinymce);(function(a){a.dom.ScriptLoader=function(h){var c=0,k=1,i=2,l={},j=[],e={},d=[],g=0,f;function b(m,v){var x=this,q=a.DOM,s,o,r,n;function p(){q.remove(n);if(s){s.onreadystatechange=s.onload=s=null}v()}function u(){if(typeof(console)!=="undefined"&&console.log){console.log("Failed to load: "+m)}}n=q.uniqueId();if(a.isIE6){o=new a.util.URI(m);r=location;if(o.host==r.hostname&&o.port==r.port&&(o.protocol+":")==r.protocol&&o.protocol.toLowerCase()!="file"){a.util.XHR.send({url:a._addVer(o.getURI()),success:function(y){var t=q.create("script",{type:"text/javascript"});t.text=y;document.getElementsByTagName("head")[0].appendChild(t);q.remove(t);p()},error:u});return}}s=q.create("script",{id:n,type:"text/javascript",src:a._addVer(m)});if(!a.isIE){s.onload=p}s.onerror=u;if(!a.isOpera){s.onreadystatechange=function(){var t=s.readyState;if(t=="complete"||t=="loaded"){p()}}}(document.getElementsByTagName("head")[0]||document.body).appendChild(s)}this.isDone=function(m){return l[m]==i};this.markDone=function(m){l[m]=i};this.add=this.load=function(m,q,n){var o,p=l[m];if(p==f){j.push(m);l[m]=c}if(q){if(!e[m]){e[m]=[]}e[m].push({func:q,scope:n||this})}};this.loadQueue=function(n,m){this.loadScripts(j,n,m)};this.loadScripts=function(m,q,p){var o;function n(r){a.each(e[r],function(s){s.func.call(s.scope)});e[r]=f}d.push({func:q,scope:p||this});o=function(){var r=a.grep(m);m.length=0;a.each(r,function(s){if(l[s]==i){n(s);return}if(l[s]!=k){l[s]=k;g++;b(s,function(){l[s]=i;g--;n(s);o()})}});if(!g){a.each(d,function(s){s.func.call(s.scope)});d.length=0}};o()}};a.ScriptLoader=new a.dom.ScriptLoader()})(tinymce);(function(a){a.dom.RangeUtils=function(c){var b="\uFEFF";this.walk=function(d,s){var i=d.startContainer,l=d.startOffset,t=d.endContainer,m=d.endOffset,j,g,o,h,r,q,e;e=c.select("td.mceSelected,th.mceSelected");if(e.length>0){a.each(e,function(u){s([u])});return}function f(u){var v;v=u[0];if(v.nodeType===3&&v===i&&l>=v.nodeValue.length){u.splice(0,1)}v=u[u.length-1];if(m===0&&u.length>0&&v===t&&v.nodeType===3){u.splice(u.length-1,1)}return u}function p(x,v,u){var y=[];for(;x&&x!=u;x=x[v]){y.push(x)}return y}function n(v,u){do{if(v.parentNode==u){return v}v=v.parentNode}while(v)}function k(x,v,y){var u=y?"nextSibling":"previousSibling";for(h=x,r=h.parentNode;h&&h!=v;h=r){r=h.parentNode;q=p(h==x?h:h[u],u);if(q.length){if(!y){q.reverse()}s(f(q))}}}if(i.nodeType==1&&i.hasChildNodes()){i=i.childNodes[l]}if(t.nodeType==1&&t.hasChildNodes()){t=t.childNodes[Math.min(m-1,t.childNodes.length-1)]}if(i==t){return s(f([i]))}j=c.findCommonAncestor(i,t);for(h=i;h;h=h.parentNode){if(h===t){return k(i,j,true)}if(h===j){break}}for(h=t;h;h=h.parentNode){if(h===i){return k(t,j)}if(h===j){break}}g=n(i,j)||i;o=n(t,j)||t;k(i,g,true);q=p(g==i?g:g.nextSibling,"nextSibling",o==t?o.nextSibling:o);if(q.length){s(f(q))}k(t,o)};this.split=function(e){var h=e.startContainer,d=e.startOffset,i=e.endContainer,g=e.endOffset;function f(j,k){return j.splitText(k)}if(h==i&&h.nodeType==3){if(d>0&&dd){g=g-d;h=i=f(i,g).previousSibling;g=i.nodeValue.length;d=0}else{g=0}}}else{if(h.nodeType==3&&d>0&&d0&&g=l.length){q=0}}s=l[q];f.setAttrib(g,"tabindex","-1");f.setAttrib(s.id,"tabindex","0");f.get(s.id).focus();if(e.actOnFocus){e.onAction(s.id)}if(r){a.cancel(r)}};o=function(y){var u=37,t=39,x=38,z=40,q=27,s=14,r=13,v=32;switch(y.keyCode){case u:if(i){p.moveFocus(-1)}break;case t:if(i){p.moveFocus(1)}break;case x:if(n){p.moveFocus(-1)}break;case z:if(n){p.moveFocus(1)}break;case q:if(e.onCancel){e.onCancel();a.cancel(y)}break;case s:case r:case v:if(e.onAction){e.onAction(g);a.cancel(y)}break}};c(l,function(s,q){var r;if(!s.id){s.id=f.uniqueId("_mce_item_")}if(k){f.bind(s.id,"blur",h);r="-1"}else{r=(q===0?"0":"-1")}f.setAttrib(s.id,"tabindex",r);f.bind(f.get(s.id),"focus",j)});if(l[0]){g=l[0].id}f.setAttrib(m,"tabindex","-1");f.bind(f.get(m),"focus",d);f.bind(f.get(m),"keydown",o)}})})(tinymce);(function(c){var b=c.DOM,a=c.is;c.create("tinymce.ui.Control",{Control:function(f,e,d){this.id=f;this.settings=e=e||{};this.rendered=false;this.onRender=new c.util.Dispatcher(this);this.classPrefix="";this.scope=e.scope||this;this.disabled=0;this.active=0;this.editor=d},setAriaProperty:function(f,e){var d=b.get(this.id+"_aria")||b.get(this.id);if(d){b.setAttrib(d,"aria-"+f,!!e)}},focus:function(){b.get(this.id).focus()},setDisabled:function(d){if(d!=this.disabled){this.setAriaProperty("disabled",d);this.setState("Disabled",d);this.setState("Enabled",!d);this.disabled=d}},isDisabled:function(){return this.disabled},setActive:function(d){if(d!=this.active){this.setState("Active",d);this.active=d;this.setAriaProperty("pressed",d)}},isActive:function(){return this.active},setState:function(f,d){var e=b.get(this.id);f=this.classPrefix+f;if(d){b.addClass(e,f)}else{b.removeClass(e,f)}},isRendered:function(){return this.rendered},renderHTML:function(){},renderTo:function(d){b.setHTML(d,this.renderHTML())},postRender:function(){var e=this,d;if(a(e.disabled)){d=e.disabled;e.disabled=-1;e.setDisabled(d)}if(a(e.active)){d=e.active;e.active=-1;e.setActive(d)}},remove:function(){b.remove(this.id);this.destroy()},destroy:function(){c.dom.Event.clear(this.id)}})})(tinymce);tinymce.create("tinymce.ui.Container:tinymce.ui.Control",{Container:function(c,b,a){this.parent(c,b,a);this.controls=[];this.lookup={}},add:function(a){this.lookup[a.id]=a;this.controls.push(a);return a},get:function(a){return this.lookup[a]}});tinymce.create("tinymce.ui.Separator:tinymce.ui.Control",{Separator:function(b,a){this.parent(b,a);this.classPrefix="mceSeparator";this.setDisabled(true)},renderHTML:function(){return tinymce.DOM.createHTML("span",{"class":this.classPrefix,role:"separator","aria-orientation":"vertical",tabindex:"-1"})}});(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.MenuItem:tinymce.ui.Control",{MenuItem:function(g,f){this.parent(g,f);this.classPrefix="mceMenuItem"},setSelected:function(f){this.setState("Selected",f);this.setAriaProperty("checked",!!f);this.selected=f},isSelected:function(){return this.selected},postRender:function(){var f=this;f.parent();if(c(f.selected)){f.setSelected(f.selected)}}})})(tinymce);(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.Menu:tinymce.ui.MenuItem",{Menu:function(h,g){var f=this;f.parent(h,g);f.items={};f.collapsed=false;f.menuCount=0;f.onAddItem=new d.util.Dispatcher(this)},expand:function(g){var f=this;if(g){a(f,function(h){if(h.expand){h.expand()}},"items",f)}f.collapsed=false},collapse:function(g){var f=this;if(g){a(f,function(h){if(h.collapse){h.collapse()}},"items",f)}f.collapsed=true},isCollapsed:function(){return this.collapsed},add:function(f){if(!f.settings){f=new d.ui.MenuItem(f.id||b.uniqueId(),f)}this.onAddItem.dispatch(this,f);return this.items[f.id]=f},addSeparator:function(){return this.add({separator:true})},addMenu:function(f){if(!f.collapse){f=this.createMenu(f)}this.menuCount++;return this.add(f)},hasMenus:function(){return this.menuCount!==0},remove:function(f){delete this.items[f.id]},removeAll:function(){var f=this;a(f,function(g){if(g.removeAll){g.removeAll()}else{g.remove()}g.destroy()},"items",f);f.items={}},createMenu:function(g){var f=new d.ui.Menu(g.id||b.uniqueId(),g);f.onAddItem.add(this.onAddItem.dispatch,this.onAddItem);return f}})})(tinymce);(function(e){var d=e.is,c=e.DOM,f=e.each,a=e.dom.Event,b=e.dom.Element;e.create("tinymce.ui.DropMenu:tinymce.ui.Menu",{DropMenu:function(h,g){g=g||{};g.container=g.container||c.doc.body;g.offset_x=g.offset_x||0;g.offset_y=g.offset_y||0;g.vp_offset_x=g.vp_offset_x||0;g.vp_offset_y=g.vp_offset_y||0;if(d(g.icons)&&!g.icons){g["class"]+=" mceNoIcons"}this.parent(h,g);this.onShowMenu=new e.util.Dispatcher(this);this.onHideMenu=new e.util.Dispatcher(this);this.classPrefix="mceMenu"},createMenu:function(j){var h=this,i=h.settings,g;j.container=j.container||i.container;j.parent=h;j.constrain=j.constrain||i.constrain;j["class"]=j["class"]||i["class"];j.vp_offset_x=j.vp_offset_x||i.vp_offset_x;j.vp_offset_y=j.vp_offset_y||i.vp_offset_y;j.keyboard_focus=i.keyboard_focus;g=new e.ui.DropMenu(j.id||c.uniqueId(),j);g.onAddItem.add(h.onAddItem.dispatch,h.onAddItem);return g},focus:function(){var g=this;if(g.keyboardNav){g.keyboardNav.focus()}},update:function(){var i=this,j=i.settings,g=c.get("menu_"+i.id+"_tbl"),l=c.get("menu_"+i.id+"_co"),h,k;h=j.max_width?Math.min(g.offsetWidth,j.max_width):g.offsetWidth;k=j.max_height?Math.min(g.offsetHeight,j.max_height):g.offsetHeight;if(!c.boxModel){i.element.setStyles({width:h+2,height:k+2})}else{i.element.setStyles({width:h,height:k})}if(j.max_width){c.setStyle(l,"width",h)}if(j.max_height){c.setStyle(l,"height",k);if(g.clientHeightv){p=r?r-u:Math.max(0,(v-A.vp_offset_x)-u)}if((n+A.vp_offset_y+l)>q){n=Math.max(0,(q-A.vp_offset_y)-l)}}c.setStyles(o,{left:p,top:n});z.element.update();z.isMenuVisible=1;z.mouseClickFunc=a.add(o,"click",function(s){var h;s=s.target;if(s&&(s=c.getParent(s,"tr"))&&!c.hasClass(s,m+"ItemSub")){h=z.items[s.id];if(h.isDisabled()){return}k=z;while(k){if(k.hideMenu){k.hideMenu()}k=k.settings.parent}if(h.settings.onclick){h.settings.onclick(s)}return false}});if(z.hasMenus()){z.mouseOverFunc=a.add(o,"mouseover",function(x){var h,t,s;x=x.target;if(x&&(x=c.getParent(x,"tr"))){h=z.items[x.id];if(z.lastMenu){z.lastMenu.collapse(1)}if(h.isDisabled()){return}if(x&&c.hasClass(x,m+"ItemSub")){t=c.getRect(x);h.showMenu((t.x+t.w-i),t.y-i,t.x);z.lastMenu=h;c.addClass(c.get(h.id).firstChild,m+"ItemActive")}}})}a.add(o,"keydown",z._keyHandler,z);z.onShowMenu.dispatch(z);if(A.keyboard_focus){z._setupKeyboardNav()}},hideMenu:function(j){var g=this,i=c.get("menu_"+g.id),h;if(!g.isMenuVisible){return}if(g.keyboardNav){g.keyboardNav.destroy()}a.remove(i,"mouseover",g.mouseOverFunc);a.remove(i,"click",g.mouseClickFunc);a.remove(i,"keydown",g._keyHandler);c.hide(i);g.isMenuVisible=0;if(!j){g.collapse(1)}if(g.element){g.element.hide()}if(h=c.get(g.id)){c.removeClass(h.firstChild,g.classPrefix+"ItemActive")}g.onHideMenu.dispatch(g)},add:function(i){var g=this,h;i=g.parent(i);if(g.isRendered&&(h=c.get("menu_"+g.id))){g._add(c.select("tbody",h)[0],i)}return i},collapse:function(g){this.parent(g);this.hideMenu(1)},remove:function(g){c.remove(g.id);this.destroy();return this.parent(g)},destroy:function(){var g=this,h=c.get("menu_"+g.id);if(g.keyboardNav){g.keyboardNav.destroy()}a.remove(h,"mouseover",g.mouseOverFunc);a.remove(c.select("a",h),"focus",g.mouseOverFunc);a.remove(h,"click",g.mouseClickFunc);a.remove(h,"keydown",g._keyHandler);if(g.element){g.element.remove()}c.remove(h)},renderNode:function(){var i=this,j=i.settings,l,h,k,g;g=c.create("div",{role:"listbox",id:"menu_"+i.id,"class":j["class"],style:"position:absolute;left:0;top:0;z-index:200000;outline:0"});if(i.settings.parent){c.setAttrib(g,"aria-parent","menu_"+i.settings.parent.id)}k=c.add(g,"div",{role:"presentation",id:"menu_"+i.id+"_co","class":i.classPrefix+(j["class"]?" "+j["class"]:"")});i.element=new b("menu_"+i.id,{blocker:1,container:j.container});if(j.menu_line){c.add(k,"span",{"class":i.classPrefix+"Line"})}l=c.add(k,"table",{role:"presentation",id:"menu_"+i.id+"_tbl",border:0,cellPadding:0,cellSpacing:0});h=c.add(l,"tbody");f(i.items,function(m){i._add(h,m)});i.rendered=true;return g},_setupKeyboardNav:function(){var i,h,g=this;i=c.get("menu_"+g.id);h=c.select("a[role=option]","menu_"+g.id);h.splice(0,0,i);g.keyboardNav=new e.ui.KeyboardNavigation({root:"menu_"+g.id,items:h,onCancel:function(){g.hideMenu()},enableUpDown:true});i.focus()},_keyHandler:function(g){var h=this,i;switch(g.keyCode){case 37:if(h.settings.parent){h.hideMenu();h.settings.parent.focus();a.cancel(g)}break;case 39:if(h.mouseOverFunc){h.mouseOverFunc(g)}break}},_add:function(j,h){var i,q=h.settings,p,l,k,m=this.classPrefix,g;if(q.separator){l=c.add(j,"tr",{id:h.id,"class":m+"ItemSeparator"});c.add(l,"td",{"class":m+"ItemSeparator"});if(i=l.previousSibling){c.addClass(i,"mceLast")}return}i=l=c.add(j,"tr",{id:h.id,"class":m+"Item "+m+"ItemEnabled"});i=k=c.add(i,q.titleItem?"th":"td");i=p=c.add(i,"a",{id:h.id+"_aria",role:q.titleItem?"presentation":"option",href:"javascript:;",onclick:"return false;",onmousedown:"return false;"});if(q.parent){c.setAttrib(p,"aria-haspopup","true");c.setAttrib(p,"aria-owns","menu_"+h.id)}c.addClass(k,q["class"]);g=c.add(i,"span",{"class":"mceIcon"+(q.icon?" mce_"+q.icon:"")});if(q.icon_src){c.add(g,"img",{src:q.icon_src})}i=c.add(i,q.element||"span",{"class":"mceText",title:h.settings.title},h.settings.title);if(h.settings.style){if(typeof h.settings.style=="function"){h.settings.style=h.settings.style()}c.setAttrib(i,"style",h.settings.style)}if(j.childNodes.length==1){c.addClass(l,"mceFirst")}if((i=l.previousSibling)&&c.hasClass(i,m+"ItemSeparator")){c.addClass(l,"mceFirst")}if(h.collapse){c.addClass(l,m+"ItemSub")}if(i=l.previousSibling){c.removeClass(i,"mceLast")}c.addClass(l,"mceLast")}})})(tinymce);(function(b){var a=b.DOM;b.create("tinymce.ui.Button:tinymce.ui.Control",{Button:function(e,d,c){this.parent(e,d,c);this.classPrefix="mceButton"},renderHTML:function(){var f=this.classPrefix,e=this.settings,d,c;c=a.encode(e.label||"");d='';if(e.image&&!(this.editor&&this.editor.forcedHighContrastMode)){d+=''+a.encode(e.title)+''+c}else{d+=''+(c?''+c+"":"")}d+='";d+="";return d},postRender:function(){var d=this,e=d.settings,c;if(b.isIE&&d.editor){b.dom.Event.add(d.id,"mousedown",function(f){var g=d.editor.selection.getNode().nodeName;c=g==="IMG"?d.editor.selection.getBookmark():null})}b.dom.Event.add(d.id,"click",function(f){if(!d.isDisabled()){if(b.isIE&&d.editor&&c!==null){d.editor.selection.moveToBookmark(c)}return e.onclick.call(e.scope,f)}});b.dom.Event.add(d.id,"keyup",function(f){if(!d.isDisabled()&&f.keyCode==b.VK.SPACEBAR){return e.onclick.call(e.scope,f)}})}})})(tinymce);(function(e){var d=e.DOM,b=e.dom.Event,f=e.each,a=e.util.Dispatcher,c;e.create("tinymce.ui.ListBox:tinymce.ui.Control",{ListBox:function(j,i,g){var h=this;h.parent(j,i,g);h.items=[];h.onChange=new a(h);h.onPostRender=new a(h);h.onAdd=new a(h);h.onRenderMenu=new e.util.Dispatcher(this);h.classPrefix="mceListBox";h.marked={}},select:function(h){var g=this,j,i;g.marked={};if(h==c){return g.selectByIndex(-1)}if(h&&typeof(h)=="function"){i=h}else{i=function(k){return k==h}}if(h!=g.selectedValue){f(g.items,function(l,k){if(i(l.value)){j=1;g.selectByIndex(k);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(g){var i=this,j,k,h;i.marked={};if(g!=i.selectedIndex){j=d.get(i.id+"_text");h=d.get(i.id+"_voiceDesc");k=i.items[g];if(k){i.selectedValue=k.value;i.selectedIndex=g;d.setHTML(j,d.encode(k.title));d.setHTML(h,i.settings.title+" - "+k.title);d.removeClass(j,"mceTitle");d.setAttrib(i.id,"aria-valuenow",k.title)}else{d.setHTML(j,d.encode(i.settings.title));d.setHTML(h,d.encode(i.settings.title));d.addClass(j,"mceTitle");i.selectedValue=i.selectedIndex=null;d.setAttrib(i.id,"aria-valuenow",i.settings.title)}j=0}},mark:function(g){this.marked[g]=true},add:function(j,g,i){var h=this;i=i||{};i=e.extend(i,{title:j,value:g});h.items.push(i);h.onAdd.dispatch(h,i)},getLength:function(){return this.items.length},renderHTML:function(){var j="",g=this,i=g.settings,k=g.classPrefix;j='';j+="";j+="";j+="";return j},showMenu:function(){var h=this,j,i=d.get(this.id),g;if(h.isDisabled()||h.items.length===0){return}if(h.menu&&h.menu.isMenuVisible){return h.hideMenu()}if(!h.isMenuRendered){h.renderMenu();h.isMenuRendered=true}j=d.getPos(i);g=h.menu;g.settings.offset_x=j.x;g.settings.offset_y=j.y;g.settings.keyboard_focus=!e.isOpera;f(h.items,function(k){if(g.items[k.id]){g.items[k.id].setSelected(0)}});f(h.items,function(k){if(g.items[k.id]&&h.marked[k.value]){g.items[k.id].setSelected(1)}if(k.value===h.selectedValue){g.items[k.id].setSelected(1)}});g.showMenu(0,i.clientHeight);b.add(d.doc,"mousedown",h.hideMenu,h);d.addClass(h.id,h.classPrefix+"Selected")},hideMenu:function(h){var g=this;if(g.menu&&g.menu.isMenuVisible){d.removeClass(g.id,g.classPrefix+"Selected");if(h&&h.type=="mousedown"&&(h.target.id==g.id+"_text"||h.target.id==g.id+"_open")){return}if(!h||!d.getParent(h.target,".mceMenu")){d.removeClass(g.id,g.classPrefix+"Selected");b.remove(d.doc,"mousedown",g.hideMenu,g);g.menu.hideMenu()}}},renderMenu:function(){var h=this,g;g=h.settings.control_manager.createDropMenu(h.id+"_menu",{menu_line:1,"class":h.classPrefix+"Menu mceNoIcons",max_width:250,max_height:150});g.onHideMenu.add(function(){h.hideMenu();h.focus()});g.add({title:h.settings.title,"class":"mceMenuItemTitle",onclick:function(){if(h.settings.onselect("")!==false){h.select("")}}});f(h.items,function(i){if(i.value===c){g.add({title:i.title,role:"option","class":"mceMenuItemTitle",onclick:function(){if(h.settings.onselect("")!==false){h.select("")}}})}else{i.id=d.uniqueId();i.role="option";i.onclick=function(){if(h.settings.onselect(i.value)!==false){h.select(i.value)}};g.add(i)}});h.onRenderMenu.dispatch(h,g);h.menu=g},postRender:function(){var g=this,h=g.classPrefix;b.add(g.id,"click",g.showMenu,g);b.add(g.id,"keydown",function(i){if(i.keyCode==32){g.showMenu(i);b.cancel(i)}});b.add(g.id,"focus",function(){if(!g._focused){g.keyDownHandler=b.add(g.id,"keydown",function(i){if(i.keyCode==40){g.showMenu();b.cancel(i)}});g.keyPressHandler=b.add(g.id,"keypress",function(j){var i;if(j.keyCode==13){i=g.selectedValue;g.selectedValue=null;b.cancel(j);g.settings.onselect(i)}})}g._focused=1});b.add(g.id,"blur",function(){b.remove(g.id,"keydown",g.keyDownHandler);b.remove(g.id,"keypress",g.keyPressHandler);g._focused=0});if(e.isIE6||!d.boxModel){b.add(g.id,"mouseover",function(){if(!d.hasClass(g.id,h+"Disabled")){d.addClass(g.id,h+"Hover")}});b.add(g.id,"mouseout",function(){if(!d.hasClass(g.id,h+"Disabled")){d.removeClass(g.id,h+"Hover")}})}g.onPostRender.dispatch(g,d.get(g.id))},destroy:function(){this.parent();b.clear(this.id+"_text");b.clear(this.id+"_open")}})})(tinymce);(function(e){var d=e.DOM,b=e.dom.Event,f=e.each,a=e.util.Dispatcher,c;e.create("tinymce.ui.NativeListBox:tinymce.ui.ListBox",{NativeListBox:function(h,g){this.parent(h,g);this.classPrefix="mceNativeListBox"},setDisabled:function(g){d.get(this.id).disabled=g;this.setAriaProperty("disabled",g)},isDisabled:function(){return d.get(this.id).disabled},select:function(h){var g=this,j,i;if(h==c){return g.selectByIndex(-1)}if(h&&typeof(h)=="function"){i=h}else{i=function(k){return k==h}}if(h!=g.selectedValue){f(g.items,function(l,k){if(i(l.value)){j=1;g.selectByIndex(k);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(g){d.get(this.id).selectedIndex=g+1;this.selectedValue=this.items[g]?this.items[g].value:null},add:function(k,h,g){var j,i=this;g=g||{};g.value=h;if(i.isRendered()){d.add(d.get(this.id),"option",g,k)}j={title:k,value:h,attribs:g};i.items.push(j);i.onAdd.dispatch(i,j)},getLength:function(){return this.items.length},renderHTML:function(){var i,g=this;i=d.createHTML("option",{value:""},"-- "+g.settings.title+" --");f(g.items,function(h){i+=d.createHTML("option",{value:h.value},h.title)});i=d.createHTML("select",{id:g.id,"class":"mceNativeListBox","aria-labelledby":g.id+"_aria"},i);i+=d.createHTML("span",{id:g.id+"_aria",style:"display: none"},g.settings.title);return i},postRender:function(){var h=this,i,j=true;h.rendered=true;function g(l){var k=h.items[l.target.selectedIndex-1];if(k&&(k=k.value)){h.onChange.dispatch(h,k);if(h.settings.onselect){h.settings.onselect(k)}}}b.add(h.id,"change",g);b.add(h.id,"keydown",function(l){var k;b.remove(h.id,"change",i);j=false;k=b.add(h.id,"blur",function(){if(j){return}j=true;b.add(h.id,"change",g);b.remove(h.id,"blur",k)});if(e.isWebKit&&(l.keyCode==37||l.keyCode==39)){return b.prevent(l)}if(l.keyCode==13||l.keyCode==32){g(l);return b.cancel(l)}});h.onPostRender.dispatch(h,d.get(h.id))}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.MenuButton:tinymce.ui.Button",{MenuButton:function(g,f,e){this.parent(g,f,e);this.onRenderMenu=new c.util.Dispatcher(this);f.menu_container=f.menu_container||b.doc.body},showMenu:function(){var g=this,j,i,h=b.get(g.id),f;if(g.isDisabled()){return}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}if(g.isMenuVisible){return g.hideMenu()}j=b.getPos(g.settings.menu_container);i=b.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.vp_offset_x=i.x;f.settings.vp_offset_y=i.y;f.settings.keyboard_focus=g._focused;f.showMenu(0,h.firstChild.clientHeight);a.add(b.doc,"mousedown",g.hideMenu,g);g.setState("Selected",1);g.isMenuVisible=1},renderMenu:function(){var f=this,e;e=f.settings.control_manager.createDropMenu(f.id+"_menu",{menu_line:1,"class":this.classPrefix+"Menu",icons:f.settings.icons});e.onHideMenu.add(function(){f.hideMenu();f.focus()});f.onRenderMenu.dispatch(f,e);f.menu=e},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&b.getParent(g.target,function(h){return h.id===f.id||h.id===f.id+"_open"})){return}if(!g||!b.getParent(g.target,".mceMenu")){f.setState("Selected",0);a.remove(b.doc,"mousedown",f.hideMenu,f);if(f.menu){f.menu.hideMenu()}}f.isMenuVisible=0},postRender:function(){var e=this,f=e.settings;a.add(e.id,"click",function(){if(!e.isDisabled()){if(f.onclick){f.onclick(e.value)}e.showMenu()}})}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.SplitButton:tinymce.ui.MenuButton",{SplitButton:function(g,f,e){this.parent(g,f,e);this.classPrefix="mceSplitButton"},renderHTML:function(){var i,f=this,g=f.settings,e;i="";if(g.image){e=b.createHTML("img ",{src:g.image,role:"presentation","class":"mceAction "+g["class"]})}else{e=b.createHTML("span",{"class":"mceAction "+g["class"]},"")}e+=b.createHTML("span",{"class":"mceVoiceLabel mceIconOnly",id:f.id+"_voice",style:"display:none;"},g.title);i+=""+b.createHTML("a",{role:"button",id:f.id+"_action",tabindex:"-1",href:"javascript:;","class":"mceAction "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"";e=b.createHTML("span",{"class":"mceOpen "+g["class"]},'');i+=""+b.createHTML("a",{role:"button",id:f.id+"_open",tabindex:"-1",href:"javascript:;","class":"mceOpen "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"";i+="";i=b.createHTML("table",{role:"presentation","class":"mceSplitButton mceSplitButtonEnabled "+g["class"],cellpadding:"0",cellspacing:"0",title:g.title},i);return b.createHTML("div",{id:f.id,role:"button",tabindex:"0","aria-labelledby":f.id+"_voice","aria-haspopup":"true"},i)},postRender:function(){var e=this,g=e.settings,f;if(g.onclick){f=function(h){if(!e.isDisabled()){g.onclick(e.value);a.cancel(h)}};a.add(e.id+"_action","click",f);a.add(e.id,["click","keydown"],function(h){var k=32,m=14,i=13,j=38,l=40;if((h.keyCode===32||h.keyCode===13||h.keyCode===14)&&!h.altKey&&!h.ctrlKey&&!h.metaKey){f();a.cancel(h)}else{if(h.type==="click"||h.keyCode===l){e.showMenu();a.cancel(h)}}})}a.add(e.id+"_open","click",function(h){e.showMenu();a.cancel(h)});a.add([e.id,e.id+"_open"],"focus",function(){e._focused=1});a.add([e.id,e.id+"_open"],"blur",function(){e._focused=0});if(c.isIE6||!b.boxModel){a.add(e.id,"mouseover",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.addClass(e.id,"mceSplitButtonHover")}});a.add(e.id,"mouseout",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.removeClass(e.id,"mceSplitButtonHover")}})}},destroy:function(){this.parent();a.clear(this.id+"_action");a.clear(this.id+"_open");a.clear(this.id)}})})(tinymce);(function(d){var c=d.DOM,a=d.dom.Event,b=d.is,e=d.each;d.create("tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton",{ColorSplitButton:function(i,h,f){var g=this;g.parent(i,h,f);g.settings=h=d.extend({colors:"000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF",grid_width:8,default_color:"#888888"},g.settings);g.onShowMenu=new d.util.Dispatcher(g);g.onHideMenu=new d.util.Dispatcher(g);g.value=h.default_color},showMenu:function(){var f=this,g,j,i,h;if(f.isDisabled()){return}if(!f.isMenuRendered){f.renderMenu();f.isMenuRendered=true}if(f.isMenuVisible){return f.hideMenu()}i=c.get(f.id);c.show(f.id+"_menu");c.addClass(i,"mceSplitButtonSelected");h=c.getPos(i);c.setStyles(f.id+"_menu",{left:h.x,top:h.y+i.firstChild.clientHeight,zIndex:200000});i=0;a.add(c.doc,"mousedown",f.hideMenu,f);f.onShowMenu.dispatch(f);if(f._focused){f._keyHandler=a.add(f.id+"_menu","keydown",function(k){if(k.keyCode==27){f.hideMenu()}});c.select("a",f.id+"_menu")[0].focus()}f.isMenuVisible=1},hideMenu:function(g){var f=this;if(f.isMenuVisible){if(g&&g.type=="mousedown"&&c.getParent(g.target,function(h){return h.id===f.id+"_open"})){return}if(!g||!c.getParent(g.target,".mceSplitButtonMenu")){c.removeClass(f.id,"mceSplitButtonSelected");a.remove(c.doc,"mousedown",f.hideMenu,f);a.remove(f.id+"_menu","keydown",f._keyHandler);c.hide(f.id+"_menu")}f.isMenuVisible=0;f.onHideMenu.dispatch()}},renderMenu:function(){var p=this,h,k=0,q=p.settings,g,j,l,o,f;o=c.add(q.menu_container,"div",{role:"listbox",id:p.id+"_menu","class":q.menu_class+" "+q["class"],style:"position:absolute;left:0;top:-1000px;"});h=c.add(o,"div",{"class":q["class"]+" mceSplitButtonMenu"});c.add(h,"span",{"class":"mceMenuLine"});g=c.add(h,"table",{role:"presentation","class":"mceColorSplitMenu"});j=c.add(g,"tbody");k=0;e(b(q.colors,"array")?q.colors:q.colors.split(","),function(m){m=m.replace(/^#/,"");if(!k--){l=c.add(j,"tr");k=q.grid_width-1}g=c.add(l,"td");var i={href:"javascript:;",style:{backgroundColor:"#"+m},title:p.editor.getLang("colors."+m,m),"data-mce-color":"#"+m};if(!d.isIE){i.role="option"}g=c.add(g,"a",i);if(p.editor.forcedHighContrastMode){g=c.add(g,"canvas",{width:16,height:16,"aria-hidden":"true"});if(g.getContext&&(f=g.getContext("2d"))){f.fillStyle="#"+m;f.fillRect(0,0,16,16)}else{c.remove(g)}}});if(q.more_colors_func){g=c.add(j,"tr");g=c.add(g,"td",{colspan:q.grid_width,"class":"mceMoreColors"});g=c.add(g,"a",{role:"option",id:p.id+"_more",href:"javascript:;",onclick:"return false;","class":"mceMoreColors"},q.more_colors_title);a.add(g,"click",function(i){q.more_colors_func.call(q.more_colors_scope||this);return a.cancel(i)})}c.addClass(h,"mceColorSplitMenu");new d.ui.KeyboardNavigation({root:p.id+"_menu",items:c.select("a",p.id+"_menu"),onCancel:function(){p.hideMenu();p.focus()}});a.add(p.id+"_menu","mousedown",function(i){return a.cancel(i)});a.add(p.id+"_menu","click",function(i){var m;i=c.getParent(i.target,"a",j);if(i&&i.nodeName.toLowerCase()=="a"&&(m=i.getAttribute("data-mce-color"))){p.setColor(m)}return false});return o},setColor:function(f){this.displayColor(f);this.hideMenu();this.settings.onselect(f)},displayColor:function(g){var f=this;c.setStyle(f.id+"_preview","backgroundColor",g);f.value=g},postRender:function(){var f=this,g=f.id;f.parent();c.add(g+"_action","div",{id:g+"_preview","class":"mceColorPreview"});c.setStyle(f.id+"_preview","backgroundColor",f.value)},destroy:function(){this.parent();a.clear(this.id+"_menu");a.clear(this.id+"_more");c.remove(this.id+"_menu")}})})(tinymce);(function(b){var d=b.DOM,c=b.each,a=b.dom.Event;b.create("tinymce.ui.ToolbarGroup:tinymce.ui.Container",{renderHTML:function(){var f=this,i=[],e=f.controls,j=b.each,g=f.settings;i.push('
                    ');i.push("");i.push('");j(e,function(h){i.push(h.renderHTML())});i.push("");i.push("
                    ");return i.join("")},focus:function(){var e=this;d.get(e.id).focus()},postRender:function(){var f=this,e=[];c(f.controls,function(g){c(g.controls,function(h){if(h.id){e.push(h)}})});f.keyNav=new b.ui.KeyboardNavigation({root:f.id,items:e,onCancel:function(){if(b.isWebKit){d.get(f.editor.id+"_ifr").focus()}f.editor.focus()},excludeFromTabOrder:!f.settings.tab_focus_toolbar})},destroy:function(){var e=this;e.parent();e.keyNav.destroy();a.clear(e.id)}})})(tinymce);(function(a){var c=a.DOM,b=a.each;a.create("tinymce.ui.Toolbar:tinymce.ui.Container",{renderHTML:function(){var m=this,f="",j,k,n=m.settings,e,d,g,l;l=m.controls;for(e=0;e"))}if(d&&k.ListBox){if(d.Button||d.SplitButton){f+=c.createHTML("td",{"class":"mceToolbarEnd"},c.createHTML("span",null,""))}}if(c.stdMode){f+=''+k.renderHTML()+""}else{f+=""+k.renderHTML()+""}if(g&&k.ListBox){if(g.Button||g.SplitButton){f+=c.createHTML("td",{"class":"mceToolbarStart"},c.createHTML("span",null,""))}}}j="mceToolbarEnd";if(k.Button){j+=" mceToolbarEndButton"}else{if(k.SplitButton){j+=" mceToolbarEndSplitButton"}else{if(k.ListBox){j+=" mceToolbarEndListBox"}}}f+=c.createHTML("td",{"class":j},c.createHTML("span",null,""));return c.createHTML("table",{id:m.id,"class":"mceToolbar"+(n["class"]?" "+n["class"]:""),cellpadding:"0",cellspacing:"0",align:m.settings.align||"",role:"presentation",tabindex:"-1"},""+f+"")}})})(tinymce);(function(b){var a=b.util.Dispatcher,c=b.each;b.create("tinymce.AddOnManager",{AddOnManager:function(){var d=this;d.items=[];d.urls={};d.lookup={};d.onAdd=new a(d)},get:function(d){if(this.lookup[d]){return this.lookup[d].instance}else{return undefined}},dependencies:function(e){var d;if(this.lookup[e]){d=this.lookup[e].dependencies}return d||[]},requireLangPack:function(e){return;var d=b.settings;if(d&&d.language&&d.language_load!==false){b.ScriptLoader.add(this.urls[e]+"/langs/"+d.language+".js")}},add:function(f,e,d){this.items.push(e);this.lookup[f]={instance:e,dependencies:d};this.onAdd.dispatch(this,f,e);return e},createUrl:function(d,e){if(typeof e==="object"){return e}else{return{prefix:d.prefix,resource:e,suffix:d.suffix}}},addComponents:function(f,d){var e=this.urls[f];b.each(d,function(g){b.ScriptLoader.add(e+"/"+g)})},load:function(j,f,d,h){var g=this,e=f;function i(){var k=g.dependencies(j);b.each(k,function(m){var l=g.createUrl(f,m);g.load(l.resource,l,undefined,undefined)});if(d){if(h){d.call(h)}else{d.call(b.ScriptLoader)}}}if(g.urls[j]){return}if(typeof f==="object"){e=f.prefix+f.resource+f.suffix}if(e.indexOf("/")!==0&&e.indexOf("://")==-1){e=b.baseURL+"/"+e}g.urls[j]=e.substring(0,e.lastIndexOf("/"));if(g.lookup[j]){i()}else{b.ScriptLoader.add(e,i,h)}}});b.PluginManager=new b.AddOnManager();b.ThemeManager=new b.AddOnManager()}(tinymce));(function(j){var g=j.each,d=j.extend,k=j.DOM,i=j.dom.Event,f=j.ThemeManager,b=j.PluginManager,e=j.explode,h=j.util.Dispatcher,a,c=0;j.documentBaseURL=window.location.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,"");if(!/[\/\\]$/.test(j.documentBaseURL)){j.documentBaseURL+="/"}j.baseURL=new j.util.URI(j.documentBaseURL).toAbsolute(j.baseURL);j.baseURI=new j.util.URI(j.baseURL);j.onBeforeUnload=new h(j);i.add(window,"beforeunload",function(l){j.onBeforeUnload.dispatch(j,l)});j.onAddEditor=new h(j);j.onRemoveEditor=new h(j);j.EditorManager=d(j,{editors:[],i18n:{},activeEditor:null,init:function(x){var v=this,o,n=j.ScriptLoader,u,l=[],r;function q(t){var s=t.id;if(!s){s=t.name;if(s&&!k.get(s)){s=t.name}else{s=k.uniqueId()}t.setAttribute("id",s)}return s}function m(z,A,t){var y=z[A];if(!y){return}if(j.is(y,"string")){t=y.replace(/\.\w+$/,"");t=t?j.resolve(t):0;y=j.resolve(y)}return y.apply(t||this,Array.prototype.slice.call(arguments,2))}function p(t,s){return s.constructor===RegExp?s.test(t.className):k.hasClass(t,s)}x=d({theme:"simple",language:"en"},x);v.settings=x;i.bind(window,"ready",function(){var s,t;m(x,"onpageload");switch(x.mode){case"exact":s=x.elements||"";if(s.length>0){g(e(s),function(y){if(k.get(y)){r=new j.Editor(y,x);l.push(r);r.render(1)}else{g(document.forms,function(z){g(z.elements,function(A){if(A.name===y){y="mce_editor_"+c++;k.setAttrib(A,"id",y);r=new j.Editor(y,x);l.push(r);r.render(1)}})})}})}break;case"textareas":case"specific_textareas":g(k.select("textarea"),function(y){if(x.editor_deselector&&p(y,x.editor_deselector)){return}if(!x.editor_selector||p(y,x.editor_selector)){r=new j.Editor(q(y),x);l.push(r);r.render(1)}});break;default:if(x.types){g(x.types,function(y){g(k.select(y.selector),function(A){var z=new j.Editor(q(A),j.extend({},x,y));l.push(z);z.render(1)})})}else{if(x.selector){g(k.select(x.selector),function(z){var y=new j.Editor(q(z),x);l.push(y);y.render(1)})}}}if(x.oninit){s=t=0;g(l,function(y){t++;if(!y.initialized){y.onInit.add(function(){s++;if(s==t){m(x,"oninit")}})}else{s++}if(s==t){m(x,"oninit")}})}})},get:function(l){if(l===a){return this.editors}return this.editors[l]},getInstanceById:function(l){return this.get(l)},add:function(m){var l=this,n=l.editors;n[m.id]=m;n.push(m);l._setActive(m);l.onAddEditor.dispatch(l,m);if(j.adapter){j.adapter.patchEditor(m)}return m},remove:function(n){var m=this,l,o=m.editors;if(!o[n.id]){return null}delete o[n.id];for(l=0;l':"",visual:n,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",apply_source_formatting:n,directionality:"ltr",forced_root_block:"p",hidden_input:n,padd_empty_editor:n,render_ui:n,indentation:"30px",fix_table_elements:n,inline_styles:n,convert_fonts_to_spans:n,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure",validate:n,entity_encoding:"named",url_converter:m.convertURL,url_converter_scope:m,ie7_compat:n},o);m.id=m.editorId=p;m.isNotDirty=false;m.plugins={};m.documentBaseURI=new k.util.URI(o.document_base_url||k.documentBaseURL,{base_uri:tinyMCE.baseURI});m.baseURI=k.baseURI;m.contentCSS=[];m.setupEvents();m.execCommands={};m.queryStateCommands={};m.queryValueCommands={};m.execCallback("setup",m)},render:function(o){var p=this,q=p.settings,r=p.id,m=k.ScriptLoader;if(!j.domLoaded){j.add(window,"ready",function(){p.render()});return}tinyMCE.settings=q;if(!p.getElement()){return}if(k.isIDevice&&!k.isIOS5){return}if(!/TEXTAREA|INPUT/i.test(p.getElement().nodeName)&&q.hidden_input&&l.getParent(r,"form")){l.insertAfter(l.create("input",{type:"hidden",name:r}),r)}if(k.WindowManager){p.windowManager=new k.WindowManager(p)}if(q.encoding=="xml"){p.onGetContent.add(function(s,t){if(t.save){t.content=l.encode(t.content)}})}if(q.add_form_submit_trigger){p.onSubmit.addToTop(function(){if(p.initialized){p.save();p.isNotDirty=1}})}if(q.add_unload_trigger){p._beforeUnload=tinyMCE.onBeforeUnload.add(function(){if(p.initialized&&!p.destroyed&&!p.isHidden()){p.save({format:"raw",no_events:true})}})}k.addUnload(p.destroy,p);if(q.submit_patch){p.onBeforeRenderUI.add(function(){var s=p.getElement().form;if(!s){return}if(s._mceOldSubmit){return}if(!s.submit.nodeType&&!s.submit.length){p.formElement=s;s._mceOldSubmit=s.submit;s.submit=function(){k.triggerSave();p.isNotDirty=1;return p.formElement._mceOldSubmit(p.formElement)}}s=null})}function n(){if(q.language&&q.language_load!==false){m.add(k.baseURL+"/../../extra/strings.php?elanguage="+q.language+"ðeme="+q.theme)}if(q.theme&&q.theme.charAt(0)!="-"&&!h.urls[q.theme]){h.load(q.theme,"themes/"+q.theme+"/editor_template"+k.suffix+".js")}i(g(q.plugins),function(t){if(t&&!c.urls[t]){if(t.charAt(0)=="-"){t=t.substr(1,t.length);var s=c.dependencies(t);i(s,function(v){var u={prefix:"plugins/",resource:v,suffix:"/editor_plugin"+k.suffix+".js"};v=c.createUrl(u,v);c.load(v.resource,v)})}else{if(t=="safari"){return}c.load(t,{prefix:"plugins/",resource:t,suffix:"/editor_plugin"+k.suffix+".js"})}}});m.loadQueue(function(){if(!p.removed){p.init()}})}n()},init:function(){var q,F=this,G=F.settings,C,y,B=F.getElement(),p,m,D,v,A,E,x,r=[];k.add(F);G.aria_label=G.aria_label||l.getAttrib(B,"aria-label",F.getLang("aria.rich_text_area"));if(G.theme){G.theme=G.theme.replace(/-/,"");p=h.get(G.theme);F.theme=new p();if(F.theme.init){F.theme.init(F,h.urls[G.theme]||k.documentBaseURL.replace(/\/$/,""))}}function z(s){var t=c.get(s),o=c.urls[s]||k.documentBaseURL.replace(/\/$/,""),n;if(t&&k.inArray(r,s)===-1){i(c.dependencies(s),function(u){z(u)});n=new t(F,o);F.plugins[s]=n;if(n.init){n.init(F,o);r.push(s)}}}i(g(G.plugins.replace(/\-/g,"")),z);if(G.popup_css!==false){if(G.popup_css){G.popup_css=F.documentBaseURI.toAbsolute(G.popup_css)}else{G.popup_css=F.baseURI.toAbsolute("themes/"+G.theme+"/skins/"+G.skin+"/dialog.css")}}if(G.popup_css_add){G.popup_css+=","+F.documentBaseURI.toAbsolute(G.popup_css_add)}F.controlManager=new k.ControlManager(F);F.onExecCommand.add(function(n,o){if(!/^(FontName|FontSize)$/.test(o)){F.nodeChanged()}});F.onBeforeRenderUI.dispatch(F,F.controlManager);if(G.render_ui&&F.theme){C=G.width||B.style.width||B.offsetWidth;y=G.height||B.style.height||B.offsetHeight;F.orgDisplay=B.style.display;E=/^[0-9\.]+(|px)$/i;if(E.test(""+C)){C=Math.max(parseInt(C,10)+(p.deltaWidth||0),100)}if(E.test(""+y)){y=Math.max(parseInt(y)+(p.deltaHeight||0),G.theme_advanced_resizing_min_height||100)}p=F.theme.renderUI({targetNode:B,width:C,height:y,deltaWidth:G.delta_width,deltaHeight:G.delta_height});F.editorContainer=p.editorContainer}if(G.content_css){i(g(G.content_css),function(n){F.contentCSS.push(F.documentBaseURI.toAbsolute(n))})}if(G.content_editable){B=q=p=null;return F.initContentBody()}if(document.domain&&location.hostname!=document.domain){k.relaxedDomain=document.domain}l.setStyles(p.sizeContainer||p.editorContainer,{width:C,height:y});y=(p.iframeHeight||y)+(typeof(y)=="number"?(p.deltaHeight||0):"");if(y<(G.theme_advanced_resizing_min_height||100)){y=G.theme_advanced_resizing_min_height||100}F.iframeHTML=G.doctype+'';if(G.document_base_url!=k.documentBaseURL){F.iframeHTML+=''}if(G.ie7_compat){F.iframeHTML+=''}else{F.iframeHTML+=''}F.iframeHTML+='';for(x=0;x'}F.contentCSS=[];v=G.body_id||"tinymce";if(v.indexOf("=")!=-1){v=F.getParam("body_id","","hash");v=v[F.id]||v}A=G.body_class||"";if(A.indexOf("=")!=-1){A=F.getParam("body_class","","hash");A=A[F.id]||""}F.iframeHTML+='
                    ";if(k.relaxedDomain&&(b||(k.isOpera&&parseFloat(opera.version())<11))){D='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinyMCE.get("'+F.id+'");document.write(ed.iframeHTML);document.close();ed.initContentBody();})()'}q=l.add(p.iframeContainer,"iframe",{id:F.id+"_ifr",src:D||'javascript:""',frameBorder:"0",allowTransparency:"true",title:G.aria_label,style:{width:"100%",height:y,display:"block"}});F.contentAreaContainer=p.iframeContainer;l.get(p.editorContainer).style.display=F.orgDisplay;l.get(F.id).style.display="none";l.setAttrib(F.id,"aria-hidden",true);if(!k.relaxedDomain||!D){F.initContentBody()}B=q=p=null},initContentBody:function(){var n=this,p=n.settings,q=l.get(n.id),r=n.getDoc(),o,m;if((!b||!k.relaxedDomain)&&!p.content_editable){r.open();r.write(n.iframeHTML);r.close();if(k.relaxedDomain){r.domain=k.relaxedDomain}}if(p.content_editable){l.addClass(q,"mceContentBody");n.contentDocument=r=p.content_document||document;n.contentWindow=p.content_window||window;n.bodyElement=q;p.content_document=p.content_window=null}m=n.getBody();m.disabled=true;if(!p.readonly){m.contentEditable=n.getParam("content_editable_state",true)}m.disabled=false;n.schema=new k.html.Schema(p);n.dom=new k.dom.DOMUtils(r,{keep_values:true,url_converter:n.convertURL,url_converter_scope:n,hex_colors:p.force_hex_style_colors,class_filter:p.class_filter,update_styles:true,root_element:p.content_editable?n.id:null,schema:n.schema});n.parser=new k.html.DomParser(p,n.schema);n.parser.addAttributeFilter("src,href,style",function(s,t){var u=s.length,x,z=n.dom,y,v;while(u--){x=s[u];y=x.attr(t);v="data-mce-"+t;if(!x.attributes.map[v]){if(t==="style"){x.attr(v,z.serializeStyle(z.parseStyle(y),x.name))}else{x.attr(v,n.convertURL(y,t,x.name))}}}});n.parser.addNodeFilter("script",function(s,t){var u=s.length,v;while(u--){v=s[u];v.attr("type","mce-"+(v.attr("type")||"text/javascript"))}});n.parser.addNodeFilter("#cdata",function(s,t){var u=s.length,v;while(u--){v=s[u];v.type=8;v.name="#comment";v.value="[CDATA["+v.value+"]]"}});n.parser.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(t,u){var v=t.length,x,s=n.schema.getNonEmptyElements();while(v--){x=t[v];if(x.isEmpty(s)){x.empty().append(new k.html.Node("br",1)).shortEnded=true}}});n.serializer=new k.dom.Serializer(p,n.dom,n.schema);n.selection=new k.dom.Selection(n.dom,n.getWin(),n.serializer);n.formatter=new k.Formatter(n);n.undoManager=new k.UndoManager(n);n.forceBlocks=new k.ForceBlocks(n);n.enterKey=new k.EnterKey(n);n.editorCommands=new k.EditorCommands(n);n.serializer.onPreProcess.add(function(s,t){return n.onPreProcess.dispatch(n,t,s)});n.serializer.onPostProcess.add(function(s,t){return n.onPostProcess.dispatch(n,t,s)});n.onPreInit.dispatch(n);if(!p.gecko_spellcheck){r.body.spellcheck=false}if(!p.readonly){n.bindNativeEvents()}n.controlManager.onPostRender.dispatch(n,n.controlManager);n.onPostRender.dispatch(n);n.quirks=k.util.Quirks(n);if(p.directionality){m.dir=p.directionality}if(p.nowrap){m.style.whiteSpace="nowrap"}if(p.protect){n.onBeforeSetContent.add(function(s,t){i(p.protect,function(u){t.content=t.content.replace(u,function(v){return""})})})}n.onSetContent.add(function(){n.addVisual(n.getBody())});if(p.padd_empty_editor){n.onPostProcess.add(function(s,t){t.content=t.content.replace(/^(]*>( | |\s|\u00a0|)<\/p>[\r\n]*|
                    [\r\n]*)$/,"")})}n.load({initial:true,format:"html"});n.startContent=n.getContent({format:"raw"});n.initialized=true;n.onInit.dispatch(n);n.execCallback("setupcontent_callback",n.id,m,r);n.execCallback("init_instance_callback",n);n.focus(true);n.nodeChanged({initial:true});i(n.contentCSS,function(s){n.dom.loadCSS(s)});if(p.auto_focus){setTimeout(function(){var s=k.get(p.auto_focus);s.selection.select(s.getBody(),1);s.selection.collapse(1);s.getBody().focus();s.getWin().focus()},100)}q=r=m=null},focus:function(p){var o,u=this,t=u.selection,q=u.settings.content_editable,n,r,s=u.getDoc(),m;if(!p){n=t.getRng();if(n.item){r=n.item(0)}u._refreshContentEditable();if(!q){u.getWin().focus()}if(k.isGecko||q){m=u.getBody();if(m.setActive){m.setActive()}else{m.focus()}if(q){t.normalize()}}if(r&&r.ownerDocument==s){n=s.body.createControlRange();n.addElement(r);n.select()}}if(k.activeEditor!=u){if((o=k.activeEditor)!=null){o.onDeactivate.dispatch(o,u)}u.onActivate.dispatch(u,o)}k._setActive(u)},execCallback:function(q){var m=this,p=m.settings[q],o;if(!p){return}if(m.callbackLookup&&(o=m.callbackLookup[q])){p=o.func;o=o.scope}if(d(p,"string")){o=p.replace(/\.\w+$/,"");o=o?k.resolve(o):0;p=k.resolve(p);m.callbackLookup=m.callbackLookup||{};m.callbackLookup[q]={func:p,scope:o}}return p.apply(o||m,Array.prototype.slice.call(arguments,1))},translate:function(m){var o=this.settings.language||"en",n=k.i18n;if(!m){return""}return n[o+"."+m]||m.replace(/\{\#([^\}]+)\}/g,function(q,p){return n[o+"."+p]||"{#"+p+"}"})},getLang:function(o,m){return k.i18n[(this.settings.language||"en")+"."+o]||(d(m)?m:"{#"+o+"}")},getParam:function(t,q,m){var r=k.trim,p=d(this.settings[t])?this.settings[t]:q,s;if(m==="hash"){s={};if(d(p,"string")){i(p.indexOf("=")>0?p.split(/[;,](?![^=;,]*(?:[;,]|$))/):p.split(","),function(n){n=n.split("=");if(n.length>1){s[r(n[0])]=r(n[1])}else{s[r(n[0])]=r(n)}})}else{s=p}return s}return p},nodeChanged:function(q){var m=this,n=m.selection,p;if(m.initialized){q=q||{};n.normalize();p=n.getStart()||m.getBody();p=b&&p.ownerDocument!=m.getDoc()?m.getBody():p;q.parents=[];m.dom.getParent(p,function(o){if(o.nodeName=="BODY"){return true}q.parents.push(o)});m.onNodeChange.dispatch(m,q?q.controlManager||m.controlManager:m.controlManager,p,n.isCollapsed(),q)}},addButton:function(n,o){var m=this;m.buttons=m.buttons||{};m.buttons[n]=o},addCommand:function(m,o,n){this.execCommands[m]={func:o,scope:n||this}},addQueryStateHandler:function(m,o,n){this.queryStateCommands[m]={func:o,scope:n||this}},addQueryValueHandler:function(m,o,n){this.queryValueCommands[m]={func:o,scope:n||this}},addShortcut:function(o,q,m,p){var n=this,r;if(n.settings.custom_shortcuts===false){return false}n.shortcuts=n.shortcuts||{};if(d(m,"string")){r=m;m=function(){n.execCommand(r,false,null)}}if(d(m,"object")){r=m;m=function(){n.execCommand(r[0],r[1],r[2])}}i(g(o),function(s){var t={func:m,scope:p||this,desc:n.translate(q),alt:false,ctrl:false,shift:false};i(g(s,"+"),function(u){switch(u){case"alt":case"ctrl":case"shift":t[u]=true;break;default:t.charCode=u.charCodeAt(0);t.keyCode=u.toUpperCase().charCodeAt(0)}});n.shortcuts[(t.ctrl?"ctrl":"")+","+(t.alt?"alt":"")+","+(t.shift?"shift":"")+","+t.keyCode]=t});return true},execCommand:function(u,r,x,m){var p=this,q=0,v,n;if(!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(u)&&(!m||!m.skip_focus)){p.focus()}m=f({},m);p.onBeforeExecCommand.dispatch(p,u,r,x,m);if(m.terminate){return false}if(p.execCallback("execcommand_callback",p.id,p.selection.getNode(),u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);return true}if(v=p.execCommands[u]){n=v.func.call(v.scope,r,x);if(n!==true){p.onExecCommand.dispatch(p,u,r,x,m);return n}}i(p.plugins,function(o){if(o.execCommand&&o.execCommand(u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);q=1;return false}});if(q){return true}if(p.theme&&p.theme.execCommand&&p.theme.execCommand(u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);return true}if(p.editorCommands.execCommand(u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);return true}p.getDoc().execCommand(u,r,x);p.onExecCommand.dispatch(p,u,r,x,m)},queryCommandState:function(q){var n=this,r,p;if(n._isHidden()){return}if(r=n.queryStateCommands[q]){p=r.func.call(r.scope);if(p!==true){return p}}r=n.editorCommands.queryCommandState(q);if(r!==-1){return r}try{return this.getDoc().queryCommandState(q)}catch(m){}},queryCommandValue:function(r){var n=this,q,p;if(n._isHidden()){return}if(q=n.queryValueCommands[r]){p=q.func.call(q.scope);if(p!==true){return p}}q=n.editorCommands.queryCommandValue(r);if(d(q)){return q}try{return this.getDoc().queryCommandValue(r)}catch(m){}},show:function(){var m=this;l.show(m.getContainer());l.hide(m.id);m.load()},hide:function(){var m=this,n=m.getDoc();if(b&&n){n.execCommand("SelectAll")}m.save();l.hide(m.getContainer());l.setStyle(m.id,"display",m.orgDisplay)},isHidden:function(){return !l.isHidden(this.id)},setProgressState:function(m,n,p){this.onSetProgressState.dispatch(this,m,n,p);return m},load:function(q){var m=this,p=m.getElement(),n;if(p){q=q||{};q.load=true;n=m.setContent(d(p.value)?p.value:p.innerHTML,q);q.element=p;if(!q.no_events){m.onLoadContent.dispatch(m,q)}q.element=p=null;return n}},save:function(r){var m=this,q=m.getElement(),n,p;if(!q||!m.initialized){return}r=r||{};r.save=true;r.element=q;n=r.content=m.getContent(r);if(!r.no_events){m.onSaveContent.dispatch(m,r)}n=r.content;if(!/TEXTAREA|INPUT/i.test(q.nodeName)){q.innerHTML=n;if(p=l.getParent(m.id,"form")){i(p.elements,function(o){if(o.name==m.id){o.value=n;return false}})}}else{q.value=n}r.element=q=null;return n},setContent:function(r,p){var o=this,n,m=o.getBody(),q;p=p||{};p.format=p.format||"html";p.set=true;p.content=r;if(!p.no_events){o.onBeforeSetContent.dispatch(o,p)}r=p.content;if(!k.isIE&&(r.length===0||/^\s+$/.test(r))){q=o.settings.forced_root_block;if(q){r="<"+q+'>
                    "}else{r='
                    '}m.innerHTML=r;o.selection.select(m,true);o.selection.collapse(true);return}if(p.format!=="raw"){r=new k.html.Serializer({},o.schema).serialize(o.parser.parse(r))}p.content=k.trim(r);o.dom.setHTML(m,p.content);if(!p.no_events){o.onSetContent.dispatch(o,p)}o.selection.normalize();return p.content},getContent:function(n){var m=this,o;n=n||{};n.format=n.format||"html";n.get=true;n.getInner=true;if(!n.no_events){m.onBeforeGetContent.dispatch(m,n)}if(n.format=="raw"){o=m.getBody().innerHTML}else{o=m.serializer.serialize(m.getBody(),n)}n.content=k.trim(o);if(!n.no_events){m.onGetContent.dispatch(m,n)}return n.content},isDirty:function(){var m=this;return k.trim(m.startContent)!=k.trim(m.getContent({format:"raw",no_events:1}))&&!m.isNotDirty},getContainer:function(){var m=this;if(!m.container){m.container=l.get(m.editorContainer||m.id+"_parent")}return m.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return l.get(this.settings.content_element||this.id)},getWin:function(){var m=this,n;if(!m.contentWindow){n=l.get(m.id+"_ifr");if(n){m.contentWindow=n.contentWindow}}return m.contentWindow},getDoc:function(){var m=this,n;if(!m.contentDocument){n=m.getWin();if(n){m.contentDocument=n.document}}return m.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(o,n,q){var m=this,p=m.settings;if(p.urlconverter_callback){return m.execCallback("urlconverter_callback",o,q,true,n)}if(!p.convert_urls||(q&&q.nodeName=="LINK")||o.indexOf("file:")===0){return o}if(p.relative_urls){return m.documentBaseURI.toRelative(o)}o=m.documentBaseURI.toAbsolute(o,p.remove_script_host);return o},addVisual:function(q){var n=this,o=n.settings,p=n.dom,m;q=q||n.getBody();if(!d(n.hasVisual)){n.hasVisual=o.visual}i(p.select("table,a",q),function(s){var r;switch(s.nodeName){case"TABLE":m=o.visual_table_class||"mceItemTable";r=p.getAttrib(s,"border");if(!r||r=="0"){if(n.hasVisual){p.addClass(s,m)}else{p.removeClass(s,m)}}return;case"A":r=p.getAttrib(s,"name");m="mceItemAnchor";if(r){if(n.hasVisual){p.addClass(s,m)}else{p.removeClass(s,m)}}return}});n.onVisualAid.dispatch(n,q,n.hasVisual)},remove:function(){var m=this,n=m.getContainer();if(!m.removed){m.removed=1;m.hide();if(!m.settings.content_editable){j.clear(m.getWin());j.clear(m.getDoc())}j.clear(m.getBody());j.clear(m.formElement);j.unbind(n);m.execCallback("remove_instance_callback",m);m.onRemove.dispatch(m);m.onExecCommand.listeners=[];k.remove(m);l.remove(n)}},destroy:function(n){var m=this;if(m.destroyed){return}if(a){j.unbind(m.getDoc());j.unbind(m.getWin());j.unbind(m.getBody())}if(!n){k.removeUnload(m.destroy);tinyMCE.onBeforeUnload.remove(m._beforeUnload);if(m.theme&&m.theme.destroy){m.theme.destroy()}m.controlManager.destroy();m.selection.destroy();m.dom.destroy()}if(m.formElement){m.formElement.submit=m.formElement._mceOldSubmit;m.formElement._mceOldSubmit=null}m.contentAreaContainer=m.formElement=m.container=m.settings.content_element=m.bodyElement=m.contentDocument=m.contentWindow=null;if(m.selection){m.selection=m.selection.win=m.selection.dom=m.selection.dom.doc=null}m.destroyed=1},_refreshContentEditable:function(){var n=this,m,o;if(n._isHidden()){m=n.getBody();o=m.parentNode;o.removeChild(m);o.appendChild(m);m.focus()}},_isHidden:function(){var m;if(!a){return 0}m=this.selection.getSel();return(!m||!m.rangeCount||m.rangeCount===0)}})})(tinymce);(function(a){var b=a.each;a.Editor.prototype.setupEvents=function(){var c=this,d=c.settings;b(["onPreInit","onBeforeRenderUI","onPostRender","onLoad","onInit","onRemove","onActivate","onDeactivate","onClick","onEvent","onMouseUp","onMouseDown","onDblClick","onKeyDown","onKeyUp","onKeyPress","onContextMenu","onSubmit","onReset","onPaste","onPreProcess","onPostProcess","onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent","onLoadContent","onSaveContent","onNodeChange","onChange","onBeforeExecCommand","onExecCommand","onUndo","onRedo","onVisualAid","onSetProgressState","onSetAttrib"],function(e){c[e]=new a.util.Dispatcher(c)});if(d.cleanup_callback){c.onBeforeSetContent.add(function(e,f){f.content=e.execCallback("cleanup_callback","insert_to_editor",f.content,f)});c.onPreProcess.add(function(e,f){if(f.set){e.execCallback("cleanup_callback","insert_to_editor_dom",f.node,f)}if(f.get){e.execCallback("cleanup_callback","get_from_editor_dom",f.node,f)}});c.onPostProcess.add(function(e,f){if(f.set){f.content=e.execCallback("cleanup_callback","insert_to_editor",f.content,f)}if(f.get){f.content=e.execCallback("cleanup_callback","get_from_editor",f.content,f)}})}if(d.save_callback){c.onGetContent.add(function(e,f){if(f.save){f.content=e.execCallback("save_callback",e.id,f.content,e.getBody())}})}if(d.handle_event_callback){c.onEvent.add(function(f,g,h){if(c.execCallback("handle_event_callback",g,f,h)===false){Event.cancel(g)}})}if(d.handle_node_change_callback){c.onNodeChange.add(function(f,e,g){f.execCallback("handle_node_change_callback",f.id,g,-1,-1,true,f.selection.isCollapsed())})}if(d.save_callback){c.onSaveContent.add(function(e,g){var f=e.execCallback("save_callback",e.id,g.content,e.getBody());if(f){g.content=f}})}if(d.onchange_callback){c.onChange.add(function(f,e){f.execCallback("onchange_callback",f,e)})}};a.Editor.prototype.bindNativeEvents=function(){var c=this,f,g=c.settings,j=c.dom,k;k={mouseup:"onMouseUp",mousedown:"onMouseDown",click:"onClick",keyup:"onKeyUp",keydown:"onKeyDown",keypress:"onKeyPress",submit:"onSubmit",reset:"onReset",contextmenu:"onContextMenu",dblclick:"onDblClick",paste:"onPaste"};function e(i,l){var m=i.type;if(c.removed){return}if(c.onEvent.dispatch(c,i,l)!==false){c[k[i.fakeType||i.type]].dispatch(c,i,l)}}function h(i){c.focus(true)}b(k,function(l,m){var i=g.content_editable?c.getBody():c.getDoc();switch(m){case"contextmenu":j.bind(i,m,e);break;case"paste":j.bind(c.getBody(),m,e);break;case"submit":case"reset":j.bind(c.getElement().form||a.DOM.getParent(c.id,"form"),m,e);break;default:j.bind(i,m,e)}});j.bind(g.content_editable?c.getBody():(a.isGecko?c.getDoc():c.getWin()),"focus",function(i){c.focus(true)});if(g.content_editable&&a.isOpera){j.bind(c.getBody(),"click",h);j.bind(c.getBody(),"keydown",h)}c.onMouseUp.add(c.nodeChanged);c.onKeyUp.add(function(i,m){var l=m.keyCode;if((l>=33&&l<=36)||(l>=37&&l<=40)||l==13||l==45||l==46||l==8||(a.isMac&&(l==91||l==93))||m.ctrlKey){c.nodeChanged()}});c.onReset.add(function(){c.setContent(c.startContent,{format:"raw"})});function d(l,i){if(l.altKey||l.ctrlKey||l.metaKey){b(c.shortcuts,function(m){var n=a.isMac?l.metaKey:l.ctrlKey;if(m.ctrl!=n||m.alt!=l.altKey||m.shift!=l.shiftKey){return}if(l.keyCode==m.keyCode||(l.charCode&&l.charCode==m.charCode)){l.preventDefault();if(i){m.func.call(m.scope)}return true}})}}c.onKeyUp.add(function(i,l){d(l)});c.onKeyPress.add(function(i,l){d(l)});c.onKeyDown.add(function(i,l){d(l,true)});if(a.isOpera){c.onClick.add(function(i,l){l.preventDefault()})}}})(tinymce);(function(d){var e=d.each,b,a=true,c=false;d.EditorCommands=function(n){var m=n.dom,p=n.selection,j={state:{},exec:{},value:{}},k=n.settings,q=n.formatter,o;function r(z,y,x){var v;z=z.toLowerCase();if(v=j.exec[z]){v(z,y,x);return a}return c}function l(x){var v;x=x.toLowerCase();if(v=j.state[x]){return v(x)}return -1}function h(x){var v;x=x.toLowerCase();if(v=j.value[x]){return v(x)}return c}function u(v,x){x=x||"exec";e(v,function(z,y){e(y.toLowerCase().split(","),function(A){j[x][A]=z})})}d.extend(this,{execCommand:r,queryCommandState:l,queryCommandValue:h,addCommands:u});function f(y,x,v){if(x===b){x=c}if(v===b){v=null}return n.getDoc().execCommand(y,x,v)}function t(v){return q.match(v)}function s(v,x){q.toggle(v,x?{value:x}:b)}function i(v){o=p.getBookmark(v)}function g(){p.moveToBookmark(o)}u({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){n.undoManager.add()},"Cut,Copy,Paste":function(z){var y=n.getDoc(),v;try{f(z)}catch(x){v=a}if(v||!y.queryCommandSupported(z)){if(d.isGecko){n.windowManager.confirm(n.getLang("clipboard_msg"),function(A){if(A){open("http://www.mozilla.org/editor/midasdemo/securityprefs.html","_blank")}})}else{n.windowManager.alert(n.getLang("clipboard_no_support"))}}},unlink:function(v){if(p.isCollapsed()){p.select(p.getNode())}f(v);p.collapse(c)},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(v){var x=v.substring(7);e("left,center,right,full".split(","),function(y){if(x!=y){q.remove("align"+y)}});s("align"+x);r("mceRepaint")},"InsertUnorderedList,InsertOrderedList":function(y){var v,x;f(y);v=m.getParent(p.getNode(),"ol,ul");if(v){x=v.parentNode;if(/^(H[1-6]|P|ADDRESS|PRE)$/.test(x.nodeName)){i();m.split(x,v);g()}}},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(v){s(v)},"ForeColor,HiliteColor,FontName":function(y,x,v){s(y,v)},FontSize:function(z,y,x){var v,A;if(x>=1&&x<=7){A=d.explode(k.font_size_style_values);v=d.explode(k.font_size_classes);if(v){x=v[x-1]||x}else{x=A[x-1]||x}}s(z,x)},RemoveFormat:function(v){q.remove(v)},mceBlockQuote:function(v){s("blockquote")},FormatBlock:function(y,x,v){return s(v||"p")},mceCleanup:function(){var v=p.getBookmark();n.setContent(n.getContent({cleanup:a}),{cleanup:a});p.moveToBookmark(v)},mceRemoveNode:function(z,y,x){var v=x||p.getNode();if(v!=n.getBody()){i();n.dom.remove(v,a);g()}},mceSelectNodeDepth:function(z,y,x){var v=0;m.getParent(p.getNode(),function(A){if(A.nodeType==1&&v++==x){p.select(A);return c}},n.getBody())},mceSelectNode:function(y,x,v){p.select(v)},mceInsertContent:function(B,I,K){var y,J,E,z,F,G,D,C,L,x,A,M,v,H;y=n.parser;J=new d.html.Serializer({},n.schema);v='\uFEFF';G={content:K,format:"html"};p.onBeforeSetContent.dispatch(p,G);K=G.content;if(K.indexOf("{$caret}")==-1){K+="{$caret}"}K=K.replace(/\{\$caret\}/,v);if(!p.isCollapsed()){n.getDoc().execCommand("Delete",false,null)}E=p.getNode();G={context:E.nodeName.toLowerCase()};F=y.parse(K,G);A=F.lastChild;if(A.attr("id")=="mce_marker"){D=A;for(A=A.prev;A;A=A.walk(true)){if(A.type==3||!m.isBlock(A.name)){A.parent.insert(D,A,A.name==="br");break}}}if(!G.invalid){K=J.serialize(F);A=E.firstChild;M=E.lastChild;if(!A||(A===M&&A.nodeName==="BR")){m.setHTML(E,K)}else{p.setContent(K)}}else{p.setContent(v);E=n.selection.getNode();z=n.getBody();if(E.nodeType==9){E=A=z}else{A=E}while(A!==z){E=A;A=A.parentNode}K=E==z?z.innerHTML:m.getOuterHTML(E);K=J.serialize(y.parse(K.replace(//i,function(){return J.serialize(F)})));if(E==z){m.setHTML(z,K)}else{m.setOuterHTML(E,K)}}D=m.get("mce_marker");C=m.getRect(D);L=m.getViewPort(n.getWin());if((C.y+C.h>L.y+L.h||C.yL.x+L.w||C.x")},mceToggleVisualAid:function(){n.hasVisual=!n.hasVisual;n.addVisual()},mceReplaceContent:function(y,x,v){n.execCommand("mceInsertContent",false,v.replace(/\{\$selection\}/g,p.getContent({format:"text"})))},mceInsertLink:function(z,y,x){var v;if(typeof(x)=="string"){x={href:x}}v=m.getParent(p.getNode(),"a");x.href=x.href.replace(" ","%20");if(!v||!x.href){q.remove("link")}if(x.href){q.apply("link",x,v)}},selectAll:function(){var x=m.getRoot(),v=m.createRng();v.setStart(x,0);v.setEnd(x,x.childNodes.length);n.selection.setRng(v)}});u({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(z){var x="align"+z.substring(7);var v=p.isCollapsed()?[m.getParent(p.getNode(),m.isBlock)]:p.getSelectedBlocks();var y=d.map(v,function(A){return !!q.matchNode(A,x)});return d.inArray(y,a)!==-1},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(v){return t(v)},mceBlockQuote:function(){return t("blockquote")},Outdent:function(){var v;if(k.inline_styles){if((v=m.getParent(p.getStart(),m.isBlock))&&parseInt(v.style.paddingLeft)>0){return a}if((v=m.getParent(p.getEnd(),m.isBlock))&&parseInt(v.style.paddingLeft)>0){return a}}return l("InsertUnorderedList")||l("InsertOrderedList")||(!k.inline_styles&&!!m.getParent(p.getNode(),"BLOCKQUOTE"))},"InsertUnorderedList,InsertOrderedList":function(v){return m.getParent(p.getNode(),v=="insertunorderedlist"?"UL":"OL")}},"state");u({"FontSize,FontName":function(y){var x=0,v;if(v=m.getParent(p.getNode(),"span")){if(y=="fontsize"){x=v.style.fontSize}else{x=v.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()}}return x}},"value");u({Undo:function(){n.undoManager.undo()},Redo:function(){n.undoManager.redo()}})}})(tinymce);(function(b){var a=b.util.Dispatcher;b.UndoManager=function(h){var l,i=0,e=[],g,k,j,f;function c(){return b.trim(h.getContent({format:"raw",no_events:1}).replace(/]+data-mce-bogus[^>]+>[\u200B\uFEFF]+<\/span>/g,""))}function d(){l.typing=false;l.add()}k=new a(l);j=new a(l);f=new a(l);k.add(function(m,n){if(m.hasUndo()){return h.onChange.dispatch(h,n,m)}});j.add(function(m,n){return h.onUndo.dispatch(h,n,m)});f.add(function(m,n){return h.onRedo.dispatch(h,n,m)});h.onInit.add(function(){l.add()});h.onBeforeExecCommand.add(function(m,p,o,q,n){if(p!="Undo"&&p!="Redo"&&p!="mceRepaint"&&(!n||!n.skip_undo)){l.beforeChange()}});h.onExecCommand.add(function(m,p,o,q,n){if(p!="Undo"&&p!="Redo"&&p!="mceRepaint"&&(!n||!n.skip_undo)){l.add()}});h.onSaveContent.add(d);h.dom.bind(h.dom.getRoot(),"dragend",d);h.dom.bind(h.getDoc(),b.isGecko?"blur":"focusout",function(m){if(!h.removed&&l.typing){d()}});h.onKeyUp.add(function(m,o){var n=o.keyCode;if((n>=33&&n<=36)||(n>=37&&n<=40)||n==45||n==13||o.ctrlKey){d()}});h.onKeyDown.add(function(m,o){var n=o.keyCode;if((n>=33&&n<=36)||(n>=37&&n<=40)||n==45){if(l.typing){d()}return}if((n<16||n>20)&&n!=224&&n!=91&&!l.typing){l.beforeChange();l.typing=true;l.add()}});h.onMouseDown.add(function(m,n){if(l.typing){d()}});h.addShortcut("ctrl+z","undo_desc","Undo");h.addShortcut("ctrl+y","redo_desc","Redo");l={data:e,typing:false,onAdd:k,onUndo:j,onRedo:f,beforeChange:function(){g=h.selection.getBookmark(2,true)},add:function(p){var m,n=h.settings,o;p=p||{};p.content=c();o=e[i];if(o&&o.content==p.content){return null}if(e[i]){e[i].beforeBookmark=g}if(n.custom_undo_redo_levels){if(e.length>n.custom_undo_redo_levels){for(m=0;m0){n=e[--i];h.setContent(n.content,{format:"raw"});h.selection.moveToBookmark(n.beforeBookmark);l.onUndo.dispatch(l,n)}return n},redo:function(){var m;if(i0||this.typing},hasRedo:function(){return i0){g.moveEnd("character",q)}g.select()}catch(n){}}if(p){c.nodeChanged()}}if(b.forced_root_block){c.onKeyUp.add(f);c.onNodeChange.add(f)}};(function(c){var b=c.DOM,a=c.dom.Event,d=c.each,e=c.extend;c.create("tinymce.ControlManager",{ControlManager:function(f,j){var h=this,g;j=j||{};h.editor=f;h.controls={};h.onAdd=new c.util.Dispatcher(h);h.onPostRender=new c.util.Dispatcher(h);h.prefix=j.prefix||f.id+"_";h._cls={};h.onPostRender.add(function(){d(h.controls,function(i){i.postRender()})})},get:function(f){return this.controls[this.prefix+f]||this.controls[f]},setActive:function(h,f){var g=null;if(g=this.get(h)){g.setActive(f)}return g},setDisabled:function(h,f){var g=null;if(g=this.get(h)){g.setDisabled(f)}return g},add:function(g){var f=this;if(g){f.controls[g.id]=g;f.onAdd.dispatch(g,f)}return g},createControl:function(i){var h,g=this,f=g.editor;d(f.plugins,function(j){if(j.createControl){h=j.createControl(i,g);if(h){return false}}});switch(i){case"|":case"separator":return g.createSeparator()}if(!h&&f.buttons&&(h=f.buttons[i])){return g.createButton(i,h)}return g.add(h)},createDropMenu:function(f,n,h){var m=this,i=m.editor,j,g,k,l;n=e({"class":"mceDropDown",constrain:i.settings.constrain_menus},n);n["class"]=n["class"]+" "+i.getParam("skin")+"Skin";if(k=i.getParam("skin_variant")){n["class"]+=" "+i.getParam("skin")+"Skin"+k.substring(0,1).toUpperCase()+k.substring(1)}n["class"]+=i.settings.directionality=="rtl"?" mceRtl":"";f=m.prefix+f;l=h||m._cls.dropmenu||c.ui.DropMenu;j=m.controls[f]=new l(f,n);j.onAddItem.add(function(r,q){var p=q.settings;p.title=i.getLang(p.title,p.title);if(!p.onclick){p.onclick=function(o){if(p.cmd){i.execCommand(p.cmd,p.ui||false,p.value)}}}});i.onRemove.add(function(){j.destroy()});if(c.isIE){j.onShowMenu.add(function(){i.focus();g=i.selection.getBookmark(1)});j.onHideMenu.add(function(){if(g){i.selection.moveToBookmark(g);g=0}})}return m.add(j)},createListBox:function(f,n,h){var l=this,j=l.editor,i,k,m;if(l.get(f)){return null}n.title=j.translate(n.title);n.scope=n.scope||j;if(!n.onselect){n.onselect=function(o){j.execCommand(n.cmd,n.ui||false,o||n.value)}}n=e({title:n.title,"class":"mce_"+f,scope:n.scope,control_manager:l},n);f=l.prefix+f;function g(o){return o.settings.use_accessible_selects&&!c.isGecko}if(j.settings.use_native_selects||g(j)){k=new c.ui.NativeListBox(f,n)}else{m=h||l._cls.listbox||c.ui.ListBox;k=new m(f,n,j)}l.controls[f]=k;if(c.isWebKit){k.onPostRender.add(function(p,o){a.add(o,"mousedown",function(){j.bookmark=j.selection.getBookmark(1)});a.add(o,"focus",function(){j.selection.moveToBookmark(j.bookmark);j.bookmark=null})})}if(k.hideMenu){j.onMouseDown.add(k.hideMenu,k)}return l.add(k)},createButton:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.label=g.translate(i.label);i.scope=i.scope||g;if(!i.onclick&&!i.menu_button){i.onclick=function(){g.execCommand(i.cmd,i.ui||false,i.value)}}i=e({title:i.title,"class":"mce_"+m,unavailable_prefix:g.getLang("unavailable",""),scope:i.scope,control_manager:h},i);m=h.prefix+m;if(i.menu_button){f=l||h._cls.menubutton||c.ui.MenuButton;k=new f(m,i,g);g.onMouseDown.add(k.hideMenu,k)}else{f=h._cls.button||c.ui.Button;k=new f(m,i,g)}return h.add(k)},createMenuButton:function(h,f,g){f=f||{};f.menu_button=1;return this.createButton(h,f,g)},createSplitButton:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.scope=i.scope||g;if(!i.onclick){i.onclick=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}if(!i.onselect){i.onselect=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}i=e({title:i.title,"class":"mce_"+m,scope:i.scope,control_manager:h},i);m=h.prefix+m;f=l||h._cls.splitbutton||c.ui.SplitButton;k=h.add(new f(m,i,g));g.onMouseDown.add(k.hideMenu,k);return k},createColorSplitButton:function(f,n,h){var l=this,j=l.editor,i,k,m,g;if(l.get(f)){return null}n.title=j.translate(n.title);n.scope=n.scope||j;if(!n.onclick){n.onclick=function(o){if(c.isIE){g=j.selection.getBookmark(1)}j.execCommand(n.cmd,n.ui||false,o||n.value)}}if(!n.onselect){n.onselect=function(o){j.execCommand(n.cmd,n.ui||false,o||n.value)}}n=e({title:n.title,"class":"mce_"+f,menu_class:j.getParam("skin")+"Skin",scope:n.scope,more_colors_title:j.getLang("more_colors")},n);f=l.prefix+f;m=h||l._cls.colorsplitbutton||c.ui.ColorSplitButton;k=new m(f,n,j);j.onMouseDown.add(k.hideMenu,k);j.onRemove.add(function(){k.destroy()});if(c.isIE){k.onShowMenu.add(function(){j.focus();g=j.selection.getBookmark(1)});k.onHideMenu.add(function(){if(g){j.selection.moveToBookmark(g);g=0}})}return l.add(k)},createToolbar:function(k,h,j){var i,g=this,f;k=g.prefix+k;f=j||g._cls.toolbar||c.ui.Toolbar;i=new f(k,h,g.editor);if(g.get(k)){return null}return g.add(i)},createToolbarGroup:function(k,h,j){var i,g=this,f;k=g.prefix+k;f=j||this._cls.toolbarGroup||c.ui.ToolbarGroup;i=new f(k,h,g.editor);if(g.get(k)){return null}return g.add(i)},createSeparator:function(g){var f=g||this._cls.separator||c.ui.Separator;return new f()},setControlType:function(g,f){return this._cls[g.toLowerCase()]=f},destroy:function(){d(this.controls,function(f){f.destroy()});this.controls=null}})})(tinymce);(function(d){var a=d.util.Dispatcher,e=d.each,c=d.isIE,b=d.isOpera;d.create("tinymce.WindowManager",{WindowManager:function(f){var g=this;g.editor=f;g.onOpen=new a(g);g.onClose=new a(g);g.params={};g.features={}},open:function(z,h){var v=this,k="",n,m,i=v.editor.settings.dialog_type=="modal",q,o,j,g=d.DOM.getViewPort(),r;z=z||{};h=h||{};o=b?g.w:screen.width;j=b?g.h:screen.height;z.name=z.name||"mc_"+new Date().getTime();z.width=parseInt(z.width||320);z.height=parseInt(z.height||240);z.resizable=true;z.left=z.left||parseInt(o/2)-(z.width/2);z.top=z.top||parseInt(j/2)-(z.height/2);h.inline=false;h.mce_width=z.width;h.mce_height=z.height;h.mce_auto_focus=z.auto_focus;if(i){if(c){z.center=true;z.help=false;z.dialogWidth=z.width+"px";z.dialogHeight=z.height+"px";z.scroll=z.scrollbars||false}}e(z,function(p,f){if(d.is(p,"boolean")){p=p?"yes":"no"}if(!/^(name|url)$/.test(f)){if(c&&i){k+=(k?";":"")+f+":"+p}else{k+=(k?",":"")+f+"="+p}}});v.features=z;v.params=h;v.onOpen.dispatch(v,z,h);r=z.url||z.file;r=d._addVer(r);try{if(c&&i){q=1;window.showModalDialog(r,window,k)}else{q=window.open(r,z.name,k)}}catch(l){}if(!q){alert(v.editor.getLang("popup_blocked"))}},close:function(f){f.close();this.onClose.dispatch(this)},createInstance:function(i,h,g,m,l,k){var j=d.resolve(i);return new j(h,g,m,l,k)},confirm:function(h,f,i,g){g=g||window;f.call(i||this,g.confirm(this._decode(this.editor.getLang(h,h))))},alert:function(h,f,j,g){var i=this;g=g||window;g.alert(i._decode(i.editor.getLang(h,h)));if(f){f.call(j||i)}},resizeBy:function(f,g,h){h.resizeBy(f,g)},_decode:function(f){return d.DOM.decode(f).replace(/\\n/g,"\n")}})}(tinymce));(function(a){a.Formatter=function(Y){var O={},R=a.each,c=Y.dom,r=Y.selection,t=a.dom.TreeWalker,M=new a.dom.RangeUtils(c),d=Y.schema.isValidChild,H=c.isBlock,m=Y.settings.forced_root_block,s=c.nodeIndex,G=a.isGecko?"\u200B":"\uFEFF",e=/^(src|href|style)$/,V=false,C=true,D,x=c.getContentEditable;function A(Z){return Z instanceof Array}function n(aa,Z){return c.getParents(aa,Z,c.getRoot())}function b(Z){return Z.nodeType===1&&Z.id==="_mce_caret"}function j(){l({alignleft:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"left"},defaultBlock:"div"},{selector:"img,table",collapsed:false,styles:{"float":"left"}}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"center"},defaultBlock:"div"},{selector:"img",collapsed:false,styles:{display:"block",marginLeft:"auto",marginRight:"auto"}},{selector:"table",collapsed:false,styles:{marginLeft:"auto",marginRight:"auto"}}],alignright:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"right"},defaultBlock:"div"},{selector:"img,table",collapsed:false,styles:{"float":"right"}}],alignfull:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"justify"},defaultBlock:"div"}],bold:[{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all"}],italic:[{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all"}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:true},{inline:"u",remove:"all"}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:true},{inline:"strike",remove:"all"}],forecolor:{inline:"span",styles:{color:"%value"},wrap_links:false},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},wrap_links:false},fontname:{inline:"span",styles:{fontFamily:"%value"}},fontsize:{inline:"span",styles:{fontSize:"%value"}},fontsize_class:{inline:"span",attributes:{"class":"%value"}},blockquote:{block:"blockquote",wrapper:1,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},link:{inline:"a",selector:"a",remove:"all",split:true,deep:true,onmatch:function(Z){return true},onformat:function(ab,Z,aa){R(aa,function(ad,ac){c.setAttrib(ab,ac,ad)})}},removeformat:[{selector:"b,strong,em,i,font,u,strike",remove:"all",split:true,expand:false,block_expand:true,deep:true},{selector:"span",attributes:["style","class"],remove:"empty",split:true,expand:false,deep:true},{selector:"*",attributes:["style","class"],split:false,expand:false,deep:true}]});R("p h1 h2 h3 h4 h5 h6 div address pre div code dt dd samp".split(/\s/),function(Z){l(Z,{block:Z,remove:"all"})});l(Y.settings.formats)}function U(){Y.addShortcut("ctrl+b","bold_desc","Bold");Y.addShortcut("ctrl+i","italic_desc","Italic");Y.addShortcut("ctrl+u","underline_desc","Underline");for(var Z=1;Z<=6;Z++){Y.addShortcut("ctrl+"+Z,"",["FormatBlock",false,"h"+Z])}Y.addShortcut("ctrl+7","",["FormatBlock",false,"p"]);Y.addShortcut("ctrl+8","",["FormatBlock",false,"div"]);Y.addShortcut("ctrl+9","",["FormatBlock",false,"address"])}function T(Z){return Z?O[Z]:O}function l(Z,aa){if(Z){if(typeof(Z)!=="string"){R(Z,function(ac,ab){l(ab,ac)})}else{aa=aa.length?aa:[aa];R(aa,function(ab){if(ab.deep===D){ab.deep=!ab.selector}if(ab.split===D){ab.split=!ab.selector||ab.inline}if(ab.remove===D&&ab.selector&&!ab.inline){ab.remove="none"}if(ab.selector&&ab.inline){ab.mixed=true;ab.block_expand=true}if(typeof(ab.classes)==="string"){ab.classes=ab.classes.split(/\s+/)}});O[Z]=aa}}}var i=function(aa){var Z;Y.dom.getParent(aa,function(ab){Z=Y.dom.getStyle(ab,"text-decoration");return Z&&Z!=="none"});return Z};var K=function(Z){var aa;if(Z.nodeType===1&&Z.parentNode&&Z.parentNode.nodeType===1){aa=i(Z.parentNode);if(Y.dom.getStyle(Z,"color")&&aa){Y.dom.setStyle(Z,"text-decoration",aa)}else{if(Y.dom.getStyle(Z,"textdecoration")===aa){Y.dom.setStyle(Z,"text-decoration",null)}}}};function W(ac,aj,ae){var af=T(ac),ak=af[0],ai,aa,ah,ag=r.isCollapsed();function Z(ao,an){an=an||ak;if(ao){if(an.onformat){an.onformat(ao,an,aj,ae)}R(an.styles,function(aq,ap){c.setStyle(ao,ap,q(aq,aj))});R(an.attributes,function(aq,ap){c.setAttrib(ao,ap,q(aq,aj))});R(an.classes,function(ap){ap=q(ap,aj);if(!c.hasClass(ao,ap)){c.addClass(ao,ap)}})}}function ad(){function ap(aw,au){var av=new t(au);for(ae=av.current();ae;ae=av.prev()){if(ae.childNodes.length>1||ae==aw||ae.tagName=="BR"){return ae}}}var ao=Y.selection.getRng();var at=ao.startContainer;var an=ao.endContainer;if(at!=an&&ao.endOffset===0){var ar=ap(at,an);var aq=ar.nodeType==3?ar.length:ar.childNodes.length;ao.setEnd(ar,aq)}return ao}function ab(aq,aw,au,at,ao){var an=[],ap=-1,av,ay=-1,ar=-1,ax;R(aq.childNodes,function(aA,az){if(aA.nodeName==="UL"||aA.nodeName==="OL"){ap=az;av=aA;return false}});R(aq.childNodes,function(aA,az){if(aA.nodeName==="SPAN"&&c.getAttrib(aA,"data-mce-type")=="bookmark"){if(aA.id==aw.id+"_start"){ay=az}else{if(aA.id==aw.id+"_end"){ar=az}}}});if(ap<=0||(ayap)){R(a.grep(aq.childNodes),ao);return 0}else{ax=c.clone(au,V);R(a.grep(aq.childNodes),function(aA,az){if((ayap&&az>ap)){an.push(aA);aA.parentNode.removeChild(aA)}});if(ayap){aq.insertBefore(ax,av.nextSibling)}}at.push(ax);R(an,function(az){ax.appendChild(az)});return ax}}function al(ao,aq,au){var an=[],at,ap,ar=true;at=ak.inline||ak.block;ap=c.create(at);Z(ap);M.walk(ao,function(av){var aw;function ax(ay){var aD,aB,az,aA,aC;aC=ar;aD=ay.nodeName.toLowerCase();aB=ay.parentNode.nodeName.toLowerCase();if(ay.nodeType===1&&x(ay)){aC=ar;ar=x(ay)==="true";aA=true}if(g(aD,"br")){aw=0;if(ak.block){c.remove(ay)}return}if(ak.wrapper&&y(ay,ac,aj)){aw=0;return}if(ar&&!aA&&ak.block&&!ak.wrapper&&I(aD)){ay=c.rename(ay,at);Z(ay);an.push(ay);aw=0;return}if(ak.selector){R(af,function(aE){if("collapsed" in aE&&aE.collapsed!==ag){return}if(c.is(ay,aE.selector)&&!b(ay)){Z(ay,aE);az=true}});if(!ak.inline||az){aw=0;return}}if(ar&&!aA&&d(at,aD)&&d(aB,at)&&!(!au&&ay.nodeType===3&&ay.nodeValue.length===1&&ay.nodeValue.charCodeAt(0)===65279)&&!b(ay)){if(!aw){aw=c.clone(ap,V);ay.parentNode.insertBefore(aw,ay);an.push(aw)}aw.appendChild(ay)}else{if(aD=="li"&&aq){aw=ab(ay,aq,ap,an,ax)}else{aw=0;R(a.grep(ay.childNodes),ax);if(aA){ar=aC}aw=0}}}R(av,ax)});if(ak.wrap_links===false){R(an,function(av){function aw(aA){var az,ay,ax;if(aA.nodeName==="A"){ay=c.clone(ap,V);an.push(ay);ax=a.grep(aA.childNodes);for(az=0;az1||!H(ax))&&av===0){c.remove(ax,1);return}if(ak.inline||ak.wrapper){if(!ak.exact&&av===1){ax=aw(ax)}R(af,function(az){R(c.select(az.inline,ax),function(aB){var aA;if(az.wrap_links===false){aA=aB.parentNode;do{if(aA.nodeName==="A"){return}}while(aA=aA.parentNode)}X(az,aj,aB,az.exact?aB:null)})});if(y(ax.parentNode,ac,aj)){c.remove(ax,1);ax=0;return C}if(ak.merge_with_parents){c.getParent(ax.parentNode,function(az){if(y(az,ac,aj)){c.remove(ax,1);ax=0;return C}})}if(ax&&ak.merge_siblings!==false){ax=u(E(ax),ax);ax=u(ax,E(ax,C))}}})}if(ak){if(ae){if(ae.nodeType){aa=c.createRng();aa.setStartBefore(ae);aa.setEndAfter(ae);al(p(aa,af),null,true)}else{al(ae,null,true)}}else{if(!ag||!ak.inline||c.select("td.mceSelected,th.mceSelected").length){var am=Y.selection.getNode();if(!m&&af[0].defaultBlock&&!c.getParent(am,c.isBlock)){W(af[0].defaultBlock)}Y.selection.setRng(ad());ai=r.getBookmark();al(p(r.getRng(C),af),ai);if(ak.styles&&(ak.styles.color||ak.styles.textDecoration)){a.walk(am,K,"childNodes");K(am)}r.moveToBookmark(ai);P(r.getRng(C));Y.nodeChanged()}else{S("apply",ac,aj)}}}}function B(ab,ak,ad){var ae=T(ab),am=ae[0],ai,ah,aa,aj=true;function ac(at){var ar,aq,ap,ao,av,au;if(at.nodeType===1&&x(at)){av=aj;aj=x(at)==="true";au=true}ar=a.grep(at.childNodes);if(aj&&!au){for(aq=0,ap=ae.length;aq=0;aa--){Z=af[aa].selector;if(!Z){return C}for(ae=ab.length-1;ae>=0;ae--){if(c.is(ab[ae],Z)){return C}}}}return V}a.extend(this,{get:T,register:l,apply:W,remove:B,toggle:F,match:k,matchAll:v,matchNode:y,canApply:z});j();U();function h(Z,aa){if(g(Z,aa.inline)){return C}if(g(Z,aa.block)){return C}if(aa.selector){return c.is(Z,aa.selector)}}function g(aa,Z){aa=aa||"";Z=Z||"";aa=""+(aa.nodeName||aa);Z=""+(Z.nodeName||Z);return aa.toLowerCase()==Z.toLowerCase()}function N(aa,Z){var ab=c.getStyle(aa,Z);if(Z=="color"||Z=="backgroundColor"){ab=c.toHex(ab)}if(Z=="fontWeight"&&ab==700){ab="bold"}return""+ab}function q(Z,aa){if(typeof(Z)!="string"){Z=Z(aa)}else{if(aa){Z=Z.replace(/%(\w+)/g,function(ac,ab){return aa[ab]||ac})}}return Z}function f(Z){return Z&&Z.nodeType===3&&/^([\t \r\n]+|)$/.test(Z.nodeValue)}function Q(ab,aa,Z){var ac=c.create(aa,Z);ab.parentNode.insertBefore(ac,ab);ac.appendChild(ab);return ac}function p(Z,ak,ac){var an,al,af,aj,ab=Z.startContainer,ag=Z.startOffset,ap=Z.endContainer,ai=Z.endOffset;function am(ax){var ar,av,aw,au,at,aq;ar=av=ax?ab:ap;at=ax?"previousSibling":"nextSibling";aq=c.getRoot();if(ar.nodeType==3&&!f(ar)){if(ax?ag>0:aial?al:ag];if(ab.nodeType==3){ag=0}}if(ap.nodeType==1&&ap.hasChildNodes()){al=ap.childNodes.length-1;ap=ap.childNodes[ai>al?al:ai-1];if(ap.nodeType==3){ai=ap.nodeValue.length}}function ao(ar){var aq=ar;while(aq){if(aq.nodeType===1&&x(aq)){return x(aq)==="false"?aq:ar}aq=aq.parentNode}return ar}function ah(ar,aw,ay){var av,at,ax,aq;function au(aA,aC){var aD,az,aB=aA.nodeValue;if(typeof(aC)=="undefined"){aC=ay?aB.length:0}if(ay){aD=aB.lastIndexOf(" ",aC);az=aB.lastIndexOf("\u00a0",aC);aD=aD>az?aD:az;if(aD!==-1&&!ac){aD++}}else{aD=aB.indexOf(" ",aC);az=aB.indexOf("\u00a0",aC);aD=aD!==-1&&(az===-1||aD0&&af.node.nodeType===3&&af.node.nodeValue.charAt(af.offset-1)===" "){if(af.offset>1){ap=af.node;ap.splitText(af.offset-1)}}}}if(ak[0].inline||ak[0].block_expand){if(!ak[0].inline||(ab.nodeType!=3||ag===0)){ab=am(true)}if(!ak[0].inline||(ap.nodeType!=3||ai===ap.nodeValue.length)){ap=am()}}if(ak[0].selector&&ak[0].expand!==V&&!ak[0].inline){ab=ad(ab,"previousSibling");ap=ad(ap,"nextSibling")}if(ak[0].block||ak[0].selector){ab=aa(ab,"previousSibling");ap=aa(ap,"nextSibling");if(ak[0].block){if(!H(ab)){ab=am(true)}if(!H(ap)){ap=am()}}}if(ab.nodeType==1){ag=s(ab);ab=ab.parentNode}if(ap.nodeType==1){ai=s(ap)+1;ap=ap.parentNode}return{startContainer:ab,startOffset:ag,endContainer:ap,endOffset:ai}}function X(af,ae,ac,Z){var ab,aa,ad;if(!h(ac,af)){return V}if(af.remove!="all"){R(af.styles,function(ah,ag){ah=q(ah,ae);if(typeof(ag)==="number"){ag=ah;Z=0}if(!Z||g(N(Z,ag),ah)){c.setStyle(ac,ag,"")}ad=1});if(ad&&c.getAttrib(ac,"style")==""){ac.removeAttribute("style");ac.removeAttribute("data-mce-style")}R(af.attributes,function(ai,ag){var ah;ai=q(ai,ae);if(typeof(ag)==="number"){ag=ai;Z=0}if(!Z||g(c.getAttrib(Z,ag),ai)){if(ag=="class"){ai=c.getAttrib(ac,ag);if(ai){ah="";R(ai.split(/\s+/),function(aj){if(/mce\w+/.test(aj)){ah+=(ah?" ":"")+aj}});if(ah){c.setAttrib(ac,ag,ah);return}}}if(ag=="class"){ac.removeAttribute("className")}if(e.test(ag)){ac.removeAttribute("data-mce-"+ag)}ac.removeAttribute(ag)}});R(af.classes,function(ag){ag=q(ag,ae);if(!Z||c.hasClass(Z,ag)){c.removeClass(ac,ag)}});aa=c.getAttribs(ac);for(ab=0;abab?ab:ad]}if(Z.nodeType===3&&ae&&ad>=Z.nodeValue.length){Z=new t(Z,Y.getBody()).next()||Z}if(Z.nodeType===3&&!ae&&ad===0){Z=new t(Z,Y.getBody()).prev()||Z}return Z}function S(ai,Z,ag){var aj="_mce_caret",aa=Y.settings.caret_debug;function ab(am){var al=c.create("span",{id:aj,"data-mce-bogus":true,style:aa?"color:red":""});if(am){al.appendChild(Y.getDoc().createTextNode(G))}return al}function ah(am,al){while(am){if((am.nodeType===3&&am.nodeValue!==G)||am.childNodes.length>1){return false}if(al&&am.nodeType===1){al.push(am)}am=am.firstChild}return true}function ae(al){while(al){if(al.id===aj){return al}al=al.parentNode}}function ad(al){var am;if(al){am=new t(al,al);for(al=am.current();al;al=am.next()){if(al.nodeType===3){return al}}}}function ac(an,am){var ao,al;if(!an){an=ae(r.getStart());if(!an){while(an=c.get(aj)){ac(an,false)}}}else{al=r.getRng(true);if(ah(an)){if(am!==false){al.setStartBefore(an);al.setEndBefore(an)}c.remove(an)}else{ao=ad(an);if(ao.nodeValue.charAt(0)===G){ao=ao.deleteData(0,1)}c.remove(an,1)}r.setRng(al)}}function af(){var an,al,ar,aq,ao,am,ap;an=r.getRng(true);aq=an.startOffset;am=an.startContainer;ap=am.nodeValue;al=ae(r.getStart());if(al){ar=ad(al)}if(ap&&aq>0&&aq=0;ap--){an.appendChild(c.clone(au[ap],false));an=an.firstChild}an.appendChild(c.doc.createTextNode(G));an=an.firstChild;c.insertAfter(at,av);r.setCursorLocation(an,1)}}if(!self._hasCaretEvents){Y.onBeforeGetContent.addToTop(function(){var al=[],am;if(ah(ae(r.getStart()),al)){am=al.length;while(am--){c.setAttrib(al[am],"data-mce-bogus","1")}}});a.each("onMouseUp onKeyUp".split(" "),function(al){Y[al].addToTop(function(){ac()})});Y.onKeyDown.addToTop(function(al,an){var am=an.keyCode;if(am==8||am==37||am==39){ac(ae(r.getStart()))}});r.onSetContent.add(function(){c.getParent(r.getStart(),function(al){if(al.id!==aj&&c.getAttrib(al,"data-mce-bogus")&&!c.isEmpty(al)){c.setAttrib(al,"data-mce-bogus",null)}})});self._hasCaretEvents=true}if(ai=="apply"){af()}else{ak()}}function P(aa){var Z=aa.startContainer,ag=aa.startOffset,ac,af,ae,ab,ad;if(Z.nodeType==3&&ag>=Z.nodeValue.length){ag=s(Z);Z=Z.parentNode;ac=true}if(Z.nodeType==1){ab=Z.childNodes;Z=ab[Math.min(ag,ab.length-1)];af=new t(Z,c.getParent(Z,c.isBlock));if(ag>ab.length-1||ac){af.next()}for(ae=af.current();ae;ae=af.next()){if(ae.nodeType==3&&!f(ae)){ad=c.create("a",null,G);ae.parentNode.insertBefore(ad,ae);aa.setStart(ae,0);r.setRng(aa);c.remove(ad);return}}}}}})(tinymce);tinymce.onAddEditor.add(function(e,a){var d,h,g,c=a.settings;function b(j,i){e.each(i,function(l,k){if(l){g.setStyle(j,k,l)}});g.rename(j,"span")}function f(i,j){g=i.dom;if(c.convert_fonts_to_spans){e.each(g.select("font,u,strike",j.node),function(k){d[k.nodeName.toLowerCase()](a.dom,k)})}}if(c.inline_styles){h=e.explode(c.font_size_legacy_values);d={font:function(j,i){b(i,{backgroundColor:i.style.backgroundColor,color:i.color,fontFamily:i.face,fontSize:h[parseInt(i.size,10)-1]})},u:function(j,i){b(i,{textDecoration:"underline"})},strike:function(j,i){b(i,{textDecoration:"line-through"})}};a.onPreProcess.add(f);a.onSetContent.add(f);a.onInit.add(function(){a.selection.onSetContent.add(f)})}});(function(b){var a=b.dom.TreeWalker;b.EnterKey=function(e){var h=e.dom,d=e.selection,c=e.settings,g=e.undoManager;function f(y){var u=d.getRng(true),C,i,x,t,o,H,n,j,l,s,E,v,z;function B(I){return I&&h.isBlock(I)&&!/^(TD|TH|CAPTION)$/.test(I.nodeName)&&!/^(fixed|absolute)/i.test(I.style.position)&&h.getContentEditable(I)!=="true"}function m(J){var O,M,I,P,N,L=J,K;I=h.createRng();if(J.hasChildNodes()){O=new a(J,J);while(M=O.current()){if(M.nodeType==3){I.setStart(M,0);I.setEnd(M,0);break}if(/^(BR|IMG)$/.test(M.nodeName)){I.setStartBefore(M);I.setEndBefore(M);break}L=M;M=O.next()}if(!M){I.setStart(L,0);I.setEnd(L,0)}}else{if(J.nodeName=="BR"){if(J.nextSibling&&h.isBlock(J.nextSibling)){if(!H||H<9){K=h.create("br");J.parentNode.insertBefore(K,J)}I.setStartBefore(J);I.setEndBefore(J)}else{I.setStartAfter(J);I.setEndAfter(J)}}else{I.setStart(J,0);I.setEnd(J,0)}}d.setRng(I);h.remove(K);N=h.getViewPort(e.getWin());P=h.getPos(J).y;if(PN.y+N.h){e.getWin().scrollTo(0,P"}return M}function p(L){var K,J,I;if(x.nodeType==3&&(L?t>0:t=x.nodeValue.length){if(!b.isIE&&!A()){J=h.create("br");u.insertNode(J);u.setStartAfter(J);u.setEndAfter(J);I=true}}J=h.create("br");u.insertNode(J);if(b.isIE&&s=="PRE"&&(!H||H<8)){J.parentNode.insertBefore(h.doc.createTextNode("\r"),J)}if(!I){u.setStartAfter(J);u.setEndAfter(J)}else{u.setStartBefore(J);u.setEndBefore(J)}d.setRng(u);g.add()}function r(I){do{if(I.nodeType===3){I.nodeValue=I.nodeValue.replace(/^[\r\n]+/,"")}I=I.firstChild}while(I)}function F(K){var I=h.getRoot(),J,L;J=K;while(J!==I&&h.getContentEditable(J)!=="false"){if(h.getContentEditable(J)==="true"){L=J}J=J.parentNode}return J!==I?L:I}if(!u.collapsed){e.execCommand("Delete");return}if(y.isDefaultPrevented()){return}x=u.startContainer;t=u.startOffset;v=c.forced_root_block;v=v?v.toUpperCase():"";H=h.doc.documentMode;if(x.nodeType==1&&x.hasChildNodes()){z=t>x.childNodes.length-1;x=x.childNodes[Math.min(t,x.childNodes.length-1)]||x;t=0}i=F(x);if(!i){return}g.beforeChange();if(!h.isBlock(i)&&i!=h.getRoot()){if(!v||y.shiftKey){G()}return}if((v&&!y.shiftKey)||(!v&&y.shiftKey)){x=k(x,t)}o=h.getParent(x,h.isBlock);l=o?h.getParent(o.parentNode,h.isBlock):null;s=o?o.nodeName.toUpperCase():"";E=l?l.nodeName.toUpperCase():"";if(s=="LI"&&h.isEmpty(o)){if(/^(UL|OL|LI)$/.test(l.parentNode.nodeName)){return false}D();return}if(s=="PRE"&&c.br_in_pre!==false){if(!y.shiftKey){G();return}}else{if((!v&&!y.shiftKey&&s!="LI")||(v&&y.shiftKey)){G();return}}v=v||"P";if(p()){if(/^(H[1-6]|PRE)$/.test(s)&&E!="HGROUP"){n=q(v)}else{n=q()}if(c.end_container_on_empty_block&&B(l)&&h.isEmpty(o)){n=h.split(l,o)}else{h.insertAfter(n,o)}}else{if(p(true)){n=o.parentNode.insertBefore(q(),o)}else{C=u.cloneRange();C.setEndAfter(o);j=C.extractContents();r(j);n=j.firstChild;h.insertAfter(j,o)}}h.setAttrib(n,"id","");m(n);g.add()}e.onKeyDown.add(function(j,i){if(i.keyCode==13){if(f(i)!==false){i.preventDefault()}}})}})(tinymce); \ No newline at end of file diff --git a/lib/editor/tinymce/tiny_mce/3.5/tiny_mce_prototype.js b/lib/editor/tinymce/tiny_mce/3.5/tiny_mce_prototype.js deleted file mode 100644 index 7c95d2a37e6..00000000000 --- a/lib/editor/tinymce/tiny_mce/3.5/tiny_mce_prototype.js +++ /dev/null @@ -1 +0,0 @@ -(function(e){var a=/^\s*|\s*$/g,b,d="B".replace(/A(.)|B/,"$1")==="$1";var c={majorVersion:"@@tinymce_major_version@@",minorVersion:"@@tinymce_minor_version@@",releaseDate:"@@tinymce_release_date@@",_init:function(){var s=this,q=document,o=navigator,g=o.userAgent,m,f,l,k,j,r;s.isOpera=e.opera&&opera.buildNumber;s.isWebKit=/WebKit/.test(g);s.isIE=!s.isWebKit&&!s.isOpera&&(/MSIE/gi).test(g)&&(/Explorer/gi).test(o.appName);s.isIE6=s.isIE&&/MSIE [56]/.test(g);s.isIE7=s.isIE&&/MSIE [7]/.test(g);s.isIE8=s.isIE&&/MSIE [8]/.test(g);s.isIE9=s.isIE&&/MSIE [9]/.test(g);s.isGecko=!s.isWebKit&&/Gecko/.test(g);s.isMac=g.indexOf("Mac")!=-1;s.isAir=/adobeair/i.test(g);s.isIDevice=/(iPad|iPhone)/.test(g);s.isIOS5=s.isIDevice&&g.match(/AppleWebKit\/(\d*)/)[1]>=534;if(e.tinyMCEPreInit){s.suffix=tinyMCEPreInit.suffix;s.baseURL=tinyMCEPreInit.base;s.query=tinyMCEPreInit.query;return}s.suffix="";f=q.getElementsByTagName("base");for(m=0;m0?b:[f.scope]);if(e===false){break}}a.inDispatch=false;return e}});(function(){var a=tinymce.each;tinymce.create("tinymce.util.URI",{URI:function(e,g){var f=this,i,d,c,h;e=tinymce.trim(e);g=f.settings=g||{};if(/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e)){f.source=e;return}if(e.indexOf("/")===0&&e.indexOf("//")!==0){e=(g.base_uri?g.base_uri.protocol||"http":"http")+"://mce_host"+e}if(!/^[\w\-]*:?\/\//.test(e)){h=g.base_uri?g.base_uri.path:new tinymce.util.URI(location.href).directory;e=((g.base_uri&&g.base_uri.protocol)||"http")+"://mce_host"+f.toAbsPath(h,e)}e=e.replace(/@@/g,"(mce_at)");e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);a(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(b,j){var k=e[j];if(k){k=k.replace(/\(mce_at\)/g,"@@")}f[b]=k});c=g.base_uri;if(c){if(!f.protocol){f.protocol=c.protocol}if(!f.userInfo){f.userInfo=c.userInfo}if(!f.port&&f.host==="mce_host"){f.port=c.port}if(!f.host||f.host==="mce_host"){f.host=c.host}f.source=""}},setPath:function(c){var b=this;c=/^(.*?)\/?(\w+)?$/.exec(c);b.path=c[0];b.directory=c[1];b.file=c[2];b.source="";b.getURI()},toRelative:function(b){var d=this,f;if(b==="./"){return b}b=new tinymce.util.URI(b,{base_uri:d});if((b.host!="mce_host"&&d.host!=b.host&&b.host)||d.port!=b.port||d.protocol!=b.protocol){return b.getURI()}var c=d.getURI(),e=b.getURI();if(c==e||(c.charAt(c.length-1)=="/"&&c.substr(0,c.length-1)==e)){return c}f=d.toRelPath(d.path,b.path);if(b.query){f+="?"+b.query}if(b.anchor){f+="#"+b.anchor}return f},toAbsolute:function(b,c){b=new tinymce.util.URI(b,{base_uri:this});return b.getURI(this.host==b.host&&this.protocol==b.protocol?c:0)},toRelPath:function(g,h){var c,f=0,d="",e,b;g=g.substring(0,g.lastIndexOf("/"));g=g.split("/");c=h.split("/");if(g.length>=c.length){for(e=0,b=g.length;e=c.length||g[e]!=c[e]){f=e+1;break}}}if(g.length=g.length||g[e]!=c[e]){f=e+1;break}}}if(f===1){return h}for(e=0,b=g.length-(f-1);e=0;c--){if(f[c].length===0||f[c]==="."){continue}if(f[c]===".."){b++;continue}if(b>0){b--;continue}h.push(f[c])}c=e.length-b;if(c<=0){g=h.reverse().join("/")}else{g=e.slice(0,c).join("/")+"/"+h.reverse().join("/")}if(g.indexOf("/")!==0){g="/"+g}if(d&&g.lastIndexOf("/")!==g.length-1){g+=d}return g},getURI:function(d){var c,b=this;if(!b.source||d){c="";if(!d){if(b.protocol){c+=b.protocol+"://"}if(b.userInfo){c+=b.userInfo+"@"}if(b.host){c+=b.host}if(b.port){c+=":"+b.port}}if(b.path){c+=b.path}if(b.query){c+="?"+b.query}if(b.anchor){c+="#"+b.anchor}b.source=c}return b.source}})})();(function(){var a=tinymce.each;tinymce.create("static tinymce.util.Cookie",{getHash:function(d){var b=this.get(d),c;if(b){a(b.split("&"),function(e){e=e.split("=");c=c||{};c[unescape(e[0])]=unescape(e[1])})}return c},setHash:function(j,b,g,f,i,c){var h="";a(b,function(e,d){h+=(!h?"":"&")+escape(d)+"="+escape(e)});this.set(j,h,g,f,i,c)},get:function(i){var h=document.cookie,g,f=i+"=",d;if(!h){return}d=h.indexOf("; "+f);if(d==-1){d=h.indexOf(f);if(d!==0){return null}}else{d+=2}g=h.indexOf(";",d);if(g==-1){g=h.length}return unescape(h.substring(d+f.length,g))},set:function(i,b,g,f,h,c){document.cookie=i+"="+escape(b)+((g)?"; expires="+g.toGMTString():"")+((f)?"; path="+escape(f):"")+((h)?"; domain="+h:"")+((c)?"; secure":"")},remove:function(e,b){var c=new Date();c.setTime(c.getTime()-1000);this.set(e,"",c,b,c)}})})();(function(){function serialize(o,quote){var i,v,t,name;quote=quote||'"';if(o==null){return"null"}t=typeof o;if(t=="string"){v="\bb\tt\nn\ff\rr\"\"''\\\\";return quote+o.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(a,b){if(quote==='"'&&a==="'"){return a}i=v.indexOf(b);if(i+1){return"\\"+v.charAt(i+1)}a=b.charCodeAt().toString(16);return"\\u"+"0000".substring(a.length)+a})+quote}if(t=="object"){if(o.hasOwnProperty&&o instanceof Array){for(i=0,v="[";i0?",":"")+serialize(o[i],quote)}return v+"]"}v="{";for(name in o){if(o.hasOwnProperty(name)){v+=typeof o[name]!="function"?(v.length>1?","+quote:quote)+name+quote+":"+serialize(o[name],quote):""}}return v+"}"}return""+o}tinymce.util.JSON={serialize:serialize,parse:function(s){try{return eval("("+s+")")}catch(ex){}}}})();tinymce.create("static tinymce.util.XHR",{send:function(g){var a,e,b=window,h=0;function f(){if(!g.async||a.readyState==4||h++>10000){if(g.success&&h<10000&&a.status==200){g.success.call(g.success_scope,""+a.responseText,a,g)}else{if(g.error){g.error.call(g.error_scope,h>10000?"TIMED_OUT":"GENERAL",a,g)}}a=null}else{b.setTimeout(f,10)}}g.scope=g.scope||this;g.success_scope=g.success_scope||g.scope;g.error_scope=g.error_scope||g.scope;g.async=g.async===false?false:true;g.data=g.data||"";function d(i){a=0;try{a=new ActiveXObject(i)}catch(c){}return a}a=b.XMLHttpRequest?new XMLHttpRequest():d("Microsoft.XMLHTTP")||d("Msxml2.XMLHTTP");if(a){if(a.overrideMimeType){a.overrideMimeType(g.content_type)}a.open(g.type||(g.data?"POST":"GET"),g.url,g.async);if(g.content_type){a.setRequestHeader("Content-Type",g.content_type)}a.setRequestHeader("X-Requested-With","XMLHttpRequest");a.send(g.data);if(!g.async){return f()}e=b.setTimeout(f,10)}}});(function(){var c=tinymce.extend,b=tinymce.util.JSON,a=tinymce.util.XHR;tinymce.create("tinymce.util.JSONRequest",{JSONRequest:function(d){this.settings=c({},d);this.count=0},send:function(f){var e=f.error,d=f.success;f=c(this.settings,f);f.success=function(h,g){h=b.parse(h);if(typeof(h)=="undefined"){h={error:"JSON Parse error."}}if(h.error){e.call(f.error_scope||f.scope,h.error,g)}else{d.call(f.success_scope||f.scope,h.result)}};f.error=function(h,g){if(e){e.call(f.error_scope||f.scope,h,g)}};f.data=b.serialize({id:f.id||"c"+(this.count++),method:f.method,params:f.params});f.content_type="application/json";a.send(f)},"static":{sendRPC:function(d){return new tinymce.util.JSONRequest().send(d)}}})}());(function(a){a.VK={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,modifierPressed:function(b){return b.shiftKey||b.ctrlKey||b.altKey}}})(tinymce);tinymce.util.Quirks=function(d){var l=tinymce.VK,r=l.BACKSPACE,s=l.DELETE,o=d.dom,z=d.selection,q=d.settings;function c(D,C){try{d.getDoc().execCommand(D,false,C)}catch(B){}}function h(){function B(E){var C,G,D,F;C=z.getRng();G=o.getParent(C.startContainer,o.isBlock);if(E){G=o.getNext(G,o.isBlock)}if(G){D=G.firstChild;while(D&&D.nodeType==3&&D.nodeValue.length===0){D=D.nextSibling}if(D&&D.nodeName==="SPAN"){F=D.cloneNode(false)}}d.getDoc().execCommand(E?"ForwardDelete":"Delete",false,null);G=o.getParent(C.startContainer,o.isBlock);tinymce.each(o.select("span.Apple-style-span,font.Apple-style-span",G),function(H){var I=z.getBookmark();if(F){o.replace(F.cloneNode(false),H,true)}else{o.remove(H,true)}z.moveToBookmark(I)})}d.onKeyDown.add(function(C,E){var D;D=E.keyCode==s;if(!E.isDefaultPrevented()&&(D||E.keyCode==r)&&!l.modifierPressed(E)){E.preventDefault();B(D)}});d.addCommand("Delete",function(){B()})}function A(){function C(E,H){var D,G,F=H?"start":"end";D=E[F+"Container"];G=E[F+"Offset"];if(D.nodeType==1&&D.hasChildNodes()){D=D.childNodes[Math.min(H?G:(G>0?G-1:0),D.childNodes.length-1)]}return D}function B(G,K){var F,J,E,H,I=K?"start":"end",D;F=G[I+"Container"];J=G[I+"Offset"];E=o.getRoot();if(F.nodeType==1){D=J>=F.childNodes.length;F=C(G,K);if(F.nodeType==3){J=K&&!D?0:F.nodeValue.length}}if(F.nodeType==3&&((K&&J>0)||(!K&&J7){return}c("RespectVisibilityInDesign",true);o.addClass(d.getBody(),"mceHideBrInPre");d.parser.addNodeFilter("pre",function(C,E){var F=C.length,H,D,I,G;while(F--){H=C[F].getAll("br");D=H.length;while(D--){I=H[D];G=I.prev;if(G&&G.type===3&&G.value.charAt(G.value-1)!="\n"){G.value+="\n"}else{I.parent.insert(new tinymce.html.Node("#text",3),I,true).value="\n"}}}});d.serializer.addNodeFilter("pre",function(C,E){var F=C.length,H,D,I,G;while(F--){H=C[F].getAll("br");D=H.length;while(D--){I=H[D];G=I.prev;if(G&&G.type==3){G.value=G.value.replace(/\r?\n$/,"")}}}})}function f(){o.bind(d.getBody(),"mouseup",function(D){var C,B=z.getNode();if(B.nodeName=="IMG"){if(C=o.getStyle(B,"width")){o.setAttrib(B,"width",C.replace(/[^0-9%]+/g,""));o.setStyle(B,"width","")}if(C=o.getStyle(B,"height")){o.setAttrib(B,"height",C.replace(/[^0-9%]+/g,""));o.setStyle(B,"height","")}}})}function p(){d.onKeyDown.add(function(H,I){var G,B,C,E,F,J,D;G=I.keyCode==s;if(!I.isDefaultPrevented()&&(G||I.keyCode==r)&&!l.modifierPressed(I)){B=z.getRng();C=B.startContainer;E=B.startOffset;D=B.collapsed;if(C.nodeType==3&&C.nodeValue.length>0&&((E===0&&!D)||(D&&E===(G?0:1)))){nonEmptyElements=H.schema.getNonEmptyElements();I.preventDefault();F=o.create("br",{id:"__tmp"});C.parentNode.insertBefore(F,C);H.getDoc().execCommand(G?"ForwardDelete":"Delete",false,null);C=z.getRng().startContainer;J=C.previousSibling;if(J&&J.nodeType==1&&!o.isBlock(J)&&o.isEmpty(J)&&!nonEmptyElements[J.nodeName.toLowerCase()]){o.remove(J)}o.remove("__tmp")}}})}function e(){d.onKeyDown.add(function(F,G){var D,C,H,B,E;if(G.isDefaultPrevented()||G.keyCode!=l.BACKSPACE){return}D=z.getRng();C=D.startContainer;H=D.startOffset;B=o.getRoot();E=C;if(!D.collapsed||H!==0){return}while(E&&E.parentNode&&E.parentNode.firstChild==E&&E.parentNode!=B){E=E.parentNode}if(E.tagName==="BLOCKQUOTE"){F.formatter.toggle("blockquote",null,E);D.setStart(C,0);D.setEnd(C,0);z.setRng(D);z.collapse(false)}})}function k(){function B(){d._refreshContentEditable();c("StyleWithCSS",false);c("enableInlineTableEditing",false);if(!q.object_resizing){c("enableObjectResizing",false)}}if(!q.readonly){d.onBeforeExecCommand.add(B);d.onMouseDown.add(B)}}function n(){function B(C,D){tinymce.each(o.select("a"),function(G){var E=G.parentNode,F=o.getRoot();if(E.lastChild===G){while(E&&!o.isBlock(E)){if(E.parentNode.lastChild!==E||E===F){return}E=E.parentNode}o.add(E,"br",{"data-mce-bogus":1})}})}d.onExecCommand.add(function(C,D){if(D==="CreateLink"){B(C)}});d.onSetContent.add(z.onSetContent.add(B))}function a(){function B(D,C){if(!D||!C.initial){d.execCommand("mceRepaint")}}d.onUndo.add(B);d.onRedo.add(B);d.onSetContent.add(B)}function j(){d.onKeyDown.add(function(B,C){if(!C.isDefaultPrevented()&&C.keyCode==8&&z.getNode().nodeName=="IMG"){C.preventDefault();B.undoManager.beforeChange();o.remove(z.getNode());B.undoManager.add()}})}u();e();A();if(tinymce.isWebKit){p();h();t();v();if(tinymce.isIDevice){i()}}if(tinymce.isIE){m();y();g();f();j()}if(tinymce.isGecko){m();b();x();k();n();a()}};(function(j){var a,g,d,k=/[&<>\"\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,b=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,f=/[<>&\"\']/g,c=/&(#x|#)?([\w]+);/g,i={128:"\u20AC",130:"\u201A",131:"\u0192",132:"\u201E",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02C6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017D",145:"\u2018",146:"\u2019",147:"\u201C",148:"\u201D",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02DC",153:"\u2122",154:"\u0161",155:"\u203A",156:"\u0153",158:"\u017E",159:"\u0178"};g={'"':""","'":"'","<":"<",">":">","&":"&"};d={"<":"<",">":">","&":"&",""":'"',"'":"'"};function h(l){var m;m=document.createElement("div");m.innerHTML=l;return m.textContent||m.innerText||l}function e(m,p){var n,o,l,q={};if(m){m=m.split(",");p=p||10;for(n=0;n1){return"&#"+(((n.charCodeAt(0)-55296)*1024)+(n.charCodeAt(1)-56320)+65536)+";"}return g[n]||"&#"+n.charCodeAt(0)+";"})},encodeNamed:function(n,l,m){m=m||a;return n.replace(l?k:b,function(o){return g[o]||m[o]||o})},getEncodeFunc:function(l,o){var p=j.html.Entities;o=e(o)||a;function m(r,q){return r.replace(q?k:b,function(s){return g[s]||o[s]||"&#"+s.charCodeAt(0)+";"||s})}function n(r,q){return p.encodeNamed(r,q,o)}l=j.makeMap(l.replace(/\+/g,","));if(l.named&&l.numeric){return m}if(l.named){if(o){return n}return p.encodeNamed}if(l.numeric){return p.encodeNumeric}return p.encodeRaw},decode:function(l){return l.replace(c,function(n,m,o){if(m){o=parseInt(o,m.length===2?16:10);if(o>65535){o-=65536;return String.fromCharCode(55296+(o>>10),56320+(o&1023))}else{return i[o]||String.fromCharCode(o)}}return d[n]||a[n]||h(n)})}}})(tinymce);tinymce.html.Styles=function(d,f){var k=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,h=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,b=/\s*([^:]+):\s*([^;]+);?/g,l=/\s+$/,m=/rgb/,e,g,a={},j;d=d||{};j="\\\" \\' \\; \\: ; : \uFEFF".split(" ");for(g=0;g1?r:"0"+r}return"#"+o(q)+o(p)+o(i)}return{toHex:function(i){return i.replace(k,c)},parse:function(s){var z={},q,n,x,r,v=d.url_converter,y=d.url_converter_scope||this;function p(D,G){var F,C,B,E;F=z[D+"-top"+G];if(!F){return}C=z[D+"-right"+G];if(F!=C){return}B=z[D+"-bottom"+G];if(C!=B){return}E=z[D+"-left"+G];if(B!=E){return}z[D+G]=E;delete z[D+"-top"+G];delete z[D+"-right"+G];delete z[D+"-bottom"+G];delete z[D+"-left"+G]}function u(C){var D=z[C],B;if(!D||D.indexOf(" ")<0){return}D=D.split(" ");B=D.length;while(B--){if(D[B]!==D[0]){return false}}z[C]=D[0];return true}function A(D,C,B,E){if(!u(C)){return}if(!u(B)){return}if(!u(E)){return}z[D]=z[C]+" "+z[B]+" "+z[E];delete z[C];delete z[B];delete z[E]}function t(B){r=true;return a[B]}function i(C,B){if(r){C=C.replace(/\uFEFF[0-9]/g,function(D){return a[D]})}if(!B){C=C.replace(/\\([\'\";:])/g,"$1")}return C}function o(C,B,F,E,G,D){G=G||D;if(G){G=i(G);return"'"+G.replace(/\'/g,"\\'")+"'"}B=i(B||F||E);if(v){B=v.call(y,B,"style")}return"url('"+B.replace(/\'/g,"\\'")+"')"}if(s){s=s.replace(/\\[\"\';:\uFEFF]/g,t).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(B){return B.replace(/[;:]/g,t)});while(q=b.exec(s)){n=q[1].replace(l,"").toLowerCase();x=q[2].replace(l,"");if(n&&x.length>0){if(n==="font-weight"&&x==="700"){x="bold"}else{if(n==="color"||n==="background-color"){x=x.toLowerCase()}}x=x.replace(k,c);x=x.replace(h,o);z[n]=r?i(x,true):x}b.lastIndex=q.index+q[0].length}p("border","");p("border","-width");p("border","-color");p("border","-style");p("padding","");p("margin","");A("border","border-width","border-style","border-color");if(z.border==="medium none"){delete z.border}}return z},serialize:function(p,r){var o="",n,q;function i(t){var x,u,s,v;x=f.styles[t];if(x){for(u=0,s=x.length;u0){o+=(o.length>0?" ":"")+t+": "+v+";"}}}}if(r&&f&&f.styles){i("*");i(r)}else{for(n in p){q=p[n];if(q!==e&&q.length>0){o+=(o.length>0?" ":"")+n+": "+q+";"}}}return o}}};(function(f){var a={},e=f.makeMap,g=f.each;function d(j,i){return j.split(i||",")}function h(m,l){var j,k={};function i(n){return n.replace(/[A-Z]+/g,function(o){return i(m[o])})}for(j in m){if(m.hasOwnProperty(j)){m[j]=i(m[j])}}i(l).replace(/#/g,"#text").replace(/(\w+)\[([^\]]+)\]\[([^\]]*)\]/g,function(q,o,n,p){n=d(n,"|");k[o]={attributes:e(n),attributesOrder:n,children:e(p,"|",{"#comment":{}})}});return k}function b(){var i=a.html5;if(!i){i=a.html5=h({A:"id|accesskey|class|dir|draggable|item|hidden|itemprop|role|spellcheck|style|subject|title",B:"#|a|abbr|area|audio|b|bdo|br|button|canvas|cite|code|command|datalist|del|dfn|em|embed|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|meta|meter|noscript|object|output|progress|q|ruby|samp|script|select|small|span|strong|sub|sup|svg|textarea|time|var|video",C:"#|a|abbr|area|address|article|aside|audio|b|bdo|blockquote|br|button|canvas|cite|code|command|datalist|del|details|dfn|dialog|div|dl|em|embed|fieldset|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|menu|meta|meter|nav|noscript|ol|object|output|p|pre|progress|q|ruby|samp|script|section|select|small|span|strong|style|sub|sup|svg|table|textarea|time|ul|var|video"},"html[A|manifest][body|head]head[A][base|command|link|meta|noscript|script|style|title]title[A][#]base[A|href|target][]link[A|href|rel|media|type|sizes][]meta[A|http-equiv|name|content|charset][]style[A|type|media|scoped][#]script[A|charset|type|src|defer|async][#]noscript[A][C]body[A][C]section[A][C]nav[A][C]article[A][C]aside[A][C]h1[A][B]h2[A][B]h3[A][B]h4[A][B]h5[A][B]h6[A][B]hgroup[A][h1|h2|h3|h4|h5|h6]header[A][C]footer[A][C]address[A][C]p[A][B]br[A][]pre[A][B]dialog[A][dd|dt]blockquote[A|cite][C]ol[A|start|reversed][li]ul[A][li]li[A|value][C]dl[A][dd|dt]dt[A][B]dd[A][C]a[A|href|target|ping|rel|media|type][C]em[A][B]strong[A][B]small[A][B]cite[A][B]q[A|cite][B]dfn[A][B]abbr[A][B]code[A][B]var[A][B]samp[A][B]kbd[A][B]sub[A][B]sup[A][B]i[A][B]b[A][B]mark[A][B]progress[A|value|max][B]meter[A|value|min|max|low|high|optimum][B]time[A|datetime][B]ruby[A][B|rt|rp]rt[A][B]rp[A][B]bdo[A][B]span[A][B]ins[A|cite|datetime][B]del[A|cite|datetime][B]figure[A][C|legend|figcaption]figcaption[A][C]img[A|alt|src|height|width|usemap|ismap][]iframe[A|name|src|height|width|sandbox|seamless][]embed[A|src|height|width|type][]object[A|data|type|height|width|usemap|name|form|classid][param]param[A|name|value][]details[A|open][C|legend]command[A|type|label|icon|disabled|checked|radiogroup][]menu[A|type|label][C|li]legend[A][C|B]div[A][C]source[A|src|type|media][]audio[A|src|autobuffer|autoplay|loop|controls][source]video[A|src|autobuffer|autoplay|loop|controls|width|height|poster][source]hr[A][]form[A|accept-charset|action|autocomplete|enctype|method|name|novalidate|target][C]fieldset[A|disabled|form|name][C|legend]label[A|form|for][B]input[A|type|accept|alt|autocomplete|checked|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|height|list|max|maxlength|min|multiple|pattern|placeholder|readonly|required|size|src|step|width|files|value][]button[A|autofocus|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|name|value|type][B]select[A|autofocus|disabled|form|multiple|name|size][option|optgroup]datalist[A][B|option]optgroup[A|disabled|label][option]option[A|disabled|selected|label|value][]textarea[A|autofocus|disabled|form|maxlength|name|placeholder|readonly|required|rows|cols|wrap][]keygen[A|autofocus|challenge|disabled|form|keytype|name][]output[A|for|form|name][B]canvas[A|width|height][]map[A|name][B|C]area[A|shape|coords|href|alt|target|media|rel|ping|type][]mathml[A][]svg[A][]table[A|summary][caption|colgroup|thead|tfoot|tbody|tr]caption[A][C]colgroup[A|span][col]col[A|span][]thead[A][tr]tfoot[A][tr]tbody[A][tr]tr[A][th|td]th[A|headers|rowspan|colspan|scope][B]td[A|headers|rowspan|colspan][C]")}return i}function c(){var i=a.html4;if(!i){i=a.html4=h({Z:"H|K|N|O|P",Y:"X|form|R|Q",ZG:"E|span|width|align|char|charoff|valign",X:"p|T|div|U|W|isindex|fieldset|table",ZF:"E|align|char|charoff|valign",W:"pre|hr|blockquote|address|center|noframes",ZE:"abbr|axis|headers|scope|rowspan|colspan|align|char|charoff|valign|nowrap|bgcolor|width|height",ZD:"[E][S]",U:"ul|ol|dl|menu|dir",ZC:"p|Y|div|U|W|table|br|span|bdo|object|applet|img|map|K|N|Q",T:"h1|h2|h3|h4|h5|h6",ZB:"X|S|Q",S:"R|P",ZA:"a|G|J|M|O|P",R:"a|H|K|N|O",Q:"noscript|P",P:"ins|del|script",O:"input|select|textarea|label|button",N:"M|L",M:"em|strong|dfn|code|q|samp|kbd|var|cite|abbr|acronym",L:"sub|sup",K:"J|I",J:"tt|i|b|u|s|strike",I:"big|small|font|basefont",H:"G|F",G:"br|span|bdo",F:"object|applet|img|map|iframe",E:"A|B|C",D:"accesskey|tabindex|onfocus|onblur",C:"onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup",B:"lang|xml:lang|dir",A:"id|class|style|title"},"script[id|charset|type|language|src|defer|xml:space][]style[B|id|type|media|title|xml:space][]object[E|declare|classid|codebase|data|type|codetype|archive|standby|width|height|usemap|name|tabindex|align|border|hspace|vspace][#|param|Y]param[id|name|value|valuetype|type][]p[E|align][#|S]a[E|D|charset|type|name|href|hreflang|rel|rev|shape|coords|target][#|Z]br[A|clear][]span[E][#|S]bdo[A|C|B][#|S]applet[A|codebase|archive|code|object|alt|name|width|height|align|hspace|vspace][#|param|Y]h1[E|align][#|S]img[E|src|alt|name|longdesc|width|height|usemap|ismap|align|border|hspace|vspace][]map[B|C|A|name][X|form|Q|area]h2[E|align][#|S]iframe[A|longdesc|name|src|frameborder|marginwidth|marginheight|scrolling|align|width|height][#|Y]h3[E|align][#|S]tt[E][#|S]i[E][#|S]b[E][#|S]u[E][#|S]s[E][#|S]strike[E][#|S]big[E][#|S]small[E][#|S]font[A|B|size|color|face][#|S]basefont[id|size|color|face][]em[E][#|S]strong[E][#|S]dfn[E][#|S]code[E][#|S]q[E|cite][#|S]samp[E][#|S]kbd[E][#|S]var[E][#|S]cite[E][#|S]abbr[E][#|S]acronym[E][#|S]sub[E][#|S]sup[E][#|S]input[E|D|type|name|value|checked|disabled|readonly|size|maxlength|src|alt|usemap|onselect|onchange|accept|align][]select[E|name|size|multiple|disabled|tabindex|onfocus|onblur|onchange][optgroup|option]optgroup[E|disabled|label][option]option[E|selected|disabled|label|value][]textarea[E|D|name|rows|cols|disabled|readonly|onselect|onchange][]label[E|for|accesskey|onfocus|onblur][#|S]button[E|D|name|value|type|disabled][#|p|T|div|U|W|table|G|object|applet|img|map|K|N|Q]h4[E|align][#|S]ins[E|cite|datetime][#|Y]h5[E|align][#|S]del[E|cite|datetime][#|Y]h6[E|align][#|S]div[E|align][#|Y]ul[E|type|compact][li]li[E|type|value][#|Y]ol[E|type|compact|start][li]dl[E|compact][dt|dd]dt[E][#|S]dd[E][#|Y]menu[E|compact][li]dir[E|compact][li]pre[E|width|xml:space][#|ZA]hr[E|align|noshade|size|width][]blockquote[E|cite][#|Y]address[E][#|S|p]center[E][#|Y]noframes[E][#|Y]isindex[A|B|prompt][]fieldset[E][#|legend|Y]legend[E|accesskey|align][#|S]table[E|summary|width|border|frame|rules|cellspacing|cellpadding|align|bgcolor][caption|col|colgroup|thead|tfoot|tbody|tr]caption[E|align][#|S]col[ZG][]colgroup[ZG][col]thead[ZF][tr]tr[ZF|bgcolor][th|td]th[E|ZE][#|Y]form[E|action|method|name|enctype|onsubmit|onreset|accept|accept-charset|target][#|X|R|Q]noscript[E][#|Y]td[E|ZE][#|Y]tfoot[ZF][tr]tbody[ZF][tr]area[E|D|shape|coords|href|nohref|alt|target][]base[id|href|target][]body[E|onload|onunload|background|bgcolor|text|link|vlink|alink][#|Y]")}return i}f.html.Schema=function(A){var u=this,s={},k={},j=[],D,y;var o,q,z,r,v,n,p={};function m(F,E,H){var G=A[F];if(!G){G=a[F];if(!G){G=e(E," ",e(E.toUpperCase()," "));G=f.extend(G,H);a[F]=G}}else{G=e(G,",",e(G.toUpperCase()," "))}return G}A=A||{};y=A.schema=="html5"?b():c();if(A.verify_html===false){A.valid_elements="*[*]"}if(A.valid_styles){D={};g(A.valid_styles,function(F,E){D[E]=f.explode(F)})}o=m("whitespace_elements","pre script style textarea");q=m("self_closing_elements","colgroup dd dt li options p td tfoot th thead tr");z=m("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source");r=m("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls");n=m("non_empty_elements","td th iframe video audio object",z);v=m("block_elements","h1 h2 h3 h4 h5 h6 hr p div address pre form table tbody thead tfoot th tr td li ol ul caption blockquote center dl dt dd dir fieldset noscript menu isindex samp header footer article section hgroup aside nav figure");function i(E){return new RegExp("^"+E.replace(/([?+*])/g,".$1")+"$")}function C(L){var K,G,Z,V,aa,F,I,U,X,Q,Y,ac,O,J,W,E,S,H,ab,ad,P,T,N=/^([#+\-])?([^\[\/]+)(?:\/([^\[]+))?(?:\[([^\]]+)\])?$/,R=/^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,M=/[*?+]/;if(L){L=d(L);if(s["@"]){S=s["@"].attributes;H=s["@"].attributesOrder}for(K=0,G=L.length;K=0){for(U=A.length-1;U>=V;U--){T=A[U];if(T.valid){n.end(T.name)}}A.length=V}}function p(U,T,Y,X,W){var Z,V;T=T.toLowerCase();Y=T in H?T:j(Y||X||W||"");if(v&&!z&&T.indexOf("data-")!==0){Z=P[T];if(!Z&&F){V=F.length;while(V--){Z=F[V];if(Z.pattern.test(T)){break}}if(V===-1){Z=null}}if(!Z){return}if(Z.validValues&&!(Y in Z.validValues)){return}}N.map[T]=Y;N.push({name:T,value:Y})}l=new RegExp("<(?:(?:!--([\\w\\W]*?)-->)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([^>]+)>)|(?:([A-Za-z0-9\\-\\:]+)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g");D=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:\\.|[^\"])*)\")|(?:\'((?:\\.|[^\'])*)\')|([^>\s]+)))?/g;K={script:/<\/script[^>]*>/gi,style:/<\/style[^>]*>/gi,noscript:/<\/noscript[^>]*>/gi};M=e.getShortEndedElements();J=e.getSelfClosingElements();H=e.getBoolAttrs();v=c.validate;s=c.remove_internals;y=c.fix_self_closing;q=a.isIE;o=/^:/;while(g=l.exec(E)){if(G0&&A[A.length-1].name===I){u(I)}if(!v||(m=e.getElementRule(I))){k=true;if(v){P=m.attributes;F=m.attributePatterns}if(R=g[8]){z=R.indexOf("data-mce-type")!==-1;if(z&&s){k=false}N=[];N.map={};R.replace(D,p)}else{N=[];N.map={}}if(v&&!z){S=m.attributesRequired;L=m.attributesDefault;f=m.attributesForced;if(f){Q=f.length;while(Q--){t=f[Q];r=t.name;h=t.value;if(h==="{$uid}"){h="mce_"+x++}N.map[r]=h;N.push({name:r,value:h})}}if(L){Q=L.length;while(Q--){t=L[Q];r=t.name;if(!(r in N.map)){h=t.value;if(h==="{$uid}"){h="mce_"+x++}N.map[r]=h;N.push({name:r,value:h})}}}if(S){Q=S.length;while(Q--){if(S[Q] in N.map){break}}if(Q===-1){k=false}}if(N.map["data-mce-bogus"]){k=false}}if(k){n.start(I,N,O)}}else{k=false}if(B=K[I]){B.lastIndex=G=g.index+g[0].length;if(g=B.exec(E)){if(k){C=E.substr(G,g.index-G)}G=g.index+g[0].length}else{C=E.substr(G);G=E.length}if(k&&C.length>0){n.text(C,true)}if(k){n.end(I)}l.lastIndex=G;continue}if(!O){if(!R||R.indexOf("/")!=R.length-1){A.push({name:I,valid:k})}else{if(k){n.end(I)}}}}else{if(I=g[1]){n.comment(I)}else{if(I=g[2]){n.cdata(I)}else{if(I=g[3]){n.doctype(I)}else{if(I=g[4]){n.pi(I,g[5])}}}}}}G=g.index+g[0].length}if(G=0;Q--){I=A[Q];if(I.valid){n.end(I.name)}}}}})(tinymce);(function(d){var c=/^[ \t\r\n]*$/,e={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11};function a(k,l,j){var i,h,f=j?"lastChild":"firstChild",g=j?"prev":"next";if(k[f]){return k[f]}if(k!==l){i=k[g];if(i){return i}for(h=k.parent;h&&h!==l;h=h.parent){i=h[g];if(i){return i}}}}function b(f,g){this.name=f;this.type=g;if(g===1){this.attributes=[];this.attributes.map={}}}d.extend(b.prototype,{replace:function(g){var f=this;if(g.parent){g.remove()}f.insert(g,f);f.remove();return f},attr:function(h,l){var f=this,g,j,k;if(typeof h!=="string"){for(j in h){f.attr(j,h[j])}return f}if(g=f.attributes){if(l!==k){if(l===null){if(h in g.map){delete g.map[h];j=g.length;while(j--){if(g[j].name===h){g=g.splice(j,1);return f}}}return f}if(h in g.map){j=g.length;while(j--){if(g[j].name===h){g[j].value=l;break}}}else{g.push({name:h,value:l})}g.map[h]=l;return f}else{return g.map[h]}}},clone:function(){var g=this,n=new b(g.name,g.type),h,f,m,j,k;if(m=g.attributes){k=[];k.map={};for(h=0,f=m.length;h1){v.reverse();z=n=f.filterNode(v[0].clone());for(t=0;t0){P.value=l;P=P.prev}else{N=P.prev;P.remove();P=N}}}n=new b.html.SaxParser({validate:z,fix_self_closing:!z,cdata:function(l){B.append(J("#cdata",4)).value=l},text:function(O,l){var N;if(!K){O=O.replace(k," ");if(B.lastChild&&o[B.lastChild.name]){O=O.replace(E,"")}}if(O.length!==0){N=J("#text",3);N.raw=!!l;B.append(N).value=O}},comment:function(l){B.append(J("#comment",8)).value=l},pi:function(l,N){B.append(J(l,7)).value=N;H(B)},doctype:function(N){var l;l=B.append(J("#doctype",10));l.value=N;H(B)},start:function(l,V,O){var T,Q,P,N,R,W,U,S;P=z?h.getElementRule(l):{};if(P){T=J(P.outputName||l,1);T.attributes=V;T.shortEnded=O;B.append(T);S=p[B.name];if(S&&p[T.name]&&!S[T.name]){L.push(T)}Q=d.length;while(Q--){R=d[Q].name;if(R in V.map){F=c[R];if(F){F.push(T)}else{c[R]=[T]}}}if(o[l]){H(T)}if(!O){B=T}if(!K&&s[l]){K=true}}},end:function(l){var R,O,Q,N,P;O=z?h.getElementRule(l):{};if(O){if(o[l]){if(!K){R=B.firstChild;if(R&&R.type===3){Q=R.value.replace(E,"");if(Q.length>0){R.value=Q;R=R.next}else{N=R.next;R.remove();R=N}while(R&&R.type===3){Q=R.value;N=R.next;if(Q.length===0||y.test(Q)){R.remove();R=N}R=N}}R=B.lastChild;if(R&&R.type===3){Q=R.value.replace(t,"");if(Q.length>0){R.value=Q;R=R.prev}else{N=R.prev;R.remove();R=N}while(R&&R.type===3){Q=R.value;N=R.prev;if(Q.length===0||y.test(Q)){R.remove();R=N}R=N}}}R=B.prev;if(R&&R.type===3){Q=R.value.replace(E,"");if(Q.length>0){R.value=Q}else{R.remove()}}}if(K&&s[l]){K=false}if(O.removeEmpty||O.paddEmpty){if(B.isEmpty(u)){if(O.paddEmpty){B.empty().append(new a("#text","3")).value="\u00a0"}else{if(!B.attributes.map.name){P=B.parent;B.empty().remove();B=P;return}}}}B=B.parent}}},h);I=B=new a(m.context||g.root_name,11);n.parse(v);if(z&&L.length){if(!m.context){j(L)}else{m.invalid=true}}if(q&&I.name=="body"){G()}if(!m.invalid){for(M in i){F=e[M];A=i[M];x=A.length;while(x--){if(!A[x].parent){A.splice(x,1)}}for(D=0,C=F.length;D0){o=c[c.length-1];if(o.length>0&&o!=="\n"){c.push("\n")}}c.push("<",m);if(k){for(n=0,j=k.length;n0){o=c[c.length-1];if(o.length>0&&o!=="\n"){c.push("\n")}}},end:function(h){var i;c.push("");if(a&&d[h]&&c.length>0){i=c[c.length-1];if(i.length>0&&i!=="\n"){c.push("\n")}}},text:function(i,h){if(i.length>0){c[c.length]=h?i:f(i)}},cdata:function(h){c.push("")},comment:function(h){c.push("")},pi:function(h,i){if(i){c.push("")}else{c.push("")}if(a){c.push("\n")}},doctype:function(h){c.push("",a?"\n":"")},reset:function(){c.length=0},getContent:function(){return c.join("").replace(/\n$/,"")}}};(function(a){a.html.Serializer=function(c,d){var b=this,e=new a.html.Writer(c);c=c||{};c.validate="validate" in c?c.validate:true;b.schema=d=d||new a.html.Schema();b.writer=e;b.serialize=function(h){var g,i;i=c.validate;g={3:function(k,j){e.text(k.value,k.raw)},8:function(j){e.comment(j.value)},7:function(j){e.pi(j.name,j.value)},10:function(j){e.doctype(j.value)},4:function(j){e.cdata(j.value)},11:function(j){if((j=j.firstChild)){do{f(j)}while(j=j.next)}}};e.reset();function f(k){var t=g[k.type],j,o,s,r,p,u,n,m,q;if(!t){j=k.name;o=k.shortEnded;s=k.attributes;if(i&&s&&s.length>1){u=[];u.map={};q=d.getElementRule(k.name);for(n=0,m=q.attributesOrder.length;n=8;k.boxModel=!e.isIE||o.compatMode=="CSS1Compat"||k.stdMode;k.hasOuterHTML="outerHTML" in o.createElement("a");k.settings=l=e.extend({keep_values:false,hex_colors:1},l);k.schema=l.schema;k.styles=new e.html.Styles({url_converter:l.url_converter,url_converter_scope:l.url_converter_scope},l.schema);if(e.isIE6){try{o.execCommand("BackgroundImageCache",false,true)}catch(m){k.cssFlicker=true}}k.fixDoc(o);k.events=l.ownEvents?new e.dom.EventUtils(l.proxy):e.dom.Event;e.addUnload(k.destroy,k);n=l.schema?l.schema.getBlockElements():{};k.isBlock=function(q){var p=q.nodeType;if(p){return !!(p===1&&n[q.nodeName])}return !!n[q]}},fixDoc:function(k){var j=this.settings,i;if(b&&j.schema){("abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video").replace(/\w+/g,function(l){k.createElement(l)});for(i in j.schema.getCustomElements()){k.createElement(i)}}},clone:function(k,i){var j=this,m,l;if(!b||k.nodeType!==1||i){return k.cloneNode(i)}l=j.doc;if(!i){m=l.createElement(k.nodeName);g(j.getAttribs(k),function(n){j.setAttrib(m,n.nodeName,j.getAttrib(k,n.nodeName))});return m}return m.firstChild},getRoot:function(){var i=this,j=i.settings;return(j&&i.get(j.root_element))||i.doc.body},getViewPort:function(j){var k,i;j=!j?this.win:j;k=j.document;i=this.boxModel?k.documentElement:k.body;return{x:j.pageXOffset||i.scrollLeft,y:j.pageYOffset||i.scrollTop,w:j.innerWidth||i.clientWidth,h:j.innerHeight||i.clientHeight}},getRect:function(l){var k,i=this,j;l=i.get(l);k=i.getPos(l);j=i.getSize(l);return{x:k.x,y:k.y,w:j.w,h:j.h}},getSize:function(l){var j=this,i,k;l=j.get(l);i=j.getStyle(l,"width");k=j.getStyle(l,"height");if(i.indexOf("px")===-1){i=0}if(k.indexOf("px")===-1){k=0}return{w:parseInt(i,10)||l.offsetWidth||l.clientWidth,h:parseInt(k,10)||l.offsetHeight||l.clientHeight}},getParent:function(k,j,i){return this.getParents(k,j,i,false)},getParents:function(s,m,k,q){var j=this,i,l=j.settings,p=[];s=j.get(s);q=q===undefined;if(l.strict_root){k=k||j.getRoot()}if(d(m,"string")){i=m;if(m==="*"){m=function(o){return o.nodeType==1}}else{m=function(o){return j.is(o,i)}}}while(s){if(s==k||!s.nodeType||s.nodeType===9){break}if(!m||m(s)){if(q){p.push(s)}else{return s}}s=s.parentNode}return q?p:null},get:function(i){var j;if(i&&this.doc&&typeof(i)=="string"){j=i;i=this.doc.getElementById(i);if(i&&i.id!==j){return this.doc.getElementsByName(j)[1]}}return i},getNext:function(j,i){return this._findSib(j,i,"nextSibling")},getPrev:function(j,i){return this._findSib(j,i,"previousSibling")},select:function(k,j){var i=this;return e.dom.Sizzle(k,i.get(j)||i.get(i.settings.root_element)||i.doc,[])},is:function(l,j){var k;if(l.length===undefined){if(j==="*"){return l.nodeType==1}if(c.test(j)){j=j.toLowerCase().split(/,/);l=l.nodeName.toLowerCase();for(k=j.length-1;k>=0;k--){if(j[k]==l){return true}}return false}}return e.dom.Sizzle.matches(j,l.nodeType?[l]:l).length>0},add:function(l,o,i,k,m){var j=this;return this.run(l,function(r){var q,n;q=d(o,"string")?j.doc.createElement(o):o;j.setAttribs(q,i);if(k){if(k.nodeType){q.appendChild(k)}else{j.setHTML(q,k)}}return !m?r.appendChild(q):q})},create:function(k,i,j){return this.add(this.doc.createElement(k),k,i,j,1)},createHTML:function(q,i,m){var p="",l=this,j;p+="<"+q;for(j in i){if(i.hasOwnProperty(j)){p+=" "+j+'="'+l.encode(i[j])+'"'}}if(typeof(m)!="undefined"){return p+">"+m+""}return p+" />"},remove:function(i,j){return this.run(i,function(l){var m,k=l.parentNode;if(!k){return null}if(j){while(m=l.firstChild){if(!e.isIE||m.nodeType!==3||m.nodeValue){k.insertBefore(m,l)}else{l.removeChild(m)}}}return k.removeChild(l)})},setStyle:function(l,i,j){var k=this;return k.run(l,function(o){var n,m;n=o.style;i=i.replace(/-(\D)/g,function(q,p){return p.toUpperCase()});if(k.pixelStyles.test(i)&&(e.is(j,"number")||/^[\-0-9\.]+$/.test(j))){j+="px"}switch(i){case"opacity":if(b){n.filter=j===""?"":"alpha(opacity="+(j*100)+")";if(!l.currentStyle||!l.currentStyle.hasLayout){n.display="inline-block"}}n[i]=n["-moz-opacity"]=n["-khtml-opacity"]=j||"";break;case"float":b?n.styleFloat=j:n.cssFloat=j;break;default:n[i]=j||""}if(k.settings.update_styles){k.setAttrib(o,"data-mce-style")}})},getStyle:function(l,i,k){l=this.get(l);if(!l){return}if(this.doc.defaultView&&k){i=i.replace(/[A-Z]/g,function(m){return"-"+m});try{return this.doc.defaultView.getComputedStyle(l,null).getPropertyValue(i)}catch(j){return null}}i=i.replace(/-(\D)/g,function(n,m){return m.toUpperCase()});if(i=="float"){i=b?"styleFloat":"cssFloat"}if(l.currentStyle&&k){return l.currentStyle[i]}return l.style?l.style[i]:undefined},setStyles:function(l,m){var j=this,k=j.settings,i;i=k.update_styles;k.update_styles=0;g(m,function(o,p){j.setStyle(l,p,o)});k.update_styles=i;if(k.update_styles){j.setAttrib(l,k.cssText)}},removeAllAttribs:function(i){return this.run(i,function(l){var k,j=l.attributes;for(k=j.length-1;k>=0;k--){l.removeAttributeNode(j.item(k))}})},setAttrib:function(k,l,i){var j=this;if(!k||!l){return}if(j.settings.strict){l=l.toLowerCase()}return this.run(k,function(p){var o=j.settings;var m=p.getAttribute(l);if(i!==null){switch(l){case"style":if(!d(i,"string")){g(i,function(q,r){j.setStyle(p,r,q)});return}if(o.keep_values){if(i&&!j._isRes(i)){p.setAttribute("data-mce-style",i,2)}else{p.removeAttribute("data-mce-style",2)}}p.style.cssText=i;break;case"class":p.className=i||"";break;case"src":case"href":if(o.keep_values){if(o.url_converter){i=o.url_converter.call(o.url_converter_scope||j,i,l,p)}j.setAttrib(p,"data-mce-"+l,i,2)}break;case"shape":p.setAttribute("data-mce-style",i);break}}if(d(i)&&i!==null&&i.length!==0){p.setAttribute(l,""+i,2)}else{p.removeAttribute(l,2)}if(tinyMCE.activeEditor&&m!=i){var n=tinyMCE.activeEditor;n.onSetAttrib.dispatch(n,p,l,i)}})},setAttribs:function(j,k){var i=this;return this.run(j,function(l){g(k,function(m,o){i.setAttrib(l,o,m)})})},getAttrib:function(m,o,k){var i,j=this,l;m=j.get(m);if(!m||m.nodeType!==1){return k===l?false:k}if(!d(k)){k=""}if(/^(src|href|style|coords|shape)$/.test(o)){i=m.getAttribute("data-mce-"+o);if(i){return i}}if(b&&j.props[o]){i=m[j.props[o]];i=i&&i.nodeValue?i.nodeValue:i}if(!i){i=m.getAttribute(o,2)}if(/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(o)){if(m[j.props[o]]===true&&i===""){return o}return i?o:""}if(m.nodeName==="FORM"&&m.getAttributeNode(o)){return m.getAttributeNode(o).nodeValue}if(o==="style"){i=i||m.style.cssText;if(i){i=j.serializeStyle(j.parseStyle(i),m.nodeName);if(j.settings.keep_values&&!j._isRes(i)){m.setAttribute("data-mce-style",i)}}}if(f&&o==="class"&&i){i=i.replace(/(apple|webkit)\-[a-z\-]+/gi,"")}if(b){switch(o){case"rowspan":case"colspan":if(i===1){i=""}break;case"size":if(i==="+0"||i===20||i===0){i=""}break;case"width":case"height":case"vspace":case"checked":case"disabled":case"readonly":if(i===0){i=""}break;case"hspace":if(i===-1){i=""}break;case"maxlength":case"tabindex":if(i===32768||i===2147483647||i==="32768"){i=""}break;case"multiple":case"compact":case"noshade":case"nowrap":if(i===65535){return o}return k;case"shape":i=i.toLowerCase();break;default:if(o.indexOf("on")===0&&i){i=e._replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/,"$1",""+i)}}}return(i!==l&&i!==null&&i!=="")?""+i:k},getPos:function(q,l){var j=this,i=0,p=0,m,o=j.doc,k;q=j.get(q);l=l||o.body;if(q){if(q.getBoundingClientRect){q=q.getBoundingClientRect();m=j.boxModel?o.documentElement:o.body;i=q.left+(o.documentElement.scrollLeft||o.body.scrollLeft)-m.clientTop;p=q.top+(o.documentElement.scrollTop||o.body.scrollTop)-m.clientLeft;return{x:i,y:p}}k=q;while(k&&k!=l&&k.nodeType){i+=k.offsetLeft||0;p+=k.offsetTop||0;k=k.offsetParent}k=q.parentNode;while(k&&k!=l&&k.nodeType){i-=k.scrollLeft||0;p-=k.scrollTop||0;k=k.parentNode}}return{x:i,y:p}},parseStyle:function(i){return this.styles.parse(i)},serializeStyle:function(j,i){return this.styles.serialize(j,i)},loadCSS:function(i){var k=this,l=k.doc,j;if(!i){i=""}j=l.getElementsByTagName("head")[0];g(i.split(","),function(m){var n;if(k.files[m]){return}k.files[m]=true;n=k.create("link",{rel:"stylesheet",href:e._addVer(m)});if(b&&l.documentMode&&l.recalc){n.onload=function(){if(l.recalc){l.recalc()}n.onload=null}}j.appendChild(n)})},addClass:function(i,j){return this.run(i,function(k){var l;if(!j){return 0}if(this.hasClass(k,j)){return k.className}l=this.removeClass(k,j);return k.className=(l!=""?(l+" "):"")+j})},removeClass:function(k,l){var i=this,j;return i.run(k,function(n){var m;if(i.hasClass(n,l)){if(!j){j=new RegExp("(^|\\s+)"+l+"(\\s+|$)","g")}m=n.className.replace(j," ");m=e.trim(m!=" "?m:"");n.className=m;if(!m){n.removeAttribute("class");n.removeAttribute("className")}return m}return n.className})},hasClass:function(j,i){j=this.get(j);if(!j||!i){return false}return(" "+j.className+" ").indexOf(" "+i+" ")!==-1},show:function(i){return this.setStyle(i,"display","block")},hide:function(i){return this.setStyle(i,"display","none")},isHidden:function(i){i=this.get(i);return !i||i.style.display=="none"||this.getStyle(i,"display")=="none"},uniqueId:function(i){return(!i?"mce_":i)+(this.counter++)},setHTML:function(k,j){var i=this;return i.run(k,function(m){if(b){while(m.firstChild){m.removeChild(m.firstChild)}try{m.innerHTML="
                    "+j;m.removeChild(m.firstChild)}catch(l){m=i.create("div");m.innerHTML="
                    "+j;g(m.childNodes,function(o,n){if(n){m.appendChild(o)}})}}else{m.innerHTML=j}return j})},getOuterHTML:function(k){var j,i=this;k=i.get(k);if(!k){return null}if(k.nodeType===1&&i.hasOuterHTML){return k.outerHTML}j=(k.ownerDocument||i.doc).createElement("body");j.appendChild(k.cloneNode(true));return j.innerHTML},setOuterHTML:function(l,j,m){var i=this;function k(p,o,r){var s,q;q=r.createElement("body");q.innerHTML=o;s=q.lastChild;while(s){i.insertAfter(s.cloneNode(true),p);s=s.previousSibling}i.remove(p)}return this.run(l,function(o){o=i.get(o);if(o.nodeType==1){m=m||o.ownerDocument||i.doc;if(b){try{if(b&&o.nodeType==1){o.outerHTML=j}else{k(o,j,m)}}catch(n){k(o,j,m)}}else{k(o,j,m)}}})},decode:h.decode,encode:h.encodeAllRaw,insertAfter:function(i,j){j=this.get(j);return this.run(i,function(l){var k,m;k=j.parentNode;m=j.nextSibling;if(m){k.insertBefore(l,m)}else{k.appendChild(l)}return l})},replace:function(m,l,i){var j=this;if(d(l,"array")){m=m.cloneNode(true)}return j.run(l,function(k){if(i){g(e.grep(k.childNodes),function(n){m.appendChild(n)})}return k.parentNode.replaceChild(m,k)})},rename:function(l,i){var k=this,j;if(l.nodeName!=i.toUpperCase()){j=k.create(i);g(k.getAttribs(l),function(m){k.setAttrib(j,m.nodeName,k.getAttrib(l,m.nodeName))});k.replace(j,l,1)}return j||l},findCommonAncestor:function(k,i){var l=k,j;while(l){j=i;while(j&&l!=j){j=j.parentNode}if(l==j){break}l=l.parentNode}if(!l&&k.ownerDocument){return k.ownerDocument.documentElement}return l},toHex:function(i){var k=/^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(i);function j(l){l=parseInt(l,10).toString(16);return l.length>1?l:"0"+l}if(k){i="#"+j(k[1])+j(k[2])+j(k[3]);return i}return i},getClasses:function(){var n=this,j=[],m,o={},p=n.settings.class_filter,l;if(n.classes){return n.classes}function q(i){g(i.imports,function(s){q(s)});g(i.cssRules||i.rules,function(s){switch(s.type||1){case 1:if(s.selectorText){g(s.selectorText.split(","),function(r){r=r.replace(/^\s*|\s*$|^\s\./g,"");if(/\.mce/.test(r)||!/\.[\w\-]+$/.test(r)){return}l=r;r=e._replace(/.*\.([a-z0-9_\-]+).*/i,"$1",r);if(p&&!(r=p(r,l))){return}if(!o[r]){j.push({"class":r});o[r]=1}})}break;case 3:q(s.styleSheet);break}})}try{g(n.doc.styleSheets,q)}catch(k){}if(j.length>0){n.classes=j}return j},run:function(l,k,j){var i=this,m;if(i.doc&&typeof(l)==="string"){l=i.get(l)}if(!l){return false}j=j||this;if(!l.nodeType&&(l.length||l.length===0)){m=[];g(l,function(o,n){if(o){if(typeof(o)=="string"){o=i.doc.getElementById(o)}m.push(k.call(j,o,n))}});return m}return k.call(j,l)},getAttribs:function(j){var i;j=this.get(j);if(!j){return[]}if(b){i=[];if(j.nodeName=="OBJECT"){return j.attributes}if(j.nodeName==="OPTION"&&this.getAttrib(j,"selected")){i.push({specified:1,nodeName:"selected"})}j.cloneNode(false).outerHTML.replace(/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi,"").replace(/[\w:\-]+/gi,function(k){i.push({specified:1,nodeName:k})});return i}return j.attributes},isEmpty:function(m,k){var r=this,o,n,q,j,l,p=0;m=m.firstChild;if(m){j=new e.dom.TreeWalker(m,m.parentNode);k=k||r.schema?r.schema.getNonEmptyElements():null;do{q=m.nodeType;if(q===1){if(m.getAttribute("data-mce-bogus")){continue}l=m.nodeName.toLowerCase();if(k&&k[l]){if(l==="br"){p++;continue}return false}n=r.getAttribs(m);o=m.attributes.length;while(o--){l=m.attributes[o].nodeName;if(l==="name"||l==="data-mce-bookmark"){return false}}}if(q==8){return false}if((q===3&&!a.test(m.nodeValue))){return false}}while(m=j.next())}return p<=1},destroy:function(j){var i=this;i.win=i.doc=i.root=i.events=i.frag=null;if(!j){e.removeUnload(i.destroy)}},createRng:function(){var i=this.doc;return i.createRange?i.createRange():new e.dom.Range(this)},nodeIndex:function(m,n){var i=0,k,l,j;if(m){for(k=m.nodeType,m=m.previousSibling,l=m;m;m=m.previousSibling){j=m.nodeType;if(n&&j==3){if(j==k||!m.nodeValue.length){continue}}i++;k=j}}return i},split:function(m,l,p){var q=this,i=q.createRng(),n,k,o;function j(v){var t,s=v.childNodes,u=v.nodeType;function x(A){var z=A.previousSibling&&A.previousSibling.nodeName=="SPAN";var y=A.nextSibling&&A.nextSibling.nodeName=="SPAN";return z&&y}if(u==1&&v.getAttribute("data-mce-type")=="bookmark"){return}for(t=s.length-1;t>=0;t--){j(s[t])}if(u!=9){if(u==3&&v.nodeValue.length>0){var r=e.trim(v.nodeValue).length;if(!q.isBlock(v.parentNode)||r>0||r===0&&x(v)){return}}else{if(u==1){s=v.childNodes;if(s.length==1&&s[0]&&s[0].nodeType==1&&s[0].getAttribute("data-mce-type")=="bookmark"){v.parentNode.insertBefore(s[0],v)}if(s.length||/^(br|hr|input|img)$/i.test(v.nodeName)){return}}}q.remove(v)}return v}if(m&&l){i.setStart(m.parentNode,q.nodeIndex(m));i.setEnd(l.parentNode,q.nodeIndex(l));n=i.extractContents();i=q.createRng();i.setStart(l.parentNode,q.nodeIndex(l)+1);i.setEnd(m.parentNode,q.nodeIndex(m)+1);k=i.extractContents();o=m.parentNode;o.insertBefore(j(n),m);if(p){o.replaceChild(p,l)}else{o.insertBefore(l,m)}o.insertBefore(j(k),m);q.remove(m);return p||l}},bind:function(l,i,k,j){return this.events.add(l,i,k,j||this)},unbind:function(k,i,j){return this.events.remove(k,i,j)},fire:function(k,j,i){return this.events.fire(k,j,i)},getContentEditable:function(j){var i;if(j.nodeType!=1){return null}i=j.getAttribute("data-mce-contenteditable");if(i&&i!=="inherit"){return i}return j.contentEditable!=="inherit"?j.contentEditable:null},_findSib:function(l,i,j){var k=this,m=i;if(l){if(d(m,"string")){m=function(n){return k.is(n,i)}}for(l=l[j];l;l=l[j]){if(m(l)){return l}}}return null},_isRes:function(i){return/^(top|left|bottom|right|width|height)/i.test(i)||/;\s*(top|left|bottom|right|width|height)/i.test(i)}});e.DOM=new e.dom.DOMUtils(document,{process_html:0})})(tinymce);(function(a){function b(c){var O=this,e=c.doc,T=0,F=1,j=2,E=true,S=false,V="startOffset",h="startContainer",Q="endContainer",A="endOffset",k=tinymce.extend,n=c.nodeIndex;k(O,{startContainer:e,startOffset:0,endContainer:e,endOffset:0,collapsed:E,commonAncestorContainer:e,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:q,setEnd:s,setStartBefore:g,setStartAfter:J,setEndBefore:K,setEndAfter:u,collapse:B,selectNode:y,selectNodeContents:G,compareBoundaryPoints:v,deleteContents:p,extractContents:I,cloneContents:d,insertNode:D,surroundContents:N,cloneRange:L});function x(){return e.createDocumentFragment()}function q(W,t){C(E,W,t)}function s(W,t){C(S,W,t)}function g(t){q(t.parentNode,n(t))}function J(t){q(t.parentNode,n(t)+1)}function K(t){s(t.parentNode,n(t))}function u(t){s(t.parentNode,n(t)+1)}function B(t){if(t){O[Q]=O[h];O[A]=O[V]}else{O[h]=O[Q];O[V]=O[A]}O.collapsed=E}function y(t){g(t);u(t)}function G(t){q(t,0);s(t,t.nodeType===1?t.childNodes.length:t.nodeValue.length)}function v(Z,t){var ac=O[h],X=O[V],ab=O[Q],W=O[A],aa=t.startContainer,ae=t.startOffset,Y=t.endContainer,ad=t.endOffset;if(Z===0){return H(ac,X,aa,ae)}if(Z===1){return H(ab,W,aa,ae)}if(Z===2){return H(ab,W,Y,ad)}if(Z===3){return H(ac,X,Y,ad)}}function p(){l(j)}function I(){return l(T)}function d(){return l(F)}function D(Z){var W=this[h],t=this[V],Y,X;if((W.nodeType===3||W.nodeType===4)&&W.nodeValue){if(!t){W.parentNode.insertBefore(Z,W)}else{if(t>=W.nodeValue.length){c.insertAfter(Z,W)}else{Y=W.splitText(t);W.parentNode.insertBefore(Z,Y)}}}else{if(W.childNodes.length>0){X=W.childNodes[t]}if(X){W.insertBefore(Z,X)}else{W.appendChild(Z)}}}function N(W){var t=O.extractContents();O.insertNode(W);W.appendChild(t);O.selectNode(W)}function L(){return k(new b(c),{startContainer:O[h],startOffset:O[V],endContainer:O[Q],endOffset:O[A],collapsed:O.collapsed,commonAncestorContainer:O.commonAncestorContainer})}function P(t,W){var X;if(t.nodeType==3){return t}if(W<0){return t}X=t.firstChild;while(X&&W>0){--W;X=X.nextSibling}if(X){return X}return t}function m(){return(O[h]==O[Q]&&O[V]==O[A])}function H(Y,aa,W,Z){var ab,X,t,ac,ae,ad;if(Y==W){if(aa==Z){return 0}if(aa0){O.collapse(W)}}else{O.collapse(W)}O.collapsed=m();O.commonAncestorContainer=c.findCommonAncestor(O[h],O[Q])}function l(ac){var ab,Y=0,ae=0,W,aa,X,Z,t,ad;if(O[h]==O[Q]){return f(ac)}for(ab=O[Q],W=ab.parentNode;W;ab=W,W=W.parentNode){if(W==O[h]){return r(ab,ac)}++Y}for(ab=O[h],W=ab.parentNode;W;ab=W,W=W.parentNode){if(W==O[Q]){return U(ab,ac)}++ae}aa=ae-Y;X=O[h];while(aa>0){X=X.parentNode;aa--}Z=O[Q];while(aa<0){Z=Z.parentNode;aa++}for(t=X.parentNode,ad=Z.parentNode;t!=ad;t=t.parentNode,ad=ad.parentNode){X=t;Z=ad}return o(X,Z,ac)}function f(ab){var ad,ae,t,X,Y,ac,Z,W,aa;if(ab!=j){ad=x()}if(O[V]==O[A]){return ad}if(O[h].nodeType==3){ae=O[h].nodeValue;t=ae.substring(O[V],O[A]);if(ab!=F){X=O[h];W=O[V];aa=O[A]-O[V];if(W===0&&aa>=X.nodeValue.length-1){X.parentNode.removeChild(X)}else{X.deleteData(W,aa)}O.collapse(E)}if(ab==j){return}if(t.length>0){ad.appendChild(e.createTextNode(t))}return ad}X=P(O[h],O[V]);Y=O[A]-O[V];while(X&&Y>0){ac=X.nextSibling;Z=z(X,ab);if(ad){ad.appendChild(Z)}--Y;X=ac}if(ab!=F){O.collapse(E)}return ad}function r(ac,Z){var ab,aa,W,t,Y,X;if(Z!=j){ab=x()}aa=i(ac,Z);if(ab){ab.appendChild(aa)}W=n(ac);t=W-O[V];if(t<=0){if(Z!=F){O.setEndBefore(ac);O.collapse(S)}return ab}aa=ac.previousSibling;while(t>0){Y=aa.previousSibling;X=z(aa,Z);if(ab){ab.insertBefore(X,ab.firstChild)}--t;aa=Y}if(Z!=F){O.setEndBefore(ac);O.collapse(S)}return ab}function U(aa,Z){var ac,W,ab,t,Y,X;if(Z!=j){ac=x()}ab=R(aa,Z);if(ac){ac.appendChild(ab)}W=n(aa);++W;t=O[A]-W;ab=aa.nextSibling;while(ab&&t>0){Y=ab.nextSibling;X=z(ab,Z);if(ac){ac.appendChild(X)}--t;ab=Y}if(Z!=F){O.setStartAfter(aa);O.collapse(E)}return ac}function o(aa,t,ad){var X,af,Z,ab,ac,W,ae,Y;if(ad!=j){af=x()}X=R(aa,ad);if(af){af.appendChild(X)}Z=aa.parentNode;ab=n(aa);ac=n(t);++ab;W=ac-ab;ae=aa.nextSibling;while(W>0){Y=ae.nextSibling;X=z(ae,ad);if(af){af.appendChild(X)}ae=Y;--W}X=i(t,ad);if(af){af.appendChild(X)}if(ad!=F){O.setStartAfter(aa);O.collapse(E)}return af}function i(ab,ac){var X=P(O[Q],O[A]-1),ad,aa,Z,t,W,Y=X!=O[Q];if(X==ab){return M(X,Y,S,ac)}ad=X.parentNode;aa=M(ad,S,S,ac);while(ad){while(X){Z=X.previousSibling;t=M(X,Y,S,ac);if(ac!=j){aa.insertBefore(t,aa.firstChild)}Y=E;X=Z}if(ad==ab){return aa}X=ad.previousSibling;ad=ad.parentNode;W=M(ad,S,S,ac);if(ac!=j){W.appendChild(aa)}aa=W}}function R(ab,ac){var Y=P(O[h],O[V]),Z=Y!=O[h],ad,aa,X,t,W;if(Y==ab){return M(Y,Z,E,ac)}ad=Y.parentNode;aa=M(ad,S,E,ac);while(ad){while(Y){X=Y.nextSibling;t=M(Y,Z,E,ac);if(ac!=j){aa.appendChild(t)}Z=E;Y=X}if(ad==ab){return aa}Y=ad.nextSibling;ad=ad.parentNode;W=M(ad,S,E,ac);if(ac!=j){W.appendChild(aa)}aa=W}}function M(t,Z,ac,ad){var Y,X,aa,W,ab;if(Z){return z(t,ad)}if(t.nodeType==3){Y=t.nodeValue;if(ac){W=O[V];X=Y.substring(W);aa=Y.substring(0,W)}else{W=O[A];X=Y.substring(0,W);aa=Y.substring(W)}if(ad!=F){t.nodeValue=aa}if(ad==j){return}ab=c.clone(t,S);ab.nodeValue=X;return ab}if(ad==j){return}return c.clone(t,S)}function z(W,t){if(t!=j){return t==F?c.clone(W,E):W}W.parentNode.removeChild(W)}}a.Range=b})(tinymce.dom);(function(){function a(d){var b=this,h=d.dom,c=true,f=false;function e(i,j){var k,t=0,q,n,m,l,o,r,p=-1,s;k=i.duplicate();k.collapse(j);s=k.parentElement();if(s.ownerDocument!==d.dom.doc){return}while(s.contentEditable==="false"){s=s.parentNode}if(!s.hasChildNodes()){return{node:s,inside:1}}m=s.children;q=m.length-1;while(t<=q){r=Math.floor((t+q)/2);l=m[r];k.moveToElementText(l);p=k.compareEndPoints(j?"StartToStart":"EndToEnd",i);if(p>0){q=r-1}else{if(p<0){t=r+1}else{return{node:l}}}}if(p<0){if(!l){k.moveToElementText(s);k.collapse(true);l=s;n=true}else{k.collapse(false)}o=0;while(k.compareEndPoints(j?"StartToStart":"StartToEnd",i)!==0){if(k.move("character",1)===0||s!=k.parentElement()){break}o++}}else{k.collapse(true);o=0;while(k.compareEndPoints(j?"StartToStart":"StartToEnd",i)!==0){if(k.move("character",-1)===0||s!=k.parentElement()){break}o++}}return{node:l,position:p,offset:o,inside:n}}function g(){var i=d.getRng(),r=h.createRng(),l,k,p,q,m,j;l=i.item?i.item(0):i.parentElement();if(l.ownerDocument!=h.doc){return r}k=d.isCollapsed();if(i.item){r.setStart(l.parentNode,h.nodeIndex(l));r.setEnd(r.startContainer,r.startOffset+1);return r}function o(A){var u=e(i,A),s,y,z=0,x,v,t;s=u.node;y=u.offset;if(u.inside&&!s.hasChildNodes()){r[A?"setStart":"setEnd"](s,0);return}if(y===v){r[A?"setStartBefore":"setEndAfter"](s);return}if(u.position<0){x=u.inside?s.firstChild:s.nextSibling;if(!x){r[A?"setStartAfter":"setEndAfter"](s);return}if(!y){if(x.nodeType==3){r[A?"setStart":"setEnd"](x,0)}else{r[A?"setStartBefore":"setEndBefore"](x)}return}while(x){t=x.nodeValue;z+=t.length;if(z>=y){s=x;z-=y;z=t.length-z;break}x=x.nextSibling}}else{x=s.previousSibling;if(!x){return r[A?"setStartBefore":"setEndBefore"](s)}if(!y){if(s.nodeType==3){r[A?"setStart":"setEnd"](x,s.nodeValue.length)}else{r[A?"setStartAfter":"setEndAfter"](x)}return}while(x){z+=x.nodeValue.length;if(z>=y){s=x;z-=y;break}x=x.previousSibling}}r[A?"setStart":"setEnd"](s,z)}try{o(true);if(!k){o()}}catch(n){if(n.number==-2147024809){m=b.getBookmark(2);p=i.duplicate();p.collapse(true);l=p.parentElement();if(!k){p=i.duplicate();p.collapse(false);q=p.parentElement();q.innerHTML=q.innerHTML}l.innerHTML=l.innerHTML;b.moveToBookmark(m);i=d.getRng();o(true);if(!k){o()}}else{throw n}}return r}this.getBookmark=function(m){var j=d.getRng(),o,i,l={};function n(u){var t,p,s,r,q=[];t=u.parentNode;p=h.getRoot().parentNode;while(t!=p&&t.nodeType!==9){s=t.children;r=s.length;while(r--){if(u===s[r]){q.push(r);break}}u=t;t=t.parentNode}return q}function k(q){var p;p=e(j,q);if(p){return{position:p.position,offset:p.offset,indexes:n(p.node),inside:p.inside}}}if(m===2){if(!j.item){l.start=k(true);if(!d.isCollapsed()){l.end=k()}}else{l.start={ctrl:true,indexes:n(j.item(0))}}}return l};this.moveToBookmark=function(k){var j,i=h.doc.body;function m(o){var r,q,n,p;r=h.getRoot();for(q=o.length-1;q>=0;q--){p=r.children;n=o[q];if(n<=p.length-1){r=p[n]}}return r}function l(r){var n=k[r?"start":"end"],q,p,o;if(n){q=n.position>0;p=i.createTextRange();p.moveToElementText(m(n.indexes));offset=n.offset;if(offset!==o){p.collapse(n.inside||q);p.moveStart("character",q?-offset:offset)}else{p.collapse(r)}j.setEndPoint(r?"StartToStart":"EndToStart",p);if(r){j.collapse(true)}}}if(k.start){if(k.start.ctrl){j=i.createControlRange();j.addElement(m(k.start.indexes));j.select()}else{j=i.createTextRange();l(true);l();j.select()}}};this.addRange=function(i){var n,l,k,p,s,q,r=d.dom.doc,m=r.body;function j(z){var u,y,t,x,v;t=h.create("a");u=z?k:s;y=z?p:q;x=n.duplicate();if(u==r||u==r.documentElement){u=m;y=0}if(u.nodeType==3){u.parentNode.insertBefore(t,u);x.moveToElementText(t);x.moveStart("character",y);h.remove(t);n.setEndPoint(z?"StartToStart":"EndToEnd",x)}else{v=u.childNodes;if(v.length){if(y>=v.length){h.insertAfter(t,v[v.length-1])}else{u.insertBefore(t,v[y])}x.moveToElementText(t)}else{if(u.canHaveHTML){u.innerHTML="\uFEFF";t=u.firstChild;x.moveToElementText(t);x.collapse(f)}}n.setEndPoint(z?"StartToStart":"EndToEnd",x);h.remove(t)}}k=i.startContainer;p=i.startOffset;s=i.endContainer;q=i.endOffset;n=m.createTextRange();if(k==s&&k.nodeType==1){if(p==q&&!k.hasChildNodes()){if(k.canHaveHTML){k.innerHTML="\uFEFF\uFEFF";n.moveToElementText(k.lastChild);n.select();h.doc.selection.clear();k.innerHTML="";return}else{p=h.nodeIndex(k);k=k.parentNode}}if(p==q-1){try{l=m.createControlRange();l.addElement(k.childNodes[p]);l.select();return}catch(o){}}}j(true);j();n.select()};this.getRangeAt=g}tinymce.dom.TridentSelection=a})();(function(){var n=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,i="sizcache",o=0,r=Object.prototype.toString,h=false,g=true,q=/\\/g,u=/\r\n/g,x=/\W/;[0,0].sort(function(){g=false;return 0});var d=function(C,e,F,G){F=F||[];e=e||document;var I=e;if(e.nodeType!==1&&e.nodeType!==9){return[]}if(!C||typeof C!=="string"){return F}var z,K,N,y,J,M,L,E,B=true,A=d.isXML(e),D=[],H=C;do{n.exec("");z=n.exec(H);if(z){H=z[3];D.push(z[1]);if(z[2]){y=z[3];break}}}while(z);if(D.length>1&&j.exec(C)){if(D.length===2&&k.relative[D[0]]){K=s(D[0]+D[1],e,G)}else{K=k.relative[D[0]]?[e]:d(D.shift(),e);while(D.length){C=D.shift();if(k.relative[C]){C+=D.shift()}K=s(C,K,G)}}}else{if(!G&&D.length>1&&e.nodeType===9&&!A&&k.match.ID.test(D[0])&&!k.match.ID.test(D[D.length-1])){J=d.find(D.shift(),e,A);e=J.expr?d.filter(J.expr,J.set)[0]:J.set[0]}if(e){J=G?{expr:D.pop(),set:l(G)}:d.find(D.pop(),D.length===1&&(D[0]==="~"||D[0]==="+")&&e.parentNode?e.parentNode:e,A);K=J.expr?d.filter(J.expr,J.set):J.set;if(D.length>0){N=l(K)}else{B=false}while(D.length){M=D.pop();L=M;if(!k.relative[M]){M=""}else{L=D.pop()}if(L==null){L=e}k.relative[M](N,L,A)}}else{N=D=[]}}if(!N){N=K}if(!N){d.error(M||C)}if(r.call(N)==="[object Array]"){if(!B){F.push.apply(F,N)}else{if(e&&e.nodeType===1){for(E=0;N[E]!=null;E++){if(N[E]&&(N[E]===true||N[E].nodeType===1&&d.contains(e,N[E]))){F.push(K[E])}}}else{for(E=0;N[E]!=null;E++){if(N[E]&&N[E].nodeType===1){F.push(K[E])}}}}}else{l(N,F)}if(y){d(y,I,F,G);d.uniqueSort(F)}return F};d.uniqueSort=function(y){if(p){h=g;y.sort(p);if(h){for(var e=1;e0};d.find=function(E,e,F){var D,z,B,A,C,y;if(!E){return[]}for(z=0,B=k.order.length;z":function(D,y){var C,B=typeof y==="string",z=0,e=D.length;if(B&&!x.test(y)){y=y.toLowerCase();for(;z=0)){if(!z){e.push(C)}}else{if(z){y[B]=false}}}}return false},ID:function(e){return e[1].replace(q,"")},TAG:function(y,e){return y[1].replace(q,"").toLowerCase()},CHILD:function(e){if(e[1]==="nth"){if(!e[2]){d.error(e[0])}e[2]=e[2].replace(/^\+|\s*/g,"");var y=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(e[2]==="even"&&"2n"||e[2]==="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(y[1]+(y[2]||1))-0;e[3]=y[3]-0}else{if(e[2]){d.error(e[0])}}e[0]=o++;return e},ATTR:function(B,y,z,e,C,D){var A=B[1]=B[1].replace(q,"");if(!D&&k.attrMap[A]){B[1]=k.attrMap[A]}B[4]=(B[4]||B[5]||"").replace(q,"");if(B[2]==="~="){B[4]=" "+B[4]+" "}return B},PSEUDO:function(B,y,z,e,C){if(B[1]==="not"){if((n.exec(B[3])||"").length>1||/^\w/.test(B[3])){B[3]=d(B[3],null,null,y)}else{var A=d.filter(B[3],y,z,true^C);if(!z){e.push.apply(e,A)}return false}}else{if(k.match.POS.test(B[0])||k.match.CHILD.test(B[0])){return true}}return B},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){if(e.parentNode){e.parentNode.selectedIndex}return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(z,y,e){return !!d(e[3],z).length},header:function(e){return(/h\d/i).test(e.nodeName)},text:function(z){var e=z.getAttribute("type"),y=z.type;return z.nodeName.toLowerCase()==="input"&&"text"===y&&(e===y||e===null)},radio:function(e){return e.nodeName.toLowerCase()==="input"&&"radio"===e.type},checkbox:function(e){return e.nodeName.toLowerCase()==="input"&&"checkbox"===e.type},file:function(e){return e.nodeName.toLowerCase()==="input"&&"file"===e.type},password:function(e){return e.nodeName.toLowerCase()==="input"&&"password"===e.type},submit:function(y){var e=y.nodeName.toLowerCase();return(e==="input"||e==="button")&&"submit"===y.type},image:function(e){return e.nodeName.toLowerCase()==="input"&&"image"===e.type},reset:function(y){var e=y.nodeName.toLowerCase();return(e==="input"||e==="button")&&"reset"===y.type},button:function(y){var e=y.nodeName.toLowerCase();return e==="input"&&"button"===y.type||e==="button"},input:function(e){return(/input|select|textarea|button/i).test(e.nodeName)},focus:function(e){return e===e.ownerDocument.activeElement}},setFilters:{first:function(y,e){return e===0},last:function(z,y,e,A){return y===A.length-1},even:function(y,e){return e%2===0},odd:function(y,e){return e%2===1},lt:function(z,y,e){return ye[3]-0},nth:function(z,y,e){return e[3]-0===y},eq:function(z,y,e){return e[3]-0===y}},filter:{PSEUDO:function(z,E,D,F){var e=E[1],y=k.filters[e];if(y){return y(z,D,E,F)}else{if(e==="contains"){return(z.textContent||z.innerText||b([z])||"").indexOf(E[3])>=0}else{if(e==="not"){var A=E[3];for(var C=0,B=A.length;C=0)}}},ID:function(y,e){return y.nodeType===1&&y.getAttribute("id")===e},TAG:function(y,e){return(e==="*"&&y.nodeType===1)||!!y.nodeName&&y.nodeName.toLowerCase()===e},CLASS:function(y,e){return(" "+(y.className||y.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(C,A){var z=A[1],e=d.attr?d.attr(C,z):k.attrHandle[z]?k.attrHandle[z](C):C[z]!=null?C[z]:C.getAttribute(z),D=e+"",B=A[2],y=A[4];return e==null?B==="!=":!B&&d.attr?e!=null:B==="="?D===y:B==="*="?D.indexOf(y)>=0:B==="~="?(" "+D+" ").indexOf(y)>=0:!y?D&&e!==false:B==="!="?D!==y:B==="^="?D.indexOf(y)===0:B==="$="?D.substr(D.length-y.length)===y:B==="|="?D===y||D.substr(0,y.length+1)===y+"-":false},POS:function(B,y,z,C){var e=y[2],A=k.setFilters[e];if(A){return A(B,z,y,C)}}}};var j=k.match.POS,c=function(y,e){return"\\"+(e-0+1)};for(var f in k.match){k.match[f]=new RegExp(k.match[f].source+(/(?![^\[]*\])(?![^\(]*\))/.source));k.leftMatch[f]=new RegExp(/(^(?:.|\r|\n)*?)/.source+k.match[f].source.replace(/\\(\d+)/g,c))}k.match.globalPOS=j;var l=function(y,e){y=Array.prototype.slice.call(y,0);if(e){e.push.apply(e,y);return e}return y};try{Array.prototype.slice.call(document.documentElement.childNodes,0)[0].nodeType}catch(v){l=function(B,A){var z=0,y=A||[];if(r.call(B)==="[object Array]"){Array.prototype.push.apply(y,B)}else{if(typeof B.length==="number"){for(var e=B.length;z";e.insertBefore(y,e.firstChild);if(document.getElementById(z)){k.find.ID=function(B,C,D){if(typeof C.getElementById!=="undefined"&&!D){var A=C.getElementById(B[1]);return A?A.id===B[1]||typeof A.getAttributeNode!=="undefined"&&A.getAttributeNode("id").nodeValue===B[1]?[A]:undefined:[]}};k.filter.ID=function(C,A){var B=typeof C.getAttributeNode!=="undefined"&&C.getAttributeNode("id");return C.nodeType===1&&B&&B.nodeValue===A}}e.removeChild(y);e=y=null})();(function(){var e=document.createElement("div");e.appendChild(document.createComment(""));if(e.getElementsByTagName("*").length>0){k.find.TAG=function(y,C){var B=C.getElementsByTagName(y[1]);if(y[1]==="*"){var A=[];for(var z=0;B[z];z++){if(B[z].nodeType===1){A.push(B[z])}}B=A}return B}}e.innerHTML="";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){k.attrHandle.href=function(y){return y.getAttribute("href",2)}}e=null})();if(document.querySelectorAll){(function(){var e=d,A=document.createElement("div"),z="__sizzle__";A.innerHTML="

                    ";if(A.querySelectorAll&&A.querySelectorAll(".TEST").length===0){return}d=function(L,C,G,K){C=C||document;if(!K&&!d.isXML(C)){var J=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(L);if(J&&(C.nodeType===1||C.nodeType===9)){if(J[1]){return l(C.getElementsByTagName(L),G)}else{if(J[2]&&k.find.CLASS&&C.getElementsByClassName){return l(C.getElementsByClassName(J[2]),G)}}}if(C.nodeType===9){if(L==="body"&&C.body){return l([C.body],G)}else{if(J&&J[3]){var F=C.getElementById(J[3]);if(F&&F.parentNode){if(F.id===J[3]){return l([F],G)}}else{return l([],G)}}}try{return l(C.querySelectorAll(L),G)}catch(H){}}else{if(C.nodeType===1&&C.nodeName.toLowerCase()!=="object"){var D=C,E=C.getAttribute("id"),B=E||z,N=C.parentNode,M=/^\s*[+~]/.test(L);if(!E){C.setAttribute("id",B)}else{B=B.replace(/'/g,"\\$&")}if(M&&N){C=C.parentNode}try{if(!M||N){return l(C.querySelectorAll("[id='"+B+"'] "+L),G)}}catch(I){}finally{if(!E){D.removeAttribute("id")}}}}}return e(L,C,G,K)};for(var y in e){d[y]=e[y]}A=null})()}(function(){var e=document.documentElement,z=e.matchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.msMatchesSelector;if(z){var B=!z.call(document.createElement("div"),"div"),y=false;try{z.call(document.documentElement,"[test!='']:sizzle")}catch(A){y=true}d.matchesSelector=function(D,F){F=F.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!d.isXML(D)){try{if(y||!k.match.PSEUDO.test(F)&&!/!=/.test(F)){var C=z.call(D,F);if(C||!B||D.document&&D.document.nodeType!==11){return C}}}catch(E){}}return d(F,null,null,[D]).length>0}}})();(function(){var e=document.createElement("div");e.innerHTML="
                    ";if(!e.getElementsByClassName||e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}k.order.splice(1,0,"CLASS");k.find.CLASS=function(y,z,A){if(typeof z.getElementsByClassName!=="undefined"&&!A){return z.getElementsByClassName(y[1])}};e=null})();function a(y,D,C,G,E,F){for(var A=0,z=G.length;A0){B=e;break}}}e=e[y]}G[A]=B}}}if(document.documentElement.contains){d.contains=function(y,e){return y!==e&&(y.contains?y.contains(e):true)}}else{if(document.documentElement.compareDocumentPosition){d.contains=function(y,e){return !!(y.compareDocumentPosition(e)&16)}}else{d.contains=function(){return false}}}d.isXML=function(e){var y=(e?e.ownerDocument||e:0).documentElement;return y?y.nodeName!=="HTML":false};var s=function(z,e,D){var C,E=[],B="",F=e.nodeType?[e]:e;while((C=k.match.PSEUDO.exec(z))){B+=C[0];z=z.replace(k.match.PSEUDO,"")}z=k.relative[z]?z+"*":z;for(var A=0,y=F.length;A"+(i.item?i.item(0).outerHTML:i.htmlText);m.removeChild(m.firstChild)}else{m.innerHTML=i.toString()}}if(/^\s/.test(m.innerHTML)){j=" "}if(/\s+$/.test(m.innerHTML)){l=" "}h.getInner=true;h.content=g.isCollapsed()?"":j+g.serializer.serialize(m,h)+l;g.onGetContent.dispatch(g,h);return h.content},setContent:function(h,j){var o=this,g=o.getRng(),k,l=o.win.document,n,m;j=j||{format:"html"};j.set=true;h=j.content=h;if(!j.no_events){o.onBeforeSetContent.dispatch(o,j)}h=j.content;if(g.insertNode){h+='_';if(g.startContainer==l&&g.endContainer==l){l.body.innerHTML=h}else{g.deleteContents();if(l.body.childNodes.length===0){l.body.innerHTML=h}else{if(g.createContextualFragment){g.insertNode(g.createContextualFragment(h))}else{n=l.createDocumentFragment();m=l.createElement("div");n.appendChild(m);m.outerHTML=h;g.insertNode(n)}}}k=o.dom.get("__caret");g=l.createRange();g.setStartBefore(k);g.setEndBefore(k);o.setRng(g);o.dom.remove("__caret");try{o.setRng(g)}catch(i){}}else{if(g.item){l.execCommand("Delete",false,null);g=o.getRng()}if(/^\s+/.test(h)){g.pasteHTML('_'+h);o.dom.remove("__mce_tmp")}else{g.pasteHTML(h)}}if(!j.no_events){o.onSetContent.dispatch(o,j)}},getStart:function(){var h=this.getRng(),i,g,k,j;if(h.duplicate||h.item){if(h.item){return h.item(0)}k=h.duplicate();k.collapse(1);i=k.parentElement();g=j=h.parentElement();while(j=j.parentNode){if(j==i){i=g;break}}return i}else{i=h.startContainer;if(i.nodeType==1&&i.hasChildNodes()){i=i.childNodes[Math.min(i.childNodes.length-1,h.startOffset)]}if(i&&i.nodeType==3){return i.parentNode}return i}},getEnd:function(){var h=this,i=h.getRng(),j,g;if(i.duplicate||i.item){if(i.item){return i.item(0)}i=i.duplicate();i.collapse(0);j=i.parentElement();if(j&&j.nodeName=="BODY"){return j.lastChild||j}return j}else{j=i.endContainer;g=i.endOffset;if(j.nodeType==1&&j.hasChildNodes()){j=j.childNodes[g>0?g-1:g]}if(j&&j.nodeType==3){return j.parentNode}return j}},getBookmark:function(s,v){var y=this,n=y.dom,h,k,j,o,i,p,q,m="\uFEFF",x;function g(z,A){var t=0;e(n.select(z),function(C,B){if(C==A){t=B}});return t}function u(t){function z(E){var A,D,C,B=E?"start":"end";A=t[B+"Container"];D=t[B+"Offset"];if(A.nodeType==1&&A.nodeName=="TR"){C=A.childNodes;A=C[Math.min(E?D:D-1,C.length-1)];if(A){D=E?0:A.childNodes.length;t["set"+(E?"Start":"End")](A,D)}}}z(true);z();return t}function l(){var z=y.getRng(true),t=n.getRoot(),A={};function B(E,J){var D=E[J?"startContainer":"endContainer"],I=E[J?"startOffset":"endOffset"],C=[],F,H,G=0;if(D.nodeType==3){if(v){for(F=D.previousSibling;F&&F.nodeType==3;F=F.previousSibling){I+=F.nodeValue.length}}C.push(I)}else{H=D.childNodes;if(I>=H.length&&H.length){G=1;I=Math.max(0,H.length-1)}C.push(y.dom.nodeIndex(H[I],v)+G)}for(;D&&D!=t;D=D.parentNode){C.push(y.dom.nodeIndex(D,v))}return C}A.start=B(z,true);if(!y.isCollapsed()){A.end=B(z)}return A}if(s==2){if(y.tridentSel){return y.tridentSel.getBookmark(s)}return l()}if(s){return{rng:y.getRng()}}h=y.getRng();j=n.uniqueId();o=tinyMCE.activeEditor.selection.isCollapsed();x="overflow:hidden;line-height:0px";if(h.duplicate||h.item){if(!h.item){k=h.duplicate();try{h.collapse();h.pasteHTML(''+m+"");if(!o){k.collapse(false);h.moveToElementText(k.parentElement());if(h.compareEndPoints("StartToEnd",k)===0){k.move("character",-1)}k.pasteHTML(''+m+"")}}catch(r){return null}}else{p=h.item(0);i=p.nodeName;return{name:i,index:g(i,p)}}}else{p=y.getNode();i=p.nodeName;if(i=="IMG"){return{name:i,index:g(i,p)}}k=u(h.cloneRange());if(!o){k.collapse(false);k.insertNode(n.create("span",{"data-mce-type":"bookmark",id:j+"_end",style:x},m))}h=u(h);h.collapse(true);h.insertNode(n.create("span",{"data-mce-type":"bookmark",id:j+"_start",style:x},m))}y.moveToBookmark({id:j,keep:1});return{id:j}},moveToBookmark:function(o){var s=this,m=s.dom,j,i,g,r,k,u,p,q;function h(A){var t=o[A?"start":"end"],x,y,z,v;if(t){z=t[0];for(y=r,x=t.length-1;x>=1;x--){v=y.childNodes;if(t[x]>v.length-1){return}y=v[t[x]]}if(y.nodeType===3){z=Math.min(t[0],y.nodeValue.length)}if(y.nodeType===1){z=Math.min(t[0],y.childNodes.length)}if(A){g.setStart(y,z)}else{g.setEnd(y,z)}}return true}function l(B){var v=m.get(o.id+"_"+B),A,t,y,z,x=o.keep;if(v){A=v.parentNode;if(B=="start"){if(!x){t=m.nodeIndex(v)}else{A=v.firstChild;t=1}k=u=A;p=q=t}else{if(!x){t=m.nodeIndex(v)}else{A=v.firstChild;t=1}u=A;q=t}if(!x){z=v.previousSibling;y=v.nextSibling;e(d.grep(v.childNodes),function(C){if(C.nodeType==3){C.nodeValue=C.nodeValue.replace(/\uFEFF/g,"")}});while(v=m.get(o.id+"_"+B)){m.remove(v,1)}if(z&&y&&z.nodeType==y.nodeType&&z.nodeType==3&&!d.isOpera){t=z.nodeValue.length;z.appendData(y.nodeValue);m.remove(y);if(B=="start"){k=u=z;p=q=t}else{u=z;q=t}}}}}function n(t){if(m.isBlock(t)&&!t.innerHTML&&!b){t.innerHTML='
                    '}return t}if(o){if(o.start){g=m.createRng();r=m.getRoot();if(s.tridentSel){return s.tridentSel.moveToBookmark(o)}if(h(true)&&h()){s.setRng(g)}}else{if(o.id){l("start");l("end");if(k){g=m.createRng();g.setStart(n(k),p);g.setEnd(n(u),q);s.setRng(g)}}else{if(o.name){s.select(m.select(o.name)[o.index])}else{if(o.rng){s.setRng(o.rng)}}}}}},select:function(l,k){var j=this,m=j.dom,h=m.createRng(),g;function i(n,p){var o=new a(n,n);do{if(n.nodeType==3&&d.trim(n.nodeValue).length!==0){if(p){h.setStart(n,0)}else{h.setEnd(n,n.nodeValue.length)}return}if(n.nodeName=="BR"){if(p){h.setStartBefore(n)}else{h.setEndBefore(n)}return}}while(n=(p?o.next():o.prev()))}if(l){g=m.nodeIndex(l);h.setStart(l.parentNode,g);h.setEnd(l.parentNode,g+1);if(k){i(l,1);i(l)}j.setRng(h)}return l},isCollapsed:function(){var g=this,i=g.getRng(),h=g.getSel();if(!i||i.item){return false}if(i.compareEndPoints){return i.compareEndPoints("StartToEnd",i)===0}return !h||i.collapsed},collapse:function(g){var i=this,h=i.getRng(),j;if(h.item){j=h.item(0);h=i.win.document.body.createTextRange();h.moveToElementText(j)}h.collapse(!!g);i.setRng(h)},getSel:function(){var h=this,g=this.win;return g.getSelection?g.getSelection():g.document.selection},getRng:function(m){var h=this,j,g,l,k=h.win.document;if(m&&h.tridentSel){return h.tridentSel.getRangeAt(0)}try{if(j=h.getSel()){g=j.rangeCount>0?j.getRangeAt(0):(j.createRange?j.createRange():k.createRange())}}catch(i){}if(d.isIE&&g&&g.setStart&&k.selection.createRange().item){l=k.selection.createRange().item(0);g=k.createRange();g.setStartBefore(l);g.setEndAfter(l)}if(!g){g=k.createRange?k.createRange():k.body.createTextRange()}if(g.setStart&&g.startContainer.nodeType===9&&g.collapsed){l=h.dom.getRoot();g.setStart(l,0);g.setEnd(l,0)}if(h.selectedRange&&h.explicitRange){if(g.compareBoundaryPoints(g.START_TO_START,h.selectedRange)===0&&g.compareBoundaryPoints(g.END_TO_END,h.selectedRange)===0){g=h.explicitRange}else{h.selectedRange=null;h.explicitRange=null}}return g},setRng:function(k,g){var j,i=this;if(!i.tridentSel){j=i.getSel();if(j){i.explicitRange=k;try{j.removeAllRanges()}catch(h){}j.addRange(k);if(g===false&&j.extend){j.collapse(k.endContainer,k.endOffset);j.extend(k.startContainer,k.startOffset)}i.selectedRange=j.rangeCount>0?j.getRangeAt(0):null}}else{if(k.cloneRange){try{i.tridentSel.addRange(k);return}catch(h){}}try{k.select()}catch(h){}}},setNode:function(h){var g=this;g.setContent(g.dom.getOuterHTML(h));return h},getNode:function(){var i=this,h=i.getRng(),j=i.getSel(),m,l=h.startContainer,g=h.endContainer;function k(q,o){var p=q;while(q&&q.nodeType===3&&q.length===0){q=o?q.nextSibling:q.previousSibling}return q||p}if(!h){return i.dom.getRoot()}if(h.setStart){m=h.commonAncestorContainer;if(!h.collapsed){if(h.startContainer==h.endContainer){if(h.endOffset-h.startOffset<2){if(h.startContainer.hasChildNodes()){m=h.startContainer.childNodes[h.startOffset]}}}if(l.nodeType===3&&g.nodeType===3){if(l.length===h.startOffset){l=k(l.nextSibling,true)}else{l=l.parentNode}if(h.endOffset===0){g=k(g.previousSibling,false)}else{g=g.parentNode}if(l&&l===g){return l}}}if(m&&m.nodeType==3){return m.parentNode}return m}return h.item?h.item(0):h.parentElement()},getSelectedBlocks:function(p,h){var o=this,k=o.dom,m,l,i,j=[];m=k.getParent(p||o.getStart(),k.isBlock);l=k.getParent(h||o.getEnd(),k.isBlock);if(m){j.push(m)}if(m&&l&&m!=l){i=m;var g=new a(m,k.getRoot());while((i=g.next())&&i!=l){if(k.isBlock(i)){j.push(i)}}}if(l&&m!=l){j.push(l)}return j},isForward:function(){var i=this.dom,g=this.getSel(),j,h;if(!g||g.anchorNode==null||g.focusNode==null){return true}j=i.createRng();j.setStart(g.anchorNode,g.anchorOffset);j.collapse(true);h=i.createRng();h.setStart(g.focusNode,g.focusOffset);h.collapse(true);return j.compareBoundaryPoints(j.START_TO_START,h)<=0},normalize:function(){var h=this,g,m,l,j,i;function k(p){var o,r,n,s=h.dom,u=s.getRoot(),q,t,v;function y(z,A){var B=new a(z,s.getParent(z.parentNode,s.isBlock)||u);while(z=B[A?"prev":"next"]()){if(z.nodeName==="BR"){return true}}}function x(B,z){var C,A;z=z||o;C=new a(z,s.getParent(z.parentNode,s.isBlock)||u);while(q=C[B?"prev":"next"]()){if(q.nodeType===3&&q.nodeValue.length>0){o=q;r=B?q.nodeValue.length:0;m=true;return}if(s.isBlock(q)||t[q.nodeName.toLowerCase()]){return}A=q}if(l&&A){o=A;m=true;r=0}}o=g[(p?"start":"end")+"Container"];r=g[(p?"start":"end")+"Offset"];t=s.schema.getNonEmptyElements();if(o.nodeType===9){o=s.getRoot();r=0}if(o===u){if(p){q=o.childNodes[r>0?r-1:0];if(q){v=q.nodeName.toLowerCase();if(t[q.nodeName]||q.nodeName=="TABLE"){return}}}if(o.hasChildNodes()){o=o.childNodes[Math.min(!p&&r>0?r-1:r,o.childNodes.length-1)];r=0;if(o.hasChildNodes()&&!/TABLE/.test(o.nodeName)){q=o;n=new a(o,u);do{if(q.nodeType===3&&q.nodeValue.length>0){r=p?0:q.nodeValue.length;o=q;m=true;break}if(t[q.nodeName.toLowerCase()]){r=s.nodeIndex(q);o=q.parentNode;if(q.nodeName=="IMG"&&!p){r++}m=true;break}}while(q=(p?n.next():n.prev()))}}}if(l){if(o.nodeType===3&&r===0){x(true)}if(o.nodeType===1){q=o.childNodes[r];if(q&&q.nodeName==="BR"&&!y(q)&&!y(q,true)){x(true,o.childNodes[r])}}}if(p&&!l&&o.nodeType===3&&r===o.nodeValue.length){x(false)}if(m){g["set"+(p?"Start":"End")](o,r)}}if(d.isIE){return}g=h.getRng();l=g.collapsed;k(true);if(!l){k()}if(m){if(l){g.collapse(true)}h.setRng(g,h.isForward())}},destroy:function(h){var g=this;g.win=null;if(!h){d.removeUnload(g.destroy)}},_fixIESelection:function(){var h=this.dom,n=h.doc,i=n.body,k,o,g;function j(p,s){var q=i.createTextRange();try{q.moveToPoint(p,s)}catch(r){q=null}return q}function m(q){var p;if(q.button){p=j(q.x,q.y);if(p){if(p.compareEndPoints("StartToStart",o)>0){p.setEndPoint("StartToStart",o)}else{p.setEndPoint("EndToEnd",o)}p.select()}}else{l()}}function l(){var p=n.selection.createRange();if(o&&!p.item&&p.compareEndPoints("StartToEnd",p)===0){o.select()}h.unbind(n,"mouseup",l);h.unbind(n,"mousemove",m);o=k=0}n.documentElement.unselectable=true;h.bind(n,["mousedown","contextmenu"],function(p){if(p.target.nodeName==="HTML"){if(k){l()}g=n.documentElement;if(g.scrollHeight>g.clientHeight){return}k=1;o=j(p.x,p.y);if(o){h.bind(n,"mouseup",l);h.bind(n,"mousemove",m);h.win.focus();o.select()}}})}})})(tinymce);(function(a){a.dom.Serializer=function(e,i,f){var h,b,d=a.isIE,g=a.each,c;if(!e.apply_source_formatting){e.indent=false}i=i||a.DOM;f=f||new a.html.Schema(e);e.entity_encoding=e.entity_encoding||"named";e.remove_trailing_brs="remove_trailing_brs" in e?e.remove_trailing_brs:true;h=new a.util.Dispatcher(self);b=new a.util.Dispatcher(self);c=new a.html.DomParser(e,f);c.addAttributeFilter("src,href,style",function(k,j){var o=k.length,l,q,n="data-mce-"+j,p=e.url_converter,r=e.url_converter_scope,m;while(o--){l=k[o];q=l.attributes.map[n];if(q!==m){l.attr(j,q.length>0?q:null);l.attr(n,null)}else{q=l.attributes.map[j];if(j==="style"){q=i.serializeStyle(i.parseStyle(q),l.name)}else{if(p){q=p.call(r,q,j,l.name)}}l.attr(j,q.length>0?q:null)}}});c.addAttributeFilter("class",function(j,k){var l=j.length,m,n;while(l--){m=j[l];n=m.attr("class").replace(/(?:^|\s)mce(Item\w+|Selected)(?!\S)/g,"");m.attr("class",n.length>0?n:null)}});c.addAttributeFilter("data-mce-type",function(j,l,k){var m=j.length,n;while(m--){n=j[m];if(n.attributes.map["data-mce-type"]==="bookmark"&&!k.cleanup){n.remove()}}});c.addAttributeFilter("data-mce-expando",function(j,l,k){var m=j.length;while(m--){j[m].attr(l,null)}});c.addNodeFilter("script,style",function(k,l){var m=k.length,n,o;function j(p){return p.replace(/()/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*(()?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")}while(m--){n=k[m];o=n.firstChild?n.firstChild.value:"";if(l==="script"){n.attr("type",(n.attr("type")||"text/javascript").replace(/^mce\-/,""));if(o.length>0){n.firstChild.value="// "}}else{if(o.length>0){n.firstChild.value=""}}}});c.addNodeFilter("#comment",function(j,k){var l=j.length,m;while(l--){m=j[l];if(m.value.indexOf("[CDATA[")===0){m.name="#cdata";m.type=4;m.value=m.value.replace(/^\[CDATA\[|\]\]$/g,"")}else{if(m.value.indexOf("mce:protected ")===0){m.name="#text";m.type=3;m.raw=true;m.value=unescape(m.value).substr(14)}}}});c.addNodeFilter("xml:namespace,input",function(j,k){var l=j.length,m;while(l--){m=j[l];if(m.type===7){m.remove()}else{if(m.type===1){if(k==="input"&&!("type" in m.attributes.map)){m.attr("type","text")}}}}});if(e.fix_list_elements){c.addNodeFilter("ul,ol",function(k,l){var m=k.length,n,j;while(m--){n=k[m];j=n.parent;if(j.name==="ul"||j.name==="ol"){if(n.prev&&n.prev.name==="li"){n.prev.append(n)}}}})}c.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style",function(j,k){var l=j.length;while(l--){j[l].attr(k,null)}});return{schema:f,addNodeFilter:c.addNodeFilter,addAttributeFilter:c.addAttributeFilter,onPreProcess:h,onPostProcess:b,serialize:function(o,m){var l,p,k,j,n;if(d&&i.select("script,style,select,map").length>0){n=o.innerHTML;o=o.cloneNode(false);i.setHTML(o,n)}else{o=o.cloneNode(true)}l=o.ownerDocument.implementation;if(l.createHTMLDocument){p=l.createHTMLDocument("");g(o.nodeName=="BODY"?o.childNodes:[o],function(q){p.body.appendChild(p.importNode(q,true))});if(o.nodeName!="BODY"){o=p.body.firstChild}else{o=p.body}k=i.doc;i.doc=p}m=m||{};m.format=m.format||"html";if(!m.no_events){m.node=o;h.dispatch(self,m)}j=new a.html.Serializer(e,f);m.content=j.serialize(c.parse(a.trim(m.getInner?o.innerHTML:i.getOuterHTML(o)),m));if(!m.cleanup){m.content=m.content.replace(/\uFEFF|\u200B/g,"")}if(!m.no_events){b.dispatch(self,m)}if(k){i.doc=k}m.node=null;return m.content},addRules:function(j){f.addValidElements(j)},setRules:function(j){f.setValidElements(j)}}}})(tinymce);(function(a){a.dom.ScriptLoader=function(h){var c=0,k=1,i=2,l={},j=[],e={},d=[],g=0,f;function b(m,v){var x=this,q=a.DOM,s,o,r,n;function p(){q.remove(n);if(s){s.onreadystatechange=s.onload=s=null}v()}function u(){if(typeof(console)!=="undefined"&&console.log){console.log("Failed to load: "+m)}}n=q.uniqueId();if(a.isIE6){o=new a.util.URI(m);r=location;if(o.host==r.hostname&&o.port==r.port&&(o.protocol+":")==r.protocol&&o.protocol.toLowerCase()!="file"){a.util.XHR.send({url:a._addVer(o.getURI()),success:function(y){var t=q.create("script",{type:"text/javascript"});t.text=y;document.getElementsByTagName("head")[0].appendChild(t);q.remove(t);p()},error:u});return}}s=q.create("script",{id:n,type:"text/javascript",src:a._addVer(m)});if(!a.isIE){s.onload=p}s.onerror=u;if(!a.isOpera){s.onreadystatechange=function(){var t=s.readyState;if(t=="complete"||t=="loaded"){p()}}}(document.getElementsByTagName("head")[0]||document.body).appendChild(s)}this.isDone=function(m){return l[m]==i};this.markDone=function(m){l[m]=i};this.add=this.load=function(m,q,n){var o,p=l[m];if(p==f){j.push(m);l[m]=c}if(q){if(!e[m]){e[m]=[]}e[m].push({func:q,scope:n||this})}};this.loadQueue=function(n,m){this.loadScripts(j,n,m)};this.loadScripts=function(m,q,p){var o;function n(r){a.each(e[r],function(s){s.func.call(s.scope)});e[r]=f}d.push({func:q,scope:p||this});o=function(){var r=a.grep(m);m.length=0;a.each(r,function(s){if(l[s]==i){n(s);return}if(l[s]!=k){l[s]=k;g++;b(s,function(){l[s]=i;g--;n(s);o()})}});if(!g){a.each(d,function(s){s.func.call(s.scope)});d.length=0}};o()}};a.ScriptLoader=new a.dom.ScriptLoader()})(tinymce);(function(a){a.dom.RangeUtils=function(c){var b="\uFEFF";this.walk=function(d,s){var i=d.startContainer,l=d.startOffset,t=d.endContainer,m=d.endOffset,j,g,o,h,r,q,e;e=c.select("td.mceSelected,th.mceSelected");if(e.length>0){a.each(e,function(u){s([u])});return}function f(u){var v;v=u[0];if(v.nodeType===3&&v===i&&l>=v.nodeValue.length){u.splice(0,1)}v=u[u.length-1];if(m===0&&u.length>0&&v===t&&v.nodeType===3){u.splice(u.length-1,1)}return u}function p(x,v,u){var y=[];for(;x&&x!=u;x=x[v]){y.push(x)}return y}function n(v,u){do{if(v.parentNode==u){return v}v=v.parentNode}while(v)}function k(x,v,y){var u=y?"nextSibling":"previousSibling";for(h=x,r=h.parentNode;h&&h!=v;h=r){r=h.parentNode;q=p(h==x?h:h[u],u);if(q.length){if(!y){q.reverse()}s(f(q))}}}if(i.nodeType==1&&i.hasChildNodes()){i=i.childNodes[l]}if(t.nodeType==1&&t.hasChildNodes()){t=t.childNodes[Math.min(m-1,t.childNodes.length-1)]}if(i==t){return s(f([i]))}j=c.findCommonAncestor(i,t);for(h=i;h;h=h.parentNode){if(h===t){return k(i,j,true)}if(h===j){break}}for(h=t;h;h=h.parentNode){if(h===i){return k(t,j)}if(h===j){break}}g=n(i,j)||i;o=n(t,j)||t;k(i,g,true);q=p(g==i?g:g.nextSibling,"nextSibling",o==t?o.nextSibling:o);if(q.length){s(f(q))}k(t,o)};this.split=function(e){var h=e.startContainer,d=e.startOffset,i=e.endContainer,g=e.endOffset;function f(j,k){return j.splitText(k)}if(h==i&&h.nodeType==3){if(d>0&&dd){g=g-d;h=i=f(i,g).previousSibling;g=i.nodeValue.length;d=0}else{g=0}}}else{if(h.nodeType==3&&d>0&&d0&&g=l.length){q=0}}s=l[q];f.setAttrib(g,"tabindex","-1");f.setAttrib(s.id,"tabindex","0");f.get(s.id).focus();if(e.actOnFocus){e.onAction(s.id)}if(r){a.cancel(r)}};o=function(y){var u=37,t=39,x=38,z=40,q=27,s=14,r=13,v=32;switch(y.keyCode){case u:if(i){p.moveFocus(-1)}break;case t:if(i){p.moveFocus(1)}break;case x:if(n){p.moveFocus(-1)}break;case z:if(n){p.moveFocus(1)}break;case q:if(e.onCancel){e.onCancel();a.cancel(y)}break;case s:case r:case v:if(e.onAction){e.onAction(g);a.cancel(y)}break}};c(l,function(s,q){var r;if(!s.id){s.id=f.uniqueId("_mce_item_")}if(k){f.bind(s.id,"blur",h);r="-1"}else{r=(q===0?"0":"-1")}f.setAttrib(s.id,"tabindex",r);f.bind(f.get(s.id),"focus",j)});if(l[0]){g=l[0].id}f.setAttrib(m,"tabindex","-1");f.bind(f.get(m),"focus",d);f.bind(f.get(m),"keydown",o)}})})(tinymce);(function(c){var b=c.DOM,a=c.is;c.create("tinymce.ui.Control",{Control:function(f,e,d){this.id=f;this.settings=e=e||{};this.rendered=false;this.onRender=new c.util.Dispatcher(this);this.classPrefix="";this.scope=e.scope||this;this.disabled=0;this.active=0;this.editor=d},setAriaProperty:function(f,e){var d=b.get(this.id+"_aria")||b.get(this.id);if(d){b.setAttrib(d,"aria-"+f,!!e)}},focus:function(){b.get(this.id).focus()},setDisabled:function(d){if(d!=this.disabled){this.setAriaProperty("disabled",d);this.setState("Disabled",d);this.setState("Enabled",!d);this.disabled=d}},isDisabled:function(){return this.disabled},setActive:function(d){if(d!=this.active){this.setState("Active",d);this.active=d;this.setAriaProperty("pressed",d)}},isActive:function(){return this.active},setState:function(f,d){var e=b.get(this.id);f=this.classPrefix+f;if(d){b.addClass(e,f)}else{b.removeClass(e,f)}},isRendered:function(){return this.rendered},renderHTML:function(){},renderTo:function(d){b.setHTML(d,this.renderHTML())},postRender:function(){var e=this,d;if(a(e.disabled)){d=e.disabled;e.disabled=-1;e.setDisabled(d)}if(a(e.active)){d=e.active;e.active=-1;e.setActive(d)}},remove:function(){b.remove(this.id);this.destroy()},destroy:function(){c.dom.Event.clear(this.id)}})})(tinymce);tinymce.create("tinymce.ui.Container:tinymce.ui.Control",{Container:function(c,b,a){this.parent(c,b,a);this.controls=[];this.lookup={}},add:function(a){this.lookup[a.id]=a;this.controls.push(a);return a},get:function(a){return this.lookup[a]}});tinymce.create("tinymce.ui.Separator:tinymce.ui.Control",{Separator:function(b,a){this.parent(b,a);this.classPrefix="mceSeparator";this.setDisabled(true)},renderHTML:function(){return tinymce.DOM.createHTML("span",{"class":this.classPrefix,role:"separator","aria-orientation":"vertical",tabindex:"-1"})}});(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.MenuItem:tinymce.ui.Control",{MenuItem:function(g,f){this.parent(g,f);this.classPrefix="mceMenuItem"},setSelected:function(f){this.setState("Selected",f);this.setAriaProperty("checked",!!f);this.selected=f},isSelected:function(){return this.selected},postRender:function(){var f=this;f.parent();if(c(f.selected)){f.setSelected(f.selected)}}})})(tinymce);(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.Menu:tinymce.ui.MenuItem",{Menu:function(h,g){var f=this;f.parent(h,g);f.items={};f.collapsed=false;f.menuCount=0;f.onAddItem=new d.util.Dispatcher(this)},expand:function(g){var f=this;if(g){a(f,function(h){if(h.expand){h.expand()}},"items",f)}f.collapsed=false},collapse:function(g){var f=this;if(g){a(f,function(h){if(h.collapse){h.collapse()}},"items",f)}f.collapsed=true},isCollapsed:function(){return this.collapsed},add:function(f){if(!f.settings){f=new d.ui.MenuItem(f.id||b.uniqueId(),f)}this.onAddItem.dispatch(this,f);return this.items[f.id]=f},addSeparator:function(){return this.add({separator:true})},addMenu:function(f){if(!f.collapse){f=this.createMenu(f)}this.menuCount++;return this.add(f)},hasMenus:function(){return this.menuCount!==0},remove:function(f){delete this.items[f.id]},removeAll:function(){var f=this;a(f,function(g){if(g.removeAll){g.removeAll()}else{g.remove()}g.destroy()},"items",f);f.items={}},createMenu:function(g){var f=new d.ui.Menu(g.id||b.uniqueId(),g);f.onAddItem.add(this.onAddItem.dispatch,this.onAddItem);return f}})})(tinymce);(function(e){var d=e.is,c=e.DOM,f=e.each,a=e.dom.Event,b=e.dom.Element;e.create("tinymce.ui.DropMenu:tinymce.ui.Menu",{DropMenu:function(h,g){g=g||{};g.container=g.container||c.doc.body;g.offset_x=g.offset_x||0;g.offset_y=g.offset_y||0;g.vp_offset_x=g.vp_offset_x||0;g.vp_offset_y=g.vp_offset_y||0;if(d(g.icons)&&!g.icons){g["class"]+=" mceNoIcons"}this.parent(h,g);this.onShowMenu=new e.util.Dispatcher(this);this.onHideMenu=new e.util.Dispatcher(this);this.classPrefix="mceMenu"},createMenu:function(j){var h=this,i=h.settings,g;j.container=j.container||i.container;j.parent=h;j.constrain=j.constrain||i.constrain;j["class"]=j["class"]||i["class"];j.vp_offset_x=j.vp_offset_x||i.vp_offset_x;j.vp_offset_y=j.vp_offset_y||i.vp_offset_y;j.keyboard_focus=i.keyboard_focus;g=new e.ui.DropMenu(j.id||c.uniqueId(),j);g.onAddItem.add(h.onAddItem.dispatch,h.onAddItem);return g},focus:function(){var g=this;if(g.keyboardNav){g.keyboardNav.focus()}},update:function(){var i=this,j=i.settings,g=c.get("menu_"+i.id+"_tbl"),l=c.get("menu_"+i.id+"_co"),h,k;h=j.max_width?Math.min(g.offsetWidth,j.max_width):g.offsetWidth;k=j.max_height?Math.min(g.offsetHeight,j.max_height):g.offsetHeight;if(!c.boxModel){i.element.setStyles({width:h+2,height:k+2})}else{i.element.setStyles({width:h,height:k})}if(j.max_width){c.setStyle(l,"width",h)}if(j.max_height){c.setStyle(l,"height",k);if(g.clientHeightv){p=r?r-u:Math.max(0,(v-A.vp_offset_x)-u)}if((n+A.vp_offset_y+l)>q){n=Math.max(0,(q-A.vp_offset_y)-l)}}c.setStyles(o,{left:p,top:n});z.element.update();z.isMenuVisible=1;z.mouseClickFunc=a.add(o,"click",function(s){var h;s=s.target;if(s&&(s=c.getParent(s,"tr"))&&!c.hasClass(s,m+"ItemSub")){h=z.items[s.id];if(h.isDisabled()){return}k=z;while(k){if(k.hideMenu){k.hideMenu()}k=k.settings.parent}if(h.settings.onclick){h.settings.onclick(s)}return false}});if(z.hasMenus()){z.mouseOverFunc=a.add(o,"mouseover",function(x){var h,t,s;x=x.target;if(x&&(x=c.getParent(x,"tr"))){h=z.items[x.id];if(z.lastMenu){z.lastMenu.collapse(1)}if(h.isDisabled()){return}if(x&&c.hasClass(x,m+"ItemSub")){t=c.getRect(x);h.showMenu((t.x+t.w-i),t.y-i,t.x);z.lastMenu=h;c.addClass(c.get(h.id).firstChild,m+"ItemActive")}}})}a.add(o,"keydown",z._keyHandler,z);z.onShowMenu.dispatch(z);if(A.keyboard_focus){z._setupKeyboardNav()}},hideMenu:function(j){var g=this,i=c.get("menu_"+g.id),h;if(!g.isMenuVisible){return}if(g.keyboardNav){g.keyboardNav.destroy()}a.remove(i,"mouseover",g.mouseOverFunc);a.remove(i,"click",g.mouseClickFunc);a.remove(i,"keydown",g._keyHandler);c.hide(i);g.isMenuVisible=0;if(!j){g.collapse(1)}if(g.element){g.element.hide()}if(h=c.get(g.id)){c.removeClass(h.firstChild,g.classPrefix+"ItemActive")}g.onHideMenu.dispatch(g)},add:function(i){var g=this,h;i=g.parent(i);if(g.isRendered&&(h=c.get("menu_"+g.id))){g._add(c.select("tbody",h)[0],i)}return i},collapse:function(g){this.parent(g);this.hideMenu(1)},remove:function(g){c.remove(g.id);this.destroy();return this.parent(g)},destroy:function(){var g=this,h=c.get("menu_"+g.id);if(g.keyboardNav){g.keyboardNav.destroy()}a.remove(h,"mouseover",g.mouseOverFunc);a.remove(c.select("a",h),"focus",g.mouseOverFunc);a.remove(h,"click",g.mouseClickFunc);a.remove(h,"keydown",g._keyHandler);if(g.element){g.element.remove()}c.remove(h)},renderNode:function(){var i=this,j=i.settings,l,h,k,g;g=c.create("div",{role:"listbox",id:"menu_"+i.id,"class":j["class"],style:"position:absolute;left:0;top:0;z-index:200000;outline:0"});if(i.settings.parent){c.setAttrib(g,"aria-parent","menu_"+i.settings.parent.id)}k=c.add(g,"div",{role:"presentation",id:"menu_"+i.id+"_co","class":i.classPrefix+(j["class"]?" "+j["class"]:"")});i.element=new b("menu_"+i.id,{blocker:1,container:j.container});if(j.menu_line){c.add(k,"span",{"class":i.classPrefix+"Line"})}l=c.add(k,"table",{role:"presentation",id:"menu_"+i.id+"_tbl",border:0,cellPadding:0,cellSpacing:0});h=c.add(l,"tbody");f(i.items,function(m){i._add(h,m)});i.rendered=true;return g},_setupKeyboardNav:function(){var i,h,g=this;i=c.get("menu_"+g.id);h=c.select("a[role=option]","menu_"+g.id);h.splice(0,0,i);g.keyboardNav=new e.ui.KeyboardNavigation({root:"menu_"+g.id,items:h,onCancel:function(){g.hideMenu()},enableUpDown:true});i.focus()},_keyHandler:function(g){var h=this,i;switch(g.keyCode){case 37:if(h.settings.parent){h.hideMenu();h.settings.parent.focus();a.cancel(g)}break;case 39:if(h.mouseOverFunc){h.mouseOverFunc(g)}break}},_add:function(j,h){var i,q=h.settings,p,l,k,m=this.classPrefix,g;if(q.separator){l=c.add(j,"tr",{id:h.id,"class":m+"ItemSeparator"});c.add(l,"td",{"class":m+"ItemSeparator"});if(i=l.previousSibling){c.addClass(i,"mceLast")}return}i=l=c.add(j,"tr",{id:h.id,"class":m+"Item "+m+"ItemEnabled"});i=k=c.add(i,q.titleItem?"th":"td");i=p=c.add(i,"a",{id:h.id+"_aria",role:q.titleItem?"presentation":"option",href:"javascript:;",onclick:"return false;",onmousedown:"return false;"});if(q.parent){c.setAttrib(p,"aria-haspopup","true");c.setAttrib(p,"aria-owns","menu_"+h.id)}c.addClass(k,q["class"]);g=c.add(i,"span",{"class":"mceIcon"+(q.icon?" mce_"+q.icon:"")});if(q.icon_src){c.add(g,"img",{src:q.icon_src})}i=c.add(i,q.element||"span",{"class":"mceText",title:h.settings.title},h.settings.title);if(h.settings.style){if(typeof h.settings.style=="function"){h.settings.style=h.settings.style()}c.setAttrib(i,"style",h.settings.style)}if(j.childNodes.length==1){c.addClass(l,"mceFirst")}if((i=l.previousSibling)&&c.hasClass(i,m+"ItemSeparator")){c.addClass(l,"mceFirst")}if(h.collapse){c.addClass(l,m+"ItemSub")}if(i=l.previousSibling){c.removeClass(i,"mceLast")}c.addClass(l,"mceLast")}})})(tinymce);(function(b){var a=b.DOM;b.create("tinymce.ui.Button:tinymce.ui.Control",{Button:function(e,d,c){this.parent(e,d,c);this.classPrefix="mceButton"},renderHTML:function(){var f=this.classPrefix,e=this.settings,d,c;c=a.encode(e.label||"");d='';if(e.image&&!(this.editor&&this.editor.forcedHighContrastMode)){d+=''+a.encode(e.title)+''+c}else{d+=''+(c?''+c+"":"")}d+='";d+="";return d},postRender:function(){var d=this,e=d.settings,c;if(b.isIE&&d.editor){b.dom.Event.add(d.id,"mousedown",function(f){var g=d.editor.selection.getNode().nodeName;c=g==="IMG"?d.editor.selection.getBookmark():null})}b.dom.Event.add(d.id,"click",function(f){if(!d.isDisabled()){if(b.isIE&&d.editor&&c!==null){d.editor.selection.moveToBookmark(c)}return e.onclick.call(e.scope,f)}});b.dom.Event.add(d.id,"keyup",function(f){if(!d.isDisabled()&&f.keyCode==b.VK.SPACEBAR){return e.onclick.call(e.scope,f)}})}})})(tinymce);(function(e){var d=e.DOM,b=e.dom.Event,f=e.each,a=e.util.Dispatcher,c;e.create("tinymce.ui.ListBox:tinymce.ui.Control",{ListBox:function(j,i,g){var h=this;h.parent(j,i,g);h.items=[];h.onChange=new a(h);h.onPostRender=new a(h);h.onAdd=new a(h);h.onRenderMenu=new e.util.Dispatcher(this);h.classPrefix="mceListBox";h.marked={}},select:function(h){var g=this,j,i;g.marked={};if(h==c){return g.selectByIndex(-1)}if(h&&typeof(h)=="function"){i=h}else{i=function(k){return k==h}}if(h!=g.selectedValue){f(g.items,function(l,k){if(i(l.value)){j=1;g.selectByIndex(k);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(g){var i=this,j,k,h;i.marked={};if(g!=i.selectedIndex){j=d.get(i.id+"_text");h=d.get(i.id+"_voiceDesc");k=i.items[g];if(k){i.selectedValue=k.value;i.selectedIndex=g;d.setHTML(j,d.encode(k.title));d.setHTML(h,i.settings.title+" - "+k.title);d.removeClass(j,"mceTitle");d.setAttrib(i.id,"aria-valuenow",k.title)}else{d.setHTML(j,d.encode(i.settings.title));d.setHTML(h,d.encode(i.settings.title));d.addClass(j,"mceTitle");i.selectedValue=i.selectedIndex=null;d.setAttrib(i.id,"aria-valuenow",i.settings.title)}j=0}},mark:function(g){this.marked[g]=true},add:function(j,g,i){var h=this;i=i||{};i=e.extend(i,{title:j,value:g});h.items.push(i);h.onAdd.dispatch(h,i)},getLength:function(){return this.items.length},renderHTML:function(){var j="",g=this,i=g.settings,k=g.classPrefix;j='';j+="";j+="";j+="";return j},showMenu:function(){var h=this,j,i=d.get(this.id),g;if(h.isDisabled()||h.items.length===0){return}if(h.menu&&h.menu.isMenuVisible){return h.hideMenu()}if(!h.isMenuRendered){h.renderMenu();h.isMenuRendered=true}j=d.getPos(i);g=h.menu;g.settings.offset_x=j.x;g.settings.offset_y=j.y;g.settings.keyboard_focus=!e.isOpera;f(h.items,function(k){if(g.items[k.id]){g.items[k.id].setSelected(0)}});f(h.items,function(k){if(g.items[k.id]&&h.marked[k.value]){g.items[k.id].setSelected(1)}if(k.value===h.selectedValue){g.items[k.id].setSelected(1)}});g.showMenu(0,i.clientHeight);b.add(d.doc,"mousedown",h.hideMenu,h);d.addClass(h.id,h.classPrefix+"Selected")},hideMenu:function(h){var g=this;if(g.menu&&g.menu.isMenuVisible){d.removeClass(g.id,g.classPrefix+"Selected");if(h&&h.type=="mousedown"&&(h.target.id==g.id+"_text"||h.target.id==g.id+"_open")){return}if(!h||!d.getParent(h.target,".mceMenu")){d.removeClass(g.id,g.classPrefix+"Selected");b.remove(d.doc,"mousedown",g.hideMenu,g);g.menu.hideMenu()}}},renderMenu:function(){var h=this,g;g=h.settings.control_manager.createDropMenu(h.id+"_menu",{menu_line:1,"class":h.classPrefix+"Menu mceNoIcons",max_width:250,max_height:150});g.onHideMenu.add(function(){h.hideMenu();h.focus()});g.add({title:h.settings.title,"class":"mceMenuItemTitle",onclick:function(){if(h.settings.onselect("")!==false){h.select("")}}});f(h.items,function(i){if(i.value===c){g.add({title:i.title,role:"option","class":"mceMenuItemTitle",onclick:function(){if(h.settings.onselect("")!==false){h.select("")}}})}else{i.id=d.uniqueId();i.role="option";i.onclick=function(){if(h.settings.onselect(i.value)!==false){h.select(i.value)}};g.add(i)}});h.onRenderMenu.dispatch(h,g);h.menu=g},postRender:function(){var g=this,h=g.classPrefix;b.add(g.id,"click",g.showMenu,g);b.add(g.id,"keydown",function(i){if(i.keyCode==32){g.showMenu(i);b.cancel(i)}});b.add(g.id,"focus",function(){if(!g._focused){g.keyDownHandler=b.add(g.id,"keydown",function(i){if(i.keyCode==40){g.showMenu();b.cancel(i)}});g.keyPressHandler=b.add(g.id,"keypress",function(j){var i;if(j.keyCode==13){i=g.selectedValue;g.selectedValue=null;b.cancel(j);g.settings.onselect(i)}})}g._focused=1});b.add(g.id,"blur",function(){b.remove(g.id,"keydown",g.keyDownHandler);b.remove(g.id,"keypress",g.keyPressHandler);g._focused=0});if(e.isIE6||!d.boxModel){b.add(g.id,"mouseover",function(){if(!d.hasClass(g.id,h+"Disabled")){d.addClass(g.id,h+"Hover")}});b.add(g.id,"mouseout",function(){if(!d.hasClass(g.id,h+"Disabled")){d.removeClass(g.id,h+"Hover")}})}g.onPostRender.dispatch(g,d.get(g.id))},destroy:function(){this.parent();b.clear(this.id+"_text");b.clear(this.id+"_open")}})})(tinymce);(function(e){var d=e.DOM,b=e.dom.Event,f=e.each,a=e.util.Dispatcher,c;e.create("tinymce.ui.NativeListBox:tinymce.ui.ListBox",{NativeListBox:function(h,g){this.parent(h,g);this.classPrefix="mceNativeListBox"},setDisabled:function(g){d.get(this.id).disabled=g;this.setAriaProperty("disabled",g)},isDisabled:function(){return d.get(this.id).disabled},select:function(h){var g=this,j,i;if(h==c){return g.selectByIndex(-1)}if(h&&typeof(h)=="function"){i=h}else{i=function(k){return k==h}}if(h!=g.selectedValue){f(g.items,function(l,k){if(i(l.value)){j=1;g.selectByIndex(k);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(g){d.get(this.id).selectedIndex=g+1;this.selectedValue=this.items[g]?this.items[g].value:null},add:function(k,h,g){var j,i=this;g=g||{};g.value=h;if(i.isRendered()){d.add(d.get(this.id),"option",g,k)}j={title:k,value:h,attribs:g};i.items.push(j);i.onAdd.dispatch(i,j)},getLength:function(){return this.items.length},renderHTML:function(){var i,g=this;i=d.createHTML("option",{value:""},"-- "+g.settings.title+" --");f(g.items,function(h){i+=d.createHTML("option",{value:h.value},h.title)});i=d.createHTML("select",{id:g.id,"class":"mceNativeListBox","aria-labelledby":g.id+"_aria"},i);i+=d.createHTML("span",{id:g.id+"_aria",style:"display: none"},g.settings.title);return i},postRender:function(){var h=this,i,j=true;h.rendered=true;function g(l){var k=h.items[l.target.selectedIndex-1];if(k&&(k=k.value)){h.onChange.dispatch(h,k);if(h.settings.onselect){h.settings.onselect(k)}}}b.add(h.id,"change",g);b.add(h.id,"keydown",function(l){var k;b.remove(h.id,"change",i);j=false;k=b.add(h.id,"blur",function(){if(j){return}j=true;b.add(h.id,"change",g);b.remove(h.id,"blur",k)});if(e.isWebKit&&(l.keyCode==37||l.keyCode==39)){return b.prevent(l)}if(l.keyCode==13||l.keyCode==32){g(l);return b.cancel(l)}});h.onPostRender.dispatch(h,d.get(h.id))}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.MenuButton:tinymce.ui.Button",{MenuButton:function(g,f,e){this.parent(g,f,e);this.onRenderMenu=new c.util.Dispatcher(this);f.menu_container=f.menu_container||b.doc.body},showMenu:function(){var g=this,j,i,h=b.get(g.id),f;if(g.isDisabled()){return}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}if(g.isMenuVisible){return g.hideMenu()}j=b.getPos(g.settings.menu_container);i=b.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.vp_offset_x=i.x;f.settings.vp_offset_y=i.y;f.settings.keyboard_focus=g._focused;f.showMenu(0,h.firstChild.clientHeight);a.add(b.doc,"mousedown",g.hideMenu,g);g.setState("Selected",1);g.isMenuVisible=1},renderMenu:function(){var f=this,e;e=f.settings.control_manager.createDropMenu(f.id+"_menu",{menu_line:1,"class":this.classPrefix+"Menu",icons:f.settings.icons});e.onHideMenu.add(function(){f.hideMenu();f.focus()});f.onRenderMenu.dispatch(f,e);f.menu=e},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&b.getParent(g.target,function(h){return h.id===f.id||h.id===f.id+"_open"})){return}if(!g||!b.getParent(g.target,".mceMenu")){f.setState("Selected",0);a.remove(b.doc,"mousedown",f.hideMenu,f);if(f.menu){f.menu.hideMenu()}}f.isMenuVisible=0},postRender:function(){var e=this,f=e.settings;a.add(e.id,"click",function(){if(!e.isDisabled()){if(f.onclick){f.onclick(e.value)}e.showMenu()}})}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.SplitButton:tinymce.ui.MenuButton",{SplitButton:function(g,f,e){this.parent(g,f,e);this.classPrefix="mceSplitButton"},renderHTML:function(){var i,f=this,g=f.settings,e;i="";if(g.image){e=b.createHTML("img ",{src:g.image,role:"presentation","class":"mceAction "+g["class"]})}else{e=b.createHTML("span",{"class":"mceAction "+g["class"]},"")}e+=b.createHTML("span",{"class":"mceVoiceLabel mceIconOnly",id:f.id+"_voice",style:"display:none;"},g.title);i+=""+b.createHTML("a",{role:"button",id:f.id+"_action",tabindex:"-1",href:"javascript:;","class":"mceAction "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"";e=b.createHTML("span",{"class":"mceOpen "+g["class"]},'');i+=""+b.createHTML("a",{role:"button",id:f.id+"_open",tabindex:"-1",href:"javascript:;","class":"mceOpen "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"";i+="";i=b.createHTML("table",{role:"presentation","class":"mceSplitButton mceSplitButtonEnabled "+g["class"],cellpadding:"0",cellspacing:"0",title:g.title},i);return b.createHTML("div",{id:f.id,role:"button",tabindex:"0","aria-labelledby":f.id+"_voice","aria-haspopup":"true"},i)},postRender:function(){var e=this,g=e.settings,f;if(g.onclick){f=function(h){if(!e.isDisabled()){g.onclick(e.value);a.cancel(h)}};a.add(e.id+"_action","click",f);a.add(e.id,["click","keydown"],function(h){var k=32,m=14,i=13,j=38,l=40;if((h.keyCode===32||h.keyCode===13||h.keyCode===14)&&!h.altKey&&!h.ctrlKey&&!h.metaKey){f();a.cancel(h)}else{if(h.type==="click"||h.keyCode===l){e.showMenu();a.cancel(h)}}})}a.add(e.id+"_open","click",function(h){e.showMenu();a.cancel(h)});a.add([e.id,e.id+"_open"],"focus",function(){e._focused=1});a.add([e.id,e.id+"_open"],"blur",function(){e._focused=0});if(c.isIE6||!b.boxModel){a.add(e.id,"mouseover",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.addClass(e.id,"mceSplitButtonHover")}});a.add(e.id,"mouseout",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.removeClass(e.id,"mceSplitButtonHover")}})}},destroy:function(){this.parent();a.clear(this.id+"_action");a.clear(this.id+"_open");a.clear(this.id)}})})(tinymce);(function(d){var c=d.DOM,a=d.dom.Event,b=d.is,e=d.each;d.create("tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton",{ColorSplitButton:function(i,h,f){var g=this;g.parent(i,h,f);g.settings=h=d.extend({colors:"000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF",grid_width:8,default_color:"#888888"},g.settings);g.onShowMenu=new d.util.Dispatcher(g);g.onHideMenu=new d.util.Dispatcher(g);g.value=h.default_color},showMenu:function(){var f=this,g,j,i,h;if(f.isDisabled()){return}if(!f.isMenuRendered){f.renderMenu();f.isMenuRendered=true}if(f.isMenuVisible){return f.hideMenu()}i=c.get(f.id);c.show(f.id+"_menu");c.addClass(i,"mceSplitButtonSelected");h=c.getPos(i);c.setStyles(f.id+"_menu",{left:h.x,top:h.y+i.firstChild.clientHeight,zIndex:200000});i=0;a.add(c.doc,"mousedown",f.hideMenu,f);f.onShowMenu.dispatch(f);if(f._focused){f._keyHandler=a.add(f.id+"_menu","keydown",function(k){if(k.keyCode==27){f.hideMenu()}});c.select("a",f.id+"_menu")[0].focus()}f.isMenuVisible=1},hideMenu:function(g){var f=this;if(f.isMenuVisible){if(g&&g.type=="mousedown"&&c.getParent(g.target,function(h){return h.id===f.id+"_open"})){return}if(!g||!c.getParent(g.target,".mceSplitButtonMenu")){c.removeClass(f.id,"mceSplitButtonSelected");a.remove(c.doc,"mousedown",f.hideMenu,f);a.remove(f.id+"_menu","keydown",f._keyHandler);c.hide(f.id+"_menu")}f.isMenuVisible=0;f.onHideMenu.dispatch()}},renderMenu:function(){var p=this,h,k=0,q=p.settings,g,j,l,o,f;o=c.add(q.menu_container,"div",{role:"listbox",id:p.id+"_menu","class":q.menu_class+" "+q["class"],style:"position:absolute;left:0;top:-1000px;"});h=c.add(o,"div",{"class":q["class"]+" mceSplitButtonMenu"});c.add(h,"span",{"class":"mceMenuLine"});g=c.add(h,"table",{role:"presentation","class":"mceColorSplitMenu"});j=c.add(g,"tbody");k=0;e(b(q.colors,"array")?q.colors:q.colors.split(","),function(m){m=m.replace(/^#/,"");if(!k--){l=c.add(j,"tr");k=q.grid_width-1}g=c.add(l,"td");var i={href:"javascript:;",style:{backgroundColor:"#"+m},title:p.editor.getLang("colors."+m,m),"data-mce-color":"#"+m};if(!d.isIE){i.role="option"}g=c.add(g,"a",i);if(p.editor.forcedHighContrastMode){g=c.add(g,"canvas",{width:16,height:16,"aria-hidden":"true"});if(g.getContext&&(f=g.getContext("2d"))){f.fillStyle="#"+m;f.fillRect(0,0,16,16)}else{c.remove(g)}}});if(q.more_colors_func){g=c.add(j,"tr");g=c.add(g,"td",{colspan:q.grid_width,"class":"mceMoreColors"});g=c.add(g,"a",{role:"option",id:p.id+"_more",href:"javascript:;",onclick:"return false;","class":"mceMoreColors"},q.more_colors_title);a.add(g,"click",function(i){q.more_colors_func.call(q.more_colors_scope||this);return a.cancel(i)})}c.addClass(h,"mceColorSplitMenu");new d.ui.KeyboardNavigation({root:p.id+"_menu",items:c.select("a",p.id+"_menu"),onCancel:function(){p.hideMenu();p.focus()}});a.add(p.id+"_menu","mousedown",function(i){return a.cancel(i)});a.add(p.id+"_menu","click",function(i){var m;i=c.getParent(i.target,"a",j);if(i&&i.nodeName.toLowerCase()=="a"&&(m=i.getAttribute("data-mce-color"))){p.setColor(m)}return false});return o},setColor:function(f){this.displayColor(f);this.hideMenu();this.settings.onselect(f)},displayColor:function(g){var f=this;c.setStyle(f.id+"_preview","backgroundColor",g);f.value=g},postRender:function(){var f=this,g=f.id;f.parent();c.add(g+"_action","div",{id:g+"_preview","class":"mceColorPreview"});c.setStyle(f.id+"_preview","backgroundColor",f.value)},destroy:function(){this.parent();a.clear(this.id+"_menu");a.clear(this.id+"_more");c.remove(this.id+"_menu")}})})(tinymce);(function(b){var d=b.DOM,c=b.each,a=b.dom.Event;b.create("tinymce.ui.ToolbarGroup:tinymce.ui.Container",{renderHTML:function(){var f=this,i=[],e=f.controls,j=b.each,g=f.settings;i.push('
                    ');i.push("");i.push('");j(e,function(h){i.push(h.renderHTML())});i.push("");i.push("
                    ");return i.join("")},focus:function(){var e=this;d.get(e.id).focus()},postRender:function(){var f=this,e=[];c(f.controls,function(g){c(g.controls,function(h){if(h.id){e.push(h)}})});f.keyNav=new b.ui.KeyboardNavigation({root:f.id,items:e,onCancel:function(){if(b.isWebKit){d.get(f.editor.id+"_ifr").focus()}f.editor.focus()},excludeFromTabOrder:!f.settings.tab_focus_toolbar})},destroy:function(){var e=this;e.parent();e.keyNav.destroy();a.clear(e.id)}})})(tinymce);(function(a){var c=a.DOM,b=a.each;a.create("tinymce.ui.Toolbar:tinymce.ui.Container",{renderHTML:function(){var m=this,f="",j,k,n=m.settings,e,d,g,l;l=m.controls;for(e=0;e"))}if(d&&k.ListBox){if(d.Button||d.SplitButton){f+=c.createHTML("td",{"class":"mceToolbarEnd"},c.createHTML("span",null,""))}}if(c.stdMode){f+=''+k.renderHTML()+""}else{f+=""+k.renderHTML()+""}if(g&&k.ListBox){if(g.Button||g.SplitButton){f+=c.createHTML("td",{"class":"mceToolbarStart"},c.createHTML("span",null,""))}}}j="mceToolbarEnd";if(k.Button){j+=" mceToolbarEndButton"}else{if(k.SplitButton){j+=" mceToolbarEndSplitButton"}else{if(k.ListBox){j+=" mceToolbarEndListBox"}}}f+=c.createHTML("td",{"class":j},c.createHTML("span",null,""));return c.createHTML("table",{id:m.id,"class":"mceToolbar"+(n["class"]?" "+n["class"]:""),cellpadding:"0",cellspacing:"0",align:m.settings.align||"",role:"presentation",tabindex:"-1"},""+f+"")}})})(tinymce);(function(b){var a=b.util.Dispatcher,c=b.each;b.create("tinymce.AddOnManager",{AddOnManager:function(){var d=this;d.items=[];d.urls={};d.lookup={};d.onAdd=new a(d)},get:function(d){if(this.lookup[d]){return this.lookup[d].instance}else{return undefined}},dependencies:function(e){var d;if(this.lookup[e]){d=this.lookup[e].dependencies}return d||[]},requireLangPack:function(e){return;var d=b.settings;if(d&&d.language&&d.language_load!==false){b.ScriptLoader.add(this.urls[e]+"/langs/"+d.language+".js")}},add:function(f,e,d){this.items.push(e);this.lookup[f]={instance:e,dependencies:d};this.onAdd.dispatch(this,f,e);return e},createUrl:function(d,e){if(typeof e==="object"){return e}else{return{prefix:d.prefix,resource:e,suffix:d.suffix}}},addComponents:function(f,d){var e=this.urls[f];b.each(d,function(g){b.ScriptLoader.add(e+"/"+g)})},load:function(j,f,d,h){var g=this,e=f;function i(){var k=g.dependencies(j);b.each(k,function(m){var l=g.createUrl(f,m);g.load(l.resource,l,undefined,undefined)});if(d){if(h){d.call(h)}else{d.call(b.ScriptLoader)}}}if(g.urls[j]){return}if(typeof f==="object"){e=f.prefix+f.resource+f.suffix}if(e.indexOf("/")!==0&&e.indexOf("://")==-1){e=b.baseURL+"/"+e}g.urls[j]=e.substring(0,e.lastIndexOf("/"));if(g.lookup[j]){i()}else{b.ScriptLoader.add(e,i,h)}}});b.PluginManager=new b.AddOnManager();b.ThemeManager=new b.AddOnManager()}(tinymce));(function(j){var g=j.each,d=j.extend,k=j.DOM,i=j.dom.Event,f=j.ThemeManager,b=j.PluginManager,e=j.explode,h=j.util.Dispatcher,a,c=0;j.documentBaseURL=window.location.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,"");if(!/[\/\\]$/.test(j.documentBaseURL)){j.documentBaseURL+="/"}j.baseURL=new j.util.URI(j.documentBaseURL).toAbsolute(j.baseURL);j.baseURI=new j.util.URI(j.baseURL);j.onBeforeUnload=new h(j);i.add(window,"beforeunload",function(l){j.onBeforeUnload.dispatch(j,l)});j.onAddEditor=new h(j);j.onRemoveEditor=new h(j);j.EditorManager=d(j,{editors:[],i18n:{},activeEditor:null,init:function(x){var v=this,o,n=j.ScriptLoader,u,l=[],r;function q(t){var s=t.id;if(!s){s=t.name;if(s&&!k.get(s)){s=t.name}else{s=k.uniqueId()}t.setAttribute("id",s)}return s}function m(z,A,t){var y=z[A];if(!y){return}if(j.is(y,"string")){t=y.replace(/\.\w+$/,"");t=t?j.resolve(t):0;y=j.resolve(y)}return y.apply(t||this,Array.prototype.slice.call(arguments,2))}function p(t,s){return s.constructor===RegExp?s.test(t.className):k.hasClass(t,s)}x=d({theme:"simple",language:"en"},x);v.settings=x;i.bind(window,"ready",function(){var s,t;m(x,"onpageload");switch(x.mode){case"exact":s=x.elements||"";if(s.length>0){g(e(s),function(y){if(k.get(y)){r=new j.Editor(y,x);l.push(r);r.render(1)}else{g(document.forms,function(z){g(z.elements,function(A){if(A.name===y){y="mce_editor_"+c++;k.setAttrib(A,"id",y);r=new j.Editor(y,x);l.push(r);r.render(1)}})})}})}break;case"textareas":case"specific_textareas":g(k.select("textarea"),function(y){if(x.editor_deselector&&p(y,x.editor_deselector)){return}if(!x.editor_selector||p(y,x.editor_selector)){r=new j.Editor(q(y),x);l.push(r);r.render(1)}});break;default:if(x.types){g(x.types,function(y){g(k.select(y.selector),function(A){var z=new j.Editor(q(A),j.extend({},x,y));l.push(z);z.render(1)})})}else{if(x.selector){g(k.select(x.selector),function(z){var y=new j.Editor(q(z),x);l.push(y);y.render(1)})}}}if(x.oninit){s=t=0;g(l,function(y){t++;if(!y.initialized){y.onInit.add(function(){s++;if(s==t){m(x,"oninit")}})}else{s++}if(s==t){m(x,"oninit")}})}})},get:function(l){if(l===a){return this.editors}return this.editors[l]},getInstanceById:function(l){return this.get(l)},add:function(m){var l=this,n=l.editors;n[m.id]=m;n.push(m);l._setActive(m);l.onAddEditor.dispatch(l,m);return m},remove:function(n){var m=this,l,o=m.editors;if(!o[n.id]){return null}delete o[n.id];for(l=0;l':"",visual:n,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",apply_source_formatting:n,directionality:"ltr",forced_root_block:"p",hidden_input:n,padd_empty_editor:n,render_ui:n,indentation:"30px",fix_table_elements:n,inline_styles:n,convert_fonts_to_spans:n,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure",validate:n,entity_encoding:"named",url_converter:m.convertURL,url_converter_scope:m,ie7_compat:n},o);m.id=m.editorId=p;m.isNotDirty=false;m.plugins={};m.documentBaseURI=new k.util.URI(o.document_base_url||k.documentBaseURL,{base_uri:tinyMCE.baseURI});m.baseURI=k.baseURI;m.contentCSS=[];m.setupEvents();m.execCommands={};m.queryStateCommands={};m.queryValueCommands={};m.execCallback("setup",m)},render:function(o){var p=this,q=p.settings,r=p.id,m=k.ScriptLoader;if(!j.domLoaded){j.add(window,"ready",function(){p.render()});return}tinyMCE.settings=q;if(!p.getElement()){return}if(k.isIDevice&&!k.isIOS5){return}if(!/TEXTAREA|INPUT/i.test(p.getElement().nodeName)&&q.hidden_input&&l.getParent(r,"form")){l.insertAfter(l.create("input",{type:"hidden",name:r}),r)}if(k.WindowManager){p.windowManager=new k.WindowManager(p)}if(q.encoding=="xml"){p.onGetContent.add(function(s,t){if(t.save){t.content=l.encode(t.content)}})}if(q.add_form_submit_trigger){p.onSubmit.addToTop(function(){if(p.initialized){p.save();p.isNotDirty=1}})}if(q.add_unload_trigger){p._beforeUnload=tinyMCE.onBeforeUnload.add(function(){if(p.initialized&&!p.destroyed&&!p.isHidden()){p.save({format:"raw",no_events:true})}})}k.addUnload(p.destroy,p);if(q.submit_patch){p.onBeforeRenderUI.add(function(){var s=p.getElement().form;if(!s){return}if(s._mceOldSubmit){return}if(!s.submit.nodeType&&!s.submit.length){p.formElement=s;s._mceOldSubmit=s.submit;s.submit=function(){k.triggerSave();p.isNotDirty=1;return p.formElement._mceOldSubmit(p.formElement)}}s=null})}function n(){if(q.language&&q.language_load!==false){m.add(k.baseURL+"/../../extra/strings.php?elanguage="+q.language+"ðeme="+q.theme)}if(q.theme&&q.theme.charAt(0)!="-"&&!h.urls[q.theme]){h.load(q.theme,"themes/"+q.theme+"/editor_template"+k.suffix+".js")}i(g(q.plugins),function(t){if(t&&!c.urls[t]){if(t.charAt(0)=="-"){t=t.substr(1,t.length);var s=c.dependencies(t);i(s,function(v){var u={prefix:"plugins/",resource:v,suffix:"/editor_plugin"+k.suffix+".js"};v=c.createUrl(u,v);c.load(v.resource,v)})}else{if(t=="safari"){return}c.load(t,{prefix:"plugins/",resource:t,suffix:"/editor_plugin"+k.suffix+".js"})}}});m.loadQueue(function(){if(!p.removed){p.init()}})}n()},init:function(){var q,F=this,G=F.settings,C,y,B=F.getElement(),p,m,D,v,A,E,x,r=[];k.add(F);G.aria_label=G.aria_label||l.getAttrib(B,"aria-label",F.getLang("aria.rich_text_area"));if(G.theme){G.theme=G.theme.replace(/-/,"");p=h.get(G.theme);F.theme=new p();if(F.theme.init){F.theme.init(F,h.urls[G.theme]||k.documentBaseURL.replace(/\/$/,""))}}function z(s){var t=c.get(s),o=c.urls[s]||k.documentBaseURL.replace(/\/$/,""),n;if(t&&k.inArray(r,s)===-1){i(c.dependencies(s),function(u){z(u)});n=new t(F,o);F.plugins[s]=n;if(n.init){n.init(F,o);r.push(s)}}}i(g(G.plugins.replace(/\-/g,"")),z);if(G.popup_css!==false){if(G.popup_css){G.popup_css=F.documentBaseURI.toAbsolute(G.popup_css)}else{G.popup_css=F.baseURI.toAbsolute("themes/"+G.theme+"/skins/"+G.skin+"/dialog.css")}}if(G.popup_css_add){G.popup_css+=","+F.documentBaseURI.toAbsolute(G.popup_css_add)}F.controlManager=new k.ControlManager(F);F.onExecCommand.add(function(n,o){if(!/^(FontName|FontSize)$/.test(o)){F.nodeChanged()}});F.onBeforeRenderUI.dispatch(F,F.controlManager);if(G.render_ui&&F.theme){C=G.width||B.style.width||B.offsetWidth;y=G.height||B.style.height||B.offsetHeight;F.orgDisplay=B.style.display;E=/^[0-9\.]+(|px)$/i;if(E.test(""+C)){C=Math.max(parseInt(C,10)+(p.deltaWidth||0),100)}if(E.test(""+y)){y=Math.max(parseInt(y)+(p.deltaHeight||0),G.theme_advanced_resizing_min_height||100)}p=F.theme.renderUI({targetNode:B,width:C,height:y,deltaWidth:G.delta_width,deltaHeight:G.delta_height});F.editorContainer=p.editorContainer}if(G.content_css){i(g(G.content_css),function(n){F.contentCSS.push(F.documentBaseURI.toAbsolute(n))})}if(G.content_editable){B=q=p=null;return F.initContentBody()}if(document.domain&&location.hostname!=document.domain){k.relaxedDomain=document.domain}l.setStyles(p.sizeContainer||p.editorContainer,{width:C,height:y});y=(p.iframeHeight||y)+(typeof(y)=="number"?(p.deltaHeight||0):"");if(y<(G.theme_advanced_resizing_min_height||100)){y=G.theme_advanced_resizing_min_height||100}F.iframeHTML=G.doctype+'';if(G.document_base_url!=k.documentBaseURL){F.iframeHTML+=''}if(G.ie7_compat){F.iframeHTML+=''}else{F.iframeHTML+=''}F.iframeHTML+='';for(x=0;x'}F.contentCSS=[];v=G.body_id||"tinymce";if(v.indexOf("=")!=-1){v=F.getParam("body_id","","hash");v=v[F.id]||v}A=G.body_class||"";if(A.indexOf("=")!=-1){A=F.getParam("body_class","","hash");A=A[F.id]||""}F.iframeHTML+='
                    ";if(k.relaxedDomain&&(b||(k.isOpera&&parseFloat(opera.version())<11))){D='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinyMCE.get("'+F.id+'");document.write(ed.iframeHTML);document.close();ed.initContentBody();})()'}q=l.add(p.iframeContainer,"iframe",{id:F.id+"_ifr",src:D||'javascript:""',frameBorder:"0",allowTransparency:"true",title:G.aria_label,style:{width:"100%",height:y,display:"block"}});F.contentAreaContainer=p.iframeContainer;l.get(p.editorContainer).style.display=F.orgDisplay;l.get(F.id).style.display="none";l.setAttrib(F.id,"aria-hidden",true);if(!k.relaxedDomain||!D){F.initContentBody()}B=q=p=null},initContentBody:function(){var n=this,p=n.settings,q=l.get(n.id),r=n.getDoc(),o,m;if((!b||!k.relaxedDomain)&&!p.content_editable){r.open();r.write(n.iframeHTML);r.close();if(k.relaxedDomain){r.domain=k.relaxedDomain}}if(p.content_editable){l.addClass(q,"mceContentBody");n.contentDocument=r=p.content_document||document;n.contentWindow=p.content_window||window;n.bodyElement=q;p.content_document=p.content_window=null}m=n.getBody();m.disabled=true;if(!p.readonly){m.contentEditable=n.getParam("content_editable_state",true)}m.disabled=false;n.schema=new k.html.Schema(p);n.dom=new k.dom.DOMUtils(r,{keep_values:true,url_converter:n.convertURL,url_converter_scope:n,hex_colors:p.force_hex_style_colors,class_filter:p.class_filter,update_styles:true,root_element:p.content_editable?n.id:null,schema:n.schema});n.parser=new k.html.DomParser(p,n.schema);n.parser.addAttributeFilter("src,href,style",function(s,t){var u=s.length,x,z=n.dom,y,v;while(u--){x=s[u];y=x.attr(t);v="data-mce-"+t;if(!x.attributes.map[v]){if(t==="style"){x.attr(v,z.serializeStyle(z.parseStyle(y),x.name))}else{x.attr(v,n.convertURL(y,t,x.name))}}}});n.parser.addNodeFilter("script",function(s,t){var u=s.length,v;while(u--){v=s[u];v.attr("type","mce-"+(v.attr("type")||"text/javascript"))}});n.parser.addNodeFilter("#cdata",function(s,t){var u=s.length,v;while(u--){v=s[u];v.type=8;v.name="#comment";v.value="[CDATA["+v.value+"]]"}});n.parser.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(t,u){var v=t.length,x,s=n.schema.getNonEmptyElements();while(v--){x=t[v];if(x.isEmpty(s)){x.empty().append(new k.html.Node("br",1)).shortEnded=true}}});n.serializer=new k.dom.Serializer(p,n.dom,n.schema);n.selection=new k.dom.Selection(n.dom,n.getWin(),n.serializer);n.formatter=new k.Formatter(n);n.undoManager=new k.UndoManager(n);n.forceBlocks=new k.ForceBlocks(n);n.enterKey=new k.EnterKey(n);n.editorCommands=new k.EditorCommands(n);n.serializer.onPreProcess.add(function(s,t){return n.onPreProcess.dispatch(n,t,s)});n.serializer.onPostProcess.add(function(s,t){return n.onPostProcess.dispatch(n,t,s)});n.onPreInit.dispatch(n);if(!p.gecko_spellcheck){r.body.spellcheck=false}if(!p.readonly){n.bindNativeEvents()}n.controlManager.onPostRender.dispatch(n,n.controlManager);n.onPostRender.dispatch(n);n.quirks=k.util.Quirks(n);if(p.directionality){m.dir=p.directionality}if(p.nowrap){m.style.whiteSpace="nowrap"}if(p.protect){n.onBeforeSetContent.add(function(s,t){i(p.protect,function(u){t.content=t.content.replace(u,function(v){return""})})})}n.onSetContent.add(function(){n.addVisual(n.getBody())});if(p.padd_empty_editor){n.onPostProcess.add(function(s,t){t.content=t.content.replace(/^(]*>( | |\s|\u00a0|)<\/p>[\r\n]*|
                    [\r\n]*)$/,"")})}n.load({initial:true,format:"html"});n.startContent=n.getContent({format:"raw"});n.initialized=true;n.onInit.dispatch(n);n.execCallback("setupcontent_callback",n.id,m,r);n.execCallback("init_instance_callback",n);n.focus(true);n.nodeChanged({initial:true});i(n.contentCSS,function(s){n.dom.loadCSS(s)});if(p.auto_focus){setTimeout(function(){var s=k.get(p.auto_focus);s.selection.select(s.getBody(),1);s.selection.collapse(1);s.getBody().focus();s.getWin().focus()},100)}q=r=m=null},focus:function(p){var o,u=this,t=u.selection,q=u.settings.content_editable,n,r,s=u.getDoc(),m;if(!p){n=t.getRng();if(n.item){r=n.item(0)}u._refreshContentEditable();if(!q){u.getWin().focus()}if(k.isGecko||q){m=u.getBody();if(m.setActive){m.setActive()}else{m.focus()}if(q){t.normalize()}}if(r&&r.ownerDocument==s){n=s.body.createControlRange();n.addElement(r);n.select()}}if(k.activeEditor!=u){if((o=k.activeEditor)!=null){o.onDeactivate.dispatch(o,u)}u.onActivate.dispatch(u,o)}k._setActive(u)},execCallback:function(q){var m=this,p=m.settings[q],o;if(!p){return}if(m.callbackLookup&&(o=m.callbackLookup[q])){p=o.func;o=o.scope}if(d(p,"string")){o=p.replace(/\.\w+$/,"");o=o?k.resolve(o):0;p=k.resolve(p);m.callbackLookup=m.callbackLookup||{};m.callbackLookup[q]={func:p,scope:o}}return p.apply(o||m,Array.prototype.slice.call(arguments,1))},translate:function(m){var o=this.settings.language||"en",n=k.i18n;if(!m){return""}return n[o+"."+m]||m.replace(/\{\#([^\}]+)\}/g,function(q,p){return n[o+"."+p]||"{#"+p+"}"})},getLang:function(o,m){return k.i18n[(this.settings.language||"en")+"."+o]||(d(m)?m:"{#"+o+"}")},getParam:function(t,q,m){var r=k.trim,p=d(this.settings[t])?this.settings[t]:q,s;if(m==="hash"){s={};if(d(p,"string")){i(p.indexOf("=")>0?p.split(/[;,](?![^=;,]*(?:[;,]|$))/):p.split(","),function(n){n=n.split("=");if(n.length>1){s[r(n[0])]=r(n[1])}else{s[r(n[0])]=r(n)}})}else{s=p}return s}return p},nodeChanged:function(q){var m=this,n=m.selection,p;if(m.initialized){q=q||{};n.normalize();p=n.getStart()||m.getBody();p=b&&p.ownerDocument!=m.getDoc()?m.getBody():p;q.parents=[];m.dom.getParent(p,function(o){if(o.nodeName=="BODY"){return true}q.parents.push(o)});m.onNodeChange.dispatch(m,q?q.controlManager||m.controlManager:m.controlManager,p,n.isCollapsed(),q)}},addButton:function(n,o){var m=this;m.buttons=m.buttons||{};m.buttons[n]=o},addCommand:function(m,o,n){this.execCommands[m]={func:o,scope:n||this}},addQueryStateHandler:function(m,o,n){this.queryStateCommands[m]={func:o,scope:n||this}},addQueryValueHandler:function(m,o,n){this.queryValueCommands[m]={func:o,scope:n||this}},addShortcut:function(o,q,m,p){var n=this,r;if(n.settings.custom_shortcuts===false){return false}n.shortcuts=n.shortcuts||{};if(d(m,"string")){r=m;m=function(){n.execCommand(r,false,null)}}if(d(m,"object")){r=m;m=function(){n.execCommand(r[0],r[1],r[2])}}i(g(o),function(s){var t={func:m,scope:p||this,desc:n.translate(q),alt:false,ctrl:false,shift:false};i(g(s,"+"),function(u){switch(u){case"alt":case"ctrl":case"shift":t[u]=true;break;default:t.charCode=u.charCodeAt(0);t.keyCode=u.toUpperCase().charCodeAt(0)}});n.shortcuts[(t.ctrl?"ctrl":"")+","+(t.alt?"alt":"")+","+(t.shift?"shift":"")+","+t.keyCode]=t});return true},execCommand:function(u,r,x,m){var p=this,q=0,v,n;if(!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(u)&&(!m||!m.skip_focus)){p.focus()}m=f({},m);p.onBeforeExecCommand.dispatch(p,u,r,x,m);if(m.terminate){return false}if(p.execCallback("execcommand_callback",p.id,p.selection.getNode(),u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);return true}if(v=p.execCommands[u]){n=v.func.call(v.scope,r,x);if(n!==true){p.onExecCommand.dispatch(p,u,r,x,m);return n}}i(p.plugins,function(o){if(o.execCommand&&o.execCommand(u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);q=1;return false}});if(q){return true}if(p.theme&&p.theme.execCommand&&p.theme.execCommand(u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);return true}if(p.editorCommands.execCommand(u,r,x)){p.onExecCommand.dispatch(p,u,r,x,m);return true}p.getDoc().execCommand(u,r,x);p.onExecCommand.dispatch(p,u,r,x,m)},queryCommandState:function(q){var n=this,r,p;if(n._isHidden()){return}if(r=n.queryStateCommands[q]){p=r.func.call(r.scope);if(p!==true){return p}}r=n.editorCommands.queryCommandState(q);if(r!==-1){return r}try{return this.getDoc().queryCommandState(q)}catch(m){}},queryCommandValue:function(r){var n=this,q,p;if(n._isHidden()){return}if(q=n.queryValueCommands[r]){p=q.func.call(q.scope);if(p!==true){return p}}q=n.editorCommands.queryCommandValue(r);if(d(q)){return q}try{return this.getDoc().queryCommandValue(r)}catch(m){}},show:function(){var m=this;l.show(m.getContainer());l.hide(m.id);m.load()},hide:function(){var m=this,n=m.getDoc();if(b&&n){n.execCommand("SelectAll")}m.save();l.hide(m.getContainer());l.setStyle(m.id,"display",m.orgDisplay)},isHidden:function(){return !l.isHidden(this.id)},setProgressState:function(m,n,p){this.onSetProgressState.dispatch(this,m,n,p);return m},load:function(q){var m=this,p=m.getElement(),n;if(p){q=q||{};q.load=true;n=m.setContent(d(p.value)?p.value:p.innerHTML,q);q.element=p;if(!q.no_events){m.onLoadContent.dispatch(m,q)}q.element=p=null;return n}},save:function(r){var m=this,q=m.getElement(),n,p;if(!q||!m.initialized){return}r=r||{};r.save=true;r.element=q;n=r.content=m.getContent(r);if(!r.no_events){m.onSaveContent.dispatch(m,r)}n=r.content;if(!/TEXTAREA|INPUT/i.test(q.nodeName)){q.innerHTML=n;if(p=l.getParent(m.id,"form")){i(p.elements,function(o){if(o.name==m.id){o.value=n;return false}})}}else{q.value=n}r.element=q=null;return n},setContent:function(r,p){var o=this,n,m=o.getBody(),q;p=p||{};p.format=p.format||"html";p.set=true;p.content=r;if(!p.no_events){o.onBeforeSetContent.dispatch(o,p)}r=p.content;if(!k.isIE&&(r.length===0||/^\s+$/.test(r))){q=o.settings.forced_root_block;if(q){r="<"+q+'>
                    "}else{r='
                    '}m.innerHTML=r;o.selection.select(m,true);o.selection.collapse(true);return}if(p.format!=="raw"){r=new k.html.Serializer({},o.schema).serialize(o.parser.parse(r))}p.content=k.trim(r);o.dom.setHTML(m,p.content);if(!p.no_events){o.onSetContent.dispatch(o,p)}o.selection.normalize();return p.content},getContent:function(n){var m=this,o;n=n||{};n.format=n.format||"html";n.get=true;n.getInner=true;if(!n.no_events){m.onBeforeGetContent.dispatch(m,n)}if(n.format=="raw"){o=m.getBody().innerHTML}else{o=m.serializer.serialize(m.getBody(),n)}n.content=k.trim(o);if(!n.no_events){m.onGetContent.dispatch(m,n)}return n.content},isDirty:function(){var m=this;return k.trim(m.startContent)!=k.trim(m.getContent({format:"raw",no_events:1}))&&!m.isNotDirty},getContainer:function(){var m=this;if(!m.container){m.container=l.get(m.editorContainer||m.id+"_parent")}return m.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return l.get(this.settings.content_element||this.id)},getWin:function(){var m=this,n;if(!m.contentWindow){n=l.get(m.id+"_ifr");if(n){m.contentWindow=n.contentWindow}}return m.contentWindow},getDoc:function(){var m=this,n;if(!m.contentDocument){n=m.getWin();if(n){m.contentDocument=n.document}}return m.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(o,n,q){var m=this,p=m.settings;if(p.urlconverter_callback){return m.execCallback("urlconverter_callback",o,q,true,n)}if(!p.convert_urls||(q&&q.nodeName=="LINK")||o.indexOf("file:")===0){return o}if(p.relative_urls){return m.documentBaseURI.toRelative(o)}o=m.documentBaseURI.toAbsolute(o,p.remove_script_host);return o},addVisual:function(q){var n=this,o=n.settings,p=n.dom,m;q=q||n.getBody();if(!d(n.hasVisual)){n.hasVisual=o.visual}i(p.select("table,a",q),function(s){var r;switch(s.nodeName){case"TABLE":m=o.visual_table_class||"mceItemTable";r=p.getAttrib(s,"border");if(!r||r=="0"){if(n.hasVisual){p.addClass(s,m)}else{p.removeClass(s,m)}}return;case"A":r=p.getAttrib(s,"name");m="mceItemAnchor";if(r){if(n.hasVisual){p.addClass(s,m)}else{p.removeClass(s,m)}}return}});n.onVisualAid.dispatch(n,q,n.hasVisual)},remove:function(){var m=this,n=m.getContainer();if(!m.removed){m.removed=1;m.hide();if(!m.settings.content_editable){j.clear(m.getWin());j.clear(m.getDoc())}j.clear(m.getBody());j.clear(m.formElement);j.unbind(n);m.execCallback("remove_instance_callback",m);m.onRemove.dispatch(m);m.onExecCommand.listeners=[];k.remove(m);l.remove(n)}},destroy:function(n){var m=this;if(m.destroyed){return}if(a){j.unbind(m.getDoc());j.unbind(m.getWin());j.unbind(m.getBody())}if(!n){k.removeUnload(m.destroy);tinyMCE.onBeforeUnload.remove(m._beforeUnload);if(m.theme&&m.theme.destroy){m.theme.destroy()}m.controlManager.destroy();m.selection.destroy();m.dom.destroy()}if(m.formElement){m.formElement.submit=m.formElement._mceOldSubmit;m.formElement._mceOldSubmit=null}m.contentAreaContainer=m.formElement=m.container=m.settings.content_element=m.bodyElement=m.contentDocument=m.contentWindow=null;if(m.selection){m.selection=m.selection.win=m.selection.dom=m.selection.dom.doc=null}m.destroyed=1},_refreshContentEditable:function(){var n=this,m,o;if(n._isHidden()){m=n.getBody();o=m.parentNode;o.removeChild(m);o.appendChild(m);m.focus()}},_isHidden:function(){var m;if(!a){return 0}m=this.selection.getSel();return(!m||!m.rangeCount||m.rangeCount===0)}})})(tinymce);(function(a){var b=a.each;a.Editor.prototype.setupEvents=function(){var c=this,d=c.settings;b(["onPreInit","onBeforeRenderUI","onPostRender","onLoad","onInit","onRemove","onActivate","onDeactivate","onClick","onEvent","onMouseUp","onMouseDown","onDblClick","onKeyDown","onKeyUp","onKeyPress","onContextMenu","onSubmit","onReset","onPaste","onPreProcess","onPostProcess","onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent","onLoadContent","onSaveContent","onNodeChange","onChange","onBeforeExecCommand","onExecCommand","onUndo","onRedo","onVisualAid","onSetProgressState","onSetAttrib"],function(e){c[e]=new a.util.Dispatcher(c)});if(d.cleanup_callback){c.onBeforeSetContent.add(function(e,f){f.content=e.execCallback("cleanup_callback","insert_to_editor",f.content,f)});c.onPreProcess.add(function(e,f){if(f.set){e.execCallback("cleanup_callback","insert_to_editor_dom",f.node,f)}if(f.get){e.execCallback("cleanup_callback","get_from_editor_dom",f.node,f)}});c.onPostProcess.add(function(e,f){if(f.set){f.content=e.execCallback("cleanup_callback","insert_to_editor",f.content,f)}if(f.get){f.content=e.execCallback("cleanup_callback","get_from_editor",f.content,f)}})}if(d.save_callback){c.onGetContent.add(function(e,f){if(f.save){f.content=e.execCallback("save_callback",e.id,f.content,e.getBody())}})}if(d.handle_event_callback){c.onEvent.add(function(f,g,h){if(c.execCallback("handle_event_callback",g,f,h)===false){Event.cancel(g)}})}if(d.handle_node_change_callback){c.onNodeChange.add(function(f,e,g){f.execCallback("handle_node_change_callback",f.id,g,-1,-1,true,f.selection.isCollapsed())})}if(d.save_callback){c.onSaveContent.add(function(e,g){var f=e.execCallback("save_callback",e.id,g.content,e.getBody());if(f){g.content=f}})}if(d.onchange_callback){c.onChange.add(function(f,e){f.execCallback("onchange_callback",f,e)})}};a.Editor.prototype.bindNativeEvents=function(){var c=this,f,g=c.settings,j=c.dom,k;k={mouseup:"onMouseUp",mousedown:"onMouseDown",click:"onClick",keyup:"onKeyUp",keydown:"onKeyDown",keypress:"onKeyPress",submit:"onSubmit",reset:"onReset",contextmenu:"onContextMenu",dblclick:"onDblClick",paste:"onPaste"};function e(i,l){var m=i.type;if(c.removed){return}if(c.onEvent.dispatch(c,i,l)!==false){c[k[i.fakeType||i.type]].dispatch(c,i,l)}}function h(i){c.focus(true)}b(k,function(l,m){var i=g.content_editable?c.getBody():c.getDoc();switch(m){case"contextmenu":j.bind(i,m,e);break;case"paste":j.bind(c.getBody(),m,e);break;case"submit":case"reset":j.bind(c.getElement().form||a.DOM.getParent(c.id,"form"),m,e);break;default:j.bind(i,m,e)}});j.bind(g.content_editable?c.getBody():(a.isGecko?c.getDoc():c.getWin()),"focus",function(i){c.focus(true)});if(g.content_editable&&a.isOpera){j.bind(c.getBody(),"click",h);j.bind(c.getBody(),"keydown",h)}c.onMouseUp.add(c.nodeChanged);c.onKeyUp.add(function(i,m){var l=m.keyCode;if((l>=33&&l<=36)||(l>=37&&l<=40)||l==13||l==45||l==46||l==8||(a.isMac&&(l==91||l==93))||m.ctrlKey){c.nodeChanged()}});c.onReset.add(function(){c.setContent(c.startContent,{format:"raw"})});function d(l,i){if(l.altKey||l.ctrlKey||l.metaKey){b(c.shortcuts,function(m){var n=a.isMac?l.metaKey:l.ctrlKey;if(m.ctrl!=n||m.alt!=l.altKey||m.shift!=l.shiftKey){return}if(l.keyCode==m.keyCode||(l.charCode&&l.charCode==m.charCode)){l.preventDefault();if(i){m.func.call(m.scope)}return true}})}}c.onKeyUp.add(function(i,l){d(l)});c.onKeyPress.add(function(i,l){d(l)});c.onKeyDown.add(function(i,l){d(l,true)});if(a.isOpera){c.onClick.add(function(i,l){l.preventDefault()})}}})(tinymce);(function(d){var e=d.each,b,a=true,c=false;d.EditorCommands=function(n){var m=n.dom,p=n.selection,j={state:{},exec:{},value:{}},k=n.settings,q=n.formatter,o;function r(z,y,x){var v;z=z.toLowerCase();if(v=j.exec[z]){v(z,y,x);return a}return c}function l(x){var v;x=x.toLowerCase();if(v=j.state[x]){return v(x)}return -1}function h(x){var v;x=x.toLowerCase();if(v=j.value[x]){return v(x)}return c}function u(v,x){x=x||"exec";e(v,function(z,y){e(y.toLowerCase().split(","),function(A){j[x][A]=z})})}d.extend(this,{execCommand:r,queryCommandState:l,queryCommandValue:h,addCommands:u});function f(y,x,v){if(x===b){x=c}if(v===b){v=null}return n.getDoc().execCommand(y,x,v)}function t(v){return q.match(v)}function s(v,x){q.toggle(v,x?{value:x}:b)}function i(v){o=p.getBookmark(v)}function g(){p.moveToBookmark(o)}u({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){n.undoManager.add()},"Cut,Copy,Paste":function(z){var y=n.getDoc(),v;try{f(z)}catch(x){v=a}if(v||!y.queryCommandSupported(z)){if(d.isGecko){n.windowManager.confirm(n.getLang("clipboard_msg"),function(A){if(A){open("http://www.mozilla.org/editor/midasdemo/securityprefs.html","_blank")}})}else{n.windowManager.alert(n.getLang("clipboard_no_support"))}}},unlink:function(v){if(p.isCollapsed()){p.select(p.getNode())}f(v);p.collapse(c)},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(v){var x=v.substring(7);e("left,center,right,full".split(","),function(y){if(x!=y){q.remove("align"+y)}});s("align"+x);r("mceRepaint")},"InsertUnorderedList,InsertOrderedList":function(y){var v,x;f(y);v=m.getParent(p.getNode(),"ol,ul");if(v){x=v.parentNode;if(/^(H[1-6]|P|ADDRESS|PRE)$/.test(x.nodeName)){i();m.split(x,v);g()}}},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(v){s(v)},"ForeColor,HiliteColor,FontName":function(y,x,v){s(y,v)},FontSize:function(z,y,x){var v,A;if(x>=1&&x<=7){A=d.explode(k.font_size_style_values);v=d.explode(k.font_size_classes);if(v){x=v[x-1]||x}else{x=A[x-1]||x}}s(z,x)},RemoveFormat:function(v){q.remove(v)},mceBlockQuote:function(v){s("blockquote")},FormatBlock:function(y,x,v){return s(v||"p")},mceCleanup:function(){var v=p.getBookmark();n.setContent(n.getContent({cleanup:a}),{cleanup:a});p.moveToBookmark(v)},mceRemoveNode:function(z,y,x){var v=x||p.getNode();if(v!=n.getBody()){i();n.dom.remove(v,a);g()}},mceSelectNodeDepth:function(z,y,x){var v=0;m.getParent(p.getNode(),function(A){if(A.nodeType==1&&v++==x){p.select(A);return c}},n.getBody())},mceSelectNode:function(y,x,v){p.select(v)},mceInsertContent:function(B,I,K){var y,J,E,z,F,G,D,C,L,x,A,M,v,H;y=n.parser;J=new d.html.Serializer({},n.schema);v='\uFEFF';G={content:K,format:"html"};p.onBeforeSetContent.dispatch(p,G);K=G.content;if(K.indexOf("{$caret}")==-1){K+="{$caret}"}K=K.replace(/\{\$caret\}/,v);if(!p.isCollapsed()){n.getDoc().execCommand("Delete",false,null)}E=p.getNode();G={context:E.nodeName.toLowerCase()};F=y.parse(K,G);A=F.lastChild;if(A.attr("id")=="mce_marker"){D=A;for(A=A.prev;A;A=A.walk(true)){if(A.type==3||!m.isBlock(A.name)){A.parent.insert(D,A,A.name==="br");break}}}if(!G.invalid){K=J.serialize(F);A=E.firstChild;M=E.lastChild;if(!A||(A===M&&A.nodeName==="BR")){m.setHTML(E,K)}else{p.setContent(K)}}else{p.setContent(v);E=n.selection.getNode();z=n.getBody();if(E.nodeType==9){E=A=z}else{A=E}while(A!==z){E=A;A=A.parentNode}K=E==z?z.innerHTML:m.getOuterHTML(E);K=J.serialize(y.parse(K.replace(//i,function(){return J.serialize(F)})));if(E==z){m.setHTML(z,K)}else{m.setOuterHTML(E,K)}}D=m.get("mce_marker");C=m.getRect(D);L=m.getViewPort(n.getWin());if((C.y+C.h>L.y+L.h||C.yL.x+L.w||C.x")},mceToggleVisualAid:function(){n.hasVisual=!n.hasVisual;n.addVisual()},mceReplaceContent:function(y,x,v){n.execCommand("mceInsertContent",false,v.replace(/\{\$selection\}/g,p.getContent({format:"text"})))},mceInsertLink:function(z,y,x){var v;if(typeof(x)=="string"){x={href:x}}v=m.getParent(p.getNode(),"a");x.href=x.href.replace(" ","%20");if(!v||!x.href){q.remove("link")}if(x.href){q.apply("link",x,v)}},selectAll:function(){var x=m.getRoot(),v=m.createRng();v.setStart(x,0);v.setEnd(x,x.childNodes.length);n.selection.setRng(v)}});u({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(z){var x="align"+z.substring(7);var v=p.isCollapsed()?[m.getParent(p.getNode(),m.isBlock)]:p.getSelectedBlocks();var y=d.map(v,function(A){return !!q.matchNode(A,x)});return d.inArray(y,a)!==-1},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(v){return t(v)},mceBlockQuote:function(){return t("blockquote")},Outdent:function(){var v;if(k.inline_styles){if((v=m.getParent(p.getStart(),m.isBlock))&&parseInt(v.style.paddingLeft)>0){return a}if((v=m.getParent(p.getEnd(),m.isBlock))&&parseInt(v.style.paddingLeft)>0){return a}}return l("InsertUnorderedList")||l("InsertOrderedList")||(!k.inline_styles&&!!m.getParent(p.getNode(),"BLOCKQUOTE"))},"InsertUnorderedList,InsertOrderedList":function(v){return m.getParent(p.getNode(),v=="insertunorderedlist"?"UL":"OL")}},"state");u({"FontSize,FontName":function(y){var x=0,v;if(v=m.getParent(p.getNode(),"span")){if(y=="fontsize"){x=v.style.fontSize}else{x=v.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()}}return x}},"value");u({Undo:function(){n.undoManager.undo()},Redo:function(){n.undoManager.redo()}})}})(tinymce);(function(b){var a=b.util.Dispatcher;b.UndoManager=function(h){var l,i=0,e=[],g,k,j,f;function c(){return b.trim(h.getContent({format:"raw",no_events:1}).replace(/]+data-mce-bogus[^>]+>[\u200B\uFEFF]+<\/span>/g,""))}function d(){l.typing=false;l.add()}k=new a(l);j=new a(l);f=new a(l);k.add(function(m,n){if(m.hasUndo()){return h.onChange.dispatch(h,n,m)}});j.add(function(m,n){return h.onUndo.dispatch(h,n,m)});f.add(function(m,n){return h.onRedo.dispatch(h,n,m)});h.onInit.add(function(){l.add()});h.onBeforeExecCommand.add(function(m,p,o,q,n){if(p!="Undo"&&p!="Redo"&&p!="mceRepaint"&&(!n||!n.skip_undo)){l.beforeChange()}});h.onExecCommand.add(function(m,p,o,q,n){if(p!="Undo"&&p!="Redo"&&p!="mceRepaint"&&(!n||!n.skip_undo)){l.add()}});h.onSaveContent.add(d);h.dom.bind(h.dom.getRoot(),"dragend",d);h.dom.bind(h.getDoc(),b.isGecko?"blur":"focusout",function(m){if(!h.removed&&l.typing){d()}});h.onKeyUp.add(function(m,o){var n=o.keyCode;if((n>=33&&n<=36)||(n>=37&&n<=40)||n==45||n==13||o.ctrlKey){d()}});h.onKeyDown.add(function(m,o){var n=o.keyCode;if((n>=33&&n<=36)||(n>=37&&n<=40)||n==45){if(l.typing){d()}return}if((n<16||n>20)&&n!=224&&n!=91&&!l.typing){l.beforeChange();l.typing=true;l.add()}});h.onMouseDown.add(function(m,n){if(l.typing){d()}});h.addShortcut("ctrl+z","undo_desc","Undo");h.addShortcut("ctrl+y","redo_desc","Redo");l={data:e,typing:false,onAdd:k,onUndo:j,onRedo:f,beforeChange:function(){g=h.selection.getBookmark(2,true)},add:function(p){var m,n=h.settings,o;p=p||{};p.content=c();o=e[i];if(o&&o.content==p.content){return null}if(e[i]){e[i].beforeBookmark=g}if(n.custom_undo_redo_levels){if(e.length>n.custom_undo_redo_levels){for(m=0;m0){n=e[--i];h.setContent(n.content,{format:"raw"});h.selection.moveToBookmark(n.beforeBookmark);l.onUndo.dispatch(l,n)}return n},redo:function(){var m;if(i0||this.typing},hasRedo:function(){return i0){g.moveEnd("character",q)}g.select()}catch(n){}}if(p){c.nodeChanged()}}if(b.forced_root_block){c.onKeyUp.add(f);c.onNodeChange.add(f)}};(function(c){var b=c.DOM,a=c.dom.Event,d=c.each,e=c.extend;c.create("tinymce.ControlManager",{ControlManager:function(f,j){var h=this,g;j=j||{};h.editor=f;h.controls={};h.onAdd=new c.util.Dispatcher(h);h.onPostRender=new c.util.Dispatcher(h);h.prefix=j.prefix||f.id+"_";h._cls={};h.onPostRender.add(function(){d(h.controls,function(i){i.postRender()})})},get:function(f){return this.controls[this.prefix+f]||this.controls[f]},setActive:function(h,f){var g=null;if(g=this.get(h)){g.setActive(f)}return g},setDisabled:function(h,f){var g=null;if(g=this.get(h)){g.setDisabled(f)}return g},add:function(g){var f=this;if(g){f.controls[g.id]=g;f.onAdd.dispatch(g,f)}return g},createControl:function(i){var h,g=this,f=g.editor;d(f.plugins,function(j){if(j.createControl){h=j.createControl(i,g);if(h){return false}}});switch(i){case"|":case"separator":return g.createSeparator()}if(!h&&f.buttons&&(h=f.buttons[i])){return g.createButton(i,h)}return g.add(h)},createDropMenu:function(f,n,h){var m=this,i=m.editor,j,g,k,l;n=e({"class":"mceDropDown",constrain:i.settings.constrain_menus},n);n["class"]=n["class"]+" "+i.getParam("skin")+"Skin";if(k=i.getParam("skin_variant")){n["class"]+=" "+i.getParam("skin")+"Skin"+k.substring(0,1).toUpperCase()+k.substring(1)}n["class"]+=i.settings.directionality=="rtl"?" mceRtl":"";f=m.prefix+f;l=h||m._cls.dropmenu||c.ui.DropMenu;j=m.controls[f]=new l(f,n);j.onAddItem.add(function(r,q){var p=q.settings;p.title=i.getLang(p.title,p.title);if(!p.onclick){p.onclick=function(o){if(p.cmd){i.execCommand(p.cmd,p.ui||false,p.value)}}}});i.onRemove.add(function(){j.destroy()});if(c.isIE){j.onShowMenu.add(function(){i.focus();g=i.selection.getBookmark(1)});j.onHideMenu.add(function(){if(g){i.selection.moveToBookmark(g);g=0}})}return m.add(j)},createListBox:function(f,n,h){var l=this,j=l.editor,i,k,m;if(l.get(f)){return null}n.title=j.translate(n.title);n.scope=n.scope||j;if(!n.onselect){n.onselect=function(o){j.execCommand(n.cmd,n.ui||false,o||n.value)}}n=e({title:n.title,"class":"mce_"+f,scope:n.scope,control_manager:l},n);f=l.prefix+f;function g(o){return o.settings.use_accessible_selects&&!c.isGecko}if(j.settings.use_native_selects||g(j)){k=new c.ui.NativeListBox(f,n)}else{m=h||l._cls.listbox||c.ui.ListBox;k=new m(f,n,j)}l.controls[f]=k;if(c.isWebKit){k.onPostRender.add(function(p,o){a.add(o,"mousedown",function(){j.bookmark=j.selection.getBookmark(1)});a.add(o,"focus",function(){j.selection.moveToBookmark(j.bookmark);j.bookmark=null})})}if(k.hideMenu){j.onMouseDown.add(k.hideMenu,k)}return l.add(k)},createButton:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.label=g.translate(i.label);i.scope=i.scope||g;if(!i.onclick&&!i.menu_button){i.onclick=function(){g.execCommand(i.cmd,i.ui||false,i.value)}}i=e({title:i.title,"class":"mce_"+m,unavailable_prefix:g.getLang("unavailable",""),scope:i.scope,control_manager:h},i);m=h.prefix+m;if(i.menu_button){f=l||h._cls.menubutton||c.ui.MenuButton;k=new f(m,i,g);g.onMouseDown.add(k.hideMenu,k)}else{f=h._cls.button||c.ui.Button;k=new f(m,i,g)}return h.add(k)},createMenuButton:function(h,f,g){f=f||{};f.menu_button=1;return this.createButton(h,f,g)},createSplitButton:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.scope=i.scope||g;if(!i.onclick){i.onclick=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}if(!i.onselect){i.onselect=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}i=e({title:i.title,"class":"mce_"+m,scope:i.scope,control_manager:h},i);m=h.prefix+m;f=l||h._cls.splitbutton||c.ui.SplitButton;k=h.add(new f(m,i,g));g.onMouseDown.add(k.hideMenu,k);return k},createColorSplitButton:function(f,n,h){var l=this,j=l.editor,i,k,m,g;if(l.get(f)){return null}n.title=j.translate(n.title);n.scope=n.scope||j;if(!n.onclick){n.onclick=function(o){if(c.isIE){g=j.selection.getBookmark(1)}j.execCommand(n.cmd,n.ui||false,o||n.value)}}if(!n.onselect){n.onselect=function(o){j.execCommand(n.cmd,n.ui||false,o||n.value)}}n=e({title:n.title,"class":"mce_"+f,menu_class:j.getParam("skin")+"Skin",scope:n.scope,more_colors_title:j.getLang("more_colors")},n);f=l.prefix+f;m=h||l._cls.colorsplitbutton||c.ui.ColorSplitButton;k=new m(f,n,j);j.onMouseDown.add(k.hideMenu,k);j.onRemove.add(function(){k.destroy()});if(c.isIE){k.onShowMenu.add(function(){j.focus();g=j.selection.getBookmark(1)});k.onHideMenu.add(function(){if(g){j.selection.moveToBookmark(g);g=0}})}return l.add(k)},createToolbar:function(k,h,j){var i,g=this,f;k=g.prefix+k;f=j||g._cls.toolbar||c.ui.Toolbar;i=new f(k,h,g.editor);if(g.get(k)){return null}return g.add(i)},createToolbarGroup:function(k,h,j){var i,g=this,f;k=g.prefix+k;f=j||this._cls.toolbarGroup||c.ui.ToolbarGroup;i=new f(k,h,g.editor);if(g.get(k)){return null}return g.add(i)},createSeparator:function(g){var f=g||this._cls.separator||c.ui.Separator;return new f()},setControlType:function(g,f){return this._cls[g.toLowerCase()]=f},destroy:function(){d(this.controls,function(f){f.destroy()});this.controls=null}})})(tinymce);(function(d){var a=d.util.Dispatcher,e=d.each,c=d.isIE,b=d.isOpera;d.create("tinymce.WindowManager",{WindowManager:function(f){var g=this;g.editor=f;g.onOpen=new a(g);g.onClose=new a(g);g.params={};g.features={}},open:function(z,h){var v=this,k="",n,m,i=v.editor.settings.dialog_type=="modal",q,o,j,g=d.DOM.getViewPort(),r;z=z||{};h=h||{};o=b?g.w:screen.width;j=b?g.h:screen.height;z.name=z.name||"mc_"+new Date().getTime();z.width=parseInt(z.width||320);z.height=parseInt(z.height||240);z.resizable=true;z.left=z.left||parseInt(o/2)-(z.width/2);z.top=z.top||parseInt(j/2)-(z.height/2);h.inline=false;h.mce_width=z.width;h.mce_height=z.height;h.mce_auto_focus=z.auto_focus;if(i){if(c){z.center=true;z.help=false;z.dialogWidth=z.width+"px";z.dialogHeight=z.height+"px";z.scroll=z.scrollbars||false}}e(z,function(p,f){if(d.is(p,"boolean")){p=p?"yes":"no"}if(!/^(name|url)$/.test(f)){if(c&&i){k+=(k?";":"")+f+":"+p}else{k+=(k?",":"")+f+"="+p}}});v.features=z;v.params=h;v.onOpen.dispatch(v,z,h);r=z.url||z.file;r=d._addVer(r);try{if(c&&i){q=1;window.showModalDialog(r,window,k)}else{q=window.open(r,z.name,k)}}catch(l){}if(!q){alert(v.editor.getLang("popup_blocked"))}},close:function(f){f.close();this.onClose.dispatch(this)},createInstance:function(i,h,g,m,l,k){var j=d.resolve(i);return new j(h,g,m,l,k)},confirm:function(h,f,i,g){g=g||window;f.call(i||this,g.confirm(this._decode(this.editor.getLang(h,h))))},alert:function(h,f,j,g){var i=this;g=g||window;g.alert(i._decode(i.editor.getLang(h,h)));if(f){f.call(j||i)}},resizeBy:function(f,g,h){h.resizeBy(f,g)},_decode:function(f){return d.DOM.decode(f).replace(/\\n/g,"\n")}})}(tinymce));(function(a){a.Formatter=function(Y){var O={},R=a.each,c=Y.dom,r=Y.selection,t=a.dom.TreeWalker,M=new a.dom.RangeUtils(c),d=Y.schema.isValidChild,H=c.isBlock,m=Y.settings.forced_root_block,s=c.nodeIndex,G=a.isGecko?"\u200B":"\uFEFF",e=/^(src|href|style)$/,V=false,C=true,D,x=c.getContentEditable;function A(Z){return Z instanceof Array}function n(aa,Z){return c.getParents(aa,Z,c.getRoot())}function b(Z){return Z.nodeType===1&&Z.id==="_mce_caret"}function j(){l({alignleft:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"left"},defaultBlock:"div"},{selector:"img,table",collapsed:false,styles:{"float":"left"}}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"center"},defaultBlock:"div"},{selector:"img",collapsed:false,styles:{display:"block",marginLeft:"auto",marginRight:"auto"}},{selector:"table",collapsed:false,styles:{marginLeft:"auto",marginRight:"auto"}}],alignright:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"right"},defaultBlock:"div"},{selector:"img,table",collapsed:false,styles:{"float":"right"}}],alignfull:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"justify"},defaultBlock:"div"}],bold:[{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all"}],italic:[{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all"}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:true},{inline:"u",remove:"all"}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:true},{inline:"strike",remove:"all"}],forecolor:{inline:"span",styles:{color:"%value"},wrap_links:false},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},wrap_links:false},fontname:{inline:"span",styles:{fontFamily:"%value"}},fontsize:{inline:"span",styles:{fontSize:"%value"}},fontsize_class:{inline:"span",attributes:{"class":"%value"}},blockquote:{block:"blockquote",wrapper:1,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},link:{inline:"a",selector:"a",remove:"all",split:true,deep:true,onmatch:function(Z){return true},onformat:function(ab,Z,aa){R(aa,function(ad,ac){c.setAttrib(ab,ac,ad)})}},removeformat:[{selector:"b,strong,em,i,font,u,strike",remove:"all",split:true,expand:false,block_expand:true,deep:true},{selector:"span",attributes:["style","class"],remove:"empty",split:true,expand:false,deep:true},{selector:"*",attributes:["style","class"],split:false,expand:false,deep:true}]});R("p h1 h2 h3 h4 h5 h6 div address pre div code dt dd samp".split(/\s/),function(Z){l(Z,{block:Z,remove:"all"})});l(Y.settings.formats)}function U(){Y.addShortcut("ctrl+b","bold_desc","Bold");Y.addShortcut("ctrl+i","italic_desc","Italic");Y.addShortcut("ctrl+u","underline_desc","Underline");for(var Z=1;Z<=6;Z++){Y.addShortcut("ctrl+"+Z,"",["FormatBlock",false,"h"+Z])}Y.addShortcut("ctrl+7","",["FormatBlock",false,"p"]);Y.addShortcut("ctrl+8","",["FormatBlock",false,"div"]);Y.addShortcut("ctrl+9","",["FormatBlock",false,"address"])}function T(Z){return Z?O[Z]:O}function l(Z,aa){if(Z){if(typeof(Z)!=="string"){R(Z,function(ac,ab){l(ab,ac)})}else{aa=aa.length?aa:[aa];R(aa,function(ab){if(ab.deep===D){ab.deep=!ab.selector}if(ab.split===D){ab.split=!ab.selector||ab.inline}if(ab.remove===D&&ab.selector&&!ab.inline){ab.remove="none"}if(ab.selector&&ab.inline){ab.mixed=true;ab.block_expand=true}if(typeof(ab.classes)==="string"){ab.classes=ab.classes.split(/\s+/)}});O[Z]=aa}}}var i=function(aa){var Z;Y.dom.getParent(aa,function(ab){Z=Y.dom.getStyle(ab,"text-decoration");return Z&&Z!=="none"});return Z};var K=function(Z){var aa;if(Z.nodeType===1&&Z.parentNode&&Z.parentNode.nodeType===1){aa=i(Z.parentNode);if(Y.dom.getStyle(Z,"color")&&aa){Y.dom.setStyle(Z,"text-decoration",aa)}else{if(Y.dom.getStyle(Z,"textdecoration")===aa){Y.dom.setStyle(Z,"text-decoration",null)}}}};function W(ac,aj,ae){var af=T(ac),ak=af[0],ai,aa,ah,ag=r.isCollapsed();function Z(ao,an){an=an||ak;if(ao){if(an.onformat){an.onformat(ao,an,aj,ae)}R(an.styles,function(aq,ap){c.setStyle(ao,ap,q(aq,aj))});R(an.attributes,function(aq,ap){c.setAttrib(ao,ap,q(aq,aj))});R(an.classes,function(ap){ap=q(ap,aj);if(!c.hasClass(ao,ap)){c.addClass(ao,ap)}})}}function ad(){function ap(aw,au){var av=new t(au);for(ae=av.current();ae;ae=av.prev()){if(ae.childNodes.length>1||ae==aw||ae.tagName=="BR"){return ae}}}var ao=Y.selection.getRng();var at=ao.startContainer;var an=ao.endContainer;if(at!=an&&ao.endOffset===0){var ar=ap(at,an);var aq=ar.nodeType==3?ar.length:ar.childNodes.length;ao.setEnd(ar,aq)}return ao}function ab(aq,aw,au,at,ao){var an=[],ap=-1,av,ay=-1,ar=-1,ax;R(aq.childNodes,function(aA,az){if(aA.nodeName==="UL"||aA.nodeName==="OL"){ap=az;av=aA;return false}});R(aq.childNodes,function(aA,az){if(aA.nodeName==="SPAN"&&c.getAttrib(aA,"data-mce-type")=="bookmark"){if(aA.id==aw.id+"_start"){ay=az}else{if(aA.id==aw.id+"_end"){ar=az}}}});if(ap<=0||(ayap)){R(a.grep(aq.childNodes),ao);return 0}else{ax=c.clone(au,V);R(a.grep(aq.childNodes),function(aA,az){if((ayap&&az>ap)){an.push(aA);aA.parentNode.removeChild(aA)}});if(ayap){aq.insertBefore(ax,av.nextSibling)}}at.push(ax);R(an,function(az){ax.appendChild(az)});return ax}}function al(ao,aq,au){var an=[],at,ap,ar=true;at=ak.inline||ak.block;ap=c.create(at);Z(ap);M.walk(ao,function(av){var aw;function ax(ay){var aD,aB,az,aA,aC;aC=ar;aD=ay.nodeName.toLowerCase();aB=ay.parentNode.nodeName.toLowerCase();if(ay.nodeType===1&&x(ay)){aC=ar;ar=x(ay)==="true";aA=true}if(g(aD,"br")){aw=0;if(ak.block){c.remove(ay)}return}if(ak.wrapper&&y(ay,ac,aj)){aw=0;return}if(ar&&!aA&&ak.block&&!ak.wrapper&&I(aD)){ay=c.rename(ay,at);Z(ay);an.push(ay);aw=0;return}if(ak.selector){R(af,function(aE){if("collapsed" in aE&&aE.collapsed!==ag){return}if(c.is(ay,aE.selector)&&!b(ay)){Z(ay,aE);az=true}});if(!ak.inline||az){aw=0;return}}if(ar&&!aA&&d(at,aD)&&d(aB,at)&&!(!au&&ay.nodeType===3&&ay.nodeValue.length===1&&ay.nodeValue.charCodeAt(0)===65279)&&!b(ay)){if(!aw){aw=c.clone(ap,V);ay.parentNode.insertBefore(aw,ay);an.push(aw)}aw.appendChild(ay)}else{if(aD=="li"&&aq){aw=ab(ay,aq,ap,an,ax)}else{aw=0;R(a.grep(ay.childNodes),ax);if(aA){ar=aC}aw=0}}}R(av,ax)});if(ak.wrap_links===false){R(an,function(av){function aw(aA){var az,ay,ax;if(aA.nodeName==="A"){ay=c.clone(ap,V);an.push(ay);ax=a.grep(aA.childNodes);for(az=0;az1||!H(ax))&&av===0){c.remove(ax,1);return}if(ak.inline||ak.wrapper){if(!ak.exact&&av===1){ax=aw(ax)}R(af,function(az){R(c.select(az.inline,ax),function(aB){var aA;if(az.wrap_links===false){aA=aB.parentNode;do{if(aA.nodeName==="A"){return}}while(aA=aA.parentNode)}X(az,aj,aB,az.exact?aB:null)})});if(y(ax.parentNode,ac,aj)){c.remove(ax,1);ax=0;return C}if(ak.merge_with_parents){c.getParent(ax.parentNode,function(az){if(y(az,ac,aj)){c.remove(ax,1);ax=0;return C}})}if(ax&&ak.merge_siblings!==false){ax=u(E(ax),ax);ax=u(ax,E(ax,C))}}})}if(ak){if(ae){if(ae.nodeType){aa=c.createRng();aa.setStartBefore(ae);aa.setEndAfter(ae);al(p(aa,af),null,true)}else{al(ae,null,true)}}else{if(!ag||!ak.inline||c.select("td.mceSelected,th.mceSelected").length){var am=Y.selection.getNode();if(!m&&af[0].defaultBlock&&!c.getParent(am,c.isBlock)){W(af[0].defaultBlock)}Y.selection.setRng(ad());ai=r.getBookmark();al(p(r.getRng(C),af),ai);if(ak.styles&&(ak.styles.color||ak.styles.textDecoration)){a.walk(am,K,"childNodes");K(am)}r.moveToBookmark(ai);P(r.getRng(C));Y.nodeChanged()}else{S("apply",ac,aj)}}}}function B(ab,ak,ad){var ae=T(ab),am=ae[0],ai,ah,aa,aj=true;function ac(at){var ar,aq,ap,ao,av,au;if(at.nodeType===1&&x(at)){av=aj;aj=x(at)==="true";au=true}ar=a.grep(at.childNodes);if(aj&&!au){for(aq=0,ap=ae.length;aq=0;aa--){Z=af[aa].selector;if(!Z){return C}for(ae=ab.length-1;ae>=0;ae--){if(c.is(ab[ae],Z)){return C}}}}return V}a.extend(this,{get:T,register:l,apply:W,remove:B,toggle:F,match:k,matchAll:v,matchNode:y,canApply:z});j();U();function h(Z,aa){if(g(Z,aa.inline)){return C}if(g(Z,aa.block)){return C}if(aa.selector){return c.is(Z,aa.selector)}}function g(aa,Z){aa=aa||"";Z=Z||"";aa=""+(aa.nodeName||aa);Z=""+(Z.nodeName||Z);return aa.toLowerCase()==Z.toLowerCase()}function N(aa,Z){var ab=c.getStyle(aa,Z);if(Z=="color"||Z=="backgroundColor"){ab=c.toHex(ab)}if(Z=="fontWeight"&&ab==700){ab="bold"}return""+ab}function q(Z,aa){if(typeof(Z)!="string"){Z=Z(aa)}else{if(aa){Z=Z.replace(/%(\w+)/g,function(ac,ab){return aa[ab]||ac})}}return Z}function f(Z){return Z&&Z.nodeType===3&&/^([\t \r\n]+|)$/.test(Z.nodeValue)}function Q(ab,aa,Z){var ac=c.create(aa,Z);ab.parentNode.insertBefore(ac,ab);ac.appendChild(ab);return ac}function p(Z,ak,ac){var an,al,af,aj,ab=Z.startContainer,ag=Z.startOffset,ap=Z.endContainer,ai=Z.endOffset;function am(ax){var ar,av,aw,au,at,aq;ar=av=ax?ab:ap;at=ax?"previousSibling":"nextSibling";aq=c.getRoot();if(ar.nodeType==3&&!f(ar)){if(ax?ag>0:aial?al:ag];if(ab.nodeType==3){ag=0}}if(ap.nodeType==1&&ap.hasChildNodes()){al=ap.childNodes.length-1;ap=ap.childNodes[ai>al?al:ai-1];if(ap.nodeType==3){ai=ap.nodeValue.length}}function ao(ar){var aq=ar;while(aq){if(aq.nodeType===1&&x(aq)){return x(aq)==="false"?aq:ar}aq=aq.parentNode}return ar}function ah(ar,aw,ay){var av,at,ax,aq;function au(aA,aC){var aD,az,aB=aA.nodeValue;if(typeof(aC)=="undefined"){aC=ay?aB.length:0}if(ay){aD=aB.lastIndexOf(" ",aC);az=aB.lastIndexOf("\u00a0",aC);aD=aD>az?aD:az;if(aD!==-1&&!ac){aD++}}else{aD=aB.indexOf(" ",aC);az=aB.indexOf("\u00a0",aC);aD=aD!==-1&&(az===-1||aD0&&af.node.nodeType===3&&af.node.nodeValue.charAt(af.offset-1)===" "){if(af.offset>1){ap=af.node;ap.splitText(af.offset-1)}}}}if(ak[0].inline||ak[0].block_expand){if(!ak[0].inline||(ab.nodeType!=3||ag===0)){ab=am(true)}if(!ak[0].inline||(ap.nodeType!=3||ai===ap.nodeValue.length)){ap=am()}}if(ak[0].selector&&ak[0].expand!==V&&!ak[0].inline){ab=ad(ab,"previousSibling");ap=ad(ap,"nextSibling")}if(ak[0].block||ak[0].selector){ab=aa(ab,"previousSibling");ap=aa(ap,"nextSibling");if(ak[0].block){if(!H(ab)){ab=am(true)}if(!H(ap)){ap=am()}}}if(ab.nodeType==1){ag=s(ab);ab=ab.parentNode}if(ap.nodeType==1){ai=s(ap)+1;ap=ap.parentNode}return{startContainer:ab,startOffset:ag,endContainer:ap,endOffset:ai}}function X(af,ae,ac,Z){var ab,aa,ad;if(!h(ac,af)){return V}if(af.remove!="all"){R(af.styles,function(ah,ag){ah=q(ah,ae);if(typeof(ag)==="number"){ag=ah;Z=0}if(!Z||g(N(Z,ag),ah)){c.setStyle(ac,ag,"")}ad=1});if(ad&&c.getAttrib(ac,"style")==""){ac.removeAttribute("style");ac.removeAttribute("data-mce-style")}R(af.attributes,function(ai,ag){var ah;ai=q(ai,ae);if(typeof(ag)==="number"){ag=ai;Z=0}if(!Z||g(c.getAttrib(Z,ag),ai)){if(ag=="class"){ai=c.getAttrib(ac,ag);if(ai){ah="";R(ai.split(/\s+/),function(aj){if(/mce\w+/.test(aj)){ah+=(ah?" ":"")+aj}});if(ah){c.setAttrib(ac,ag,ah);return}}}if(ag=="class"){ac.removeAttribute("className")}if(e.test(ag)){ac.removeAttribute("data-mce-"+ag)}ac.removeAttribute(ag)}});R(af.classes,function(ag){ag=q(ag,ae);if(!Z||c.hasClass(Z,ag)){c.removeClass(ac,ag)}});aa=c.getAttribs(ac);for(ab=0;abab?ab:ad]}if(Z.nodeType===3&&ae&&ad>=Z.nodeValue.length){Z=new t(Z,Y.getBody()).next()||Z}if(Z.nodeType===3&&!ae&&ad===0){Z=new t(Z,Y.getBody()).prev()||Z}return Z}function S(ai,Z,ag){var aj="_mce_caret",aa=Y.settings.caret_debug;function ab(am){var al=c.create("span",{id:aj,"data-mce-bogus":true,style:aa?"color:red":""});if(am){al.appendChild(Y.getDoc().createTextNode(G))}return al}function ah(am,al){while(am){if((am.nodeType===3&&am.nodeValue!==G)||am.childNodes.length>1){return false}if(al&&am.nodeType===1){al.push(am)}am=am.firstChild}return true}function ae(al){while(al){if(al.id===aj){return al}al=al.parentNode}}function ad(al){var am;if(al){am=new t(al,al);for(al=am.current();al;al=am.next()){if(al.nodeType===3){return al}}}}function ac(an,am){var ao,al;if(!an){an=ae(r.getStart());if(!an){while(an=c.get(aj)){ac(an,false)}}}else{al=r.getRng(true);if(ah(an)){if(am!==false){al.setStartBefore(an);al.setEndBefore(an)}c.remove(an)}else{ao=ad(an);if(ao.nodeValue.charAt(0)===G){ao=ao.deleteData(0,1)}c.remove(an,1)}r.setRng(al)}}function af(){var an,al,ar,aq,ao,am,ap;an=r.getRng(true);aq=an.startOffset;am=an.startContainer;ap=am.nodeValue;al=ae(r.getStart());if(al){ar=ad(al)}if(ap&&aq>0&&aq=0;ap--){an.appendChild(c.clone(au[ap],false));an=an.firstChild}an.appendChild(c.doc.createTextNode(G));an=an.firstChild;c.insertAfter(at,av);r.setCursorLocation(an,1)}}if(!self._hasCaretEvents){Y.onBeforeGetContent.addToTop(function(){var al=[],am;if(ah(ae(r.getStart()),al)){am=al.length;while(am--){c.setAttrib(al[am],"data-mce-bogus","1")}}});a.each("onMouseUp onKeyUp".split(" "),function(al){Y[al].addToTop(function(){ac()})});Y.onKeyDown.addToTop(function(al,an){var am=an.keyCode;if(am==8||am==37||am==39){ac(ae(r.getStart()))}});r.onSetContent.add(function(){c.getParent(r.getStart(),function(al){if(al.id!==aj&&c.getAttrib(al,"data-mce-bogus")&&!c.isEmpty(al)){c.setAttrib(al,"data-mce-bogus",null)}})});self._hasCaretEvents=true}if(ai=="apply"){af()}else{ak()}}function P(aa){var Z=aa.startContainer,ag=aa.startOffset,ac,af,ae,ab,ad;if(Z.nodeType==3&&ag>=Z.nodeValue.length){ag=s(Z);Z=Z.parentNode;ac=true}if(Z.nodeType==1){ab=Z.childNodes;Z=ab[Math.min(ag,ab.length-1)];af=new t(Z,c.getParent(Z,c.isBlock));if(ag>ab.length-1||ac){af.next()}for(ae=af.current();ae;ae=af.next()){if(ae.nodeType==3&&!f(ae)){ad=c.create("a",null,G);ae.parentNode.insertBefore(ad,ae);aa.setStart(ae,0);r.setRng(aa);c.remove(ad);return}}}}}})(tinymce);tinymce.onAddEditor.add(function(e,a){var d,h,g,c=a.settings;function b(j,i){e.each(i,function(l,k){if(l){g.setStyle(j,k,l)}});g.rename(j,"span")}function f(i,j){g=i.dom;if(c.convert_fonts_to_spans){e.each(g.select("font,u,strike",j.node),function(k){d[k.nodeName.toLowerCase()](a.dom,k)})}}if(c.inline_styles){h=e.explode(c.font_size_legacy_values);d={font:function(j,i){b(i,{backgroundColor:i.style.backgroundColor,color:i.color,fontFamily:i.face,fontSize:h[parseInt(i.size,10)-1]})},u:function(j,i){b(i,{textDecoration:"underline"})},strike:function(j,i){b(i,{textDecoration:"line-through"})}};a.onPreProcess.add(f);a.onSetContent.add(f);a.onInit.add(function(){a.selection.onSetContent.add(f)})}});(function(b){var a=b.dom.TreeWalker;b.EnterKey=function(e){var h=e.dom,d=e.selection,c=e.settings,g=e.undoManager;function f(y){var u=d.getRng(true),C,i,x,t,o,H,n,j,l,s,E,v,z;function B(I){return I&&h.isBlock(I)&&!/^(TD|TH|CAPTION)$/.test(I.nodeName)&&!/^(fixed|absolute)/i.test(I.style.position)&&h.getContentEditable(I)!=="true"}function m(J){var O,M,I,P,N,L=J,K;I=h.createRng();if(J.hasChildNodes()){O=new a(J,J);while(M=O.current()){if(M.nodeType==3){I.setStart(M,0);I.setEnd(M,0);break}if(/^(BR|IMG)$/.test(M.nodeName)){I.setStartBefore(M);I.setEndBefore(M);break}L=M;M=O.next()}if(!M){I.setStart(L,0);I.setEnd(L,0)}}else{if(J.nodeName=="BR"){if(J.nextSibling&&h.isBlock(J.nextSibling)){if(!H||H<9){K=h.create("br");J.parentNode.insertBefore(K,J)}I.setStartBefore(J);I.setEndBefore(J)}else{I.setStartAfter(J);I.setEndAfter(J)}}else{I.setStart(J,0);I.setEnd(J,0)}}d.setRng(I);h.remove(K);N=h.getViewPort(e.getWin());P=h.getPos(J).y;if(PN.y+N.h){e.getWin().scrollTo(0,P"}return M}function p(L){var K,J,I;if(x.nodeType==3&&(L?t>0:t=x.nodeValue.length){if(!b.isIE&&!A()){J=h.create("br");u.insertNode(J);u.setStartAfter(J);u.setEndAfter(J);I=true}}J=h.create("br");u.insertNode(J);if(b.isIE&&s=="PRE"&&(!H||H<8)){J.parentNode.insertBefore(h.doc.createTextNode("\r"),J)}if(!I){u.setStartAfter(J);u.setEndAfter(J)}else{u.setStartBefore(J);u.setEndBefore(J)}d.setRng(u);g.add()}function r(I){do{if(I.nodeType===3){I.nodeValue=I.nodeValue.replace(/^[\r\n]+/,"")}I=I.firstChild}while(I)}function F(K){var I=h.getRoot(),J,L;J=K;while(J!==I&&h.getContentEditable(J)!=="false"){if(h.getContentEditable(J)==="true"){L=J}J=J.parentNode}return J!==I?L:I}if(!u.collapsed){e.execCommand("Delete");return}if(y.isDefaultPrevented()){return}x=u.startContainer;t=u.startOffset;v=c.forced_root_block;v=v?v.toUpperCase():"";H=h.doc.documentMode;if(x.nodeType==1&&x.hasChildNodes()){z=t>x.childNodes.length-1;x=x.childNodes[Math.min(t,x.childNodes.length-1)]||x;t=0}i=F(x);if(!i){return}g.beforeChange();if(!h.isBlock(i)&&i!=h.getRoot()){if(!v||y.shiftKey){G()}return}if((v&&!y.shiftKey)||(!v&&y.shiftKey)){x=k(x,t)}o=h.getParent(x,h.isBlock);l=o?h.getParent(o.parentNode,h.isBlock):null;s=o?o.nodeName.toUpperCase():"";E=l?l.nodeName.toUpperCase():"";if(s=="LI"&&h.isEmpty(o)){if(/^(UL|OL|LI)$/.test(l.parentNode.nodeName)){return false}D();return}if(s=="PRE"&&c.br_in_pre!==false){if(!y.shiftKey){G();return}}else{if((!v&&!y.shiftKey&&s!="LI")||(v&&y.shiftKey)){G();return}}v=v||"P";if(p()){if(/^(H[1-6]|PRE)$/.test(s)&&E!="HGROUP"){n=q(v)}else{n=q()}if(c.end_container_on_empty_block&&B(l)&&h.isEmpty(o)){n=h.split(l,o)}else{h.insertAfter(n,o)}}else{if(p(true)){n=o.parentNode.insertBefore(q(),o)}else{C=u.cloneRange();C.setEndAfter(o);j=C.extractContents();r(j);n=j.firstChild;h.insertAfter(j,o)}}h.setAttrib(n,"id","");m(n);g.add()}e.onKeyDown.add(function(j,i){if(i.keyCode==13){if(f(i)!==false){i.preventDefault()}}})}})(tinymce); \ No newline at end of file diff --git a/lib/editor/tinymce/version.php b/lib/editor/tinymce/version.php index 416fd95336c..c6c843ad686 100644 --- a/lib/editor/tinymce/version.php +++ b/lib/editor/tinymce/version.php @@ -25,7 +25,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2012050800; // The current plugin version (Date: YYYYMMDDXX) +$plugin->version = 2012052400; // The current plugin version (Date: YYYYMMDDXX) $plugin->requires = 2011112900; // Requires this Moodle version $plugin->component = 'editor_tinymce'; // Full name of the plugin (used for diagnostics) -$plugin->release = '3.5.0'; +$plugin->release = '3.5.1.1'; diff --git a/lib/filebrowser/file_info.php b/lib/filebrowser/file_info.php index 44069114762..e53640b3076 100644 --- a/lib/filebrowser/file_info.php +++ b/lib/filebrowser/file_info.php @@ -226,6 +226,20 @@ abstract class file_info { return 0; } + /** + * Returns the localised human-readable name of the file together with + * virtual path + * + * @return string + */ + public function get_readable_fullname() { + $fpath = array(); + for ($parent = $this; $parent; $parent = $parent->get_parent()) { + array_unshift($fpath, $parent->get_visible_name()); + } + return join('/', $fpath); + } + /** * Create new directory, may throw exception - make sure * params are valid. diff --git a/lib/filebrowser/file_info_context_user.php b/lib/filebrowser/file_info_context_user.php index 48d76e19643..badd5a39b57 100644 --- a/lib/filebrowser/file_info_context_user.php +++ b/lib/filebrowser/file_info_context_user.php @@ -201,7 +201,7 @@ class file_info_context_user extends file_info { return null; } } - $urlbase = $CFG->wwwroot.'/pluginfile.php'; + $urlbase = $CFG->wwwroot.'/draftfile.php'; return new file_info_stored($this->browser, $this->context, $storedfile, $urlbase, get_string('areauserdraft', 'repository'), true, true, true, true); } diff --git a/lib/filebrowser/file_info_stored.php b/lib/filebrowser/file_info_stored.php index 787787ee6a0..2f3ea57211a 100644 --- a/lib/filebrowser/file_info_stored.php +++ b/lib/filebrowser/file_info_stored.php @@ -187,6 +187,16 @@ class file_info_stored extends file_info { return $this->lf->get_filesize(); } + /** + * Returns width, height and mimetype of the stored image, or false + * + * @see stored_file::get_imageinfo() + * @return array|false + */ + public function get_imageinfo() { + return $this->lf->get_imageinfo(); + } + /** * Returns mimetype * @@ -495,7 +505,7 @@ class file_info_stored extends file_info { if ($this->is_directory()) { $filepath = $this->lf->get_filepath(); $fs = get_file_storage(); - $storedfiles = $fs->get_area_files($this->context->id, $this->get_component(), $this->lf->get_filearea(), $this->lf->get_itemid(), ""); + $storedfiles = $fs->get_area_files($this->context->id, $this->get_component(), $this->lf->get_filearea(), $this->lf->get_itemid()); foreach ($storedfiles as $file) { if (strpos($file->get_filepath(), $filepath) === 0) { $file->delete(); diff --git a/lib/filelib.php b/lib/filelib.php index f10d8ca5d63..7aa8841aa2b 100644 --- a/lib/filelib.php +++ b/lib/filelib.php @@ -374,7 +374,25 @@ function file_prepare_draft_area(&$draftitemid, $contextid, $component, $fileare if (!$options['subdirs'] and ($file->is_directory() or $file->get_filepath() !== '/')) { continue; } - $fs->create_file_from_storedfile($file_record, $file); + $draftfile = $fs->create_file_from_storedfile($file_record, $file); + // XXX: This is a hack for file manager (MDL-28666) + // File manager needs to know the original file information before copying + // to draft area, so we append these information in mdl_files.source field + // {@link file_storage::search_references()} + // {@link file_storage::search_references_count()} + $sourcefield = $file->get_source(); + $newsourcefield = new stdClass; + $newsourcefield->source = $sourcefield; + $original = new stdClass; + $original->contextid = $contextid; + $original->component = $component; + $original->filearea = $filearea; + $original->itemid = $itemid; + $original->filename = $file->get_filename(); + $original->filepath = $file->get_filepath(); + $newsourcefield->original = file_storage::pack_reference($original); + $draftfile->set_source(serialize($newsourcefield)); + // End of file manager hack } } if (!is_null($text)) { @@ -548,13 +566,13 @@ function file_get_drafarea_files($draftitemid, $filepath = '/') { $data->path[] = array('name'=>get_string('files'), 'path'=>'/'); // will be used to build breadcrumb - $trail = ''; + $trail = '/'; if ($filepath !== '/') { $filepath = file_correct_filepath($filepath); $parts = explode('/', $filepath); foreach ($parts as $part) { if ($part != '' && $part != null) { - $trail .= ('/'.$part.'/'); + $trail .= ($part.'/'); $data->path[] = array('name'=>$part, 'path'=>$trail); } } @@ -569,27 +587,47 @@ function file_get_drafarea_files($draftitemid, $filepath = '/') { $item->filepath = $file->get_filepath(); $item->fullname = trim($item->filename, '/'); $filesize = $file->get_filesize(); + $item->size = $filesize ? $filesize : null; $item->filesize = $filesize ? display_size($filesize) : ''; - $icon = mimeinfo_from_type('icon', $file->get_mimetype()); - $item->icon = $OUTPUT->pix_url('f/' . $icon)->out(); $item->sortorder = $file->get_sortorder(); - - if ($icon == 'zip') { - $item->type = 'zip'; - } else { - $item->type = 'file'; + $item->author = $file->get_author(); + $item->license = $file->get_license(); + $item->datemodified = $file->get_timemodified(); + $item->datecreated = $file->get_timecreated(); + $item->isref = $file->is_external_file(); + // find the file this draft file was created from and count all references in local + // system pointing to that file + $source = unserialize($file->get_source()); + if (isset($source->original)) { + $item->refcount = $fs->search_references_count($source->original); } if ($file->is_directory()) { $item->filesize = 0; - $item->icon = $OUTPUT->pix_url('f/folder')->out(); + $item->icon = $OUTPUT->pix_url(file_folder_icon(24))->out(false); $item->type = 'folder'; $foldername = explode('/', trim($item->filepath, '/')); $item->fullname = trim(array_pop($foldername), '/'); + $item->thumbnail = $OUTPUT->pix_url(file_folder_icon(90))->out(false); } else { // do NOT use file browser here! - $item->url = moodle_url::make_draftfile_url($draftitemid, $item->filepath, $item->filename)->out(); + $item->mimetype = get_mimetype_description($file); + if (file_mimetype_in_typegroup($item->mimetype, 'archive')) { + $item->type = 'zip'; + } else { + $item->type = 'file'; + } + $itemurl = moodle_url::make_draftfile_url($draftitemid, $item->filepath, $item->filename); + $item->url = $itemurl->out(); + $item->icon = $OUTPUT->pix_url(file_file_icon($file, 24))->out(false); + $item->thumbnail = $OUTPUT->pix_url(file_file_icon($file, 90))->out(false); + if ($imageinfo = $file->get_imageinfo()) { + $item->realthumbnail = $itemurl->out(false, array('preview' => 'thumb', 'oid' => $file->get_timemodified())); + $item->realicon = $itemurl->out(false, array('preview' => 'tinyicon', 'oid' => $file->get_timemodified())); + $item->image_width = $imageinfo['width']; + $item->image_height = $imageinfo['height']; + } } $list[] = $item; } @@ -631,6 +669,24 @@ function file_get_submitted_draft_itemid($elname) { return $param; } +/** + * Restore the original source field from draft files + * + * @param stored_file $storedfile This only works with draft files + * @return stored_file + */ +function file_restore_source_field_from_draft_file($storedfile) { + $source = unserialize($storedfile->get_source()); + if (!empty($source)) { + if (is_object($source)) { + $restoredsource = $source->source; + $storedfile->set_source($restoredsource); + } else { + throw new moodle_exception('invalidsourcefield', 'error'); + } + } + return $storedfile; +} /** * Saves files from a draft file area to a real one (merging the list of files). * Can rewrite URLs in some content at the same time if desired. @@ -676,8 +732,8 @@ function file_save_draft_area_files($draftitemid, $contextid, $component, $filea } else if (count($oldfiles) < 2) { $filecount = 0; // there were no files before - one file means root dir only ;-) - $file_record = array('contextid'=>$contextid, 'component'=>$component, 'filearea'=>$filearea, 'itemid'=>$itemid); foreach ($draftfiles as $file) { + $file_record = array('contextid'=>$contextid, 'component'=>$component, 'filearea'=>$filearea, 'itemid'=>$itemid); if (!$options['subdirs']) { if ($file->get_filepath() !== '/' or $file->is_directory()) { continue; @@ -694,13 +750,22 @@ function file_save_draft_area_files($draftitemid, $contextid, $component, $filea if (!$file->is_directory()) { $filecount++; } + + if ($file->is_external_file()) { + $repoid = $file->get_repository_id(); + if (!empty($repoid)) { + $file_record['repositoryid'] = $repoid; + $file_record['reference'] = $file->get_reference(); + } + } + file_restore_source_field_from_draft_file($file); + $fs->create_file_from_storedfile($file_record, $file); } } else { // we have to merge old and new files - we want to keep file ids for files that were not changed // we change time modified for all new and changed files, we keep time created as is - $file_record = array('contextid'=>$contextid, 'component'=>$component, 'filearea'=>$filearea, 'itemid'=>$itemid, 'timemodified'=>time()); $newhashes = array(); foreach ($draftfiles as $file) { @@ -715,14 +780,50 @@ function file_save_draft_area_files($draftitemid, $contextid, $component, $filea $oldfile->delete(); continue; } + $newfile = $newhashes[$oldhash]; - if ($oldfile->get_contenthash() != $newfile->get_contenthash() or $oldfile->get_sortorder() != $newfile->get_sortorder() - or $oldfile->get_status() != $newfile->get_status() or $oldfile->get_license() != $newfile->get_license() - or $oldfile->get_author() != $newfile->get_author() or $oldfile->get_source() != $newfile->get_source()) { + // status changed, we delete old file, and create a new one + if ($oldfile->get_status() != $newfile->get_status()) { // file was changed, use updated with new timemodified data $oldfile->delete(); + // This file will be added later continue; } + + file_restore_source_field_from_draft_file($newfile); + // Replaced file content + if ($oldfile->get_contenthash() != $newfile->get_contenthash()) { + $oldfile->replace_content_with($newfile); + } + // Updated author + if ($oldfile->get_author() != $newfile->get_author()) { + $oldfile->set_author($newfile->get_author()); + } + // Updated license + if ($oldfile->get_license() != $newfile->get_license()) { + $oldfile->set_license($newfile->get_license()); + } + + // Updated file source + if ($oldfile->get_source() != $newfile->get_source()) { + $oldfile->set_source($newfile->get_source()); + } + + // Updated sort order + if ($oldfile->get_sortorder() != $newfile->get_sortorder()) { + $oldfile->set_sortorder($newfile->get_sortorder()); + } + + // Update file size + if ($oldfile->get_filesize() != $newfile->get_filesize()) { + $oldfile->set_filesize($newfile->get_filesize()); + } + + // Update file timemodified + if ($oldfile->get_timemodified() != $newfile->get_timemodified()) { + $oldfile->set_timemodified($newfile->get_timemodified()); + } + // unchanged file or directory - we keep it as is unset($newhashes[$oldhash]); if (!$oldfile->is_directory()) { @@ -730,9 +831,10 @@ function file_save_draft_area_files($draftitemid, $contextid, $component, $filea } } - // now add new/changed files + // Add fresh file or the file which has changed status // the size and subdirectory tests are extra safety only, the UI should prevent it foreach ($newhashes as $file) { + $file_record = array('contextid'=>$contextid, 'component'=>$component, 'filearea'=>$filearea, 'itemid'=>$itemid, 'timemodified'=>time()); if (!$options['subdirs']) { if ($file->get_filepath() !== '/' or $file->is_directory()) { continue; @@ -749,6 +851,15 @@ function file_save_draft_area_files($draftitemid, $contextid, $component, $filea if (!$file->is_directory()) { $filecount++; } + + if ($file->is_external_file()) { + $repoid = $file->get_repository_id(); + if (!empty($repoid)) { + $file_record['repositoryid'] = $repoid; + $file_record['reference'] = $file->get_reference(); + } + } + $fs->create_file_from_storedfile($file_record, $file); } } @@ -1210,7 +1321,32 @@ function download_file_content_write_handler($received, $ch, $data) { } /** - * Returns a list of information about file t ypes based on extensions + * Returns a list of information about file types based on extensions. + * + * The following elements expected in value array for each extension: + * 'type' - mimetype + * 'icon' - location of the icon file. If value is FILENAME, then either pix/f/FILENAME.gif + * or pix/f/FILENAME.png must be present in moodle and contain 16x16 filetype icon; + * also files with bigger sizes under names + * FILENAME-24, FILENAME-32, FILENAME-64, FILENAME-128, FILENAME-256 are recommended. + * 'groups' (optional) - array of filetype groups this filetype extension is part of; + * commonly used in moodle the following groups: + * - web_image - image that can be included as in HTML + * - image - image that we can parse using GD to find it's dimensions, also used for portfolio format + * - video - file that can be imported as video in text editor + * - audio - file that can be imported as audio in text editor + * - archive - we can extract files from this archive + * - spreadsheet - used for portfolio format + * - document - used for portfolio format + * - presentation - used for portfolio format + * 'string' (optional) - the name of the string from lang/en/mimetypes.php that displays + * human-readable description for this filetype; + * Function {@link get_mimetype_description()} first looks at the presence of string for + * particular mimetype (value of 'type'), if not found looks for string specified in 'string' + * attribute, if not found returns the value of 'type'; + * 'defaulticon' (boolean, optional) - used by function {@link file_mimetype_icon()} to find + * an icon for mimetype. If an entry with 'defaulticon' is not found for a particular mimetype, + * this function will return first found icon; Especially usefull for types such as 'text/plain' * * @category files * @return array List of information about file types based on extensions. @@ -1218,179 +1354,179 @@ function download_file_content_write_handler($received, $ch, $data) { * from 'element name' to data. Current element names are 'type' and 'icon'. * Unknown types should use the 'xxx' entry which includes defaults. */ -function get_mimetypes_array() { +function &get_mimetypes_array() { static $mimearray = array ( 'xxx' => array ('type'=>'document/unknown', 'icon'=>'unknown'), - '3gp' => array ('type'=>'video/quicktime', 'icon'=>'video'), - 'aac' => array ('type'=>'audio/aac', 'icon'=>'audio'), - 'ai' => array ('type'=>'application/postscript', 'icon'=>'image'), - 'aif' => array ('type'=>'audio/x-aiff', 'icon'=>'audio'), - 'aiff' => array ('type'=>'audio/x-aiff', 'icon'=>'audio'), - 'aifc' => array ('type'=>'audio/x-aiff', 'icon'=>'audio'), + '3gp' => array ('type'=>'video/quicktime', 'icon'=>'mov', 'groups'=>array('video'), 'string'=>'video'), + 'aac' => array ('type'=>'audio/aac', 'icon'=>'mp3', 'groups'=>array('audio'), 'string'=>'audio'), + 'ai' => array ('type'=>'application/postscript', 'icon'=>'eps', 'groups'=>array('image'), 'string'=>'image'), + 'aif' => array ('type'=>'audio/x-aiff', 'icon'=>'audio', 'groups'=>array('audio'), 'string'=>'audio'), + 'aiff' => array ('type'=>'audio/x-aiff', 'icon'=>'audio', 'groups'=>array('audio'), 'string'=>'audio'), + 'aifc' => array ('type'=>'audio/x-aiff', 'icon'=>'audio', 'groups'=>array('audio'), 'string'=>'audio'), 'applescript' => array ('type'=>'text/plain', 'icon'=>'text'), 'asc' => array ('type'=>'text/plain', 'icon'=>'text'), 'asm' => array ('type'=>'text/plain', 'icon'=>'text'), - 'au' => array ('type'=>'audio/au', 'icon'=>'audio'), - 'avi' => array ('type'=>'video/x-ms-wm', 'icon'=>'avi'), - 'bmp' => array ('type'=>'image/bmp', 'icon'=>'image'), + 'au' => array ('type'=>'audio/au', 'icon'=>'audio', 'groups'=>array('audio'), 'string'=>'audio'), + 'avi' => array ('type'=>'video/x-ms-wm', 'icon'=>'avi', 'groups'=>array('video','web_video'), 'string'=>'video'), + 'bmp' => array ('type'=>'image/bmp', 'icon'=>'bmp', 'groups'=>array('image'), 'string'=>'image'), 'c' => array ('type'=>'text/plain', 'icon'=>'text'), 'cct' => array ('type'=>'shockwave/director', 'icon'=>'flash'), 'cpp' => array ('type'=>'text/plain', 'icon'=>'text'), 'cs' => array ('type'=>'application/x-csh', 'icon'=>'text'), - 'css' => array ('type'=>'text/css', 'icon'=>'text'), - 'csv' => array ('type'=>'text/csv', 'icon'=>'excel'), - 'dv' => array ('type'=>'video/x-dv', 'icon'=>'video'), + 'css' => array ('type'=>'text/css', 'icon'=>'text', 'groups'=>array('web_file')), + 'csv' => array ('type'=>'text/csv', 'icon'=>'xlsx', 'groups'=>array('spreadsheet')), + 'dv' => array ('type'=>'video/x-dv', 'icon'=>'mov', 'groups'=>array('video'), 'string'=>'video'), 'dmg' => array ('type'=>'application/octet-stream', 'icon'=>'dmg'), - 'doc' => array ('type'=>'application/msword', 'icon'=>'word'), - 'docx' => array ('type'=>'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'icon'=>'docx'), - 'docm' => array ('type'=>'application/vnd.ms-word.document.macroEnabled.12', 'icon'=>'docm'), - 'dotx' => array ('type'=>'application/vnd.openxmlformats-officedocument.wordprocessingml.template', 'icon'=>'dotx'), - 'dotm' => array ('type'=>'application/vnd.ms-word.template.macroEnabled.12', 'icon'=>'dotm'), + 'doc' => array ('type'=>'application/msword', 'icon'=>'docx', 'groups'=>array('document')), + 'docx' => array ('type'=>'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'icon'=>'docx', 'groups'=>array('document')), + 'docm' => array ('type'=>'application/vnd.ms-word.document.macroEnabled.12', 'icon'=>'docx'), + 'dotx' => array ('type'=>'application/vnd.openxmlformats-officedocument.wordprocessingml.template', 'icon'=>'docx'), + 'dotm' => array ('type'=>'application/vnd.ms-word.template.macroEnabled.12', 'icon'=>'docx'), 'dcr' => array ('type'=>'application/x-director', 'icon'=>'flash'), - 'dif' => array ('type'=>'video/x-dv', 'icon'=>'video'), + 'dif' => array ('type'=>'video/x-dv', 'icon'=>'mov', 'groups'=>array('video'), 'string'=>'video'), 'dir' => array ('type'=>'application/x-director', 'icon'=>'flash'), 'dxr' => array ('type'=>'application/x-director', 'icon'=>'flash'), - 'eps' => array ('type'=>'application/postscript', 'icon'=>'pdf'), + 'eps' => array ('type'=>'application/postscript', 'icon'=>'eps'), 'fdf' => array ('type'=>'application/pdf', 'icon'=>'pdf'), - 'flv' => array ('type'=>'video/x-flv', 'icon'=>'video'), - 'f4v' => array ('type'=>'video/mp4', 'icon'=>'video'), - 'gif' => array ('type'=>'image/gif', 'icon'=>'image'), - 'gtar' => array ('type'=>'application/x-gtar', 'icon'=>'zip'), - 'tgz' => array ('type'=>'application/g-zip', 'icon'=>'zip'), - 'gz' => array ('type'=>'application/g-zip', 'icon'=>'zip'), - 'gzip' => array ('type'=>'application/g-zip', 'icon'=>'zip'), + 'flv' => array ('type'=>'video/x-flv', 'icon'=>'flash', 'groups'=>array('video','web_video'), 'string'=>'video'), + 'f4v' => array ('type'=>'video/mp4', 'icon'=>'flash', 'groups'=>array('video','web_video'), 'string'=>'video'), + 'gif' => array ('type'=>'image/gif', 'icon'=>'gif', 'groups'=>array('image', 'web_image'), 'string'=>'image'), + 'gtar' => array ('type'=>'application/x-gtar', 'icon'=>'zip', 'groups'=>array('archive'), 'string'=>'archive'), + 'tgz' => array ('type'=>'application/g-zip', 'icon'=>'zip', 'groups'=>array('archive'), 'string'=>'archive'), + 'gz' => array ('type'=>'application/g-zip', 'icon'=>'zip', 'groups'=>array('archive'), 'string'=>'archive'), + 'gzip' => array ('type'=>'application/g-zip', 'icon'=>'zip', 'groups'=>array('archive'), 'string'=>'archive'), 'h' => array ('type'=>'text/plain', 'icon'=>'text'), 'hpp' => array ('type'=>'text/plain', 'icon'=>'text'), - 'hqx' => array ('type'=>'application/mac-binhex40', 'icon'=>'zip'), - 'htc' => array ('type'=>'text/x-component', 'icon'=>'text'), - 'html' => array ('type'=>'text/html', 'icon'=>'html'), - 'xhtml'=> array ('type'=>'application/xhtml+xml', 'icon'=>'html'), - 'htm' => array ('type'=>'text/html', 'icon'=>'html'), - 'ico' => array ('type'=>'image/vnd.microsoft.icon', 'icon'=>'image'), + 'hqx' => array ('type'=>'application/mac-binhex40', 'icon'=>'zip', 'groups'=>array('archive'), 'string'=>'archive'), + 'htc' => array ('type'=>'text/x-component', 'icon'=>'html'), + 'html' => array ('type'=>'text/html', 'icon'=>'html', 'groups'=>array('web_file')), + 'xhtml'=> array ('type'=>'application/xhtml+xml', 'icon'=>'html', 'groups'=>array('web_file')), + 'htm' => array ('type'=>'text/html', 'icon'=>'html', 'groups'=>array('web_file')), + 'ico' => array ('type'=>'image/vnd.microsoft.icon', 'icon'=>'image', 'groups'=>array('image'), 'string'=>'image'), 'ics' => array ('type'=>'text/calendar', 'icon'=>'text'), 'isf' => array ('type'=>'application/inspiration', 'icon'=>'isf'), 'ist' => array ('type'=>'application/inspiration.template', 'icon'=>'isf'), 'java' => array ('type'=>'text/plain', 'icon'=>'text'), - 'jcb' => array ('type'=>'text/xml', 'icon'=>'jcb'), - 'jcl' => array ('type'=>'text/xml', 'icon'=>'jcl'), - 'jcw' => array ('type'=>'text/xml', 'icon'=>'jcw'), - 'jmt' => array ('type'=>'text/xml', 'icon'=>'jmt'), - 'jmx' => array ('type'=>'text/xml', 'icon'=>'jmx'), - 'jpe' => array ('type'=>'image/jpeg', 'icon'=>'image'), - 'jpeg' => array ('type'=>'image/jpeg', 'icon'=>'image'), - 'jpg' => array ('type'=>'image/jpeg', 'icon'=>'image'), - 'jqz' => array ('type'=>'text/xml', 'icon'=>'jqz'), - 'js' => array ('type'=>'application/x-javascript', 'icon'=>'text'), + 'jcb' => array ('type'=>'text/xml', 'icon'=>'xml'), + 'jcl' => array ('type'=>'text/xml', 'icon'=>'xml'), + 'jcw' => array ('type'=>'text/xml', 'icon'=>'xml'), + 'jmt' => array ('type'=>'text/xml', 'icon'=>'xml'), + 'jmx' => array ('type'=>'text/xml', 'icon'=>'xml'), + 'jpe' => array ('type'=>'image/jpeg', 'icon'=>'jpeg', 'groups'=>array('image', 'web_image'), 'string'=>'image'), + 'jpeg' => array ('type'=>'image/jpeg', 'icon'=>'jpeg', 'groups'=>array('image', 'web_image'), 'string'=>'image'), + 'jpg' => array ('type'=>'image/jpeg', 'icon'=>'jpeg', 'groups'=>array('image', 'web_image'), 'string'=>'image'), + 'jqz' => array ('type'=>'text/xml', 'icon'=>'xml'), + 'js' => array ('type'=>'application/x-javascript', 'icon'=>'text', 'groups'=>array('web_file')), 'latex'=> array ('type'=>'application/x-latex', 'icon'=>'text'), 'm' => array ('type'=>'text/plain', 'icon'=>'text'), 'mbz' => array ('type'=>'application/vnd.moodle.backup', 'icon'=>'moodle'), - 'mov' => array ('type'=>'video/quicktime', 'icon'=>'video'), - 'movie'=> array ('type'=>'video/x-sgi-movie', 'icon'=>'video'), - 'm3u' => array ('type'=>'audio/x-mpegurl', 'icon'=>'audio'), - 'mp3' => array ('type'=>'audio/mp3', 'icon'=>'audio'), - 'mp4' => array ('type'=>'video/mp4', 'icon'=>'video'), - 'm4v' => array ('type'=>'video/mp4', 'icon'=>'video'), - 'm4a' => array ('type'=>'audio/mp4', 'icon'=>'audio'), - 'mpeg' => array ('type'=>'video/mpeg', 'icon'=>'video'), - 'mpe' => array ('type'=>'video/mpeg', 'icon'=>'video'), - 'mpg' => array ('type'=>'video/mpeg', 'icon'=>'video'), + 'mov' => array ('type'=>'video/quicktime', 'icon'=>'mov', 'groups'=>array('video','web_video'), 'string'=>'video'), + 'movie'=> array ('type'=>'video/x-sgi-movie', 'icon'=>'mov', 'groups'=>array('video'), 'string'=>'video'), + 'm3u' => array ('type'=>'audio/x-mpegurl', 'icon'=>'mp3', 'groups'=>array('audio'), 'string'=>'audio'), + 'mp3' => array ('type'=>'audio/mp3', 'icon'=>'mp3', 'groups'=>array('audio','web_audio'), 'string'=>'audio'), + 'mp4' => array ('type'=>'video/mp4', 'icon'=>'mpeg', 'groups'=>array('video','web_video'), 'string'=>'video'), + 'm4v' => array ('type'=>'video/mp4', 'icon'=>'mpeg', 'groups'=>array('video','web_video'), 'string'=>'video'), + 'm4a' => array ('type'=>'audio/mp4', 'icon'=>'mp3', 'groups'=>array('audio'), 'string'=>'audio'), + 'mpeg' => array ('type'=>'video/mpeg', 'icon'=>'mpeg', 'groups'=>array('video','web_video'), 'string'=>'video'), + 'mpe' => array ('type'=>'video/mpeg', 'icon'=>'mpeg', 'groups'=>array('video','web_video'), 'string'=>'video'), + 'mpg' => array ('type'=>'video/mpeg', 'icon'=>'mpeg', 'groups'=>array('video','web_video'), 'string'=>'video'), - 'odt' => array ('type'=>'application/vnd.oasis.opendocument.text', 'icon'=>'odt'), - 'ott' => array ('type'=>'application/vnd.oasis.opendocument.text-template', 'icon'=>'odt'), - 'oth' => array ('type'=>'application/vnd.oasis.opendocument.text-web', 'icon'=>'odt'), - 'odm' => array ('type'=>'application/vnd.oasis.opendocument.text-master', 'icon'=>'odm'), + 'odt' => array ('type'=>'application/vnd.oasis.opendocument.text', 'icon'=>'odt', 'groups'=>array('document')), + 'ott' => array ('type'=>'application/vnd.oasis.opendocument.text-template', 'icon'=>'odt', 'groups'=>array('document')), + 'oth' => array ('type'=>'application/vnd.oasis.opendocument.text-web', 'icon'=>'oth', 'groups'=>array('document')), + 'odm' => array ('type'=>'application/vnd.oasis.opendocument.text-master', 'icon'=>'odt'), 'odg' => array ('type'=>'application/vnd.oasis.opendocument.graphics', 'icon'=>'odg'), 'otg' => array ('type'=>'application/vnd.oasis.opendocument.graphics-template', 'icon'=>'odg'), 'odp' => array ('type'=>'application/vnd.oasis.opendocument.presentation', 'icon'=>'odp'), 'otp' => array ('type'=>'application/vnd.oasis.opendocument.presentation-template', 'icon'=>'odp'), - 'ods' => array ('type'=>'application/vnd.oasis.opendocument.spreadsheet', 'icon'=>'ods'), - 'ots' => array ('type'=>'application/vnd.oasis.opendocument.spreadsheet-template', 'icon'=>'ods'), + 'ods' => array ('type'=>'application/vnd.oasis.opendocument.spreadsheet', 'icon'=>'ods', 'groups'=>array('spreadsheet')), + 'ots' => array ('type'=>'application/vnd.oasis.opendocument.spreadsheet-template', 'icon'=>'ods', 'groups'=>array('spreadsheet')), 'odc' => array ('type'=>'application/vnd.oasis.opendocument.chart', 'icon'=>'odc'), 'odf' => array ('type'=>'application/vnd.oasis.opendocument.formula', 'icon'=>'odf'), 'odb' => array ('type'=>'application/vnd.oasis.opendocument.database', 'icon'=>'odb'), - 'odi' => array ('type'=>'application/vnd.oasis.opendocument.image', 'icon'=>'odi'), - 'oga' => array ('type'=>'audio/ogg', 'icon'=>'audio'), - 'ogg' => array ('type'=>'audio/ogg', 'icon'=>'audio'), - 'ogv' => array ('type'=>'video/ogg', 'icon'=>'video'), + 'odi' => array ('type'=>'application/vnd.oasis.opendocument.image', 'icon'=>'odg'), + 'oga' => array ('type'=>'audio/ogg', 'icon'=>'wma', 'groups'=>array('audio'), 'string'=>'audio'), + 'ogg' => array ('type'=>'audio/ogg', 'icon'=>'wma', 'groups'=>array('audio'), 'string'=>'audio'), + 'ogv' => array ('type'=>'video/ogg', 'icon'=>'wmv', 'groups'=>array('video'), 'string'=>'video'), - 'pct' => array ('type'=>'image/pict', 'icon'=>'image'), + 'pct' => array ('type'=>'image/pict', 'icon'=>'image', 'groups'=>array('image'), 'string'=>'image'), 'pdf' => array ('type'=>'application/pdf', 'icon'=>'pdf'), 'php' => array ('type'=>'text/plain', 'icon'=>'text'), - 'pic' => array ('type'=>'image/pict', 'icon'=>'image'), - 'pict' => array ('type'=>'image/pict', 'icon'=>'image'), - 'png' => array ('type'=>'image/png', 'icon'=>'image'), + 'pic' => array ('type'=>'image/pict', 'icon'=>'image', 'groups'=>array('image'), 'string'=>'image'), + 'pict' => array ('type'=>'image/pict', 'icon'=>'image', 'groups'=>array('image'), 'string'=>'image'), + 'png' => array ('type'=>'image/png', 'icon'=>'png', 'groups'=>array('image', 'web_image'), 'string'=>'image'), - 'pps' => array ('type'=>'application/vnd.ms-powerpoint', 'icon'=>'powerpoint'), - 'ppt' => array ('type'=>'application/vnd.ms-powerpoint', 'icon'=>'powerpoint'), + 'pps' => array ('type'=>'application/vnd.ms-powerpoint', 'icon'=>'pptx', 'groups'=>array('presentation')), + 'ppt' => array ('type'=>'application/vnd.ms-powerpoint', 'icon'=>'pptx', 'groups'=>array('presentation')), 'pptx' => array ('type'=>'application/vnd.openxmlformats-officedocument.presentationml.presentation', 'icon'=>'pptx'), - 'pptm' => array ('type'=>'application/vnd.ms-powerpoint.presentation.macroEnabled.12', 'icon'=>'pptm'), - 'potx' => array ('type'=>'application/vnd.openxmlformats-officedocument.presentationml.template', 'icon'=>'potx'), - 'potm' => array ('type'=>'application/vnd.ms-powerpoint.template.macroEnabled.12', 'icon'=>'potm'), - 'ppam' => array ('type'=>'application/vnd.ms-powerpoint.addin.macroEnabled.12', 'icon'=>'ppam'), - 'ppsx' => array ('type'=>'application/vnd.openxmlformats-officedocument.presentationml.slideshow', 'icon'=>'ppsx'), - 'ppsm' => array ('type'=>'application/vnd.ms-powerpoint.slideshow.macroEnabled.12', 'icon'=>'ppsm'), + 'pptm' => array ('type'=>'application/vnd.ms-powerpoint.presentation.macroEnabled.12', 'icon'=>'pptx'), + 'potx' => array ('type'=>'application/vnd.openxmlformats-officedocument.presentationml.template', 'icon'=>'pptx'), + 'potm' => array ('type'=>'application/vnd.ms-powerpoint.template.macroEnabled.12', 'icon'=>'pptx'), + 'ppam' => array ('type'=>'application/vnd.ms-powerpoint.addin.macroEnabled.12', 'icon'=>'pptx'), + 'ppsx' => array ('type'=>'application/vnd.openxmlformats-officedocument.presentationml.slideshow', 'icon'=>'pptx'), + 'ppsm' => array ('type'=>'application/vnd.ms-powerpoint.slideshow.macroEnabled.12', 'icon'=>'pptx'), 'ps' => array ('type'=>'application/postscript', 'icon'=>'pdf'), - 'qt' => array ('type'=>'video/quicktime', 'icon'=>'video'), - 'ra' => array ('type'=>'audio/x-realaudio-plugin', 'icon'=>'audio'), - 'ram' => array ('type'=>'audio/x-pn-realaudio-plugin', 'icon'=>'audio'), + 'qt' => array ('type'=>'video/quicktime', 'icon'=>'mov', 'groups'=>array('video','web_video'), 'string'=>'video'), + 'ra' => array ('type'=>'audio/x-realaudio-plugin', 'icon'=>'audio', 'groups'=>array('audio','web_audio'), 'string'=>'audio'), + 'ram' => array ('type'=>'audio/x-pn-realaudio-plugin', 'icon'=>'audio', 'groups'=>array('audio'), 'string'=>'audio'), 'rhb' => array ('type'=>'text/xml', 'icon'=>'xml'), - 'rm' => array ('type'=>'audio/x-pn-realaudio-plugin', 'icon'=>'audio'), - 'rmvb' => array ('type'=>'application/vnd.rn-realmedia-vbr', 'icon'=>'video'), - 'rtf' => array ('type'=>'text/rtf', 'icon'=>'text'), + 'rm' => array ('type'=>'audio/x-pn-realaudio-plugin', 'icon'=>'audio', 'groups'=>array('audio'), 'string'=>'audio'), + 'rmvb' => array ('type'=>'application/vnd.rn-realmedia-vbr', 'icon'=>'video', 'groups'=>array('video'), 'string'=>'video'), + 'rtf' => array ('type'=>'text/rtf', 'icon'=>'text', 'groups'=>array('document')), 'rtx' => array ('type'=>'text/richtext', 'icon'=>'text'), - 'rv' => array ('type'=>'audio/x-pn-realaudio-plugin', 'icon'=>'video'), + 'rv' => array ('type'=>'audio/x-pn-realaudio-plugin', 'icon'=>'audio', 'groups'=>array('video'), 'string'=>'video'), 'sh' => array ('type'=>'application/x-sh', 'icon'=>'text'), - 'sit' => array ('type'=>'application/x-stuffit', 'icon'=>'zip'), + 'sit' => array ('type'=>'application/x-stuffit', 'icon'=>'zip', 'groups'=>array('archive'), 'string'=>'archive'), 'smi' => array ('type'=>'application/smil', 'icon'=>'text'), 'smil' => array ('type'=>'application/smil', 'icon'=>'text'), 'sqt' => array ('type'=>'text/xml', 'icon'=>'xml'), - 'svg' => array ('type'=>'image/svg+xml', 'icon'=>'image'), - 'svgz' => array ('type'=>'image/svg+xml', 'icon'=>'image'), + 'svg' => array ('type'=>'image/svg+xml', 'icon'=>'image', 'groups'=>array('image','web_image'), 'string'=>'image'), + 'svgz' => array ('type'=>'image/svg+xml', 'icon'=>'image', 'groups'=>array('image','web_image'), 'string'=>'image'), 'swa' => array ('type'=>'application/x-director', 'icon'=>'flash'), - 'swf' => array ('type'=>'application/x-shockwave-flash', 'icon'=>'flash'), - 'swfl' => array ('type'=>'application/x-shockwave-flash', 'icon'=>'flash'), + 'swf' => array ('type'=>'application/x-shockwave-flash', 'icon'=>'flash', 'groups'=>array('video','web_video')), + 'swfl' => array ('type'=>'application/x-shockwave-flash', 'icon'=>'flash', 'groups'=>array('video','web_video')), 'sxw' => array ('type'=>'application/vnd.sun.xml.writer', 'icon'=>'odt'), 'stw' => array ('type'=>'application/vnd.sun.xml.writer.template', 'icon'=>'odt'), - 'sxc' => array ('type'=>'application/vnd.sun.xml.calc', 'icon'=>'odt'), - 'stc' => array ('type'=>'application/vnd.sun.xml.calc.template', 'icon'=>'odt'), - 'sxd' => array ('type'=>'application/vnd.sun.xml.draw', 'icon'=>'odt'), - 'std' => array ('type'=>'application/vnd.sun.xml.draw.template', 'icon'=>'odt'), - 'sxi' => array ('type'=>'application/vnd.sun.xml.impress', 'icon'=>'odt'), - 'sti' => array ('type'=>'application/vnd.sun.xml.impress.template', 'icon'=>'odt'), + 'sxc' => array ('type'=>'application/vnd.sun.xml.calc', 'icon'=>'ods'), + 'stc' => array ('type'=>'application/vnd.sun.xml.calc.template', 'icon'=>'ods'), + 'sxd' => array ('type'=>'application/vnd.sun.xml.draw', 'icon'=>'odg'), + 'std' => array ('type'=>'application/vnd.sun.xml.draw.template', 'icon'=>'odg'), + 'sxi' => array ('type'=>'application/vnd.sun.xml.impress', 'icon'=>'odp'), + 'sti' => array ('type'=>'application/vnd.sun.xml.impress.template', 'icon'=>'odp'), 'sxg' => array ('type'=>'application/vnd.sun.xml.writer.global', 'icon'=>'odt'), - 'sxm' => array ('type'=>'application/vnd.sun.xml.math', 'icon'=>'odt'), + 'sxm' => array ('type'=>'application/vnd.sun.xml.math', 'icon'=>'odf'), - 'tar' => array ('type'=>'application/x-tar', 'icon'=>'zip'), - 'tif' => array ('type'=>'image/tiff', 'icon'=>'image'), - 'tiff' => array ('type'=>'image/tiff', 'icon'=>'image'), + 'tar' => array ('type'=>'application/x-tar', 'icon'=>'zip', 'groups'=>array('archive'), 'string'=>'archive'), + 'tif' => array ('type'=>'image/tiff', 'icon'=>'tiff', 'groups'=>array('image'), 'string'=>'image'), + 'tiff' => array ('type'=>'image/tiff', 'icon'=>'tiff', 'groups'=>array('image'), 'string'=>'image'), 'tex' => array ('type'=>'application/x-tex', 'icon'=>'text'), 'texi' => array ('type'=>'application/x-texinfo', 'icon'=>'text'), 'texinfo' => array ('type'=>'application/x-texinfo', 'icon'=>'text'), 'tsv' => array ('type'=>'text/tab-separated-values', 'icon'=>'text'), - 'txt' => array ('type'=>'text/plain', 'icon'=>'text'), - 'wav' => array ('type'=>'audio/wav', 'icon'=>'audio'), - 'webm' => array ('type'=>'video/webm', 'icon'=>'video'), - 'wmv' => array ('type'=>'video/x-ms-wmv', 'icon'=>'avi'), - 'asf' => array ('type'=>'video/x-ms-asf', 'icon'=>'avi'), + 'txt' => array ('type'=>'text/plain', 'icon'=>'text', 'defaulticon'=>true), + 'wav' => array ('type'=>'audio/wav', 'icon'=>'wav', 'groups'=>array('audio'), 'string'=>'audio'), + 'webm' => array ('type'=>'video/webm', 'icon'=>'wmv', 'groups'=>array('video'), 'string'=>'video'), + 'wmv' => array ('type'=>'video/x-ms-wmv', 'icon'=>'wmv', 'groups'=>array('video'), 'string'=>'video'), + 'asf' => array ('type'=>'video/x-ms-asf', 'icon'=>'wmv', 'groups'=>array('video'), 'string'=>'video'), 'xdp' => array ('type'=>'application/pdf', 'icon'=>'pdf'), 'xfd' => array ('type'=>'application/pdf', 'icon'=>'pdf'), 'xfdf' => array ('type'=>'application/pdf', 'icon'=>'pdf'), - 'xls' => array ('type'=>'application/vnd.ms-excel', 'icon'=>'excel'), + 'xls' => array ('type'=>'application/vnd.ms-excel', 'icon'=>'xlsx', 'groups'=>array('spreadsheet')), 'xlsx' => array ('type'=>'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'icon'=>'xlsx'), - 'xlsm' => array ('type'=>'application/vnd.ms-excel.sheet.macroEnabled.12', 'icon'=>'xlsm'), - 'xltx' => array ('type'=>'application/vnd.openxmlformats-officedocument.spreadsheetml.template', 'icon'=>'xltx'), - 'xltm' => array ('type'=>'application/vnd.ms-excel.template.macroEnabled.12', 'icon'=>'xltm'), - 'xlsb' => array ('type'=>'application/vnd.ms-excel.sheet.binary.macroEnabled.12', 'icon'=>'xlsb'), - 'xlam' => array ('type'=>'application/vnd.ms-excel.addin.macroEnabled.12', 'icon'=>'xlam'), + 'xlsm' => array ('type'=>'application/vnd.ms-excel.sheet.macroEnabled.12', 'icon'=>'xlsx', 'groups'=>array('spreadsheet')), + 'xltx' => array ('type'=>'application/vnd.openxmlformats-officedocument.spreadsheetml.template', 'icon'=>'xlsx'), + 'xltm' => array ('type'=>'application/vnd.ms-excel.template.macroEnabled.12', 'icon'=>'xlsx'), + 'xlsb' => array ('type'=>'application/vnd.ms-excel.sheet.binary.macroEnabled.12', 'icon'=>'xlsx'), + 'xlam' => array ('type'=>'application/vnd.ms-excel.addin.macroEnabled.12', 'icon'=>'xlsx'), 'xml' => array ('type'=>'application/xml', 'icon'=>'xml'), 'xsl' => array ('type'=>'text/xml', 'icon'=>'xml'), - 'zip' => array ('type'=>'application/zip', 'icon'=>'zip') + 'zip' => array ('type'=>'application/zip', 'icon'=>'zip', 'groups'=>array('archive'), 'string'=>'archive') ); return $mimearray; } @@ -1402,39 +1538,41 @@ function get_mimetypes_array() { * * @category files * @param string $element Desired information (usually 'icon' - * for icon filename or 'type' for MIME type) + * for icon filename or 'type' for MIME type. Can also be + * 'icon24', ...32, 48, 64, 72, 80, 96, 128, 256) * @param string $filename Filename we're looking up * @return string Requested piece of information from array */ function mimeinfo($element, $filename) { global $CFG; - $mimeinfo = get_mimetypes_array(); + $mimeinfo = & get_mimetypes_array(); + static $iconpostfixes = array(256=>'-256', 128=>'-128', 96=>'-96', 80=>'-80', 72=>'-72', 64=>'-64', 48=>'-48', 32=>'-32', 24=>'-24', 16=>''); - if (preg_match('/\.([a-z0-9]+)$/i', $filename, $match)) { - if (isset($mimeinfo[strtolower($match[1])][$element])) { - return $mimeinfo[strtolower($match[1])][$element]; - } else { - if ($element == 'icon32') { - if (isset($mimeinfo[strtolower($match[1])]['icon'])) { - $filename = $mimeinfo[strtolower($match[1])]['icon']; - } else { - $filename = 'unknown'; + $filetype = strtolower(pathinfo($filename, PATHINFO_EXTENSION)); + if (empty($filetype)) { + $filetype = 'xxx'; // file without extension + } + if (preg_match('/^icon(\d*)$/', $element, $iconsizematch)) { + $iconsize = max(array(16, (int)$iconsizematch[1])); + $filenames = array($mimeinfo['xxx']['icon']); + if ($filetype != 'xxx' && isset($mimeinfo[$filetype]['icon'])) { + array_unshift($filenames, $mimeinfo[$filetype]['icon']); + } + // find the file with the closest size, first search for specific icon then for default icon + foreach ($filenames as $filename) { + foreach ($iconpostfixes as $size => $postfix) { + $fullname = $CFG->dirroot.'/pix/f/'.$filename.$postfix; + if ($iconsize >= $size && (file_exists($fullname.'.png') || file_exists($fullname.'.gif'))) { + return $filename.$postfix; } - $filename .= '-32'; - if (file_exists($CFG->dirroot.'/pix/f/'.$filename.'.png') or file_exists($CFG->dirroot.'/pix/f/'.$filename.'.gif')) { - return $filename; - } else { - return 'unknown-32'; - } - } else { - return $mimeinfo['xxx'][$element]; // By default } } - } else { - if ($element == 'icon32') { - return 'unknown-32'; - } + } else if (isset($mimeinfo[$filetype][$element])) { + return $mimeinfo[$filetype][$element]; + } else if (isset($mimeinfo['xxx'][$element])) { return $mimeinfo['xxx'][$element]; // By default + } else { + return null; } } @@ -1443,66 +1581,120 @@ function mimeinfo($element, $filename) { * the other way around. * * @category files - * @param string $element Desired information (usually 'icon') + * @param string $element Desired information ('extension', 'icon', 'icon-24', etc.) * @param string $mimetype MIME type we're looking up * @return string Requested piece of information from array */ function mimeinfo_from_type($element, $mimetype) { - $mimeinfo = get_mimetypes_array(); + /* array of cached mimetype->extension associations */ + static $cached = array(); + $mimeinfo = & get_mimetypes_array(); - foreach($mimeinfo as $values) { - if ($values['type']==$mimetype) { - if (isset($values[$element])) { - return $values[$element]; + if (!array_key_exists($mimetype, $cached)) { + $cached[$mimetype] = null; + foreach($mimeinfo as $filetype => $values) { + if ($values['type'] == $mimetype) { + if ($cached[$mimetype] === null) { + $cached[$mimetype] = '.'.$filetype; + } + if (!empty($values['defaulticon'])) { + $cached[$mimetype] = '.'.$filetype; + break; + } } - break; + } + if (empty($cached[$mimetype])) { + $cached[$mimetype] = '.xxx'; } } - return $mimeinfo['xxx'][$element]; // Default + if ($element === 'extension') { + return $cached[$mimetype]; + } else { + return mimeinfo($element, $cached[$mimetype]); + } } /** - * Get information about a filetype based on the icon file. + * Return the relative icon path for a given file * - * @category files - * @param string $element Desired information (usually 'icon') - * @param string $icon Icon file name without extension - * @param bool $all return all matching entries (defaults to false - best (by ext)/last match) - * @return string Requested piece of information from array + * Usage: + * + * // $file - instance of stored_file or file_info + * $icon = $OUTPUT->pix_url(file_file_icon($file))->out(); + * echo html_writer::empty_tag('img', array('src' => $icon, 'alt' => get_mimetype_description($file))); + * + * or + * + * echo $OUTPUT->pix_icon(file_file_icon($file), get_mimetype_description($file)); + * + * + * @param stored_file|file_info|stdClass|array $file (in case of object attributes $file->filename + * and $file->mimetype are expected) + * @param int $size The size of the icon. Defaults to 16 can also be 24, 32, 64, 128, 256 + * @return string */ -function mimeinfo_from_icon($element, $icon, $all=false) { - $mimeinfo = get_mimetypes_array(); +function file_file_icon($file, $size = null) { + if (!is_object($file)) { + $file = (object)$file; + } + if (isset($file->filename)) { + $filename = $file->filename; + } else if (method_exists($file, 'get_filename')) { + $filename = $file->get_filename(); + } else if (method_exists($file, 'get_visible_name')) { + $filename = $file->get_visible_name(); + } else { + $filename = ''; + } + if (isset($file->mimetype)) { + $mimetype = $file->mimetype; + } else if (method_exists($file, 'get_mimetype')) { + $mimetype = $file->get_mimetype(); + } else { + $mimetype = ''; + } + $mimetypes = &get_mimetypes_array(); + if ($filename) { + $extension = strtolower(pathinfo($filename, PATHINFO_EXTENSION)); + if ($extension && !empty($mimetypes[$extension])) { + // if file name has known extension, return icon for this extension + return file_extension_icon($filename, $size); + } + } + return file_mimetype_icon($mimetype, $size); +} - if (preg_match("/\/(.*)/", $icon, $matches)) { - $icon = $matches[1]; - } - // Try to get the extension - $extension = ''; - if (($cutat = strrpos($icon, '.')) !== false && $cutat < strlen($icon)-1) { - $extension = substr($icon, $cutat + 1); - } - $info = array($mimeinfo['xxx'][$element]); // Default - foreach($mimeinfo as $key => $values) { - if ($values['icon']==$icon) { - if (isset($values[$element])) { - $info[$key] = $values[$element]; +/** + * Return the relative icon path for a folder image + * + * Usage: + * + * $icon = $OUTPUT->pix_url(file_folder_icon())->out(); + * echo html_writer::empty_tag('img', array('src' => $icon)); + * + * or + * + * echo $OUTPUT->pix_icon(file_folder_icon(32)); + * + * + * @param int $iconsize The size of the icon. Defaults to 16 can also be 24, 32, 48, 64, 72, 80, 96, 128, 256 + * @return string + */ +function file_folder_icon($iconsize = null) { + global $CFG; + static $iconpostfixes = array(256=>'-256', 128=>'-128', 96=>'-96', 80=>'-80', 72=>'-72', 64=>'-64', 48=>'-48', 32=>'-32', 24=>'-24', 16=>''); + static $cached = array(); + $iconsize = max(array(16, (int)$iconsize)); + if (!array_key_exists($iconsize, $cached)) { + foreach ($iconpostfixes as $size => $postfix) { + $fullname = $CFG->dirroot.'/pix/f/folder'.$postfix; + if ($iconsize >= $size && (file_exists($fullname.'.png') || file_exists($fullname.'.gif'))) { + $cached[$iconsize] = 'f/folder'.$postfix; + break; } - //No break, for example for 'excel' we don't want 'csv'! } } - if ($all) { - if (count($info) > 1) { - array_shift($info); // take off document/unknown if we have better options - } - return array_values($info); // Keep keys out when requesting all - } - - // Requested only one, try to get the best by extension coincidence, else return the last - if ($extension && isset($info[$extension])) { - return $info[$extension]; - } - - return array_pop($info); // Return last match (mimicking behaviour/comment inside foreach loop) + return $cached[$iconsize]; } /** @@ -1513,27 +1705,19 @@ function mimeinfo_from_icon($element, $icon, $all=false) { * * * $mimetype = 'image/jpg'; - * $icon = $OUTPUT->pix_url(file_mimetype_icon($mimetype)); - * echo ''.$mimetype.''; + * $icon = $OUTPUT->pix_url(file_mimetype_icon($mimetype))->out(); + * echo html_writer::empty_tag('img', array('src' => $icon, 'alt' => get_mimetype_description($mimetype))); * * * @category files * @todo MDL-31074 When an $OUTPUT->icon method is available this function should be altered * to conform with that. * @param string $mimetype The mimetype to fetch an icon for - * @param int $size The size of the icon. Not yet implemented + * @param int $size The size of the icon. Defaults to 16 can also be 24, 32, 64, 128, 256 * @return string The relative path to the icon */ function file_mimetype_icon($mimetype, $size = NULL) { - global $CFG; - - $icon = mimeinfo_from_type('icon', $mimetype); - if ($size) { - if (file_exists("$CFG->dirroot/pix/f/$icon-$size.png") or file_exists("$CFG->dirroot/pix/f/$icon-$size.gif")) { - $icon = "$icon-$size"; - } - } - return 'f/'.$icon; + return 'f/'.mimeinfo_from_type('icon'.$size, $mimetype); } /** @@ -1543,9 +1727,9 @@ function file_mimetype_icon($mimetype, $size = NULL) { * a return the full path to an icon. * * - * $filename = 'jpg'; - * $icon = $OUTPUT->pix_url(file_extension_icon($filename)); - * echo 'blah'; + * $filename = '.jpg'; + * $icon = $OUTPUT->pix_url(file_extension_icon($filename))->out(); + * echo html_writer::empty_tag('img', array('src' => $icon, 'alt' => '...')); * * * @todo MDL-31074 When an $OUTPUT->icon method is available this function should be altered @@ -1553,34 +1737,78 @@ function file_mimetype_icon($mimetype, $size = NULL) { * @todo MDL-31074 Implement $size * @category files * @param string $filename The filename to get the icon for - * @param int $size The size of the icon. Defaults to null can also be 32 + * @param int $size The size of the icon. Defaults to 16 can also be 24, 32, 64, 128, 256 * @return string */ function file_extension_icon($filename, $size = NULL) { - global $CFG; - - $icon = mimeinfo('icon', $filename); - if ($size) { - if (file_exists("$CFG->dirroot/pix/f/$icon-$size.png") or file_exists("$CFG->dirroot/pix/f/$icon-$size.gif")) { - $icon = "$icon-$size"; - } - } - return 'f/'.$icon; + return 'f/'.mimeinfo('icon'.$size, $filename); } /** * Obtains descriptions for file types (e.g. 'Microsoft Word document') from the * mimetypes.php language file. * - * @param string $mimetype MIME type (can be obtained using the mimeinfo function) + * @param mixed $obj - instance of stored_file or file_info or array/stdClass with field + * 'filename' and 'mimetype', or just a string with mimetype (though it is recommended to + * have filename); In case of array/stdClass the field 'mimetype' is optional. * @param bool $capitalise If true, capitalises first character of result * @return string Text description */ -function get_mimetype_description($mimetype, $capitalise=false) { - if (get_string_manager()->string_exists($mimetype, 'mimetypes')) { - $result = get_string($mimetype, 'mimetypes'); +function get_mimetype_description($obj, $capitalise=false) { + $filename = $mimetype = ''; + if (is_object($obj) && method_exists($obj, 'get_filename') && method_exists($obj, 'get_mimetype')) { + // this is an instance of stored_file + $mimetype = $obj->get_mimetype(); + $filename = $obj->get_filename(); + } else if (is_object($obj) && method_exists($obj, 'get_visible_name') && method_exists($obj, 'get_mimetype')) { + // this is an instance of file_info + $mimetype = $obj->get_mimetype(); + $filename = $obj->get_visible_name(); + } else if (is_array($obj) || is_object ($obj)) { + $obj = (array)$obj; + if (!empty($obj['filename'])) { + $filename = $obj['filename']; + } + if (!empty($obj['mimetype'])) { + $mimetype = $obj['mimetype']; + } } else { - $result = get_string('document/unknown','mimetypes'); + $mimetype = $obj; + } + $mimetypefromext = mimeinfo('type', $filename); + if (empty($mimetype) || $mimetypefromext !== 'document/unknown') { + // if file has a known extension, overwrite the specified mimetype + $mimetype = $mimetypefromext; + } + $extension = strtolower(pathinfo($filename, PATHINFO_EXTENSION)); + if (empty($extension)) { + $mimetypestr = mimeinfo_from_type('string', $mimetype); + $extension = str_replace('.', '', mimeinfo_from_type('extension', $mimetype)); + } else { + $mimetypestr = mimeinfo('string', $filename); + } + $chunks = explode('/', $mimetype, 2); + $chunks[] = ''; + $attr = array( + 'mimetype' => $mimetype, + 'ext' => $extension, + 'mimetype1' => $chunks[0], + 'mimetype2' => $chunks[1], + ); + $a = array(); + foreach ($attr as $key => $value) { + $a[$key] = $value; + $a[strtoupper($key)] = strtoupper($value); + $a[ucfirst($key)] = ucfirst($value); + } + if (get_string_manager()->string_exists($mimetype, 'mimetypes')) { + $result = get_string($mimetype, 'mimetypes', (object)$a); + } else if (get_string_manager()->string_exists($mimetypestr, 'mimetypes')) { + $result = get_string($mimetypestr, 'mimetypes', (object)$a); + } else if (get_string_manager()->string_exists('default', 'mimetypes')) { + $result = get_string('default', 'mimetypes', (object)$a); + } else { + $result = $mimetype; } if ($capitalise) { $result=ucfirst($result); @@ -1588,6 +1816,74 @@ function get_mimetype_description($mimetype, $capitalise=false) { return $result; } +/** + * Returns array of elements of type $element in type group(s) + * + * @param string $element name of the element we are interested in, usually 'type' or 'extension' + * @param string|array $groups one group or array of groups/extensions/mimetypes + * @return array + */ +function file_get_typegroup($element, $groups) { + static $cached = array(); + if (!is_array($groups)) { + $groups = array($groups); + } + if (!array_key_exists($element, $cached)) { + $cached[$element] = array(); + } + $result = array(); + foreach ($groups as $group) { + if (!array_key_exists($group, $cached[$element])) { + // retrieive and cache all elements of type $element for group $group + $mimeinfo = & get_mimetypes_array(); + $cached[$element][$group] = array(); + foreach ($mimeinfo as $extension => $value) { + $value['extension'] = '.'.$extension; + if (empty($value[$element])) { + continue; + } + if (($group === '.'.$extension || $group === $value['type'] || + (!empty($value['groups']) && in_array($group, $value['groups']))) && + !in_array($value[$element], $cached[$element][$group])) { + $cached[$element][$group][] = $value[$element]; + } + } + } + $result = array_merge($result, $cached[$element][$group]); + } + return array_unique($result); +} + +/** + * Checks if file with name $filename has one of the extensions in groups $groups + * + * @see get_mimetypes_array() + * @param string $filename name of the file to check + * @param string|array $groups one group or array of groups to check + * @param bool $checktype if true and extension check fails, find the mimetype and check if + * file mimetype is in mimetypes in groups $groups + * @return bool + */ +function file_extension_in_typegroup($filename, $groups, $checktype = false) { + $extension = pathinfo($filename, PATHINFO_EXTENSION); + if (!empty($extension) && in_array('.'.strtolower($extension), file_get_typegroup('extension', $groups))) { + return true; + } + return $checktype && file_mimetype_in_typegroup(mimeinfo('type', $filename), $groups); +} + +/** + * Checks if mimetype $mimetype belongs to one of the groups $groups + * + * @see get_mimetypes_array() + * @param string $mimetype + * @param string|array $groups one group or array of groups to check + * @return bool + */ +function file_mimetype_in_typegroup($mimetype, $groups) { + return !empty($mimetype) && in_array($mimetype, file_get_typegroup('type', $groups)); +} + /** * Requested file is not found or not accessible, does not return, terminates script * @@ -1991,20 +2287,34 @@ function send_stored_file($stored_file, $lifetime=86400 , $filter=0, $forcedownl if (!empty($options['preview'])) { // replace the file with its preview $fs = get_file_storage(); - $stored_file = $fs->get_file_preview($stored_file, $options['preview']); - if (!$stored_file) { - // unable to create a preview of the file - send_header_404(); - die(); + $preview_file = $fs->get_file_preview($stored_file, $options['preview']); + if (!$preview_file) { + // unable to create a preview of the file, send its default mime icon instead + if ($options['preview'] === 'tinyicon') { + $size = 24; + } else if ($options['preview'] === 'thumb') { + $size = 90; + } else { + $size = 256; + } + $fileicon = file_file_icon($stored_file, $size); + send_file($CFG->dirroot.'/pix/'.$fileicon.'.png', basename($fileicon).'.png'); } else { // preview images have fixed cache lifetime and they ignore forced download // (they are generated by GD and therefore they are considered reasonably safe). + $stored_file = $preview_file; $lifetime = DAYSECS; $filter = 0; $forcedownload = false; } } + // handle external resource + if ($stored_file->is_external_file()) { + $stored_file->send_file($lifetime, $filter, $forcedownload, $options); + die; + } + if (!$stored_file or $stored_file->is_directory()) { // nothing to serve if ($dontdie) { @@ -2943,7 +3253,7 @@ class curl_cache { * @global stdClass $CFG * @param string $module which module is using curl_cache */ - function __construct($module = 'repository'){ + public function __construct($module = 'repository') { global $CFG; if (!empty($module)) { $this->dir = $CFG->cachedir.'/'.$module.'/'; @@ -2974,14 +3284,13 @@ class curl_cache { * @param mixed $param * @return bool|string */ - public function get($param){ + public function get($param) { global $CFG, $USER; $this->cleanup($this->ttl); $filename = 'u'.$USER->id.'_'.md5(serialize($param)); if(file_exists($this->dir.$filename)) { $lasttime = filemtime($this->dir.$filename); - if(time()-$lasttime > $this->ttl) - { + if (time()-$lasttime > $this->ttl) { return false; } else { $fp = fopen($this->dir.$filename, 'r'); @@ -3001,7 +3310,7 @@ class curl_cache { * @param mixed $param * @param mixed $val */ - public function set($param, $val){ + public function set($param, $val) { global $CFG, $USER; $filename = 'u'.$USER->id.'_'.md5(serialize($param)); $fp = fopen($this->dir.$filename, 'w'); @@ -3012,18 +3321,19 @@ class curl_cache { /** * Remove cache files * - * @param int $expire The number os seconds before expiry + * @param int $expire The number of seconds before expiry */ - public function cleanup($expire){ - if($dir = opendir($this->dir)){ + public function cleanup($expire) { + if ($dir = opendir($this->dir)) { while (false !== ($file = readdir($dir))) { if(!is_dir($file) && $file != '.' && $file != '..') { $lasttime = @filemtime($this->dir.$file); - if(time() - $lasttime > $expire){ + if (time() - $lasttime > $expire) { @unlink($this->dir.$file); } } } + closedir($dir); } } /** @@ -3032,12 +3342,12 @@ class curl_cache { * @global object $CFG * @global object $USER */ - public function refresh(){ + public function refresh() { global $CFG, $USER; - if($dir = opendir($this->dir)){ + if ($dir = opendir($this->dir)) { while (false !== ($file = readdir($dir))) { - if(!is_dir($file) && $file != '.' && $file != '..') { - if(strpos($file, 'u'.$USER->id.'_')!==false){ + if (!is_dir($file) && $file != '.' && $file != '..') { + if (strpos($file, 'u'.$USER->id.'_') !== false) { @unlink($this->dir.$file); } } @@ -3046,109 +3356,6 @@ class curl_cache { } } -/** - * This class is used to parse lib/file/file_types.mm which help get file extensions by file types. - * - * The file_types.mm file can be edited by freemind in graphic environment. - * - * @package core_files - * @category files - * @copyright 2009 Dongsheng Cai - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - */ -class filetype_parser { - /** - * Check file_types.mm file, setup variables - * - * @global stdClass $CFG - * @param string $file - */ - public function __construct($file = '') { - global $CFG; - if (empty($file)) { - $this->file = $CFG->libdir.'/filestorage/file_types.mm'; - } else { - $this->file = $file; - } - $this->tree = array(); - $this->result = array(); - } - - /** - * A private function to browse xml nodes - * - * @param array $parent - * @param array $types - */ - private function _browse_nodes($parent, $types) { - $key = (string)$parent['TEXT']; - if(isset($parent->node)) { - $this->tree[$key] = array(); - if (in_array((string)$parent['TEXT'], $types)) { - $this->_select_nodes($parent, $this->result); - } else { - foreach($parent->node as $v){ - $this->_browse_nodes($v, $types); - } - } - } else { - $this->tree[] = $key; - } - } - - /** - * A private function to select text nodes - * - * @param array $parent - */ - private function _select_nodes($parent){ - if(isset($parent->node)) { - foreach($parent->node as $v){ - $this->_select_nodes($v, $this->result); - } - } else { - $this->result[] = (string)$parent['TEXT']; - } - } - - - /** - * Get file extensions by file types names. - * - * @param array $types - * @return mixed - */ - public function get_extensions($types) { - if (!is_array($types)) { - $types = array($types); - } - $this->result = array(); - if ((is_array($types) && in_array('*', $types)) || - $types == '*' || empty($types)) { - return array('*'); - } - foreach ($types as $key=>$value){ - if (strpos($value, '.') !== false) { - $this->result[] = $value; - unset($types[$key]); - } - } - if (file_exists($this->file)) { - $xml = simplexml_load_file($this->file); - foreach($xml->node->node as $v){ - if (in_array((string)$v['TEXT'], $types)) { - $this->_select_nodes($v); - } else { - $this->_browse_nodes($v, $types); - } - } - } else { - exit('Failed to open file lib/filestorage/file_types.mm'); - } - return $this->result; - } -} - /** * This function delegates file serving to individual plugins * @@ -3413,7 +3620,7 @@ function file_pluginfile($relativepath, $forcedownload, $preview = null) { } // fix file name automatically - if ($filename !== 'f1' and $filename !== 'f2') { + if ($filename !== 'f1' and $filename !== 'f2' and $filename !== 'f3') { $filename = 'f1'; } @@ -3426,20 +3633,28 @@ function file_pluginfile($relativepath, $forcedownload, $preview = null) { redirect($theme->pix_url('u/'.$filename, 'moodle')); // intentionally not cached } - if (!$file = $fs->get_file($context->id, 'user', 'icon', 0, '/', $filename.'/.png')) { - if (!$file = $fs->get_file($context->id, 'user', 'icon', 0, '/', $filename.'/.jpg')) { - // bad reference - try to prevent future retries as hard as possible! - if ($user = $DB->get_record('user', array('id'=>$context->instanceid), 'id, picture')) { - if ($user->picture == 1 or $user->picture > 10) { - $DB->set_field('user', 'picture', 0, array('id'=>$user->id)); + if (!$file = $fs->get_file($context->id, 'user', 'icon', 0, '/', $filename.'.png')) { + if (!$file = $fs->get_file($context->id, 'user', 'icon', 0, '/', $filename.'.jpg')) { + if ($filename === 'f3') { + // f3 512x512px was introduced in 2.3, there might be only the smaller version. + if (!$file = $fs->get_file($context->id, 'user', 'icon', 0, '/', 'f1.png')) { + $file = $fs->get_file($context->id, 'user', 'icon', 0, '/', 'f1.jpg'); } } - // no redirect here because it is not cached - $theme = theme_config::load($themename); - $imagefile = $theme->resolve_image_location('u/'.$filename, 'moodle'); - send_file($imagefile, basename($imagefile), 60*60*24*14); } } + if (!$file) { + // bad reference - try to prevent future retries as hard as possible! + if ($user = $DB->get_record('user', array('id'=>$context->instanceid), 'id, picture')) { + if ($user->picture > 0) { + $DB->set_field('user', 'picture', 0, array('id'=>$user->id)); + } + } + // no redirect here because it is not cached + $theme = theme_config::load($themename); + $imagefile = $theme->resolve_image_location('u/'.$filename, 'moodle'); + send_file($imagefile, basename($imagefile), 60*60*24*14); + } send_stored_file($file, 60*60*24*365, 0, false, array('preview' => $preview)); // enable long caching, there are many images on each page @@ -3888,6 +4103,12 @@ function file_pluginfile($relativepath, $forcedownload, $preview = null) { // somebody tries to gain illegal access, cm type must match the component! send_file_not_found(); } + + $bprecord = $DB->get_record('block_positions', array('blockinstanceid' => $context->instanceid), 'visible'); + // User can't access file, if block is hidden or doesn't have block:view capability + if (($bprecord && !$bprecord->visible) || !has_capability('moodle/block:view', $context)) { + send_file_not_found(); + } } else { $birecord = null; } @@ -3923,3 +4144,170 @@ function file_pluginfile($relativepath, $forcedownload, $preview = null) { } } + +/** + * Universe file cacheing class + * + * @package core_files + * @category files + * @copyright 2012 Dongsheng Cai {@link http://dongsheng.org} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +class cache_file { + /** @var string */ + public $cachedir = ''; + + /** + * static method to create cache_file class instance + * + * @param array $options caching ooptions + */ + public static function get_instance($options = array()) { + return new cache_file($options); + } + + /** + * Constructor + * + * @param array $options + */ + private function __construct($options = array()) { + global $CFG; + + // Path to file caches. + if (isset($options['cachedir'])) { + $this->cachedir = $options['cachedir']; + } else { + $this->cachedir = $CFG->cachedir . '/filedir'; + } + + // Create cache directory. + if (!file_exists($this->cachedir)) { + mkdir($this->cachedir, $CFG->directorypermissions, true); + } + + // When use cache_file::get, it will check ttl. + if (isset($options['ttl']) && is_numeric($options['ttl'])) { + $this->ttl = $options['ttl']; + } else { + // One day. + $this->ttl = 60 * 60 * 24; + } + } + + /** + * Get cached file, false if file expires + * + * @param mixed $param + * @param array $options caching options + * @return bool|string + */ + public static function get($param, $options = array()) { + $instance = self::get_instance($options); + $filepath = $instance->generate_filepath($param); + if (file_exists($filepath)) { + $lasttime = filemtime($filepath); + if (time() - $lasttime > $instance->ttl) { + // Remove cache file. + unlink($filepath); + return false; + } else { + return $filepath; + } + } else { + return false; + } + } + + /** + * Static method to create cache from a file + * + * @param mixed $ref + * @param string $srcfile + * @param array $options + * @return string cached file path + */ + public static function create_from_file($ref, $srcfile, $options = array()) { + $instance = self::get_instance($options); + $cachedfilepath = $instance->generate_filepath($ref); + copy($srcfile, $cachedfilepath); + return $cachedfilepath; + } + + /** + * Static method to create cache from url + * + * @param mixed $ref file reference + * @param string $url file url + * @param array $options options + * @return string cached file path + */ + public static function create_from_url($ref, $url, $options = array()) { + $instance = self::get_instance($options); + $cachedfilepath = $instance->generate_filepath($ref); + $fp = fopen($cachedfilepath, 'w'); + $curl = new curl; + $curl->download(array(array('url'=>$url, 'file'=>$fp))); + // Must close file handler. + fclose($fp); + return $cachedfilepath; + } + + /** + * Static method to create cache from string + * + * @param mixed $ref file reference + * @param string $url file url + * @param array $options options + * @return string cached file path + */ + public static function create_from_string($ref, $string, $options = array()) { + $instance = self::get_instance($options); + $cachedfilepath = $instance->generate_filepath($ref); + $fp = fopen($cachedfilepath, 'w'); + fwrite($fp, $string); + // Must close file handler. + fclose($fp); + return $cachedfilepath; + } + + /** + * Build path to cache file + * + * @param mixed $ref + * @return string + */ + private function generate_filepath($ref) { + global $CFG; + $hash = sha1(serialize($ref)); + $l1 = $hash[0].$hash[1]; + $l2 = $hash[2].$hash[3]; + $dir = $this->cachedir . "/$l1/$l2"; + if (!file_exists($dir)) { + mkdir($dir, $CFG->directorypermissions, true); + } + return "$dir/$hash"; + } + + /** + * Remove cache files + * + * @param array $options options + * @param int $expire The number of seconds before expiry + */ + public static function cleanup($options = array(), $expire) { + global $CFG; + $instance = self::get_instance($options); + if ($dir = opendir($instance->cachedir)) { + while (($file = readdir($dir)) !== false) { + if (!is_dir($file) && $file != '.' && $file != '..') { + $lasttime = @filemtime($instance->cachedir . $file); + if(time() - $lasttime > $expire){ + @unlink($instance->cachedir . $file); + } + } + } + closedir($dir); + } + } +} diff --git a/lib/filestorage/file_exceptions.php b/lib/filestorage/file_exceptions.php index 93eef5b0164..68c01de2e39 100644 --- a/lib/filestorage/file_exceptions.php +++ b/lib/filestorage/file_exceptions.php @@ -65,7 +65,7 @@ class stored_file_creation_exception extends file_exception { * @param string $filename file name * @param string $debuginfo extra debug info */ - function __construct($contextid, $component, $filearea, $itemid, $filepath, $filename, $debuginfo = NULL) { + function __construct($contextid, $component, $filearea, $itemid, $filepath, $filename, $debuginfo = null) { $a = new stdClass(); $a->contextid = $contextid; $a->component = $component; @@ -91,8 +91,8 @@ class file_access_exception extends file_exception { * * @param string $debuginfo extra debug info */ - function __construct($debuginfo = NULL) { - parent::__construct('nopermissions', NULL, $debuginfo); + public function __construct($debuginfo = null) { + parent::__construct('nopermissions', null, $debuginfo); } } @@ -111,7 +111,28 @@ class file_pool_content_exception extends file_exception { * @param string $contenthash content hash * @param string $debuginfo extra debug info */ - function __construct($contenthash, $debuginfo = NULL) { + public function __construct($contenthash, $debuginfo = null) { parent::__construct('hashpoolproblem', $contenthash, $debuginfo); } } + +/** + * Exception related to external file support + * + * @package core_files + * @category files + * @copyright 2012 Dongsheng Cai {@link http://dongsheng.org} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +class external_file_exception extends file_exception { + /** + * Constructor + * + * @param string $errorcode error code + * @param stdClass $a extra information + * @param string $debuginfo extra debug info + */ + public function __construct($errorcode, $a = null, $debuginfo = null) { + parent::__construct($errorcode, '', '', $a, $debuginfo); + } +} diff --git a/lib/filestorage/file_storage.php b/lib/filestorage/file_storage.php index 9855a6d0973..d5ce7c150f2 100644 --- a/lib/filestorage/file_storage.php +++ b/lib/filestorage/file_storage.php @@ -145,11 +145,12 @@ class file_storage { /** * Create instance of file class from database record. * - * @param stdClass $file_record record from the files table + * @param stdClass $filerecord record from the files table left join files_reference table * @return stored_file instance of file abstraction class */ - public function get_file_instance(stdClass $file_record) { - return new stored_file($this, $file_record, $this->filedir); + public function get_file_instance(stdClass $filerecord) { + $storedfile = new stored_file($this, $filerecord, $this->filedir); + return $storedfile; } /** @@ -245,7 +246,7 @@ class file_storage { $file->copy_content_to($tmpfilepath); if ($mode === 'tinyicon') { - $data = generate_image_thumbnail($tmpfilepath, 16, 16); + $data = generate_image_thumbnail($tmpfilepath, 24, 24); } else if ($mode === 'thumb') { $data = generate_image_thumbnail($tmpfilepath, 90, 90); @@ -271,8 +272,13 @@ class file_storage { public function get_file_by_id($fileid) { global $DB; - if ($file_record = $DB->get_record('files', array('id'=>$fileid))) { - return $this->get_file_instance($file_record); + $sql = "SELECT ".self::instance_sql_fields('f', 'r')." + FROM {files} f + LEFT JOIN {files_reference} r + ON f.referencefileid = r.id + WHERE f.id = ?"; + if ($filerecord = $DB->get_record_sql($sql, array($fileid))) { + return $this->get_file_instance($filerecord); } else { return false; } @@ -287,8 +293,13 @@ class file_storage { public function get_file_by_hash($pathnamehash) { global $DB; - if ($file_record = $DB->get_record('files', array('pathnamehash'=>$pathnamehash))) { - return $this->get_file_instance($file_record); + $sql = "SELECT ".self::instance_sql_fields('f', 'r')." + FROM {files} f + LEFT JOIN {files_reference} r + ON f.referencefileid = r.id + WHERE f.pathnamehash = ?"; + if ($filerecord = $DB->get_record_sql($sql, array($pathnamehash))) { + return $this->get_file_instance($filerecord); } else { return false; } @@ -351,6 +362,31 @@ class file_storage { return !$DB->record_exists_sql($sql, $params); } + /** + * Returns all files belonging to given repository + * + * @param int $repositoryid + * @param string $sort A fragment of SQL to use for sorting + */ + public function get_external_files($repositoryid, $sort = 'sortorder, itemid, filepath, filename') { + global $DB; + $sql = "SELECT ".self::instance_sql_fields('f', 'r')." + FROM {files} f + LEFT JOIN {files_reference} r + ON f.referencefileid = r.id + WHERE r.repositoryid = ?"; + if (!empty($sort)) { + $sql .= " ORDER BY {$sort}"; + } + + $result = array(); + $filerecords = $DB->get_records_sql($sql, array($repositoryid)); + foreach ($filerecords as $filerecord) { + $result[$filerecord->pathnamehash] = $this->get_file_instance($filerecord); + } + return $result; + } + /** * Returns all area files (optionally limited by itemid) * @@ -358,25 +394,40 @@ class file_storage { * @param string $component component * @param string $filearea file area * @param int $itemid item ID or all files if not specified - * @param string $sort sort fields + * @param string $sort A fragment of SQL to use for sorting * @param bool $includedirs whether or not include directories * @return array of stored_files indexed by pathanmehash */ - public function get_area_files($contextid, $component, $filearea, $itemid = false, $sort="sortorder, itemid, filepath, filename", $includedirs = true) { + public function get_area_files($contextid, $component, $filearea, $itemid = false, $sort = "sortorder, itemid, filepath, filename", $includedirs = true) { global $DB; $conditions = array('contextid'=>$contextid, 'component'=>$component, 'filearea'=>$filearea); if ($itemid !== false) { + $itemidsql = ' AND f.itemid = :itemid '; $conditions['itemid'] = $itemid; + } else { + $itemidsql = ''; + } + + $sql = "SELECT ".self::instance_sql_fields('f', 'r')." + FROM {files} f + LEFT JOIN {files_reference} r + ON f.referencefileid = r.id + WHERE f.contextid = :contextid + AND f.component = :component + AND f.filearea = :filearea + $itemidsql"; + if (!empty($sort)) { + $sql .= " ORDER BY {$sort}"; } $result = array(); - $file_records = $DB->get_records('files', $conditions, $sort); - foreach ($file_records as $file_record) { - if (!$includedirs and $file_record->filename === '.') { + $filerecords = $DB->get_records_sql($sql, $conditions); + foreach ($filerecords as $filerecord) { + if (!$includedirs and $filerecord->filename === '.') { continue; } - $result[$file_record->pathnamehash] = $this->get_file_instance($file_record); + $result[$filerecord->pathnamehash] = $this->get_file_instance($filerecord); } return $result; } @@ -442,7 +493,7 @@ class file_storage { * @param int $filepath directory path * @param bool $recursive include all subdirectories * @param bool $includedirs include files and directories - * @param string $sort sort fields + * @param string $sort A fragment of SQL to use for sorting * @return array of stored_files indexed by pathanmehash */ public function get_directory_files($contextid, $component, $filearea, $itemid, $filepath, $recursive = false, $includedirs = true, $sort = "filepath, filename") { @@ -452,28 +503,32 @@ class file_storage { return array(); } + $orderby = (!empty($sort)) ? " ORDER BY {$sort}" : ''; + if ($recursive) { $dirs = $includedirs ? "" : "AND filename <> '.'"; $length = textlib::strlen($filepath); - $sql = "SELECT * - FROM {files} - WHERE contextid = :contextid AND component = :component AND filearea = :filearea AND itemid = :itemid - AND ".$DB->sql_substr("filepath", 1, $length)." = :filepath - AND id <> :dirid + $sql = "SELECT ".self::instance_sql_fields('f', 'r')." + FROM {files} f + LEFT JOIN {files_reference} r + ON f.referencefileid = r.id + WHERE f.contextid = :contextid AND f.component = :component AND f.filearea = :filearea AND f.itemid = :itemid + AND ".$DB->sql_substr("f.filepath", 1, $length)." = :filepath + AND f.id <> :dirid $dirs - ORDER BY $sort"; + $orderby"; $params = array('contextid'=>$contextid, 'component'=>$component, 'filearea'=>$filearea, 'itemid'=>$itemid, 'filepath'=>$filepath, 'dirid'=>$directory->get_id()); $files = array(); $dirs = array(); - $file_records = $DB->get_records_sql($sql, $params); - foreach ($file_records as $file_record) { - if ($file_record->filename == '.') { - $dirs[$file_record->pathnamehash] = $this->get_file_instance($file_record); + $filerecords = $DB->get_records_sql($sql, $params); + foreach ($filerecords as $filerecord) { + if ($filerecord->filename == '.') { + $dirs[$filerecord->pathnamehash] = $this->get_file_instance($filerecord); } else { - $files[$file_record->pathnamehash] = $this->get_file_instance($file_record); + $files[$filerecord->pathnamehash] = $this->get_file_instance($filerecord); } } $result = array_merge($dirs, $files); @@ -485,32 +540,36 @@ class file_storage { $length = textlib::strlen($filepath); if ($includedirs) { - $sql = "SELECT * - FROM {files} - WHERE contextid = :contextid AND component = :component AND filearea = :filearea - AND itemid = :itemid AND filename = '.' - AND ".$DB->sql_substr("filepath", 1, $length)." = :filepath - AND id <> :dirid - ORDER BY $sort"; + $sql = "SELECT ".self::instance_sql_fields('f', 'r')." + FROM {files} f + LEFT JOIN {files_reference} r + ON f.referencefileid = r.id + WHERE f.contextid = :contextid AND f.component = :component AND f.filearea = :filearea + AND f.itemid = :itemid AND f.filename = '.' + AND ".$DB->sql_substr("f.filepath", 1, $length)." = :filepath + AND f.id <> :dirid + $orderby"; $reqlevel = substr_count($filepath, '/') + 1; - $file_records = $DB->get_records_sql($sql, $params); - foreach ($file_records as $file_record) { - if (substr_count($file_record->filepath, '/') !== $reqlevel) { + $filerecords = $DB->get_records_sql($sql, $params); + foreach ($filerecords as $filerecord) { + if (substr_count($filerecord->filepath, '/') !== $reqlevel) { continue; } - $result[$file_record->pathnamehash] = $this->get_file_instance($file_record); + $result[$filerecord->pathnamehash] = $this->get_file_instance($filerecord); } } - $sql = "SELECT * - FROM {files} - WHERE contextid = :contextid AND component = :component AND filearea = :filearea AND itemid = :itemid - AND filepath = :filepath AND filename <> '.' - ORDER BY $sort"; + $sql = "SELECT ".self::instance_sql_fields('f', 'r')." + FROM {files} f + LEFT JOIN {files_reference} r + ON f.referencefileid = r.id + WHERE f.contextid = :contextid AND f.component = :component AND f.filearea = :filearea AND f.itemid = :itemid + AND f.filepath = :filepath AND f.filename <> '.' + $orderby"; - $file_records = $DB->get_records_sql($sql, $params); - foreach ($file_records as $file_record) { - $result[$file_record->pathnamehash] = $this->get_file_instance($file_record); + $filerecords = $DB->get_records_sql($sql, $params); + foreach ($filerecords as $filerecord) { + $result[$filerecord->pathnamehash] = $this->get_file_instance($filerecord); } } @@ -540,9 +599,9 @@ class file_storage { $conditions['itemid'] = $itemid; } - $file_records = $DB->get_records('files', $conditions); - foreach ($file_records as $file_record) { - $this->get_file_instance($file_record)->delete(); + $filerecords = $DB->get_records('files', $conditions); + foreach ($filerecords as $filerecord) { + $this->get_file_instance($filerecord)->delete(); } return true; // BC only @@ -572,11 +631,11 @@ class file_storage { $params['component'] = $component; $params['filearea'] = $filearea; - $file_records = $DB->get_recordset_select('files', $where, $params); - foreach ($file_records as $file_record) { - $this->get_file_instance($file_record)->delete(); + $filerecords = $DB->get_recordset_select('files', $where, $params); + foreach ($filerecords as $filerecord) { + $this->get_file_instance($filerecord)->delete(); } - $file_records->close(); + $filerecords->close(); } /** @@ -699,11 +758,11 @@ class file_storage { /** * Add new local file based on existing local file. * - * @param stdClass|array $file_record object or array describing changes + * @param stdClass|array $filerecord object or array describing changes * @param stored_file|int $fileorid id or stored_file instance of the existing local file * @return stored_file instance of newly created file */ - public function create_file_from_storedfile($file_record, $fileorid) { + public function create_file_from_storedfile($filerecord, $fileorid) { global $DB; if ($fileorid instanceof stored_file) { @@ -712,20 +771,26 @@ class file_storage { $fid = $fileorid; } - $file_record = (array)$file_record; // we support arrays too, do not modify the submitted record! + $filerecord = (array)$filerecord; // We support arrays too, do not modify the submitted record! - unset($file_record['id']); - unset($file_record['filesize']); - unset($file_record['contenthash']); - unset($file_record['pathnamehash']); + unset($filerecord['id']); + unset($filerecord['filesize']); + unset($filerecord['contenthash']); + unset($filerecord['pathnamehash']); - if (!$newrecord = $DB->get_record('files', array('id'=>$fid))) { + $sql = "SELECT ".self::instance_sql_fields('f', 'r')." + FROM {files} f + LEFT JOIN {files_reference} r + ON f.referencefileid = r.id + WHERE f.id = ?"; + + if (!$newrecord = $DB->get_record_sql($sql, array($fid))) { throw new file_exception('storedfileproblem', 'File does not exist'); } unset($newrecord->id); - foreach ($file_record as $key=>$value) { + foreach ($filerecord as $key => $value) { // validate all parameters, we do not want any rubbish stored in database, right? if ($key == 'contextid' and (!is_number($value) or $value < 1)) { throw new file_exception('storedfileproblem', 'Invalid contextid'); @@ -776,6 +841,10 @@ class file_storage { } } + if ($key == 'referencefileid' or $key == 'referencelastsync' or $key == 'referencelifetime') { + $value = clean_param($value, PARAM_INT); + } + $newrecord->$key = $value; } @@ -790,6 +859,21 @@ class file_storage { return $this->get_file_instance($newrecord); } + if (!empty($newrecord->repositoryid)) { + try { + $referencerecord = new stdClass; + $referencerecord->repositoryid = $newrecord->repositoryid; + $referencerecord->reference = $newrecord->reference; + $referencerecord->lastsync = $newrecord->referencelastsync; + $referencerecord->lifetime = $newrecord->referencelifetime; + $referencerecord->id = $DB->insert_record('files_reference', $referencerecord); + } catch (dml_exception $e) { + throw new stored_file_creation_exception($newrecord->contextid, $newrecord->component, $newrecord->filearea, $newrecord->itemid, + $newrecord->filepath, $newrecord->filename, $e->debuginfo); + } + $newrecord->referencefileid = $referencerecord->id; + } + try { $newrecord->id = $DB->insert_record('files', $newrecord); } catch (dml_exception $e) { @@ -797,6 +881,7 @@ class file_storage { $newrecord->filepath, $newrecord->filename, $e->debuginfo); } + $this->create_directory($newrecord->contextid, $newrecord->component, $newrecord->filearea, $newrecord->itemid, $newrecord->filepath, $newrecord->userid); return $this->get_file_instance($newrecord); @@ -805,16 +890,16 @@ class file_storage { /** * Add new local file. * - * @param stdClass|array $file_record object or array describing file + * @param stdClass|array $filerecord object or array describing file * @param string $url the URL to the file * @param array $options {@link download_file_content()} options * @param bool $usetempfile use temporary file for download, may prevent out of memory problems * @return stored_file */ - public function create_file_from_url($file_record, $url, array $options = NULL, $usetempfile = false) { + public function create_file_from_url($filerecord, $url, array $options = null, $usetempfile = false) { - $file_record = (array)$file_record; //do not modify the submitted record, this cast unlinks objects - $file_record = (object)$file_record; // we support arrays too + $filerecord = (array)$filerecord; // Do not modify the submitted record, this cast unlinks objects. + $filerecord = (object)$filerecord; // We support arrays too. $headers = isset($options['headers']) ? $options['headers'] : null; $postdata = isset($options['postdata']) ? $options['postdata'] : null; @@ -824,13 +909,13 @@ class file_storage { $skipcertverify = isset($options['skipcertverify']) ? $options['skipcertverify'] : false; $calctimeout = isset($options['calctimeout']) ? $options['calctimeout'] : false; - if (!isset($file_record->filename)) { + if (!isset($filerecord->filename)) { $parts = explode('/', $url); $filename = array_pop($parts); - $file_record->filename = clean_param($filename, PARAM_FILE); + $filerecord->filename = clean_param($filename, PARAM_FILE); } - $source = !empty($file_record->source) ? $file_record->source : $url; - $file_record->source = clean_param($source, PARAM_URL); + $source = !empty($filerecord->source) ? $filerecord->source : $url; + $filerecord->source = clean_param($source, PARAM_URL); if ($usetempfile) { check_dir_exists($this->tempdir); @@ -840,7 +925,7 @@ class file_storage { throw new file_exception('storedfileproblem', 'Can not fetch file form URL'); } try { - $newfile = $this->create_file_from_pathname($file_record, $tmpfile); + $newfile = $this->create_file_from_pathname($filerecord, $tmpfile); @unlink($tmpfile); return $newfile; } catch (Exception $e) { @@ -853,104 +938,108 @@ class file_storage { if ($content === false) { throw new file_exception('storedfileproblem', 'Can not fetch file form URL'); } - return $this->create_file_from_string($file_record, $content); + return $this->create_file_from_string($filerecord, $content); } } /** * Add new local file. * - * @param stdClass|array $file_record object or array describing file + * @param stdClass|array $filerecord object or array describing file * @param string $pathname path to file or content of file * @return stored_file */ - public function create_file_from_pathname($file_record, $pathname) { + public function create_file_from_pathname($filerecord, $pathname) { global $DB; - $file_record = (array)$file_record; //do not modify the submitted record, this cast unlinks objects - $file_record = (object)$file_record; // we support arrays too + $filerecord = (array)$filerecord; // Do not modify the submitted record, this cast unlinks objects. + $filerecord = (object)$filerecord; // We support arrays too. // validate all parameters, we do not want any rubbish stored in database, right? - if (!is_number($file_record->contextid) or $file_record->contextid < 1) { + if (!is_number($filerecord->contextid) or $filerecord->contextid < 1) { throw new file_exception('storedfileproblem', 'Invalid contextid'); } - $file_record->component = clean_param($file_record->component, PARAM_COMPONENT); - if (empty($file_record->component)) { + $filerecord->component = clean_param($filerecord->component, PARAM_COMPONENT); + if (empty($filerecord->component)) { throw new file_exception('storedfileproblem', 'Invalid component'); } - $file_record->filearea = clean_param($file_record->filearea, PARAM_AREA); - if (empty($file_record->filearea)) { + $filerecord->filearea = clean_param($filerecord->filearea, PARAM_AREA); + if (empty($filerecord->filearea)) { throw new file_exception('storedfileproblem', 'Invalid filearea'); } - if (!is_number($file_record->itemid) or $file_record->itemid < 0) { + if (!is_number($filerecord->itemid) or $filerecord->itemid < 0) { throw new file_exception('storedfileproblem', 'Invalid itemid'); } - if (!empty($file_record->sortorder)) { - if (!is_number($file_record->sortorder) or $file_record->sortorder < 0) { - $file_record->sortorder = 0; + if (!empty($filerecord->sortorder)) { + if (!is_number($filerecord->sortorder) or $filerecord->sortorder < 0) { + $filerecord->sortorder = 0; } } else { - $file_record->sortorder = 0; + $filerecord->sortorder = 0; } - $file_record->filepath = clean_param($file_record->filepath, PARAM_PATH); - if (strpos($file_record->filepath, '/') !== 0 or strrpos($file_record->filepath, '/') !== strlen($file_record->filepath)-1) { + $filerecord->referencefileid = !isset($filerecord->referencefileid) ? 0 : $filerecord->referencefileid; + $filerecord->referencelastsync = !isset($filerecord->referencelastsync) ? 0 : $filerecord->referencelastsync; + $filerecord->referencelifetime = !isset($filerecord->referencelifetime) ? 0 : $filerecord->referencelifetime; + + $filerecord->filepath = clean_param($filerecord->filepath, PARAM_PATH); + if (strpos($filerecord->filepath, '/') !== 0 or strrpos($filerecord->filepath, '/') !== strlen($filerecord->filepath)-1) { // path must start and end with '/' throw new file_exception('storedfileproblem', 'Invalid file path'); } - $file_record->filename = clean_param($file_record->filename, PARAM_FILE); - if ($file_record->filename === '') { + $filerecord->filename = clean_param($filerecord->filename, PARAM_FILE); + if ($filerecord->filename === '') { // filename must not be empty throw new file_exception('storedfileproblem', 'Invalid file name'); } $now = time(); - if (isset($file_record->timecreated)) { - if (!is_number($file_record->timecreated)) { + if (isset($filerecord->timecreated)) { + if (!is_number($filerecord->timecreated)) { throw new file_exception('storedfileproblem', 'Invalid file timecreated'); } - if ($file_record->timecreated < 0) { + if ($filerecord->timecreated < 0) { //NOTE: unfortunately I make a mistake when creating the "files" table, we can not have negative numbers there, on the other hand no file should be older than 1970, right? (skodak) - $file_record->timecreated = 0; + $filerecord->timecreated = 0; } } else { - $file_record->timecreated = $now; + $filerecord->timecreated = $now; } - if (isset($file_record->timemodified)) { - if (!is_number($file_record->timemodified)) { + if (isset($filerecord->timemodified)) { + if (!is_number($filerecord->timemodified)) { throw new file_exception('storedfileproblem', 'Invalid file timemodified'); } - if ($file_record->timemodified < 0) { + if ($filerecord->timemodified < 0) { //NOTE: unfortunately I make a mistake when creating the "files" table, we can not have negative numbers there, on the other hand no file should be older than 1970, right? (skodak) - $file_record->timemodified = 0; + $filerecord->timemodified = 0; } } else { - $file_record->timemodified = $now; + $filerecord->timemodified = $now; } $newrecord = new stdClass(); - $newrecord->contextid = $file_record->contextid; - $newrecord->component = $file_record->component; - $newrecord->filearea = $file_record->filearea; - $newrecord->itemid = $file_record->itemid; - $newrecord->filepath = $file_record->filepath; - $newrecord->filename = $file_record->filename; + $newrecord->contextid = $filerecord->contextid; + $newrecord->component = $filerecord->component; + $newrecord->filearea = $filerecord->filearea; + $newrecord->itemid = $filerecord->itemid; + $newrecord->filepath = $filerecord->filepath; + $newrecord->filename = $filerecord->filename; - $newrecord->timecreated = $file_record->timecreated; - $newrecord->timemodified = $file_record->timemodified; - $newrecord->mimetype = empty($file_record->mimetype) ? mimeinfo('type', $file_record->filename) : $file_record->mimetype; - $newrecord->userid = empty($file_record->userid) ? null : $file_record->userid; - $newrecord->source = empty($file_record->source) ? null : $file_record->source; - $newrecord->author = empty($file_record->author) ? null : $file_record->author; - $newrecord->license = empty($file_record->license) ? null : $file_record->license; - $newrecord->sortorder = $file_record->sortorder; + $newrecord->timecreated = $filerecord->timecreated; + $newrecord->timemodified = $filerecord->timemodified; + $newrecord->mimetype = empty($filerecord->mimetype) ? $this->mimetype($pathname, $filerecord->filename) : $filerecord->mimetype; + $newrecord->userid = empty($filerecord->userid) ? null : $filerecord->userid; + $newrecord->source = empty($filerecord->source) ? null : $filerecord->source; + $newrecord->author = empty($filerecord->author) ? null : $filerecord->author; + $newrecord->license = empty($filerecord->license) ? null : $filerecord->license; + $newrecord->sortorder = $filerecord->sortorder; list($newrecord->contenthash, $newrecord->filesize, $newfile) = $this->add_file_to_pool($pathname); @@ -974,99 +1063,104 @@ class file_storage { /** * Add new local file. * - * @param stdClass|array $file_record object or array describing file + * @param stdClass|array $filerecord object or array describing file * @param string $content content of file * @return stored_file */ - public function create_file_from_string($file_record, $content) { + public function create_file_from_string($filerecord, $content) { global $DB; - $file_record = (array)$file_record; //do not modify the submitted record, this cast unlinks objects - $file_record = (object)$file_record; // we support arrays too + $filerecord = (array)$filerecord; // Do not modify the submitted record, this cast unlinks objects. + $filerecord = (object)$filerecord; // We support arrays too. // validate all parameters, we do not want any rubbish stored in database, right? - if (!is_number($file_record->contextid) or $file_record->contextid < 1) { + if (!is_number($filerecord->contextid) or $filerecord->contextid < 1) { throw new file_exception('storedfileproblem', 'Invalid contextid'); } - $file_record->component = clean_param($file_record->component, PARAM_COMPONENT); - if (empty($file_record->component)) { + $filerecord->component = clean_param($filerecord->component, PARAM_COMPONENT); + if (empty($filerecord->component)) { throw new file_exception('storedfileproblem', 'Invalid component'); } - $file_record->filearea = clean_param($file_record->filearea, PARAM_AREA); - if (empty($file_record->filearea)) { + $filerecord->filearea = clean_param($filerecord->filearea, PARAM_AREA); + if (empty($filerecord->filearea)) { throw new file_exception('storedfileproblem', 'Invalid filearea'); } - if (!is_number($file_record->itemid) or $file_record->itemid < 0) { + if (!is_number($filerecord->itemid) or $filerecord->itemid < 0) { throw new file_exception('storedfileproblem', 'Invalid itemid'); } - if (!empty($file_record->sortorder)) { - if (!is_number($file_record->sortorder) or $file_record->sortorder < 0) { - $file_record->sortorder = 0; + if (!empty($filerecord->sortorder)) { + if (!is_number($filerecord->sortorder) or $filerecord->sortorder < 0) { + $filerecord->sortorder = 0; } } else { - $file_record->sortorder = 0; + $filerecord->sortorder = 0; } + $filerecord->referencefileid = !isset($filerecord->referencefileid) ? 0 : $filerecord->referencefileid; + $filerecord->referencelastsync = !isset($filerecord->referencelastsync) ? 0 : $filerecord->referencelastsync; + $filerecord->referencelifetime = !isset($filerecord->referencelifetime) ? 0 : $filerecord->referencelifetime; - $file_record->filepath = clean_param($file_record->filepath, PARAM_PATH); - if (strpos($file_record->filepath, '/') !== 0 or strrpos($file_record->filepath, '/') !== strlen($file_record->filepath)-1) { + $filerecord->filepath = clean_param($filerecord->filepath, PARAM_PATH); + if (strpos($filerecord->filepath, '/') !== 0 or strrpos($filerecord->filepath, '/') !== strlen($filerecord->filepath)-1) { // path must start and end with '/' throw new file_exception('storedfileproblem', 'Invalid file path'); } - $file_record->filename = clean_param($file_record->filename, PARAM_FILE); - if ($file_record->filename === '') { + $filerecord->filename = clean_param($filerecord->filename, PARAM_FILE); + if ($filerecord->filename === '') { // path must start and end with '/' throw new file_exception('storedfileproblem', 'Invalid file name'); } $now = time(); - if (isset($file_record->timecreated)) { - if (!is_number($file_record->timecreated)) { + if (isset($filerecord->timecreated)) { + if (!is_number($filerecord->timecreated)) { throw new file_exception('storedfileproblem', 'Invalid file timecreated'); } - if ($file_record->timecreated < 0) { + if ($filerecord->timecreated < 0) { //NOTE: unfortunately I make a mistake when creating the "files" table, we can not have negative numbers there, on the other hand no file should be older than 1970, right? (skodak) - $file_record->timecreated = 0; + $filerecord->timecreated = 0; } } else { - $file_record->timecreated = $now; + $filerecord->timecreated = $now; } - if (isset($file_record->timemodified)) { - if (!is_number($file_record->timemodified)) { + if (isset($filerecord->timemodified)) { + if (!is_number($filerecord->timemodified)) { throw new file_exception('storedfileproblem', 'Invalid file timemodified'); } - if ($file_record->timemodified < 0) { + if ($filerecord->timemodified < 0) { //NOTE: unfortunately I make a mistake when creating the "files" table, we can not have negative numbers there, on the other hand no file should be older than 1970, right? (skodak) - $file_record->timemodified = 0; + $filerecord->timemodified = 0; } } else { - $file_record->timemodified = $now; + $filerecord->timemodified = $now; } $newrecord = new stdClass(); - $newrecord->contextid = $file_record->contextid; - $newrecord->component = $file_record->component; - $newrecord->filearea = $file_record->filearea; - $newrecord->itemid = $file_record->itemid; - $newrecord->filepath = $file_record->filepath; - $newrecord->filename = $file_record->filename; + $newrecord->contextid = $filerecord->contextid; + $newrecord->component = $filerecord->component; + $newrecord->filearea = $filerecord->filearea; + $newrecord->itemid = $filerecord->itemid; + $newrecord->filepath = $filerecord->filepath; + $newrecord->filename = $filerecord->filename; - $newrecord->timecreated = $file_record->timecreated; - $newrecord->timemodified = $file_record->timemodified; - $newrecord->mimetype = empty($file_record->mimetype) ? mimeinfo('type', $file_record->filename) : $file_record->mimetype; - $newrecord->userid = empty($file_record->userid) ? null : $file_record->userid; - $newrecord->source = empty($file_record->source) ? null : $file_record->source; - $newrecord->author = empty($file_record->author) ? null : $file_record->author; - $newrecord->license = empty($file_record->license) ? null : $file_record->license; - $newrecord->sortorder = $file_record->sortorder; + $newrecord->timecreated = $filerecord->timecreated; + $newrecord->timemodified = $filerecord->timemodified; + $newrecord->userid = empty($filerecord->userid) ? null : $filerecord->userid; + $newrecord->source = empty($filerecord->source) ? null : $filerecord->source; + $newrecord->author = empty($filerecord->author) ? null : $filerecord->author; + $newrecord->license = empty($filerecord->license) ? null : $filerecord->license; + $newrecord->sortorder = $filerecord->sortorder; list($newrecord->contenthash, $newrecord->filesize, $newfile) = $this->add_string_to_pool($content); + $filepathname = $this->path_from_hash($newrecord->contenthash) . '/' . $newrecord->contenthash; + // get mimetype by magic bytes + $newrecord->mimetype = empty($filerecord->mimetype) ? $this->mimetype($filepathname, $filerecord->filename) : $filerecord->mimetype; $newrecord->pathnamehash = $this->get_pathname_hash($newrecord->contextid, $newrecord->component, $newrecord->filearea, $newrecord->itemid, $newrecord->filepath, $newrecord->filename); @@ -1085,10 +1179,139 @@ class file_storage { return $this->get_file_instance($newrecord); } + /** + * Create a moodle file from file reference information + * + * @param stdClass $filerecord + * @param int $repositoryid + * @param string $reference + * @param array $options options for creating external file + * @return stored_file + */ + public function create_file_from_reference($filerecord, $repositoryid, $reference, $options = array()) { + global $DB; + + $filerecord = (array)$filerecord; // Do not modify the submitted record, this cast unlinks objects. + $filerecord = (object)$filerecord; // We support arrays too. + + // validate all parameters, we do not want any rubbish stored in database, right? + if (!is_number($filerecord->contextid) or $filerecord->contextid < 1) { + throw new file_exception('storedfileproblem', 'Invalid contextid'); + } + + $filerecord->component = clean_param($filerecord->component, PARAM_COMPONENT); + if (empty($filerecord->component)) { + throw new file_exception('storedfileproblem', 'Invalid component'); + } + + $filerecord->filearea = clean_param($filerecord->filearea, PARAM_AREA); + if (empty($filerecord->filearea)) { + throw new file_exception('storedfileproblem', 'Invalid filearea'); + } + + if (!is_number($filerecord->itemid) or $filerecord->itemid < 0) { + throw new file_exception('storedfileproblem', 'Invalid itemid'); + } + + if (!empty($filerecord->sortorder)) { + if (!is_number($filerecord->sortorder) or $filerecord->sortorder < 0) { + $filerecord->sortorder = 0; + } + } else { + $filerecord->sortorder = 0; + } + + $filerecord->referencefileid = empty($filerecord->referencefileid) ? 0 : $filerecord->referencefileid; + $filerecord->referencelastsync = empty($filerecord->referencelastsync) ? 0 : $filerecord->referencelastsync; + $filerecord->referencelifetime = empty($filerecord->referencelifetime) ? 0 : $filerecord->referencelifetime; + $filerecord->mimetype = empty($filerecord->mimetype) ? $this->mimetype($filerecord->filename) : $filerecord->mimetype; + $filerecord->userid = empty($filerecord->userid) ? null : $filerecord->userid; + $filerecord->source = empty($filerecord->source) ? null : $filerecord->source; + $filerecord->author = empty($filerecord->author) ? null : $filerecord->author; + $filerecord->license = empty($filerecord->license) ? null : $filerecord->license; + $filerecord->filepath = clean_param($filerecord->filepath, PARAM_PATH); + if (strpos($filerecord->filepath, '/') !== 0 or strrpos($filerecord->filepath, '/') !== strlen($filerecord->filepath)-1) { + // Path must start and end with '/'. + throw new file_exception('storedfileproblem', 'Invalid file path'); + } + + $filerecord->filename = clean_param($filerecord->filename, PARAM_FILE); + if ($filerecord->filename === '') { + // Path must start and end with '/'. + throw new file_exception('storedfileproblem', 'Invalid file name'); + } + + $now = time(); + if (isset($filerecord->timecreated)) { + if (!is_number($filerecord->timecreated)) { + throw new file_exception('storedfileproblem', 'Invalid file timecreated'); + } + if ($filerecord->timecreated < 0) { + // NOTE: unfortunately I make a mistake when creating the "files" table, we can not have negative numbers there, on the other hand no file should be older than 1970, right? (skodak) + $filerecord->timecreated = 0; + } + } else { + $filerecord->timecreated = $now; + } + + if (isset($filerecord->timemodified)) { + if (!is_number($filerecord->timemodified)) { + throw new file_exception('storedfileproblem', 'Invalid file timemodified'); + } + if ($filerecord->timemodified < 0) { + // NOTE: unfortunately I make a mistake when creating the "files" table, we can not have negative numbers there, on the other hand no file should be older than 1970, right? (skodak) + $filerecord->timemodified = 0; + } + } else { + $filerecord->timemodified = $now; + } + + $transaction = $DB->start_delegated_transaction(); + + // Insert file reference record. + try { + $referencerecord = new stdClass; + $referencerecord->repositoryid = $repositoryid; + $referencerecord->reference = $reference; + $referencerecord->lastsync = $filerecord->referencelastsync; + $referencerecord->lifetime = $filerecord->referencelifetime; + $referencerecord->id = $DB->insert_record('files_reference', $referencerecord); + } catch (dml_exception $e) { + throw $e; + } + + $filerecord->referencefileid = $referencerecord->id; + + // External file doesn't have content in moodle. + // So we create an empty file for it. + list($filerecord->contenthash, $filerecord->filesize, $newfile) = $this->add_string_to_pool(null); + + $filerecord->pathnamehash = $this->get_pathname_hash($filerecord->contextid, $filerecord->component, $filerecord->filearea, $filerecord->itemid, $filerecord->filepath, $filerecord->filename); + + try { + $filerecord->id = $DB->insert_record('files', $filerecord); + } catch (dml_exception $e) { + if ($newfile) { + $this->deleted_file_cleanup($filerecord->contenthash); + } + throw new stored_file_creation_exception($filerecord->contextid, $filerecord->component, $filerecord->filearea, $filerecord->itemid, + $filerecord->filepath, $filerecord->filename, $e->debuginfo); + } + + $this->create_directory($filerecord->contextid, $filerecord->component, $filerecord->filearea, $filerecord->itemid, $filerecord->filepath, $filerecord->userid); + + $transaction->allow_commit(); + + // Adding repositoryid and reference to file record to create stored_file instance + $filerecord->repositoryid = $repositoryid; + $filerecord->reference = $reference; + return $this->get_file_instance($filerecord); + } + /** * Creates new image file from existing. * - * @param stdClass|array $file_record object or array describing new file + * @param stdClass|array $filerecord object or array describing new file * @param int|stored_file $fid file id or stored file object * @param int $newwidth in pixels * @param int $newheight in pixels @@ -1096,7 +1319,7 @@ class file_storage { * @param int $quality depending on image type 0-100 for jpeg, 0-9 (0 means no compression) for png * @return stored_file */ - public function convert_image($file_record, $fid, $newwidth = NULL, $newheight = NULL, $keepaspectratio = true, $quality = NULL) { + public function convert_image($filerecord, $fid, $newwidth = null, $newheight = null, $keepaspectratio = true, $quality = null) { if (!function_exists('imagecreatefromstring')) { //Most likely the GD php extension isn't installed //image conversion cannot succeed @@ -1107,9 +1330,9 @@ class file_storage { $fid = $fid->get_id(); } - $file_record = (array)$file_record; // we support arrays too, do not modify the submitted record! + $filerecord = (array)$filerecord; // We support arrays too, do not modify the submitted record! - if (!$file = $this->get_file_by_id($fid)) { // make sure file really exists and we we correct data + if (!$file = $this->get_file_by_id($fid)) { // Make sure file really exists and we we correct data. throw new file_exception('storedfileproblem', 'File does not exist'); } @@ -1117,12 +1340,12 @@ class file_storage { throw new file_exception('storedfileproblem', 'File is not an image'); } - if (!isset($file_record['filename'])) { - $file_record['filename'] = $file->get_filename(); + if (!isset($filerecord['filename'])) { + $filerecord['filename'] = $file->get_filename(); } - if (!isset($file_record['mimetype'])) { - $file_record['mimetype'] = mimeinfo('type', $file_record['filename']); + if (!isset($filerecord['mimetype'])) { + $filerecord['mimetype'] = $imageinfo['mimetype']; } $width = $imageinfo['width']; @@ -1171,7 +1394,7 @@ class file_storage { } ob_start(); - switch ($file_record['mimetype']) { + switch ($filerecord['mimetype']) { case 'image/gif': imagegif($img); break; @@ -1201,7 +1424,7 @@ class file_storage { throw new file_exception('storedfileproblem', 'Can not convert image'); } - return $this->create_file_from_string($file_record, $content); + return $this->create_file_from_string($filerecord, $content); } /** @@ -1310,6 +1533,18 @@ class file_storage { return xsendfile("$hashpath/$contenthash"); } + /** + * Content exists + * + * @param string $contenthash + * @return bool + */ + public function content_exists($contenthash) { + $dir = $this->path_from_hash($contenthash); + $filepath = $dir . '/' . $contenthash; + return file_exists($filepath); + } + /** * Return path to file with given hash. * @@ -1408,6 +1643,190 @@ class file_storage { chmod($trashfile, $this->filepermissions); // fix permissions if needed } + /** + * When user referring to a moodle file, we build the reference field + * + * @param array $params + * @return string + */ + public static function pack_reference($params) { + $params = (array)$params; + $reference = array(); + $reference['contextid'] = is_null($params['contextid']) ? null : clean_param($params['contextid'], PARAM_INT); + $reference['component'] = is_null($params['component']) ? null : clean_param($params['component'], PARAM_COMPONENT); + $reference['itemid'] = is_null($params['itemid']) ? null : clean_param($params['itemid'], PARAM_INT); + $reference['filearea'] = is_null($params['filearea']) ? null : clean_param($params['filearea'], PARAM_AREA); + $reference['filepath'] = is_null($params['filepath']) ? null : clean_param($params['filepath'], PARAM_PATH);; + $reference['filename'] = is_null($params['filename']) ? null : clean_param($params['filename'], PARAM_FILE); + return base64_encode(serialize($reference)); + } + + /** + * Unpack reference field + * + * @param string $str + * @return array + */ + public static function unpack_reference($str) { + return unserialize(base64_decode($str)); + } + + /** + * Search references by providing reference content + * + * @param string $str + * @return array + */ + public function search_references($str) { + global $DB; + $sql = "SELECT ".self::instance_sql_fields('f', 'r')." + FROM {files} f + LEFT JOIN {files_reference} r + ON f.referencefileid = r.id + WHERE ".$DB->sql_compare_text('r.reference').' = '.$DB->sql_compare_text('?')." + AND (f.component <> ? OR f.filearea <> ?)"; + + $rs = $DB->get_recordset_sql($sql, array($str, 'user', 'draft')); + $files = array(); + foreach ($rs as $filerecord) { + $file = $this->get_file_instance($filerecord); + if ($file->is_external_file()) { + $files[$filerecord->pathnamehash] = $file; + } + } + + return $files; + } + + /** + * Search references count by providing reference content + * + * @param string $str + * @return int + */ + public function search_references_count($str) { + global $DB; + $sql = "SELECT COUNT(f.id) + FROM {files} f + LEFT JOIN {files_reference} r + ON f.referencefileid = r.id + WHERE ".$DB->sql_compare_text('r.reference').' = '.$DB->sql_compare_text('?')." + AND (f.component <> ? OR f.filearea <> ?)"; + + $count = $DB->count_records_sql($sql, array($str, 'user', 'draft')); + return $count; + } + + /** + * Return all files referring to provided stored_file instance + * This won't work for draft files + * + * @param stored_file $storedfile + * @return array + */ + public function get_references_by_storedfile($storedfile) { + global $DB; + + $params = array(); + $params['contextid'] = $storedfile->get_contextid(); + $params['component'] = $storedfile->get_component(); + $params['filearea'] = $storedfile->get_filearea(); + $params['itemid'] = $storedfile->get_itemid(); + $params['filename'] = $storedfile->get_filename(); + $params['filepath'] = $storedfile->get_filepath(); + $params['userid'] = $storedfile->get_userid(); + + $reference = self::pack_reference($params); + + $sql = "SELECT ".self::instance_sql_fields('f', 'r')." + FROM {files} f + LEFT JOIN {files_reference} r + ON f.referencefileid = r.id + WHERE ".$DB->sql_compare_text('r.reference').' = '.$DB->sql_compare_text('?')." + AND (f.component <> ? OR f.filearea <> ?)"; + + $rs = $DB->get_recordset_sql($sql, array($reference, 'user', 'draft')); + $files = array(); + foreach ($rs as $filerecord) { + $file = $this->get_file_instance($filerecord); + if ($file->is_external_file()) { + $files[$filerecord->pathnamehash] = $file; + } + } + + return $files; + } + + /** + * Return the count files referring to provided stored_file instance + * This won't work for draft files + * + * @param stored_file $storedfile + * @return int + */ + public function get_references_count_by_storedfile($storedfile) { + global $DB; + + $params = array(); + $params['contextid'] = $storedfile->get_contextid(); + $params['component'] = $storedfile->get_component(); + $params['filearea'] = $storedfile->get_filearea(); + $params['itemid'] = $storedfile->get_itemid(); + $params['filename'] = $storedfile->get_filename(); + $params['filepath'] = $storedfile->get_filepath(); + $params['userid'] = $storedfile->get_userid(); + + $reference = self::pack_reference($params); + + $sql = "SELECT COUNT(f.id) + FROM {files} f + LEFT JOIN {files_reference} r + ON f.referencefileid = r.id + WHERE ".$DB->sql_compare_text('r.reference').' = '.$DB->sql_compare_text('?')." + AND (f.component <> ? OR f.filearea <> ?)"; + + $count = $DB->count_records_sql($sql, array($reference, 'user', 'draft')); + return $count; + } + + /** + * Convert file alias to local file + * + * @param stored_file $storedfile a stored_file instances + * @return stored_file stored_file + */ + public function import_external_file($storedfile) { + global $CFG; + require_once($CFG->dirroot.'/repository/lib.php'); + // sync external file + repository::sync_external_file($storedfile); + // Remove file references + $storedfile->delete_reference(); + return $storedfile; + } + + /** + * Return mimetype by given file pathname + * + * If file has a known extension, we return the mimetype based on extension. + * Otherwise (when possible) we try to get the mimetype from file contents. + * + * @param string $pathname full path to the file + * @param string $filename correct file name with extension, if omitted will be taken from $path + * @return string + */ + public static function mimetype($pathname, $filename = null) { + if (empty($filename)) { + $filename = $pathname; + } + $type = mimeinfo('type', $filename); + if ($type === 'document/unknown' && class_exists('finfo') && file_exists($pathname)) { + $finfo = new finfo(FILEINFO_MIME_TYPE); + $type = mimeinfo_from_type('type', $finfo->file($pathname)); + } + return $type; + } + /** * Cron cleanup job. */ @@ -1474,5 +1893,37 @@ class file_storage { mtrace('done.'); } } + + /** + * Get the sql formated fields for a file instance to be created from a + * {files} and {files_refernece} join. + * + * @param string $filesprefix the table prefix for the {files} table + * @param string $filesreferenceprefix the table prefix for the {files_reference} table + * @return string the sql to go after a SELECT + */ + private static function instance_sql_fields($filesprefix, $filesreferenceprefix) { + // Note, these fieldnames MUST NOT overlap between the two tables, + // else problems like MDL-33172 occur. + $filefields = array('contenthash', 'pathnamehash', 'contextid', 'component', 'filearea', + 'itemid', 'filepath', 'filename', 'userid', 'filesize', 'mimetype', 'status', 'source', + 'author', 'license', 'timecreated', 'timemodified', 'sortorder', 'referencefileid', + 'referencelastsync', 'referencelifetime'); + + $referencefields = array('repositoryid', 'reference'); + + // id is specifically named to prevent overlaping between the two tables. + $fields = array(); + $fields[] = $filesprefix.'.id AS id'; + foreach ($filefields as $field) { + $fields[] = "{$filesprefix}.{$field}"; + } + + foreach ($referencefields as $field) { + $fields[] = "{$filesreferenceprefix}.{$field}"; + } + + return implode(', ', $fields); + } } diff --git a/lib/filestorage/file_types.mm b/lib/filestorage/file_types.mm deleted file mode 100644 index 71ff4fbdc09..00000000000 --- a/lib/filestorage/file_types.mm +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/lib/filestorage/stored_file.php b/lib/filestorage/stored_file.php index bc19c0ba78b..c9367160fe6 100644 --- a/lib/filestorage/stored_file.php +++ b/lib/filestorage/stored_file.php @@ -25,8 +25,6 @@ defined('MOODLE_INTERNAL') || die(); -require_once("$CFG->libdir/filestorage/stored_file.php"); - /** * Class representing local files stored in a sha1 file pool. * @@ -42,10 +40,12 @@ require_once("$CFG->libdir/filestorage/stored_file.php"); class stored_file { /** @var file_storage file storage pool instance */ private $fs; - /** @var stdClass record from the files table */ + /** @var stdClass record from the files table left join files_reference table */ private $file_record; /** @var string location of content files */ private $filedir; + /** @var repository repository plugin instance */ + private $repository; /** * Constructor, this constructor should be called ONLY from the file_storage class! @@ -55,9 +55,177 @@ class stored_file { * @param string $filedir location of file directory with sh1 named content files */ public function __construct(file_storage $fs, stdClass $file_record, $filedir) { + global $DB, $CFG; $this->fs = $fs; $this->file_record = clone($file_record); // prevent modifications $this->filedir = $filedir; // keep secret, do not expose! + + if (!empty($file_record->repositoryid)) { + require_once("$CFG->dirroot/repository/lib.php"); + $this->repository = repository::get_repository_by_id($file_record->repositoryid, SYSCONTEXTID); + if ($this->repository->supported_returntypes() & FILE_REFERENCE != FILE_REFERENCE) { + // Repository cannot do file reference. + throw new moodle_exception('error'); + } + } else { + $this->repository = null; + } + } + + /** + * Whether or not this is a external resource + * + * @return bool + */ + public function is_external_file() { + return !empty($this->repository); + } + + /** + * Update some file record fields + * NOTE: Must remain protected + * + * @param stdClass $dataobject + */ + protected function update($dataobject) { + global $DB; + $keys = array_keys((array)$this->file_record); + foreach ($dataobject as $field => $value) { + if (in_array($field, $keys)) { + if ($field == 'contextid' and (!is_number($value) or $value < 1)) { + throw new file_exception('storedfileproblem', 'Invalid contextid'); + } + + if ($field == 'component') { + $value = clean_param($value, PARAM_COMPONENT); + if (empty($value)) { + throw new file_exception('storedfileproblem', 'Invalid component'); + } + } + + if ($field == 'filearea') { + $value = clean_param($value, PARAM_AREA); + if (empty($value)) { + throw new file_exception('storedfileproblem', 'Invalid filearea'); + } + } + + if ($field == 'itemid' and (!is_number($value) or $value < 0)) { + throw new file_exception('storedfileproblem', 'Invalid itemid'); + } + + + if ($field == 'filepath') { + $value = clean_param($value, PARAM_PATH); + if (strpos($value, '/') !== 0 or strrpos($value, '/') !== strlen($value)-1) { + // path must start and end with '/' + throw new file_exception('storedfileproblem', 'Invalid file path'); + } + } + + if ($field == 'filename') { + // folder has filename == '.', so we pass this + if ($value != '.') { + $value = clean_param($value, PARAM_FILE); + } + if ($value === '') { + throw new file_exception('storedfileproblem', 'Invalid file name'); + } + } + + if ($field === 'timecreated' or $field === 'timemodified') { + if (!is_number($value)) { + throw new file_exception('storedfileproblem', 'Invalid timestamp'); + } + if ($value < 0) { + $value = 0; + } + } + + if ($field == 'referencefileid' or $field == 'referencelastsync' or $field == 'referencelifetime') { + $value = clean_param($value, PARAM_INT); + } + + // adding the field + $this->file_record->$field = $value; + } else { + throw new coding_exception("Invalid field name, $field doesn't exist in file record"); + } + } + // Validate mimetype field + // we don't use {@link stored_file::get_content_file_location()} here becaues it will try to update file_record + $pathname = $this->get_pathname_by_contenthash(); + // try to recover the content from trash + if (!is_readable($pathname)) { + if (!$this->fs->try_content_recovery($this) or !is_readable($pathname)) { + throw new file_exception('storedfilecannotread', '', $pathname); + } + } + $mimetype = $this->fs->mimetype($pathname); + $this->file_record->mimetype = $mimetype; + + $DB->update_record('files', $this->file_record); + } + + /** + * Rename filename + * + * @param string $filepath file path + * @param string $filename file name + */ + public function rename($filepath, $filename) { + if ($this->fs->file_exists($this->get_contextid(), $this->get_component(), $this->get_filearea(), $this->get_itemid(), $filepath, $filename)) { + throw new file_exception('storedfilenotcreated', '', 'file exists, cannot rename'); + } + $filerecord = new stdClass; + $filerecord->filepath = $filepath; + $filerecord->filename = $filename; + // populate the pathname hash + $filerecord->pathnamehash = $this->fs->get_pathname_hash($this->file_record->contextid, $this->file_record->component, $this->file_record->filearea, $this->file_record->itemid, $filepath, $filename); + $this->update($filerecord); + } + + /** + * Replace the content by providing another stored_file instance + * + * @param stored_file $storedfile + */ + public function replace_content_with(stored_file $storedfile) { + $contenthash = $storedfile->get_contenthash(); + $this->set_contenthash($contenthash); + } + + /** + * Delete file reference + * + */ + public function delete_reference() { + global $DB; + + // Remove repository info. + $this->repository = null; + + $transaction = $DB->start_delegated_transaction(); + + // Remove reference info from DB. + $DB->delete_records('files_reference', array('id'=>$this->file_record->referencefileid)); + + // Must refresh $this->file_record form DB + $filerecord = $DB->get_record('files', array('id'=>$this->get_id())); + // Update DB + $filerecord->referencelastsync = null; + $filerecord->referencelifetime = null; + $filerecord->referencefileid = null; + $this->update($filerecord); + + $transaction->allow_commit(); + + // unset object variable + unset($this->file_record->repositoryid); + unset($this->file_record->reference); + unset($this->file_record->referencelastsync); + unset($this->file_record->referencelifetime); + unset($this->file_record->referencefileid); } /** @@ -83,13 +251,45 @@ class stored_file { */ public function delete() { global $DB; + + $transaction = $DB->start_delegated_transaction(); + + // If other files referring to this file, we need convert them + if ($files = $this->fs->get_references_by_storedfile($this)) { + foreach ($files as $file) { + $this->fs->import_external_file($file); + } + } + // Now delete file records in DB $DB->delete_records('files', array('id'=>$this->file_record->id)); + $DB->delete_records('files_reference', array('id'=>$this->file_record->referencefileid)); + + $transaction->allow_commit(); + // moves pool file to trash if content not needed any more $this->fs->deleted_file_cleanup($this->file_record->contenthash); return true; // BC only } /** + * Get file pathname by contenthash + * + * NOTE, this function is not calling sync_external_file, it assume the contenthash is current + * Protected - developers must not gain direct access to this function. + * + * @return string full path to pool file with file content + */ + protected function get_pathname_by_contenthash() { + // Detect is local file or not. + $contenthash = $this->file_record->contenthash; + $l1 = $contenthash[0].$contenthash[1]; + $l2 = $contenthash[2].$contenthash[3]; + return "$this->filedir/$l1/$l2/$contenthash"; + } + + /** + * Get file pathname by given contenthash, this method will try to sync files + * * Protected - developers must not gain direct access to this function. * * NOTE: do not make this public, we must not modify or delete the pool files directly! ;-) @@ -97,10 +297,8 @@ class stored_file { * @return string full path to pool file with file content **/ protected function get_content_file_location() { - $contenthash = $this->file_record->contenthash; - $l1 = $contenthash[0].$contenthash[1]; - $l2 = $contenthash[2].$contenthash[3]; - return "$this->filedir/$l1/$l2/$contenthash"; + $this->sync_external_file(); + return $this->get_pathname_by_contenthash(); } /** @@ -128,7 +326,7 @@ class stored_file { throw new file_exception('storedfilecannotread', '', $path); } } - return fopen($path, 'rb'); //binary reading only!! + return fopen($path, 'rb'); // Binary reading only!! } /** @@ -241,7 +439,14 @@ class stored_file { * @return mixed array with width, height and mimetype; false if not an image */ public function get_imageinfo() { - if (!$imageinfo = getimagesize($this->get_content_file_location())) { + $path = $this->get_content_file_location(); + if (!is_readable($path)) { + if (!$this->fs->try_content_recovery($this) or !is_readable($path)) { + throw new file_exception('storedfilecannotread', '', $path); + } + } + $mimetype = $this->get_mimetype(); + if (!preg_match('|^image/|', $mimetype) || !filesize($path) || !($imageinfo = getimagesize($path))) { return false; } $image = array('width'=>$imageinfo[0], 'height'=>$imageinfo[1], 'mimetype'=>image_type_to_mime_type($imageinfo[2])); @@ -261,7 +466,7 @@ class stored_file { */ public function is_valid_image() { $mimetype = $this->get_mimetype(); - if ($mimetype !== 'image/gif' and $mimetype !== 'image/jpeg' and $mimetype !== 'image/png') { + if (!file_mimetype_in_typegroup($mimetype, 'web_image')) { return false; } if (!$info = $this->get_imageinfo()) { @@ -300,7 +505,33 @@ class stored_file { } /** - * Returns context id of the file- + * Sync external files + * + * @return bool true if file content changed, false if not + */ + public function sync_external_file() { + global $CFG, $DB; + if (empty($this->file_record->referencefileid)) { + return false; + } + if (empty($this->file_record->referencelastsync) or ($this->file_record->referencelastsync + $this->file_record->referencelifetime < time())) { + require_once($CFG->dirroot.'/repository/lib.php'); + if (repository::sync_external_file($this)) { + $prevcontent = $this->file_record->contenthash; + $sql = "SELECT f.*, r.repositoryid, r.reference + FROM {files} f + LEFT JOIN {files_reference} r + ON f.referencefileid = r.id + WHERE f.id = ?"; + $this->file_record = $DB->get_record_sql($sql, array($this->file_record->id), MUST_EXIST); + return ($prevcontent !== $this->file_record->contenthash); + } + } + return false; + } + + /** + * Returns context id of the file * * @return int context id */ @@ -370,9 +601,21 @@ class stored_file { * @return int bytes */ public function get_filesize() { + $this->sync_external_file(); return $this->file_record->filesize; } + /** + * Returns the size of file in bytes. + * + * @param int $filesize bytes + */ + public function set_filesize($filesize) { + $filerecord = new stdClass; + $filerecord->filesize = $filesize; + $this->update($filerecord); + } + /** * Returns mime type of file. * @@ -397,9 +640,21 @@ class stored_file { * @return int */ public function get_timemodified() { + $this->sync_external_file(); return $this->file_record->timemodified; } + /** + * set timemodified + * + * @param int $timemodified + */ + public function set_timemodified($timemodified) { + $filerecord = new stdClass; + $filerecord->timemodified = $timemodified; + $this->update($filerecord); + } + /** * Returns file status flag. * @@ -424,9 +679,26 @@ class stored_file { * @return string */ public function get_contenthash() { + $this->sync_external_file(); return $this->file_record->contenthash; } + /** + * Set contenthash + * + * @param string $contenthash + */ + protected function set_contenthash($contenthash) { + // make sure the content exists in moodle file pool + if ($this->fs->content_exists($contenthash)) { + $filerecord = new stdClass; + $filerecord->contenthash = $contenthash; + $this->update($filerecord); + } else { + throw new file_exception('storedfileproblem', 'Invalid contenthash, content must be already in filepool', $contenthash); + } + } + /** * Returns sha1 hash of all file path components sha1("contextid/component/filearea/itemid/dir/dir/filename.ext"). * @@ -445,6 +717,17 @@ class stored_file { return $this->file_record->license; } + /** + * Set license + * + * @param string $license license + */ + public function set_license($license) { + $filerecord = new stdClass; + $filerecord->license = $license; + $this->update($filerecord); + } + /** * Returns the author name of the file. * @@ -454,6 +737,17 @@ class stored_file { return $this->file_record->author; } + /** + * Set author + * + * @param string $author + */ + public function set_author($author) { + $filerecord = new stdClass; + $filerecord->author = $author; + $this->update($filerecord); + } + /** * Returns the source of the file, usually it is a url. * @@ -463,6 +757,18 @@ class stored_file { return $this->file_record->source; } + /** + * Set license + * + * @param string $license license + */ + public function set_source($source) { + $filerecord = new stdClass; + $filerecord->source = $source; + $this->update($filerecord); + } + + /** * Returns the sort order of file * @@ -471,4 +777,82 @@ class stored_file { public function get_sortorder() { return $this->file_record->sortorder; } + + /** + * Set file sort order + * + * @param int $sortorder + * @return int + */ + public function set_sortorder($sortorder) { + $filerecord = new stdClass; + $filerecord->sortorder = $sortorder; + $this->update($filerecord); + } + + /** + * Returns repository id + * + * @return int|null + */ + public function get_repository_id() { + if (!empty($this->repository)) { + return $this->repository->id; + } else { + return null; + } + } + + /** + * get reference file id + * @return int + */ + public function get_referencefileid() { + return $this->file_record->referencefileid; + } + + /** + * Get reference last sync time + * @return int + */ + public function get_referencelastsync() { + return $this->file_record->referencelastsync; + } + + /** + * Get reference last sync time + * @return int + */ + public function get_referencelifetime() { + return $this->file_record->referencelifetime; + } + /** + * Returns file reference + * + * @return string + */ + public function get_reference() { + return $this->file_record->reference; + } + + /** + * Get human readable file reference information + * + * @return string + */ + public function get_reference_details() { + return $this->repository->get_reference_details($this->get_reference()); + } + + /** + * Send file references + * + * @param int $lifetime Number of seconds before the file should expire from caches (default 24 hours) + * @param int $filter 0 (default)=no filtering, 1=all files, 2=html files only + * @param bool $forcedownload If true (default false), forces download of file rather than view in browser/plugin + * @param array $options additional options affecting the file serving + */ + public function send_file($lifetime, $filter, $forcedownload, $options) { + $this->repository->send_file($this, $lifetime, $filter, $forcedownload, $options); + } } diff --git a/lib/filestorage/tests/file_storage_test.php b/lib/filestorage/tests/file_storage_test.php index ba31f8043a9..41feea15ae5 100644 --- a/lib/filestorage/tests/file_storage_test.php +++ b/lib/filestorage/tests/file_storage_test.php @@ -28,6 +28,7 @@ defined('MOODLE_INTERNAL') || die(); global $CFG; require_once($CFG->libdir . '/filelib.php'); +require_once($CFG->dirroot . '/repository/lib.php'); class filestoragelib_testcase extends advanced_testcase { @@ -76,5 +77,1093 @@ class filestoragelib_testcase extends advanced_testcase { $previewtinyicon = $fs->get_file_preview($file, 'thumb'); $this->assertInstanceOf('stored_file', $previewtinyicon); $this->assertEquals('6b9864ae1536a8eeef54e097319175a8be12f07c', $previewtinyicon->get_filename()); + + $this->setExpectedException('file_exception'); + $fs->get_file_preview($file, 'amodewhichdoesntexist'); + } + + public function test_get_file_preview_nonimage() { + $this->resetAfterTest(true); + $syscontext = context_system::instance(); + $filerecord = array( + 'contextid' => $syscontext->id, + 'component' => 'core', + 'filearea' => 'unittest', + 'itemid' => 0, + 'filepath' => '/textfiles/', + 'filename' => 'testtext.txt', + ); + + $fs = get_file_storage(); + $fs->create_file_from_string($filerecord, 'text contents'); + $textfile = $fs->get_file($syscontext->id, $filerecord['component'], $filerecord['filearea'], + $filerecord['itemid'], $filerecord['filepath'], $filerecord['filename']); + + $preview = $fs->get_file_preview($textfile, 'thumb'); + $this->assertFalse($preview); + } + + /** + * Make sure renaming is working + * + * @copyright 2012 Dongsheng Cai {@link http://dongsheng.org} + */ + public function test_file_renaming() { + global $CFG; + + $this->resetAfterTest(true); + $fs = get_file_storage(); + $syscontext = context_system::instance(); + $component = 'core'; + $filearea = 'unittest'; + $itemid = 0; + $filepath = '/'; + $filename = 'test.txt'; + + $filerecord = array( + 'contextid' => $syscontext->id, + 'component' => $component, + 'filearea' => $filearea, + 'itemid' => $itemid, + 'filepath' => $filepath, + 'filename' => $filename, + ); + + $originalfile = $fs->create_file_from_string($filerecord, 'Test content'); + $this->assertInstanceOf('stored_file', $originalfile); + $contenthash = $originalfile->get_contenthash(); + $newpath = '/test/'; + $newname = 'newtest.txt'; + + // this should work + $originalfile->rename($newpath, $newname); + $file = $fs->get_file($syscontext->id, $component, $filearea, $itemid, $newpath, $newname); + $this->assertInstanceOf('stored_file', $file); + $this->assertEquals($contenthash, $file->get_contenthash()); + + // try break it + $this->setExpectedException('file_exception'); + // this shall throw exception + $originalfile->rename($newpath, $newname); + } + + /** + * Create file from reference tests + * + * @copyright 2012 Dongsheng Cai {@link http://dongsheng.org} + */ + public function test_create_file_from_reference() { + global $CFG, $DB; + + $this->resetAfterTest(true); + // create user + $generator = $this->getDataGenerator(); + $user = $generator->create_user(); + $usercontext = context_user::instance($user->id); + $syscontext = context_system::instance(); + $USER = $DB->get_record('user', array('id'=>$user->id)); + + $fs = get_file_storage(); + + $repositorypluginname = 'user'; + // override repository permission + $capability = 'repository/' . $repositorypluginname . ':view'; + $allroles = $DB->get_records_menu('role', array(), 'id', 'archetype, id'); + assign_capability($capability, CAP_ALLOW, $allroles['guest'], $syscontext->id, true); + + + $args = array(); + $args['type'] = $repositorypluginname; + $repos = repository::get_instances($args); + $userrepository = reset($repos); + $this->assertInstanceOf('repository', $userrepository); + + $component = 'user'; + $filearea = 'private'; + $itemid = 0; + $filepath = '/'; + $filename = 'userfile.txt'; + + $filerecord = array( + 'contextid' => $usercontext->id, + 'component' => $component, + 'filearea' => $filearea, + 'itemid' => $itemid, + 'filepath' => $filepath, + 'filename' => $filename, + ); + + $content = 'Test content'; + $originalfile = $fs->create_file_from_string($filerecord, $content); + $this->assertInstanceOf('stored_file', $originalfile); + + $newfilerecord = array( + 'contextid' => $syscontext->id, + 'component' => 'core', + 'filearea' => 'phpunit', + 'itemid' => 0, + 'filepath' => $filepath, + 'filename' => $filename, + ); + $ref = $fs->pack_reference($filerecord); + $newstoredfile = $fs->create_file_from_reference($newfilerecord, $userrepository->id, $ref); + $this->assertInstanceOf('stored_file', $newstoredfile); + $this->assertEquals($userrepository->id, $newstoredfile->get_repository_id()); + $this->assertEquals($originalfile->get_contenthash(), $newstoredfile->get_contenthash()); + $this->assertEquals($originalfile->get_filesize(), $newstoredfile->get_filesize()); + $this->assertRegExp('#' . $filename. '$#', $newstoredfile->get_reference_details()); + + // Test looking for references + $count = $fs->get_references_count_by_storedfile($originalfile); + $this->assertEquals(1, $count); + $files = $fs->get_references_by_storedfile($originalfile); + $file = reset($files); + $this->assertEquals($file, $newstoredfile); + + // Look for references by repository ID + $files = $fs->get_external_files($userrepository->id); + $file = reset($files); + $this->assertEquals($file, $newstoredfile); + + // Try convert reference to local file + $importedfile = $fs->import_external_file($newstoredfile); + $this->assertFalse($importedfile->is_external_file()); + $this->assertInstanceOf('stored_file', $importedfile); + // still readable? + $this->assertEquals($content, $importedfile->get_content()); + } + + private function setup_three_private_files() { + + $this->resetAfterTest(true); + + $generator = $this->getDataGenerator(); + $user = $generator->create_user(); + $this->setUser($user->id); + $usercontext = context_user::instance($user->id); + // create a user private file + $file1 = new stdClass; + $file1->contextid = $usercontext->id; + $file1->component = 'user'; + $file1->filearea = 'private'; + $file1->itemid = 0; + $file1->filepath = '/'; + $file1->filename = '1.txt'; + $file1->source = 'test'; + + $fs = get_file_storage(); + $userfile1 = $fs->create_file_from_string($file1, 'file1 content'); + $this->assertInstanceOf('stored_file', $userfile1); + + $file2 = clone($file1); + $file2->filename = '2.txt'; + $userfile2 = $fs->create_file_from_string($file2, 'file2 content'); + $this->assertInstanceOf('stored_file', $userfile2); + + $file3 = clone($file1); + $file3->filename = '3.txt'; + $userfile3 = $fs->create_file_from_storedfile($file3, $userfile2); + $this->assertInstanceOf('stored_file', $userfile3); + + $user->ctxid = $usercontext->id; + + return $user; + } + + public function test_get_area_files() { + $user = $this->setup_three_private_files(); + $fs = get_file_storage(); + + // Get area files with default options. + $areafiles = $fs->get_area_files($user->ctxid, 'user', 'private'); + + // Should be the two files we added plus the folder. + $this->assertEquals(4, count($areafiles)); + + // Verify structure. + foreach ($areafiles as $key => $file) { + $this->assertInstanceOf('stored_file', $file); + $this->assertEquals($key, $file->get_pathnamehash()); + } + + // Get area files without a folder. + $folderlessfiles = $fs->get_area_files($user->ctxid, 'user', 'private', false, 'sortorder', false); + // Should be the two files without folder. + $this->assertEquals(3, count($folderlessfiles)); + + // Verify structure. + foreach ($folderlessfiles as $key => $file) { + $this->assertInstanceOf('stored_file', $file); + $this->assertEquals($key, $file->get_pathnamehash()); + } + + // Get area files ordered by id (was breaking on oracle). + $filesbyid = $fs->get_area_files($user->ctxid, 'user', 'private', false, 'id', false); + // Should be the two files without folder. + $this->assertEquals(3, count($filesbyid)); + + // Verify structure. + foreach ($filesbyid as $key => $file) { + $this->assertInstanceOf('stored_file', $file); + $this->assertEquals($key, $file->get_pathnamehash()); + } + + // Test with an itemid with no files + $areafiles = $fs->get_area_files($user->ctxid, 'user', 'private', 666, 'sortorder', false); + // Should be none. + $this->assertEmpty($areafiles); + } + + public function test_get_area_tree() { + $user = $this->setup_three_private_files(); + $fs = get_file_storage(); + + + // Get area files with default options. + $areatree = $fs->get_area_tree($user->ctxid, 'user', 'private', 0); + $this->assertEmpty($areatree['subdirs']); + $this->assertNotEmpty($areatree['files']); + $this->assertCount(3, $areatree['files']); + + // Ensure an empty try with a fake itemid. + $emptytree = $fs->get_area_tree($user->ctxid, 'user', 'private', 666); + $this->assertEmpty($emptytree['subdirs']); + $this->assertEmpty($emptytree['files']); + + // Create a subdir. + $dir = $fs->create_directory($user->ctxid, 'user', 'private', 0, '/testsubdir/'); + $this->assertInstanceOf('stored_file', $dir); + + // Add a file to the subdir. + $filerecord = array( + 'contextid' => $user->ctxid, + 'component' => 'user', + 'filearea' => 'private', + 'itemid' => 0, + 'filepath' => '/testsubdir/', + 'filename' => 'test-get-area-tree.txt', + ); + + $directoryfile = $fs->create_file_from_string($filerecord, 'Test content'); + $this->assertInstanceOf('stored_file', $directoryfile); + + $areatree = $fs->get_area_tree($user->ctxid, 'user', 'private', 0); + + // At the top level there should still be 3 files. + $this->assertCount(3, $areatree['files']); + + // There should now be a subdirectory. + $this->assertCount(1, $areatree['subdirs']); + + // The test subdir is named testsubdir. + $subdir = $areatree['subdirs']['testsubdir']; + $this->assertNotEmpty($subdir); + // It should have one file we added. + $this->assertCount(1, $subdir['files']); + // And no subdirs itself. + $this->assertCount(0, $subdir['subdirs']); + + // Verify the file is the one we added. + $subdirfile = reset($subdir['files']); + $this->assertInstanceOf('stored_file', $subdirfile); + $this->assertEquals($filerecord['filename'], $subdirfile->get_filename()); + } + + public function test_get_file_by_id() { + $user = $this->setup_three_private_files(); + $fs = get_file_storage(); + + $areafiles = $fs->get_area_files($user->ctxid, 'user', 'private'); + + // Test get_file_by_id. + $filebyid = reset($areafiles); + $shouldbesame = $fs->get_file_by_id($filebyid->get_id()); + $this->assertEquals($filebyid->get_contenthash(), $shouldbesame->get_contenthash()); + + // Test an id which doens't exist. + $doesntexist = $fs->get_file_by_id(99999); + $this->assertFalse($doesntexist); + } + + public function test_get_file_by_hash() { + $user = $this->setup_three_private_files(); + $fs = get_file_storage(); + + $areafiles = $fs->get_area_files($user->ctxid, 'user', 'private'); + // Test get_file_by_hash + $filebyhash = reset($areafiles); + $shouldbesame = $fs->get_file_by_hash($filebyhash->get_pathnamehash()); + $this->assertEquals($filebyhash->get_id(), $shouldbesame->get_id()); + + // Test an hash which doens't exist. + $doesntexist = $fs->get_file_by_hash('DOESNTEXIST'); + $this->assertFalse($doesntexist); + } + + public function test_get_references_by_storedfile() { + $user = $this->setup_three_private_files(); + $fs = get_file_storage(); + + $areafiles = $fs->get_area_files($user->ctxid, 'user', 'private'); + //Test get_file_by_hash + + $testfile = reset($areafiles); + $references = $fs->get_references_by_storedfile($testfile); + // TODO MDL-33368 Verify result!! + } + + public function test_get_external_files() { + $user = $this->setup_three_private_files(); + $fs = get_file_storage(); + + $repos = repository::get_instances(array('type'=>'user')); + $userrepository = reset($repos); + $this->assertInstanceOf('repository', $userrepository); + + // This should break on oracle. + $fs->get_external_files($userrepository->id, 'id'); + // TODO MDL-33368 Verify result!! + } + + public function test_create_directory_contextid_negative() { + $fs = get_file_storage(); + + $this->setExpectedException('file_exception'); + $fs->create_directory(-1, 'core', 'unittest', 0, '/'); + } + + public function test_create_directory_contextid_invalid() { + $fs = get_file_storage(); + + $this->setExpectedException('file_exception'); + $fs->create_directory('not an int', 'core', 'unittest', 0, '/'); + } + + public function test_create_directory_component_invalid() { + $fs = get_file_storage(); + $syscontext = context_system::instance(); + + $this->setExpectedException('file_exception'); + $fs->create_directory($syscontext->id, 'bad/component', 'unittest', 0, '/'); + } + + public function test_create_directory_filearea_invalid() { + $fs = get_file_storage(); + $syscontext = context_system::instance(); + + $this->setExpectedException('file_exception'); + $fs->create_directory($syscontext->id, 'core', 'bad-filearea', 0, '/'); + } + + public function test_create_directory_itemid_negative() { + $fs = get_file_storage(); + $syscontext = context_system::instance(); + + $this->setExpectedException('file_exception'); + $fs->create_directory($syscontext->id, 'core', 'unittest', -1, '/'); + } + + public function test_create_directory_itemid_invalid() { + $fs = get_file_storage(); + $syscontext = context_system::instance(); + + $this->setExpectedException('file_exception'); + $fs->create_directory($syscontext->id, 'core', 'unittest', 'notanint', '/'); + } + + public function test_create_directory_filepath_invalid() { + $fs = get_file_storage(); + $syscontext = context_system::instance(); + + $this->setExpectedException('file_exception'); + $fs->create_directory($syscontext->id, 'core', 'unittest', 0, '/not-with-trailing/or-leading-slash'); + } + + public function test_get_directory_files() { + $user = $this->setup_three_private_files(); + $fs = get_file_storage(); + + $dir = $fs->create_directory($user->ctxid, 'user', 'private', 0, '/testsubdir/'); + $this->assertInstanceOf('stored_file', $dir); + + // Add a file to the subdir. + $filerecord = array( + 'contextid' => $user->ctxid, + 'component' => 'user', + 'filearea' => 'private', + 'itemid' => 0, + 'filepath' => '/testsubdir/', + 'filename' => 'test-get-area-tree.txt', + ); + + $directoryfile = $fs->create_file_from_string($filerecord, 'Test content'); + $this->assertInstanceOf('stored_file', $directoryfile); + + // Don't recurse without dirs + $files = $fs->get_directory_files($user->ctxid, 'user', 'private', 0, '/', false, false, 'id'); + // 3 files only. + $this->assertCount(3, $files); + foreach ($files as $key => $file) { + $this->assertInstanceOf('stored_file', $file); + $this->assertEquals($key, $file->get_pathnamehash()); + } + + // Don't recurse with dirs. + $files = $fs->get_directory_files($user->ctxid, 'user', 'private', 0, '/', false, true, 'id'); + // 3 files + 1 directory. + $this->assertCount(4, $files); + foreach ($files as $key => $file) { + $this->assertInstanceOf('stored_file', $file); + $this->assertEquals($key, $file->get_pathnamehash()); + } + + // Recurse with dirs. + $files = $fs->get_directory_files($user->ctxid, 'user', 'private', 0, '/', true, true, 'id'); + // 3 files + 1 directory + 1 subdir file. + $this->assertCount(5, $files); + foreach ($files as $key => $file) { + $this->assertInstanceOf('stored_file', $file); + $this->assertEquals($key, $file->get_pathnamehash()); + } + + // Recurse without dirs. + $files = $fs->get_directory_files($user->ctxid, 'user', 'private', 0, '/', true, false, 'id'); + // 3 files + 1 subdir file. + $this->assertCount(4, $files); + foreach ($files as $key => $file) { + $this->assertInstanceOf('stored_file', $file); + $this->assertEquals($key, $file->get_pathnamehash()); + } + } + + public function test_search_references() { + $fs = get_file_storage(); + $references = $fs->search_references('testsearch'); + // TODO MDL-33368 Verify result!! + } + + public function test_search_references_count() { + $fs = get_file_storage(); + $references = $fs->search_references_count('testsearch'); + // TODO MDL-33368 Verify result!! + } + + public function test_delete_area_files() { + $user = $this->setup_three_private_files(); + $fs = get_file_storage(); + + // Get area files with default options. + $areafiles = $fs->get_area_files($user->ctxid, 'user', 'private'); + // Should be the two files we added plus the folder. + $this->assertEquals(4, count($areafiles)); + $fs->delete_area_files($user->ctxid, 'user', 'private'); + + $areafiles = $fs->get_area_files($user->ctxid, 'user', 'private'); + // Should be the two files we added plus the folder. + $this->assertEquals(0, count($areafiles)); + } + + public function test_delete_area_files_itemid() { + $user = $this->setup_three_private_files(); + $fs = get_file_storage(); + + // Get area files with default options. + $areafiles = $fs->get_area_files($user->ctxid, 'user', 'private'); + // Should be the two files we added plus the folder. + $this->assertEquals(4, count($areafiles)); + $fs->delete_area_files($user->ctxid, 'user', 'private', 9999); + + $areafiles = $fs->get_area_files($user->ctxid, 'user', 'private'); + $this->assertEquals(4, count($areafiles)); + } + + public function test_delete_area_files_select() { + $user = $this->setup_three_private_files(); + $fs = get_file_storage(); + + // Get area files with default options. + $areafiles = $fs->get_area_files($user->ctxid, 'user', 'private'); + // Should be the two files we added plus the folder. + $this->assertEquals(4, count($areafiles)); + $fs->delete_area_files_select($user->ctxid, 'user', 'private', '!= :notitemid', array('notitemid'=>9999)); + + $areafiles = $fs->get_area_files($user->ctxid, 'user', 'private'); + // Should be the two files we added plus the folder. + $this->assertEquals(0, count($areafiles)); + } + + public function test_create_file_from_url() { + $this->resetAfterTest(true); + + $syscontext = context_system::instance(); + $filerecord = array( + 'contextid' => $syscontext->id, + 'component' => 'core', + 'filearea' => 'unittest', + 'itemid' => 0, + 'filepath' => '/downloadtest/', + ); + $url = 'http://download.moodle.org/unittest/test.html'; + + $fs = get_file_storage(); + + // Test creating file without filename. + $file1 = $fs->create_file_from_url($filerecord, $url); + $this->assertInstanceOf('stored_file', $file1); + + // Set filename. + $filerecord['filename'] = 'unit-test-filename.html'; + $file2 = $fs->create_file_from_url($filerecord, $url); + $this->assertInstanceOf('stored_file', $file2); + + // Use temporary file. + $filerecord['filename'] = 'unit-test-with-temp-file.html'; + $file3 = $fs->create_file_from_url($filerecord, $url, null, true); + $file3 = $this->assertInstanceOf('stored_file', $file3); + } + + public function test_cron() { + $this->resetAfterTest(true); + + // Note: this is only testing DB compatibility atm, rather than + // that work is done. + $fs = get_file_storage(); + + $this->expectOutputRegex('/Cleaning up/'); + $fs->cron(); + } + + public function test_is_area_empty() { + $user = $this->setup_three_private_files(); + $fs = get_file_storage(); + + $this->assertFalse($fs->is_area_empty($user->ctxid, 'user', 'private')); + + // File area with madeup itemid should be empty. + $this->assertTrue($fs->is_area_empty($user->ctxid, 'user', 'private', 9999)); + // Still empty with dirs included. + $this->assertTrue($fs->is_area_empty($user->ctxid, 'user', 'private', 9999, false)); + } + + public function test_move_area_files_to_new_context() { + $this->resetAfterTest(true); + + // Create a course with a page resource. + $course = $this->getDataGenerator()->create_course(); + $page1 = $this->getDataGenerator()->create_module('page', array('course'=>$course->id)); + $page1context = context_module::instance($page1->cmid); + + // Add a file to the page. + $fs = get_file_storage(); + $filerecord = array( + 'contextid' => $page1context->id, + 'component' => 'mod_page', + 'filearea' => 'content', + 'itemid' => 0, + 'filepath' => '/', + 'filename' => 'unit-test-file.txt', + ); + + $originalfile = $fs->create_file_from_string($filerecord, 'Test content'); + $this->assertInstanceOf('stored_file', $originalfile); + + $pagefiles = $fs->get_area_files($page1context->id, 'mod_page', 'content', 0, 'sortorder', false); + // Should be one file in filearea. + $this->assertFalse($fs->is_area_empty($page1context->id, 'mod_page', 'content')); + + // Create a new page. + $page2 = $this->getDataGenerator()->create_module('page', array('course'=>$course->id)); + $page2context = context_module::instance($page2->cmid); + + // Newly created page area is empty. + $this->assertTrue($fs->is_area_empty($page2context->id, 'mod_page', 'content')); + + // Move the files. + $fs->move_area_files_to_new_context($page1context->id, $page2context->id, 'mod_page', 'content'); + + // Page2 filearea should no longer be empty. + $this->assertFalse($fs->is_area_empty($page2context->id, 'mod_page', 'content')); + + // Page1 filearea should now be empty. + $this->assertTrue($fs->is_area_empty($page1context->id, 'mod_page', 'content')); + + $page2files = $fs->get_area_files($page2context->id, 'mod_page', 'content', 0, 'sortorder', false); + $movedfile = reset($page2files); + + // The two files should have the same content hash. + $this->assertEquals($movedfile->get_contenthash(), $originalfile->get_contenthash()); + } + + public function test_convert_image() { + global $CFG; + + $this->resetAfterTest(false); + + $filepath = $CFG->dirroot.'/lib/filestorage/tests/fixtures/testimage.jpg'; + $syscontext = context_system::instance(); + $filerecord = array( + 'contextid' => $syscontext->id, + 'component' => 'core', + 'filearea' => 'unittest', + 'itemid' => 0, + 'filepath' => '/images/', + 'filename' => 'testimage.jpg', + ); + + $fs = get_file_storage(); + $original = $fs->create_file_from_pathname($filerecord, $filepath); + + $filerecord['filename'] = 'testimage-converted-10x10.jpg'; + $converted = $fs->convert_image($filerecord, $original, 10, 10, true, 100); + $this->assertInstanceOf('stored_file', $converted); + + $filerecord['filename'] = 'testimage-convereted-nosize.jpg'; + $converted = $fs->convert_image($filerecord, $original); + $this->assertInstanceOf('stored_file', $converted); + } + + private function generate_file_record() { + $syscontext = context_system::instance(); + $filerecord = new stdClass(); + $filerecord->contextid = $syscontext->id; + $filerecord->component = 'core'; + $filerecord->filearea = 'phpunit'; + $filerecord->filepath = '/'; + $filerecord->filename = 'testfile.txt'; + $filerecord->itemid = 0; + + return $filerecord; + } + + public function test_create_file_from_storedfile_file_invalid() { + $this->resetAfterTest(true); + + $filerecord = $this->generate_file_record(); + + $fs = get_file_storage(); + $this->setExpectedException('file_exception'); + // Create a file from a file id which doesn't exist. + $fs->create_file_from_storedfile($filerecord, 9999); + } + + public function test_create_file_from_storedfile_contextid_invalid() { + $this->resetAfterTest(true); + + $filerecord = $this->generate_file_record(); + + $fs = get_file_storage(); + $file1 = $fs->create_file_from_string($filerecord, 'text contents'); + $this->assertInstanceOf('stored_file', $file1); + + $filerecord->filename = 'invalid.txt'; + $filerecord->contextid = 'invalid'; + + $this->setExpectedException('file_exception', 'Invalid contextid'); + $fs->create_file_from_storedfile($filerecord, $file1->get_id()); + } + + public function test_create_file_from_storedfile_component_invalid() { + $this->resetAfterTest(true); + + $filerecord = $this->generate_file_record(); + + $fs = get_file_storage(); + $file1 = $fs->create_file_from_string($filerecord, 'text contents'); + $this->assertInstanceOf('stored_file', $file1); + + $filerecord->filename = 'invalid.txt'; + $filerecord->component = 'bad/component'; + + $this->setExpectedException('file_exception', 'Invalid component'); + $fs->create_file_from_storedfile($filerecord, $file1->get_id()); + } + + public function test_create_file_from_storedfile_filearea_invalid() { + $this->resetAfterTest(true); + + $filerecord = $this->generate_file_record(); + + $fs = get_file_storage(); + $file1 = $fs->create_file_from_string($filerecord, 'text contents'); + $this->assertInstanceOf('stored_file', $file1); + + $filerecord->filename = 'invalid.txt'; + $filerecord->filearea = 'bad-filearea'; + + $this->setExpectedException('file_exception', 'Invalid filearea'); + $fs->create_file_from_storedfile($filerecord, $file1->get_id()); + } + + public function test_create_file_from_storedfile_itemid_invalid() { + $this->resetAfterTest(true); + + $filerecord = $this->generate_file_record(); + + $fs = get_file_storage(); + $file1 = $fs->create_file_from_string($filerecord, 'text contents'); + $this->assertInstanceOf('stored_file', $file1); + + $filerecord->filename = 'invalid.txt'; + $filerecord->itemid = 'bad-itemid'; + + $this->setExpectedException('file_exception', 'Invalid itemid'); + $fs->create_file_from_storedfile($filerecord, $file1->get_id()); + } + + public function test_create_file_from_storedfile_filepath_invalid() { + $this->resetAfterTest(true); + + $filerecord = $this->generate_file_record(); + + $fs = get_file_storage(); + $file1 = $fs->create_file_from_string($filerecord, 'text contents'); + $this->assertInstanceOf('stored_file', $file1); + + $filerecord->filename = 'invalid.txt'; + $filerecord->filepath = 'a-/bad/-filepath'; + + $this->setExpectedException('file_exception', 'Invalid file path'); + $fs->create_file_from_storedfile($filerecord, $file1->get_id()); + } + + public function test_create_file_from_storedfile_filename_invalid() { + $this->resetAfterTest(true); + + $filerecord = $this->generate_file_record(); + + $fs = get_file_storage(); + $file1 = $fs->create_file_from_string($filerecord, 'text contents'); + $this->assertInstanceOf('stored_file', $file1); + + $filerecord->filename = ''; + + $this->setExpectedException('file_exception', 'Invalid file name'); + $fs->create_file_from_storedfile($filerecord, $file1->get_id()); + } + + public function test_create_file_from_storedfile_timecreated_invalid() { + $this->resetAfterTest(true); + + $filerecord = $this->generate_file_record(); + + $fs = get_file_storage(); + $file1 = $fs->create_file_from_string($filerecord, 'text contents'); + $this->assertInstanceOf('stored_file', $file1); + + $filerecord->filename = 'invalid.txt'; + $filerecord->timecreated = 'today'; + + $this->setExpectedException('file_exception', 'Invalid file timecreated'); + $fs->create_file_from_storedfile($filerecord, $file1->get_id()); + } + + public function test_create_file_from_storedfile_timemodified_invalid() { + $this->resetAfterTest(true); + + $filerecord = $this->generate_file_record(); + + $fs = get_file_storage(); + $file1 = $fs->create_file_from_string($filerecord, 'text contents'); + $this->assertInstanceOf('stored_file', $file1); + + $filerecord->filename = 'invalid.txt'; + $filerecord->timemodified = 'today'; + + $this->setExpectedException('file_exception', 'Invalid file timemodified'); + $fs->create_file_from_storedfile($filerecord, $file1->get_id()); + } + + public function test_create_file_from_storedfile_duplicate() { + $this->resetAfterTest(true); + + $filerecord = $this->generate_file_record(); + + $fs = get_file_storage(); + $file1 = $fs->create_file_from_string($filerecord, 'text contents'); + $this->assertInstanceOf('stored_file', $file1); + + // Creating a file validating unique constraint. + $this->setExpectedException('stored_file_creation_exception'); + $fs->create_file_from_storedfile($filerecord, $file1->get_id()); + } + + public function test_create_file_from_storedfile() { + $this->resetAfterTest(true); + + $syscontext = context_system::instance(); + + $filerecord = new stdClass(); + $filerecord->contextid = $syscontext->id; + $filerecord->component = 'core'; + $filerecord->filearea = 'phpunit'; + $filerecord->filepath = '/'; + $filerecord->filename = 'testfile.txt'; + $filerecord->itemid = 0; + + $fs = get_file_storage(); + + $file1 = $fs->create_file_from_string($filerecord, 'text contents'); + $this->assertInstanceOf('stored_file', $file1); + + $filerecord->filename = 'test-create-file-from-storedfile.txt'; + $file2 = $fs->create_file_from_storedfile($filerecord, $file1->get_id()); + $this->assertInstanceOf('stored_file', $file2); + + // These will be normalised to current time.. + $filerecord->timecreated = -100; + $filerecord->timemodified= -100; + $filerecord->filename = 'test-create-file-from-storedfile-bad-dates.txt'; + + $file3 = $fs->create_file_from_storedfile($filerecord, $file1->get_id()); + $this->assertInstanceOf('stored_file', $file3); + + $this->assertNotEquals($file3->get_timemodified(), $filerecord->timemodified); + $this->assertNotEquals($file3->get_timecreated(), $filerecord->timecreated); + } + + public function test_create_file_from_string_contextid_invalid() { + $this->resetAfterTest(true); + + $filerecord = $this->generate_file_record(); + $fs = get_file_storage(); + + $filerecord->contextid = 'invalid'; + + $this->setExpectedException('file_exception', 'Invalid contextid'); + $file1 = $fs->create_file_from_string($filerecord, 'text contents'); + } + + public function test_create_file_from_string_component_invalid() { + $this->resetAfterTest(true); + + $filerecord = $this->generate_file_record(); + $fs = get_file_storage(); + + $filerecord->component = 'bad/component'; + + $this->setExpectedException('file_exception', 'Invalid component'); + $file1 = $fs->create_file_from_string($filerecord, 'text contents'); + } + + public function test_create_file_from_string_filearea_invalid() { + $this->resetAfterTest(true); + + $filerecord = $this->generate_file_record(); + $fs = get_file_storage(); + + $filerecord->filearea = 'bad-filearea'; + + $this->setExpectedException('file_exception', 'Invalid filearea'); + $file1 = $fs->create_file_from_string($filerecord, 'text contents'); + } + + public function test_create_file_from_string_itemid_invalid() { + $this->resetAfterTest(true); + + $filerecord = $this->generate_file_record(); + $fs = get_file_storage(); + + $filerecord->itemid = 'bad-itemid'; + + $this->setExpectedException('file_exception', 'Invalid itemid'); + $file1 = $fs->create_file_from_string($filerecord, 'text contents'); + } + + public function test_create_file_from_string_filepath_invalid() { + $this->resetAfterTest(true); + + $filerecord = $this->generate_file_record(); + $fs = get_file_storage(); + + $filerecord->filepath = 'a-/bad/-filepath'; + + $this->setExpectedException('file_exception', 'Invalid file path'); + $file1 = $fs->create_file_from_string($filerecord, 'text contents'); + } + + public function test_create_file_from_string_filename_invalid() { + $this->resetAfterTest(true); + + $filerecord = $this->generate_file_record(); + $fs = get_file_storage(); + + $filerecord->filename = ''; + + $this->setExpectedException('file_exception', 'Invalid file name'); + $file1 = $fs->create_file_from_string($filerecord, 'text contents'); + } + + public function test_create_file_from_string_timecreated_invalid() { + $this->resetAfterTest(true); + + $filerecord = $this->generate_file_record(); + $fs = get_file_storage(); + + $filerecord->timecreated = 'today'; + + $this->setExpectedException('file_exception', 'Invalid file timecreated'); + $file1 = $fs->create_file_from_string($filerecord, 'text contents'); + } + + public function test_create_file_from_string_timemodified_invalid() { + $this->resetAfterTest(true); + + $filerecord = $this->generate_file_record(); + $fs = get_file_storage(); + + $filerecord->timemodified = 'today'; + + $this->setExpectedException('file_exception', 'Invalid file timemodified'); + $file1 = $fs->create_file_from_string($filerecord, 'text contents'); + } + + public function test_create_file_from_string_duplicate() { + $this->resetAfterTest(true); + + $filerecord = $this->generate_file_record(); + $fs = get_file_storage(); + + $file1 = $fs->create_file_from_string($filerecord, 'text contents'); + + // Creating a file validating unique constraint. + $this->setExpectedException('stored_file_creation_exception'); + $file2 = $fs->create_file_from_string($filerecord, 'text contents'); + } + + public function test_create_file_from_pathname_contextid_invalid() { + global $CFG; + $path = $CFG->dirroot.'/lib/filestorage/tests/fixtures/testimage.jpg'; + + $this->resetAfterTest(true); + + $filerecord = $this->generate_file_record(); + $fs = get_file_storage(); + + $filerecord->contextid = 'invalid'; + + $this->setExpectedException('file_exception', 'Invalid contextid'); + $file1 = $fs->create_file_from_pathname($filerecord, $path); + } + + public function test_create_file_from_pathname_component_invalid() { + global $CFG; + $path = $CFG->dirroot.'/lib/filestorage/tests/fixtures/testimage.jpg'; + + $this->resetAfterTest(true); + + $filerecord = $this->generate_file_record(); + $fs = get_file_storage(); + + $filerecord->component = 'bad/component'; + + $this->setExpectedException('file_exception', 'Invalid component'); + $file1 = $fs->create_file_from_pathname($filerecord, $path); + } + + public function test_create_file_from_pathname_filearea_invalid() { + global $CFG; + $path = $CFG->dirroot.'/lib/filestorage/tests/fixtures/testimage.jpg'; + + $this->resetAfterTest(true); + + $filerecord = $this->generate_file_record(); + $fs = get_file_storage(); + + $filerecord->filearea = 'bad-filearea'; + + $this->setExpectedException('file_exception', 'Invalid filearea'); + $file1 = $fs->create_file_from_pathname($filerecord, $path); + } + + public function test_create_file_from_pathname_itemid_invalid() { + global $CFG; + $path = $CFG->dirroot.'/lib/filestorage/tests/fixtures/testimage.jpg'; + + $this->resetAfterTest(true); + + $filerecord = $this->generate_file_record(); + $fs = get_file_storage(); + + $filerecord->itemid = 'bad-itemid'; + + $this->setExpectedException('file_exception', 'Invalid itemid'); + $file1 = $fs->create_file_from_pathname($filerecord, $path); + } + + public function test_create_file_from_pathname_filepath_invalid() { + global $CFG; + $path = $CFG->dirroot.'/lib/filestorage/tests/fixtures/testimage.jpg'; + + $this->resetAfterTest(true); + + $filerecord = $this->generate_file_record(); + $fs = get_file_storage(); + + $filerecord->filepath = 'a-/bad/-filepath'; + + $this->setExpectedException('file_exception', 'Invalid file path'); + $file1 = $fs->create_file_from_pathname($filerecord, $path); + } + + public function test_create_file_from_pathname_filename_invalid() { + global $CFG; + $path = $CFG->dirroot.'/lib/filestorage/tests/fixtures/testimage.jpg'; + + $this->resetAfterTest(true); + + $filerecord = $this->generate_file_record(); + $fs = get_file_storage(); + + $filerecord->filename = ''; + + $this->setExpectedException('file_exception', 'Invalid file name'); + $file1 = $fs->create_file_from_pathname($filerecord, $path); + } + + public function test_create_file_from_pathname_timecreated_invalid() { + global $CFG; + $path = $CFG->dirroot.'/lib/filestorage/tests/fixtures/testimage.jpg'; + + $this->resetAfterTest(true); + + $filerecord = $this->generate_file_record(); + $fs = get_file_storage(); + + $filerecord->timecreated = 'today'; + + $this->setExpectedException('file_exception', 'Invalid file timecreated'); + $file1 = $fs->create_file_from_pathname($filerecord, $path); + } + + public function test_create_file_from_pathname_timemodified_invalid() { + global $CFG; + $path = $CFG->dirroot.'/lib/filestorage/tests/fixtures/testimage.jpg'; + + $this->resetAfterTest(true); + + $filerecord = $this->generate_file_record(); + $fs = get_file_storage(); + + $filerecord->timemodified = 'today'; + + $this->setExpectedException('file_exception', 'Invalid file timemodified'); + $file1 = $fs->create_file_from_pathname($filerecord, $path); + } + + public function test_create_file_from_pathname_duplicate_file() { + global $CFG; + $this->resetAfterTest(true); + + $path = $CFG->dirroot.'/lib/filestorage/tests/fixtures/testimage.jpg'; + + $filerecord = $this->generate_file_record(); + $fs = get_file_storage(); + + $file1 = $fs->create_file_from_pathname($filerecord, $path); + $this->assertInstanceOf('stored_file', $file1); + + // Creating a file validating unique constraint. + $this->setExpectedException('stored_file_creation_exception'); + $file2 = $fs->create_file_from_pathname($filerecord, $path); } } diff --git a/lib/form/dndupload.js b/lib/form/dndupload.js index 385440ab7a6..2e1514c9c3f 100644 --- a/lib/form/dndupload.js +++ b/lib/form/dndupload.js @@ -64,18 +64,20 @@ M.form_dndupload.init = function(Y, options) { * maxfiles: maximum number of files this form allows * maxbytes: maximum size of files allowed in this form * clientid: unqiue id of this form field used for html elements - * containerprefix: prefix of htmlid of container + * containerid: htmlid of container * repositories: array of repository objects passed from filepicker * filemanager: filemanager element we are working with - * callback: callback to filepicker element to refesh when uploaded + * formcallback: callback to filepicker element to refesh when uploaded * } */ init: function(Y, options) { this.Y = Y; if (!this.browser_supported()) { + Y.one('body').addClass('dndnotsupported'); return; // Browser does not support the required functionality } + Y.one('body').addClass('dndsupported'); // try and retrieve enabled upload repository this.repositoryid = this.get_upload_repositoryid(options.repositories); @@ -89,21 +91,13 @@ M.form_dndupload.init = function(Y, options) { this.maxfiles = options.maxfiles; this.maxbytes = options.maxbytes; this.itemid = options.itemid; - this.container = this.Y.one(options.containerprefix + this.clientid); + this.author = options.author; + this.container = this.Y.one('#'+options.containerid); if (options.filemanager) { // Needed to tell the filemanager to redraw when files uploaded // and to check how many files are already uploaded this.filemanager = options.filemanager; - // Add a callback to show the 'drag and drop enabled' message - // within the filemanager box once it has finished loading, - // if there are no files yet uploaded - this.filemanager.emptycallback = function(clientid) { - var el = Y.one('#dndenabled2-'+clientid); - if (el) { - el.setStyle('display', 'inline'); - } - } } else if (options.formcallback) { // Needed to tell the filepicker to update when a new @@ -111,14 +105,13 @@ M.form_dndupload.init = function(Y, options) { this.callback = options.formcallback; } else { if (M.cfg.developerdebug) { - alert('dndupload: Need to define either options.filemanager or options.callback'); + alert('dndupload: Need to define either options.filemanager or options.formcallback'); } return; } this.init_events(); this.init_page_events(); - this.Y.one('#dndenabled-'+this.clientid).setStyle('display', 'inline'); }, /** @@ -361,11 +354,11 @@ M.form_dndupload.init = function(Y, options) { * Highlight the area where files could be dropped */ show_drop_target: function() { - this.Y.one('#filemanager-uploadmessage'+this.clientid).setStyle('display', 'block'); + this.container.addClass('dndupload-ready'); }, hide_drop_target: function() { - this.Y.one('#filemanager-uploadmessage'+this.clientid).setStyle('display', 'none'); + this.container.removeClass('dndupload-ready'); }, /** @@ -386,20 +379,14 @@ M.form_dndupload.init = function(Y, options) { * Display a progress spinner in the destination node */ show_progress_spinner: function() { - // add a loading spinner to show something is happening - var loadingspinner = this.Y.Node.create('
                    '); - loadingspinner.append(''); - this.container.append(loadingspinner); + this.container.addClass('dndupload-uploading'); }, /** * Remove progress spinner in the destination node */ hide_progress_spinner: function() { - var spinner = this.Y.one('#dndprogresspinner-'+this.clientid); - if (spinner) { - spinner.remove(); - } + this.container.removeClass('dndupload-uploading'); }, /** @@ -466,6 +453,9 @@ M.form_dndupload.init = function(Y, options) { formdata.append('sesskey', M.cfg.sesskey); formdata.append('repo_id', this.repositoryid); formdata.append('itemid', this.itemid); + if (this.author) { + formdata.append('author', this.author); + } if (this.filemanager) { // Filepickers do not have folders formdata.append('savepath', this.filemanager.currentpath); } diff --git a/lib/form/editor.php b/lib/form/editor.php index a993ffd467a..f36580becdb 100644 --- a/lib/form/editor.php +++ b/lib/form/editor.php @@ -302,8 +302,8 @@ class MoodleQuickForm_editor extends HTML_QuickForm_element { $args = new stdClass(); // need these three to filter repositories list - $args->accepted_types = array('image'); - $args->return_types = (FILE_INTERNAL | FILE_EXTERNAL); + $args->accepted_types = array('web_image'); + $args->return_types = (FILE_INTERNAL | FILE_EXTERNAL | FILE_REFERENCE); $args->context = $ctx; $args->env = 'filepicker'; // advimage plugin @@ -407,4 +407,4 @@ class MoodleQuickForm_editor extends HTML_QuickForm_element { return ''; } -} \ No newline at end of file +} diff --git a/lib/form/filemanager.js b/lib/form/filemanager.js index 915fe90627b..6627c2a9d21 100644 --- a/lib/form/filemanager.js +++ b/lib/form/filemanager.js @@ -26,6 +26,9 @@ * this.filecount, how many files in this filemanager * this.maxfiles * this.maxbytes + * this.filemanager, contains reference to filemanager Node + * this.selectnode, contains referenct to select-file Node + * this.selectui, YUI Panel to select the file * * FileManager options: * ===== @@ -34,7 +37,11 @@ */ -M.form_filemanager = {}; +M.form_filemanager = {templates:{}}; + +M.form_filemanager.set_templates = function(Y, templates) { + M.form_filemanager.templates = templates; +} /** * This fucntion is called for each file picker on page. @@ -76,25 +83,50 @@ M.form_filemanager.init = function(Y, options) { } else { this.filecount = 0; } + // prepare filemanager for drag-and-drop upload + this.filemanager = Y.one('#filemanager-'+options.client_id); + if (this.filemanager.hasClass('filemanager-container') || !this.filemanager.one('.filemanager-container')) { + this.dndcontainer = this.filemanager; + } else { + this.dndcontainer = this.filemanager.one('.filemanager-container'); + if (!this.dndcontainer.get('id')) { + this.dndcontainer.generateID(); + } + } + // save template for one path element and location of path bar + if (this.filemanager.one('.fp-path-folder')) { + this.pathnode = this.filemanager.one('.fp-path-folder'); + this.pathbar = this.pathnode.get('parentNode'); + this.pathbar.removeChild(this.pathnode); + } + // initialize 'select file' panel + this.selectnode = Y.Node.create(M.form_filemanager.templates.fileselectlayout); + this.selectnode.generateID(); + Y.one(document.body).appendChild(this.selectnode); + this.selectui = new Y.Panel({ + srcNode : this.selectnode, + zIndex : 600000, + centered : true, + modal : true, + close : true, + render : true + }); + this.selectui.plug(Y.Plugin.Drag,{handles:['#'+this.selectnode.get('id')+' .yui3-widget-hd']}); + this.selectui.hide(); + this.setup_select_file(); + // setup buttons onclick events this.setup_buttons(); + // set event handler for lazy loading of thumbnails + this.filemanager.one('.fp-content').on(['scroll','resize'], this.content_scrolled, this); + // display files + this.viewmode = 1; // TODO take from cookies? + this.filemanager.all('.fp-vb-icons,.fp-vb-tree,.fp-vb-details').removeClass('checked') + this.filemanager.all('.fp-vb-icons').addClass('checked') this.refresh(this.currentpath); // MDL-31113 get latest list from server }, - wait: function(client_id) { - var container = Y.one('#filemanager-'+client_id); - container.set('innerHTML', ''); - var html = Y.Node.create('
                      '); - container.appendChild(html); - var panel = Y.one('#draftfiles-'+client_id); - var name = ''; - var str = '
                      '; - str += ''; - str += '
                      '; - try { - panel.set('innerHTML', str); - } catch(e) { - alert(e.toString()); - } + wait: function() { + this.filemanager.addClass('fm-updating'); }, request: function(args, redraw) { var api = this.api + '?action='+args.action; @@ -120,7 +152,18 @@ M.form_filemanager.init = function(Y, options) { alert('IO FATAL'); return; } - var data = Y.JSON.parse(o.responseText); + var data = null; + try { + data = Y.JSON.parse(o.responseText); + } catch(e) { + // TODO display error + scope.print_msg(M.str.repository.invalidjson, 'error'); + //scope.display_error(M.str.repository.invalidjson+'
                      '+stripHTML(o.responseText)+'
                      ', 'invalidjson') + return; + } + if (data && data.tree && scope.set_current_tree) { + scope.set_current_tree(data.tree); + } args.callback(id,data,p); } }, @@ -138,7 +181,7 @@ M.form_filemanager.init = function(Y, options) { } Y.io(api, cfg); if (redraw) { - this.wait(this.client_id); + this.wait(); } }, filepicker_callback: function(obj) { @@ -150,12 +193,16 @@ M.form_filemanager.init = function(Y, options) { } }, check_buttons: function() { - var button_addfile = Y.one("#btnadd-"+this.client_id); - if (this.filecount > 0) { - Y.one("#btndwn-"+this.client_id).setStyle('display', 'inline'); + if (this.filecount>0) { + this.filemanager.removeClass('fm-nofiles'); + } else { + this.filemanager.addClass('fm-nofiles'); } if (this.filecount >= this.maxfiles && this.maxfiles!=-1) { - button_addfile.setStyle('display', 'none'); + this.filemanager.addClass('fm-maxfiles'); + } + else { + this.filemanager.removeClass('fm-maxfiles'); } }, refresh: function(filepath) { @@ -174,39 +221,70 @@ M.form_filemanager.init = function(Y, options) { scope.filecount = obj.filecount; scope.check_buttons(); scope.options = obj; + scope.lazyloading = {}; scope.render(obj); } }, true); }, + /** displays message in a popup */ + print_msg: function(msg, type) { + var header = M.str.moodle.error; + if (type != 'error') { + type = 'info'; // one of only two types excepted + header = M.str.moodle.info; + } + if (!this.msg_dlg) { + var node = Y.Node.create(M.form_filemanager.templates.message); + this.filemanager.appendChild(node); + + this.msg_dlg = new Y.Panel({ + srcNode : node, + zIndex : 800000, + centered : true, + modal : true, + visible : false, + render : true + }); + this.msg_dlg.plug(Y.Plugin.Drag,{handles:['.yui3-widget-hd']}); + node.one('.fp-msg-butok').on('click', function(e) { + e.preventDefault(); + this.msg_dlg.hide(); + }, this); + } + + this.msg_dlg.set('headerContent', header); + this.filemanager.one('.fp-msg').removeClass('fp-msg-info').removeClass('fp-msg-error').addClass('fp-msg-'+type) + this.filemanager.one('.fp-msg .fp-msg-text').setContent(msg); + this.msg_dlg.show(); + }, setup_buttons: function() { - var button_download = Y.one("#btndwn-"+this.client_id); - var button_create = Y.one("#btncrt-"+this.client_id); - var button_addfile = Y.one("#btnadd-"+this.client_id); + var button_download = this.filemanager.one('.fp-btn-download'); + var button_create = this.filemanager.one('.fp-btn-mkdir'); + var button_addfile = this.filemanager.one('.fp-btn-add'); // setup 'add file' button // if maxfiles == -1, the no limit - if (this.filecount >= this.maxfiles - && this.maxfiles!=-1) { - button_addfile.setStyle('display', 'none'); - } else { - button_addfile.on('click', function(e) { - var options = this.filepicker_options; - options.formcallback = this.filepicker_callback; - // XXX: magic here, to let filepicker use filemanager scope - options.magicscope = this; - options.savepath = this.currentpath; - M.core_filepicker.show(Y, options); - }, this); - } + button_addfile.on('click', function(e) { + e.preventDefault(); + var options = this.filepicker_options; + options.formcallback = this.filepicker_callback; + // XXX: magic here, to let filepicker use filemanager scope + options.magicscope = this; + options.savepath = this.currentpath; + M.core_filepicker.show(Y, options); + }, this); // setup 'make a folder' button if (this.options.subdirs) { button_create.on('click',function(e) { + e.preventDefault(); var scope = this; // a function used to perform an ajax request - function perform_action(e) { - var foldername = Y.one('#fm-newname').get('value'); + var perform_action = function(e) { + e.preventDefault(); + var foldername = Y.one('#fm-newname-'+scope.client_id).get('value'); if (!foldername) { + scope.mkdir_dialog.hide(); return; } scope.request({ @@ -216,39 +294,45 @@ M.form_filemanager.init = function(Y, options) { var filepath = obj.filepath; scope.mkdir_dialog.hide(); scope.refresh(filepath); - Y.one('#fm-newname').set('value', ''); + Y.one('#fm-newname-'+scope.client_id).set('value', ''); if (typeof M.core_formchangechecker != 'undefined') { M.core_formchangechecker.set_form_changed(); } } }); } - if (!Y.one('#fm-mkdir-dlg')) { - var dialog = Y.Node.create('
                      '+M.str.repository.entername+'
                      '); - Y.one(document.body).appendChild(dialog); - this.mkdir_dialog = new YAHOO.widget.Dialog("fm-mkdir-dlg", { - width: "300px", - visible: true, - x:e.pageX, - y:e.pageY, - constraintoviewport : true - }); - + if (!this.mkdir_dialog) { + var node = Y.Node.create(M.form_filemanager.templates.mkdir); + this.filemanager.appendChild(node); + this.mkdir_dialog = new Y.Panel({ + srcNode : node, + zIndex : 800000, + centered : true, + modal : true, + visible : false, + render : true + }); + this.mkdir_dialog.plug(Y.Plugin.Drag,{handles:['.yui3-widget-hd']}); + node.one('.fp-dlg-butcreate').on('click', perform_action, this); + node.one('input').set('id', 'fm-newname-'+this.client_id). + on('keydown', function(e){ + if (e.keyCode == 13) {Y.bind(perform_action, this)(e);} + }, this); + node.all('.fp-dlg-butcancel').on('click', function(e){e.preventDefault();this.mkdir_dialog.hide();}, this); + node.all('.fp-dlg-curpath').set('id', 'fm-curpath-'+this.client_id); } - var buttons = [ { text:M.str.moodle.ok, handler:perform_action, isDefault:true }, - { text:M.str.moodle.cancel, handler:function(){this.cancel();}}]; - - this.mkdir_dialog.cfg.queueProperty("buttons", buttons); - this.mkdir_dialog.render(); this.mkdir_dialog.show(); + Y.one('#fm-newname-'+scope.client_id).focus(); + Y.all('#fm-curpath-'+scope.client_id).setContent(this.currentpath) }, this); } else { - button_create.setStyle('display', 'none'); + this.filemanager.addClass('fm-nomkdir'); } // setup 'download this folder' button // NOTE: popup window must be enabled to perform download process - button_download.on('click',function() { + button_download.on('click',function(e) { + e.preventDefault(); var scope = this; // perform downloaddir ajax request this.request({ @@ -259,563 +343,632 @@ M.form_filemanager.init = function(Y, options) { scope.refresh(obj.filepath); var win = window.open(obj.fileurl, 'fm-download-folder'); if (!win) { - alert(M.str.repository.popupblockeddownload); + scope.print_msg(M.str.repository.popupblockeddownload, 'error'); } } else { - alert(M.str.repository.draftareanofiles); + scope.print_msg(M.str.repository.draftareanofiles, 'error'); } } }); }, this); + + this.filemanager.all('.fp-vb-icons,.fp-vb-tree,.fp-vb-details'). + on('click', function(e) { + e.preventDefault(); + var viewbar = this.filemanager.one('.fp-viewbar') + if (!viewbar || !viewbar.hasClass('disabled')) { + this.filemanager.all('.fp-vb-icons,.fp-vb-tree,.fp-vb-details').removeClass('checked') + if (e.currentTarget.hasClass('fp-vb-tree')) { + this.viewmode = 2; + } else if (e.currentTarget.hasClass('fp-vb-details')) { + this.viewmode = 3; + } else { + this.viewmode = 1; + } + e.currentTarget.addClass('checked') + this.render(); + //Y.Cookie.set('recentviewmode', this.viewmode); + } + }, this); }, - empty_filelist: function(container) { - var content = '
                      '+M.str.repository.nofilesattached; - content += ''; - content += '
                      '; - content += this.upload_message(); - container.set('innerHTML', content); - if (this.emptycallback) { - this.emptycallback(this.client_id); - } - }, - upload_message: function() { - var div = ''; - return div; - }, - render: function() { - var options = this.options; - var path = this.options.path; - var list = this.options.list; - var breadcrumb = Y.one('#fm-path-'+this.client_id); - // build breadcrumb - if (path) { - // empty breadcrumb - breadcrumb.set('innerHTML', ''); - var count = 0; - for(var p in path) { - var arrow = ''; - if (count==0) { - arrow = Y.Node.create(''+M.str.moodle.path + ': '); + print_path: function() { + var p = this.options.path; + this.pathbar.setContent('').addClass('empty'); + if (p && p.length!=0 && this.viewmode != 2) { + for(var i = 0; i < p.length; i++) { + var el = this.pathnode.cloneNode(true); + this.pathbar.appendChild(el); + + if (i == 0) { + el.addClass('first'); + } + if (i == p.length-1) { + el.addClass('last'); + } + + if (i%2) { + el.addClass('even'); } else { - arrow = Y.Node.create(''); + el.addClass('odd'); } - count++; - - var pathid = 'fm-path-node-'+this.client_id; - pathid += ('-'+count); - - var crumb = Y.Node.create(''+path[p].name+''); - breadcrumb.appendChild(arrow); - breadcrumb.appendChild(crumb); - - var args = {}; - args.requestpath = path[p].path; - args.client_id = this.client_id; - Y.one('#'+pathid).on('click', function(e, args) { - var scope = this; - var params = {}; - params['filepath'] = args.requestpath; - this.currentpath = args.requestpath; - this.request({ - action: 'list', - scope: scope, - params: params, - callback: function(id, obj, args) { - scope.filecount = obj.filecount; - scope.check_buttons(); - scope.options = obj; - scope.render(obj); - } - }, true); - }, this, args); + el.one('.fp-path-folder-name').setContent(p[i].name). + on('click', function(e, path) { + e.preventDefault(); + this.refresh(path); + }, this, p[i].path); + } + this.pathbar.removeClass('empty'); + } + }, + get_filepath: function(obj) { + if (obj.path && obj.path.length) { + return obj.path[obj.path.length-1].path; + } + return ''; + }, + treeview_dynload: function(node, cb) { + var retrieved_children = {}; + if (node.children) { + for (var i in node.children) { + retrieved_children[node.children[i].path] = node.children[i]; } } - var template = Y.one('#fm-template'); - var container = Y.one('#filemanager-' + this.client_id); - var listhtml = ''; - - // folder list items - var folder_ids = []; - var folder_data = {}; - - // normal file list items - var file_ids = []; - var file_data = {}; - - // archives list items - var zip_ids = []; - var zip_data = {}; - - var html_ids = []; - var html_data = {}; - - file_data.itemid = folder_data.itemid = zip_data.itemid = options.itemid; - file_data.client_id = folder_data.client_id = zip_data.client_id = this.client_id; - - var foldername_ids = []; - if (!list || list.length == 0) { - // hide file browser and breadcrumb - //container.setStyle('display', 'none'); - this.empty_filelist(container); - if (!path || path.length <= 1) { - breadcrumb.setStyle('display', 'none'); + if (!node.path || node.path == '/') { + // this is a root pseudo folder + node.fileinfo.filepath = '/'; + node.fileinfo.type = 'folder'; + node.fileinfo.fullname = node.fileinfo.title; + node.fileinfo.filename = '.'; + } + this.request({ + action:'list', + params: {filepath:node.path?node.path:''}, + scope:this, + callback: function(id, obj, args) { + var list = obj.list; + var scope = args.scope; + // check that user did not leave the view mode before recieving this response + if (!(scope.viewmode == 2 && node && node.getChildrenEl())) { + return; + } + if (cb != null) { // (in manual mode do not update current path) + scope.options = obj; + scope.currentpath = node.path?node.path:'/'; + } + node.highlight(false); + node.origlist = obj.list ? obj.list : null; + node.origpath = obj.path ? obj.path : null; + node.children = []; + for(k in list) { + if (list[k].type == 'folder' && retrieved_children[list[k].filepath]) { + // if this child is a folder and has already been retrieved + retrieved_children[list[k].filepath].fileinfo = list[k]; + node.children[node.children.length] = retrieved_children[list[k].filepath]; + } else { + // append new file to the list + scope.view_files([list[k]]); + } + } + if (cb == null) { + node.refresh(); + } else { + // invoke callback requested by TreeView component + cb(); + } + scope.content_scrolled(); } + }, false); + }, + content_scrolled: function(e) { + setTimeout(Y.bind(function() { + if (this.processingimages) {return;} + this.processingimages = true; + var scope = this, + fpcontent = this.filemanager.one('.fp-content'), + fpcontenty = fpcontent.getY(), + fpcontentheight = fpcontent.getStylePx('height'), + is_node_visible = function(node) { + var offset = node.getY()-fpcontenty; + if (offset <= fpcontentheight && (offset >=0 || offset+node.getStylePx('height')>=0)) { + return true; + } + return false; + }; + // replace src for visible images that need to be lazy-loaded + if (scope.lazyloading) { + fpcontent.all('img').each( function(node) { + if (node.get('id') && scope.lazyloading[node.get('id')] && is_node_visible(node)) { + node.setImgRealSrc(scope.lazyloading); + } + }); + } + this.processingimages = false; + }, this), 200) + }, + view_files: function(appendfiles) { + this.filemanager.removeClass('fm-updating').removeClass('fm-noitems'); + if ((appendfiles == null) && (!this.options.list || this.options.list.length == 0) && this.viewmode != 2) { + this.filemanager.addClass('fm-noitems'); return; + } + var list = (appendfiles != null) ? appendfiles : this.options.list; + var element_template; + if (this.viewmode == 2 || this.viewmode == 3) { + element_template = Y.Node.create(M.form_filemanager.templates.listfilename); } else { - container.setStyle('display', 'block'); - breadcrumb.setStyle('display', 'block'); + this.viewmode = 1; + element_template = Y.Node.create(M.form_filemanager.templates.iconfilename); } - - var count = 0; - for(var i in list) { - count++; - // the li html element - var htmlid = 'fileitem-'+this.client_id+'-'+count; - // link to file - var fileid = 'filename-'+this.client_id+'-'+count; - // file menu - var action = 'action-' +this.client_id+'-'+count; - - var html = template.get('innerHTML'); - - html_ids.push('#'+htmlid); - html_data[htmlid] = action; - - list[i].htmlid = htmlid; - list[i].fileid = fileid; - list[i].action = action; - - var url = "###"; - - switch (list[i].type) { - case 'folder': - // click folder name - foldername_ids.push('#'+fileid); - // click folder menu - folder_ids.push('#'+action); - folder_data[action] = list[i]; - folder_data[fileid] = list[i]; - break; - case 'file': - file_ids.push('#'+action); - // click file name - file_ids.push('#'+fileid); - file_data[action] = list[i]; - file_data[fileid] = list[i]; - if (list[i].url) { - url = list[i].url; - } - break; - case 'zip': - zip_ids.push('#'+action); - zip_ids.push('#'+fileid); - zip_data[action] = list[i]; - zip_data[fileid] = list[i]; - if (list[i].url) { - url = list[i].url; - } - break; + var options = { + viewmode : this.viewmode, + appendonly : appendfiles != null, + filenode : element_template, + callbackcontext : this, + callback : function(e, node) { + if (e.preventDefault) { e.preventDefault(); } + if (node.type == 'folder') { + this.refresh(node.filepath); + } else { + this.select_file(node); + } + }, + rightclickcallback : function(e, node) { + if (e.preventDefault) { e.preventDefault(); } + this.select_file(node); + }, + classnamecallback : function(node) { + var classname = ''; + if (node.type == 'folder' || (!node.type && !node.filename)) { + classname = classname + ' fp-folder'; + } + if (node.filename || node.filepath || (node.path && node.path != '/')) { + classname = classname + ' fp-hascontextmenu'; + } + if (node.isref) { + classname = classname + ' fp-isreference'; + } + if (node.refcount) { + classname = classname + ' fp-hasreferences'; + } + if (node.sortorder == 1) { classname = classname + ' fp-mainfile';} + return Y.Lang.trim(classname); } - var fullname = list[i].fullname; - - if (list[i].sortorder == 1) { - html = html.replace('___fullname___', ' ' + fullname + ''); - } else { - html = html.replace('___fullname___', ' ' + fullname + ''); + }; + if (this.viewmode == 2) { + options.dynload = true; + options.filepath = this.options.path; + options.treeview_dynload = this.treeview_dynload; + options.norootrightclick = true; + options.callback = function(e, node) { + // TODO MDL-32736 e is not an event here but an object with properties 'event' and 'node' + if (!node.fullname) {return;} + if (node.type != 'folder') { + if (e.node.parent && e.node.parent.origpath) { + // set the current path + this.options.path = e.node.parent.origpath; + this.options.list = e.node.parent.origlist; + this.print_path(); + } + this.currentpath = node.filepath; + this.select_file(node); + } else { + // save current path and filelist (in case we want to jump to other viewmode) + this.options.path = e.node.origpath; + this.options.list = e.node.origlist; + this.currentpath = node.filepath; + this.print_path(); + //this.content_scrolled(); + } + }; + } + if (!this.lazyloading) { + this.lazyloading={}; + } + this.filemanager.one('.fp-content').fp_display_filelist(options, list, this.lazyloading); + this.content_scrolled(); + }, + populate_licenses_select: function(node) { + if (!node) { + return; + } + node.setContent(''); + var licenses = this.options.licenses; + for (var i in licenses) { + var option = Y.Node.create('
                    • '+html+'
                    • '; - listhtml += html; } - if (!Y.one('#draftfiles-'+this.client_id)) { - var filelist = Y.Node.create('
                        '); - container.appendChild(filelist); + var list = ['/']; + appendfilepaths(list, tree); + var selectnode = this.selectnode; + node = selectnode.one('.fp-path select'); + node.setContent(''); + for (var i in list) { + node.appendChild(Y.Node.create('