From d9a8432c63add285df9291ca8142687a787f43bd Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Thu, 28 Mar 2013 22:51:37 -0400 Subject: some post-merge fixes --- askbot/media/js/post.js | 16 ++++++++++++---- askbot/media/js/wmd/wmd.js | 19 +++++++------------ askbot/templates/question.html | 1 + 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/askbot/media/js/post.js b/askbot/media/js/post.js index 666fe70b..f377e474 100644 --- a/askbot/media/js/post.js +++ b/askbot/media/js/post.js @@ -1447,6 +1447,9 @@ EditCommentForm.prototype.startEditor = function() { content_css: mediaUrl('media/style/tinymce/comments-content.css'), elements: editorId, plugins: 'autoresize', + theme: 'advanced', + theme_advanced_toolbar_location: 'top', + theme_advanced_toolbar_align: 'left', theme_advanced_buttons1: 'bold, italic, |, link, |, numlist, bullist', theme_advanced_buttons2: '', theme_advanced_path: false, @@ -1495,11 +1498,15 @@ EditCommentForm.prototype.attachTo = function(comment, mode){ //fix up the comment submit button, depending on the mode if (this._type == 'add'){ this._submit_btn.html(gettext('add comment')); - this._minorEditBox.hide(); + if (this._minorEditBox) { + this._minorEditBox.hide(); + } } else { this._submit_btn.html(gettext('save comment')); - this._minorEditBox.show(); + if (this._minorEditBox) { + this._minorEditBox.show(); + } } //enable the editor this.getElement().show(); @@ -1576,9 +1583,10 @@ EditCommentForm.prototype.canCancel = function(){ EditCommentForm.prototype.getCancelHandler = function(){ var form = this; - return function(){ + return function(evt){ if (form.canCancel()){ form.detach(); + evt.preventDefault(); } return false; }; @@ -2535,7 +2543,7 @@ TinyMCE.prototype.setHighlight = function() {}; TinyMCE.prototype.putCursorAtEnd = function() {}; TinyMCE.prototype.focus = function() { - tinymce.execCommand('mceFocus', false, this._id); + //tinymce.execCommand('mceFocus', false, this._id); //@todo: make this general to all editors var winH = $(window).height(); diff --git a/askbot/media/js/wmd/wmd.js b/askbot/media/js/wmd/wmd.js index 91d98694..ddbc91ed 100644 --- a/askbot/media/js/wmd/wmd.js +++ b/askbot/media/js/wmd/wmd.js @@ -2472,21 +2472,16 @@ Attacklab.wmd_env = {}; Attacklab.account_options = {}; Attacklab.wmd_defaults = {version:1, output:"Markdown", lineLength:40, delayLoad:false}; -if(!Attacklab.wmd) -{ - Attacklab.wmd = function() - { - Attacklab.loadEnv = function() - { - var mergeEnv = function(env) - { - if(!env) - { +//@todo: this needs to be moved out of the wmd.js as we have askbot-specific code here +if(!Attacklab.wmd && askbot['data']['editorType'] === 'markdown') { + Attacklab.wmd = function() { + Attacklab.loadEnv = function() { + var mergeEnv = function(env) { + if(!env) { return; } - for(var key in env) - { + for(var key in env) { Attacklab.wmd_env[key] = env[key]; } }; diff --git a/askbot/templates/question.html b/askbot/templates/question.html index 5fa32206..3ddc0114 100644 --- a/askbot/templates/question.html +++ b/askbot/templates/question.html @@ -279,6 +279,7 @@ askbot['settings']['saveCommentOnEnter'] = {{ settings.SAVE_COMMENT_ON_ENTER|as_js_bool }}; askbot['settings']['tagSource'] = '{{ settings.TAG_SOURCE }}'; askbot['settings']['enableSharingGoogle'] = {{ settings.ENABLE_SHARING_GOOGLE|as_js_bool }}; + askbot['settings']['enableEmailAlerts'] = {{ settings.ENABLE_EMAIL_ALERTS|as_js_bool }}; {% include "meta/editor_data.html" %} {% compress js %} -- cgit v1.2.3-1-g7c22