Posts: 2,754
Threads: 63
Joined: Nov 2011
Reputation:
261
http://community.mybb.com/thread-95808.html
If you follow that tutorial, it wouldn't be hard to change the code to work with this plugin.
[retired]
Posts: 142
Threads: 18
Joined: Aug 2012
Reputation:
1
2012-12-24, 05:28 AM
(This post was last modified: 2012-12-24, 05:29 AM by bekircem.)
(2012-12-24, 05:20 AM)Wildcard Wrote: http://community.mybb.com/thread-95808.html
If you follow that tutorial, it wouldn't be hard to change the code to work with this plugin.
That tutorial for spoiler button. Spoiler button dont have pop-up window. I looked that topic already. I need code for to add editor.js.
Posts: 2,754
Threads: 63
Joined: Nov 2011
Reputation:
261
2012-12-24, 06:26 AM
(This post was last modified: 2014-04-16, 03:29 AM by Wildcard.)
To add a codebutton to the editor for this plugin, use the following patches.
In editor.js, find:
{type: 'button', name: 'color', insert: 'color', dropdown: true, color_select: true, image: 'color.gif', draw_option: this.drawColorOption, options: this.colors}
and change it to this:
{type: 'button', name: 'color', insert: 'color', dropdown: true, color_select: true, image: 'color.gif', draw_option: this.drawColorOption, options: this.colors},
{type: 'button', name: 'mention', insert: 'mention', image: 'mention.gif', title: 'Mention'}
- then find:
case "video":
this.insertVideo(extra);
break;
and change it to this:
case "video":
this.insertVideo(extra);
break;
case "mention":
this.insertMention();
break;
- Then find this:
insertMyCode: function(code, extra)
and change it to this:
insertMention: function()
{
selectedText = this.getSelectedText($(this.textarea));
if(!selectedText)
{
text = prompt("Enter a username to mention.", "");
}
else
{
text = selectedText;
}
if(text)
{
this.performInsert("@\""+text+"\"", "", true, false);
}
},
insertMyCode: function(code, extra)
- Upload a 22x23 transparent background GIF to jscripts/editor_themes/default/images and name it mention.gif
That should do it.
EDIT:
I am attaching three exported patches (for those who use the Patches plugin)
EDIT AGAIN:
I have included these patches as part of the optional files in version 1.5.
EDIT AGAIN, AGAIN:
I've removed the patch from this post and the installation package as it is no longer necessary.
MentionMe can now insert a code button automatically and can be controlled with a simple setting since 2.1
[retired]
Posts: 142
Threads: 18
Joined: Aug 2012
Reputation:
1
2012-12-24, 07:30 AM
(This post was last modified: 2012-12-24, 08:29 AM by bekircem.)
(2012-12-24, 06:26 AM)Wildcard Wrote: To add a codebutton to the editor for this plugin, use the following patches.
In editor.js, find:
{type: 'button', name: 'color', insert: 'color', dropdown: true, color_select: true, image: 'color.gif', draw_option: this.drawColorOption, options: this.colors}
and change it to this:
{type: 'button', name: 'color', insert: 'color', dropdown: true, color_select: true, image: 'color.gif', draw_option: this.drawColorOption, options: this.colors},
{type: 'button', name: 'mention', insert: 'mention', image: 'mention.gif', title: 'Mention'}
- then find:
case "video":
this.insertVideo(extra);
break;
and change it to this:
case "video":
this.insertVideo(extra);
break;
case "mention":
this.insertMention();
break;
- Then find this:
insertMyCode: function(code, extra)
and change it to this:
insertMention: function()
{
selectedText = this.getSelectedText($(this.textarea));
if(!selectedText)
{
text = prompt("Enter a username to mention.", "");
}
else
{
text = selectedText;
}
if(text)
{
this.performInsert("@\""+text+"\"", "", true, false);
}
},
insertMyCode: function(code, extra)
- Upload a 22x23 transparent background GIF to jscripts/editor_themes/default/images and name it mention.gif
That should do it.
EDIT:
I am attaching three exported patches (for those who use the Patches plugin) Thank you so much!
Posts: 15,129
Threads: 240
Joined: Jun 2009
Reputation:
703
Looks good Wildcard! Nice work with this - I was going to look into doing something similar eventually
Posts: 2,530
Threads: 124
Joined: Jul 2011
Reputation:
293
very good...
thanks...
installed...
Posts: 13
Threads: 1
Joined: Dec 2012
Reputation:
0
does this plugin will have a conflict here? http://community.mybb.com/thread-131176.html
Posts: 2,754
Threads: 63
Joined: Nov 2011
Reputation:
261
(2012-12-24, 12:06 PM)euantor Wrote: Looks good Wildcard! Nice work with this - I was going to look into doing something similar eventually
That means a lot, Euan.
I would appreciate any advice you might have or check the project out on GitHub.
(2012-12-24, 12:35 PM)martec Wrote: very good...
thanks...
installed...
Great!
Would you link me to your board that is using it please?
(2012-12-24, 01:17 PM)why so serious? Wrote: does this plugin will have a conflict here? http://community.mybb.com/thread-131176.html
euanator made MyAlerts extensible in such a way that if both Shade and I have followed the integration techniques provided there should be absolutely no conflicts.
However, if you find a conflict (or any other bug) please report it.
https://github.com/WildcardSearch/MentionMe
[retired]
Posts: 15,129
Threads: 240
Joined: Jun 2009
Reputation:
703
One thing I have noticed after browsing your code is how the _is_installed() function works. Users can clear the admin log via the ACP so your current check could easily return false even when it is installed.
The way you update user settings could also cause a timeout on boards with large amounts of users too. I still need to find a better way of handling settings so that's kind of my fault.
Posts: 2,754
Threads: 63
Joined: Nov 2011
Reputation:
261
2012-12-24, 04:59 PM
(This post was last modified: 2012-12-24, 05:01 PM by Wildcard.)
(2012-12-24, 04:27 PM)euantor Wrote: One thing I have noticed after browsing your code is how the _is_installed() function works. Users can clear the admin log via the ACP so your current check could easily return false even when it is installed.
I never considered that.
Would it be better to use this?
function mention_is_installed ()
{
global $cache, $plugins;
$pluginlist = $cache->read("plugins");
return in_array('mention', $pluginlist['active']);
}
EDIT:
No, that doesn't work correctly. I will keep trying.
(2012-12-24, 04:27 PM)euantor Wrote: The way you update user settings could also cause a timeout on boards with large amounts of users too. I still need to find a better way of handling settings so that's kind of my fault.
What is it that I am doing wrong?
Please let me know if there is a better way and I will implement the changes.
Thanks for all you help
[retired]
|