Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki
This commit is contained in:
commit
5d0eb597f1
|
@ -47,10 +47,6 @@ $(function() {
|
||||||
$('#itex_save, #itex_cancel').toggle(on);
|
$('#itex_save, #itex_cancel').toggle(on);
|
||||||
}
|
}
|
||||||
|
|
||||||
function htmlEscape(string) {
|
|
||||||
return string.replace(/&/g, '&').replace(/</g, '<');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Function: setItexString(string, url)
|
// Function: setItexString(string, url)
|
||||||
// This function sets the content of of the currently-selected foreignObject element,
|
// This function sets the content of of the currently-selected foreignObject element,
|
||||||
// based on the itex contained in string.
|
// based on the itex contained in string.
|
||||||
|
@ -72,7 +68,7 @@ $(function() {
|
||||||
var semantics = document.createElementNS(mathns, 'semantics');
|
var semantics = document.createElementNS(mathns, 'semantics');
|
||||||
var annotation = document.createElementNS(mathns, 'annotation');
|
var annotation = document.createElementNS(mathns, 'annotation');
|
||||||
annotation.setAttribute('encoding', 'application/x-tex');
|
annotation.setAttribute('encoding', 'application/x-tex');
|
||||||
annotation.textContent = htmlEscape(tex);
|
annotation.textContent = tex;
|
||||||
var mrow = document.createElementNS(mathns, 'mrow');
|
var mrow = document.createElementNS(mathns, 'mrow');
|
||||||
var children = data.documentElement.childNodes;
|
var children = data.documentElement.childNodes;
|
||||||
while (children.length > 0) {
|
while (children.length > 0) {
|
||||||
|
@ -94,10 +90,6 @@ $(function() {
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
function unescapeHTML(str) {
|
|
||||||
return str.replace(/&/g, '&').replace(/</g, '<');
|
|
||||||
}
|
|
||||||
|
|
||||||
function showItexEditor() {
|
function showItexEditor() {
|
||||||
var elt = selElems[0];
|
var elt = selElems[0];
|
||||||
var annotation = jQuery('math > semantics > annotation', elt);
|
var annotation = jQuery('math > semantics > annotation', elt);
|
||||||
|
@ -106,7 +98,7 @@ $(function() {
|
||||||
toggleSourceButtons(true);
|
toggleSourceButtons(true);
|
||||||
// elt.removeAttribute('fill');
|
// elt.removeAttribute('fill');
|
||||||
|
|
||||||
var str = unescapeHTML(annotation.text());
|
var str = annotation.text();
|
||||||
$('#svg_source_textarea').val(str);
|
$('#svg_source_textarea').val(str);
|
||||||
$('#svg_source_editor').fadeIn();
|
$('#svg_source_editor').fadeIn();
|
||||||
properlySourceSizeTextArea();
|
properlySourceSizeTextArea();
|
||||||
|
|
Loading…
Reference in a new issue