How to disable right clicking mathjax in shiny - shiny

How to disable right clicking mathjax in shiny? For example, see
https://shiny.rstudio.com/gallery/mathjax.html
Ideally, I would like users not to be abe to interact with the mathjax text at all.

You can turn off the MathJax contextual menu by adding
<script type="tet/x-mathjax-config">
MathJax.Hub.Config({
showMathMenu: false
});
</script>
to your page just before the script that loads MathJax.js itself.
I would encourage you not to do this, however. There are important functions in the menu, including the controls for those using assistive technology like screen readers. Those users may need access to those controls to set things appropriately for their assistive needs. If you disable the menu, you may prevent them from being able to use your pages.

In case of MathJax 3 use the following syntax:
MathJax = {
options: {
renderActions: {
addMenu: []
}
}
};

a little CSS rule
mjx-container.MathJax {
pointer-events: none;
}

Related

Is this possible when Secure Embeding a Power BI report into an html page?

Looking to Secure Embed a bunch of reports into a html webpage/portal.
Does anyone know if it is possible to completely remove/hide the filter pane on the right as well as the tab bar along the bottom? (the bits highlighted below).
Thanks.
You can achieve this in PBI service also. Follow the Below steps:
Open the report in Edit mode. Expand the filters pane. You can see hide/view icon and select it to hide.
Right click on the Page name and you can see Hide Page Select it.
Save Your report and Go to File and then from Embed get your iframe link.
When you paste iframe in your HTML you can see that Filter Pane and Pages below are hidden
Yes, this is possible.
At the time of embedding report, Update the embedConfig settings like below.
Or use Api 'updateSettings` to update the settings after you embedded the report.
// The new settings that you want to apply to the report.
const newSettings = {
panes: {
filters: {
visible: false,
},
pageNavigation: {
visible: false
},
}
};
// Update the settings by passing in the new settings you have configured.
try {
await report.updateSettings(newSettings);
}
catch (error) {
console.log(error);
}
References:
https://learn.microsoft.com/javascript/api/overview/powerbi/configure-report-settings#panes
https://learn.microsoft.com/javascript/api/overview/powerbi/update-settings

Page previewing issue in Sitecore

I have deployed my first page in Sitecore. But it is not rendered perfectly in Content editor preview mode.
Original html:
There is a nav menu and a banner below it. Behind them is a white transparent overlay & behind the overlay is a graffiti background image.
View from Experience editor:
The settings icon went offset. The white overlay is now above the Sitecore menu preventing the edits.
Error in browser console:
Uncaught TypeError: element.dispatchEvent is
not a function - prototype.js:5734
Uncaught TypeError:
element.attachEvent is not a function - prototype.js:5653
View in Content Editor:
It is rendered as if for a tablet, as you see the menu got shifted to the icon. I understand, it is because of the dimensions of the preview panel.
But, if this is the case, how will an author be able to edit/view the correct design.
Prototype.js is not a file being used by the site. So, it must be from Sitecore's.
Im guessing , certain CSS props, aren't being respected (Like position, transformnation).
Is this a bug. How to fix this. I have checked in different browsers (IE, chrome & firefox). It's the same
It looks like you are running into a conflict with prototype.js. Sitecore uses this in the experience editor.
If you are using jQuery in your site, there is a kb article about that here: https://kb.sitecore.net/articles/286042
To fix the issue, you need to run jQuery in no conflict mode. There are a few ways of doing that. Here is a simple example:
<!-- Putting jQuery into no-conflict mode. -->
<script src="prototype.js"></script>
<script src="jquery.js"></script>
<script>
var $j = jQuery.noConflict();
// $j is now an alias to the jQuery function; creating the new alias is optional.
$j(document).ready(function() {
$j( "div" ).hide();
});
// The $ variable now has the prototype meaning, which is a shortcut for
// document.getElementById(). mainDiv below is a DOM element, not a jQuery object.
window.onload = function() {
var mainDiv = $( "main" );
}
</script>
You can find more on the jQuery website: http://learn.jquery.com/using-jquery-core/avoid-conflicts-other-libraries/
You also need to be careful with your CSS - don't absolutely position elements to the top of your browser, always make sure they are relative to a container so that the Sitecore EE DOM elements can be added and positioned correctly.

