Skip to content

Commit

Permalink
Latest platform build
Browse files Browse the repository at this point in the history
  • Loading branch information
nathancarter committed Oct 26, 2017
1 parent cd8a2db commit 28ff16b
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 14 deletions.
2 changes: 1 addition & 1 deletion release/lurch-web-platform.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion release/lurch-web-platform.js.map

Large diffs are not rendered by default.

38 changes: 26 additions & 12 deletions release/lurch-web-platform.litcoffee
Original file line number Diff line number Diff line change
Expand Up @@ -3310,24 +3310,40 @@ the latter if needed.
# Installing the plugin

The plugin, when initialized on an editor, places an instance of the
`Groups` class inside the editor, and points the class at that editor.
There is a very small stylesheet we will install with this plugin.

styleSheet = '
img.grouper {
margin-bottom : -0.35em;
cursor : default;
}
img.grouper.hide:not(.decorate) {
width : 0px;
height : 22px;
}
'
styleSheet = 'data:text/css;base64,' + btoa styleSheet
styleSheetURL = 'data:text/css;base64,' + btoa styleSheet
The plugin, when initialized on an editor, places an instance of the
`Groups` class inside the editor, and points the class at that editor.

tinymce.PluginManager.add 'groups', ( editor, url ) ->
editor.Groups = new Groups editor
editor.on 'init', ( event ) -> editor.dom.loadCSS styleSheet
We do not rely on TinyMCE's built-in stylesheet installing function
(`loadCSS`), because it cannot handle data URIs. We wish to use a data URI
here because it lets us embed the stylesheet in the code, making it easier
to distribute this file on a CDN. Instead, I mimic the code from [the
TinyMCE
source](https://github.com/tinymce/tinymce/blob/master/src/core/src/main/js/dom/DOMUtils.js),
but without the feature that splits by commas (thus breaking up data URIs).

editor.on 'init', ( event ) ->
head = editor.getDoc().getElementsByTagName( 'head' )[0]
link = editor.getDoc().createElement 'link'
link.setAttribute 'rel', 'stylesheet'
link.setAttribute 'href', styleSheetURL
head.appendChild link
for type in editor.settings.groupTypes
editor.Groups.addGroupType type.name, type
editor.addMenuItem 'hideshowgroups',
Expand Down Expand Up @@ -4360,11 +4376,9 @@ related getters for listing all back-ends, or getting the current one.
availableBackends: => Object.keys @backends
getBackend: => @backend
setBackend: ( which ) =>
console.log 'setting back end', which
if which in @availableBackends()
@backend = which
window.setFileSystem @backends[@backend]
console.log @backends[@backend]
The following function is useful for storing file objects provided by
[the cloud storage module](https://github.com/lurchmath/cloud-storage), and
Expand Down Expand Up @@ -5063,10 +5077,9 @@ Not all of the following plugins are working yet, but most are. A plugin
that begins with a hyphen is a local plugin written as part of this project.

plugins :
'advlist table charmap colorpicker image link
paste print searchreplace textcolor
-storage -overlay -groups -equationeditor -dependencies
-dialogs -downloadupload ' \
'advlist table charmap colorpicker image link paste print
searchreplace textcolor -storage -overlay -groups
-dependencies -dialogs -downloadupload ' \
+ ( "-#{p}" for p in window.pluginsToLoad ).join( ' ' ) \
+ ( if window.fullScreenEditor then ' fullscreen' else '' )
Expand Down Expand Up @@ -5263,7 +5276,8 @@ by invoking the "mceFullScreen" command.
The third-party plugin for math equations requires the following stylesheet.

editor.dom.loadCSS './eqed/mathquill.css'
if 'equationeditor' in window.pluginsToLoad
editor.dom.loadCSS './eqed/mathquill.css'
Add an icon to the left of the File menu, if one has been specified.

Expand Down

0 comments on commit 28ff16b

Please sign in to comment.