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

Saving should support a respecEvent #335

Merged
merged 2 commits into from Sep 22, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions js/ui/save-html.js
Expand Up @@ -77,6 +77,7 @@ define(
}
// convert the document to a string (HTML)
, toString: function () {
respecEvents.pub("save", "toString")
var str = "<!DOCTYPE html"
, dt = doc.doctype;
if (dt && dt.publicId) str += " PUBLIC '" + dt.publicId + "' '" + dt.systemId + "'";
Expand All @@ -101,6 +102,7 @@ define(
}
// convert the document to XML, pass 5 as mode for XHTML5
, toXML: function (mode) {
respecEvents.pub("save", "toXML" + mode)
var rootEl = doc.documentElement.cloneNode(true);
cleanup(rootEl);
if (mode !== 5) {
Expand Down Expand Up @@ -193,6 +195,7 @@ define(
// data needed for diff marking - submit the form so that the response populates
// page with the diff marked version
, toDiffHTML: function () {
respecEvents.pub("save", "toDiffHTML")
var base = window.location.href.replace(/\/[^\/]*$/, "/")
, str = "<!DOCTYPE html>\n<html>\n" +
"<head><title>Diff form</title></head>\n" +
Expand Down