syntax highlight in redmine

The most Users which use redmine, are programmers.
They need the code highlight syntax very, very often which is.
< pre >< code class="LANGUAGE_NAME" >
Some Code
< /code>< /pre>
In order to write less, as an editor in the redmine wiki
I want to be able to press a button or a dropdown field, which surrounds my selected text (like bold, italic, underlined, pre, h1, h2 and so on which already does.)
Maybe someone can suggest a plugin if that exists.
Or shows me the code where the editor happens, so I can implement and provide it as plugin.
Many, many, thanks
I made a plugin which provides this functionality:
https://github.com/mediatainment/redmine_codebutton/
Hope this helps someone, till redmine implements it by default.
There is a "PRE" button in the Redmine Wiki toolbar, which partially does, what you want. I.e., it surrounds the code with just <pre>. At least, you will be able to use this button as a sample...
I'm not aware of any plugin, which comes with the button, you request...
Redmine lets you add any button to the Wiki toolbar. For this you just need to add an element to jsToolBar.prototype.elements as follows:
jsToolBar.prototype.elements.ruby = {
type: 'button',
title: 'Ruby code',
fn: {
wiki: function() { /* handle it here */ this.encloseLineSelection('<pre><code class="ruby">\n', '\n</code></pre>') }
}
};
See also: javascripts/jstoolbar/textile.js.
If someone is still have that problem I recently uploaded redmine plugin that replaces built-in coderay with highlightJS. Plugin feature much more markups, very good language autodetection as well as dual language highlighting (i.e http+json in body). Plugin url is:
https://github.com/dominch/redmine_highlightjs
Language autodetection works great, so probably You will no longer need to input specific language class. Plugin takes care about that and just work!

How to disable menu entries in Zurb Foundation Top Bar

in a web application (= multi user environment) I need to disable certain menu entries in a top bar, depending on the currently logged-in user etc. To keep consistency in the UI, hiding/omitting the menu entries is not an option. Adding disabled/inactive/whatsoever class which is the way to go on other foundation elements e.g. buttons is not supported by the framework, obviously.
<li><a class="disabled" href="#">Disabled Menu Entry</a></li>
Any ideas?
Your question has nothing to do "directly" with Foundation. Disabling and/or hiding elements is either a CSS thing or javascript. You can NOT directly disable an anchor tag but you can simulate it's "disabled behavior". Based on what logic you have, how you will determine if an anchor tag should be disabled, you can do the following:
<style>
.disabled-link {
text-decoration:none; // really not needed for the Top Bar, just for general technique
cursor: auto;
}
</style>
<script>
$(document).ready(function(){
$(".disabled-link").click(function(e){
e.preventDefault();
return false;
});
});
</script>
<a class="disabled-link" href="#">Disabled Menu Entry</a>
Take note that the disabled-link class should be applied there based on some logic, this depends on your server side code - you did not tell us what other tools you were using. If you are using ASP.Net, PHP or whatever.
Additionally you should remember to validate on the server as there is no way of stopping your users to circumvent the disabled behavior of the links.

One-time FancyBox popup like on Digg.com

How can I go about actioning a FancyBox popup that notifies new users of a quick sign-up button (or whatever is chosen) like on Digg.com ... and as with Digg just one time. I really have no experience with cookies but already have FancyBox running in other parts of the website, so the basis is already there. I require the popup to appear on page load. Any pointers very happily received!
My eventual solution uses the Reveal Modal plugin (click here) to trigger inline to 'fire' on page load using the modified following code for the popup to be displayed only once every three days. Remember also to load jquery.cookie.js and then add the following code:
<script type="text/javascript">
jQuery(document).ready(function(){
if (jQuery.cookie('test_status') != '1') {
jQuery('#myModal').reveal()
jQuery('#myModal').trigger('click');
jQuery.cookie('test_status', '1', { expires: 3}); }
});
</script>
Using something other than FancyBox was the answer to the original question as it seemed there was a conflict somewhere, so using Reveal made the two functions completely separate. I should also note that the .css contents from the Reveal download were added to our site's stylesheet.
Hopefully that will help someone else out.
You can find a code example here https://stackoverflow.com/a/8305703/1055987 including the link to the jQuery Cookie plugin.