diff --git a/public/src/forum/topic.js b/public/src/forum/topic.js index 48bf5dbdfa..540550996f 100644 --- a/public/src/forum/topic.js +++ b/public/src/forum/topic.js @@ -341,7 +341,7 @@ define('forum/topic', ['forum/pagination', 'forum/infinitescroll', 'forum/topic/ findInsertionPoint(); - data.title = ajaxify.variables.get('topic_name'); + data.title = $('
').text(ajaxify.variables.get('topic_name')).html(); data.viewcount = ajaxify.variables.get('viewcount'); infinitescroll.parseAndTranslate('topic', 'posts', data, function(html) { diff --git a/public/src/modules/composer.js b/public/src/modules/composer.js index 1bc122cf0f..6c2c2a6eca 100644 --- a/public/src/modules/composer.js +++ b/public/src/modules/composer.js @@ -209,7 +209,7 @@ define('composer', ['taskbar', 'composer/controls', 'composer/uploads', 'compose bodyEl = postContainer.find('textarea'), draft = drafts.getDraft(postData.save_id); - postData.title = $('').html(postData.title).text(); + postData.title = $('').text(postData.title).html(); updateTitle(postData, postContainer); @@ -408,9 +408,9 @@ define('composer', ['taskbar', 'composer/controls', 'composer/uploads', 'compose $('body').css({'margin-bottom': postContainer.css('height')}); if (env !== 'sm' && env !== 'xs') { - focusElements(post_uuid); + focusElements(post_uuid); } - + resizeTabContent(postContainer); } @@ -455,7 +455,7 @@ define('composer', ['taskbar', 'composer/controls', 'composer/uploads', 'compose var checkTitle = parseInt(postData.cid, 10) || parseInt(postData.pid, 10); - if (postData.uploadsInProgress && postData.uploadsInProgress.length) { + if (uploads.inProgress[post_uuid] && uploads.inProgress[post_uuid].length) { return composerAlert('[[error:still-uploading]]'); } else if (checkTitle && titleEl.val().length < parseInt(config.minimumTitleLength, 10)) { return composerAlert('[[error:title-too-short, ' + config.minimumTitleLength + ']]'); diff --git a/public/src/modules/composer/uploads.js b/public/src/modules/composer/uploads.js index b61d962d2f..142659a309 100644 --- a/public/src/modules/composer/uploads.js +++ b/public/src/modules/composer/uploads.js @@ -3,7 +3,9 @@ /* globals define, utils, config, app */ define('composer/uploads', function() { - var uploads = {}; + var uploads = { + inProgress: {} + }; uploads.initialize = function(post_uuid) { @@ -234,8 +236,8 @@ define('composer/uploads', function() { formData.append('_csrf', $('#csrf_token').val()); } - uploads[post_uuid] = uploads[post_uuid] || []; - uploads[post_uuid].push(1); + uploads.inProgress[post_uuid] = uploads.inProgress[post_uuid] || []; + uploads.inProgress[post_uuid].push(1); $(this).ajaxSubmit({ resetForm: true, @@ -264,7 +266,7 @@ define('composer/uploads', function() { complete: function() { uploadForm[0].reset(); - uploads[post_uuid].pop(); + uploads.inProgress[post_uuid].pop(); } }); @@ -293,8 +295,8 @@ define('composer/uploads', function() { spinner.removeClass('hide'); - uploads[post_uuid] = uploads[post_uuid] || []; - uploads[post_uuid].push(1); + uploads.inProgress[post_uuid] = uploads.inProgress[post_uuid] || []; + uploads.inProgress[post_uuid].push(1); $(this).ajaxSubmit({ formData: formData, @@ -305,7 +307,7 @@ define('composer/uploads', function() { postContainer.find('#topic-thumb-url').val((uploads[0] || {}).url || '').trigger('change'); }, complete: function() { - uploads[post_uuid].pop(); + uploads.inProgress[post_uuid].pop(); spinner.addClass('hide'); } }); diff --git a/public/src/modules/notifications.js b/public/src/modules/notifications.js index 8553f55280..5e4b5ef140 100644 --- a/public/src/modules/notifications.js +++ b/public/src/modules/notifications.js @@ -24,7 +24,7 @@ define('notifications', ['sounds'], function(sound) { } else { image = ''; } - + notification.text = $('').text(notification.text).html(); return '