Commit 0c875692 authored by Mike Kelly's avatar Mike Kelly Committed by Gerrit Code Review

Fix tabs and whitespace formatting

Change-Id: Iae6b20134f7426c006dcfe0200e46b2cd52279ff
Signed-off-by: 's avatarMike Kelly <m.f.kelly@arts.ac.uk>
parent aa8d1892
......@@ -101,7 +101,7 @@ else {
// If the file is in the logged in menu and the user is logged in then
// they can view it
$fileinloggedinmenu = $file->get('institution') == 'mahara';
// check if users are allowed to access files in subfolders
// check if users are allowed to access files in subfolders
if (!get_config('sitefilesaccess')) {
$fileinloggedinmenu = $fileinloggedinmenu && $file->get('parent') == null;
}
......@@ -112,19 +112,19 @@ else {
// Alternatively, if you own the file or you are an admin, it should always work
if (!$USER->can_view_artefact($file)) {
$imagevisible = false;
$imagevisible = false;
// Check for resume elements in pages
$resumelements = array('resumecoverletter','resumeinterest','personalgoal','academicgoal','careergoal','personalskill','academicskill','workskill','profileintrotext');
foreach ($resumelements as $element) {
$resourceid = param_integer($element, null);
if ($resourceid && $file instanceof ArtefactTypeImage) {
$imagevisible = EmbeddedImage::can_see_embedded_image($fileid, $element, $resourceid);
}
if ($imagevisible) {
break;
}
foreach ($resumelements as $element) {
$resourceid = param_integer($element, null);
if ($resourceid && $file instanceof ArtefactTypeImage) {
$imagevisible = EmbeddedImage::can_see_embedded_image($fileid, $element, $resourceid);
}
if ($imagevisible) {
break;
}
}
// Check for images sitting in visible forum posts
......
......@@ -780,10 +780,10 @@ function FileBrowser(idprefix, folderid, config, globalconfig) {
}
this.update_metadata_to_selected_list();
// are we running inside tinymce imagebrowser plugin?
if (window.imgbrowserconf_artefactid) {
// propagate the click
jQuery('#filebrowserupdatetarget').click();
}
if (window.imgbrowserconf_artefactid) {
// propagate the click
jQuery('#filebrowserupdatetarget').click();
}
}
this.unselect = function (e) {
......
......@@ -11,7 +11,7 @@
/*global tinymce:true */
tinymce.PluginManager.add('imagebrowser', function(editor) {
function imageBrowserDialogue() {
return function () {
// open our own dialogue instead of using editor.windowManager.open
......@@ -25,7 +25,7 @@ tinymce.PluginManager.add('imagebrowser', function(editor) {
var formname = '#imgbrowserconf';
var win, data = {}, dom = editor.dom, imgElm = editor.selection.getNode();
var width, height;
width = dom.getAttrib(imgElm, 'width');
height = dom.getAttrib(imgElm, 'height');
......@@ -69,7 +69,7 @@ tinymce.PluginManager.add('imagebrowser', function(editor) {
var postid = 0;
if (jQuery('#edittopic_post').length) {
postid = jQuery('#edittopic_post').val()
}
}
var group = 0;
if (jQuery('#edit_interaction_group').length) {
group = jQuery('#edit_interaction_group').val();
......@@ -86,7 +86,7 @@ tinymce.PluginManager.add('imagebrowser', function(editor) {
function addImageBrowser(configblock) {
var browser = jQuery('<div>').attr({'id':'imagebrowser', 'role':'dialog'}).addClass('blockinstance cb configure');
jQuery(browser).append(configblock.data.html);
jQuery(browser).append(configblock.data.html);
jQuery('body').append(browser);
win = jQuery('#imagebrowser');
win.css('width', 520);
......@@ -112,10 +112,10 @@ tinymce.PluginManager.add('imagebrowser', function(editor) {
jQuery('#imgbrowserconf_formattingoptions_container').toggleClass('js-hidden');
jQuery('#formattingoptionstoggle').toggleClass('retracted');
});
jQuery(formname + '_align, ' + formname + '_hspace, ' + formname + '_vspace, ' + formname + '_border').change(function() {
updateStyle();
});
});
var cancelbutton = jQuery(browser).find('#cancel_imgbrowserconf_action_submitimage');
if (cancelbutton.length) {
......@@ -186,7 +186,7 @@ tinymce.PluginManager.add('imagebrowser', function(editor) {
imgElm.onerror = selectImage;
}
updateStyle();
recalcSize();
......@@ -369,7 +369,7 @@ tinymce.PluginManager.add('imagebrowser', function(editor) {
img.src = url;
}
function updateStyle() {
function updateStyle() {
function addPixelSuffix(value) {
if (value.length > 0 && /^[0-9]+$/.test(value)) {
value += 'px';
......
......@@ -125,10 +125,10 @@ class ImageBrowser {
'right' => 'Right'
);
$elements['toggleformatting'] = array(
'type' => 'html',
'class' => 'toggleablecontainer',
'value' => '<div id="formattingoptionstoggle" class="retracted arrow"><label>Image formatting options</label></div>',
);
'type' => 'html',
'class' => 'toggleablecontainer',
'value' => '<div id="formattingoptionstoggle" class="retracted arrow"><label>Image formatting options</label></div>',
);
$elements ['formattingoptions'] = array (
'type' => 'container',
'name' => 'formattingoptions',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment