If you do Data --> Upload File, then upload the file foo.png,
you can use <img src="foo.png">
William
Yep. It's particularly good because then if you download the
worksheet and upload it somewhere else, the image will definitely be
there and work, even if you aren't online, etc.
William
There's also TinyMCE's style / CSS plug-in and toolbar button, which
might be useful in other situations:
http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/style
To activate them, backup and edit
SAGE_ROOT/local/lib/python2.5/site-packages/sage/server/notebook/notebook.py
or the devel equivalent. Starting around line 1800, in tinyMCE.init(),
replace
plugins: "table,searchreplace,safari,paste,autosave",
with
plugins: "table,searchreplace,safari,paste,autosave,style",
This enables the plug-in. To display the toolbar button, replace
link,image,unlink",
with
link,image,unlink,styleprops",
To keep TinyMCE from deactivating any *manually* inserted <style>
elements (e.g., via "Edit"), add
extended_valid_elements: "style",
after
theme_advanced_resizing : true,
In the attached screenshot, the style toolbar button is the one with two
"A"s on it.
By the way, the other "new" toolbar button in the snapshot brings up
TinyMCE's fullpage editor:
http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage
To enable this, too, use
plugins: "table,searchreplace,safari,paste,autosave,style,fullpage",
and
link,image,unlink,styleprops,fullpage",
Apparently, the style plugin edits only the style="" attribute of the
selected elements, but the fullpage plugin has wider scope.
It may be possible to blend these into a worksheet-specific tab or
plug-in, e.g., to change the background color of an input cell. Perhaps
double-clicking on a plot can pop up another plug-in, for editing axes,
labels, etc. I'm sure there are other possibilities!
It seems the TinyMCE developers have already done a lot of the work. Of
course, there's "some" layout work and wiring to do. If we're not
fastidious about the widget layout, perhaps we can generate much of the
boilerplate code from lists of the names and types of "the stuff that
needs setting" and Python scripts. This might make it easier to make
changes.
Or so I think. It'd be great to get input, particularly from the
JavaScript experts. Does anyone have experience developing custom
plug-ins for TinyMCE?
I've cc'd this reply to sage-devel.
> On Apr 9, 7:08 pm, mark mcclure <mcmcc...@unca.edu> wrote:
>> You must specify the image by
>> URL but you should be able to use an image stored with
>> your sage worksheets easily enough.
>
> For an image stored locally, I've tried various combinations of using
> TinyMCE and raw HTML with "file://" and "localhost:8000//" type URLs,
> to various locations (near worksheets, or elsewhere), but with no
> luck.
?