Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
taufik-nurrohman committed Mar 18, 2024
1 parent 5fecced commit cf5b538
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .factory/index.js.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function TextEditor(self, state) {
return new TextEditor(self, state);
}

self['_' + TextEditor.name] = hook($);
self['_' + TextEditor.name] = hook($, TextEditor.prototype);

return $.attach(self, fromStates({}, TextEditor.state, isInteger(state) || isString(state) ? {
tab: state
Expand Down
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
<meta content="#000" name="theme-color">
<meta content="width=device-width" name="viewport">
<meta content="A text selection range API written in pure JavaScript, for modern browsers." name="description">
<title>Text Editor 4.1.1</title>
<title>Text Editor 4.1.2</title>
<link href="../layout/index.min.css" rel="stylesheet">
</head>
<body>
<p role="alert">Do you like this project? Please support my <a href="https://github.com/mecha-cms">Mecha CMS</a> project too. Thank you!</p>
<header>
<h1>Text Editor 4.1.1</h1>
<h1>Text Editor 4.1.2</h1>
<p>Text Editor is a simple JavaScript application that aims to provide accessibility enhancements to the native HTML <code>&lt;textarea&gt;</code> elements, allowing users to control and manipulate their data in the text editor as they wish. It contains very sufficient methods to manipulate the existing text selection range data without providing unnecessary features. This keeps the file size small and the learning curve low, so you can fully focus on the results.</p>
<hr>
</header>
Expand Down
14 changes: 7 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@
};
var x = "!$^*()+=[]{}|:<>,.?/-";

function hook($) {
var constructor = $.constructor.prototype;
constructor.fire = function (name, data) {
function hook($, $$) {
$$ = $$ || $;
$$.fire = function (name, data) {
var $ = this,
hooks = $.hooks;
if (!isSet(hooks[name])) {
Expand All @@ -135,7 +135,7 @@
});
return $;
};
constructor.off = function (name, then) {
$$.off = function (name, then) {
var $ = this,
hooks = $.hooks;
if (!isSet(name)) {
Expand All @@ -161,7 +161,7 @@
}
return $;
};
constructor.on = function (name, then) {
$$.on = function (name, then) {
var $ = this,
hooks = $.hooks;
if (!isSet(hooks[name])) {
Expand Down Expand Up @@ -230,7 +230,7 @@
if (!isInstance($, TextEditor)) {
return new TextEditor(self, state);
}
self['_' + TextEditor.name] = hook($);
self['_' + TextEditor.name] = hook($, TextEditor.prototype);
return $.attach(self, fromStates({}, TextEditor.state, isInteger(state) || isString(state) ? {
tab: state
} : state || {}));
Expand All @@ -253,7 +253,7 @@
return current;
};
};
TextEditor.version = '4.1.1';
TextEditor.version = '4.1.2';
TextEditor.x = x;
Object.defineProperty(TextEditor, 'name', {
value: 'TextEditor'
Expand Down
2 changes: 1 addition & 1 deletion index.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function TextEditor(self, state) {
return new TextEditor(self, state);
}

self['_' + TextEditor.name] = hook($);
self['_' + TextEditor.name] = hook($, TextEditor.prototype);

return $.attach(self, fromStates({}, TextEditor.state, isInteger(state) || isString(state) ? {
tab: state
Expand All @@ -84,7 +84,7 @@ TextEditor.S = function (start, end, value) {
$.toString = () => current;
};

TextEditor.version = '4.1.1';
TextEditor.version = '4.1.2';

TextEditor.x = x;

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@
"scripts": {
"pack": "pack --clean=false --from=.factory --js-format=umd --js-name=TextEditor --js-top='%(js.license)' --mjs=true --to=."
},
"version": "4.1.1"
"version": "4.1.2"
}

0 comments on commit cf5b538

Please sign in to comment.