apostrophe
Advanced tools
Comparing version 0.4.10 to 0.4.11
{ | ||
"name": "apostrophe", | ||
"version": "0.4.10", | ||
"version": "0.4.11", | ||
"description": "Apostrophe is a user-friendly content management system. This core module of Apostrophe provides rich content editing and essential facilities to integrate Apostrophe into your Express project. Apostrophe also includes simple facilities for storing your rich content areas in MongoDB and fetching them back again. Additional functionality is available in modules like apostrophe-pages, apostrophe-snippets, apostrophe-blog, apostrophe-events, apostrophe-twitter and apostrophe-rss.", | ||
@@ -5,0 +5,0 @@ "main": "apostrophe.js", |
@@ -1477,2 +1477,57 @@ /* global rangy, $, _ */ | ||
apos.widgetTypes.html = { | ||
label: 'Raw HTML', | ||
editor: function(options) { | ||
var self = this; | ||
self.code = ''; | ||
if (!options.messages) { | ||
options.messages = {}; | ||
} | ||
if (!options.messages.missing) { | ||
options.messages.missing = 'Paste in some HTML code first.'; | ||
} | ||
self.afterCreatingEl = function() { | ||
self.$code = self.$el.find('.apos-code'); | ||
self.$code.val(self.data.code); | ||
setTimeout(function() { | ||
self.$code.focus(); | ||
self.$code.setSelection(0, 0); | ||
}, 500); | ||
// Automatically preview if we detect something that looks like a | ||
// fresh paste | ||
var last = ''; | ||
self.timers.push(setInterval(function() { | ||
var next = self.$code.val(); | ||
self.exists = (next.length > 2); | ||
if (next !== last) { | ||
self.preview(); | ||
} | ||
last = next; | ||
}, 500)); | ||
}; | ||
self.preSave = getCode; | ||
self.prePreview = getCode; | ||
function getCode(callback) { | ||
var code = self.$code.val(); | ||
self.data.code = code; | ||
if (callback) { | ||
callback(); | ||
} | ||
} | ||
self.type = 'html'; | ||
options.template = '.apos-html-editor'; | ||
// Parent class constructor shared by all widget editors | ||
apos.widgetEditor.call(self, options); | ||
} | ||
}; | ||
// Utilities | ||
@@ -1479,0 +1534,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4174300
220
16420