├── .gitignore ├── LICENSE.md ├── README.md ├── package.json ├── screenshot.png ├── welcome.js └── welcome.min.js /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules/ 2 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | ## MIT License 2 | 3 | #### Copyright (c) 2016 James Bridle 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | 8 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # welcome.js 2 | 3 | **welcome.js** is a tiny JavaScript file you can add to any web page to help novice users get the most out of the web. 4 | 5 | ## Being Welcoming 6 | 7 | The web is an amazing technology, and people can get even more out if it by understanding how to use it better, how it's built, and even how to build it themselves. 8 | 9 | This takes specialised knowledge, and the discovery of the developer console is the way many people first start learning about the web. 10 | 11 | **welcome.js** adds a friendly message to the console when it's first opened, as well as links for [users](http://contemporary-home-computing.org/turing-complete-user/) to find out more about the console, and programming in general. 12 | 13 | ![welcome.js screenshot](screenshot.png) 14 | 15 | ## Demo 16 | 17 | You can see the script in action on [this demo page](https://stml.github.io/welcomejs/). 18 | 19 | ## Installing 20 | 21 | Place the `welcome.js` file on your server, and add the following line (with the correct path) anywhere on your page, preferably at the end just before ``. 22 | 23 | ```html 24 | 25 | ``` 26 | 27 | ### Hosting and Distribution 28 | 29 | You can use **welcome.js** from a CDN with a URL such as the following: 30 | 31 | 32 | Or you can download **welcome.js** and install it locally. 33 | If you like it, please **star this project**, and perhaps we'll get it onto [cdnjs](https://cdnjs.com). 34 | 35 | ## Feedback 36 | 37 | Please feel free to send comments, requests, and issues. In particular, suggestions for better and more helpful links are welcome. 38 | 39 | ## Background 40 | 41 | **welcome.js** was inspired by the use on certain websites of aggressive warnings in the console, which might appear frightening and off-putting to inexperienced users. 42 | 43 | More information can be found in [this blog post](http://booktwo.org/notebook/welcome-js/). 44 | 45 | ## Author 46 | 47 | * **James Bridle** - [shorttermmemoryloss.com](http://shorttermmemoryloss.com) - [stml](https://github.com/stml) 48 | 49 | ## License 50 | 51 | This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details. 52 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "welcome.js", 3 | "description": "**welcome.js** is a tiny javascript file you can add to any web page to help novice users get the most out of the web.", 4 | "version": "1.0.0", 5 | "homepage": "https://github.com/stml/welcomejs#readme", 6 | "author": "James Bridle ", 7 | "license": "MIT", 8 | "main": "welcome.js", 9 | "scripts": { 10 | "test": "echo \"Error: no test specified\" && exit 1" 11 | }, 12 | "repository": { 13 | "type": "git", 14 | "url": "git+https://github.com/stml/welcomejs.git" 15 | }, 16 | "bugs": { 17 | "url": "https://github.com/stml/welcomejs/issues" 18 | }, 19 | "scripts": { 20 | "minify": "uglifyjs welcome.js --compress --mangle -o welcome.min.js" 21 | }, 22 | "devDependencies": { 23 | "uglifyjs": "^2.4.10" 24 | }, 25 | "files": [ 26 | "welcome.js", 27 | "welcome.min.js" 28 | ], 29 | "engines": { 30 | "node": ">=4" 31 | }, 32 | "keywords": [ 33 | "console", 34 | "friendly", 35 | "welcome", 36 | "help" 37 | ], 38 | "author": "James Bridle", 39 | "license": "MIT", 40 | "bugs": { 41 | "url": "https://github.com/stml/welcomejs/issues" 42 | }, 43 | "homepage": "https://github.com/stml/welcomejs#readme", 44 | "autoupdate": { 45 | "source": "git", 46 | "target": "git://github.com/stml/welcomejs.git", 47 | "fileMap": [ 48 | { 49 | "basePath": "", 50 | "files": [ 51 | "welcome.js", 52 | "welcome.min.js" 53 | ] 54 | } 55 | ] 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stml/welcomejs/788d4d05339e239f1a6baec2e33d7a0789672111/screenshot.png -------------------------------------------------------------------------------- /welcome.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | if (!window.console) { 3 | return; 4 | } 5 | 6 | var i = 0; 7 | 8 | if (!i) { 9 | setTimeout(function () { 10 | console.log("%cWelcome!", "font: 3em sans-serif; color: green;"); 11 | console.log("%cHello, and welcome to the console. If this is your first time here, make yourself at home. (If not, disregard this message!)", "font: 1.5em sans-serif;"); 12 | console.log("%cWhat you can find down here is what lies underneath the web: its code. You can read, write, rewrite, and manipulate this code to make the web your own.", "font: 1.5em sans-serif;"); 13 | console.log("%cYou can find out more about using the console from these sites:", "font: 1.25 sans-serif;"); 14 | console.log("%c - Firefox: https://developer.mozilla.org/en-US/docs/Tools/Web_Console", "font: 1.25 sans-serif;"); 15 | console.log("%c - Chrome: https://developers.google.com/web/tools/chrome-devtools/console/", "font: 1.25 sans-serif;"); 16 | console.log("%c - Safari: https://developer.apple.com/library/content/documentation/AppleApplications/Conceptual/Safari_Developer_Guide/Console/Console.html", "font: 1.25 sans-serif;"); 17 | console.log("%c - Or just use any search engine to look up 'developer console'", "font: 1.25 sans-serif;"); 18 | console.log("%cFor help with learning to code, try https://www.codecademy.com/", "font: 1.25 sans-serif;"); 19 | console.log("%c[This text generated by https://github.com/stml/welcomejs]", "font: 1 sans-serif;"); 20 | }, 1); 21 | i = 1; 22 | } 23 | 24 | })(); 25 | -------------------------------------------------------------------------------- /welcome.min.js: -------------------------------------------------------------------------------- 1 | !function(){if(window.console){var o=0;o||(setTimeout(function(){console.log("%cWelcome!","font: 3em sans-serif; color: green;"),console.log("%cHello, and welcome to the console. If this is your first time here, make yourself at home. (If not, disregard this message!)","font: 1.5em sans-serif;"),console.log("%cWhat you can find down here is what lies underneath the web: its code. You can read, write, rewrite, and manipulate this code to make the web your own.","font: 1.5em sans-serif;"),console.log("%cYou can find out more about using the console from these sites:","font: 1.25 sans-serif;"),console.log("%c - Firefox: https://developer.mozilla.org/en-US/docs/Tools/Web_Console","font: 1.25 sans-serif;"),console.log("%c - Chrome: https://developers.google.com/web/tools/chrome-devtools/console/","font: 1.25 sans-serif;"),console.log("%c - Safari: https://developer.apple.com/library/content/documentation/AppleApplications/Conceptual/Safari_Developer_Guide/Console/Console.html","font: 1.25 sans-serif;"),console.log("%c - Or just use any search engine to look up 'developer console'","font: 1.25 sans-serif;"),console.log("%cFor help with learning to code, try https://www.codecademy.com/","font: 1.25 sans-serif;"),console.log("%c[This text generated by https://github.com/stml/welcomejs]","font: 1 sans-serif;")},1),o=1)}}(); --------------------------------------------------------------------------------