Merge pull request #22887 from edx/dsheraz/PROD-1179

modify URL generation in tinymce editor
This commit is contained in:
Syed Muhammad Dawoud Sheraz Ali
2020-01-24 12:27:03 +05:00
committed by GitHub
2 changed files with 9 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
describe('HTMLEditingDescriptor', function() {
beforeEach(() => window.baseUrl = "/static/deadbeef");
beforeEach(() => window.baseUrl = "/static/deadbeef/");
afterEach(() => delete window.baseUrl);
describe('Visual HTML Editor', function() {
beforeEach(function() {
@@ -48,6 +48,10 @@ describe('HTMLEditingDescriptor', function() {
const savedContent = this.descriptor.getVisualEditor().getContent()
expect(savedContent).toEqual(expectedData);
});
it('Editor base URL does not contain double slash', function(){
const editor = this.descriptor.getVisualEditor();
expect(editor.editorManager.baseURL).not.toContain('//');
});
});
describe('Raw HTML Editor', function() {
beforeEach(function() {

View File

@@ -88,7 +88,7 @@
This is a workaround for the fact that tinyMCE's baseURL property is not getting correctly set on AWS
instances (like sandbox). It is not necessary to explicitly set baseURL when running locally.
*/
tinyMCE.baseURL = baseUrl + "/js/vendor/tinymce/js/tinymce";
tinyMCE.baseURL = baseUrl + "js/vendor/tinymce/js/tinymce";
/*
This is necessary for the LMS bulk e-mail acceptance test. In that particular scenario,
@@ -96,7 +96,7 @@
*/
tinyMCE.suffix = ".min";
this.tiny_mce_textarea = $(".tiny-mce", this.element).tinymce({
script_url: baseUrl + "/js/vendor/tinymce/js/tinymce/tinymce.full.min.js",
script_url: baseUrl + "js/vendor/tinymce/js/tinymce/tinymce.full.min.js",
font_formats: _getFonts(),
theme: "modern",
skin: 'studio-tmce4',
@@ -126,7 +126,7 @@
visual: false,
plugins: "textcolor, link, image, codemirror",
codemirror: {
path: baseUrl + "/js/vendor"
path: baseUrl + "js/vendor"
},
image_advtab: true,
@@ -1204,7 +1204,7 @@
Translators: this is a toolbar button tooltip from the raw HTML editor displayed in the browser when a user needs to edit HTML
*/
title: gettext('Code block'),
image: baseUrl + "/images/ico-tinymce-code.png",
image: baseUrl + "images/ico-tinymce-code.png",
onclick: function() {
return ed.formatter.toggle('code');
}