Skip to content

Commit

Permalink
Merge pull request #167 from WildcardSearch/maintenance
Browse files Browse the repository at this point in the history
3.1.3 Release
  • Loading branch information
Mark Vincent authored Sep 23, 2017
2 parents e1a0523 + be812a0 commit d45c9ba
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## MentionMe 3.1.2
## MentionMe 3.1.3

A plugin for MyBB 1.8.x that allows Twitter-style tagging and integration with [MyAlerts](https://github.com/euantorano/MyAlerts)

Expand Down
2 changes: 1 addition & 1 deletion Upload/inc/plugins/MentionMe/forum.php
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ function mentionMeXMLHTTPgetNameCache()
"cached" => array(),
"inThread" => array(),
);
foreach ($nameCache as $key => $data) {
foreach ((array) $nameCache as $key => $data) {
$names['cached'][$key] = $data;
}

Expand Down
9 changes: 8 additions & 1 deletion Upload/inc/plugins/MentionMe/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ function mention_info()
'version' => MENTIONME_VERSION,
'author' => $author,
'authorsite' => 'http://www.rantcentralforums.com/',
'compatibility' => '18*'
'compatibility' => '18*',
'codename' => 'mention',
);
}

Expand Down Expand Up @@ -471,6 +472,12 @@ function mentionMeMyAlertsIntegrate()
$lang->load('mention');
}

if (!function_exists("myalerts_info") ||
myalerts_info()['version'] < "2.0.0" ||
$cache->read('mybbstuff_myalerts_alert_types')['mention']['code'] == 'mention') {
return;
}

$alertTypeManager = MybbStuff_MyAlerts_AlertTypeManager::createInstance($db, $cache);
$alertType = new MybbStuff_MyAlerts_Entity_AlertType();
$alertType->setCode("mention");
Expand Down
2 changes: 1 addition & 1 deletion Upload/inc/plugins/mention.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

// checked by other plugin files
define('IN_MENTIONME', true);
define('MENTIONME_VERSION', '3.1.2');
define('MENTIONME_VERSION', '3.1.3');

if (!class_exists('MentionMeCache')) {
require_once MYBB_ROOT . 'inc/plugins/MentionMe/classes/MentionMeCache.php';
Expand Down
22 changes: 19 additions & 3 deletions Upload/jscripts/MentionMe/autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -1292,7 +1292,7 @@ var MentionMe = (function($, m) {
rangeHelper = editor.getRangeHelper();

$iFrame = $("iframe");
$container = $iFrame.closest("div");
$container = $iFrame.closest("td");
$body = editor.getBody();

editor.keyUp(onKeyUp);
Expand Down Expand Up @@ -1339,8 +1339,13 @@ var MentionMe = (function($, m) {
var coords = $body.caret("offset", {
iframe: $iFrame[0],
}),
left = parseInt(coords.left) + 7,
top = parseInt(coords.top + $container.find("div.sceditor-toolbar").height()) + 2;
containerOffset = $container.offset(),
toolBarHeight = $container.find("div.sceditor-toolbar").height(),
fontSize = parseInt($currentNode.closest("div").css("fontSize").replace("px", "") / 2),
paddingLeft = parseInt($container.css("paddingLeft").replace("px", ""), 10),
paddingTop = parseInt($container.css("paddingTop").replace("px", ""), 10),
left = parseInt(coords.left, 10) + containerOffset.left + paddingLeft + fontSize + 2,
top = parseInt(coords.top + toolBarHeight) + containerOffset.top + paddingTop + 3;

popup.show(left, top);
}
Expand Down Expand Up @@ -1473,6 +1478,17 @@ var MentionMe = (function($, m) {
editor = CKEDITOR.instances[key];

editor.on("instanceReady", finalize);

if ($('#quick_reply_submit').length) {
$('#quick_reply_submit').click(function(e) {
if ($doc.length) {
$doc.unbind('keyup', onKeyUp);
}
setTimeout(function() {
$doc.keyup(onKeyUp);
}, 500);
});
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion Upload/jscripts/MentionMe/autocomplete.min.js

Large diffs are not rendered by default.

0 comments on commit d45c9ba

Please sign in to comment.