From 46f7b7096450939fe03c95aa81ce06ae4bfca89d Mon Sep 17 00:00:00 2001 From: Aleksander Machniak <alec@alec.pl> Date: Mon, 28 Mar 2016 06:51:43 -0400 Subject: [PATCH] Enable reply/reply-all/forward buttons also in preview frame of message/rfc822 --- plugins/jqueryui/jqueryui.php | 42 ++++++++++++++++++++++++++++++++++-------- 1 files changed, 34 insertions(+), 8 deletions(-) diff --git a/plugins/jqueryui/jqueryui.php b/plugins/jqueryui/jqueryui.php index 601e161..7853d09 100644 --- a/plugins/jqueryui/jqueryui.php +++ b/plugins/jqueryui/jqueryui.php @@ -5,7 +5,7 @@ * * Provide the jQuery UI library with according themes. * - * @version 1.9.2 + * @version 1.10.4 * @author Cor Bosman <roundcube@wa.ter.net> * @author Thomas Bruederli <roundcube@gmail.com> * @license GNU GPLv3+ @@ -13,32 +13,37 @@ class jqueryui extends rcube_plugin { public $noajax = true; + public $version = '1.10.4'; private static $features = array(); private static $ui_theme; public function init() { - $version = '1.9.2'; - $rcmail = rcmail::get_instance(); + + // the plugin might have been force-loaded so do some sanity check first + if ($rcmail->output->type != 'html' || self::$ui_theme) { + return; + } + $this->load_config(); // include UI scripts - $this->include_script("js/jquery-ui-$version.custom.min.js"); + $this->include_script("js/jquery-ui-$this->version.custom.min.js"); // include UI stylesheet $skin = $rcmail->config->get('skin'); $ui_map = $rcmail->config->get('jquery_ui_skin_map', array()); - $ui_theme = $ui_map[$skin] ? $ui_map[$skin] : $skin; + $ui_theme = $ui_map[$skin] ?: $skin; self::$ui_theme = $ui_theme; - if (file_exists($this->home . "/themes/$ui_theme/jquery-ui-$version.custom.css")) { - $this->include_stylesheet("themes/$ui_theme/jquery-ui-$version.custom.css"); + if (file_exists($this->home . "/themes/$ui_theme/jquery-ui-$this->version.custom.css")) { + $this->include_stylesheet("themes/$ui_theme/jquery-ui-$this->version.custom.css"); } else { - $this->include_stylesheet("themes/larry/jquery-ui-$version.custom.css"); + $this->include_stylesheet("themes/larry/jquery-ui-$this->version.custom.css"); } if ($ui_theme == 'larry') { @@ -109,6 +114,27 @@ $rcube->output->set_env('mscolors', self::get_color_values()); } + public static function tagedit() + { + if (in_array('tagedit', self::$features)) { + return; + } + + self::$features[] = 'tagedit'; + + $script = 'plugins/jqueryui/js/jquery.tagedit.js'; + $rcube = rcube::get_instance(); + $ui_theme = self::$ui_theme; + $css = "plugins/jqueryui/themes/$ui_theme/tagedit.css"; + + if (!file_exists(INSTALL_PATH . $css)) { + $css = "plugins/jqueryui/themes/larry/tagedit.css"; + } + + $rcube->output->include_css($css); + $rcube->output->add_header(html::tag('script', array('type' => "text/javascript", 'src' => $script))); + } + /** * Return a (limited) list of color values to be used for calendar and category coloring * -- Gitblit v1.9.1