Skip to content

Commit

Permalink
Merge branch 'nemetris-Reformatted-source-+-fixed-spelling-in-comments'
Browse files Browse the repository at this point in the history
  • Loading branch information
mrg2001 committed May 26, 2021
2 parents 492148b + 3b399f7 commit 4d98cee
Show file tree
Hide file tree
Showing 13 changed files with 1,172 additions and 1,159 deletions.
5 changes: 5 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ module.exports = {
'globals': {
'$': 'readonly',
'app': 'readonly',
'define': 'readonly',
'exports': 'readonly',
'jQuery': 'readonly',
'module': 'readonly',
'w2ui': 'readonly',
'w2obj': 'readonly',
'w2utils': 'readonly',
Expand Down Expand Up @@ -58,6 +62,7 @@ module.exports = {
'func-name-matching': 'warn',
// "func-names": ["warn", "always"],
'no-inner-declarations': 'off',
'no-undef': 'error',
'no-unreachable': 'off'
}
}
7 changes: 6 additions & 1 deletion docs/details/w2utils.parseColor.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@
Returns object.

<h4>Description</h4>
The <span class="argument">color</span> argument is a web color, for example:
The <span class="argument">color</span> argument is a web color.

Valid notations include 3, 6 or 8 hex digits with an optional leading hash symbol,
as well as rgb() or rgba() notations.

Example:

<textarea class="javascript">
w2utils.parseColor('49A4DF01')
Expand Down
191 changes: 95 additions & 96 deletions src/w2compat.js

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions src/w2event.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { w2utils } from './w2utils.js'
class w2event {
constructor(name) {
this.handlers = []
// register globaly
// register globally
if (name) {
window.w2ui = window.w2ui || {}
if (!w2utils.checkName(name)) return
Expand All @@ -22,8 +22,8 @@ class w2event {
// allow 'eventName.scope' syntax
if (typeof edata === 'string' && edata.indexOf('.') !== -1) {
let tmp = edata.split('.')
edata = tmp[0]
scope = tmp[1]
edata = tmp[0]
scope = tmp[1]
}
// allow 'eventName:after' syntax
if (typeof edata === 'string' && edata.indexOf(':') !== -1) {
Expand All @@ -50,8 +50,8 @@ class w2event {
// allow 'eventName.scope' syntax
if (typeof edata === 'string' && edata.indexOf('.') !== -1) {
let tmp = edata.split('.')
edata = tmp[0]
scope = tmp[1]
edata = tmp[0]
scope = tmp[1]
if (edata === '') edata = '*'
}
// allow 'eventName:after' syntax
Expand Down Expand Up @@ -108,7 +108,7 @@ class w2event {
edata = $.extend({}, item.edata, edata)
// check handler arguments
args = []
tmp = new RegExp(/\((.*?)\)/).exec(item.handler)
tmp = new RegExp(/\((.*?)\)/).exec(item.handler)
if (tmp) args = tmp[1].split(/\s*,\s*/)
if (args.length === 2) {
item.handler.call(this, edata.target, edata) // old way for back compatibility
Expand All @@ -124,7 +124,7 @@ class w2event {
fun = this[funName]
// check handler arguments
args = []
tmp = new RegExp(/\((.*?)\)/).exec(fun)
tmp = new RegExp(/\((.*?)\)/).exec(fun)
if (tmp) args = tmp[1].split(/\s*,\s*/)
if (args.length === 2) {
fun.call(this, edata.target, edata) // old way for back compatibility
Expand All @@ -138,7 +138,7 @@ class w2event {
fun = edata.object[funName]
// check handler arguments
args = []
tmp = new RegExp(/\((.*?)\)/).exec(fun)
tmp = new RegExp(/\((.*?)\)/).exec(fun)
if (tmp) args = tmp[1].split(/\s*,\s*/)
if (args.length === 2) {
fun.call(this, edata.target, edata) // old way for back compatibility
Expand Down
Loading

0 comments on commit 4d98cee

Please sign in to comment.