لإنشاء إدخال مخصّص، عليك إدراج فئة فرعية Input أو إحدى
وفئاتها الفرعية.
classMyInputextendsBlockly.inputs.Input{// The constructor should always take in a name and a block to be compatible// with JSON block definitions.constructor(name,block){super(name,block);// etc...}}
يمكنك إنشاء عملية ربط (إجراء اختياري).
إذا كنت تريد أن يكون للمدخل اتصال، فيجب إنشاء ذلك في
الدالة الإنشائية، من خلال استدعاء الطريقة makeConnection.
تاريخ التعديل الأخير: 2024-09-09 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2024-09-09 (حسب التوقيت العالمي المتفَّق عليه)"],[[["Subclass `Blockly.inputs.Input` to create a custom input, ensuring the constructor accepts a name and block for JSON compatibility."],["Optionally create a connection for the input using the `makeConnection` method within the constructor."],["Register the custom input with `Blockly.registry` to enable its usage in JSON block definitions, associating it with a unique string identifier."],["Custom inputs cannot replace built-in inputs, nor can custom JSON configuration be added to built-in inputs."]]],["To create a custom input, subclass the `Input` class, including a constructor that accepts a name and block. Optionally, create a connection within the constructor using the `makeConnection` method. To use the custom input in JSON block definitions, register it with `Blockly.registry.register`, associating it with a unique string. Note that unlike custom fields, built-in inputs cannot be overridden and do not accept custom JSON configurations.\n"]]