aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-09-11input: allow label to be HTMLElement instead of only stringShulhan
A label on input can be a string or another HTMLElement.
2021-09-05notif: convert the example using TypeScript and load it with type="module"Shulhan
2021-09-05vfs: refactor example to use TypeScript loaded with type="module"Shulhan
2021-09-05editor: convert the example to TypeScript and loaded as moduleShulhan
2021-09-05input: implement input for checkboxesShulhan
The WuiInputCheckboxes class can create an HTML input for selecting one or more item using checkbox. The class require the following options: label, name, and options; and optionally id, hint, is_disabled, and onChangeHandler. The onChangeHandler receive all checked values.
2021-09-05input: implement class for input with selectShulhan
The WuiInputSelect create an HTML input for selecting one more item.
2021-09-05input: implement class WuiInputStringShulhan
The WuiInputString create an HTML input for string with predefined options. The required options are "label" and "value".
2021-09-05input: implement class for input numberShulhan
The WuiInputNumber create an HTML input that allow number only, with optional max and min options. The required options is "label" and "value". Format of generated HTML output, <div [id=${id}] class="${WUI_INPUT_NUMBER_CLASS}"> <div> <label class="${WUI_INPUT_NUMBER_CLASS_LABEL}">${label}</label> <input class="${WUI_INPUT_NUMBER_CLASS_INPUT}" [max=${max}] [min=${min}] [disabled=${is_disabled}] value=${value} > <span class="${WUI_INPUT_NUMBER_CLASS_HINT_TOGGLER}">i </span> </div> <div class="${WUI_INPUT_NUMBER_CLASS_HINT}">${hint}</div> </div> User can set onChangeHandler to receive new value when the value changes and valid; otherwise, if the value is invalid, the input background will changes accordingly.
2021-09-05all: set target compiler lib, target and module to es2015Shulhan
In order to minimize dependencies with require.js, we set the "lib", "target" and "module" to es2015 and "esModuleInterop" to true to allow module importable on browser.
2021-08-30editor: fix example converting the content to base64Shulhan
2021-08-30vfs: remove WuiVfsNode in favor of WuiVfsNodeInterfaceShulhan
Since WuiVfsNode does not have any methods then and the constructor only initialize the value to zero, we remove the type and use the interface instead.
2021-08-29all: remove and ignore generate JavaScript filesShulhan
2021-08-29editor: remove unused import WuiResponseInterfaceShulhan
2021-08-29vfs: export the WuiVfsNode classShulhan
While at it, fix the return type of Open and OpenNode on WuiVfsOptions to be Promise.
2021-08-29response: make the message field to be requiredShulhan
2021-08-29editor: make the lines field become publicShulhan
2021-08-29vfs: add handler OpenNode to WuiVfsOptionsShulhan
The OpenNode define an handler that will be called when a node is clicked from the WuiVfsList.
2021-08-29notif: make the notification position to fixedShulhan
This is to fix the notification hidden when the current document have scroll.
2021-08-29vfs: add content_type to WuiVfsNodeInterface and use single mod_timeShulhan
2021-08-29editor: always decode the node content from base64Shulhan
2021-08-29vfs: simplify the handlers on WuiVfsOptionsShulhan
Previously, the WuiVfsOptions contains two handlers: ListNodes to retrieve list of files and OnClickNode for triggering changes when user click a path or item in the list. This changes simplify it into single handler: Open, which accept path and boolean is_dir.
2021-08-29editor: simplify the Open methodShulhan
Previously, the Open method call the predefined options OpenFile, which in turn may send request to remote server. This changes simplify it by accepting node interface that has been filled with content and metadata.
2021-08-28editor: listen on key Escape on document to clear selectionShulhan
Previously, to clear selection, user must set the editor to active by selecting any line. This commit allow user to clear selection by pressing "Escape" anywhere on the document. While at it, add methods to turn on or off the editor editability.
2021-08-28all: use the WuiResponseInterface for non-void return typeShulhan
This commit changes the WuiVfsOptions.istNodes and WuiEditorOptions.OpenFile to WuiResponseInterface. WuiResponseInterface define an interface that will be returned by function or method with non-void type. If the function/method success, the code should be set to 200 (equal to HTTP OK), and the data will contains the expected data for that function. If the function/method call failed, the code should be set to other value beside 200 with a message describe why its failed.
2021-08-28all: refactoring to follow the coding style in READMEShulhan
* Use snake_case for field, variable, HTML ID, and CSS class names. * Use camelCase for class, interface, type, function, or method names. * An exported type or class. interface, type, method, or function name MUST start with an upper-case letter. * An exported class, type, interface, or function MUST be prefixed with "Wui".
2021-08-28vfs: rename all fields and variables to use snake caseShulhan
2021-08-28notif: implement component for notificationShulhan
The WuiNotif implement the HTML interface to display pop-up notification. The notification can be triggered by calling method Info() or Error(). Each pop-up has 5 seconds duration, after that they will be removed automatically.
2021-08-27vfs: rename onClickPath to OpenPathShulhan
2021-08-27editor: add handler to save the contentShulhan
When user press CTRL+S on the editor, it will trigger the OnSave handler. While at it, * auto scroll when pressing arrow up or down * auto scroll to bottom when pressing Enter at the end of file * fix tab key not inserting tab characters
2021-08-27vfs: add parameter is_dir to OnClickNode handlerShulhan
The is_dir parameter indicated that the node is a directory.
2021-08-23vfs: fix the path when clicking crumb's pathShulhan
While at it, change the border to silver and use console.error for logging an error message.
2021-08-23vfs: use different background color for directoryShulhan
If the node is directory the background color is cornsilk, otherwise the background color is white.
2021-08-23editor: remove the SaveFile field from EditorShulhan
2021-08-22editor: add method GetContentShulhan
The GetContent method return the concatenated statements with new-line. While at it, set default range begin and end to -1 to fix issue where user select only line number 1 (index 0).
2021-08-15editor: add method to get file and selection rangeShulhan
The GetFile method return the current file as IVfsNode, including its content (concatenated). The GetSelectionRange return the current selection on the editor.
2021-08-15vfs: make the is_dir field on IVfsNode to be optionalShulhan
2021-08-12editor: add event handler for OnSelectionShulhan
The OnSelection event will be triggered when user select one or more lines.
2021-08-12vfs: add event OnClickNodeShulhan
The OnClickNode event will be send when user click non-directory files.
2021-07-31editor: pressing escape key will clear the selectionShulhan
2021-07-31editor: implement redo functionality using CTRL+rShulhan
2021-07-31all: add license file and headersShulhan
2021-07-29editor: handle undo with CTRL+ZShulhan
2021-07-27editor: fix paste to plain textShulhan
Previously copy or cutting text on line and pasting it will generate <span> inside the line. This commit fix the paste function to paste only text.
2021-07-27editor: fix enter and support for backspaceShulhan
Enter on middle of line now will cut the text and move the rest text after caret to the next line. Pressing backspace on the beginning of line will merge the line with previous one.
2021-07-26editor: init the style sheet using javascript and add support for tabShulhan
2021-07-26editor: add support to move arrow up and down between textShulhan
2021-07-26all: implement editorShulhan
2021-07-26vfs: implement virtual file system explorerShulhan
The vfs.js implement the web user interface for virtual file system explorer.