thanx on great plugin.
Unfortunately not working for me.
I am on 1.7.0.beta1 version
I did install it only on containers/app.yml
without editing settings.
It is installed and activated on admin menu.
When I type IMMO nothing happns.
when I type <abbr>IMMO</abbr> i get question mark over word but nothing happens
There is no network calls also there no erros in chrome chonsole
So i have this code in a file called abbreviations.js.es6
import { registerOption } from 'pretty-text/pretty-text';
registerOption((siteSettings, opts) => {
opts.features['abbreviations'] = !!siteSettings.abbreviations_plugin_enabled;
});
function abbreviate(text) {
var siteSettings = Discourse.SiteSettings;
if (siteSettings.abbreviations_plugin_enabled) {
//blabla.............
}
return text;
}
export function setup(helper) {
helper.addPreProcessor(abbreviate);
}
The line
var siteSettings = Discourse.SiteSettings;
is giving me some headaches. Can someone give me some advice on how to reach Discourse.SiteSettings from there?
It works in the client, (i.e the preview window), but when I try to save the message that line gives an error, there is no way to save the message.
That is great, thank you @tgxworld ! . helper.getOptions() was what I was looking for. Silly me
Your solution is working for me in my development rig. I already merged it in the repository so anyone can use it, but I am going to make it âbackwards compatibleâ later on, so the plugin works in an old installation I have (EDIT: already done).
@sam, as far as i am concerned the plugin works again
As far as I know, the abbr tag doesnât work in mobile devices. You are right, i should put a css media query so it doesnât underline the acronym in mobile devices.
Or, if possible, you could change the mobile behavior so it will toggle viewing when touched (instead of hover, you could simulate a click to activate it). I hope it will be possible. Since mobile & touch devices are widely used!
<script type="text/javascript">
/**
* touchHover.js
*
* Create tooltips on mouseover or on click (for supporting touch interfaces).
*
* @author C. Scott Asbach
*/
$(document).ready(function() {
/**
* store the value of and then remove the title attributes from the
* abbreviations (thus removing the default tooltip functionality of
* the abbreviations)
*/
$('abbr').each(function(){
$(this).data('title',$(this).attr('title'));
$(this).removeAttr('title');
});
/**
* when abbreviations are mouseover-ed show a tooltip with the data from the title attribute
*/
$('abbr').mouseover(function() {
// first remove all existing abbreviation tooltips
$('abbr').next('.touchtooltip').remove();
// create the tooltip
$(this).after('<span class="touchtooltip">' + $(this).data('title') + '</span>');
// position the tooltip 4 pixels above and 4 pixels to the left of the abbreviation
var left = $(this).position().left + $(this).width() + 4;
var top = $(this).position().top - 4;
$(this).next().css('left',left);
$(this).next().css('top',top);
});
/**
* when abbreviations are clicked trigger their mouseover event then fade the tooltip
* (this is friendly to touch interfaces)
*/
$('abbr').click(function(){
$(this).mouseover();
// after a slight 2 second fade, fade out the tooltip for 1 second
$(this).next().animate({opacity: 0.9},{duration: 2000, complete: function(){
$(this).fadeOut(1000);
}});
});
/**
* Remove the tooltip on abbreviation mouseout
*/
$('abbr').mouseout(function(){
$(this).next('.touchtooltip').remove();
});
});
</script>
Is there a way to get this plugin to recognize acronyms directly followed by a colon (or some other punctuation for that matter)?
Example: I have defined BTW as âBy the wayâ in the plugin settings, but when I write âBTW: xyzâ in a post, it is not rendered as an acronym whereas âBTW : xyzâ is.
Very weird situation: I posted a topic with an image in category A. When I move the topic to category B, the image in the post was no longer rendered but instead, the image path was displayed (just like in the editor). Trying to upload the same or another image to that post leads to the same result. Whatâs more, uploading images to posts is now broken on the entire site. Images seem to upload fine but only the path is displayed.
I tried rebuilding HTML but to no avail.
Context:
the image was embedded as a float using [floatl] ... [/floatl]
I have the translator plugin activated and the text of the post was in a different language than both the site and my user locale
the category name of category B contains an ampersand (&) though the slug is a single word
This is so weird, I donât even know where to start debugging. Or to get things working again (do I need to rebuild for this?)
UPDATE: there is no error in the error logs and there are no dead jobs in /sidekiq
UPDATE 2: OK, I found the black sheep: it was @BlackSheepâs abbreviation plugin. When I deactivated it, things worked again.
Maybe it has something to do with the fact that I have âappâ defined as an abbreviation in the pluginâs settings and the word app appeared in that post that cause the trouble?
Looks like a similar issue (involving Discourse.dialect_deprecated) to what I had with the discourse-solved plugin - @eviltrout fixed it with this commit