From 94816a1cef50c0d747e883a1353eb46116132698 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Mon, 24 Feb 2025 19:30:18 -0500 Subject: [PATCH 1/7] spelling: associated Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- js/VisualEvent.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/VisualEvent.js b/js/VisualEvent.js index 1fe8ced..5a27125 100644 --- a/js/VisualEvent.js +++ b/js/VisualEvent.js @@ -20,7 +20,7 @@ /** * Visual Event will show, visually, which DOM elements on a web-page have events attached to - * them, information about those events and the code accossiated with each handler for the + * them, information about those events and the code associated with each handler for the * event. It does this by parsing through the cache of Javascript libraries (as there is no DOM * method to get the information required), thus a major part of Visual Event are the library * parsers. A result of this is that universal display of events is not possible - there must From 4ff8a29df4d8ab6b1a99a6b82a3ce59f38557985 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Mon, 24 Feb 2025 23:15:38 -0500 Subject: [PATCH 2/7] spelling: check Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- js/VisualEvent.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/VisualEvent.js b/js/VisualEvent.js index 5a27125..c99b7fd 100644 --- a/js/VisualEvent.js +++ b/js/VisualEvent.js @@ -553,7 +553,7 @@ VisualEvent.prototype = { /* Add the API array information - if it is available */ if ( typeof VisualEvents == 'object' ) { - if ( this._ceckIntegrity( VisualEvents ) ) { + if ( this._checkIntegrity( VisualEvents ) ) { elements = this._combineEvents( elements, VisualEvents ); } } From 30f030445668a1d02231ee041cfe776cf020d3dc Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Mon, 24 Feb 2025 19:55:31 -0500 Subject: [PATCH 3/7] spelling: constructor Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- js/VisualEvent_Loader.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/VisualEvent_Loader.js b/js/VisualEvent_Loader.js index 8aacebc..90cbc7e 100644 --- a/js/VisualEvent_Loader.js +++ b/js/VisualEvent_Loader.js @@ -70,7 +70,7 @@ window.VisualEvent_Loader = function () VisualEvent_Loader.prototype = { /** - * Constrctor - show a loading element to the end user and then load up the various files + * Constructor - show a loading element to the end user and then load up the various files * that are needed * @returns {undefined} * @private From fba6a7f2f3cc90ece0e831d3cf3e218ca6caea2b Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Mon, 24 Feb 2025 19:56:15 -0500 Subject: [PATCH 4/7] spelling: github Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- js/VisualEvent.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/VisualEvent.js b/js/VisualEvent.js index c99b7fd..10c9d1c 100644 --- a/js/VisualEvent.js +++ b/js/VisualEvent.js @@ -225,7 +225,7 @@ window.VisualEvent = function () ''+ '

Visual Event is open source software (GPLv2). If you would like to contribute an '+ 'enhancement, please fork the project on '+ - 'Github!

'+ + 'GitHub!

'+ '

Click anywhere to close this help box.

'+ ''+ '')[0], From b1a26876c0c0ee055f96e78a0efbe704ce439e7a Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Mon, 24 Feb 2025 19:56:22 -0500 Subject: [PATCH 5/7] spelling: javascript Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- Readme.markdown | 18 +++++++++--------- bookmarklet.html | 4 ++-- build.sh | 8 ++++---- js/VisualEvent.js | 16 ++++++++-------- js/VisualEvent_Loader.js | 6 +++--- 5 files changed, 26 insertions(+), 26 deletions(-) diff --git a/Readme.markdown b/Readme.markdown index 9dc44b5..e66043f 100644 --- a/Readme.markdown +++ b/Readme.markdown @@ -1,6 +1,6 @@ -# Visual Event - visually inspect Javascript events +# Visual Event - visually inspect JavaScript events -Visual Event is a Javascript bookmarklet which provides debugging information about events that have been attached to DOM elements. Visual Event shows: +Visual Event is a JavaScript bookmarklet which provides debugging information about events that have been attached to DOM elements. Visual Event shows: * Which elements have events attached to them * The type of events attached to an element @@ -15,7 +15,7 @@ In addition to being useful for debugging your own code, Visual Event can be use As Visual Event is a bookmarklet, installing and running it on any web-page is extremely simple: * Open the [Visual Event bookmarklet page](http://sprymedia.co.uk/VisualEvent) and drag the "Visual Event" link to your bookmark bar -* Load a web-page which uses one of the supported Javascript libraries +* Load a web-page which uses one of the supported JavaScript libraries * Click "Visual Event" in your bookmark bar * View the event handlers which are attached to the document elements. @@ -24,9 +24,9 @@ A demo of Visual Event that is automatically loaded is [available](http://spryme ## How it works -It turns out that there is no standard method provided by the W3C recommended DOM interface to find out what event listeners are attached to a particular element. While this may appear to be an oversight, there was a proposal to include a property called [eventListenerList](http://www.w3.org/TR/2002/WD-DOM-Level-3-Events-20020208/changes.html) to the level 3 DOM specification, but was unfortunately been removed in later drafts. As such we are forced to looked at the individual Javascript libraries, which typically maintain a cache of attached events (so they can later be removed and perform other useful abstractions). +It turns out that there is no standard method provided by the W3C recommended DOM interface to find out what event listeners are attached to a particular element. While this may appear to be an oversight, there was a proposal to include a property called [eventListenerList](http://www.w3.org/TR/2002/WD-DOM-Level-3-Events-20020208/changes.html) to the level 3 DOM specification, but was unfortunately been removed in later drafts. As such we are forced to looked at the individual JavaScript libraries, which typically maintain a cache of attached events (so they can later be removed and perform other useful abstractions). -As such, in order for Visual Event to show events, it must be able to parse the event information out of a Javascript library. Currently the following libraries are supported by Visual Event: +As such, in order for Visual Event to show events, it must be able to parse the event information out of a JavaScript library. Currently the following libraries are supported by Visual Event: * DOM 0 events * jQuery 1.2+ @@ -40,9 +40,9 @@ As such, in order for Visual Event to show events, it must be able to parse the Any help with improvements and suggestions for Visual Event are very welcome indeed! If you hit a specific problem, then please open an issue on GitHub for the problem you are encountering, including a link to the page where the problem occurs. Forks and pull requests are also very much encouraged! -One area which may be of interest to you is how to add support for additional Javascript libraries. The key thing that is needed is access to the event cache that the library uses, since without that it is impossible to determine what nodes have events and the attached code. +One area which may be of interest to you is how to add support for additional JavaScript libraries. The key thing that is needed is access to the event cache that the library uses, since without that it is impossible to determine what nodes have events and the attached code. -The VisualEvent class has a static array called `VisualEvent.parsers` which is an array of functions - to add a new parser, just push your function onto this array. The function must return a Javascript array of objects with the following parameters: +The VisualEvent class has a static array called `VisualEvent.parsers` which is an array of functions - to add a new parser, just push your function onto this array. The function must return a JavaScript array of objects with the following parameters: ```javascript [ @@ -64,7 +64,7 @@ The VisualEvent class has a static array called `VisualEvent.parsers` which is a ## Building Visual Event -In order to run a local copy of Visual Event you must build it, since this process does file concatenation, which brings in the library parsers to the main file. The build process will also build the JSDoc documentation and compress the Javascript files (unless made with debug). +In order to run a local copy of Visual Event you must build it, since this process does file concatenation, which brings in the library parsers to the main file. The build process will also build the JSDoc documentation and compress the JavaScript files (unless made with debug). To build Visual Event, all you need is a system which will run bash scripts and enter the command `./build.sh debug` in your terminal. This will create a new directory in the "builds" directory with the correct loader and the build Visual Event directory (note the timestamp is used to help prevent caching issues for the bookmarklet, both during development and when deployed). The following is the usage for the build script: @@ -76,7 +76,7 @@ Visual Event build script - usage: automatically prepended. For example: localhost/VisualEvent/builds - default if no option is provided sprymedia.co.uk/VisualEvent/builds - debug - Debug indicator. Will not compress the Javascript + debug - Debug indicator. Will not compress the JavaScript Example deploy build: ./build.sh sprymedia.co.uk/VisualEvent/builds diff --git a/bookmarklet.html b/bookmarklet.html index b9597fd..6128c0d 100644 --- a/bookmarklet.html +++ b/bookmarklet.html @@ -50,11 +50,11 @@

Visual Event bookmarklet generator

Visual Event is a bookmarklet which will visually show you which elements on an HTML - page have Javascript events assigned to them. This page can be used to generate the + page have JavaScript events assigned to them. This page can be used to generate the bookmarklet that you want to use for testing or deployment of Visual Event.

- To generate a bookmarklet, modify the Javascript in the textarea below, the + To generate a bookmarklet, modify the JavaScript in the textarea below, the bookmarklet link will be updated as you type (typically you will only need to change the URL to load Visual Event) and then click and drag the Visual Event link to your bookmarklet bar. diff --git a/build.sh b/build.sh index eef5483..48cb871 100755 --- a/build.sh +++ b/build.sh @@ -8,7 +8,7 @@ if [ "$1" = "-h" ]; then directory name is automatically appended. For example: localhost/VisualEvent/builds - default if no option is provided sprymedia.co.uk/VisualEvent/builds - debug - Debug indicator. Will not compress the Javascript + debug - Debug indicator. Will not compress the JavaScript Example deploy build: ./build.sh sprymedia.co.uk/VisualEvent/builds @@ -57,16 +57,16 @@ mkdir -p "$BUILD" # JAVASCRIPT -echo " Javascript" +echo " JavaScript" mkdir "$BUILD_JS" -echo " Combining Javascript files" +echo " Combining JavaScript files" cp "$JS/VisualEvent_Loader.js" "$BUILD_BASE/VisualEvent_Loader.js" cat "$JS/jquery.js" "$JS/shCore.js" "$JS/VisualEvent.js" "$JS"/parsers/*.js > "$BUILD_JS/VisualEvent-jQuery.js" cat "$JS/shCore.js" "$JS/VisualEvent.js" "$JS"/parsers/*.js > "$BUILD_JS/VisualEvent.js" if [ "$DEBUG" != "debug" -a -e $UGLIFYJS ]; then - echo " Compressing Javascript" + echo " Compressing JavaScript" $UGLIFYJS $BUILD_BASE/VisualEvent_Loader.js > $BUILD_BASE/VisualEvent_Loader.min.js $UGLIFYJS $BUILD_JS/VisualEvent-jQuery.js > $BUILD_JS/VisualEvent-jQuery.min.js $UGLIFYJS $BUILD_JS/VisualEvent.js > $BUILD_JS/VisualEvent.min.js diff --git a/js/VisualEvent.js b/js/VisualEvent.js index 10c9d1c..e2070ce 100644 --- a/js/VisualEvent.js +++ b/js/VisualEvent.js @@ -1,6 +1,6 @@ /** * @summary Visual Event - * @description Visual Event - show Javascript events which have been attached to objects, and + * @description Visual Event - show JavaScript events which have been attached to objects, and * the event's associated function code, visually. * @file VisualEvent_Loader.js * @author Allan Jardine (www.sprymedia.co.uk) @@ -21,7 +21,7 @@ /** * Visual Event will show, visually, which DOM elements on a web-page have events attached to * them, information about those events and the code associated with each handler for the - * event. It does this by parsing through the cache of Javascript libraries (as there is no DOM + * event. It does this by parsing through the cache of JavaScript libraries (as there is no DOM * method to get the information required), thus a major part of Visual Event are the library * parsers. A result of this is that universal display of events is not possible - there must * be a parser available. @@ -172,11 +172,11 @@ window.VisualEvent = function () '

'+ '
'+ '

Visual Event help

'+ - '

Visual Event will show which elements on any given page have Javascript events attached '+ + '

Visual Event will show which elements on any given page have JavaScript events attached '+ 'to them, what those events are and the code associated with the events. In Webkit '+ 'browsers and Opera, Visual Event will also indicate where the code in question was '+ 'defined.

'+ - '

Note that Visual Event is only able to show events for Javascript libraries for which '+ + '

Note that Visual Event is only able to show events for JavaScript libraries for which '+ 'it has a parser. This is currently: DOM0 events, Glow, jQuery, MooTools, Prototype and YUI2.

'+ '

Commands:

'+ ''+ @@ -360,7 +360,7 @@ VisualEvent.prototype = { this._renderLabel(); - /* Load the text of all the Javascript on the page so we can try to find source */ + /* Load the text of all the JavaScript on the page so we can try to find source */ this._scriptsLoad(); }, @@ -389,11 +389,11 @@ VisualEvent.prototype = { /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Javascript source handling + * JavaScript source handling */ /** - * Parse the DOM for script tags and store the Javascript that is found. For any scripts which + * Parse the DOM for script tags and store the JavaScript that is found. For any scripts which * have a 'src' attribute, add them to a queue for Ajax loading and then start the queue running * @private */ @@ -1161,7 +1161,7 @@ VisualEvent.prototype = { * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /** - * Javascript library parsers which will find information about the nodes and events which are + * JavaScript library parsers which will find information about the nodes and events which are * used in the page. This is an array of functions which must return an array of objects with * the following parameters * {element} node The DOM element in question diff --git a/js/VisualEvent_Loader.js b/js/VisualEvent_Loader.js index 90cbc7e..1845a16 100644 --- a/js/VisualEvent_Loader.js +++ b/js/VisualEvent_Loader.js @@ -1,6 +1,6 @@ /** * @summary VisualEvent_Loader - * @description Loader for VisualEvent - injects the required CSS and Javascript into a page + * @description Loader for VisualEvent - injects the required CSS and JavaScript into a page * @file VisualEvent_Loader.js * @author Allan Jardine (www.sprymedia.co.uk) * @license GPL v2 @@ -19,7 +19,7 @@ if ( typeof VisualEvent_Loader == 'undefined' ) { /** - * VisualEvent_Loader is a class which will provide pre-loading of Javascript and CSS files + * VisualEvent_Loader is a class which will provide pre-loading of JavaScript and CSS files * for VisualEvent based on the environment the script is running in (for example if jQuery is * already available or not). * @@ -136,7 +136,7 @@ VisualEvent_Loader.prototype = { /** * Load a new file into the DOM, and have it processed based on its type. This can be a - * Javascript file, a CSS file or an image + * JavaScript file, a CSS file or an image * @param {string} file URL to the file to load * @param {string} type The file type. Can be "css", "js" or "image" * @returns {undefined} From 12cf79fdba85548d485fc0aa28296fdd5352fb17 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Mon, 24 Feb 2025 19:56:00 -0500 Subject: [PATCH 6/7] spelling: separated Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- js/VisualEvent.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/VisualEvent.js b/js/VisualEvent.js index e2070ce..1b0bc92 100644 --- a/js/VisualEvent.js +++ b/js/VisualEvent.js @@ -511,7 +511,7 @@ VisualEvent.prototype = { /** - * Get the name of a file from a URL (i.e. the last part in a slash seperated string) + * Get the name of a file from a URL (i.e. the last part in a slash separated string) * @param {string} src URL to get the file name from * @returns {string} File name * @private From 8d073228343bc8472a6b567531789570fc006034 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Mon, 24 Feb 2025 19:55:52 -0500 Subject: [PATCH 7/7] spelling: the Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- js/VisualEvent.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/VisualEvent.js b/js/VisualEvent.js index 1b0bc92..31700ee 100644 --- a/js/VisualEvent.js +++ b/js/VisualEvent.js @@ -379,7 +379,7 @@ VisualEvent.prototype = { /** - * Hide hte help box + * Hide the help box * @private */ "_hideHelp": function () {