mirror of
https://github.com/google/blockly.git
synced 2026-01-10 02:17:09 +01:00
Migrate core/keyboard_nav/cursor.js to goog.module
This commit is contained in:
@@ -11,7 +11,8 @@
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
goog.provide('Blockly.Cursor');
|
||||
goog.module('Blockly.Cursor');
|
||||
goog.module.declareLegacyNamespace();
|
||||
|
||||
goog.require('Blockly.ASTNode');
|
||||
goog.require('Blockly.Marker');
|
||||
@@ -25,15 +26,15 @@ goog.require('Blockly.utils.object');
|
||||
* @constructor
|
||||
* @extends {Blockly.Marker}
|
||||
*/
|
||||
Blockly.Cursor = function() {
|
||||
Blockly.Cursor.superClass_.constructor.call(this);
|
||||
const Cursor = function() {
|
||||
Cursor.superClass_.constructor.call(this);
|
||||
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
this.type = 'cursor';
|
||||
};
|
||||
Blockly.utils.object.inherits(Blockly.Cursor, Blockly.Marker);
|
||||
Blockly.utils.object.inherits(Cursor, Blockly.Marker);
|
||||
|
||||
/**
|
||||
* Find the next connection, field, or block.
|
||||
@@ -41,7 +42,7 @@ Blockly.utils.object.inherits(Blockly.Cursor, Blockly.Marker);
|
||||
* not set or there is no next value.
|
||||
* @public
|
||||
*/
|
||||
Blockly.Cursor.prototype.next = function() {
|
||||
Cursor.prototype.next = function() {
|
||||
const curNode = this.getCurNode();
|
||||
if (!curNode) {
|
||||
return null;
|
||||
@@ -66,7 +67,7 @@ Blockly.Cursor.prototype.next = function() {
|
||||
* not set or there is no in value.
|
||||
* @public
|
||||
*/
|
||||
Blockly.Cursor.prototype.in = function() {
|
||||
Cursor.prototype.in = function() {
|
||||
let curNode = this.getCurNode();
|
||||
if (!curNode) {
|
||||
return null;
|
||||
@@ -91,7 +92,7 @@ Blockly.Cursor.prototype.in = function() {
|
||||
* is not set or there is no previous value.
|
||||
* @public
|
||||
*/
|
||||
Blockly.Cursor.prototype.prev = function() {
|
||||
Cursor.prototype.prev = function() {
|
||||
const curNode = this.getCurNode();
|
||||
if (!curNode) {
|
||||
return null;
|
||||
@@ -116,7 +117,7 @@ Blockly.Cursor.prototype.prev = function() {
|
||||
* not set or there is no out value.
|
||||
* @public
|
||||
*/
|
||||
Blockly.Cursor.prototype.out = function() {
|
||||
Cursor.prototype.out = function() {
|
||||
const curNode = this.getCurNode();
|
||||
if (!curNode) {
|
||||
return null;
|
||||
@@ -134,4 +135,6 @@ Blockly.Cursor.prototype.out = function() {
|
||||
};
|
||||
|
||||
Blockly.registry.register(
|
||||
Blockly.registry.Type.CURSOR, Blockly.registry.DEFAULT, Blockly.Cursor);
|
||||
Blockly.registry.Type.CURSOR, Blockly.registry.DEFAULT, Cursor);
|
||||
|
||||
exports = Cursor;
|
||||
|
||||
@@ -101,7 +101,7 @@ goog.addDependency('../../core/interfaces/i_toolbox.js', ['Blockly.IToolbox'], [
|
||||
goog.addDependency('../../core/interfaces/i_toolbox_item.js', ['Blockly.ICollapsibleToolboxItem', 'Blockly.ISelectableToolboxItem', 'Blockly.IToolboxItem'], []);
|
||||
goog.addDependency('../../core/keyboard_nav/ast_node.js', ['Blockly.ASTNode'], ['Blockly.connectionTypes', 'Blockly.constants', 'Blockly.utils.Coordinate'], {'lang': 'es5'});
|
||||
goog.addDependency('../../core/keyboard_nav/basic_cursor.js', ['Blockly.BasicCursor'], ['Blockly.ASTNode', 'Blockly.Cursor', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'});
|
||||
goog.addDependency('../../core/keyboard_nav/cursor.js', ['Blockly.Cursor'], ['Blockly.ASTNode', 'Blockly.Marker', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es5'});
|
||||
goog.addDependency('../../core/keyboard_nav/cursor.js', ['Blockly.Cursor'], ['Blockly.ASTNode', 'Blockly.Marker', 'Blockly.registry', 'Blockly.utils.object'], {'lang': 'es6', 'module': 'goog'});
|
||||
goog.addDependency('../../core/keyboard_nav/marker.js', ['Blockly.Marker'], ['Blockly.ASTNode']);
|
||||
goog.addDependency('../../core/keyboard_nav/tab_navigate_cursor.js', ['Blockly.TabNavigateCursor'], ['Blockly.ASTNode', 'Blockly.BasicCursor', 'Blockly.utils.object']);
|
||||
goog.addDependency('../../core/marker_manager.js', ['Blockly.MarkerManager'], ['Blockly.Cursor', 'Blockly.Marker']);
|
||||
|
||||
Reference in New Issue
Block a user