├── LICENSE ├── README.md ├── css ├── classic.css ├── dark.css ├── default.css ├── fedora.css ├── lufthansa.css ├── mountainlake.css ├── rays.css ├── redhat.css ├── skyline.css ├── terminal.css └── ubuntu.css ├── favicon.ico ├── index.html ├── js ├── commands.js ├── config.js ├── engines.js ├── functions.js ├── mods.js ├── shortcuts.js └── tips.js ├── spa ├── index.html ├── index_src.html ├── mergemin.rb └── template.rhtml └── xml /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 dohliam 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # yub.js 2 | 3 | Yub.js is an extensible client-side web command-line that comes with [loads of useful search engines](https://dohliam.github.io/yub/?s%20google) and shortcuts, reusable commands, and lots of other hidden goodies like [stopwatches](https://dohliam.github.io/yub/?stopwatch) and [inline YouTube videos](https://dohliam.github.io/yub/?watch%20imax). It also has a flexible API so you can call yub.js commands from anywhere: for example, you can [link directly to commands](https://dohliam.github.io/yub/?echo%20Hi%20there,%20new%20yub.js%20user!
Have%20fun,%20and%20type%20'help'%20if%20you%20get%20lost%20:%29), or access them right from your browser address bar (just set up a single search shortcut pointing at the yub.js API, and get hundreds of other search shortcuts for free). 4 | 5 | The whole thing was designed from the outset to be a single page standalone html document containing everything needed to work out of the box. It can be [installed locally](#installation) and run right from your computer without the need for a server or web hosting. Since then it has grown considerably and development has been split into separate, more manageable files. The [standalone html page version](https://dohliam.github.io/yub/) is still available, though it is now automatically generated by a ruby script, and comes in minified and source versions. Just save the page directly to your computer or drop it on your server and you're ready to go! 6 | 7 | The list of available search engines is completely modular: you can drop in your own list of commonly visited websites by editing or replacing the mods.js file (json). Making your own new commands is easy -- just use the [`create`](https://dohliam.github.io/yub/?man%20create) command (with the name of the new command as an [optional argument](https://dohliam.github.io/yub/?create%20yourcommand)). Feel free to add your own new functions or extend existing ones by editing `functions.js`. Oh, and regular expressions are [supported everywhere by default](https://dohliam.github.io/yub/?s%20^gn). 8 | 9 | 10 | * [1 Cool Things To Try Out](#cool-things-to-try-out) 11 | * [1.1 The Basics](#the-basics) 12 | * [1.2 More Examples](#more-examples) 13 | * [2 Search Engines](#search-engines) 14 | * [2.1 engines.js](#enginesjs) 15 | * [2.2 mods.js](#modsjs) 16 | * [2.3 Customization](#customization) 17 | * [3 Skins](#skins) 18 | * [4 Installation](#installation) 19 | * [5 API](#api) 20 | * [6 Embedding](#embedding) 21 | * [7 Upcoming Features](#upcoming-features) 22 | * [8 History](#history) 23 | * [9 Development](#development) 24 | * [10 It Might Not Be For You](#it-might-not-be-for-you) 25 | * [11 Similar Projects](#similar-projects) 26 | * [12 Acknowledgements](#acknowledgements) 27 | * [13 License](#license) 28 | 29 | 30 | ## Cool Things To Try Out 31 | 32 | The best way to understand how yub.js works is to jump in and start trying commands. So before getting into boring things like history or internals, let's take a look at some of the cool commands you can try out right away. 33 | 34 | ### The Basics 35 | 36 | * get a list of all available search shortcuts by typing [`list`](https://dohliam.github.io/yub/?list) or [`ls`](https://dohliam.github.io/yub/?ls) 37 | * enter any full URL to go directly to the site, e.g.: `http://commandlinefu.com/` or `ftp://ftp.mozilla.org/` 38 | * add `!` in front of any bare URL to go directly to the site, e.g.: !smh.com.au to go to the _Sydney Morning Herald_ 39 | * use `g [searchterm]` for a plain vanilla Google Search. Or you might prefer to use `y`, `b`, `ix`, or `sp` instead 40 | * help is available by typing [`help`](https://dohliam.github.io/yub/?help) or [`man`](https://dohliam.github.io/yub/?man) (optionally including the command you want help with as an argument, e.g. [`help shuffle`](https://dohliam.github.io/yub/?help%20shuffle)) 41 | 42 | ### More Examples 43 | 44 | * [`calc 857*2^3`](https://dohliam.github.io/yub/?calc%20857*2%5E3): solve simple mathematical formulas 45 | * [`calc (25+2)==(28-1)`](https://dohliam.github.io/yub/?calc%20%2825+2%29==%2828-1%29): test equivalence 46 | * [`calc ~32.56`](https://dohliam.github.io/yub/?calc%20~32.56): round numbers 47 | * [`rand 550`](https://dohliam.github.io/yub/?rand%20550): return a random number between 0-550 48 | * [`rand site`](https://dohliam.github.io/yub/?rand%20site): go to random website 49 | * [`rand img`](https://dohliam.github.io/yub/?rand%20img): show a random image 50 | * [`rand git`](https://dohliam.github.io/yub/?rand%20git): visit a random GitHub project 51 | * [`watch ninja cat`](https://dohliam.github.io/yub/?watch%20ninja%20cat): watch an embedded playlist of YouTube video results for the search term "ninja cat" 52 | * [`link flint tigers`](https://dohliam.github.io/yub/?link%20flint%20tigers): get a permalink to the command _flint tigers_ (which searches flickr for pictures of tigers sorted by "interestingness") 53 | * [`fspell sometext`](https://dohliam.github.io/yub/?fspell%20sometext): write out _sometext_ with flickr images 54 | * [`ascii sometext`](https://dohliam.github.io/yub/?ascii%20sometext): write out _sometext in ascii art 55 | * [`where gn`](https://dohliam.github.io/yub/?where%20gn): show the keyword and default search addresses for the command _gn_ 56 | * [`> am Alice in Wonderland`](https://dohliam.github.io/yub/?%3E%20am%20Alice%20in%20Wonderland): go directly to the first Google search result for the term "Alice in Wonderland" on Amazon.com 57 | * [`> wpde Turing complete`](https://dohliam.github.io/yub/?%3E%20wpde%20Turing%20complete): read the article on "Turing completeness" in the _German_ Wikipedia 58 | * [`cat engadget.com`](https://dohliam.github.io/yub/?cat%20engadget.com): displays a text-only version of the webpage at engadget.com 59 | * [`pop bbc gn yn bn`](https://dohliam.github.io/yub/?pop%20gn%20yn%20bn%20bbc): pop up individual tabs with BBC News , Google News, Yahoo News, and Bing News, all in one command 60 | * [`pop gim yim bim -t horses`](https://dohliam.github.io/yub/?pop%20gim%20yim%20bim%20-t%20horses): pop up new tabs showing results of an image search for horses on Google, Yahoo, and Bing 61 | 62 | _Note: to use the `pop` command you will probably need to set up an exception in your browser's pop-up blocker for yub.js_ 63 | 64 | 65 | ## Search Engines 66 | 67 | ### engines.js 68 | 69 | Default search engines are stored in the engines.js file. This contains a wide variety of general-purpose web shortcuts, search engines, news sources and other interesting stuff that demonstrates the basic features of yub.js and should give you an idea of what kinds of shortcuts might be useful for your own needs. 70 | 71 | Things you can expect to find in engines.js are: major search engines (Google, Yahoo, Bing... etc) and their various associated products (images, video, maps, news, weather, machine translation), [Wikipedia](https://dohliam.github.io/yub/?wp) and its various Wikimedia sister sites ([Wiktionary](https://dohliam.github.io/yub/?wt), [Wikiquote](https://dohliam.github.io/yub/?wq), [Wikinews](https://dohliam.github.io/yub/?wn)... etc), a selection of major news organizations ([BBC](https://dohliam.github.io/yub/?bbc), [Deutsche Welle](https://dohliam.github.io/yub/?dw), [France 24](https://dohliam.github.io/yub/?fr24en)... etc), major webmail providers (Gmail, Yahoo, Hotmail... etc), documentation for several popular scripting languages ([Bash](https://dohliam.github.io/yub/?sh), [JS](https://dohliam.github.io/yub/?js), [PHP](https://dohliam.github.io/yub/?php), [Python](https://dohliam.github.io/yub/?py), [Ruby](https://dohliam.github.io/yub/?rb)), and a bunch of other useful sites and tools ([Down For Everyone Or Just Me?](https://dohliam.github.io/yub/?isup), [Whois](https://dohliam.github.io/yub/?whois), [What Is My Ip?](https://dohliam.github.io/yub/?ip)... etc). A more detailed guide can be found in the wiki. 72 | 73 | A nice benefit of using yub.js shortcuts is that https is used by default whenever possible (i.e. everywhere that it is supported). 74 | 75 | 76 | ### mods.js 77 | 78 | All custom links and shortcuts go in mods.js for convenience. This file is entirely optional, so you can drop things in and out of it as you please. _You do not need the mods.js file to use yub.js_. 79 | 80 | The gigantic mods.js file found in the repository is purely an example for the purposes of demonstrating various features of yub.js, such as [unicode regex searches](https://dohliam.github.io/yub/?s%20[А-я]), as well as various local search sites and other interesting stuff that you can cherry-pick for your own uses. At 106 Kb / 870+ entries (as of this writing) it also demonstrates that even with a huge list of custom shortcuts, yub.js runs along smoothly without any noticeable decrease in speed. 81 | 82 | Some examples of things that have been dumped indiscriminately in the sample mods.js file: 83 | * International and local versions of the default websites in engines.js 84 | * For example, _all_ (as of this writing) international Google sites (including [Google British Indian Ocean Territory](https://dohliam.github.io/yub/?gio) and [Google Pitcairn Islands](https://dohliam.github.io/yub/?gpn)...) 85 | * Multilingual versions of most major international news aggregators and news websites (e.g. BBC, CNN, AFP, Deutsche Welle, Google News, etc) 86 | * _Āll_ international eBay and Amazon sites (e.g. `ebin` for eBay India, or `amuk` for Amazon U.K.) 87 | * Links to each of the language dictionaries at WordReference.com 88 | * Note that each language pair has two separate links -- one for each direction. So, use `enes` for the English-Spanish dicitonary, and `esen` for Spanish-English; `enko` and `koen` for Korean, `enfr` and `fren` for French, etc. 89 | * A large (but not complete) selection of Wikimedia editions -- almost 30 major language versions of Wikipedia, Wikinews, Wikiquotes, Wiktionary, etc 90 | * Complete multilingual collection of Global Voices links 91 | * Complete multilingual collection of WikiHow links 92 | * Most of the major Baidu, Sina, Sogou, Kvasir, and Yandex sites (search, images, maps, etc) 93 | 94 | 95 | ### Customization 96 | 97 | One thing to note is that some really interesting sites have been left out of engines.js and even mods.js in order to keep the default shortcuts as _generally_ useful as possible. But never fear, you can still add them to your mods.js file! Here are some things you might consider adding to customize mods.js: 98 | 99 | * Local classifieds: Both Cragslist and Kjiji have fairly straightforward search systems, but they don't offer sitewide search -- you have to choose your location first. Since it wouldn't make sense to prepackage any particular location (or _shudder_ all of them), just create a `cl` or `kj` command for your desired location and drop it in mods.js 100 | * Currency conversion: Create a shortcut to xe.com (or another site) with the following parameters: 101 | * `http://www.xe.com/ucc/convert.cgi?Amount=%s&From=[CURRENCY1]&To=[CURRENCY2]` (replace `[CURRENCY1]` and `[CURRENCY2]` with the three-letter codes for the currencies of your choice) 102 | * Local library catalogue: Create a shortcut to show search results from your local public or school library 103 | * Blog search: Create a shortcut for search results on a blog you read often, or your personal website 104 | * Local newspapers: The wiki will eventually host links to mods.js files for regional newspapers from around the world (so you'll be able to pick up a mods.js file for South African or Thai or Portuguese newspapers), but in the meantime create your own shortcuts to the local and international newspapers you read most frequently -- most websites have their own search function, but if not you can always link to a Google result for the specific site 105 | * If your favourite radio station has an embeddable stream, you can add a link to it in functions.js and have it pop out under the command-line while you do other stuff 106 | 107 | ## Skins 108 | 109 | Theming support is available in the form of custom css files loaded through the `skin` command. Skins are basically just css files (located in the `/css` folder), and can be loaded by entering the command `skin` and the name of the skin (there is no need to add the `.css` extension). 110 | 111 | To return to the default skin, just type `skin default`. To remove all css, use `skin none`. 112 | 113 | Skins currently don't persist across yub sessions (this would require setting a cookie, which we've managed to avoid so far), but you can change the link/bookmark to your yub.js instance to something like `https://dohliam.github.io/yub/?skin%20terminal` to always start yub.js with a particular skin loaded. Alternatively, once you decide on a skin you want to make the default for your local installation, just rename it to `default.css` (you can rename the original `default.css` file to `old.css` or similar if you don't want to overwrite it). Your new file will be loaded as the default the next time you open up yub.js. 114 | 115 | To make a new skin, just copy one of the existing skin files to a new file e.g. `mynewskin.css` and customize to your heart's content! (And don't forget to add your custom skins to the [skins gallery](https://github.com/dohliam/yub/wiki/skins_gallery) in the wiki so others can enjoy them!) 116 | 117 | Here are some screenshots of the skins that come with yub.js: 118 | 119 | _default_: 120 | 121 | ![default skin screenshot](http://imgur.com/s06B83P.jpg) 122 | 123 | _terminal_: 124 | 125 | ![terminal skin screenshot](http://imgur.com/v6RhFwG.jpg) 126 | 127 | _mountainlake_: 128 | 129 | ![mountainlake skin screenshot](http://imgur.com/y33lZmP.jpg) 130 | 131 | _rays_: 132 | 133 | ![rays skin screenshot](http://imgur.com/Hbr6Juj.jpg) 134 | 135 | _skyline_: 136 | 137 | ![skyline skin screenshot](http://imgur.com/QrVPomR.jpg) 138 | 139 | _nocss_: 140 | 141 | ![nocss skin screenshot](http://imgur.com/LQiAsX3.jpg) 142 | 143 | 144 | ## Installation 145 | 146 | Of course you don't need to install yub.js in order to begin using it. For one-off searches you can easily use the latest version of yub.js hosted [here on GitHub](https://dohliam.github.io/yub/). Everything is done entirely on the client side, so none of your queries are sent over the network. 147 | 148 | You can even use [the API](#api) to make the GitHub version the default search for your browser. However, if you use the API any commands you enter _will_ be visible (for example, in the GitHub server logs), so you might prefer to set up a local version of yub.js and run it entirely offline (or on your own site). 149 | 150 | There is a detailed guide in the wiki on [how to make yub.js your default search engine](https://github.com/dohliam/yub/wiki/default_search). You can find step-by-step instructions on how to set up yub.js for [Chrome/Chromium](https://github.com/dohliam/yub/wiki/default_search#chrome) and [Firefox](https://github.com/dohliam/yub/wiki/default_search#firefox) (if you use a different browser and are able to install yub.js, please consider adding the steps you took to the guide). 151 | 152 | One thing to consider when installing yub.js whether you'd like to [set it up as a keyword search or use it as your default search engine](https://github.com/dohliam/yub/wiki/default_search#default-search-vs-keyword-search). The benefit of setting it up as your default is that it basically makes your browser's URL bar itself into a web command-line. 153 | 154 | 155 | ## API 156 | 157 | One of the most useful features of yub.js is its easy-to-use API, which works just as well on a laptop as it does on a server. Just point a link, bookmark, or keyword search at your yub.js URL and add `?` plus your commands or search terms to go directly to the result. 158 | 159 | Example 1: 160 | * yub.js URL: `http://example.com/yub` 161 | * command: weather tokyo 162 | * _full URL for this command_: `http://example.com/yub?weather tokyo` 163 | 164 | Example 2: 165 | * yub.js URL: file:///home/username/yub/index.html 166 | * command: rand site 167 | * _full URL for this command_: `file:///home/user/yub/index.html?rand site` 168 | 169 | 170 | ## Embedding 171 | 172 | You can embed yub.js on any webpage and get a functional web command-line that looks like this: 173 | 174 | ![Embedded yub.js command-line](https://dohliam.github.io/img/embedded_yub.png) 175 | 176 | Just copy the following code and include it anywhere on the page: 177 | 178 | ``` 179 |
   180 | ``` 181 | 182 | There is probably a more elegant way to do this, but after some testing this seemed to be the only way that works in both Firefox and Chrome. Feel free to experiment and open a pull request if you find something better! 183 | 184 | 185 | ## Upcoming Features 186 | 187 | There are tons of features that have yet to be implemented. As much as possible, planned new functionality and requested features are being tracked in the issue tracker. If you have an idea, go ahead and add it in (or fork the project and shoot over a pull request)! 188 | 189 | It would be awesome to see everyone's custom mods.js files -- links to these can be shared [in the wiki](https://github.com/dohliam/yub/wiki/engines_general), though a separate repository is another possibility in the future if the list gets big enough. In the meantime, let me know if you have a mods.js file you'd like to share -- particularly if it's organized around a specific theme (e.g., collections of social media sites, Swedish newspapers, research databases, tools for historians or marine biologists... etc). 190 | 191 | Some planned features that are still in the works: 192 | 193 | * ~~theming support (skins)~~ _done!_ 194 | * translation support for multiple languages 195 | * command tagging 196 | * more extensive man entries 197 | * jukebox feature (like [`watch`](https://dohliam.github.io/yub/?whatis%20watch), but for music) 198 | * pipes! 199 | 200 | If you'd like to contribute to adding any of these features (or others I haven't thought of), feel free to submit a pull request. 201 | 202 | ## History 203 | 204 | A long time ago (2005 to be exact), a groundbreaking website called YubNub was unveiled that allowed users to write their own commands and shortcuts for various web services. The idea of accessing websites with short bash-like commands was quite compelling and actually addictive, and quickly led to all sorts of creative tools like _split_ and _gimyim_. Along with many others, I created a bunch of commands and used the site quite heavily for a while. 205 | 206 | However, there was one thing that never quite made sense -- why would anyone want to filter every single search they did through a(nother) third party website? In any case, as soon Firefox's _keyword search_ functionality became widely known, the allure of using YubNub shortcuts began to fade -- it was easier to just set up local Firefox keywords for most common searches and then use those instead. So a bookmark file containing dozens of former YubNub commands in the form of search keywords traveled from computer to computer, surviving for almost a decade before it became obvious that this system, too, was entirely too clunky, slow and impractical (e.g., access from another computer was a pain, and keeping the list updated across computers was also not pleasant). What was worse, this method also missed much of the exciting non-search command functionality that YubNub offered. 207 | 208 | Nine years later, a visit to YubNub revealed that the service is still running, and [according to Wikipedia](https://en.wikipedia.org/wiki/YubNub), even boasted over 22,000 user-contributed commands... as of 2008. Looking at the list of commands leads one to the disheartening conclusion that the once awesome service has become swamped by thousands and thousands of spam entries, stifling any remaining sense of community (the _social command-line_) that was once one of the most endearing things about the site. 209 | 210 | Even more disappointing, many of the coolest commands (e.g., _split_, _gimyim_) are no longer even functional. Of course, this should not really be all that surprising -- the architecture of the web has changed a lot since 2005. (In the case of split, both because loading websites in frames has stopped being a normal and acceptable thing to do, and also, as demonstrated by _gimyim_, because both Google and Yahoo -- as well as virtually every other major website -- now [actively discourage attempts](http://stackoverflow.com/q/7905169) to load their content from external sites). Bummer. 211 | 212 | Yub.js started out as an attempt to get back some of the functionality of the old YubNub command-line in an entirely client-side application that anyone could tweak or adjust to suit their needs and then run on their local machine -- or drop into the cloud or onto a private server and access from anywhere. 213 | 214 | Although I had been kicking this idea around idly for years, it always remained something of a pipe dream, since I wasn't even sure if it was possible to do most of the stuff I wanted to do with JavaScript. Eventually I whipped up a little html page to redirect queries to a few common search engines and "yubSearch" was born. 215 | 216 | However, it soon became clear that search shortcuts alone were not enough. A simple command to search through the shortcuts list was followed by other commands to print the date and time, show descriptions for each shortcut, and sort text. A calculator was added, and then a stopwatch. As new commands evolved out of bits and snippets of code and workarounds from all over the place, it became almost a challenge to see what could be cobbled together with pure JavaScript alone. It was no longer just about search shortcuts -- and thus yubSearch became yub.js. 217 | 218 | Development has proceeded on a strictly itch-scratching basis, with new functionality being added when and as actually needed. From very early on, yub.js became something of its own development environment, and there are built-in reference tools for [JavaScript](https://dohliam.github.io/yub/?whatis%20js) (as well as [other popular scripting languages](https://dohliam.github.io/yub/?s%20documentation)), [linters](https://dohliam.github.io/yub/?whatis%20jshint) and an [internal command creation syntax](https://dohliam.github.io/yub/?whatis%20create) that have helped to make common development-related tasks much easier. 219 | 220 | At some point, yub.js took on a life of its own. While not exactly Turing complete, it became dangerously close when a patch was contemplated to add [Eliza](http://elizagen.org/index.html) as an engine to respond to conversational prompts... 221 | 222 | 223 | ## Development 224 | 225 | Yub.js continues to be developed in pure JS without the use of frameworks or external libraries. Although many interesting functions could be added using server-side scripting, frameworks, and other bits of whiz-bang heavy coding artillery, the main goals have always been portability and responsiveness -- you can drop yub.js virtually anywhere: a desktop, a server, a ChromeBook, even a mobile phone, and it will work pretty much exactly the same way. This has proven to be a particular lifesaver on mobile devices where even simple searches (let alone anything more sophisticated) can sometimes be incredibly clumsy and frustrating to work with -- and when mobile websites often hide or dumb down basic features like search. 226 | 227 | As mentioned above, however, the code has been literally cobbled together out of spare parts without (until very recently) any thought to making it look _pretty_, let alone _standardized_ or _efficient_. Nevertheless, everything chugs along at an incredible speed, thanks to relatively small file sizes and the benefits of running entirely on the client side. 228 | 229 | Could it be even faster? Absolutely! A lot of work no doubt remains to be done optimizing and prettifying the existing (admittedly quite ugly) codebase. Will the average user notice these improvements? That's harder to say -- after all, the difference between instantaneous response times and those that are half that speed can be pretty hard to discern. Most of the individual tasks that JavaScript is handling at any given time are incredibly trivial (making lists, redirecting to URLs), so speed has rarely if ever been a concern during actual use. 230 | 231 | On the other hand, if things that are slower than they need to be bother you _on principle_, you may want to take a look at the next section. 232 | 233 | 234 | ## It Might Not Be For You 235 | 236 | * **Cloud sync afficionados**: If you are still wondering what the point of all this is when you could just use Firefox Sync or sign in to Chrome with your Google Account, then yub.js may not be for you. 237 | 238 | * **Bookmarks managers**: Cloud sync options for almost all major browsers are now ubiquitous, and if not one of those services, you could always backup your bookmarks file on a server somewhere and be done with it. If that works for you, great -- but frustration with these approaches is what led to yub.js in the first place. 239 | 240 | * **Sticklers for elegant code**: As mentioned before, the code is pretty ugly at the moment -- not on purpose, of course, but since every new feature has been added due to some immediately pressing need, kludges and all sorts of brute force inefficient loops abound. That will hopefully change over time as the code is (slowly) refactored. But if ugly code offends you, you may want to avert your eyes. 241 | 242 | * **Haters of eval**: If you believe that [eval is evil](http://blogs.msdn.com/b/ericlippert/archive/2003/11/01/53329.aspx) under _any_ circumstances (even parsing sanitized mathematical expressions)... then you may want to just remove the calculator function from your version of yub.js. 243 | 244 | * **Seekers of bash.js**: Yub.js is not a port of bash into JavaScript. If you are wondering why yub.js doesn't offer a `mount` command, or have a way to `kill` processes, or `modprobe` your mouse driver... you are probably in the wrong place (perhaps you are looking for [unixkcd](http://uni.xkcd.com/)). On the other hand, if you can think of an appropriate metaphor for `mount`, `kill`, or `modprobe` that would make sense on a **web** command-line, I'd love to hear from you! :smiley: 245 | 246 | ## Similar projects 247 | 248 | * [YubNub](http://yubnub.org/) (The original inspiration for yub.js) 249 | * [Inky](http://groups.csail.mit.edu/uid/inky/index.html) (Firefox extension) 250 | * [Ubiquity](https://wiki.mozilla.org/Labs/Ubiquity) (Firefox extension) 251 | * [unixkcd](http://uni.xkcd.com/)) (A commandline for the comic xkcd) 252 | * [JSShell](https://github.com/ianb/jsshell) (An actual UNIX-style shell written in JavaScript for the browser) 253 | 254 | ## Acknowledgements 255 | 256 | Many thanks to [Jon Aquino](http://jona.ca/), and everyone who contributed to [YubNub](http://yubnub.org/) in its heyday, for the web-as-command-line metaphor that was the original inspiration for yub.js. 257 | 258 | Minified single-page version made using [Uglifier](https://github.com/lautis/uglifier) for Ruby. 259 | 260 | Table of contents generated by [https://github.com/dohliam/tocdown](tocdown). 261 | 262 | The random GitHub repo is based on [RandomRepo](https://github.com/RyanDavison/RandomRepo) by RyanDavison. 263 | 264 | Background wallpapers for various skins: 265 | * ["Untitled"](https://flic.kr/p/9Yq8g6) by [tiltti](https://www.flickr.com/photos/tiltti/), released under a CC-BY license (used in the ["mountainlake" skin](https://dohliam.github.io/yub/?skin%20mountainlake)) 266 | * [Mountain Monastery Sunrise](https://flic.kr/p/xTfwsF) by [Ronan Shenhav](https://www.flickr.com/photos/ronan_shenhav/), released under a CC-BY license (used in the ["rays" skin](https://dohliam.github.io/yub/?skin%20rays)) 267 | * [Hong Kong from Victoria Peak](https://flic.kr/p/9e6Ngd) by [Robert Lowe](https://www.flickr.com/photos/rmlowe/), released under a CC-BY license (used in the ["skyline" skin](https://dohliam.github.io/yub/?skin%20skyline)) 268 | 269 | ## License 270 | 271 | MIT -- see LICENSE file for details. 272 | -------------------------------------------------------------------------------- /css/classic.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-size: large; 3 | font-family: sans-serif; 4 | } 5 | h2 { 6 | color: #FF8000; 7 | font: 72px 'Open Sans', sans-serif; 8 | margin-top: auto; 9 | margin-bottom: auto; 10 | } 11 | h3 { 12 | margin-top: auto; 13 | margin-bottom: 25px; 14 | } 15 | .small { 16 | font-size: small; 17 | } 18 | .grey { 19 | color: gray; 20 | } 21 | #create input[type=text] { 22 | color: gray; 23 | font-style: italic; 24 | padding: 1px 6px 1px 6px; 25 | } 26 | -------------------------------------------------------------------------------- /css/dark.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-size: large; 3 | font-family: sans-serif; 4 | color: #f2f2f2; 5 | background:#000; 6 | background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAAUVBMVEWFhYWDg4N3d3dtbW17e3t1dXWBgYGHh4d5eXlzc3OLi4ubm5uVlZWPj4+NjY19fX2JiYl/f39ra2uRkZGZmZlpaWmXl5dvb29xcXGTk5NnZ2c8TV1mAAAAG3RSTlNAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAvEOwtAAAFVklEQVR4XpWWB67c2BUFb3g557T/hRo9/WUMZHlgr4Bg8Z4qQgQJlHI4A8SzFVrapvmTF9O7dmYRFZ60YiBhJRCgh1FYhiLAmdvX0CzTOpNE77ME0Zty/nWWzchDtiqrmQDeuv3powQ5ta2eN0FY0InkqDD73lT9c9lEzwUNqgFHs9VQce3TVClFCQrSTfOiYkVJQBmpbq2L6iZavPnAPcoU0dSw0SUTqz/GtrGuXfbyyBniKykOWQWGqwwMA7QiYAxi+IlPdqo+hYHnUt5ZPfnsHJyNiDtnpJyayNBkF6cWoYGAMY92U2hXHF/C1M8uP/ZtYdiuj26UdAdQQSXQErwSOMzt/XWRWAz5GuSBIkwG1H3FabJ2OsUOUhGC6tK4EMtJO0ttC6IBD3kM0ve0tJwMdSfjZo+EEISaeTr9P3wYrGjXqyC1krcKdhMpxEnt5JetoulscpyzhXN5FRpuPHvbeQaKxFAEB6EN+cYN6xD7RYGpXpNndMmZgM5Dcs3YSNFDHUo2LGfZuukSWyUYirJAdYbF3MfqEKmjM+I2EfhA94iG3L7uKrR+GdWD73ydlIB+6hgref1QTlmgmbM3/LeX5GI1Ux1RWpgxpLuZ2+I+IjzZ8wqE4nilvQdkUdfhzI5QDWy+kw5Wgg2pGpeEVeCCA7b85BO3F9DzxB3cdqvBzWcmzbyMiqhzuYqtHRVG2y4x+KOlnyqla8AoWWpuBoYRxzXrfKuILl6SfiWCbjxoZJUaCBj1CjH7GIaDbc9kqBY3W/Rgjda1iqQcOJu2WW+76pZC9QG7M00dffe9hNnseupFL53r8F7YHSwJWUKP2q+k7RdsxyOB11n0xtOvnW4irMMFNV4H0uqwS5ExsmP9AxbDTc9JwgneAT5vTiUSm1E7BSflSt3bfa1tv8Di3R8n3Af7MNWzs49hmauE2wP+ttrq+AsWpFG2awvsuOqbipWHgtuvuaAE+A1Z/7gC9hesnr+7wqCwG8c5yAg3AL1fm8T9AZtp/bbJGwl1pNrE7RuOX7PeMRUERVaPpEs+yqeoSmuOlokqw49pgomjLeh7icHNlG19yjs6XXOMedYm5xH2YxpV2tc0Ro2jJfxC50ApuxGob7lMsxfTbeUv07TyYxpeLucEH1gNd4IKH2LAg5TdVhlCafZvpskfncCfx8pOhJzd76bJWeYFnFciwcYfubRc12Ip/ppIhA1/mSZ/RxjFDrJC5xifFjJpY2Xl5zXdguFqYyTR1zSp1Y9p+tktDYYSNflcxI0iyO4TPBdlRcpeqjK/piF5bklq77VSEaA+z8qmJTFzIWiitbnzR794USKBUaT0NTEsVjZqLaFVqJoPN9ODG70IPbfBHKK+/q/AWR0tJzYHRULOa4MP+W/HfGadZUbfw177G7j/OGbIs8TahLyynl4X4RinF793Oz+BU0saXtUHrVBFT/DnA3ctNPoGbs4hRIjTok8i+algT1lTHi4SxFvONKNrgQFAq2/gFnWMXgwffgYMJpiKYkmW3tTg3ZQ9Jq+f8XN+A5eeUKHWvJWJ2sgJ1Sop+wwhqFVijqWaJhwtD8MNlSBeWNNWTa5Z5kPZw5+LbVT99wqTdx29lMUH4OIG/D86ruKEauBjvH5xy6um/Sfj7ei6UUVk4AIl3MyD4MSSTOFgSwsH/QJWaQ5as7ZcmgBZkzjjU1UrQ74ci1gWBCSGHtuV1H2mhSnO3Wp/3fEV5a+4wz//6qy8JxjZsmxxy5+4w9CDNJY09T072iKG0EnOS0arEYgXqYnXcYHwjTtUNAcMelOd4xpkoqiTYICWFq0JSiPfPDQdnt+4/wuqcXY47QILbgAAAABJRU5ErkJggg==); 7 | } 8 | h2 { 9 | color: lightslategrey; 10 | font: 72px 'Open Sans', sans-serif; 11 | margin-top: auto; 12 | margin-bottom: auto; 13 | } 14 | h3 { 15 | margin-top: auto; 16 | margin-bottom: 25px; 17 | color: #f2f2f2; 18 | } 19 | .small { 20 | font-size: small; 21 | } 22 | .grey { 23 | color: gray; 24 | } 25 | input[type=text] { 26 | background-color: #0d0d0d; 27 | color: #f2f2f2; 28 | } 29 | .inputbox { 30 | border: solid 1px; 31 | padding: 5px; 32 | border-radius: 2px; 33 | } 34 | input { 35 | color: white; 36 | background: dimgrey; 37 | border: none; 38 | padding: 5px; 39 | border-radius: 2px; 40 | } 41 | #create input[type=text] { 42 | color: gray; 43 | font-style: italic; 44 | padding: 1px 6px 1px 6px; 45 | } 46 | .note { 47 | color: black 48 | } 49 | -------------------------------------------------------------------------------- /css/default.css: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css?family=Open+Sans'); 2 | 3 | body { 4 | font: 16px 'Open Sans', sans-serif; 5 | } 6 | h2 { 7 | color: #FF8000; 8 | font: 72px 'Open Sans', sans-serif; 9 | font-weight: 800; 10 | margin-top: auto; 11 | margin-bottom: auto; 12 | } 13 | h3 { 14 | margin-top: auto; 15 | margin-bottom: 25px; 16 | } 17 | .small { 18 | font-size: small; 19 | } 20 | .grey { 21 | color: gray; 22 | } 23 | #create input[type=text] { 24 | color: gray; 25 | font-family: 'Open Sans', sans-serif; 26 | font-style: italic; 27 | padding: 1px 6px 1px 6px; 28 | } 29 | .button { 30 | border: none; 31 | padding: 6px 8px 6px 8px; 32 | border-radius: 2px; 33 | min-width: 5%; 34 | font-family: 'Open Sans'; 35 | color: #3A474D; 36 | background-color: #DDDDDD; 37 | } 38 | .button:hover { 39 | color: #FF8000; 40 | cursor: pointer; 41 | } 42 | .inputbox { 43 | border: 1px solid #DDDDDD; 44 | border-radius: 2px; 45 | padding: 5px 8px 5px 8px; 46 | min-width: 20%; 47 | font-family: 'Open Sans'; 48 | } 49 | -------------------------------------------------------------------------------- /css/fedora.css: -------------------------------------------------------------------------------- 1 | @import url(https://fonts.googleapis.com/css?family=Comfortaa); 2 | 3 | body { 4 | font-size: large; 5 | font-family: 'Open Sans',sans-serif; 6 | font-weight: 400; 7 | background-color: white; 8 | } 9 | h2 { 10 | color: #3c6eb4; /*Fedora Blue */ 11 | font: 72px 'Comfortaa', sans-serif; 12 | margin-top: auto; 13 | margin-bottom: auto; 14 | } 15 | h3 { 16 | color: white; 17 | margin-top: auto; 18 | margin-bottom: 25px; 19 | font-weight: 400; 20 | } 21 | .small { 22 | font-size: small; 23 | } 24 | .grey { 25 | color: #8c8c8c; 26 | } 27 | #create input[type=text] { 28 | color: gray; 29 | font-style: italic; 30 | padding: 1px 6px 1px 6px; 31 | } 32 | .button{ 33 | color: white; 34 | background: #79db32; /* First Green (Fedora) */ 35 | border: none; 36 | padding: 10px 40px; 37 | border-radius: 3px; 38 | font-weight: bold; 39 | } 40 | .button:hover{ 41 | background: #e59728; /* Features Orange (Fedora) */ 42 | } 43 | .inputbox{ 44 | border:1px solid #3c6eb4 ; 45 | padding: 10px 40px; 46 | border-radius: 3px; 47 | } 48 | -------------------------------------------------------------------------------- /css/lufthansa.css: -------------------------------------------------------------------------------- 1 | @import url(https://fonts.googleapis.com/css?family=Ubuntu:400,300); 2 | 3 | body { 4 | font-size: large; 5 | font-family: Helvetica,sans-serif; 6 | font-weight: 400; 7 | background-color: #F49E26; /* Lufthansa Yellow */ 8 | } 9 | h2 { 10 | color: #001F52; /* Lufthansa Blue */ 11 | font: 72px 'Helvetica', sans-serif; 12 | margin-top: auto; 13 | margin-bottom: auto; 14 | border: 10px solid #001F52; 15 | border-radius: 50%; 16 | display: inline-block; 17 | margin-right: 20px; 18 | padding: 60px 0px; 19 | font-weight: bold; 20 | } 21 | h3 { 22 | color: #DCDCDC; /* Lufthansa Silver */ 23 | margin-top: auto; 24 | margin-bottom: 25px; 25 | font-weight: 400; 26 | } 27 | .small { 28 | font-size: small; 29 | } 30 | .grey { 31 | color: #001F52; /* Lufthansa Blue */ 32 | } 33 | #create input[type=text] { 34 | color: gray; 35 | font-style: italic; 36 | padding: 1px 6px 1px 6px; 37 | } 38 | .button{ 39 | color: #001F52; 40 | background: #F49E26; 41 | border: 2px solid #001F52; 42 | padding: 5px; 43 | border-radius: 5px; 44 | } 45 | .button:hover{ 46 | background: #001F52; 47 | color: white; 48 | } 49 | .inputbox{ 50 | border:none; 51 | padding: 5px; 52 | border-radius: 2px; 53 | } 54 | -------------------------------------------------------------------------------- /css/mountainlake.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: url("https://c2.staticflickr.com/6/5272/5889285031_ee1415ec1c_b.jpg") fixed; 3 | background-size: cover; 4 | font-size: large; 5 | font-family: sans-serif; 6 | } 7 | h2 { 8 | color: #FF8000; 9 | font: 72px 'Arial Black', sans-serif; 10 | margin-top: auto; 11 | margin-bottom: auto; 12 | } 13 | h3 { 14 | color: white; 15 | margin-top: auto; 16 | margin-bottom: 25px; 17 | } 18 | .small { 19 | font-size: small; 20 | } 21 | .grey { 22 | color: #D3D3D3; 23 | } 24 | #create input[type=text] { 25 | color: gray; 26 | font-style: italic; 27 | padding: 1px 6px 1px 6px; 28 | } 29 | -------------------------------------------------------------------------------- /css/rays.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: url("https://c2.staticflickr.com/6/5667/20927035139_d50ae87e73_b.jpg") fixed; 3 | background-size: cover; 4 | /* background-size: 100% 100%; */ 5 | font-size: large; 6 | font-family: sans-serif; 7 | } 8 | h2 { 9 | color: #FF8000; 10 | font: 72px 'Open Sans', sans-serif; 11 | margin-top: auto; 12 | margin-bottom: auto; 13 | } 14 | h3 { 15 | color: white; 16 | margin-top: auto; 17 | margin-bottom: 25px; 18 | } 19 | .small { 20 | font-size: small; 21 | } 22 | .grey { 23 | color: #D3D3D3; 24 | } 25 | #create input[type=text] { 26 | color: gray; 27 | font-style: italic; 28 | padding: 1px 6px 1px 6px; 29 | } 30 | #output table { 31 | color: #fff; 32 | text-shadow: 1px 0 0 #000, 0 -1px 0 #000, 0 1px 0 #000, -1px 0 0 #000; 33 | font-weight: bold; 34 | } 35 | -------------------------------------------------------------------------------- /css/redhat.css: -------------------------------------------------------------------------------- 1 | @import url("https://overpass-30e2.kxcdn.com/overpass.css"); 2 | 3 | body { 4 | font-size: large; 5 | font-family: 'overpass',sans-serif; 6 | font-weight: 400; 7 | color: white; 8 | background: red; /* For browsers that do not support gradients */ 9 | background: -webkit-linear-gradient(#820000, #cc0000); /* For Safari 5.1 to 6.0 */ 10 | background: -o-linear-gradient(#820000, #cc0000); /* For Opera 11.1 to 12.0 */ 11 | background: -moz-linear-gradient(#820000, #cc0000); /* For Firefox 3.6 to 15 */ 12 | background: linear-gradient(#820000, #cc0000); /* Standard syntax */ 13 | } 14 | h2 { 15 | color: black; 16 | font: 72px 'overpass', sans-serif; 17 | font-weight: 600; 18 | margin-top: auto; 19 | margin-bottom: auto; 20 | background-color: white; 21 | } 22 | h3 { 23 | color: white; 24 | margin-top: auto; 25 | margin-bottom: 25px; 26 | font-weight: 400; 27 | } 28 | .small { 29 | font-size: small; 30 | } 31 | .grey { 32 | color: #dcdcdc; /* Fedora light grey */ 33 | } 34 | #create input[type=text] { 35 | color: gray; 36 | font-style: italic; 37 | padding: 1px 6px 1px 6px; 38 | } 39 | .button{ 40 | color: #cc0000; /* Fedora red */ 41 | background: white; 42 | border: none; 43 | padding: 8px 8px; 44 | text-transform: uppercase; 45 | font-weight: 600; 46 | } 47 | .button:hover{ 48 | color: black; 49 | } 50 | .inputbox{ 51 | border:none; 52 | padding: 8px 8px; 53 | } 54 | -------------------------------------------------------------------------------- /css/skyline.css: -------------------------------------------------------------------------------- 1 | @import url(https://fonts.googleapis.com/css?family=Abel); 2 | @import url(https://fonts.googleapis.com/css?family=Oswald); 3 | body { 4 | background: url("https://c2.staticflickr.com/6/5018/5399099778_16df6a5493_b.jpg") fixed; 5 | background-size: cover; 6 | /* background-size: 100% 100%; */ 7 | font-size: large; 8 | font-family: 'Oswald', sans-serif; 9 | } 10 | h2 { 11 | color: #FF8000; 12 | font: 72px 'Abel', sans-serif; 13 | margin-top: auto; 14 | margin-bottom: auto; 15 | } 16 | h3 { 17 | color: white; 18 | margin-top: auto; 19 | margin-bottom: 25px; 20 | } 21 | .small { 22 | font-size: small; 23 | } 24 | .grey { 25 | color: #D3D3D3; 26 | } 27 | #create input[type=text] { 28 | color: gray; 29 | font-style: italic; 30 | padding: 1px 6px 1px 6px; 31 | } 32 | #output table { 33 | color: #fff; 34 | text-shadow: 1px 0 0 #000, 0 -1px 0 #000, 0 1px 0 #000, -1px 0 0 #000; 35 | font-weight: bold; 36 | } 37 | -------------------------------------------------------------------------------- /css/terminal.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: #141414; 3 | font-size: large; 4 | font: 0.8em 'Andale Mono', Consolas, 'Courier New'; 5 | color: #63de00; 6 | } 7 | h2 { 8 | color: #63de00; 9 | font: 72px 'Andale Mono', Consolas, 'Courier New'; 10 | margin-top: auto; 11 | margin-bottom: auto; 12 | } 13 | h3 { 14 | color: #63de00; 15 | margin-top: auto; 16 | margin-bottom: 25px; 17 | } 18 | input[type=text] { 19 | background-color: #141414; 20 | border-style: none none solid none; 21 | color: #63de00; 22 | border-color: #63de00; 23 | border: 0px 4px 0px 4px; 24 | padding: 1px 6px 1px 6px; 25 | } 26 | input[type=submit] { 27 | background-color: #141414; 28 | border-style: none; 29 | color: #63de00; 30 | border-color: #63de00; 31 | border: 0px 4px 0px 4px; 32 | padding: 1px 6px 1px 6px; 33 | } 34 | .small { 35 | font-size: small; 36 | } 37 | .grey { 38 | color: #63de00; 39 | } 40 | #create input[type=text] { 41 | color: gray; 42 | font-style: italic; 43 | padding: 1px 6px 1px 6px; 44 | } 45 | -------------------------------------------------------------------------------- /css/ubuntu.css: -------------------------------------------------------------------------------- 1 | @import url(https://fonts.googleapis.com/css?family=Ubuntu:400,300); 2 | 3 | body { 4 | font-size: large; 5 | font-family: Ubuntu,sans-serif; 6 | font-weight: 400; 7 | color: white; 8 | background-color: #2C001E; /* Dark Aubergine */ 9 | } 10 | h2 { 11 | color: #DD4814; /* Ubuntu orange */ 12 | font: 72px 'Ubuntu', sans-serif; 13 | margin-top: auto; 14 | margin-bottom: auto; 15 | } 16 | h3 { 17 | color: white; 18 | margin-top: auto; 19 | margin-bottom: 25px; 20 | font-weight: 400; 21 | } 22 | .small { 23 | font-size: small; 24 | } 25 | .grey { 26 | color: lightgrey; 27 | } 28 | #create input[type=text] { 29 | color: gray; 30 | font-style: italic; 31 | padding: 1px 6px 1px 6px; 32 | } 33 | .button{ 34 | color: white; 35 | background: #DD4814; 36 | border: none; 37 | padding: 5px; 38 | border-radius: 2px; 39 | } 40 | .inputbox{ 41 | border:none; 42 | padding: 5px; 43 | border-radius: 2px; 44 | } 45 | -------------------------------------------------------------------------------- /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dohliam/yub/f2c3ba577418db4b473e323d6807227ef77226aa/favicon.ico -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | yub.js | web command-line 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 27 | 28 | 29 |
30 |
31 |

yub.js

32 |

web command-line

33 | 34 | 35 | 36 |

type 'list' to see all available search shortcuts, or 'tips' for more commands

37 | 38 |
39 |
 
40 |
41 | 42 | 54 | 55 |
56 | 66 |
67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /js/commands.js: -------------------------------------------------------------------------------- 1 | function yubComm(nub) { 2 | var nublc = nub.toLowerCase().replace(/[\s\+]$/, ""); 3 | 4 | var finished = ""; 5 | 6 | var o = document.getElementById("output"); 7 | var y = document.getElementById("yub"); 8 | 9 | if (nublc == "") { 10 | o.innerHTML = "Please enter a command."; 11 | finished = "done"; 12 | } 13 | 14 | if (nublc == "count") { 15 | var total = 0; 16 | if (modson == "off") { 17 | total = engines.length + tips.length; 18 | } else { 19 | total = engines.length + tips.length + mods.length; 20 | } 21 | o.innerHTML = "There are currently " + total + " commands available!"; 22 | y.value = ""; 23 | finished = "done"; 24 | } 25 | 26 | if (nublc == "clear") { 27 | o.innerHTML = ""; 28 | document.getElementById("create").style.display = "none"; 29 | document.getElementById("timer").style.display = "none"; 30 | y.value = ""; 31 | finished = "done"; 32 | } 33 | 34 | if (nublc == "dup") { 35 | if (modson == "off") { 36 | lsshort(engines,tips); 37 | } else { 38 | lsshort(engines,tips,mods); 39 | } 40 | var dupArr = []; 41 | for (var i = 0; i < allArray.length; i++) { 42 | dupArr.push(allArray[i].replace(/\t.*/, "")); 43 | } 44 | var uniqArr = uniqd(dupArr); 45 | if (uniqArr.length == 0) { 46 | o.innerHTML = "no duplicates found!"; 47 | } else { 48 | o.innerHTML = uniqArr.join("
"); 49 | } 50 | finished = "done"; 51 | } 52 | 53 | var shcut = nublc.replace(/^([>a-z]+) .*/,"$1"); 54 | var sterm = nub.replace(/[\s\+]+$/, "").replace(/^[>A-Za-z]+ (.*)/,"$1"); 55 | var stermlc = sterm.toLowerCase(); 56 | 57 | addr = ""; 58 | loc = ""; 59 | 60 | if (shcut == "list" || shcut == "ls") { 61 | if (/\s/.test(nublc) == false) { 62 | shcutList = ""; 63 | if (modson == "off") { 64 | lsshort(engines,tips); 65 | } else { 66 | lsshort(engines,tips,mods); 67 | } 68 | for (var i = 0; i < allArray.length; i++) { 69 | shcutList = shcutList + ""; 70 | } 71 | o.innerHTML = shcutList + "
" + allArray[i].replace(/\t/,"") + "
"; 72 | y.value = ""; 73 | } else { 74 | yubSearch("whatis " + sterm); 75 | y.value = ""; 76 | } 77 | finished = "done"; 78 | } 79 | 80 | if (/^((https*|ftp|file|chrome):\/\/)|(about:)/.test(nub)) { 81 | addr = nub; 82 | window.location=addr; 83 | finished = "done"; 84 | } 85 | 86 | if (/^\!/.test(nub)) { 87 | addr = nub.replace(/^\! */,"http://"); 88 | window.location=addr; 89 | finished = "done"; 90 | } 91 | 92 | if (shcut == "search" || shcut == "s") { 93 | if (/\s/.test(nublc) == false) { 94 | o.innerHTML = "Please enter a search string."; 95 | } else { 96 | if (modson == "off") { 97 | lslong(engines); 98 | } else { 99 | lslong(engines,mods); 100 | } 101 | var re = new RegExp(sterm.toLowerCase()); 102 | var shcutList = ""; 103 | var noresult = 0; 104 | for (var i = 0; i < longArray.length; i++) { 105 | if (re.test(longArray[i].toLowerCase())) { 106 | var l = longArray[i].split("\t"); 107 | shcutList = shcutList + ""; 108 | noresult++; 109 | } 110 | } 111 | o.innerHTML = shcutList + "
" + l[0] + "" + l[1] + "
"; 112 | y.value = ""; 113 | } 114 | if (noresult == 0) { 115 | o.innerHTML = "No matching commands found. Try a different search string!"; 116 | } 117 | finished = "done"; 118 | } 119 | 120 | 121 | if (shcut == "whatis" || shcut == "w") { 122 | if (/\s/.test(nublc) == false) { 123 | o.innerHTML = "Please enter a command name."; 124 | } else { 125 | if (modson == "off") { 126 | lsshort(engines,tips); 127 | } else { 128 | lsshort(engines,tips,mods); 129 | } 130 | var noresult = 0; 131 | for (var i = 0; i < allArray.length; i++) { 132 | if (allArray[i].replace(/\s*\t.*/, "") == sterm) { 133 | o.innerHTML = allArray[i].replace(/\t/, " = "); 134 | noresult++; 135 | } 136 | } 137 | if (noresult == 0) { 138 | o.innerHTML = "Command \"" + sterm + "\" not found. Please try again."; 139 | } 140 | } 141 | finished = "done"; 142 | } 143 | 144 | if (shcut == "where" || shcut == "wh") { 145 | if (/\s/.test(nublc) == false) { 146 | o.innerHTML = "Please enter a command name."; 147 | } else { 148 | if (modson == "off") { 149 | lslong(engines); 150 | } else { 151 | lslong(engines,mods); 152 | } 153 | var noresult = 0; 154 | for (var i = 0; i < longArray.length; i++) { 155 | var l = longArray[i].split("\t"); 156 | if (l[0] == sterm) { 157 | o.innerHTML = l[0] + " = " + l[1] + "
Search: " + l[2] + "
Default: " + l[3] + "
"; 158 | noresult++; 159 | y.value = ""; 160 | } 161 | } 162 | if (noresult == 0) { 163 | o.innerHTML = "Command \"" + sterm + "\" not found. Please try again."; 164 | } 165 | } 166 | finished = "done"; 167 | } 168 | 169 | if (shcut == "calc" || shcut == "c") { 170 | o.innerHTML = eval(sterm.replace(/[a-zA-Z]/g, "").replace(/([\d\.]+)\^([\d\.]+)/g, "Math.pow($1,$2)").replace(/~([\d\.]+)/g, "Math.round($1)")); 171 | finished = "done"; 172 | } 173 | 174 | if (shcut == "random" || shcut == "rand") { 175 | if (sterm == "site") { 176 | lslong(engines,mods); 177 | var rfloor = longArray.length; 178 | rfloor = Math.floor(Math.random()*rfloor); 179 | var addr = longArray[rfloor].split("\t")[3]; 180 | window.location = addr; 181 | } else if (sterm == "git") { 182 | randgit(); 183 | } else if (sterm == "img") { 184 | var addr = "https://imgur.com/random"; 185 | window.location = addr; 186 | } else { 187 | var rfloor = sterm.replace(/[^\d]/g, ""); 188 | rfloor == "" ? rfloor = 101 : rfloor = parseInt(rfloor) + 1; 189 | o.innerHTML = Math.floor(Math.random()*rfloor); 190 | } 191 | finished = "done"; 192 | } 193 | 194 | if (shcut == "pop") { 195 | if (modson == "off") { 196 | lslong(engines); 197 | } else { 198 | lslong(engines,mods); 199 | } 200 | if (/\s/.test(nublc) == false) { 201 | window.open(document.URL,'_blank','location=yes,height=570,width=520,scrollbars=yes,status=yes'); 202 | window.open(window.location, '_self').close(); 203 | } else if (/-u/.test(sterm) == true) { 204 | a = /-u (.*)/.exec(sterm)[1]; 205 | // c = /(http:\/\/.*?)(?:\s+||$)/g.exec(a); 206 | var httpArr = a.split(" "); 207 | for (var i = 0; i < httpArr.length; i++) { 208 | window.open(httpArr[i]); 209 | } 210 | return true; 211 | } else if (/-t/.test(sterm) == true) { 212 | var a = sterm.split(" -t "); 213 | var comm = a[0]; 214 | var text = a[1]; 215 | var commArr = comm.split(" "); 216 | var httpArr = []; 217 | for (var c = 0; c < commArr.length; c++) { 218 | for (var i = 0; i < longArray.length; i++) { 219 | var l = longArray[i].split("\t"); 220 | if (commArr[c] == l[0]) { 221 | httpArr.push(l[2].replace(/%s/, text)); 222 | } 223 | } 224 | } 225 | for (var i = 0; i < httpArr.length; i++) { 226 | window.open(httpArr[i]); 227 | } 228 | return true; 229 | } else { 230 | var comm = sterm.split(" "); 231 | var httpArr = []; 232 | for (var c = 0; c < comm.length; c++) { 233 | for (var i = 0; i < longArray.length; i++) { 234 | var l = longArray[i].split("\t"); 235 | if (comm[c] == l[0]) { 236 | httpArr.push(l[3]); 237 | } 238 | } 239 | } 240 | for (var i = 0; i < httpArr.length; i++) { 241 | window.open(httpArr[i]); 242 | } 243 | return true; 244 | } 245 | finished = "done"; 246 | } 247 | 248 | if (shcut == "href" || shcut == "link") { 249 | var url = location.href; 250 | if (/\s/.test(nublc) == false) { 251 | o.innerHTML = "The current url is: " + url; 252 | } else { 253 | var encurl = encodeURI(url + "?" + sterm); 254 | o.innerHTML = "The current url is: " + url + "

You entered the following command: " + sterm + "
Permalink"; 255 | } 256 | y.value = ""; 257 | finished = "done"; 258 | } 259 | 260 | if (shcut == "echo") { 261 | if (/\s/.test(nublc) == false) { 262 | o.innerHTML = "Hi there! :)"; 263 | } else { 264 | o.innerHTML = sterm; 265 | } 266 | y.value = ""; 267 | finished = "done"; 268 | } 269 | 270 | if (shcut == "sort") { 271 | if (/\s/.test(nublc) == false) { 272 | o.innerHTML = "Please input some text to sort."; 273 | } else { 274 | var d = delimit(sterm); 275 | o.innerHTML = d.sort().join("
"); 276 | } 277 | y.value = ""; 278 | finished = "done"; 279 | } 280 | 281 | if (shcut == "shuffle") { 282 | if (/\s/.test(nublc) == false) { 283 | o.innerHTML = "Please input some text to shuffle."; 284 | } else { 285 | var d = delimit(sterm); 286 | o.innerHTML = shuffle(d).join("
"); 287 | } 288 | y.value = ""; 289 | finished = "done"; 290 | } 291 | 292 | if (shcut == "uniq") { 293 | if (/\s/.test(nublc) == false) { 294 | o.innerHTML = "Please input some text as an argument to uniq."; 295 | } else { 296 | var d = delimit(sterm); 297 | o.innerHTML = uniq(d).join("
"); 298 | } 299 | y.value = ""; 300 | finished = "done"; 301 | } 302 | 303 | if (shcut == "uniqd") { 304 | if (/\s/.test(nublc) == false) { 305 | o.innerHTML = "Please input some text as an argument to uniqd."; 306 | } else { 307 | var d = delimit(sterm); 308 | o.innerHTML = uniqd(d).join("
"); 309 | } 310 | y.value = ""; 311 | finished = "done"; 312 | } 313 | 314 | if (shcut == "ucase" || shcut == "upcase") { 315 | if (/\s/.test(nublc) == false) { 316 | o.innerHTML = "Please input some text to convert to upper case."; 317 | } else { 318 | o.innerHTML = sterm.toUpperCase(); 319 | } 320 | finished = "done"; 321 | } 322 | 323 | if (shcut == "lcase" || shcut == "downcase") { 324 | if (/\s/.test(nublc) == false) { 325 | o.innerHTML = "Please input some text to convert to lower case."; 326 | } else { 327 | o.innerHTML = sterm.toLowerCase(); 328 | } 329 | finished = "done"; 330 | } 331 | 332 | if (shcut == "ccase" || shcut == "capcase" || shcut == "caps") { 333 | if (/\s/.test(nublc) == false) { 334 | o.innerHTML = "Please input some text to convert to initial caps."; 335 | } else { 336 | o.innerHTML = sterm.toLowerCase().replace(/(^|\s+)(.)/g,function(_, a, l){return a+l.toUpperCase();}); 337 | } 338 | finished = "done"; 339 | } 340 | 341 | if (shcut == "wc") { 342 | if (/\s/.test(nublc) == false) { 343 | o.innerHTML = "Please input some text to count."; 344 | } else if (/^\-c /.test(sterm) == true) { 345 | c = sterm.replace(/^\-c /,""); 346 | o.innerHTML = c.split(/./).length -1; 347 | } else { 348 | var d = delimit(sterm); 349 | o.innerHTML = d.length; 350 | } 351 | y.value = ""; 352 | finished = "done"; 353 | } 354 | 355 | if (shcut == "watch" || shcut == "ytp") { 356 | if (/\s/.test(nublc) == false) { 357 | o.innerHTML = "Please provide a search term for something you would like to watch."; 358 | } else { 359 | p = ''; 360 | o.innerHTML = p; 361 | } 362 | // y.value = ""; 363 | finished = "done"; 364 | } 365 | 366 | if (shcut == "timer" || shcut == "stopwatch") { 367 | timer(); 368 | 369 | y.value = ""; 370 | finished = "done"; 371 | } 372 | 373 | if (shcut == "whoami") { 374 | o.innerHTML = "
Browser code name: " + navigator.appCodeName + "
Browser offical name: " + navigator.appName + "
Browser Version: " + navigator.appVersion + "
Java enabled? " + navigator.javaEnabled() + "
Browser Language: " + navigator.language + "
All languages in order of preference: " + navigator.languages + "
Browser online? " + navigator.onLine + "
Current operating system: " + navigator.oscpu + "
Browser platform: " + navigator.platform + "
User agent: " + navigator.userAgent.replace(/\)/,")
") + "
"; 375 | y.value = ""; 376 | finished = "done"; 377 | } 378 | 379 | if (shcut == "sticky") { 380 | y.value = ""; 381 | if (/\s/.test(nublc) == false) { 382 | o.innerHTML = '
'; 383 | if (localStorage.sticky) { 384 | b["innerHTML"]=[localStorage.sticky]; 385 | } else { 386 | b["innerHTML"]="This is an editable sticky. Type something to add notes here."; 387 | } 388 | window.b.setAttribute("oninput", "localStorage.sticky=b['innerHTML']"); 389 | window.b.focus(); 390 | } else if (/^\-r/.test(sterm) == true) { 391 | localStorage.sticky = ""; 392 | o.innerHTML = "Local storage has been cleared."; 393 | y.focus(); 394 | } else { 395 | localStorage.sticky = sterm; 396 | yubComm("sticky"); 397 | window.b.focus(); 398 | } 399 | finished = "done"; 400 | } 401 | 402 | if (shcut == "notepad") { 403 | y.value = ""; 404 | if (sterm == "-r") { 405 | localStorage.np = ""; 406 | o.innerHTML = "Local storage has been cleared."; 407 | y.focus(); 408 | } else { 409 | o.innerHTML = '
'; 410 | // b["innerHTML"]=[localStorage.c]; 411 | if (localStorage.np) { 412 | b["innerHTML"]=[localStorage.np]; 413 | } else { 414 | b["innerHTML"]="This is an editable notepad with automatic local storage.\nClick here to add some notes."; 415 | } 416 | window.b.setAttribute("oninput", "localStorage.np=b['innerHTML']"); 417 | window.b.focus(); 418 | } 419 | finished = "done"; 420 | } 421 | 422 | if (shcut == ">") { 423 | if (/\s/.test(nublc) == false) { 424 | o.innerHTML = "To use the > redirect prefix, input a yubnub command and a search term as arguments, for example:
> wp Hedgehogs
(Uses Google to search Wikipedia and goes automatically to the first result)"; 425 | } else { 426 | var surl = ""; 427 | var nterm = sterm.replace(/.*?\s(.*)/,"$1"); 428 | if (modson == "off") { 429 | lslong(engines); 430 | } else { 431 | lslong(engines,mods); 432 | } 433 | c = 0; 434 | for (var i = 0; i < longArray.length; i++) { 435 | var l = longArray[i].split("\t"); 436 | if (l[0] == sterm.replace(/\s.*/,"")) { 437 | surl = l[3].replace(/(https*:\/\/.*?)\/.*/, "$1"); 438 | c++; 439 | } 440 | } 441 | if (c == 0) { 442 | o.innerHTML = "No command \"" + sterm + "\" found. Please try again!"; 443 | } else { 444 | var gfl = "https://google.com/search?q=site:" + surl + "+" + nterm + "&btnI=I%27m+Feeling+Lucky"; 445 | window.location = gfl; 446 | } 447 | } 448 | finished = "done"; 449 | } 450 | 451 | if (shcut == "create") { 452 | var cr = document.getElementById("create"); 453 | var scn = document.getElementById("scname"); 454 | if (/\s/.test(nublc) == true) { 455 | if (modson == "off") { 456 | lsshort(engines,tips); 457 | } else { 458 | lsshort(engines,tips,mods); 459 | } 460 | c = 0; 461 | for (var i = 0; i < allArray.length; i++) { 462 | if (allArray[i].replace(/\s*\t.*/, "") == sterm) { 463 | c++; 464 | } 465 | } 466 | if (c > 0) { 467 | o.innerHTML = "A command with the name \"" + sterm + "\" already exists. Please try another command name."; 468 | } else { 469 | cr.style.display = ''; 470 | scn.value = sterm; 471 | scn.focus(); 472 | scn.select(); 473 | } 474 | } else { 475 | if (cr.style.display == '') { 476 | cr.style.display = 'none'; 477 | } else { 478 | cr.style.display = ''; 479 | scn.focus(); 480 | scn.select(); 481 | } 482 | } 483 | finished = "done"; 484 | } 485 | 486 | if (shcut == "time" || shcut == "t") { 487 | d = new Date(); 488 | t = d.toLocaleTimeString().replace(/([\d]+:[\d]{2})(:[\d]{2})(.*)/, "$1$3"); 489 | iso = d.toISOString().replace(/T.*/,""); 490 | df = d.toLocaleDateString("en-US", {weekday: "long", month: "long", day: "numeric"}); 491 | finished = "done"; 492 | if (sterm != "time" && sterm != "t") { 493 | df = d.toLocaleDateString(sterm, {weekday: "long", month: "long", day: "numeric"}); 494 | finished = "done"; 495 | } 496 | o.innerHTML = t + "
" + df + "
(" + iso + ")
"; 497 | } 498 | 499 | if (shcut == "day" || shcut == "date" || shcut == "d") { 500 | d = new Date(); 501 | day = d.getDay().toString().replace(/0/,"Sunday").replace(/1/,"Monday").replace(/2/,"Tuesday").replace(/3/,"Wednesday").replace(/4/,"Thursday").replace(/5/,"Friday").replace(/6/,"Saturday"); 502 | iso = d.toISOString().replace(/T.*/,""); 503 | o.innerHTML = day + "
(" + iso + ")
"; 504 | finished = "done"; 505 | } 506 | 507 | if (shcut == "skin") { 508 | stylesheet = document.getElementById("stylesheet"); 509 | // if ls then list available skins 510 | // if non-existent then print error 511 | stylesheet.href = "css/" + sterm + ".css"; 512 | o.innerHTML = "yub.js skin successfully changed to \"" + sterm + "\"!"; 513 | finished = "done"; 514 | } 515 | 516 | if (shcut == "tips" || shcut == "help" || shcut == "man") { 517 | var commList = ""; 518 | var noresult = 0; 519 | if (/\s/.test(nublc) == false) { 520 | for (var i = 0; i < tips.length; i++) { 521 | commList = commList + "\n"; 522 | } 523 | o.innerHTML = commList.split("\n").sort().join("\n") + "
" + tips[i].n + "" + tips[i].d + "
"; 524 | y.value = ""; 525 | } else { 526 | lsshort(tips); 527 | var noresult = 0; 528 | for (var i = 0; i < allArray.length; i++) { 529 | if (allArray[i].replace(/\s*\t.*/, "") == sterm) { 530 | o.innerHTML = allArray[i].replace(/\t/, " = "); 531 | noresult++; 532 | } 533 | } 534 | if (noresult == 0) { 535 | o.innerHTML = "Command \"" + sterm + "\" not found. Please try again."; 536 | } 537 | } 538 | finished = "done"; 539 | } 540 | 541 | // if (nublc == "shortcuts") { 542 | // shcList = ""; 543 | // for (var i = 0; i < shortcuts.length; i++) { 544 | // shcList = shcList + "\n"; 545 | // } 546 | // o.innerHTML = shcList.split("\n").sort().join("\n") + "
" + shortcuts[i].shcName + "" + shortcuts[i].shcDesc + "
"; 547 | // y.value = ""; 548 | // finished = "done"; 549 | // } 550 | 551 | if (nublc == "mods") { 552 | if (modson == "off") { 553 | o.innerHTML = "No additional modules loaded."; 554 | } else { 555 | modList = ""; 556 | for (var i = 0; i < mods.length; i++) { 557 | modList = modList + "\n"; 558 | } 559 | o.innerHTML = modList.split("\n").sort().join("\n") + "
" + mods[i].n + "" + mods[i].d + "
"; 560 | y.value = ""; 561 | } 562 | finished = "done"; 563 | } 564 | 565 | for (var i = 0; i < engines.length; i++) { 566 | if (engines[i].n == shcut) { 567 | finished = "done"; 568 | if (shcut == stermlc && /\s/.test(nublc) == false) { 569 | addr = engines[i].f; 570 | window.location=addr; 571 | } else { 572 | loc = engines[i].a; 573 | addr = loc.replace(/%s/,sterm); 574 | window.location=addr; 575 | } 576 | } 577 | } 578 | 579 | // for (var i = 0; i < shortcuts.length; i++) { 580 | // if (shortcuts[i].shcName == shcut) { 581 | // addr = shortcuts[i].shcAddr; 582 | // window.location=addr; 583 | // finished = "done"; 584 | // } 585 | // } 586 | 587 | if (modson == "on") { 588 | for (var i = 0; i < mods.length; i++) { 589 | if (mods[i].n == shcut) { 590 | finished = "done"; 591 | if (shcut == stermlc && /\s/.test(nub) == false) { 592 | addr = mods[i].f; 593 | window.location=addr; 594 | } else { 595 | loc = mods[i].a; 596 | addr = loc.replace(/%s/,sterm); 597 | window.location=addr; 598 | } 599 | } 600 | } 601 | } 602 | 603 | if (finished == "") { 604 | escNub = encodeURIComponent(nub).replace(/'/g, "@39@"); 605 | o.innerHTML = "Command '" + shcut + "' not found.
Type 'list' or 'ls' to see all commands."; 606 | y.value = ""; 607 | } 608 | } 609 | -------------------------------------------------------------------------------- /js/config.js: -------------------------------------------------------------------------------- 1 | // version information 2 | var name = "yub.js"; 3 | var version = "1.0.0"; 4 | 5 | // language options 6 | var lang = ""; // select ui language 7 | 8 | // support for themes 9 | var theme = ""; // choose a theme 10 | var bgcol = ""; // set background colour 11 | var txtcol = ""; // set text colour 12 | -------------------------------------------------------------------------------- /js/engines.js: -------------------------------------------------------------------------------- 1 | var engines = [ 2 | {"n":"about", "a":"", "d":"Information about yub.js", "f":"https://github.com/dohliam/yub"}, 3 | {"n":"g", "a":"https://www.google.com/search?q=%s", "d":"Google Search", "f":"https://google.com/"}, 4 | {"n":"gim", "a":"https://www.google.com/search?tbm=isch&q=%s", "d":"Google Image Search", "f":"https://images.google.com/"}, 5 | {"n":"gmail", "a":"https://mail.google.com/mail/u/0/#search/%s", "d":"Gmail", "f":"https://gmail.com/"}, 6 | {"n":"drive", "a":"https://drive.google.com/#search/%s", "d":"Google Drive", "f":"https://drive.google.com/"}, 7 | {"n":"am", "a":"https://www.amazon.com/exec/obidos/external-search?mode=blended&keyword=%s", "d":"Amazon.com Product Search", "f":"https://www.amazon.com/"}, 8 | {"n":"gt", "a":"https://translate.google.com/#auto/en/%s", "d":"Google Auto-Translate Text", "f":"https://translate.google.com"}, 9 | {"n":"gtu", "a":"https://translate.google.com/translate?u=%s", "d":"Google Auto-Translate URL", "f":"https://translate.google.com"}, 10 | {"n":"gb", "a":"https://books.google.com/books?q=%s&btnG=Search+Books", "d":"Google Books Search", "f":"https://books.google.com"}, 11 | {"n":"gfl", "a":"https://google.com/search?q=%s&btnI=I%27m+Feeling+Lucky", "d":"Google Feeling Lucky Search", "f":"https://google.com"}, 12 | {"n":"gm", "a":"https://maps.google.com/maps?q=%s&output=classic", "d":"Google Maps Search", "f":"https://maps.google.com"}, 13 | {"n":"gs", "a":"https://scholar.google.com/scholar?q=%s", "d":"Google Scholar Search", "f":"https://scholar.google.com"}, 14 | {"n":"gmt", "a":"https://www.timeanddate.com/worldclock/results.html?query=%s", "d":"Time and Date for any Location", "f":"https://timeanddate.com/worldclock"}, 15 | {"n":"weather", "a":"https://openweathermap.org/find?q=%s", "d":"Weather from OpenWeatherMap", "f":"https://openweathermap.org/"}, 16 | {"n":"wbm", "a":"https://web.archive.org/web/*/%s", "d":"Wayback Machine Internet Archive of URL", "f":"https://archive.org"}, 17 | {"n":"whois", "a":"https://www.whois.sc/%s", "d":"Whois URL & IP Address Listing", "f":"https://whois.sc"}, 18 | {"n":"gwhois", "a":"https://gwhois.org/%s", "d":"GWhois DNS & IP search", "f":"https://gwhois.org"}, 19 | {"n":"wco", "a":"https://commons.wikimedia.org/wiki/Special:Search?search=%s", "d":"Wikimedia Commons Search", "f":"https://commons.wikimedia.org/"}, 20 | {"n":"wp", "a":"https://en.wikipedia.org/?search=%s", "d":"Wikipedia", "f":"https://en.wikipedia.org/"}, 21 | {"n":"wv", "a":"https://en.wikivoyage.org/?search=%s", "d":"Wikivoyage", "f":"https://en.wikivoyage.org/"}, 22 | {"n":"wt", "a":"https://en.wiktionary.org/?search=%s", "d":"Wiktionary", "f":"https://en.wiktionary.org/"}, 23 | {"n":"wq", "a":"https://en.wikiquote.org/?search=%s", "d":"Wikiquote", "f":"https://en.wikiquote.org/"}, 24 | {"n":"wn", "a":"https://en.wikinews.org/?search=%s", "d":"Wikinews", "f":"https://en.wikinews.org/"}, 25 | {"n":"ws", "a":"https://en.wikisource.org/?search=%s", "d":"Wikisource", "f":"https://en.wikisource.org/"}, 26 | {"n":"gn", "a":"https://news.google.com/news?q=%s", "d":"Google News", "f":"https://news.google.com"}, 27 | {"n":"yt", "a":"https://www.youtube.com/results?search_type=&search_query=%s&aq=f", "d":"YouTube Video Search", "f":"https://www.youtube.com/"}, 28 | {"n":"fcc", "a":"https://www.flickr.com/search/?q=%s&l=4", "d":"Flickr cc-by Image Search", "f":"https://www.flickr.com/creativecommons/by-2.0/"}, 29 | {"n":"flk", "a":"https://www.flickr.com/search?text=%s", "d":"Flickr Image Search", "f":"https://www.flickr.com/"}, 30 | {"n":"play", "a":"https://play.google.com/store/search?q=%s&c=apps&price=1", "d":"Google Play Store Search", "f":"https://play.google.com/"}, 31 | {"n":"opc", "a":"https://openclipart.org/search/?query=%s", "d":"Open Clipart Search", "f":"https://openclipart.org/"}, 32 | {"n":"gten", "a":"https://translate.google.com/translate_t#%s|en", "d":"Google Translate page for specified language -> English", "f":"https://translate.google.com/"}, 33 | {"n":"cache", "a":"https://google.com/search?q=cache:%s&strip=1", "d":"Google text-only cache of a webpage", "f":"https://google.com"}, 34 | {"n":"cat", "a":"https://google.com/search?q=cache:%s&strip=1", "d":"output webpage text from Google cache", "f":"https://google.com"}, 35 | {"n":"yn", "a":"https://news.search.yahoo.com/search?p=%s", "d":"Yahoo News", "f":"https://news.yahoo.com/"}, 36 | {"n":"onelook", "a":"https://www.onelook.com/?w=%s&ls=a", "d":"Onelook Dictionary Search", "f":"https://www.onelook.com/"}, 37 | {"n":"olr", "a":"https://www.onelook.com/?w=*&loc=revfp2&clue=%s", "d":"OneLook Reverse Dictionary", "f":"https://www.onelook.com/reverse-dictionary.shtml"}, 38 | {"n":"ud", "a":"https://www.urbandictionary.com/define.php?term=%s", "d":"Urban Dictionary Search", "f":"https://www.urbandictionary.com/"}, 39 | {"n":"dic", "a":"https://dictionary.reference.com/browse/%s", "d":"Dictionary.com", "f":"https://dictionary.com/"}, 40 | {"n":"thes", "a":"https://www.wordreference.com/thesaurus/%s", "d":"WordReference.com English Thesaurus", "f":"https://www.wordreference.com/thesaurus/"}, 41 | {"n":"ted", "a":"https://www.ted.com/search?q=%s", "d":"TED Talks", "f":"https://ted.com"}, 42 | {"n":"r", "a":"https://reddit.com/r/%s", "d":"Reddit", "f":"https://reddit.com"}, 43 | {"n":"ddg", "a":"https://duckduckgo.com/?q=%s", "d":"DuckDuckGo Search", "f":"https://duckduckgo.com/"}, 44 | {"n":"ext", "a":"https://filext.com/file-extension/%s", "d":"FILExt - File Extension Search", "f":"https://filext.com/"}, 45 | {"n":"ebay", "a":"https://www.ebay.com/sch/i.html?_nkw=%s", "d":"Ebay", "f":"https://www.ebay.com/"}, 46 | {"n":"tw", "a":"https://twitter.com/%s", "d":"Twitter", "f":"https://twitter.com/"}, 47 | {"n":"tws", "a":"https://twitter.com/search?q=%s", "d":"Twitter Search", "f":"https://twitter.com/search-advanced"}, 48 | {"n":"imgur", "a":"https://imgur.com/search?q=%s", "d":"Imgur - Image Sharer", "f":"https://imgur.com/"}, 49 | {"n":"gpdf", "a":"https://www.google.com/search?q=filetype:pdf+%s", "d":"Google PDF Search", "f":"https://www.google.com/search?q=filetype:pdf"}, 50 | {"n":"gfim", "a":"https://www.google.com/search?tbm=isch&as_q=%s&tbs=sur:fmc", "d":"Google Free Image Search", "f":"https://images.google.com/"}, 51 | {"n":"ngram", "a":"https://books.google.com/ngrams/graph?content=%s", "d":"Google Books Ngram Viewer", "f":"https://books.google.com/ngrams"}, 52 | {"n":"gnas", "a":"https://www.google.com/search?q=%s site:news.google.com/newspapers", "d":"Google News Archive Search", "f":"https://news.google.com/newspapers"}, 53 | {"n":"gsite", "a":"https://www.google.com/search?q=site:%s", "d":"Google Site Search", "f":"https://google.com/"}, 54 | {"n":"hn", "a":"https://hn.algolia.com/?q=%s", "d":"Hacker News", "f":"https://news.ycombinator.com/"}, 55 | {"n":"how", "a":"https://www.wikihow.com/?search=%s", "d":"wikiHow - How to do anything", "f":"https://www.wikihow.com/"}, 56 | {"n":"ifixit", "a":"https://www.ifixit.com/Guide/search/%s", "d":"iFixit - The free repair manual", "f":"https://www.ifixit.com/"}, 57 | {"n":"y", "a":"https://search.yahoo.com/search;?p=%s", "d":"Yahoo", "f":"https://yahoo.com"}, 58 | {"n":"yim", "a":"https://images.search.yahoo.com/search/images;?p=%s", "d":"Yahoo Image Search", "f":"https://images.search.yahoo.com/"}, 59 | {"n":"yv", "a":"https://video.search.yahoo.com/search/video;?p=%s", "d":"Yahoo Video Search", "f":"https://video.search.yahoo.com/"}, 60 | {"n":"ym", "a":"https://maps.yahoo.com/place/?addr=%s", "d":"Yahoo Maps", "f":"https://maps.yahoo.com"}, 61 | {"n":"b", "a":"https://www.bing.com/search?q=%s", "d":"Bing Search", "f":"https://www.bing.com/"}, 62 | {"n":"bim", "a":"https://www.bing.com/images/search?q=%s", "d":"Bing Image Search", "f":"https://www.bing.com/images/"}, 63 | {"n":"btr", "a":"", "d":"Bing Translator", "f":"https://www.bing.com/translator/"}, 64 | {"n":"bn", "a":"https://www.bing.com/news/search?q=%s", "d":"Bing News", "f":"https://www.bing.com/news/"}, 65 | {"n":"bm", "a":"https://www.bing.com/maps/?where1=%s", "d":"Bing Maps", "f":"https://www.bing.com/maps/"}, 66 | {"n":"bv", "a":"https://www.bing.com/videos/search?q=%s", "d":"Bing Videos", "f":"https://www.bing.com/videos/"}, 67 | {"n":"gut", "a":"https://www.gutenberg.org/ebooks/search/?query=%s", "d":"Project Gutenberg", "f":"https://www.gutenberg.org/"}, 68 | {"n":"forvo", "a":"https://www.forvo.com/word/%s", "d":"Forvo Pronunciations", "f":"https://www.forvo.com/"}, 69 | {"n":"gc", "a":"https://code.google.com/hosting/search?q=%s", "d":"Google Code", "f":"https://code.google.com/"}, 70 | {"n":"sf", "a":"https://sourceforge.net/directory?q=%s", "d":"SourceForge", "f":"https://sourceforge.net/"}, 71 | {"n":"git", "a":"https://github.com/search?q=%s", "d":"GitHub", "f":"https://github.com/"}, 72 | {"n":"bbc", "a":"https://www.bbc.co.uk/search?q=%s", "d":"BBC News", "f":"https://www.bbc.com/news/"}, 73 | {"n":"dw", "a":"https://www.dw.de/search/english/%s/category/9097/", "d":"Deutsche Welle - English (English)", "f":"https://www.dw.de/"}, 74 | {"n":"nhken", "a":"https://www2.nhk.or.jp/nhkworld/search/query.cgi?qt=%s", "d":"NHK World - English", "f":"https://www3.nhk.or.jp/nhkworld/"}, 75 | {"n":"fr24en", "a":"https://www.france24.com/en/search/?Search[term]=%s&Search[page]=1", "d":"France 24 (en) - International News 24/7", "f":"https://www.france24.com/en/"}, 76 | {"n":"rfien", "a":"https://www.english.rfi.fr/search/sinequa_search/%s", "d":"RFI (en)", "f":"https://www.english.rfi.fr/"}, 77 | {"n":"abc", "a":"https://www.radioaustralia.net.au/international/search/%s", "d":"ABC Radio Australia", "f":"https://www.radioaustralia.net.au/"}, 78 | {"n":"gg", "a":"https://groups.google.com/forum/#!search/%s", "d":"Google Groups", "f":"https://groups.google.com/"}, 79 | {"n":"yg", "a":"https://groups.yahoo.com/neo/search?query=%s", "d":"Yahoo Groups", "f":"https://groups.yahoo.com/"}, 80 | {"n":"so", "a":"https://stackoverflow.com/search?q=%s", "d":"Stack Overflow", "f":"https://stackoverflow.com/"}, 81 | {"n":"yw", "a":"", "d":"Yahoo Weather", "f":"https://weather.yahoo.com/"}, 82 | {"n":"yelp", "a":"https://www.yelp.com/search?find_desc=%s", "d":"Yelp", "f":"https://www.yelp.com/"}, 83 | {"n":"cnn", "a":"https://edition.cnn.com/search/?query=%s", "d":"CNN International", "f":"https://edition.cnn.com/"}, 84 | {"n":"rci", "a":"https://www.rcinet.ca/en/?s=%s", "d":"Radio Canada International - English", "f":"https://www.rcinet.ca/en/"}, 85 | {"n":"cbc", "a":"https://www.cbc.ca/gsa/?q=%s", "d":"CBC News - Canadian Broadcasting Corporation", "f":"https://www.cbc.ca/news"}, 86 | {"n":"db", "a":"https://www.dropbox.com/home/%s", "d":"Dropbox", "f":"https://dropbox.com"}, 87 | {"n":"ibn", "a":"https://ibnlive.in.com/searcher/search.php?searchq=%s", "d":"CNN-IBN News - Indian Broadcasting Network (English)", "f":"https://ibnlive.in.com/"}, 88 | {"n":"voa", "a":"https://www.voanews.com/search/search2.aspx#all|%s|0|allzones|min|now", "d":"Voice of America News (English)", "f":"https://www.voanews.com/"}, 89 | {"n":"rpen", "a":"https://radio.cz/en/search/?query=%s", "d":"Radio Prague (en)", "f":"https://radio.cz/en"}, 90 | {"n":"xhen", "a":"http://search.news.cn/language/search.jspa?id=en&t=1&t1=0&ss=&ct=&n1=%s&button=ok", "d":"Xinhua English (en)", "f":"http://www.news.cn/english/"}, 91 | {"n":"ymail", "a":"", "d":"Yahoo Mail", "f":"https://mail.yahoo.com"}, 92 | {"n":"mail", "a":"", "d":"Mail.com", "f":"https://www.mail.com/"}, 93 | {"n":"hmail", "a":"", "d":"Hotmail", "f":"https://hotmail.com"}, 94 | {"n":"omail", "a":"", "d":"Outlook.com E-mail", "f":"https://outlook.com"}, 95 | {"n":"dd", "a":"https://downdetector.com/search/?q=%s", "d":"Down Detector", "f":"https://downdetector.com/"}, 96 | {"n":"isup", "a":"https://www.downforeveryoneorjustme.com/%s", "d":"Down For Everyone Or Just Me", "f":"https://www.downforeveryoneorjustme.com/"}, 97 | {"n":"dfeojm", "a":"https://www.downforeveryoneorjustme.com/%s", "d":"Down For Everyone Or Just Me", "f":"https://www.downforeveryoneorjustme.com/"}, 98 | {"n":"ip", "a":"", "d":"What Is My IP", "f":"https://www.whatismyip.com/"}, 99 | {"n":"ggv", "a":"https://www.google.com/search?tbm=vid&q=%s", "d":"Google Video Search", "f":"https://video.google.com/"}, 100 | {"n":"gflights", "a":"https://www.google.ca/flights/#search;t=%s", "d":"Google Flights Search", "f":"https://flights.google.com/"}, 101 | {"n":"trends", "a":"https://www.google.ca/trends/explore#q=%s", "d":"Google Trends", "f":"https://www.google.com/trends/"}, 102 | {"n":"sp", "a":"https://startpage.com/do/search?query=%s", "d":"Startpage Web Search", "f":"https://startpage.com/"}, 103 | {"n":"spim", "a":"https://startpage.com/do/search?cat=pics&query=%s", "d":"Startpage Image Search", "f":"https://startpage.com/"}, 104 | {"n":"spv", "a":"https://startpage.com/do/search?cat=video&query=%s", "d":"Startpage Video Search", "f":"https://startpage.com/"}, 105 | {"n":"spsite", "a":"https://startpage.com/do/search?query=site:%s", "d":"Startpage Site Search", "f":"https://startpage.com/"}, 106 | {"n":"ix", "a":"https://ixquick.com/do/search?q=%s", "d":"Ixquick Search Engine", "f":"https://www.ixquick.com/"}, 107 | {"n":"ixim", "a":"https://ixquick.com/do/search?cat=pics&query=%s", "d":"Ixquick Image Search", "f":"https://ixquick.com/"}, 108 | {"n":"ixv", "a":"https://ixquick.com/do/search?cat=video&query=%s", "d":"Ixquick Video Search", "f":"https://ixquick.com/"}, 109 | {"n":"ixsite", "a":"https://ixquick.com/do/search?q=site:%s", "d":"Ixquick Site Search", "f":"https://www.ixquick.com/"}, 110 | {"n":"vi", "a":"https://vimeo.com/search?q=%s", "d":"Vimeo Videos", "f":"https://vimeo.com/"}, 111 | {"n":"fspam", "a":"https://www.stopforumspam.com/ipcheck/%s", "d":"Stop Forum Spam - IP Check", "f":"https://www.stopforumspam.com/"}, 112 | {"n":"lmd", "a":"https://mondediplo.com/spip.php?page=recherche&recherche=%s", "d":"Le Monde diplomatique - English edition", "f":"https://mondediplo.com/"}, 113 | {"n":"gv", "a":"https://globalvoicesonline.org/?s=%s", "d":"Global Voices (en)", "f":"https://globalvoicesonline.org/"}, 114 | {"n":"eun", "a":"", "d":"Euronews (en)", "f":"https://www.euronews.com/"}, 115 | {"n":"reu", "a":"https://www.reuters.com/search?blob=%s", "d":"Reuters", "f":"https://www.reuters.com/"}, 116 | {"n":"swi", "a":"https://www.swissinfo.ch/action/eng/40468904/search?query=%s", "d":"SwissInfo (en)", "f":"https://www.swissinfo.ch/eng"}, 117 | {"n":"rt", "a":"https://rt.com/search/everywhere/term/%s/", "d":"RT - Russia Today (en)", "f":"https://rt.com/"}, 118 | {"n":"blm", "a":"https://search1.bloomberg.com/search/?content_type=all&q=%s", "d":"Bloomberg News", "f":"https://www.bloomberg.com/news/"}, 119 | {"n":"ascii", "a":"https://www.network-science.de/ascii/ascii.php?TEXT=%s&x=8&y=7&FONT=_all+fonts+with+your+text_&RICH=no&FORM=left&STRE=no", "d":"ASCII Generator", "f":"https://www.network-science.de/ascii/"}, 120 | {"n":"del", "a":"https://delicious.com/tag/%s", "d":"Delicious.com tag search", "f":"https://delicious.com/"}, 121 | {"n":"wa", "a":"https://www.wolframalpha.com/input/?i=%s", "d":"Wolfram Alpha", "f":"https://www.wolframalpha.com/"}, 122 | {"n":"npr", "a":"https://www.npr.org/templates/search/index.php?searchinput=%s", "d":"NPR - National Public Radio", "f":"https://www.npr.org/"}, 123 | {"n":"mo", "a":"https://www.google.com/gwt/n?u=%s", "d":"Show mobile version of page (via Google)", "f":"https://www.google.com/"}, 124 | {"n":"js", "a":"https://developer.mozilla.org/en-US/search?q=%s", "d":"Search JavaScript documentation", "f":"https://developer.mozilla.org/en-US/docs/Web/JavaScript"}, 125 | {"n":"rb", "a":"https://ruby-doc.com/search.html?q=%s", "d":"Search Ruby documentation", "f":"https://ruby-doc.com/"}, 126 | {"n":"php", "a":"https://www.php.net/%s", "d":"Search PHP documentation", "f":"https://www.php.net/"}, 127 | {"n":"py", "a":"https://docs.python.org/3/search.html?q=%s", "d":"Search Python documentation", "f":"https://docs.python.org/"}, 128 | {"n":"sh", "a":"https://mywiki.wooledge.org/ParsingLs?action=fullsearch&context=180&value=%s&fullsearch=Text", "d":"Search Bash documentation on BashFAQ", "f":"https://mywiki.wooledge.org/BashFAQ/"}, 129 | {"n":"jshint", "a":"", "d":"JSHint, a JavaScript Code Quality Tool", "f":"https://jshint.com/"}, 130 | {"n":"flint", "a":"https://www.flickr.com/photos/tags/%s/interesting/", "d":"Search Flickr for images, sorted by \"interestingness\"", "f":"https://www.flickr.com/"}, 131 | {"n":"lman", "a":"https://man.he.net/?section=all&topic=%s", "d":"Linux Man Pages Online", "f":"https://man.he.net/"}, 132 | {"n":"hl", "a":"https://news.search.yahoo.com/news/rss?ei=UTF-8&p=%s&c=&eo=UTF-8", "d":"Show a list of Yahoo News headlines on a particular topic", "f":"https://news.search.yahoo.com/"}, 133 | {"n":"imdb", "a":"https://www.imdb.com/find?q=%s", "d":"IMDB - International Movie Database", "f":"https://www.imdb.com/"}, 134 | {"n":"ccm", "a":"http://ccmixter.org/api/query?search=%s", "d":"ccMixter", "f":"http://ccmixter.org/"}, 135 | {"n":"ccmt", "a":"http://ccmixter.org/api/query?tags=%s", "d":"ccMixter Tag Search", "f":"http://ccmixter.org/"}, 136 | {"n":"jam", "a":"https://www.jamendo.com/en/search?qs=q=%s", "d":"Jamendo - Royalty Free Music", "f":"https://www.jamendo.com/"}, 137 | {"n":"sc", "a":"https://soundcloud.com/search?q=%s", "d":"SoundCloud", "f":"https://soundcloud.com/"}, 138 | {"n":"ar", "a":"https://archive.org/search.php?query=%s", "d":"Internet Archive", "f":"https://archive.org/"}, 139 | {"n":"medium", "a":"https://medium.com/search?q=%s", "d":"Medium Search", "f":"https://medium.com/"} 140 | ]; 141 | -------------------------------------------------------------------------------- /js/functions.js: -------------------------------------------------------------------------------- 1 | function yubSearch(nub) { 2 | yubComm(nub); 3 | return false; 4 | } 5 | 6 | function lsshort() { 7 | for (var allArray = [], i = 0; i < arguments.length; i++) for (var l = 0; l < arguments[i].length; l++) allArray.push(arguments[i][l].n + "\t" + arguments[i][l].d); 8 | window.allArray = allArray.sort(); 9 | } 10 | 11 | function lslong(n,p) { 12 | var f = []; 13 | if ("off" == modson) for (var i = 0; i < n.length; i++) f.push(n[i].n + "\t" + n[i].d + "\t" + n[i].a + "\t" + n[i].f); else { 14 | for (var i = 0; i < n.length; i++) f.push(n[i].n + "\t" + n[i].d + "\t" + n[i].a + "\t" + n[i].f); 15 | for (var i = 0; i < p.length; i++) f.push(p[i].n + "\t" + p[i].d + "\t" + p[i].a + "\t" + p[i].f); 16 | } 17 | window.longArray = f.sort(); 18 | } 19 | 20 | function uniq(a) { 21 | a = a.sort(); 22 | var r = [a[0]]; 23 | for (var i = 1; i < a.length; i++) { 24 | if (a[i-1] !== a[i]) { 25 | r.push(a[i]); 26 | } 27 | } 28 | return r; 29 | } 30 | 31 | 32 | function uniqd(a) { 33 | tmp = new Array(0); 34 | tmp2 = new Array(0); 35 | for(i=0;i=59){ 98 | window.sec = 0; 99 | min++; 100 | } 101 | if (min>=59){ 102 | min=0; 103 | hour++; 104 | } 105 | document.getElementById("sec").innerHTML = (window.sec < 10) ? "0" + window.sec : window.sec; 106 | document.getElementById("min").innerHTML = (min < 10) ? "0" + min : min; 107 | document.getElementById("hour").innerHTML = (hour < 10) ? "0" + hour : hour; 108 | window.clock = setTimeout("stopWatch()",1000); 109 | } 110 | 111 | function pause() { 112 | clearTimeout(window.clock); 113 | return false; 114 | } 115 | 116 | function play() { 117 | stopWatch(); 118 | return false; 119 | } 120 | 121 | function reset() { 122 | clearTimeout(window.clock); 123 | window.sec = min = hour = 0; 124 | document.getElementById("sec").innerHTML = "00"; 125 | document.getElementById("min").innerHTML = "00"; 126 | document.getElementById("hour").innerHTML = "00"; 127 | return false; 128 | } 129 | 130 | function clearTimer() { 131 | document.getElementById("timer").style.display = "none"; 132 | } 133 | 134 | function randgit() { 135 | function init(){ 136 | var number = getRandomIntInclusive(0, 60000000); 137 | console.log(number); 138 | 139 | var xhr = new XMLHttpRequest(); 140 | xhr.open('GET', 'https://api.github.com/repositories?since=' + number, true); 141 | xhr.send(); 142 | 143 | xhr.onreadystatechange = function(e){ 144 | openRepo(e, xhr) 145 | }; 146 | } 147 | 148 | function getRandomIntInclusive(min, max) { 149 | min = Math.ceil(min); 150 | max = Math.floor(max); 151 | return Math.floor(Math.random() * (max - min + 1)) + min; 152 | } 153 | 154 | function openRepo (e, xhr){ 155 | if (xhr.readyState == 4 && xhr.status == 200) { 156 | var full_name = JSON.parse(xhr.responseText)[0]['full_name']; 157 | location.href = 'https://github.com/' + full_name; 158 | } 159 | } 160 | init(); 161 | } 162 | 163 | function editNub(nub) { 164 | yub = document.getElementById("yub"); 165 | yub.value = decodeURIComponent(nub.replace(/@39@/g, "'")); 166 | yub.focus(); 167 | } 168 | 169 | -------------------------------------------------------------------------------- /js/shortcuts.js: -------------------------------------------------------------------------------- 1 | var shortcuts = [ 2 | // {"n":"db", "a":"https://dropbox.com", "d":"Dropbox"} 3 | ]; 4 | -------------------------------------------------------------------------------- /js/tips.js: -------------------------------------------------------------------------------- 1 | var tips = [ 2 | {"n":"!", "d":"Type ! before any bare url (e.g., \"google.com\") to go directly to the site"}, 3 | {"n":"calc", "d":"Calculate simple mathematical expressions"}, 4 | {"n":"==", "d":"Use with calc to test the equivalence of two expressions (e.g., \"calc (25+2)==(28-1)\")"}, 5 | {"n":">", "d":"Use with calc to test for the greater of two expressions (e.g., \"calc 8>4\")"}, 6 | {"n":"<", "d":"Use with calc to test for the lesser of two expressions (e.g., \"calc 8<4\")"}, 7 | {"n":"^", "d":"Use with calc for exponents (e.g., \"calc 5^3\")"}, 8 | {"n":"~", "d":"Use with calc to round to the nearest integer (e.g., \"calc ~32.56\")"}, 9 | {"n":"rand ", "d":"Without an argument: returns a random number between 1-100"}, 10 | {"n":"rand number", "d":"With an argument: returns a random number between 1-number"}, 11 | {"n":"whatis", "d":"Type whatis and any command to see a description of what it does"}, 12 | {"n":"where", "d":"Show full search and default URLs for any command"}, 13 | {"n":"search", "d":"Search through all commands for the given string"}, 14 | {"n":"mods", "d":"List all additional personal modules, if any"}, 15 | {"n":"dup", "d":"Check for duplicate entries"}, 16 | {"n":"pop ", "d":"Open YubSearch in a new window"}, 17 | {"n":"pop commands", "d":"Open multiple shortcuts simultaneously in different tabs (e.g., \"pop g y b\")"}, 18 | {"n":"pop commands -t searchterm", "d":"Open multiple searches for searchterm in different tabs (e.g., \"pop gim yim bim -t supernova\")"}, 19 | {"n":"pop -u urls", "d":"Open a list of urls (e.g., \"pop -u http://google.com http://yahoo.com\")"}, 20 | {"n":"tips", "d":"List all available commands"}, 21 | {"n":"ls ", "d":"Same as list"}, 22 | {"n":"ls command", "d":"Same as whatis"}, 23 | {"n":"list", "d":"Show all available shortcuts and commands"}, 24 | {"n":"count", "d":"Show a count of the total number of commands available"}, 25 | {"n":"help", "d":"Same as tips, display this help message"}, 26 | {"n":"s", "d":"Same as search"}, 27 | {"n":"c", "d":"Same as calc"}, 28 | {"n":"w", "d":"Same as whatis"}, 29 | {"n":"wh", "d":"Same as where"}, 30 | {"n":"t", "d":"Same as time"}, 31 | {"n":"day", "d":"Displays the day of the week and the ISO date for the current locale"}, 32 | {"n":"date", "d":"Same as day"}, 33 | {"n":"d", "d":"Same as date"}, 34 | {"n":"link ", "d":"Print the current url"}, 35 | {"n":"link command", "d":"Generate a permalink to the given command"}, 36 | {"n":"href", "d":"Same as link"}, 37 | {"n":"clear", "d":"Clear all output"}, 38 | {"n":"create ", "d":"Create a new command"}, 39 | {"n":"create commandname", "d":"Create a new command called commandname; will alert if command already exists"}, 40 | {"n":"shuffle ", "d":"Shuffle text randomly (default is to delimit by spaces, or tabs if present)"}, 41 | {"n":"shuffle -t delimiter", "d":"Shuffles text randomly using delimiter to separate entries"}, 42 | {"n":"sort ", "d":"Sorts text (default is to delimit by spaces, or tabs if present)"}, 43 | {"n":"sort -t delimiter", "d":"Sorts text using delimiter to separate entries"}, 44 | {"n":"uniq ", "d":"Sorts text and filters out duplicate entries (default is to delimit by spaces, or tabs if present)"}, 45 | {"n":"uniq -t delimiter", "d":"Sorts text and filters out duplicates using delimiter to separate entries"}, 46 | {"n":"uniqd ", "d":"Finds duplicates in given text (default is to delimit by spaces, or tabs if present)"}, 47 | {"n":"uniqd -t delimiter", "d":"Finds duplicates in given text using delimiter to separate entries"}, 48 | {"n":"wc ", "d":"Counts number of words in given text (default is to delimit by spaces, or tabs if present)"}, 49 | {"n":"wc -c", "d":"Counts number of characters in given text"}, 50 | {"n":"wc -t delimiter", "d":"Counts number of words in given text using delimiter to separate entries"}, 51 | {"n":"ucase", "d":"Converts text to UPPER CASE"}, 52 | {"n":"upcase", "d":"Same as ucase"}, 53 | {"n":"lcase", "d":"Converts text to lower case"}, 54 | {"n":"downcase", "d":"Same as lcase"}, 55 | {"n":"ccase", "d":"Converts text to Capital Case"}, 56 | {"n":"capcase", "d":"Same as ccase"}, 57 | {"n":"caps", "d":"Same as ccase"}, 58 | {"n":"watch", "d":"Watch a playlist of embedded videos based on the given search term"}, 59 | {"n":"ytp", "d":"YouTube Player - Same as watch"}, 60 | {"n":"whoami", "d":"Shows some information about your system"}, 61 | {"n":"rand site", "d":"Go to random site from list of shortcuts"}, 62 | {"n":"rand git", "d":"Go to random GitHub repository"}, 63 | {"n":"rand img", "d":"Go to random image"}, 64 | {"n":"random ", "d":"Same as rand"}, 65 | {"n":"echo ", "d":"Says hello"}, 66 | {"n":"echo string", "d":"Prints the given string"}, 67 | {"n":"timer", "d":"Opens a stopwatch timer"}, 68 | {"n":"stopwatch", "d":"Same as timer"}, 69 | {"n":"sticky ", "d":"An editable sticky note with local storage"}, 70 | {"n":"sticky -r", "d":"Clear sticky local storage"}, 71 | {"n":"sticky message", "d":"Open a new sticky note with the contents of message"}, 72 | {"n":"notepad", "d":"Opens a editable lined notepad with persistent local storage"}, 73 | {"n":"notepad -r", "d":"Clear notepad local storage"}, 74 | {"n":">", "d":"Redirect any command to first Google search result (e.g. > wpde Battle of Hastings)"}, 75 | {"n":"time ", "d":"Print the current local time and date"}, 76 | {"n":"time locale", "d":"Print the current time and date formatted for a specific language or locale"} 77 | ]; 78 | -------------------------------------------------------------------------------- /spa/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | yub.js | web command-line 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 32 | 33 | 34 |
35 |
36 |

yub.js

37 |

web command-line

38 |
39 | 40 | 41 |

type 'list' to see all available search shortcuts, or 'tips' for more commands

42 |
43 |
44 |
 
45 |
46 | 47 | 59 | 60 |
61 | 71 |
72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /spa/index_src.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | yub.js | web command-line 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 1025 | 1026 | 1027 |
1028 |
1029 |

yub.js

1030 |

web command-line

1031 |
1032 | 1033 | 1034 |

type 'list' to see all available search shortcuts, or 'tips' for more commands

1035 |
1036 |
1037 |
 
1038 |
1039 | 1040 | 1052 | 1053 |
1054 | 1064 |
1065 | 1066 | 1067 | 1068 | -------------------------------------------------------------------------------- /spa/mergemin.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/ruby 2 | 3 | require 'erb' 4 | require 'uglifier' 5 | 6 | merge = File.open("index_src.html", "w") 7 | min = File.open("index.html", "w") 8 | 9 | # # merge to single-page html file 10 | 11 | # $nub = File.read("../css/default.css") 12 | $commands = File.read("../js/commands.js") 13 | $engines = File.read("../js/engines.js") 14 | $functions = File.read("../js/functions.js") 15 | $mods = File.read("../js/mods.js") 16 | # $shortcuts = File.read("../js/shortcuts.js") 17 | $tips = File.read("../js/tips.js") 18 | 19 | content = ERB.new(File.read("template.rhtml")).result 20 | 21 | merge << content 22 | 23 | 24 | # # minify to compressed standalone version 25 | 26 | # $nub = File.read("../css/default.css") 27 | $commands = Uglifier.compile(File.read("../js/commands.js")) 28 | $engines = Uglifier.compile(File.read("../js/engines.js")) 29 | $functions = Uglifier.compile(File.read("../js/functions.js")) 30 | # $mods = Uglifier.compile(File.read("../js/mods.js")) 31 | # $shortcuts = File.read("../js/shortcuts.js") 32 | $tips = Uglifier.compile(File.read("../js/tips.js")) 33 | 34 | content = ERB.new(File.read("template.rhtml")).result 35 | 36 | min << content 37 | -------------------------------------------------------------------------------- /spa/template.rhtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | yub.js | web command-line 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 32 | 33 | 34 |
35 |
36 |

yub.js

37 |

web command-line

38 |
39 | 40 | 41 |

type 'list' to see all available search shortcuts, or 'tips' for more commands

42 |
43 |
44 |
 
45 |
46 | 47 | 59 | 60 |
61 | 71 |
72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | yub.js 4 | yub.js Web Command-line 5 | 7 | https://dohliam.github.io/yub/favicon.ico?v=2 8 | 9 | --------------------------------------------------------------------------------