Support for \tooltip{}{} and \statusline{}{}
itex2MML 1.3.16 add a \tooltip{}{} command which, like \statusline{}{}, produces an <maction> element. Neither of these is natively supported by Mozilla/Firefox. Add some Javascript to work around that weakness.
This commit is contained in:
parent
c99ca26a8d
commit
977da29f68
|
@ -17,7 +17,7 @@
|
|||
<%= javascript_include_tag 'page_helper' %>
|
||||
|
||||
<style type="text/css">
|
||||
h1#pageName, div.info, .newWikiWord a, a.existingWikiWord, .newWikiWord a:hover, #TextileHelp h3 {
|
||||
h1#pageName, div.info, .newWikiWord a, a.existingWikiWord, .newWikiWord a:hover, [actiontype="toggle"]:hover, #TextileHelp h3 {
|
||||
color: #<%= @web ? @web.color : "393" %>;
|
||||
}
|
||||
<%= File.read(RAILS_ROOT + '/public/stylesheets/instiki.css') if @inline_style %>
|
||||
|
|
|
@ -41,7 +41,22 @@ function fixRunIn() {
|
|||
});
|
||||
}
|
||||
|
||||
function mactionWorkarounds() {
|
||||
$$('maction[actiontype="tooltip"]').each( function(mtool){
|
||||
Element.writeAttribute(mtool, 'title', mtool.lastChild.firstChild.data);
|
||||
});
|
||||
$$('maction[actiontype="statusline"]').each( function(mstatus){
|
||||
Event.observe(mstatus, 'mouseover', function(){
|
||||
window.status = mstatus.lastChild.firstChild.data;
|
||||
});
|
||||
Event.observe(mstatus, 'mouseout', function(){
|
||||
window.status = '';
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
window.onload = function (){
|
||||
extractBlockquoteCitations();
|
||||
fixRunIn();
|
||||
mactionWorkarounds();
|
||||
};
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
body {
|
||||
background-color:#FFF;
|
||||
color:#333;
|
||||
font-family:Verdana, Arial, Helvetica, sans-serif;
|
||||
font-family:TeX Gyre Termes, Times New Roman,Verdana, Arial, Helvetica, sans-serif;
|
||||
font-size:1em;
|
||||
line-height:1.3em;
|
||||
}
|
||||
|
@ -512,3 +512,4 @@ pre.xml .attribute { color: #771; }
|
|||
font-variant: normal;
|
||||
font-weight: bold;
|
||||
}
|
||||
[actiontype="toggle"]:hover {text-shadow: #ccc 2px 2px 5px;}
|
||||
|
|
|
@ -212,6 +212,14 @@ END_THM
|
|||
|
||||
def test_have_latest_itex2mml
|
||||
|
||||
assert_markup_parsed_as(
|
||||
%{<p>equation <math class='maruku-mathml' displa} +
|
||||
%{y='inline' xmlns='http://www.w3.org/1998/Math/} +
|
||||
%{MathML'><mi>A</mi><mo>=</mo><maction actiontyp} +
|
||||
%{e='tooltip'><mi>B</mi><mtext>Spoons!</mtext></} +
|
||||
%{maction></math></p>},
|
||||
"equation $A=\\tooltip{Spoons!}{B}$")
|
||||
|
||||
assert_markup_parsed_as(
|
||||
%{<p>equation <math class='maruku-mathml' displa} +
|
||||
%{y='inline' xmlns='http://www.w3.org/1998/Math/} +
|
||||
|
|
Loading…
Reference in a new issue