Mooeypoo has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/78138


Change subject: [WIP] Language Block Node Inspector Prototype
......................................................................

[WIP] Language Block Node Inspector Prototype

This is work in progress, mostly just setting up the basics and testing
node wrapping and combining an inspector with a node wrapper functionality.

- Added new LanguageBlock node as <div> element with lang/dir attributes
- Added button (no icon for the moment)
- Added ce/dm functionality
- Added a basic inspector
- TODO: Improve LanguageInputWidget so it could work as an interface to
  both Language Inspector (inline <span>) and Language Block Inspector
  (wrapper <div>)

Change-Id: I4852ec462d63a25a9dc7215df439d96df81be527
---
M VisualEditor.i18n.php
M VisualEditor.php
M modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
M modules/ve/ce/styles/ve.ce.Node.css
M modules/ve/init/ve.init.Target.js
5 files changed, 18 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/38/78138/1

diff --git a/VisualEditor.i18n.php b/VisualEditor.i18n.php
index fde772b..65f9969 100644
--- a/VisualEditor.i18n.php
+++ b/VisualEditor.i18n.php
@@ -33,6 +33,7 @@
        'visualeditor-annotationbutton-italic-tooltip' => 'Italic',
        'visualeditor-annotationbutton-link-tooltip' => 'Link',
        'visualeditor-annotationbutton-language-tooltip' => 'Language',
+       'visualeditor-annotationbutton-languageblock-tooltip' => 'Language 
Block',
        'visualeditor-annotationbutton-strikethrough-tooltip' => 
'Strikethrough',
        'visualeditor-beta-label' => 'beta',
        'visualeditor-beta-warning' => 'VisualEditor is in \'beta\'. You may 
encounter software issues, and you may not be able to edit parts of the page. 
Click "{{int:visualeditor-ca-editsource}}" to switch to wikitext mode – unsaved 
changes will be lost.',
@@ -134,6 +135,7 @@
        'visualeditor-linkinspector-title' => 'Hyperlink',
        'visualeditor-mwhieroinspector-title' => 'Hieroglyphics',
        'visualeditor-mwmathinspector-title' => 'LaTeX',
+       'visualeditor-languageblock-inspector-title' => 'Language Block',
        'visualeditor-languageinspector-title' => 'Language',
        'visualeditor-languageinspector-block-tooltip' => 'Language block: $1',
        'visualeditor-languageinspector-block-tooltip-rtldirection' => ': Right 
to Left',
@@ -247,6 +249,7 @@
 {{Identical|Link}}',
        'visualeditor-annotationbutton-language-tooltip' => 'Tooltip text for 
language button.
 {{Identical|Language}}',
+       'visualeditor-annotationbutton-languageblock-tooltip' => 'Tooltip text 
for language block button',
        'visualeditor-annotationbutton-strikethrough-tooltip' => 'Tooltip text 
for strikethrough button',
        'visualeditor-beta-label' => 'Text of tool in the toolbar that 
highlights that VisualEditor is still in beta.
 {{Identical|Beta}}',
@@ -432,6 +435,7 @@
        'visualeditor-mwmathinspector-title' => 'Used as title for 
MathInspector.
 
 See [[w:LaTeX]].',
+       'visualeditor-languageblock-inspector-title' => 'Title of the language 
block inspector dialog',
        'visualeditor-languageinspector-title' => 'Title of the language 
inspector dialog.
 {{Identical|Language}}',
        'visualeditor-languageinspector-block-tooltip' => 'Tooltip identifying 
language block properties inside VisualEditor. Parameters: $1 - the language 
code (for example "en")',
diff --git a/VisualEditor.php b/VisualEditor.php
index 9a00f6b..7a0e2a3 100644
--- a/VisualEditor.php
+++ b/VisualEditor.php
@@ -728,6 +728,10 @@
                        've/ui/widgets/ve.ui.LanguageInputWidget.js',
                        've/ui/tools/buttons/ve.ui.CodeButtonTool.js',
                        've/ui/tools/buttons/ve.ui.StrikethroughButtonTool.js',
+                       've/dm/nodes/ve.dm.LanguageBlockNode.js',
+                       've/ce/nodes/ve.ce.LanguageBlockNode.js',
+                       've/ui/inspectors/ve.ui.LanguageBlockInspector.js',
+                       've/ui/tools/buttons/ve.ui.LanguageBlockButtonTool.js',
                ),
                'dependencies' => array(
                        'ext.visualEditor.core',
@@ -738,7 +742,9 @@
                        'visualeditor-mwhieroinspector-title',
                        'visualeditor-mwmathinspector-title',
                        'visualeditor-annotationbutton-language-tooltip',
+                       'visualeditor-annotationbutton-languageblock-tooltip',
                        'visualeditor-annotationbutton-strikethrough-tooltip',
+                       'visualeditor-languageblock-inspector-title',
                ),
        ),
 
diff --git a/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js 
b/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
index 16b7d41..8ffeb73 100644
--- a/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
+++ b/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js
@@ -171,7 +171,7 @@
        { 'items': [ 'undo', 'redo' ] },
        { 'items': [ 'mwFormat' ] },
        { 'items': [ 'bold', 'italic', 'mwLink', 'language', 'code', 
'strikethrough', 'clear' ] },
-       { 'items': [ 'number', 'bullet', 'outdent', 'indent' ] },
+       { 'items': [ 'number', 'bullet', 'outdent', 'indent', 'languageblock' ] 
},
        { 'items': [ 'mwMediaInsert', 'mwReference', 'mwReferenceList', 
'mwTransclusion', 'mwMath', 'mwHiero' ] }
 ];
 
diff --git a/modules/ve/ce/styles/ve.ce.Node.css 
b/modules/ve/ce/styles/ve.ce.Node.css
index 6458fb6..8955694 100644
--- a/modules/ve/ce/styles/ve.ce.Node.css
+++ b/modules/ve/ce/styles/ve.ce.Node.css
@@ -192,3 +192,9 @@
        border-bottom: dashed #ccc 1px;
        background-color: #ebf3f5;
 }
+
+/* Language Block Div Node */
+.ve-ce-languageBlockNode {
+       border: dashed #ccc 1px;
+       background-color: #ebf3f5;
+}
\ No newline at end of file
diff --git a/modules/ve/init/ve.init.Target.js 
b/modules/ve/init/ve.init.Target.js
index 28c246d..74d0a6c 100644
--- a/modules/ve/init/ve.init.Target.js
+++ b/modules/ve/init/ve.init.Target.js
@@ -33,7 +33,7 @@
        { 'items': ['undo', 'redo'] },
        { 'items': ['format'] },
        { 'items': ['bold', 'italic', 'link', 'code', 'language', 
'strikethrough', 'clear'] },
-       { 'items': ['number', 'bullet', 'outdent', 'indent'] }
+       { 'items': ['number', 'bullet', 'outdent', 'indent', 'languageblock'] }
 ];
 
 ve.init.Target.static.surfaceCommands = [

-- 
To view, visit https://gerrit.wikimedia.org/r/78138
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4852ec462d63a25a9dc7215df439d96df81be527
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo <mor...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to