summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/additional_message_headers/config.inc.php.dist2
-rw-r--r--plugins/emoticons/emoticons.php4
-rw-r--r--plugins/hide_blockquote/hide_blockquote.js2
-rw-r--r--plugins/legacy_browser/js/iehacks.js80
-rw-r--r--plugins/legacy_browser/legacy_browser.php11
-rw-r--r--plugins/managesieve/skins/classic/templates/vacation.html2
-rw-r--r--plugins/newmail_notifier/newmail_notifier.php4
-rw-r--r--plugins/password/README3
-rw-r--r--plugins/password/config.inc.php.dist3
-rw-r--r--plugins/password/drivers/vpopmaild.php2
10 files changed, 103 insertions, 10 deletions
diff --git a/plugins/additional_message_headers/config.inc.php.dist b/plugins/additional_message_headers/config.inc.php.dist
index 72a4f1cee..904681349 100644
--- a/plugins/additional_message_headers/config.inc.php.dist
+++ b/plugins/additional_message_headers/config.inc.php.dist
@@ -1,7 +1,7 @@
<?php
// $config['additional_message_headers']['X-Remote-Browser'] = $_SERVER['HTTP_USER_AGENT'];
-// $config['additional_message_headers']['X-Originating-IP'] = $_SERVER['REMOTE_ADDR'];
+// $config['additional_message_headers']['X-Originating-IP'] = '[' . $_SERVER['REMOTE_ADDR'] .']';
// $config['additional_message_headers']['X-RoundCube-Server'] = $_SERVER['SERVER_ADDR'];
// if( isset( $_SERVER['MACHINE_NAME'] )) {
diff --git a/plugins/emoticons/emoticons.php b/plugins/emoticons/emoticons.php
index c986686e3..187e83827 100644
--- a/plugins/emoticons/emoticons.php
+++ b/plugins/emoticons/emoticons.php
@@ -71,8 +71,8 @@ class emoticons extends rcube_plugin
}
private function img_tag($ico, $title)
- {
- $path = './program/js/tiny_mce/plugins/emotions/img/';
+ {
+ $path = './program/js/tinymce/plugins/emoticons/img/';
return html::img(array('src' => $path.$ico, 'title' => $title));
}
}
diff --git a/plugins/hide_blockquote/hide_blockquote.js b/plugins/hide_blockquote/hide_blockquote.js
index 2d28076a1..964cc07a3 100644
--- a/plugins/hide_blockquote/hide_blockquote.js
+++ b/plugins/hide_blockquote/hide_blockquote.js
@@ -25,7 +25,7 @@ function hide_blockquote()
if (limit <= 0)
return;
- $('pre > blockquote', $('#messagebody')).each(function() {
+ $('div.message-part div.pre > blockquote', $('#messagebody')).each(function() {
var div, link, q = $(this),
text = $.trim(q.text()),
res = text.split(/\n/);
diff --git a/plugins/legacy_browser/js/iehacks.js b/plugins/legacy_browser/js/iehacks.js
index 129ad6003..91dc6d63a 100644
--- a/plugins/legacy_browser/js/iehacks.js
+++ b/plugins/legacy_browser/js/iehacks.js
@@ -1,7 +1,8 @@
// Make getElementById() case-sensitive on IE7
document._getElementById = document.getElementById;
-document.getElementById = function(id) {
+document.getElementById = function(id)
+{
var i = 0, obj = document._getElementById(id);
if (obj && obj.id != id)
@@ -18,3 +19,80 @@ $(document).ready(function() {
$('li:last-child', ul).css('border-bottom', 0);
});
});
+
+// gets cursor position (IE<9)
+rcube_webmail.prototype.get_caret_pos = function(obj)
+{
+ if (document.selection && document.selection.createRange) {
+ var range = document.selection.createRange();
+ if (range.parentElement() != obj)
+ return 0;
+
+ var gm = range.duplicate();
+ if (obj.tagName == 'TEXTAREA')
+ gm.moveToElementText(obj);
+ else
+ gm.expand('textedit');
+
+ gm.setEndPoint('EndToStart', range);
+ var p = gm.text.length;
+
+ return p <= obj.value.length ? p : -1;
+ }
+
+ return obj.value.length;
+};
+
+// moves cursor to specified position (IE<9)
+rcube_webmail.prototype.set_caret_pos = function(obj, pos)
+{
+ if (obj.createTextRange) {
+ var range = obj.createTextRange();
+ range.collapse(true);
+ range.moveEnd('character', pos);
+ range.moveStart('character', pos);
+ range.select();
+ }
+};
+
+// get selected text from an input field (IE<9)
+// http://stackoverflow.com/questions/7186586/how-to-get-the-selected-text-in-textarea-using-jquery-in-internet-explorer-7
+rcube_webmail.prototype.get_input_selection = function(obj)
+{
+ var start = 0, end = 0, len,
+ normalizedValue, textInputRange, endRange,
+ range = document.selection.createRange();
+
+ if (range && range.parentElement() == obj) {
+ len = obj.value.length;
+ normalizedValue = obj.value; //.replace(/\r\n/g, "\n");
+
+ // create a working TextRange that lives only in the input
+ textInputRange = obj.createTextRange();
+ textInputRange.moveToBookmark(range.getBookmark());
+
+ // Check if the start and end of the selection are at the very end
+ // of the input, since moveStart/moveEnd doesn't return what we want
+ // in those cases
+ endRange = obj.createTextRange();
+ endRange.collapse(false);
+
+ if (textInputRange.compareEndPoints("StartToEnd", endRange) > -1) {
+ start = end = len;
+ }
+ else {
+ start = -textInputRange.moveStart("character", -len);
+ start += normalizedValue.slice(0, start).split("\n").length - 1;
+
+ if (textInputRange.compareEndPoints("EndToEnd", endRange) > -1) {
+ end = len;
+ }
+ else {
+ end = -textInputRange.moveEnd("character", -len);
+ end += normalizedValue.slice(0, end).split("\n").length - 1;
+ }
+ }
+ }
+
+ return {start: start, end: end, text: normalizedValue.substr(start, end-start)};
+};
diff --git a/plugins/legacy_browser/legacy_browser.php b/plugins/legacy_browser/legacy_browser.php
index 0dc0794f3..9378cdc3e 100644
--- a/plugins/legacy_browser/legacy_browser.php
+++ b/plugins/legacy_browser/legacy_browser.php
@@ -25,10 +25,17 @@ class legacy_browser extends rcube_plugin
// replace jQuery 2.x with 1.x
$ts1 = filemtime($this->home . '/js/jquery.min.js');
$ts2 = filemtime($this->home . '/js/iehacks.js');
+
+ // put iehacks.js after app.js
+ $args['content'] = preg_replace(
+ '|(<script src="program/js/app(\.min)?\.js\?s=[0-9]+" type="text/javascript"></script>)|',
+ '\\1<script src="plugins/legacy_browser/js/iehacks.js?s=' . $ts2 . '" type="text/javascript"></script>',
+ $args['content'], 1, $count);
+
$args['content'] = preg_replace(
'|<script src="program/js/jquery\.min\.js\?s=[0-9]+" type="text/javascript"></script>|',
- '<script src="plugins/legacy_browser/js/jquery.min.js?s=' . $ts1 . '" type="text/javascript"></script>'."\n"
- .'<script src="plugins/legacy_browser/js/iehacks.js?s=' . $ts2 . '" type="text/javascript"></script>',
+ '<script src="plugins/legacy_browser/js/jquery.min.js?s=' . $ts1 . '" type="text/javascript"></script>'
+ . ($count ? '' : "\n".'<script src="plugins/legacy_browser/js/iehacks.js?s=' . $ts2 . '" type="text/javascript"></script>'),
$args['content'], 1);
return $args;
diff --git a/plugins/managesieve/skins/classic/templates/vacation.html b/plugins/managesieve/skins/classic/templates/vacation.html
index bf94edb20..26e408eef 100644
--- a/plugins/managesieve/skins/classic/templates/vacation.html
+++ b/plugins/managesieve/skins/classic/templates/vacation.html
@@ -17,7 +17,7 @@
<roundcube:object name="vacationform" id="vacationform" style="margin: 10px 10px 0 10px" />
<div id="formfooter" style="padding: 0 10px">
<div class="footerleft">
- <roundcube:button command="save" type="input" class="button mainaction" label="save" />
+ <roundcube:button command="plugin.managesieve-save" type="input" class="button mainaction" label="save" />
</div>
</div>
</div>
diff --git a/plugins/newmail_notifier/newmail_notifier.php b/plugins/newmail_notifier/newmail_notifier.php
index 20c542f58..efac69116 100644
--- a/plugins/newmail_notifier/newmail_notifier.php
+++ b/plugins/newmail_notifier/newmail_notifier.php
@@ -52,8 +52,8 @@ class newmail_notifier extends rcube_plugin
$this->add_hook('preferences_save', array($this, 'prefs_save'));
}
else { // if ($this->rc->task == 'mail') {
- // add script when not in ajax and not in frame
- if ($this->rc->output->type == 'html' && empty($_REQUEST['_framed'])) {
+ // add script when not in ajax and not in frame and only in main window
+ if ($this->rc->output->type == 'html' && empty($_REQUEST['_framed']) && $this->rc->action == '') {
$this->add_texts('localization/');
$this->rc->output->add_label('newmail_notifier.title', 'newmail_notifier.body');
$this->include_script('newmail_notifier.js');
diff --git a/plugins/password/README b/plugins/password/README
index 262ebfd86..c50eb0bf3 100644
--- a/plugins/password/README
+++ b/plugins/password/README
@@ -310,6 +310,9 @@
Set $config['password_vpopmaild_port'] to the port of vpopmaild.
+ Set $config['password_vpopmaild_timeout'] to the timeout used for the TCP
+ connection to vpopmaild (You may want to set it higher on busy servers).
+
3. Driver API
-------------
diff --git a/plugins/password/config.inc.php.dist b/plugins/password/config.inc.php.dist
index 8c83dd703..8f7a57f9a 100644
--- a/plugins/password/config.inc.php.dist
+++ b/plugins/password/config.inc.php.dist
@@ -256,6 +256,9 @@ $config['password_vpopmaild_host'] = 'localhost';
// TCP port used for vpopmaild connections
$config['password_vpopmaild_port'] = 89;
+// Timout used for the connection to vpopmaild (in seconds)
+$config['password_vpopmaild_timeout'] = 10;
+
// cPanel Driver options
// --------------------------
diff --git a/plugins/password/drivers/vpopmaild.php b/plugins/password/drivers/vpopmaild.php
index 6c1a9ee9d..40731206a 100644
--- a/plugins/password/drivers/vpopmaild.php
+++ b/plugins/password/drivers/vpopmaild.php
@@ -22,6 +22,8 @@ class rcube_vpopmaild_password
$rcmail->config->get('password_vpopmaild_port'), null))) {
return PASSWORD_CONNECT_ERROR;
}
+
+ $vpopmaild->setTimeout($rcmail->config->get('password_vpopmaild_timeout'),0);
$result = $vpopmaild->readLine();
if(!preg_match('/^\+OK/', $result)) {