User:DG/common.js: Difference between revisions

From CODECS: Online Database and e-Resources for Celtic Studies
No edit summary
(Blanked the page)
Tag: Blanking
 
(95 intermediate revisions by 2 users not shown)
Line 1: Line 1:
/* Load in namespace 6 */


if (mw.config.get('wgNamespaceNumber')==6 && mw.config.get('wgAction')=='view') {
mw.loader.load('//tools.wmflabs.org/imagemapedit/ime.js');
}
/* Medium editor */
function setupMedium() {     
var editor = new MediumEditor('.medium-wysiwyg', {
toolbar: {
/* These are the default options for the toolbar,
  if nothing is passed this is what is used */
disableReturn: true,
disableDoubleReturn: true,
disableExtraSpaces: true,
allowMultiParagraphSelection: true,
buttons: ['bold',
  'italic',
  'underline',
  'superscript',
  'subscript'
],
diffLeft: 0,
diffTop: -10,
firstButtonClass: 'medium-editor-button-first',
lastButtonClass: 'medium-editor-button-last',
relativeContainer: null,
standardizeSelectionStart: false,
static: false,
/* options which only apply when static is true */
align: 'center',
sticky: false,
updateOnEmptySelection: false,
toolbar: false,
keyboardCommands: false,
commands: [
{
command: false,
key: 'B', // for bold
meta: true,
shift: false
}
]
}
});
}
/* end of function now declare it  */
$(function() {
if ($('.medium-wysiwyg')[0]) {
   
if( typeof( MediumEditor ) === "undefined" ) {
console.log('no MediumEditor, loading...');
//$.when($.getScript('/vhcodecs/resources/lib/jquery.ui/jquery.ui.sortable.js')).done(function() {
$.getScript('/vhcodecs/custom/js/medium/dist/js/medium-editor.js').done(function() {
setupMedium();
});
//});
} else setupMedium();
   
  }
});

Latest revision as of 21:23, 8 October 2022