Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use vendor guidelines for custom types #97

Open
kathi-fletcher opened this issue Oct 18, 2013 · 0 comments
Open

Use vendor guidelines for custom types #97

kathi-fletcher opened this issue Oct 18, 2013 · 0 comments

Comments

@kathi-fletcher
Copy link
Member

src/plugins/oer/math/lib/math-plugin.coffee

Lines 143-158

  • it on the clipboard with a different content type. This will prevent the

  • cleanup that the browser does on namespaces. Use this alternative content

  • type again when pasting. Prevent the browser default. This will only work

  • in browsers that support event.clipboardData, chrome and safari to date.

  • editable.obj.on 'copy', (e) ->
  •  content = e.oerContent or Aloha.getSelection().getRangeAt(0).cloneContents()
    
  •  $content = $('<div />').append(content)
    
  •  # If there is math among the content we're copying, treat it specially.
    
  •  # Check that we also have a script tag in our selection, that occurs
    
  •  # towards the end of the math and ensures we have the whole of it.
    
  •  # The idea is to only do custom copy/paste if we need it, and let the
    
  •  # browser handle other content. Also buffer it in our local copy buffer.
    
  •  if $content.has('span.math-element').length and $content.has('script').length
    
  •    e.preventDefault()
    
  •    clipboard = e.clipboardData or e.originalEvent.clipboardData
    

Phil's comments: can this follow the custom vendor mimetype recommendations and be application/vnd.oerpub+text? (or, as a fallback, text/x-oerpub). Also, since it is used several times in the file can it be moved up as a const to the top of the file?

  •    clipboard.setData 'text/oerpub-content', $content.html()
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant