From 07b24bb9f0026082891aab8f73d33416c7cab263 Mon Sep 17 00:00:00 2001 From: Derk-Jan Hartman Date: Mon, 31 Oct 2016 13:57:31 +0100 Subject: [PATCH] Remove inline CodeEditor for This was an unfinished module to enable the CodeEditor to do inline editing of blocks. It was never finished and I think that with the VE and WE 2017 work, it likely will never be finished either. For that reason, it is better to remove it altogether. Change-Id: I83714188a53d2ca6bb7bf0dc6d0c89b7fb45a47a --- CodeEditor.hooks.php | 8 -- extension.json | 17 +--- modules/ext.codeEditor.geshi.css | 3 - modules/ext.codeEditor.geshi.js | 155 ------------------------------- 4 files changed, 1 insertion(+), 182 deletions(-) delete mode 100644 modules/ext.codeEditor.geshi.css delete mode 100644 modules/ext.codeEditor.geshi.js diff --git a/CodeEditor.hooks.php b/CodeEditor.hooks.php index 7ae7396a..fb21b45b 100644 --- a/CodeEditor.hooks.php +++ b/CodeEditor.hooks.php @@ -44,12 +44,4 @@ class CodeEditorHooks { } return true; } - - public static function onBeforePageDisplay( $out, $skin ) { - global $wgCodeEditorGeshiIntegration; - if ( $wgCodeEditorGeshiIntegration ) { - $out->addModules( 'ext.codeEditor.geshi' ); - } - return true; - } } diff --git a/extension.json b/extension.json index ef0b0472..fcb30e06 100644 --- a/extension.json +++ b/extension.json @@ -32,8 +32,7 @@ ] }, "config": { - "CodeEditorEnableCore": true, - "CodeEditorGeshiIntegration": false + "CodeEditorEnableCore": true }, "ResourceModules": { "ext.codeEditor": { @@ -101,20 +100,6 @@ "ace/mode-scala.js" ], "dependencies": "ext.codeEditor.ace" - }, - "ext.codeEditor.geshi": { - "scripts": [ - "ext.codeEditor.geshi.js" - ], - "styles": [ - "ext.codeEditor.geshi.css" - ], - "messages": [ - "editsection", - "savearticle" - ], - "dependencies": "mediawiki.api.parse", - "group": "ext.wikiEditor" } }, "ResourceFileModulePaths": { diff --git a/modules/ext.codeEditor.geshi.css b/modules/ext.codeEditor.geshi.css deleted file mode 100644 index 30e17cf5..00000000 --- a/modules/ext.codeEditor.geshi.css +++ /dev/null @@ -1,3 +0,0 @@ -.mw-geshi .mw-editsection { - float: right; -} diff --git a/modules/ext.codeEditor.geshi.js b/modules/ext.codeEditor.geshi.js deleted file mode 100644 index 7dd99d0d..00000000 --- a/modules/ext.codeEditor.geshi.js +++ /dev/null @@ -1,155 +0,0 @@ -/** - * This is experimental and does not yet actually save anything back. - * Has to be manually enabled. - * Needs some code de-dup with the full-page JS/CSS page editing. - */ -/*global ace */ -( function ( $, mw ) { - -$( function () { - var $sources, setupEditor, openEditor; - - $sources = $( '.mw-geshi' ); - - if ( $sources.length > 0 ) { - setupEditor = function ( $div ) { - var $link, $edit; - - $link = $( '' ) - .text( mw.msg( 'editsection' ) ) - .attr( 'href', '#' ) - .attr( 'title', 'Edit this code section' ) - .click( function ( event ) { - openEditor( $div ); - event.preventDefault(); - } ); - $edit = $( '' ) - .addClass( 'mw-editsection' ) - .append( '[' ) - .append( $link ) - .append( ']' ); - $div.prepend( $edit ); - }; - - openEditor = function ( $div ) { - var $main, geshiLang, matches, $label, $langDropDown, $xcontainer, codeEditor; - - $main = $div.find( 'div' ); - geshiLang = null; - matches = /(?:^| )source-([a-z0-9_-]+)/.exec( $main.attr( 'class' ) ); - - if ( matches ) { - geshiLang = matches[ 1 ]; - } - mw.loader.using( 'ext.codeEditor.ace.modes', function () { - var map, $container, $save, $cancel, $controls, setLanguage, closeEditor; - - // @fixme de-duplicate - map = { - c: 'c_cpp', - cpp: 'c_cpp', - clojure: 'clojure', - csharp: 'csharp', - css: 'css', - coffeescript: 'coffee', - groovy: 'groovy', - html4strict: 'html', - html5: 'html', - java: 'java', - java5: 'java', - javascript: 'javascript', - jquery: 'javascript', - json: 'json', - ocaml: 'ocaml', - perl: 'perl', - php: 'php', - python: 'python', - ruby: 'ruby', - scala: 'scala', - xml: 'xml' - }; - - $container = $( '
' ) - .attr( 'style', 'top: 32px; left: 0px; right: 0px; bottom: 0px; border: 1px solid gray; position: absolute;' ) - .text( $main.text() ); // quick hack :D - - $label = $( '