summaryrefslogtreecommitdiff
path: root/addons/website/static/src/js/website.editor.js
diff options
context:
space:
mode:
authorXavier Morel <xmo@openerp.com>2013-11-15 14:29:03 +0100
committerXavier Morel <xmo@openerp.com>2013-11-15 14:29:03 +0100
commit780c35598dfdf646ca8019ecdb250ada88f31d94 (patch)
tree3aecdcccad8d51bc16f38c316b821c5394ed1481 /addons/website/static/src/js/website.editor.js
parentb97a83aa0e9af8ed5c12d6e5f4ef3877eb1e7ec5 (diff)
parente7117a579907342465f14982c09df0cb096c3d98 (diff)
[MERGE] from trunk
bzr revid: xmo@openerp.com-20131115132903-epi3321e4uxjqtn2
Diffstat (limited to 'addons/website/static/src/js/website.editor.js')
-rw-r--r--addons/website/static/src/js/website.editor.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/addons/website/static/src/js/website.editor.js b/addons/website/static/src/js/website.editor.js
index 22367e24d47..2fa71d27f62 100644
--- a/addons/website/static/src/js/website.editor.js
+++ b/addons/website/static/src/js/website.editor.js
@@ -12,6 +12,16 @@
website.ready().then(website.init_editor);
}
+ $(document).on('click', 'a.js_link2post', function (ev) {
+ ev.preventDefault();
+ var form = document.createElement('form');
+ form.action = this.pathname; // restrict to same origin
+ form.method = 'POST';
+ // TODO: support this.search as form input fields
+ $(this).append(form);
+ form.submit();
+ });
+
$(document).on('hide.bs.dropdown', '.dropdown', function (ev) {
// Prevent dropdown closing when a contenteditable children is focused
if (ev.originalEvent
@@ -383,6 +393,7 @@
'click button[data-action=edit]': 'edit',
'click button[data-action=save]': 'save',
'click button[data-action=cancel]': 'cancel',
+ 'click a[data-action=new_page]': 'new_page',
},
container: 'body',
customize_setup: function() {
@@ -531,6 +542,15 @@
cancel: function () {
website.reload();
},
+ new_page: function (ev) {
+ ev.preventDefault();
+ website.prompt({
+ window_title: "New Page",
+ input: "Page Title",
+ }).then(function (val) {
+ document.location = '/pagenew/' + encodeURI(val);
+ });
+ },
});
var blocks_selector = _.keys(CKEDITOR.dtd.$block).join(',');