X7ROOT File Manager
Current Path:
/home/cbholdings/pasukulu/h5p/h5plib/v124/joubel/editor/scripts
home
/
cbholdings
/
pasukulu
/
h5p
/
h5plib
/
v124
/
joubel
/
editor
/
scripts
/
📁
..
📄
h5p-hub-client.js
(331.61 KB)
📄
h5peditor-av.js
(21.38 KB)
📄
h5peditor-boolean.js
(1.99 KB)
📄
h5peditor-coordinates.js
(5.1 KB)
📄
h5peditor-dimensions.js
(4.26 KB)
📄
h5peditor-editor.js
(18.25 KB)
📄
h5peditor-file-uploader.js
(3.69 KB)
📄
h5peditor-file.js
(8.54 KB)
📄
h5peditor-form.js
(14 KB)
📄
h5peditor-fullscreen-bar.js
(2.7 KB)
📄
h5peditor-group.js
(10.39 KB)
📄
h5peditor-html.js
(17.01 KB)
📄
h5peditor-image-popup.js
(12.1 KB)
📄
h5peditor-image.js
(8.09 KB)
📄
h5peditor-init.js
(3.72 KB)
📄
h5peditor-library-list-cache.js
(3.38 KB)
📄
h5peditor-library-selector.js
(9.97 KB)
📄
h5peditor-library.js
(16.98 KB)
📄
h5peditor-list-editor.js
(10.4 KB)
📄
h5peditor-list.js
(9.08 KB)
📄
h5peditor-metadata-author-widget.js
(3.91 KB)
📄
h5peditor-metadata-changelog-widget.js
(7.5 KB)
📄
h5peditor-metadata.js
(14.66 KB)
📄
h5peditor-none.js
(918 B)
📄
h5peditor-number.js
(4.79 KB)
📄
h5peditor-pre-save.js
(3.62 KB)
📄
h5peditor-select.js
(3.24 KB)
📄
h5peditor-selector-hub.js
(7.76 KB)
📄
h5peditor-selector-legacy.js
(3.11 KB)
📄
h5peditor-semantic-structure.js
(7.39 KB)
📄
h5peditor-text.js
(3.15 KB)
📄
h5peditor-textarea.js
(2.68 KB)
📄
h5peditor.js
(53.53 KB)
Editing: h5peditor-boolean.js
/* global ns */ /** * Creates a boolean field for the editor. * * @param {mixed} parent * @param {object} field * @param {mixed} params * @param {function} setValue * @returns {ns.Boolean} */ ns.Boolean = function (parent, field, params, setValue) { if (params === undefined) { this.value = false; setValue(field, this.value); } else { this.value = params; } this.field = field; this.setValue = setValue; // Setup event dispatching on change this.changes = []; this.triggerListeners = function (value) { // Run callbacks for (var i = 0; i < this.changes.length; i++) { this.changes[i](value); } }; }; /** * Create HTML for the boolean field. */ ns.Boolean.prototype.createHtml = function () { const id = ns.getNextFieldId(this.field); const checked = (this.value !== undefined && this.value) ? ' checked' : ''; let content = '<input id="' + id + '" type="checkbox"'; if (this.field.description !== undefined) { content += ' aria-describedby="' + ns.getDescriptionId(id) + '"'; } if (this.value !== undefined && this.value) { content += ' checked'; } content += '/>'; return ns.createBooleanFieldMarkup(this.field, content, id); }; /** * "Validate" the current boolean field. */ ns.Boolean.prototype.validate = function () { return true; }; /** * Append the boolean field to the given wrapper. * * @param {jQuery} $wrapper * @returns {undefined} */ ns.Boolean.prototype.appendTo = function ($wrapper) { var that = this; this.$item = ns.$(this.createHtml()).appendTo($wrapper); this.$input = this.$item.find('input'); this.$errors = this.$item.find('.h5p-errors'); this.$input.change(function () { // Validate that.value = that.$input.is(':checked'); that.setValue(that.field, that.value); that.triggerListeners(that.value); }); }; /** * Remove this item. */ ns.Boolean.prototype.remove = function () { this.$item.remove(); }; // Tell the editor what widget we are. ns.widgets['boolean'] = ns.Boolean;
Upload File
Create Folder