├── .editorconfig ├── .gitignore ├── .jshintrc ├── .travis.yml ├── README.md ├── app-config.yml ├── build-files.yml ├── build.yml ├── configure ├── config.js └── index.tmpl ├── font ├── entypo.css ├── entypo.eot ├── entypo.svg ├── entypo.ttf └── entypo.woff ├── gruntfile.js ├── images ├── arrow.gif ├── b_background_sel.gif ├── b_background_sel2.gif ├── b_background_unsel.gif ├── cross.gif ├── empty_favicon.ico ├── favicon.png ├── hs.png ├── hv.png ├── icon.png ├── loading.gif ├── qwebircsmall.png ├── ui-icons_222222_256x240.png ├── ui-icons_2e83ff_256x240.png ├── ui-icons_454545_256x240.png ├── ui-icons_888888_256x240.png └── ui-icons_cd0a0a_256x240.png ├── js ├── libs │ ├── .jshintrc │ ├── 1mootools-more+clientside+bootstrap.js │ ├── Element.position.js │ ├── Elements.from.js │ ├── Epitome │ │ ├── 1epitome-events.js │ │ ├── 2epitome.js │ │ ├── 3epitome-isequal.js │ │ ├── 4epitome-model.js │ │ ├── epitome-model-storage.js │ │ ├── epitome-router.js │ │ ├── epitome-view.js │ │ └── unused │ │ │ ├── epitome-collection-sync.js │ │ │ ├── epitome-collection.js │ │ │ ├── epitome-model-sync.js │ │ │ ├── epitome-router.js │ │ │ ├── epitome-storage.js │ │ │ └── epitome-template.js │ ├── Fx.Scroll.js │ ├── Storage.js │ ├── console-shim.js │ ├── notifications.js │ └── underscore-mixin.js ├── modules │ ├── Handlebars-production.js │ ├── Promise.js │ ├── jscolor.js │ ├── mootools-1.4.5.js │ ├── one-color.js │ ├── respond.js │ ├── soundmanager2.js │ └── underscore.js └── src │ ├── Interface.js │ ├── components │ ├── Asset.js │ ├── AutoScroll.js │ ├── Completer.js │ ├── ImagePopover.js │ ├── Popups.js │ ├── Urlerizer.js │ └── colourise.js │ ├── config │ ├── commands.js │ ├── irc-mode-status.js │ ├── options.js │ ├── registeredCTCP.js │ ├── settings.js │ └── theme-templates.js │ ├── constants │ ├── constants.js │ ├── irc_lowertable.js │ └── irc_numerics.js │ ├── irc │ ├── Client.js │ ├── CommandHistory.js │ ├── Connection.js │ ├── ICommands.js │ ├── IRC_Error.js │ ├── IRC_Replies.js │ ├── IRC_Response.js │ ├── Tracker.js │ ├── atheme.js │ └── irc_Whois.js │ ├── qwebirc.js │ ├── ready.js │ ├── ui │ ├── QUI.js │ ├── StandardUI.js │ ├── Tabbar.js │ ├── Theme.js │ ├── interfaces │ │ ├── IKeyboard.js │ │ ├── ILogin.js │ │ ├── IRCClient-Adapter.js │ │ ├── IUIOptions.js │ │ ├── IWindows.js │ │ └── Notifiers.js │ ├── panes │ │ ├── ChannelList.js │ │ ├── PanelView.js │ │ ├── PrivacyPolicy.js │ │ ├── ToggleDesktopNotifications.js │ │ ├── about.js │ │ ├── faq.js │ │ ├── feedback.js │ │ ├── options.js │ │ ├── welcome.js │ │ └── wizard.js │ ├── sounds.js │ └── window │ │ ├── BaseWindow.js │ │ ├── IDetachable.js │ │ └── QUI.Window.js │ └── util │ ├── IRCProcessors.js │ ├── Monkey-patches.js │ ├── Templates.js │ ├── irc-utils.js │ ├── lang.js │ ├── uihelpers.js │ ├── urlifier.js │ └── utils.js ├── lang ├── Readme.md ├── base.json └── panes │ ├── channels │ └── base.json │ ├── options │ ├── base.json │ └── en-US.json │ └── welcome │ └── base.json ├── less ├── .csscomb.json ├── .csslintrc ├── bootstrap.less ├── qwebirc.less ├── qwebirc │ ├── bootstrap-theme.less │ ├── core.less │ ├── detached-window.less │ ├── image-popover.less │ ├── input.less │ ├── irc-colours.less │ ├── irc-op-status.less │ ├── jQuery-Icons.less │ ├── loginbox.less │ ├── panels.less │ ├── qui.less │ ├── tabbar.less │ └── variables.less └── twbs │ ├── alerts.less │ ├── badges.less │ ├── breadcrumbs.less │ ├── button-groups.less │ ├── buttons.less │ ├── carousel.less │ ├── close.less │ ├── code.less │ ├── component-animations.less │ ├── dropdowns.less │ ├── forms.less │ ├── glyphicons.less │ ├── grid.less │ ├── input-groups.less │ ├── jumbotron.less │ ├── labels.less │ ├── list-group.less │ ├── media.less │ ├── mixins.less │ ├── modals.less │ ├── navbar.less │ ├── navs.less │ ├── normalize.less │ ├── pager.less │ ├── pagination.less │ ├── panels.less │ ├── popovers.less │ ├── print.less │ ├── progress-bars.less │ ├── responsive-utilities.less │ ├── scaffolding.less │ ├── tables.less │ ├── thumbnails.less │ ├── tooltip.less │ ├── type.less │ ├── utilities.less │ ├── variables.less │ └── wells.less ├── licence.lic ├── mcss ├── Readme.md └── qui-modifiable-css.hbs ├── package.json ├── panes ├── about.hbs ├── channel-list.hbs ├── faq.hbs ├── feedback.hbs ├── options.hbs ├── partials │ ├── channel-list-content.hbs │ └── customNotice.hbs ├── privacypolicy.hbs └── wizard.hbs ├── sound ├── beep.mp3 ├── beep.ogg ├── beep.wav ├── readme.md ├── smb3_fireball.mp3 ├── smb3_fireball.ogg ├── smb3_fireball.wav ├── smb3_frog_mario_walk.mp3 ├── smb3_frog_mario_walk.ogg ├── smb3_frog_mario_walk.wav ├── smb_coin.mp3 ├── smb_coin.ogg ├── smb_coin.wav ├── smb_kick.mp3 ├── smb_kick.ogg ├── smb_kick.wav ├── smb_pause.mp3 ├── smb_pause.ogg ├── smb_pause.wav ├── smw_spring_jump.mp3 ├── smw_spring_jump.ogg ├── smw_spring_jump.wav ├── smw_stomp.mp3 ├── smw_stomp.ogg └── smw_stomp.wav ├── swf ├── WebSocketMain.swf ├── soundmanager2.swf ├── soundmanager2_debug.swf └── soundmanager2_flash9.swf ├── templates ├── amd │ ├── popup-alert.hbs │ ├── popup-dialog.hbs │ └── welcome-pane.hbs ├── authpage.hbs ├── channelName.hbs ├── customlink.hbs ├── detachedWindow.hbs ├── failed-validator.hbs ├── image-popover.hbs ├── ircInput.hbs ├── ircMessage.hbs ├── ircTab.hbs ├── ircnick.hbs ├── ircstyle.hbs ├── loadingPage.hbs ├── mainmenu.hbs ├── menubtn.hbs ├── menuitem.hbs ├── navbar.hbs ├── nickMenu.hbs ├── nickbtn.hbs ├── nickmenubtn.hbs ├── qwebirc-layout.hbs ├── status.hbs ├── topicText.hbs ├── userlink.hbs ├── window-container.hbs └── window.hbs └── test ├── .jshintrc ├── Elements.from.js ├── Monkey-patches.js ├── irc-parser.js ├── irc-styles.js ├── options.js ├── qwebirc.js ├── server ├── .jshintrc ├── run.js └── server.js ├── test-runner.html ├── ui.js ├── url-format.js └── utils.js /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: http://EditorConfig.org 2 | 3 | # top-most EditorConfig file 4 | root = true 5 | 6 | # Unix-style newlines with a newline ending every file 7 | [*] 8 | insert_final_newline = true 9 | indent_style = space 10 | indent_size = 4 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | #Compiled Resources 2 | index.html 3 | dist 4 | templates/modifiablecss.hbs 5 | *.log 6 | 7 | # cool analysis tool https://github.com/es-analysis/plato 8 | report 9 | 10 | #Standard stuff 11 | *.sublime* 12 | *.dropbox 13 | node_modules/ 14 | **/unused/** 15 | 16 | # Compiled source # 17 | ################### 18 | *.com 19 | *.class 20 | *.dll 21 | *.exe 22 | *.o 23 | *.so 24 | 25 | # Packages # 26 | ############ 27 | # it's better to unpack these files and commit the raw source 28 | # git has its own built in compression methods 29 | *.7z 30 | *.dmg 31 | *.gz 32 | *.iso 33 | *.jar 34 | *.rar 35 | *.tar 36 | *.zip 37 | 38 | # Logs and databases # 39 | ###################### 40 | *.log 41 | *.sql 42 | *.sqlite 43 | 44 | # OS generated files # 45 | ###################### 46 | .DS_Store 47 | .DS_Store? 48 | ._* 49 | .Spotlight-V100 50 | .Trashes 51 | ehthumbs.db 52 | Thumbs.db -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | // JSHint linting config 3 | // Example: https://github.com/jshint/jshint/blob/master/examples/.jshintrc 4 | // Documentation: http://www.jshint.com/docs/options/ 5 | "globals": { 6 | //Polyfilled 7 | "Promise": true, 8 | 9 | //Mootools 10 | "Browser": true, 11 | "Elements": true, 12 | "Class": true, 13 | "Options": true, 14 | "Events": true, 15 | "Request": true, 16 | "Type": true, 17 | "typeOf": true, 18 | "Fx": true, 19 | "$": true, 20 | "$$": true, 21 | "Asset": true, 22 | "Storage": true, 23 | "Color": true, 24 | 25 | //libs 26 | "_": true, 27 | "Epitome": true, 28 | "Bootstrap": true, 29 | "Base64": true, 30 | "notify": true, 31 | "one": true, 32 | 33 | //Qwebirc 34 | "qwebirc": true, 35 | "ui": true, 36 | "irc": true, 37 | "util": true, 38 | "lang": true, 39 | "sound": true, 40 | "templates": true, 41 | "config": true, 42 | "cookies": true, 43 | "constants": true, 44 | "windowNames": true, 45 | "components": true, 46 | "PanelView": true, 47 | 48 | //Locals 49 | "DEBUG": true 50 | }, 51 | 52 | "browser": true, 53 | "mootools": true, 54 | "esnext": true, 55 | "globalstrict": false, 56 | "strict": false,//strict declared at top 57 | "devel": true, 58 | 59 | "smarttabs": true, 60 | "trailing": true, 61 | "indent": 4, 62 | "quotmark": "double", 63 | 64 | "unused": true, 65 | "undef": true, 66 | "eqnull": true, 67 | "immed": true, 68 | "noarg": true, 69 | "freeze": false, 70 | "maxcomplexity": 10, 71 | 72 | "lastsemic": true, 73 | "laxcomma": false, 74 | 75 | "newcap": true, 76 | "nonew": false 77 | } -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.11 4 | notifications: 5 | email: false 6 | before_script: 7 | - npm install -g grunt-cli -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | qwebirc-mods [![Build Status](https://travis-ci.org/megawac/qwebirc-enhancements.svg)](https://travis-ci.org/megawac/qwebirc-enhancements) 2 | ============= 3 | 4 | 5 | Qwebirc is intended to be a simple, intuitive and feature rich IRC client that operates out of the browser. This spiritual *fork* of Chris Porter's [qwebirc](http://qwebirc.org/) is a complete rewrite of the project in order to introduce more customability, add features introduced with HTML5, improve the extensibility of the code and revamp the ui (still qui). I began this project when I became frustrated trying to create a plugin atop of Qwebirc; flexibility and extensibility are two of the main focuses of the changes. I have also added multiple features, made code quality improvements, bug fixes, etc. Here's a ([Screenshot](http://puu.sh/4ANPf.png) [Screenshot 2](http://i.imgur.com/9Cee1iO.jpg)) of a live instance. 6 | 7 | **This is undergoing active development - a RC build is being staged** 8 | 9 | ## Installation: 10 | 11 | - Install [node.js](http://nodejs.org) 12 | - Configure the qwebirc instance settings as described in [configuration](#configuration) 13 | - Install development build dependencies using `npm install` in the base folder (reads in package.json) 14 | - Run `grunt` to build static files 15 | - Start up a [iris or qwebirc](#server) with this repo's static files see [#server](#server). For testing I personally use the server in [`test/server`](https://github.com/megawac/qwebirc-enhancements/blob/master/test/server/run.js) with the `base_url` set to a live instance 16 | 17 | #### Making changes 18 | After making changes to source files run in the base directory and run `grunt` in the command line to recompile resources. 19 | 20 | ### Configuration 21 | You can set compile settings either in the gruntfile manually or setting the compile presets in [`app-config.yml`](https://github.com/megawac/qwebirc-enhancements/blob/master/app-config.yml) and [`build.yml`](https://github.com/megawac/qwebirc-enhancements/blob/master/build.yml). A similar build step to the old `compile.py` build is in the works (see #17) 22 | 23 | Making changes to most source files will require you to rebuild via `grunt` 24 | 25 | ####TODOs: 26 | * Add options for: 27 | * (mid) configure hotkeys 28 | * (major) Refactor python compile code to call appropriate Grunt build and set app options (#17) 29 | 30 | 31 | ##Server: 32 | Requires a light modification of either qwebirc or iris in order to support localization and switching the index file to `static.html`. See commits below if you don't want to use [my server fork](https://github.com/megawac/iris) 33 | - Compile: [`ffba0d7b2772d2`](https://github.com/megawac/iris/commit/ffba0d7b2772d2a26dcd47a4f941f6b020e52254) 34 | - Set index.html: [`83e67bf4b236e`](https://github.com/megawac/iris/commit/83e67bf4b236e532dcdcc7a8c9e6b7cb9f6ee4d9) 35 | - Localization engine: [`fed82b8a6a4c9`](https://github.com/megawac/iris/commit/fed82b8a6a4c9168fda4ee12a657fde5bddfc337) 36 | 37 | #### Twisted (or Iris) 38 | I have an instance of the code running over twisted on the Geeks-IRC network at [atf2.org](http://atf2.org/) 39 | -------------------------------------------------------------------------------- /app-config.yml: -------------------------------------------------------------------------------- 1 | ## Front end settings that will be plugged in to configure/config.js (if you decide to only use provided customizations) 2 | ## You can update config.js to suit your needs 3 | ## These settings will be injected into qwebirc.js where appropriate and into the config intialization 4 | ## These will be compliled using lodash templates (see http://lodash.com/docs#template) with this file as the object 5 | 6 | #default network name 7 | network: "ChatNet" 8 | 9 | init_config: 10 | networkName: "<%= network %>" #eg Freenode 11 | appTitle: "<%= network %> WebIRC" #eg Freenode WebIRC 12 | uiOptions: #set any of the defaults values in js/src/config/options.js -- may be overriden by user 13 | colour: #hex values 14 | background: #"f0f7ff" 15 | font: #"000" 16 | brouhaha: 17 | enabled: false #no aggregator by default 18 | quit_msg: Page closed 19 | highlight: true # highlight messages 20 | beep_sound: #beep -- any of the sounds specified below 21 | 22 | client: 23 | loginRegex: "I recogni[sz]e you" #authed when this test passes on a message from a network service 24 | networkServices: 25 | #network hosts ie Services.Quakenet.net 26 | #- Services.Quakenet.net 27 | 28 | settings: #default (initial) user settings 29 | nickname: #"" 30 | username: #"" 31 | password: #"" 32 | channels: #[] 33 | auth: #false 34 | #demand authentication -- not setable by user 35 | requireAuth: false #require authentication? 36 | parseQueryString: true #should the query string be parse for option presets see https://github.com/megawac/qwebirc-enhancements#configuration 37 | 38 | user_settings: 39 | welcome_message: true #show a welcome message on first visit? 40 | 41 | qwebirc_config: #random variables you may wish to settings 42 | auth_command: #defaults to "AUTHSERV AUTH {username} {password}" though I've seen many different commands 43 | 44 | password_format: "{username} {password}" #for instance "{password}" 45 | 46 | base_url: / 47 | static_url: / 48 | 49 | router_prefix: ! #the hash prepended to urls starts with this string 50 | 51 | timeout: #timeout requests after period 52 | 53 | #for instance google analytics code. Below is jsdelivr tracking https://github.com/jsdelivr/jsdelivr#contribute-performance-data 54 | extra_html: 55 | templates: ## any data you would like to prefill the handlebars templates 56 | feedback_form_url: https://docs.google.com/forms/d/1DQUg-DOEMbmqqeCryhMr6t20m2EMSkng28HdWIUm2vM/viewform 57 | 58 | sounds: #supported sounds requires a mp3 and ogg file for each in /sound/ 59 | - beep 60 | - smb_coin 61 | - smb_kick 62 | - smb_pause 63 | - smb3_fireball 64 | - smb3_frog_mario_walk 65 | - smw_spring_jump 66 | - smw_stomp 67 | -------------------------------------------------------------------------------- /build-files.yml: -------------------------------------------------------------------------------- 1 | { 2 | "templates": { 3 | "qwebirc": "dist/templates/qwebirc.js", 4 | "main": { 5 | "dist/templates/qwebirc.js": "templates/**.hbs" 6 | }, 7 | "panes": { 8 | "dist/templates/options.js": ["panes/options.hbs", "panes/partials/customNotice.hbs"], 9 | "dist/templates/channel-list.js": ["panes/channel-list.hbs", "panes/partials/channel-list-content.hbs"], 10 | "dist/templates/wizard.js": ["panes/wizard.hbs"], 11 | "dist/templates/feedback.js": ["panes/feedback.hbs"], 12 | "dist/templates/about.js": ["panes/about.hbs"], 13 | "dist/templates/faq.js": ["panes/faq.hbs"], 14 | "dist/templates/privacypolicy.js": ["panes/privacypolicy.hbs"], 15 | "dist/templates/popup-alert.js": ["templates/amd/popup-alert.hbs"], 16 | "dist/templates/popup-dialog.js": ["templates/amd/popup-dialog.hbs"], 17 | "dist/templates/welcome-pane.js": ["templates/amd/welcome-pane.hbs"] 18 | } 19 | }, 20 | "modules": [ 21 | "js/modules/respond.js", 22 | "js/modules/mootools-1.4.5.js", 23 | "js/modules/Handlebars-production.js", 24 | "js/modules/Promise.js", 25 | "js/modules/underscore.js", 26 | "js/modules/one-color.js" 27 | ], 28 | "plugins": [ 29 | "js/libs/*.js", 30 | "js/libs/Epitome/*.js" 31 | ], 32 | "full": [ 33 | "dist/js/plugins<%= suffix %>.js", 34 | "dist/js/templates<%= suffix %>.js", 35 | "dist/js/qwebirc<%= suffix %>.js" 36 | ], 37 | 38 | "resources": { 39 | "qwebirc templates": { 40 | "local": "dist/dist/templates<%= suffix %>.js" 41 | }, 42 | 43 | "qwebirc css": { 44 | "local": "dist/css/qwebirc<%= suffix %>.css" 45 | }, 46 | "bootstrap css": { 47 | "local": "dist/css/bootstrap-<%= pkg['frontend-dependencies'].twbs.version %>.css" 48 | }, 49 | "soundManager": { 50 | "cdn": "//cdn.jsdelivr.net/soundmanager2/2.97a.20130512/soundmanager2-nodebug-jsmin.js", 51 | "local": "js/modules/soundmanager2.js" 52 | }, 53 | "modules": { 54 | # not including soundManager2 here so users can disable sound and not load code 55 | "cdn": "//cdn.jsdelivr.net/g/respond@1.4,mootools@1.4.5,handlebarsjs@1.3,es6-promise,underscorejs@1.6,one-color@2.4", 56 | "local": "dist/js/modules<%= suffix %>.js" 57 | }, 58 | "entypo": { 59 | "cdn": "//cdn.jsdelivr.net/entypo-fontello/0.1/entypo.css", 60 | "local": "font/entypo.css" 61 | }, 62 | "jQuery-images": { 63 | "cdn": "//ajax.googleapis.com/ajax/libs/jqueryui/1.8.7/themes/smoothness/images", 64 | "local": "images" 65 | } 66 | } 67 | } -------------------------------------------------------------------------------- /build.yml: -------------------------------------------------------------------------------- 1 | { 2 | #minify source files? 3 | "minify": false, 4 | # compile all local source files into a large file 5 | # Note: according to html5 rocks the optimal script size (for caching) is <125 kB 6 | # I've set up the build scripts with this in mind so `concat` may not be recommended 7 | # see https://hacks.mozilla.org/2012/12/fantastic-front-end-performance-part-1-concatenate-compress-cache-a-node-js-holiday-season-part-4/ 8 | "concat": false, 9 | # Load resources off of a top-tier CDN where possible - otherwise going to build a modules.js file 10 | # see http://www.sitepoint.com/7-reasons-to-use-a-cdn/ 11 | "use cdn": true, 12 | 13 | #give stats on build (gzip size) - significantly slows down the build 14 | "report": false, 15 | 16 | # Does your server support Atheme RPC services (currently only using channel lists) 17 | "atheme": false, 18 | 19 | # In debug mode? console debug statements may be outputted 20 | "debug": true 21 | } -------------------------------------------------------------------------------- /configure/config.js: -------------------------------------------------------------------------------- 1 | /****************************************************************** 2 | Init config -- compiled settings from ../app-config.yml 3 | 4 | To create a new instance call `qwebirc.createInstance([element or id], [ui class (eg qui)], options) 5 | 6 | The configurable options are shown in: https://github.com/megawac/qwebirc-enhancements/blob/master/js/src/ui/Interface.js#L2 7 | 8 | settings (eg nick) are here: https://github.com/megawac/qwebirc-enhancements/blob/master/js/src/config/settings.js#L6 9 | 10 | uiOptions are here: https://github.com/megawac/qwebirc-enhancements/blob/master/js/src/config/options.js#L3 11 | 12 | IRC client options are here: https://github.com/megawac/qwebirc-enhancements/blob/master/js/src/irc/ircclient.js#L5 13 | 14 | You can also make custom changes here such as adjusting the servers commands (eg auth) 15 | 16 | 17 | This file will be minified and moved to js/dist/app-version.js on build 18 | 19 | ******************************************************************/ 20 | 21 | this.app = qwebirc.createInstance("ircui", <%= serialize(config.init_config) %>); -------------------------------------------------------------------------------- /configure/index.tmpl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | <% if(config.network) { %><%= config.network %> <% } %>WebIRC Using QWebirc v<%= pkg.version %> 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 |
35 | 40 |
41 | 42 | <%= config.qwebirc_config.extra_html %> 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /font/entypo.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'EntypoRegular'; 3 | src: url('./entypo.eot'); 4 | src: url('./entypo.eot?#iefix') format('embedded-opentype'), 5 | url('./entypo.woff') format('woff'), 6 | url('./entypo.ttf') format('truetype'), 7 | url('./entypo.svg#EntypoRegular') format('svg'); 8 | font-weight: normal; 9 | font-style: normal; 10 | } 11 | .entypo { 12 | font-family: 'EntypoRegular'; 13 | font-size: 2em; 14 | font-weight: normal; 15 | line-height: 0; 16 | } -------------------------------------------------------------------------------- /font/entypo.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megawac/qwebirc-enhancements/d04252a7ccfca6c1119f40f0f9082d875751b0e7/font/entypo.eot -------------------------------------------------------------------------------- /font/entypo.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megawac/qwebirc-enhancements/d04252a7ccfca6c1119f40f0f9082d875751b0e7/font/entypo.ttf -------------------------------------------------------------------------------- /font/entypo.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megawac/qwebirc-enhancements/d04252a7ccfca6c1119f40f0f9082d875751b0e7/font/entypo.woff -------------------------------------------------------------------------------- /images/arrow.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megawac/qwebirc-enhancements/d04252a7ccfca6c1119f40f0f9082d875751b0e7/images/arrow.gif -------------------------------------------------------------------------------- /images/b_background_sel.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megawac/qwebirc-enhancements/d04252a7ccfca6c1119f40f0f9082d875751b0e7/images/b_background_sel.gif -------------------------------------------------------------------------------- /images/b_background_sel2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megawac/qwebirc-enhancements/d04252a7ccfca6c1119f40f0f9082d875751b0e7/images/b_background_sel2.gif -------------------------------------------------------------------------------- /images/b_background_unsel.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megawac/qwebirc-enhancements/d04252a7ccfca6c1119f40f0f9082d875751b0e7/images/b_background_unsel.gif -------------------------------------------------------------------------------- /images/cross.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megawac/qwebirc-enhancements/d04252a7ccfca6c1119f40f0f9082d875751b0e7/images/cross.gif -------------------------------------------------------------------------------- /images/empty_favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megawac/qwebirc-enhancements/d04252a7ccfca6c1119f40f0f9082d875751b0e7/images/empty_favicon.ico -------------------------------------------------------------------------------- /images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megawac/qwebirc-enhancements/d04252a7ccfca6c1119f40f0f9082d875751b0e7/images/favicon.png -------------------------------------------------------------------------------- /images/hs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megawac/qwebirc-enhancements/d04252a7ccfca6c1119f40f0f9082d875751b0e7/images/hs.png -------------------------------------------------------------------------------- /images/hv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megawac/qwebirc-enhancements/d04252a7ccfca6c1119f40f0f9082d875751b0e7/images/hv.png -------------------------------------------------------------------------------- /images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megawac/qwebirc-enhancements/d04252a7ccfca6c1119f40f0f9082d875751b0e7/images/icon.png -------------------------------------------------------------------------------- /images/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megawac/qwebirc-enhancements/d04252a7ccfca6c1119f40f0f9082d875751b0e7/images/loading.gif -------------------------------------------------------------------------------- /images/qwebircsmall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megawac/qwebirc-enhancements/d04252a7ccfca6c1119f40f0f9082d875751b0e7/images/qwebircsmall.png -------------------------------------------------------------------------------- /images/ui-icons_222222_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megawac/qwebirc-enhancements/d04252a7ccfca6c1119f40f0f9082d875751b0e7/images/ui-icons_222222_256x240.png -------------------------------------------------------------------------------- /images/ui-icons_2e83ff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megawac/qwebirc-enhancements/d04252a7ccfca6c1119f40f0f9082d875751b0e7/images/ui-icons_2e83ff_256x240.png -------------------------------------------------------------------------------- /images/ui-icons_454545_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megawac/qwebirc-enhancements/d04252a7ccfca6c1119f40f0f9082d875751b0e7/images/ui-icons_454545_256x240.png -------------------------------------------------------------------------------- /images/ui-icons_888888_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megawac/qwebirc-enhancements/d04252a7ccfca6c1119f40f0f9082d875751b0e7/images/ui-icons_888888_256x240.png -------------------------------------------------------------------------------- /images/ui-icons_cd0a0a_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megawac/qwebirc-enhancements/d04252a7ccfca6c1119f40f0f9082d875751b0e7/images/ui-icons_cd0a0a_256x240.png -------------------------------------------------------------------------------- /js/libs/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | // JSHint linting config 3 | // Example: https://github.com/jshint/jshint/blob/master/examples/.jshintrc 4 | // Documentation: http://www.jshint.com/docs/options/ 5 | "globals": { 6 | 7 | //Mootools 8 | "Browser": true, 9 | "Elements": true, 10 | "Class": true, 11 | "Options": true, 12 | "Events": true, 13 | "Request": true, 14 | "Type": true, 15 | "typeOf": true, 16 | "Fx": true, 17 | "$": true, 18 | "$$": true, 19 | 20 | //libs 21 | "_": true, 22 | "Epitome": true, 23 | "Bootstrap": true, 24 | 25 | //Qwebirc 26 | "qwebirc": true, 27 | "ui": true, 28 | "irc": true, 29 | "util": true, 30 | "lang": true, 31 | "templates": true, 32 | "config": true, 33 | "cookies": true 34 | }, 35 | 36 | "browser": true, 37 | "esnext": true, 38 | "globalstrict": false, 39 | "strict": false,//strict declared at top 40 | 41 | "smarttabs": true, 42 | "trailing": true, 43 | "indent": 4, 44 | 45 | "unused": true, 46 | "undef": true, 47 | "eqnull": true, 48 | "immed": true, 49 | "noarg": true, 50 | "freeze": false, 51 | 52 | "lastsemic": true, 53 | "laxcomma": false, 54 | 55 | "newcap": true, 56 | "nonew": false 57 | } -------------------------------------------------------------------------------- /js/libs/Elements.from.js: -------------------------------------------------------------------------------- 1 | /* 2 | --- 3 | 4 | script: Elements.From.js 5 | 6 | name: Elements.From 7 | 8 | description: Returns a collection of elements from a string of html. 9 | 10 | license: MIT-style license 11 | 12 | authors: 13 | - Aaron Newton 14 | - adapted by Graeme Yeates 15 | 16 | requires: 17 | - Core/String 18 | - Core/Element 19 | - /MooTools.More 20 | 21 | provides: [Elements.from, Elements.From] 22 | 23 | ... 24 | */ 25 | (function() { 26 | var range; 27 | 28 | window.addEvent('domready', function(){ 29 | range = document.createRange && document.createRange(); 30 | if(range && range.createContextualFragment) { //ie >= 9 31 | range.selectNode(document.getElement('div')); 32 | } else { 33 | range = null; 34 | } 35 | }); 36 | 37 | Elements.from = function(text, excludeScripts){ 38 | if (excludeScripts || excludeScripts == null) text = text.stripScripts(); 39 | 40 | // var match = text.match(/^\s*<(t[dhr]|tbody|tfoot|thead)/i); 41 | // if(match) {//table fix 42 | // var container = new Element('table'); 43 | // var tag = match[1].toLowerCase(); 44 | // if (['td', 'th', 'tr'].contains(tag)){ 45 | // container = new Element('tbody').inject(container); 46 | // if (tag != 'tr') container = new Element('tr').inject(container); 47 | // } 48 | // return new Elements(container.set('html', text).childNodes); 49 | // } 50 | 51 | return new Elements((range ? range.createContextualFragment(text) : //use faster range if available 52 | new Element('div').set('html', text)).childNodes); 53 | }; 54 | })(); 55 | 56 | Element.extend({ 57 | from: function(text, es) { 58 | return Elements.from(text, es)[0]; 59 | } 60 | }); -------------------------------------------------------------------------------- /js/libs/Epitome/2epitome.js: -------------------------------------------------------------------------------- 1 | ;(function(){ 2 | 'use strict'; 3 | 4 | var obj, 5 | wrap = function(Events){ 6 | var e = new Events(); 7 | e.Events = Events; 8 | return e; 9 | }; 10 | 11 | // by default, requiring Epitome returns an Epitome.Events instance as a mediator 12 | if (typeof define === 'function' && define.amd){ 13 | // returns an empty module 14 | define(['./epitome-events'], wrap); 15 | } 16 | else if (typeof module !== 'undefined' && module.exports){ 17 | // CommonJS module is defined 18 | // load mootools-core npm 19 | require('mootools'); 20 | 21 | obj = wrap(require('./epitome-events')); 22 | 23 | // export all sub modules that work w/o a browser. 24 | obj.Model = require('./epitome-model'); 25 | obj.Collection = require('./epitome-collection'); 26 | obj.isEqual = require('./epitome-isequal'); 27 | obj.Template = require('./epitome-template'); 28 | 29 | module.exports = obj; 30 | } 31 | else { 32 | this.Epitome = wrap(this.Epitome.Events); 33 | } 34 | }.call(this)); -------------------------------------------------------------------------------- /js/libs/Epitome/3epitome-isequal.js: -------------------------------------------------------------------------------- 1 | ;(function(){ 2 | 'use strict'; 3 | 4 | // wrapper function for requirejs or normal object 5 | var wrap = function(){ 6 | 7 | return _.isEqual; 8 | }; // end wrap 9 | 10 | if (typeof define === 'function' && define.amd){ 11 | define(['./epitome'], wrap); 12 | } 13 | else if (typeof module !== 'undefined' && module.exports){ 14 | require('mootools'); 15 | module.exports = wrap(); 16 | } 17 | else { 18 | this.Epitome || (this.Epitome = {}); 19 | this.Epitome.isEqual = wrap(this.Epitome); 20 | } 21 | }.call(this)); -------------------------------------------------------------------------------- /js/libs/Epitome/epitome-model-storage.js: -------------------------------------------------------------------------------- 1 | ; (function() { 2 | "use strict"; 3 | 4 | // wrapper function for requirejs or normal object 5 | var wrap = function(Model) { 6 | 7 | // decorate the original object by adding a new property Sync 8 | return new Class({ 9 | Extends: Model, 10 | 11 | properties: { 12 | //storage/// 13 | }, 14 | 15 | options: { 16 | storage: { 17 | duration: 365, 18 | domain: "/", 19 | fallback: true, 20 | storageType: "localStorage" 21 | }, 22 | key: undefined, 23 | minimize: false 24 | }, 25 | 26 | initialize: function(obj, options) { 27 | // needs to happen first before events are added, 28 | // in case we have custom accessors in the model object. 29 | this.setOptions(options); 30 | if(!this.options.key) 31 | throw("Initiated without storage key (options.key)"); 32 | if(!this.properties.storage) 33 | this.properties.storage = new Storage(this.options.storage); 34 | this.parent(obj, this.options); 35 | this.setupSync(); 36 | }, 37 | 38 | //revert or update changes to Model 39 | sync: function() { 40 | var oldattrs = this._attributes, 41 | attrs = Object.append({}, this.options.defaults, this.properties.storage.get(this.options.key)); 42 | 43 | //update props 44 | Object.each(attrs, function(val, key) { 45 | if(!Epitome.isEqual(oldattrs[key], val)) { 46 | this.set(key, val); 47 | } 48 | }, this); 49 | 50 | //no longer set properties 51 | Object.keys(oldattrs).each(function(key) { 52 | if(!attrs.hasOwnProperty(key)) { 53 | this.unset(key); 54 | } 55 | }); 56 | 57 | this.trigger("sync"); 58 | return this; 59 | }, 60 | 61 | setupSync: function() { 62 | Object.each(this.properties.storage.get(this.options.key), function(item, key) { 63 | this.set(key, item); 64 | }, this); 65 | return this.fireEvent("init"); 66 | }, 67 | 68 | save: function(val) { 69 | if(this.validate()) { 70 | var data = this.options.minimize ? Object.filter(this._attributes, this._filter, this) : this._attributes; 71 | this.properties.storage.set(this.options.key, data); 72 | this.trigger("save"); 73 | } 74 | return this; 75 | }, 76 | 77 | _filter: function(val, key) { 78 | return !Epitome.isEqual(val, this.options.defaults[key]);//dont store defaults if minimize is true 79 | }, 80 | 81 | clear: function() { 82 | this.properties.storage.remove(this.options.key); 83 | }, 84 | 85 | destroy: function() { 86 | // destroy the model and the storage space 87 | this.clear(); 88 | return this.parent(); 89 | } 90 | }); 91 | }; // end wrap 92 | if (typeof define === "function" && define.amd) { 93 | define(["./epitome-model"], wrap); 94 | } else { 95 | this.Epitome || (this.Epitome = { 96 | Model: {} 97 | }); 98 | this.Epitome.Model.Storage = wrap(this.Epitome.Model); 99 | } 100 | }.call(this)); -------------------------------------------------------------------------------- /js/libs/Epitome/unused/epitome-collection-sync.js: -------------------------------------------------------------------------------- 1 | ;(function(){ 2 | 'use strict'; 3 | 4 | // wrapper function for requirejs or normal object 5 | var wrap = function(Collection){ 6 | 7 | var noUrl = 'no-urlRoot-set', 8 | eventPseudo = 'fetch:'; 9 | 10 | return new Class({ 11 | // allows for fetching collections of model from the server 12 | 13 | Extends: Collection, 14 | 15 | options: { 16 | urlRoot: noUrl 17 | }, 18 | 19 | initialize: function(models, options){ 20 | this.setupSync(); 21 | this.parent(models, options); 22 | }, 23 | 24 | setupSync: function(){ 25 | // single request object as in models. independent of models. 26 | var self = this, 27 | rid = 0, 28 | incrementRequestId = function(){ 29 | // request ids are unique and private. private to up them. 30 | rid++; 31 | }; 32 | 33 | // public methods - next likely is current rid + 1 34 | this.getRequestId = function(){ 35 | return rid + 1; 36 | }; 37 | 38 | this.request = new Request.JSON({ 39 | // one request at a time 40 | link: 'chain', 41 | url: this.options.urlRoot, 42 | emulation: this.options.emulateREST, 43 | onRequest: incrementRequestId, 44 | onCancel: function(){ 45 | this.removeEvents(eventPseudo + rid); 46 | }, 47 | onSuccess: function(responseObj){ 48 | responseObj = self.postProcessor && self.postProcessor(responseObj); 49 | self.trigger(eventPseudo + rid, [ 50 | [responseObj] 51 | ]); 52 | }, 53 | onFailure: function(){ 54 | self.trigger(eventPseudo + 'error', [this.options.method, this.options.url, this.options.data]); 55 | } 56 | }); 57 | 58 | this.request.setHeader('Accept', 'application/json,text/plain;q=0.2,text/html;q=0.1'); 59 | return this; 60 | }, 61 | 62 | fetch: function(refresh, queryParams){ 63 | // get a list of models. `@refresh (boolean)` will empty collection first, queryParams passed as get args 64 | queryParams || (queryParams = {}); 65 | 66 | // set the onSuccess event for this fetch call 67 | this._throwAwayEvent(function(models){ 68 | if (refresh){ 69 | this.empty(); 70 | Array.each(models, this.addModel.bind(this)); 71 | } 72 | else { 73 | this.processModels(models); 74 | } 75 | 76 | // finaly fire the event to instance 77 | this.trigger('fetch', [models]); 78 | }); 79 | 80 | this.request.get(queryParams); 81 | 82 | // dangerous. async stuff coming. 83 | return this; 84 | }, 85 | 86 | processModels: function(models){ 87 | // deals with newly arrived objects which can either update existing models or be added as new models 88 | // `@models (array or objects)`, not actual model instances 89 | var self = this; 90 | 91 | Array.each(models, function(model){ 92 | var exists = model.id && self.getModelById(model.id); 93 | 94 | if (exists){ 95 | exists.set(model); 96 | } 97 | else { 98 | self.addModel(model); 99 | } 100 | }); 101 | }, 102 | 103 | _throwAwayEvent: function(callback){ 104 | // this is a one-off event that will ensure a fetch event fires only once per `.fetch` 105 | var eventName = eventPseudo + this.getRequestId(), 106 | self = this, 107 | throwAway = {}; 108 | 109 | if (!callback || typeof callback !== 'function') 110 | return; 111 | 112 | throwAway[eventName] = function(responseObj){ 113 | callback.apply(self, responseObj); 114 | 115 | // remove this one-off event. 116 | self.off(throwAway); 117 | }; 118 | 119 | return this.on(throwAway); 120 | }.protect(), 121 | 122 | postProcessor: function(jsonResponse){ 123 | // apply a post-processor to response 124 | return jsonResponse; 125 | } 126 | 127 | }); 128 | }; // end wrap 129 | 130 | if (typeof define === 'function' && define.amd){ 131 | define(['./epitome-collection'], wrap); 132 | } 133 | else { 134 | this.Epitome || (this.Epitome = {Collection: {}}); 135 | this.Epitome.Collection.Sync = wrap(this.Epitome.Collection); 136 | } 137 | }.call(this)); -------------------------------------------------------------------------------- /js/libs/Storage.js: -------------------------------------------------------------------------------- 1 | /* 2 | --- 3 | description: A cross browser persistent storgae API 4 | 5 | license: MIT-style 6 | 7 | authors: 8 | - Arieh Glazer + Graeme Yeate's edits 9 | 10 | requires: 11 | - core/1.2.4 : [Core,Class,Class.Extras,Cookie] 12 | 13 | provides: [Storage] 14 | 15 | ... 16 | */ 17 | (function(window) { 18 | 'use strict'; 19 | /* global globalStorage, Cookie */ 20 | window.Storage = new Class({ 21 | Implements: [Options], 22 | options: { //see Cookie options 23 | path: '/', 24 | name: window.location.hostname, 25 | duration: 100, //days 26 | storageType: 'localStorage', 27 | fallback: true 28 | }, 29 | storage: null, 30 | initialize: function(options) { 31 | this.setOptions(options); 32 | var $this = this, 33 | storageType = this.options.storageType, 34 | fallback = this.options.fallback; 35 | 36 | if (window[storageType]) { //HTML5 storage 37 | this.storage = window[storageType]; 38 | } else if (Browser.ie && Browser.version < 8) { //IE < 8 39 | this.storage = (function() { 40 | var storage = document.createElement('span'); 41 | storage.style.behavior = 'url(#default#userData)'; 42 | document.body.adopt(storage); 43 | storage.load($this.options.name); 44 | 45 | return { 46 | setItem: function(name, value) { 47 | storage.setAttribute(name, value); 48 | storage.save($this.options.name); 49 | }, 50 | getItem: function(name) { 51 | return storage.getAttribute(name); 52 | }, 53 | removeItem: function(name) { 54 | storage.removeAttribute(name); 55 | storage.save($this.options.name); 56 | } 57 | }; 58 | })(); 59 | } else if(fallback) { //All others 60 | this.usingCookies = true; 61 | this.storage = (function() { 62 | var options = { 63 | path: $this.options.path, 64 | duration: $this.options.duration 65 | }; 66 | 67 | return { 68 | setItem: function(name, value) { 69 | Cookie.write(name, value, options); 70 | }, 71 | getItem: function(name) { 72 | return Cookie.read(name); 73 | }, 74 | removeItem: function(name) { 75 | Cookie.dispose(name); 76 | } 77 | }; 78 | })(); 79 | } else { 80 | var data = null; 81 | this.storage = { 82 | getItem: function() { 83 | return data; 84 | }, 85 | setItem: function(d) { 86 | data = d; 87 | }, 88 | removeItem: function() { 89 | data = null; 90 | } 91 | }; 92 | } 93 | }, 94 | set: function(name, value) { 95 | this.storage.setItem(name, JSON.encode(value)); 96 | return this; 97 | }, 98 | get: function(name) { 99 | return JSON.decode(this.storage.getItem(name)); 100 | }, 101 | remove: function(name) { 102 | this.storage.removeItem(name); 103 | return this; 104 | } 105 | }); 106 | 107 | })(this); 108 | -------------------------------------------------------------------------------- /js/libs/console-shim.js: -------------------------------------------------------------------------------- 1 | /** 2 | * quick console shim https://gist.github.com/bgrins/5108712 3 | */ 4 | (function(console, noop) { 5 | [ 6 | 'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error', 7 | 'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log', 8 | 'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd', 9 | 'timeStamp', 'trace', 'warn' 10 | ].forEach(function(method) { 11 | // Only stub undefined methods. 12 | if(!console[method]) console[method] = noop; 13 | }); 14 | })(window.console = window.console || {}, function() {}); -------------------------------------------------------------------------------- /js/libs/underscore-mixin.js: -------------------------------------------------------------------------------- 1 | /* 2 | A collection of functional helpers for underscore 3 | 4 | */ 5 | (function(_, undefined) { 6 | var slice = Array.prototype.slice; 7 | 8 | _.mixin({ 9 | //http://lodash.com/docs#curry 10 | curry: function(fn, numArgs) { 11 | numArgs = numArgs || fn.length; 12 | return function wrapper(prev_args) { 13 | return function() { 14 | var args = prev_args.concat(slice.call(arguments)); 15 | return args.length < numArgs ? wrapper(args) : fn.apply(this, args); 16 | }; 17 | }([]); 18 | }, 19 | 20 | periodical: function(fn, period, bind) { 21 | return fn.periodical(period, bind, slice.call(arguments, 3)); 22 | }, 23 | 24 | merge: Object.merge, 25 | 26 | //f(a,b//) -> f(b,a..) 27 | flip: function(f) { 28 | return function() { 29 | var args = slice.call(arguments); 30 | args = args.slice(1, 2).concat(args.slice(0, 1), args.slice(2)); 31 | return f.apply(null, args); 32 | }; 33 | }, 34 | 35 | //makes it into next version of _ 36 | negate: function(fn) { 37 | return function() { 38 | return !fn.apply(this, arguments); 39 | }; 40 | }, 41 | 42 | /* jshint devel:true */ 43 | log: function() { 44 | if (console && console.log) console.log(arguments); 45 | }, 46 | 47 | //https://gist.github.com/rjz/2815273 48 | assign: function(obj, key, value) { 49 | var keys = key.split("."), 50 | cur, ptr = obj; 51 | 52 | while ((cur = keys.shift()) && keys.length) { 53 | if (!_.isObject(ptr[cur])) { 54 | ptr[cur] = {}; 55 | } 56 | ptr = ptr[cur]; 57 | } 58 | ptr[cur] = value; 59 | return obj; 60 | }, 61 | 62 | lookup: function (obj, key){ 63 | var type = typeof key; 64 | if (type == "string" || type == "number") key = ("" + key).split("."); 65 | for (var i = 0, l = key.length; i < l; i++){ 66 | if (_.has(obj, key[i])) obj = obj[key[i]]; 67 | else return undefined; 68 | } 69 | return obj; 70 | }, 71 | 72 | item: function(xs, n) { 73 | return xs == null ? null : xs[n]; 74 | } 75 | 76 | //.alias({a:1,b:{alpha:'a'}}, {a: 'test', c: 'rawf'}) => {a: 1, b: Object, test: 1} 77 | // alias: function(obj, aliases, force) {//obj is an object and aliases is a dictionary of (string union listof string) 78 | // function makeAliases(alias, key) { 79 | // if(_.has(obj, key)) { 80 | // if(_.isArray(alias)) { 81 | // _.each(alias, function(alias) {makeAliases(alias, key)}); 82 | // } else if(_.isString(alias) && (force || !_.has(obj, alias))) { 83 | // obj[alias] = obj[key]; 84 | // } 85 | // } 86 | // } 87 | // _.each(aliases, makeAliases); 88 | // return obj; 89 | // } 90 | }); 91 | 92 | })(this._); -------------------------------------------------------------------------------- /js/src/Interface.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Creates an instance of Qwebirc. Start of the road 3 | * Default config will be extended by whatever settings are given in app.js 4 | * 5 | * @depends [qwebirc, util/utils, config/Settings] 6 | * @depends [ui/QUI, ui/Theme, irc/Client] 7 | */ 8 | var DEFAULT_QWEBIRC_CONFIG = { 9 | appTitle: "" /* Quake Net Web IRC */, 10 | networkName: "" /* Quake Net */, 11 | 12 | validators: { //test is a helper from ircutils 13 | nick: [{ 14 | test: util.test(/^[\s\S]{1,30}$/), //30 to 31 characters is an IRCd standard. Worse to worse, the ircd will reject. 15 | description: lang.getFormatter("nickWrongLen", {min: 1, max: 30}) 16 | }], 17 | password: [{ 18 | test: function(pass, $ele) { 19 | return pass || !$ele.isVisible(); 20 | }, 21 | description: lang.getter("missingPass") 22 | }], 23 | username: [{ 24 | test: function(user, $ele) { 25 | return user || !$ele.isVisible(); 26 | }, 27 | description: lang.getter("missingNick") 28 | }] 29 | }, 30 | parseQueryString: true, 31 | 32 | uiOptions: {/*see config/options.js*/}, 33 | settings: {/*see config/settings.js*/}, 34 | client: {/*see irc/IRCClient.js*/} 35 | }; 36 | 37 | // createInstance: (element|str id), [qwebircUI], options -> qwebirc instance 38 | qwebirc.createInstance = function(element_id, UIclass, options) { 39 | if(!options) { 40 | options = UIclass; 41 | UIclass = ui.QUI; 42 | } 43 | options = _.merge({}, DEFAULT_QWEBIRC_CONFIG, options); 44 | var settings = options.settings = new config.Settings({}, { 45 | defaults: options.settings 46 | }); 47 | 48 | //parse query string 49 | // it will override any non cached (localstorage/cookie) options for uiOptions and settings 50 | //so ?nickname=test&style_saturation=30 will set the saturation to 30 and the initial nickname to test 51 | var query = window.location.search; 52 | if(query && options.parseQueryString) { 53 | var parsed = query.slice(1).parseQueryString(); 54 | 55 | if(parsed.channels) {//append query string channels to saved channels 56 | parsed.channels = util.concatUnique(settings.get("channels"), util.unformatChannelString(parsed.channels)); 57 | } 58 | 59 | softextend(parsed, options.uiOptions = _.merge({}, ui["default options"], options.uiOptions)); 60 | softextend(parsed, options.client); 61 | softextend(parsed, options.settings._attributes);//poor practice 62 | } 63 | 64 | //create instance 65 | var instance = new UIclass(element_id, options); //unconventional naming scheme 66 | instance.addEvents({ 67 | "ready:once": function() { 68 | instance.loginBox(); 69 | //cleans up old properties 70 | if(settings.get("newb")) { 71 | instance.welcome(); 72 | settings.set("newb", false); 73 | } 74 | }, 75 | "login:once": function(loginopts) { 76 | var ircopts = _.extend({settings: settings, uiOptions: instance.uiOptions}, loginopts, options.client); 77 | 78 | var client = new irc.Client(ircopts); 79 | instance.newClient(client); 80 | client.connect(); 81 | window.onbeforeunload = function(e) { 82 | if (client.isConnected()) { //has gotten passed the IRC gate 83 | e = e || window.event; 84 | e.preventDefault(); 85 | e.returnValue = lang.dontLeave; //legacy ie 86 | return lang.dontLeave; 87 | } 88 | }; 89 | window.addEvent("unload", client.quit); 90 | } 91 | }); 92 | 93 | return instance; 94 | }; 95 | 96 | function softextend(origin, obj) {//only sets vals if they exist on the object 97 | _.each(origin, function(val, key) { 98 | if(_.has(obj, key)) { 99 | obj[key] = +val == val ? +val : val;//coerce nums 100 | } 101 | }); 102 | } 103 | -------------------------------------------------------------------------------- /js/src/components/Asset.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Based on Mootools/More/Assets 3 | * Promised based implementation 4 | * @depends [components, patches] 5 | * @provides [components/Loader] 6 | */ 7 | (function() { 8 | //hash of urls that have already loaded successfully 9 | var loaded = {}; 10 | components.loader = { 11 | javascript: function(source, properties) { 12 | return new Promise(function(fullfil, reject) { 13 | if(source in loaded) fullfil(); 14 | if (!properties) properties = {}; 15 | 16 | var script = new Element("script", { 17 | src: source, 18 | async: "" 19 | }); 20 | var doc = properties.document || document; 21 | var success = true; 22 | var onload = function() { 23 | if(success) fullfil(); 24 | loaded[source] = success; 25 | script.destroy(); 26 | }; 27 | var onerror = function() { 28 | reject(); 29 | success = false; 30 | script.destroy(); 31 | }; 32 | 33 | delete properties.document; 34 | 35 | if (!script.addEventListener){ 36 | script.addEvent("readystatechange", function(){ 37 | if (["loaded", "complete"].contains(this.readyState)) onload(); 38 | }); 39 | } else { 40 | script.addEvent("load", onload); 41 | } 42 | script 43 | .addEvent("error", onerror) 44 | .set(properties) 45 | .inject(doc.head); 46 | }); 47 | }, 48 | 49 | load: function(sources, properties) { 50 | if(!Type.isArray(sources)) sources = Array.from(arguments); 51 | if(!Type.isObject(properties)) { 52 | if(Type.isObject(_.last(sources))) properties = sources.pop(); 53 | } 54 | var promises = sources.map(function(source) { 55 | return components.loader.javascript(source, properties); 56 | }); 57 | return Promise.all(promises); 58 | } 59 | }; 60 | 61 | })(); -------------------------------------------------------------------------------- /js/src/components/AutoScroll.js: -------------------------------------------------------------------------------- 1 | /** 2 | * scrolls an elemenet as new items are added. will stop scrolling if user manually scrolls 3 | * Requires some element refactoring see nativemods so adopting and disowning elements causes an event to be fired 4 | * Author: Graeme Yeates 5 | * Requires: 6 | * - Fx.Scroll 7 | * - Element.Event.Pseudos 8 | * @depends [patches, components] 9 | * @provides [components/AutoScroll] 10 | */ 11 | components.AutoScroll = new Class({ 12 | Extends: Fx.Scroll, 13 | Binds: ["updatePosition"], 14 | options: { 15 | // direction: "Bottom", 16 | interval: 100,//time to debounce scroll event checks to save some processing 17 | duration: 0, //ms to execute effect 18 | threshold: 5,//px - how close to bottom to start scrolling 19 | wheelStops: true, 20 | link: "cancel", 21 | start: true 22 | }, 23 | 24 | initialize: function(ele, options) { 25 | this.parent(ele, options); 26 | 27 | var self = this, 28 | opts = self.options; 29 | self.threshold = this.options.threshold; 30 | 31 | this.$events = { 32 | element: { 33 | "adopt": self.updatePosition, 34 | "disown": self.updatePosition 35 | }, 36 | window: { 37 | "resize": self.updatePosition//pretty light function doesnt need to be throttled 38 | } 39 | }; 40 | // this.$events.element["scroll:pause(" + opts.interval + ")"] = function() { 41 | // self.toggleScroll(); 42 | // }; 43 | this.$events.element.scroll = _.debounce(function() {//underscore debounce uses much less memory than pause 44 | self.toggleScroll(); 45 | }, opts.interval); 46 | 47 | //begin autoscrolling 48 | if(opts.start) this.start(); 49 | }, 50 | 51 | autoScroll: function() { 52 | this._scroll = true; 53 | return this.updatePosition(); 54 | }, 55 | 56 | stopScroll: function() { 57 | this._scroll = false; 58 | }, 59 | 60 | toggleScroll: function() { 61 | this._scroll = false; 62 | 63 | var $ele = this.element, 64 | pxFromBottom = Math.abs($ele.getScrollHeight() - ($ele.getHeight() + $ele.getScrollTop())); 65 | 66 | if(pxFromBottom <= this.threshold) {//bottom of element + offset - begin autoscrolling 67 | this.autoScroll(); 68 | } 69 | else { //stop autoscrolling 70 | this.stopScroll(); 71 | } 72 | return this; 73 | }, 74 | 75 | updatePosition: function(target) { 76 | var $ele = this.element; 77 | if(this._scroll && 78 | /*bug fix for a off by one one in Fx.Scroll*/ Math.abs($ele.getScrollHeight() - $ele.getHeight() - $ele.getScrollTop()) > 2) { 79 | if(this.options.duration === 0) { 80 | this.set($ele.scrollLeft, $ele.scrollHeight); //place at bottom instantly 81 | } else { 82 | this.toBottom(); 83 | } 84 | if(target) { 85 | this.threshold = this.options.threshold || target.getHeight(); 86 | } 87 | } 88 | return this; 89 | }, 90 | 91 | start: function() { 92 | this.element.addEvents(this.$events.element); 93 | window.addEvents(this.$events.window); 94 | return this.autoScroll(); 95 | }, 96 | 97 | stop: function() { 98 | window.removeEvents(this.$events.window); 99 | this.element.removeEvents(this.$events.element); 100 | this.stopScroll(); 101 | return this.parent(); 102 | } 103 | }); 104 | -------------------------------------------------------------------------------- /js/src/components/ImagePopover.js: -------------------------------------------------------------------------------- 1 | /** 2 | * img popovers 3 | * 4 | * @depends [components] 5 | * @provides [components/ImagePopover] 6 | */ 7 | 8 | //create an image popover on (img) url hover 9 | //could use BS popovers here but this will be more efficent 10 | var imgRegex = /\.(gif|jpg|jpeg|tiff|png)$/i; 11 | components.ImagePopover = new Class({ 12 | initialize: function(element, enable) { 13 | this.element = element; 14 | this.events = { 15 | "mouseenter:relay(a)": this.show.bind(this), 16 | "mouseleave:relay(a)": _.debounce(this.hide.bind(this), 100) //throttled to prevent hover being toggled when leaving spaces 17 | }; 18 | this.toggle(enable); 19 | }, 20 | 21 | show: function(e, $tar) { 22 | var self = this; 23 | if (self.hide()) return; //no need already shown 24 | if (imgRegex.test($tar.href)) { 25 | self.target = $tar; 26 | self.current = Element.from(templates["image-popover"]({ 27 | image_url: $tar.href 28 | })) 29 | .inject(self.element) 30 | .setStyle("display", "block"); 31 | 32 | var tarPos = $tar.getCoordinates(); 33 | 34 | var payload = self.current.getElement(".payload") 35 | .addEvent("load", function() { 36 | self.current.getElement(".loading").dispose(); 37 | //set arrow position 38 | self.current.getElement(".arrow") 39 | .setStyle("top", Math.abs(tarPos.top - pos.y) + tarPos.height / 2); 40 | }); 41 | 42 | var maxWidth = payload.getComputedStyle("max-width").toInt(); 43 | var maxHeight = payload.getComputedStyle("max-height").toInt(); 44 | var imgMaxMin = { 45 | x: { 46 | min: 40, 47 | max: window.getWidth() - maxWidth - 40 48 | }, 49 | y: { 50 | min: 40, 51 | max: window.getHeight() - maxHeight - 40 52 | } 53 | }; 54 | 55 | var pos = { 56 | x: Math.min((Math.max(tarPos.right + 10, imgMaxMin.x.min)), imgMaxMin.x.max), 57 | y: Math.min((Math.max(e.client.y / 2, imgMaxMin.y.min)), imgMaxMin.y.max) 58 | }; 59 | 60 | self.current.setPosition(pos); 61 | } 62 | }, 63 | 64 | hide: function() { 65 | if (this.target && this.target.match(":hover")) return true; 66 | if (this.current) this.current.destroy(); 67 | this.current = this.target = null; 68 | }, 69 | 70 | toggle: function(state) { 71 | state = _.isBoolean(state) ? state : ! this.state; 72 | this.hide(); 73 | if (state !== this.state) { 74 | this.element[(state ? "add" : "remove") + "Events"](this.events); 75 | this.state = state; 76 | } 77 | return this; 78 | } 79 | }); -------------------------------------------------------------------------------- /js/src/config/commands.js: -------------------------------------------------------------------------------- 1 | /** 2 | * commands are substituted by util.formatter. Please make sure they are the correct command for your server 3 | * eg : https://www.quakenet.org/help/q-commands 4 | * @depends [config] 5 | * @provides [config/commands] 6 | */ 7 | config.IRC_COMMANDS = { //maybe make these templates? 8 | "ACTION": { 9 | command: "PRIVMSG {target} :\x01ACTION {text}\x01" 10 | }, 11 | "CTCP": { 12 | command: "PRIVMSG {target} :\x01{type} {text} \x01" 13 | }, 14 | "PRIVMSG": { 15 | command: "PRIVMSG {target} :{message}" 16 | }, 17 | "JOIN": { 18 | command: "JOIN {channel} {args}" 19 | }, 20 | "NICK": { 21 | command: "NICK {nick}" 22 | }, 23 | "PART": { 24 | command: "PART {channel} :{message}" 25 | }, 26 | "QUIT": { 27 | command: "QUIT :{message}" 28 | }, 29 | "TOPIC": { 30 | command: "TOPIC {channel} :{topic}" 31 | }, 32 | "AWAY": { 33 | command: "AWAY :{message}" 34 | }, 35 | "NOTICE": { 36 | command: "NOTICE {target} :{message}" 37 | }, 38 | "MODE": { 39 | command: "MODE {target} {mode} {args}" 40 | }, 41 | "AUTH": {//templated as quite likely to change 42 | command: "<%= config.qwebirc_config.auth_command %>" || "AUTHSERV AUTH {username} {password}" 43 | }, 44 | "KICK": { 45 | command: "KICK {channel} {kickee} :{message}" 46 | } 47 | }; 48 | 49 | config.COMMAND_ALIAS = { 50 | "J": "JOIN", 51 | "P": "PART", 52 | "MESSAGE": "PRIVMSG", 53 | "M": "PRIVMSG", 54 | "MSG": "PRIVMSG", 55 | "PM": "PRIVMSG", 56 | "Q": "QUERY", 57 | "BACK": "AWAY", 58 | "HOP": "CYCLE", 59 | "SLAP": "ME", 60 | "CLS": "CLEAR" 61 | }; -------------------------------------------------------------------------------- /js/src/config/irc-mode-status.js: -------------------------------------------------------------------------------- 1 | /** 2 | * supported irc modes ie admin vocie etc 3 | * @depends [config] 4 | * @provides [config/modes] 5 | */ 6 | config.modes = [ //sort by importance 7 | { 8 | prefix: "@", //prefix 9 | "class": "op", //css class 10 | description: lang.getter("op") 11 | }, 12 | { 13 | voice: "+", 14 | "class": "voice", 15 | description: lang.getter("voice") 16 | } 17 | ]; -------------------------------------------------------------------------------- /js/src/config/registeredCTCP.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @depends [config, util/utils] 3 | * @provides [config/ctcp] 4 | */ 5 | irc.RegisteredCTCPs = { 6 | "VERSION": Function.from("qwebirc v" + qwebirc.VERSION), 7 | "USERINFO": Function.from("qwebirc"), 8 | "TIME": util.IRCDate, 9 | "PING": _.identity, 10 | "CLIENTINFO": Function.from("PING VERSION TIME USERINFO CLIENTINFO WEBSITE"), 11 | "WEBSITE": Function.from(((window == window.top) ? "direct" : document.referrer)) 12 | }; 13 | -------------------------------------------------------------------------------- /js/src/config/settings.js: -------------------------------------------------------------------------------- 1 | /** 2 | * user settings 3 | * @depends [config, cookies] 4 | * @provides [config/Settings] 5 | */ 6 | var encode = window.btoa || _.identity, 7 | decode = window.atob || _.identity; 8 | config.Settings = new Class({ 9 | Extends: Epitome.Model.Storage, 10 | options: { 11 | defaults: { 12 | "channels": [], 13 | "nickname": "", 14 | "username": "", 15 | "password": "", 16 | "auth": false, 17 | "newb": "<%= config.user_settings.welcome_message %>" !== "false" //first visit 18 | }, 19 | key: cookies.settings, 20 | minimize: false, 21 | 22 | onInit: function() { 23 | this.loaded = true; 24 | } 25 | }, 26 | properties: { 27 | username: { 28 | get: function() { 29 | return decode(this._attributes.username); 30 | }, 31 | set: function(user) { //prevent double encoding 32 | return this.loaded ? encode(user) : user; 33 | } 34 | }, 35 | password: { 36 | get: function() { 37 | return decode(this._attributes.password); 38 | }, 39 | set: function(password) { 40 | return this.loaded ? encode(password) : password; 41 | } 42 | } 43 | }, 44 | 45 | set: function(key, data) { 46 | this.parent(key, data); 47 | if(this.loaded) {//set is called when initing if we save we will lose state 48 | this.save(); 49 | } 50 | return this; 51 | }, 52 | 53 | unset: function(key) { 54 | this.parent(key); 55 | return this.save(); 56 | } 57 | }); 58 | -------------------------------------------------------------------------------- /js/src/config/theme-templates.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @depends [config, util/utils] 3 | * @provides [config/theme-templates] 4 | */ 5 | var baseControlMap = { //these are settings for the templates -ie {C} is replaced by irc.styles.colour.key 6 | "C": irc.styles.colour.key, 7 | "O": irc.styles.colour.key, 8 | "B": irc.styles.bold.key, 9 | "U": irc.styles.underline.key, 10 | "D": Browser.ie ? "" : irc.styles.normal.key, //address ie bug where /x00 is null character 11 | //little clever here 12 | "NN": templates.userlink({"nick":"{N}"}),//nick name 13 | "CN": templates.userlink({"nick":"{newnick}"}),// change nick 14 | "P": "{C}4=={O} " //prefix 15 | }; 16 | 17 | config.ThemeControlCodeMap = Object.map(baseControlMap, function(str) { 18 | return util.formatSafe(str, baseControlMap); 19 | }); 20 | 21 | config.IRCTemplates = { 22 | "SIGNON": "{P}Signed on!", 23 | "CONNECT": "{P}Connected to server - establishing IRC connection.", 24 | 25 | "INFO": "{m}", 26 | "RAW": "{P}{m}", 27 | "DISCONNECT": "{P}Disconnected from server: {m}", 28 | "ERROR": "{P}ERROR: {m}", 29 | 30 | "SERVERNOTICE": "{P}{m}", 31 | "OURTARGETEDNOTICE": "[notice({[}{t}{]})] {m}", 32 | "OURCHANNOTICE": "-{N}:{t}- {m}", 33 | "OURPRIVNOTICE": "-{N}- {m}", 34 | "CHANNOTICE": "-{D}{(}{N}{)}{D}:{c}- {m}", 35 | "PRIVNOTICE": "-{(}{N}{)}- {m}", 36 | 37 | "JOIN": "{P}{D}{N}{D} [{h}] has joined {c}", 38 | "OURJOIN": "{P}{D}{N}{D} [{h}] has joined {c}", 39 | "PART": "{P}{D}{N}{D} [{h}] has left {c} [{m}]", 40 | "KICK": "{P}{D}{kickee}{D} was kicked from {c} by {D}{kicker}{D} [{m}]", 41 | "MODE": "{P}mode/{c} gives [{m}] to {D}{N}{D}", 42 | "QUIT": "{P}{D}{N}{D} [{h}] has quit [{m}]", 43 | "NICK": "{P}{D}{n}{D} has changed nick to {CN}", 44 | "TOPIC": "{P}{D}{N}{D} changed the topic of {c} to: {m}", 45 | "UMODE": "Usermode change: {m}", 46 | "INVITE": "{N} invites you to join {c}", 47 | 48 | "HILIGHT": "{C}4", 49 | "HILIGHTEND": "{O}", 50 | 51 | "CHANMSG": "{D}{nicktmpl}{)}{D} {m}", 52 | "PRIVMSG": "{(}{nicktmpl}{)} {m}", 53 | 54 | "OURCHANMSG": "{nicktmpl} {m}", 55 | "OURPRIVMSG": "{nicktmpl} {m}", 56 | "OURTARGETEDMSG": "*{[}{t}{]}* {m}", 57 | "OURCHANACTION": " * {N} {m}", 58 | "OURPRIVACTION": " * {N} {m}", 59 | 60 | "CHANACTION": " * {D}{(}{N}{)}{D} {m}", 61 | "PRIVACTION": " * {(}{N}{)} {m}", 62 | "CHANCTCP": "{N} [{h}] requested CTCP {data} from {c}: {m}", 63 | "PRIVCTCP": "{N} [{h}] requested CTCP {data} from {n}: {m}", 64 | "CTCPREPLY": "CTCP {x} reply from {N}: {m}", 65 | 66 | "OURCHANCTCP": "[ctcp({t})] {x} {m}", 67 | "OURPRIVCTCP": "[ctcp({t})] {x} {m}", 68 | "OURTARGETEDCTCP": "[ctcp({t})] {x} {m}", 69 | 70 | "WHOISUSER": "{P}{B}{N}{B} [{h}]", 71 | "WHOISREALNAME": "{P} realname : {m}", 72 | "WHOISCHANNELS": "{P} channels : {m}", 73 | "WHOISSERVER": "{P} server : {server} [{m}]", 74 | "WHOISACCOUNT": "{P} account : {m}", 75 | "WHOISIDLE": "{P} idle : {idle} [connected: {m}]", 76 | "WHOISAWAY": "{P} away : {m}", 77 | "WHOISOPER": "{P} : {B}IRC Operator{B}", 78 | "WHOISOPERNAME": "{P} operedas : {m}", 79 | "WHOISACTUALLY": "{P} realhost : {m} [ip: {ip}]", 80 | "WHOISGENERICTEXT": "{P} note : {m}", 81 | "WHOISEND": "{P}End of whois {n}", 82 | 83 | "AWAY": "{P}{N} is away: {m}", 84 | "GENERICERROR": "{P}{t}: {m}", 85 | "GENERICMESSAGE": "{P}{m}", 86 | "WALLOPS": "{P}WALLOP {n}: {t}", 87 | "CHANNELCREATIONTIME": "{P}Channel {c} was created at: {m}", 88 | "CHANNELMODEIS": "{P}Channel modes on {c} are: {m}" 89 | }; 90 | -------------------------------------------------------------------------------- /js/src/constants/constants.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @depends [ui, irc, constants] 3 | * @provides [util/constants] 4 | */ 5 | ui.WINDOW = { 6 | status: 1, 7 | query: 2, 8 | channel: 4, 9 | custom: 8, 10 | connect: 16, 11 | messages: 32, 12 | all: 10, 13 | active: 9 //currently selected window 14 | }; 15 | 16 | 17 | irc.pmodes = { 18 | LIST: 0, 19 | SET_UNSET: 1, 20 | SET_ONLY: 2, 21 | regular: 3 22 | }; 23 | 24 | 25 | constants.hl = { 26 | none: 0, 27 | activity: 1, 28 | speech: 2, 29 | us: 3 30 | }; 31 | 32 | //window names 33 | constants.brouhaha = "brouhaha"; 34 | constants.status = "status"; 35 | constants.login = "login"; 36 | constants.active = ui.WINDOW.active; 37 | constants.all = ui.WINDOW.all; 38 | 39 | 40 | // constants.window = { 41 | // brouhaha: "#brouhaha", 42 | // connect: "Connection details", 43 | // status: "Status" 44 | // }; 45 | 46 | constants.BASE_WINDOWS = [constants.brouhaha, constants.status, constants.login]; 47 | constants.CHANNEL_TYPES = [ui.WINDOW.channel, ui.WINDOW.query, ui.WINDOW.messages]; 48 | constants.INPUT_TYPES = [ui.WINDOW.status, ui.WINDOW.query, ui.WINDOW.channel, ui.WINDOW.messages]; 49 | 50 | constants.op = "+"; 51 | constants.deop = "-"; 52 | constants.prefixes = { 53 | op: "@", 54 | voice: "+" 55 | }; 56 | -------------------------------------------------------------------------------- /js/src/constants/irc_lowertable.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @depends [constants] 3 | * @provides [irc/LowerTable] 4 | */ 5 | constants.IRCLowerTable = [ 6 | /* x00-x07 */ 7 | "\x00", "\x01", "\x02", "\x03", "\x04", "\x05", "\x06", "\x07", 8 | /* x08-x0f */ 9 | "\x08", "\x09", "\x0a", "\x0b", "\x0c", "\x0d", "\x0e", "\x0f", 10 | /* x10-x17 */ 11 | "\x10", "\x11", "\x12", "\x13", "\x14", "\x15", "\x16", "\x17", 12 | /* x18-x1f */ 13 | "\x18", "\x19", "\x1a", "\x1b", "\x1c", "\x1d", "\x1e", "\x1f", 14 | /* " "-x27 */ 15 | " ", "!", "\"", "#", "$", "%", "&", "\x27", 16 | /* "("-"/" */ 17 | "(", ")", "*", "+", ",", "-", ".", "/", 18 | /* "0"-"7" */ 19 | "0", "1", "2", "3", "4", "5", "6", "7", 20 | /* "8"-"?" */ 21 | "8", "9", ":", ";", "<", "=", ">", "?", 22 | /* "@"-"G" */ 23 | "@", "a", "b", "c", "d", "e", "f", "g", 24 | /* "H"-"O" */ 25 | "h", "i", "j", "k", "l", "m", "n", "o", 26 | /* "P"-"W" */ 27 | "p", "q", "r", "s", "t", "u", "v", "w", 28 | /* "X"-"_" */ 29 | "x", "y", "z", "{", "|", "}", "~", "_", 30 | /* "`"-"g" */ 31 | "`", "a", "b", "c", "d", "e", "f", "g", 32 | /* "h"-"o" */ 33 | "h", "i", "j", "k", "l", "m", "n", "o", 34 | /* "p"-"w" */ 35 | "p", "q", "r", "s", "t", "u", "v", "w", 36 | /* "x"-x7f */ 37 | "x", "y", "z", "{", "|", "}", "~", "\x7f", 38 | /* x80-x87 */ 39 | "\x80", "\x81", "\x82", "\x83", "\x84", "\x85", "\x86", "\x87", 40 | /* x88-x8f */ 41 | "\x88", "\x89", "\x8a", "\x8b", "\x8c", "\x8d", "\x8e", "\x8f", 42 | /* x90-x97 */ 43 | "\x90", "\x91", "\x92", "\x93", "\x94", "\x95", "\x96", "\x97", 44 | /* x98-x9f */ 45 | "\x98", "\x99", "\x9a", "\x9b", "\x9c", "\x9d", "\x9e", "\x9f", 46 | /* xa0-xa7 */ 47 | "\xa0", "\xa1", "\xa2", "\xa3", "\xa4", "\xa5", "\xa6", "\xa7", 48 | /* xa8-xaf */ 49 | "\xa8", "\xa9", "\xaa", "\xab", "\xac", "\xad", "\xae", "\xaf", 50 | /* xb0-xb7 */ 51 | "\xb0", "\xb1", "\xb2", "\xb3", "\xb4", "\xb5", "\xb6", "\xb7", 52 | /* xb8-xbf */ 53 | "\xb8", "\xb9", "\xba", "\xbb", "\xbc", "\xbd", "\xbe", "\xbf", 54 | /* xc0-xc7 */ 55 | "\xe0", "\xe1", "\xe2", "\xe3", "\xe4", "\xe5", "\xe6", "\xe7", 56 | /* xc8-xcf */ 57 | "\xe8", "\xe9", "\xea", "\xeb", "\xec", "\xed", "\xee", "\xef", 58 | /* xd0-xd7 */ 59 | "\xf0", "\xf1", "\xf2", "\xf3", "\xf4", "\xf5", "\xf6", "\xd7", 60 | /* xd8-xdf */ 61 | "\xf8", "\xf9", "\xfa", "\xfb", "\xfc", "\xfd", "\xfe", "\xdf", 62 | /* xe0-xe7 */ 63 | "\xe0", "\xe1", "\xe2", "\xe3", "\xe4", "\xe5", "\xe6", "\xe7", 64 | /* xe8-xef */ 65 | "\xe8", "\xe9", "\xea", "\xeb", "\xec", "\xed", "\xee", "\xef", 66 | /* xf0-xf7 */ 67 | "\xf0", "\xf1", "\xf2", "\xf3", "\xf4", "\xf5", "\xf6", "\xf7", 68 | /* xf8-xff */ 69 | "\xf8", "\xf9", "\xfa", "\xfb", "\xfc", "\xfd", "\xfe", "\xff" 70 | ]; 71 | -------------------------------------------------------------------------------- /js/src/irc/CommandHistory.js: -------------------------------------------------------------------------------- 1 | /** 2 | * CommandHistory inteface... Probably should be moved to ui 3 | * 4 | * @depends [util/utils] for browser.isMobile 5 | * @provides [irc/CommandHistory] 6 | */ 7 | irc.CommandHistory = new Class({ 8 | Extends: Epitome.Model.Storage, 9 | Implements: [Options], 10 | options: { 11 | lines: 20, 12 | minlen: 2, 13 | storage: { 14 | fallback: false//dont save on shit browsers 15 | }, 16 | store: !Browser.isMobile, 17 | key: cookies.history 18 | }, 19 | 20 | addLine: function(name, line) { 21 | var data = this.get(name).erase(line); 22 | if(line.length > this.options.minlen) { 23 | data.unshift(line); 24 | if (data.length > this.options.lines) { 25 | data.pop(); 26 | } 27 | this.set(name, data); 28 | this.save(); 29 | } 30 | }, 31 | 32 | addChannel: function(name) { 33 | if(!this.get(name)) this.set(name, []); 34 | }, 35 | 36 | removeChannel: function(name) { 37 | this.unset(name); 38 | if(this.options.store) this.save(); 39 | } 40 | 41 | // _filter: _.not(_.isEmpty) 42 | }); -------------------------------------------------------------------------------- /js/src/irc/IRC_Error.js: -------------------------------------------------------------------------------- 1 | /** 2 | * ircclient non whois replies 3 | * 4 | * @depends [irc/Client] 5 | * @depends [util/utils] 6 | * @provides [irc/Error] 7 | */ 8 | 9 | function genericIRCError(data, target) { 10 | var message = _.last(data.args); 11 | 12 | if (!target) { 13 | target = util.isChannel(data.args[1]) ? data.args[1] : constants.status; 14 | } 15 | 16 | this.trigger("error", { 17 | target: target, 18 | channel: target, 19 | message: message, 20 | type: "genericError", 21 | colourClass: "warn" 22 | }); 23 | return true; 24 | } 25 | 26 | irc.Client.implement({ 27 | 28 | IRC_COMMAND_MAP: { 29 | "ERR_CANNOTSENDTOCHAN": "channelError", 30 | "ERR_CHANOPRIVSNEEDED": "channelError", 31 | "ERR_NOSUCHNICK": "channelError" 32 | }, 33 | 34 | irc_ERR_NICKNAMEINUSE: function(data) {//add some number to the nick and resend 35 | if(!this.__signedOn) { 36 | var nick = data.args[1]; 37 | var newnick = nick + Array.getRandom("_`-"); 38 | 39 | this.ALL_ERROR(lang.nickTaken, { 40 | oldnick: nick, 41 | nick: newnick 42 | }); 43 | 44 | this.send(util.formatCommand("NICK", {nick: newnick})); 45 | } 46 | return true; 47 | }, 48 | 49 | ALL_ERROR: function(message, data, settings) { 50 | this.writeMessages(message, data, _.extend({ 51 | channels: constants.all, 52 | type: lang.TYPES.ERROR 53 | }, settings)); 54 | }, 55 | 56 | channelError: _.partial(genericIRCError, _, constants.active), 57 | 58 | IRC_ERROR: genericIRCError 59 | }); -------------------------------------------------------------------------------- /js/src/irc/irc_Whois.js: -------------------------------------------------------------------------------- 1 | /** 2 | * ircclient whois handlers whippeee 3 | * 4 | * @depends [irc/Client] 5 | * @depends [util/utils] 6 | * @provides [irc/Whois] 7 | */ 8 | 9 | function whoisWrapper(type, fn) { 10 | type = "whois" + type.camelCase().capitalize(); 11 | return _.compose(function(data) { 12 | data.type = type; 13 | data.msgs = Array.from(data.msgs || data.message).map(function(msg) { 14 | if(_.isString(msg)) return { message: msg }; 15 | return msg; 16 | }); 17 | this.trigger("whois", data); 18 | return true; 19 | }, fn); 20 | } 21 | 22 | var genericText = whoisWrapper("genericText", function(data) { 23 | return { 24 | nick: data.args[1], 25 | message: _.last(data.args) //w/e text 26 | }; 27 | }); 28 | 29 | irc.Client.implement({ 30 | _whoisAway: whoisWrapper("away", _.identity), 31 | 32 | irc_RPL_WHOISUSER: whoisWrapper("user", function(data) { 33 | var nick = data.args[1]; 34 | var ident = data.args[2]; 35 | var hostname = data.args[3]; 36 | this._whoisNick = nick; 37 | 38 | return { 39 | nick: nick, 40 | msgs: [{ 41 | host: ident + "@" + hostname 42 | }, 43 | { 44 | message: data.args[5], 45 | type: "whoisRealname" 46 | }] 47 | }; 48 | }), 49 | 50 | irc_RPL_WHOISSERVER: whoisWrapper("server", function(data) { 51 | return { 52 | nick: data.args[1], 53 | server: data.args[2], 54 | message: _.last(data.args) 55 | }; 56 | }), 57 | 58 | irc_RPL_WHOISOPERATOR: whoisWrapper("oper", function(data) { 59 | return { 60 | nick: data.args[1] 61 | // opertext: _.last(data.args) 62 | }; 63 | }), 64 | 65 | irc_RPL_WHOISIDLE: whoisWrapper("idle", function(data) { 66 | return { 67 | nick: data.args[1], 68 | idle: data.args[2], 69 | message: data.args[3] 70 | }; 71 | }), 72 | 73 | irc_RPL_WHOISCHANNELS: whoisWrapper("channels", function(data) { 74 | return { 75 | nick: data.args[1], 76 | message: _.last(data.args) //the channels 77 | }; 78 | }), 79 | 80 | irc_RPL_WHOISACCOUNT: whoisWrapper("account", function(data) { 81 | return { 82 | nick: data.args[1], 83 | message: data.args[2] //the account 84 | }; 85 | }), 86 | 87 | irc_RPL_WHOISACTUALLY: whoisWrapper("actually", function(data) { 88 | return { 89 | nick: data.args[1], 90 | message: data.args[2], //users hostmask 91 | ip: data.args[3] 92 | }; 93 | }), 94 | 95 | irc_RPL_WHOISOPERNAME: whoisWrapper("opername", function(data) { 96 | return { 97 | nick: data.args[1], 98 | message: data.args[2] //opername 99 | }; 100 | }), 101 | 102 | irc_RPL_WHOISGENERICTEXT: genericText, 103 | 104 | //whoiswebirc 105 | irc_RPL_UNIQOPIS: genericText, 106 | 107 | irc_RPL_WHOISSECURE: genericText, 108 | 109 | irc_RPL_ENDOFWHOIS: whoisWrapper("end", function(/*data*/) { 110 | this._whoisNick = null; 111 | return {}; 112 | }) 113 | }); 114 | -------------------------------------------------------------------------------- /js/src/qwebirc.js: -------------------------------------------------------------------------------- 1 | /** 2 | * qwebirc -- Copyright (C) 2008-2011 Chris Porter and the qwebirc project --- All rights reserved. 3 | * 4 | * @provides [qwebirc, irc, util, config, auth, ui, components, cookies, sound, lang, windowNames, templates, constants] 5 | */ 6 | 7 | /* exported irc, util, ui, cookies, config, auth, components, sound, templates, constants, windowNames, readyPromises */ 8 | 9 | //wrapped in iife during grunt build 10 | /* jshint ignore:start */ 11 | 12 | //cache common globals in scope 13 | var $ = document.id, 14 | $$ = document.getElements, 15 | Class = window.Class, 16 | Options = window.Options, 17 | Events = window.Events, 18 | _ = window._, 19 | Epitome = window.Epitome; 20 | 21 | /* jshint ignore:end */ 22 | 23 | 24 | //global object 25 | var qwebirc = window.qwebirc = _.merge(window.qwebirc || {}, { 26 | DEBUG: "<%= build.debug %>" === "true", 27 | irc: {}, 28 | ui: {}, 29 | util: {}, 30 | components: {}, 31 | global: { 32 | dynamicBaseURL: "<%= config.qwebirc_config.base_url %>" || "/", 33 | staticBaseURL: "<%= config.qwebirc_config.static_url %>" || "/" 34 | }, 35 | config: {}, 36 | sound: {}, 37 | lang: { 38 | windowNames: {} 39 | }, 40 | constants: {}, 41 | templates: {}, 42 | cookies: { 43 | "options": "qweb-options", 44 | "history": "qweb-hist", 45 | "settings": "qweb-settings" 46 | }, 47 | VERSION: "<%= pkg.version %>" 48 | }); 49 | 50 | var irc = qwebirc.irc, 51 | 52 | util = qwebirc.util, 53 | 54 | config = qwebirc.config, 55 | auth = qwebirc.auth, 56 | 57 | ui = qwebirc.ui, 58 | components = qwebirc.comp = qwebirc.components, 59 | 60 | cookies = qwebirc.cookies, 61 | 62 | sound = qwebirc.sound, 63 | 64 | lang = qwebirc.lang, 65 | windowNames = lang.windowNames, 66 | 67 | templates = qwebirc.templates, 68 | 69 | constants = qwebirc.constants; 70 | 71 | //promises indicating qwebirc is ready to load 72 | var readyPromises = []; 73 | -------------------------------------------------------------------------------- /js/src/ready.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Promise based ready controller to indicate the app can start loading 3 | * 4 | * @depends [qwebirc, util/lang] 5 | * @provides [ready, qwebirc/ready] 6 | */ 7 | 8 | //qwebirc.js defines readyPromises = [] 9 | /* global readyPromises */ 10 | readyPromises.push(new Promise(function(fulfill) { 11 | document.addEvent("domready", fulfill); 12 | })); 13 | 14 | var qwebircReadyPromise = Promise.all(readyPromises); 15 | 16 | // qwebirc.ready = function(cb/*, args*/) { 17 | // return qwebircReadyPromise.then(_.partial.apply(_, [cb].concat(_.rest(arguments)))); 18 | // }; 19 | qwebirc.ready = function(cb/*, args*/) { 20 | return qwebircReadyPromise.then(cb.pass(_.rest(arguments), this)); 21 | }; 22 | -------------------------------------------------------------------------------- /js/src/ui/interfaces/IKeyboard.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Handles hotkeys for a standardUI 3 | * 4 | * @depends [util/lang, util/constants, util/utils, util/uihelpers, ui/IWindows] 5 | * @provides [ui/IKeyboard] 6 | */ 7 | ui.IKeyboard = new Class({ 8 | hotkeys: { 9 | keyboard: { 10 | nextWindow: { 11 | keys: "right", 12 | description: "", 13 | handler: function() { 14 | this.scope.nextWindow(); 15 | } 16 | }, 17 | next: { 18 | keys: "tab", 19 | description: "", 20 | handler: function() { 21 | this.scope.nextWindow(); 22 | } 23 | }, 24 | prevWindow: { 25 | keys: "left", 26 | description: "", 27 | handler: function() { 28 | this.scope.prevWindow(); 29 | } 30 | } 31 | }, 32 | 33 | input: { 34 | bold: { 35 | keys: "ctrl+b", 36 | description: "", 37 | handler: _.partial(util.wrapSelected, ".window:not(.hidden) .input .irc-input", irc.styles.bold.bbcode) 38 | }, 39 | italic: { 40 | keys: "ctrl+i", 41 | description: "", 42 | handler: _.partial(util.wrapSelected, ".window:not(.hidden) .input .irc-input", irc.styles.italic.bbcode) 43 | }, 44 | underline: { 45 | keys: "ctrl+u", 46 | description: "", 47 | handler: _.partial(util.wrapSelected, ".window:not(.hidden) .input .irc-input", irc.styles.underline.bbcode) 48 | } 49 | } 50 | }, 51 | 52 | /* global Keyboard */ 53 | makeKeyboard: function () { 54 | if(Browser.isMobile) return; 55 | var self = this, 56 | keyboard = self.keyboard = new Keyboard({active: true}).addShortcuts(self.hotkeys.keyboard), 57 | ircKeyboard = self.ircKeyboard = new Keyboard({active: false}).addShortcuts(self.hotkeys.input); 58 | 59 | keyboard.scope = self; 60 | 61 | function isChar(code) { //http://www.cambiaresearch.com/articles/15/javascript-char-codes-key-codes 62 | return code === 32 || (code > 46 && !(code >= 91 && code <= 123) && code !== 144 && code !== 145) ; 63 | } 64 | 65 | self._keyboardEvents = { 66 | "blur:relay(input)": function() { 67 | keyboard.activate(); 68 | }, 69 | "focus:relay(input)": function() { 70 | ircKeyboard.activate(); 71 | } 72 | }; 73 | 74 | self.element.addEvents(self._keyboardEvents); 75 | 76 | self._keyboardHandler = { 77 | "keydown": function(e) { // pressing 1 2 3 4 etc will change tab 78 | if(keyboard.isActive() && e.nodeName !== "INPUT") { 79 | if(e.alt && !isNaN(e.key) && e.key <= self.windowArray.length) { 80 | self.selectWindow(e.key - 1); 81 | } else if(self.active.$input && 82 | !(e.alt || e.meta) && //allow hotkeys 83 | //focus input on a character input or ctrl+[xxx] 84 | !(e.control && ["c", "x"].contains(e.key)) && //but allow copying 85 | isChar(e.code) ) { 86 | self.active.$input.focus(); 87 | } 88 | } 89 | } 90 | }; 91 | 92 | document.addEvents(self._keyboardHandler); 93 | return self; 94 | }, 95 | 96 | killKeyboard: function() { 97 | document.removeEvents(this._keyboardHandler); 98 | this.element.removeEvents(this._keyboardEvents); 99 | this.keyboard.deactivate().stop(); 100 | this.ircKeyboard.deactivate().stop(); 101 | this.keyboard = this.ircKeyboard = null; 102 | return this; 103 | } 104 | }); 105 | -------------------------------------------------------------------------------- /js/src/ui/interfaces/IUIOptions.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Controls options 3 | * 4 | * @depends [config/OptionModel, ui/Theme] 5 | * @provides [ui/UIOptions] 6 | */ 7 | ui.IUIOptions = new Class({ 8 | config: function() { 9 | var self = this; 10 | var options = self.options; 11 | if(self.uiOptions instanceof config.OptionModel) return self; 12 | var uiOptions = self.uiOptions = new config.OptionModel({}, { 13 | defaults: options.uiOptions 14 | }); 15 | var updateStylesheet = self.updateStylesheet.bind(self); 16 | self.theme = new ui.Theme(); 17 | function setNotices() { 18 | var notices = uiOptions.get("standard_notices").concat(uiOptions.get("custom_notices")); 19 | var notifiers = notices 20 | .filter(uiOptions.notice_filter) 21 | .map(function(notice) { 22 | var onotice = { 23 | beep: notice.beep, 24 | flash: notice.flash, 25 | pm: notice.pm, 26 | 27 | mentioned: notice.mentioned, 28 | notus: notice.notus, 29 | highlight: notice.highlight, 30 | tabhl: notice.tabhl, 31 | classes: notice.classes, 32 | types: notice.types 33 | }; 34 | ["msg", "nick", "type"].each(function(type) { 35 | if(notice[type]) { 36 | onotice[type] = new RegExp(notice.autoescape ? String.escapeRegExp(notice[type]) : notice[type],//format regex 37 | notice["case"] ? "i" : "");//set flag 38 | } 39 | }); 40 | 41 | return Object.cleanValues(onotice); 42 | }); 43 | 44 | self.theme.messageParsers.empty().combine(notifiers); 45 | } 46 | uiOptions.on({ 47 | "change:colour": updateStylesheet, 48 | "change:font_size": updateStylesheet, 49 | "change:custom_notices": setNotices, 50 | "change:standard_notices": setNotices, 51 | "change:show_nicklist": function(/*state*/) { 52 | _.invoke(self.windowArray, "toggleNickList"); 53 | }, 54 | "change:completer": function(completer) { 55 | self.commandhistory.options.store = completer.store; 56 | if(!completer.store) self.commandhistory.clear(); 57 | _.invoke(self.windowArray, "toggleAutocomplete", completer.intrusive); 58 | }, 59 | "change:show_timestamps": function(show) { 60 | self.element.toggleClass("hide-timestamps", !show); 61 | } 62 | }); 63 | setNotices(); 64 | 65 | 66 | self._styleSheet = new Element("style").inject(document.head); 67 | 68 | updateStylesheet({ 69 | colour: Object.filter({ 70 | back: options.background, 71 | font: options.font 72 | }, Boolean) 73 | }); 74 | 75 | return self; 76 | }, 77 | 78 | updateStylesheet: function(values) { 79 | var self = this; 80 | util.getTemplate("modifiablecss", function(template) { 81 | var styles = _.merge({}, Browser, self.uiOptions.toJSON(), values); 82 | var stylesheet = template(styles); 83 | 84 | //update stylesheet 85 | var node = self._styleSheet; 86 | if ("styleSheet" in node) { /* ol ie */ 87 | node.styleSheet.cssText = stylesheet; 88 | } else { 89 | node.empty() 90 | .appendText(stylesheet); 91 | } 92 | }); 93 | } 94 | }); -------------------------------------------------------------------------------- /js/src/ui/panes/ChannelList.js: -------------------------------------------------------------------------------- 1 | // <% if(pkg.build["atheme"]) { %> only include this code if "atheme" set in package.json 2 | /** 3 | * chan list view 4 | * 5 | * @depends [panes/PanelView, atheme] 6 | * @provides [panes/Channels] 7 | */ 8 | ui.ChannelList = new Class({ 9 | Extends: PanelView, 10 | options: { 11 | pane: "channel-list", 12 | i18n: "channels", 13 | events: { 14 | "click:relay(.refresh)": "postRender", 15 | "keypress:relay(input.filter)": "update", 16 | "change:relay(input.filter)": "update", 17 | 18 | "click:relay(.internal,.chan)": "join", 19 | "dblclick:relay(.channels [data-channel])": "join" 20 | }, 21 | limit: 100, 22 | chanmask: "", 23 | topicmask: "", 24 | 25 | onJoin: function(e,target) { 26 | this.fireEvent("addChannel", target.get("data-channel") || target.val() || target.get("href")); 27 | } 28 | }, 29 | 30 | postRender: function() { 31 | var self = this, 32 | options = self.options; 33 | 34 | irc.atheme.channelList(function(channels) { 35 | self.chanList = channels.map(function(channel) { 36 | return _.assign(channel, "topic", util.urlifier.parse(channel.topic));//urlify the channel - doesn't do colours yet 37 | }); 38 | self.update(); 39 | }, 0, options.limit, 1, options.chanmask, options.topicmask); 40 | }, 41 | 42 | update: _.debounce(function() { 43 | var self = this; 44 | var userFilter = self.element.getElement("input.filter").val(); 45 | var filterExp = new RegExp(String.escapeRegExp(userFilter), "i"); //jsperf.com/contains-ignore-case 46 | util.getTemplate("channel-list-content", function(template) { 47 | self.element.getElement(".channels tbody").html(template({ 48 | channels: self.chanList.filter(function(chan) { 49 | return !userFilter || filterExp.test(chan.name) || filterExp.test(chan.topic); 50 | }) 51 | })); 52 | }); 53 | }, 50) 54 | }); 55 | //<% } %> -------------------------------------------------------------------------------- /js/src/ui/panes/PanelView.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Base view to be inheritted 3 | * 4 | * @depends [components/loader, util/uihelpers] 5 | * @provides [panes/PanelView] 6 | */ 7 | /* exported PanelView */ 8 | var PanelView = ui.PanelView = new Class({ 9 | Extends: Epitome.View, 10 | options: { 11 | pane: "", 12 | // i18n: "mypanel", 13 | deps: [], 14 | 15 | events: { 16 | "click:relay([data-event='close'])": "_close" 17 | }, 18 | 19 | onReady: function() { 20 | return this.render(); 21 | } 22 | }, 23 | 24 | getData: function() { 25 | return this.model && this.model.toJSON() || this.options && this.options.data || {}; 26 | }, 27 | 28 | render: function() { 29 | var self = this.empty(); 30 | var $loader = Element.from(templates.loadingPage()).inject(self.element); 31 | var loadPromises = [util.getTemplate(self.options.pane), components.loader.load(self.options.deps)]; 32 | if (self.options.i18n) { 33 | loadPromises.push(lang.load("panes/" + self.options.i18n)); 34 | } 35 | 36 | Promise.all(loadPromises) 37 | .then(function(results) { 38 | //results[0] is the template 39 | self.element.adopt(Elements.from(results[0](self.getData())));//not inject because it can have text nodes 40 | $loader.dispose(); 41 | self.postRender(); 42 | }); 43 | return self.parent(); 44 | }, 45 | 46 | postRender: function() { 47 | ui.Behaviour.apply(this.element); //note not native apply (gotcha) 48 | return this; 49 | }, 50 | 51 | empty: function() { 52 | return this.parent(true); 53 | }, 54 | 55 | _close: function() { 56 | return this.trigger("close").destroy(); 57 | } 58 | }); -------------------------------------------------------------------------------- /js/src/ui/panes/PrivacyPolicy.js: -------------------------------------------------------------------------------- 1 | /** 2 | * pp view 3 | * 4 | * @depends [panes/PanelView] 5 | * @provides [panes/Privacy] 6 | */ 7 | ui.PrivacyPolicyPane = new Class({ 8 | Extends: PanelView, 9 | options: { 10 | pane: "privacypolicy" 11 | } 12 | }); -------------------------------------------------------------------------------- /js/src/ui/panes/ToggleDesktopNotifications.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @provides [ util/ToggleNotifications] 3 | */ 4 | /* exported toggleNotifications */ 5 | function toggleNotifications(model, state, save) { 6 | if(notify.permissionLevel() !== notify.PERMISSION_GRANTED) { 7 | notify.requestPermission(function() { 8 | toggleNotifications(model, notify.permissionLevel() === notify.PERMISSION_GRANTED, save); 9 | }); 10 | } 11 | else { 12 | model.set("dn_state", state != null ? !!state : !model.get("dn_state")); 13 | } 14 | if(save) model.save(); 15 | } -------------------------------------------------------------------------------- /js/src/ui/panes/about.js: -------------------------------------------------------------------------------- 1 | /** 2 | * About view 3 | * 4 | * @depends [panes/PanelView] 5 | * @provides [panes/About] 6 | */ 7 | ui.AboutPane = new Class({ 8 | Extends: PanelView, 9 | options: { 10 | pane: "about", 11 | data: { 12 | version: qwebirc.VERSION 13 | } 14 | } 15 | }); -------------------------------------------------------------------------------- /js/src/ui/panes/faq.js: -------------------------------------------------------------------------------- 1 | /** 2 | * faq pane 3 | * 4 | * @depends [panes/PanelView] 5 | * @provides [panes/FAQ] 6 | */ 7 | ui.FAQPane = new Class({ 8 | Extends: PanelView, 9 | options: { 10 | pane: "faq" 11 | } 12 | }); -------------------------------------------------------------------------------- /js/src/ui/panes/feedback.js: -------------------------------------------------------------------------------- 1 | /** 2 | * feedback view 3 | * 4 | * @depends [panes/PanelView] 5 | * @provides [panes/Feedback] 6 | */ 7 | ui.FeedbackPane = new Class({ 8 | Extends: PanelView, 9 | options: { 10 | pane: "feedback" 11 | } 12 | }); -------------------------------------------------------------------------------- /js/src/ui/panes/welcome.js: -------------------------------------------------------------------------------- 1 | /** 2 | * welcome view 3 | * 4 | * @depends [panes/PanelView, util/ToggleNotifications] 5 | * @provides [panes/Welcome] 6 | */ 7 | ui.WelcomePane = new Class({ 8 | Extends: PanelView, 9 | options: { 10 | pane: "welcome-pane", 11 | i18n: "welcome", 12 | events: { 13 | "click:relay(.enable-notifications)": "enableNotifications", 14 | "click:relay(.controls)": "controlClick" 15 | }, 16 | onEnableNotifications: function() { 17 | /* global toggleNotifications */ 18 | toggleNotifications(this.ui.uiOptions, true, true); 19 | }, 20 | onControlClick: function(e, controls) { 21 | controls.dispose(); 22 | if(!this.element.getElement(".controls")) this._close(); 23 | } 24 | }, 25 | initialize: function(ui, options) { 26 | this.ui = ui; 27 | this.parent(options); 28 | }, 29 | getData: function() { 30 | return _.extend({}, this.options, { 31 | Browser: window.Browser 32 | }); 33 | } 34 | }) 35 | .extend({ 36 | show: function(_ui, options) {//determines if needs to be shown and shows 37 | if(options.firstvisit || notify.permissionLevel() !== notify.PERMISSION_GRANTED) { 38 | options.element = new Element("div.welcome").inject(options.element); 39 | return new ui.WelcomePane(_ui, options); 40 | } 41 | } 42 | }); -------------------------------------------------------------------------------- /js/src/ui/panes/wizard.js: -------------------------------------------------------------------------------- 1 | /** 2 | * wizard view 3 | * 4 | * @depends [panes/PanelView] 5 | * @provides [panes/Wizard] 6 | */ 7 | ui.EmbedWizard = new Class({ 8 | Extends: PanelView, 9 | options: { 10 | pane: "wizard" 11 | } 12 | }); -------------------------------------------------------------------------------- /js/src/ui/sounds.js: -------------------------------------------------------------------------------- 1 | /** 2 | * see http://indiegamr.com/the-state-of-audio-in-html5-games/ 3 | * @depends [sound] 4 | * @provides [sound/Player] 5 | */ 6 | sound.SoundPlayer = new Class({ 7 | Implements: [Options, Events], 8 | options: { 9 | soundsurl: qwebirc.global.staticBaseURL + "sound/", //directory of sounds for sm 10 | swfurl: qwebirc.global.staticBaseURL + "swf", 11 | flashVersion: 8, 12 | sounds: [], 13 | preferFlash: false //use html5 if possible 14 | }, 15 | loadingSM: false, 16 | 17 | initialize: function(options) { 18 | var self = this.setOptions(options); 19 | var opts = this.options; 20 | 21 | if (self.loadingSM !== false) return; 22 | self.loadingSM = true; 23 | if (self.sm) { 24 | self.fireEvent("ready"); 25 | return; 26 | } 27 | 28 | var soundinit = function() { 29 | var sm = self.sm = window.soundManager; 30 | self.play = sm.play; 31 | //https://www.scirra.com/blog/44/on-html5-audio-formats-aac-and-ogg 32 | sm.setup({ 33 | url: opts.swfurl, 34 | preferFlash: opts.preferFlash, 35 | onready: function() { 36 | opts.sounds.each(function(sound) {//load all sounds here 37 | // self.register(sound.id, opts.soundsurl + sound.url + extension); 38 | sound = _.clone(sound); 39 | sound.url = _.map(sound.url, function(path) { 40 | return path.contains("/") ? path : opts.soundsurl + path; 41 | }); 42 | sm.createSound(sound); 43 | }); 44 | self.loadingSM = false; 45 | self.fireEvent("ready"); 46 | } 47 | }).beginDelayedInit(); 48 | }; 49 | 50 | //load sound manager 51 | if(window.soundManager) { 52 | soundinit(); 53 | } 54 | else {//lazy load 55 | components.loader.javascript("<%= getFileURL('soundManager') %>").then(soundinit);//see gruntfile 56 | } 57 | }, 58 | 59 | register: function(alias,src) { 60 | this.sm.createSound(alias, src); 61 | }, 62 | 63 | isReady: function() { 64 | return this.sm && this.loadingSM === false; 65 | } 66 | }); 67 | -------------------------------------------------------------------------------- /js/src/ui/window/IDetachable.js: -------------------------------------------------------------------------------- 1 | /** 2 | * detachable component 3 | * 4 | * @depends [ui/Window] 5 | * @provides [ui/Detachable] 6 | */ 7 | ui.IDetachableWindow = new Class({ 8 | options: { 9 | events: { 10 | "click:relay(.detached-window .attach)": "attach", 11 | "click:relay(.detached-window .tab-close)": "close" 12 | } 13 | }, 14 | 15 | detached: false, 16 | 17 | attach: function(/*e*/) { 18 | this.detached = false; 19 | 20 | util.resetGrid(this.element).removeClass("detached"); 21 | 22 | this.window.replaces(this.wrapper); 23 | this.wrapper.destroy(); 24 | 25 | this.drag.detach().stop(); 26 | this.resizable.detach().stop(); 27 | this.wrapper = this.resizable = this.drag = null; 28 | 29 | this.parentObject.nav.toggleTab(this.tab.removeClass("detached"), true); 30 | this.select(); 31 | 32 | this.fireEvent("attached"); 33 | }, 34 | 35 | detach: function(/*e*/) { 36 | var self = this, 37 | win = self.window, 38 | po = self.parentObject, 39 | 40 | wrapper = self.wrapper = Element.from(templates.detachedWindow({ 41 | "channel": self.name, 42 | "base": util.isBaseWindow(self.id) 43 | })), 44 | //header = wrapper.getElement(".header"), 45 | 46 | // resizeWrapper = Element.from(templates.resizeHandle()), 47 | // resizeHandle = resizeWrapper.getElement(".resize-handle"); 48 | resizeHandle = wrapper.getElement(".resize-handle"); 49 | 50 | var size = util.percentToPixel({x:40, y:60}, win.getParent(".qwebirc")); 51 | 52 | //as to not mess with other window remove grid 53 | util.removeGrid(self.element).addClass("detached").show(); 54 | 55 | //set size and add detach wrapper to dom 56 | wrapper.setStyles({ 57 | "width": size.x, 58 | "height": size.y 59 | }).replaces(win); 60 | 61 | win.addEvent("mousedown", function(e) { 62 | var tag = e.target.tagName.toLowerCase(); 63 | if(!(tag == "div" || tag == "form"))//prevent dragging if not on container 64 | e.stopPropagation(); 65 | }).inject(wrapper.getElement(".body")); 66 | 67 | self.resizable = wrapper.makeResizable({ 68 | limit: {//min/max 69 | x: [400, null], 70 | y: [200, null] 71 | }, 72 | handle: resizeHandle, 73 | stopPropagation: true, 74 | onDrag: function() { 75 | self.__dirtyFixes(); 76 | } 77 | }); 78 | self.drag = wrapper.makeDraggable({ 79 | handle: wrapper, 80 | includeMargins: true 81 | }); 82 | 83 | /*** update windows and center detached window ****/ 84 | if(self.active) po.nextWindow();//change window if we"re active 85 | self.detached = true; 86 | _.defer(function() { 87 | self.setActive(); 88 | self._selectUpdates(); 89 | wrapper.position(); 90 | }); 91 | 92 | //keeps order 93 | po.nav.toggleTab(self.tab.addClass("detached"), false); 94 | self.fireEvent("detached"); 95 | } 96 | }); 97 | -------------------------------------------------------------------------------- /js/src/util/IRCProcessors.js: -------------------------------------------------------------------------------- 1 | /* jshint boss:true */ 2 | var prefix_re = /^([_a-zA-Z0-9\[\]\/\\`^{}|-]*)(!([^@]+)@(.*))?$/, 3 | hasprefix_re = /^:([^ ]+) +/, 4 | colonrem_re = /^:[^ ]+ +/, 5 | command_re = /^([^ ]+) */, 6 | data_re = /^[^ ]+ +/, 7 | args_re = /^:|\s+:/, 8 | argsm_re = /(.*?)(?:^:|\s+:)(.*)/, 9 | args_split_re = / +/, 10 | NUMERICS = irc.Numerics; 11 | 12 | /* 13 | * Adapted from https://github.com/martynsmith/node-irc - see http://jsperf.com/javascript-irc-parsers for dif implementations 14 | * parseMessage(line, stripColors) 15 | * 16 | * takes a raw "line" from the IRC server and turns it into an object with 17 | * useful keys 18 | * ":OCD!~OCD@76.72.16.142 PRIVMSG #tf2mix :mix servers are down. join mumble for an inhouse pug." => {"prefix":"OCD!~OCD@76.72.16.142","nick":"OCD","user":"~OCD","host":"76.72.16.142","command":"PRIVMSG","rawCommand":"PRIVMSG","commandType":"normal","args":["#tf2mix","mix servers are down. join mumble for an inhouse pug."]} 19 | * 20 | * @depends [irc/Numerics] 21 | * @provides [util/ircprocessor] 22 | */ 23 | function parseIRCMessage(line/*, stripColors*/) { 24 | var message = { 25 | // "raw": line, 26 | "prefix": "" 27 | // "commandType": "normal" 28 | }; 29 | var match; 30 | var middle, trailing; 31 | 32 | /*if (stripColors) { 33 | line = line.replace(/[\x02\x1f\x16\x0f]|\x03\d{0,2}(?:,\d{0,2})?/g, ""); 34 | }*/ 35 | 36 | // Parse prefix 37 | if (match = line.match(hasprefix_re)) { 38 | message.prefix = match[1]; 39 | line = line.replace(colonrem_re, ""); 40 | if (match = message.prefix.match(prefix_re)) { 41 | message.nick = match[1]; 42 | message.user = match[3]; 43 | message.host = match[4]; 44 | } else { 45 | message.server = message.prefix; 46 | } 47 | } 48 | 49 | // Parse command 50 | match = line.match(command_re); 51 | message.rawCommand = match[1]; 52 | message.command = NUMERICS[message.rawCommand] || match[1].toUpperCase(); 53 | line = line.replace(data_re, ""); 54 | 55 | message.args = []; 56 | 57 | // Parse parameters 58 | if (args_re.test(line)) { 59 | match = line.match(argsm_re); 60 | middle = match[1].trimRight(); 61 | trailing = match[2]; 62 | } else { 63 | middle = line; 64 | } 65 | 66 | if (middle) message.args = middle.split(args_split_re); 67 | 68 | if (trailing) message.args.push(trailing); 69 | 70 | return message; 71 | } 72 | 73 | /** 74 | * Parses a preprocessed line from the Qwebirc twisted server 75 | */ 76 | function parseTwistedMessage(data) { 77 | var message = { 78 | // commandType: "normal", 79 | rawCommand: data[1], 80 | command: NUMERICS[data[1]] || data[1], 81 | args: data[3], 82 | prefix: data[2] 83 | }, 84 | match; 85 | 86 | if (match = message.prefix.match(prefix_re)) { 87 | message.nick = match[1]; 88 | message.user = match[3]; 89 | message.host = match[4]; 90 | } else { 91 | message.server = message.prefix; 92 | } 93 | return message; 94 | } 95 | 96 | util.parseIRCMessage = function(message) { 97 | return _.isString(message) ? parseIRCMessage(message) : parseTwistedMessage(message); 98 | }; 99 | 100 | util.processCTCP = function(message) { 101 | if (!message.startsWith("\x01")) return null; 102 | //slice off the end \x01 if its there 103 | message = message.slice(1, message.search(/\x01?$/)); 104 | var ctcp = util.splitMax(message, " ", 2); 105 | ctcp[0] = ctcp[0].toUpperCase(); 106 | return ctcp; 107 | }; -------------------------------------------------------------------------------- /js/src/util/lang.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Home of future localization.... Its gonna be a rough road... 3 | * todo request local.json and ready qwebirc only after its loaded 4 | * 5 | * @depend [qwebirc] 6 | * @provides [lang, util/lang] 7 | */ 8 | 9 | /* global readyPromises */ 10 | 11 | _.extend(lang, { 12 | TYPES: { 13 | ERROR: 0, 14 | INFO: 1, 15 | SERVER: 2, 16 | CHAN: 3, 17 | MESSAGE: 4 18 | } 19 | }); 20 | 21 | 22 | lang.getter = function(prop) { 23 | return function() { 24 | return lang[prop]; 25 | }; 26 | }; 27 | 28 | lang.getFormatter = function(prop, data) { 29 | return function() { 30 | return util.format(lang[prop], data); 31 | }; 32 | }; 33 | 34 | lang.load = function(item) { 35 | return new Request.JSON({ 36 | url: qwebirc.global.dynamicBaseURL + "lang", 37 | method: "GET" 38 | }).send(item ? "path=" + encodeURIComponent(item) : "") 39 | .then(function(json) { 40 | _.merge(lang, json); 41 | return json; 42 | }); 43 | }; 44 | 45 | var langRequest = lang.load(); 46 | 47 | langRequest.then(function() { 48 | //language specific stuff. right now just an object 49 | // can either be a message or array of messages 50 | function setLangType(type) { 51 | return function(prop) { 52 | if (_.isArray(lang[prop])) { 53 | lang[prop].type = type; 54 | } else { 55 | lang[prop] = { 56 | message: lang[prop], 57 | type: type 58 | }; 59 | } 60 | }; 61 | } 62 | 63 | [ 64 | "poorJoinFormat" 65 | ].each(setLangType(lang.TYPES.INFO)); 66 | 67 | [ 68 | "invalidCommand", "invalidChanTarget", "insufficentArgs", 69 | "uncontrolledFlood", "connError", "connTimeOut", "connFail" 70 | ].each(setLangType(lang.TYPES.ERROR)); 71 | }); 72 | 73 | readyPromises.push(langRequest); -------------------------------------------------------------------------------- /lang/Readme.md: -------------------------------------------------------------------------------- 1 | #Localization 2 | 3 | Localization will request files based on the `Accept-Language` in a http request. For instance `Accept-Language=en-US,en;q=0.8,es;q=0.6` will compile a response of `en-US.json + en.json + base.json` assuming they all exist. 4 | 5 | Requires a server with localization (see [this commit](https://github.com/megawac/iris/commit/fed82b8a6a4c9168fda4ee12a657fde5bddfc337)) 6 | 7 | Files in this directory will be converted to minified json in the build step. -------------------------------------------------------------------------------- /lang/panes/channels/base.json: -------------------------------------------------------------------------------- 1 | { 2 | "channels": { 3 | "title": "Channel list", 4 | "filterHeader": "Filter by topic and name" 5 | }, 6 | 7 | "channel" : "Channel", 8 | "users" : "Users", 9 | "topic" : "Topic" 10 | } -------------------------------------------------------------------------------- /lang/panes/options/base.json: -------------------------------------------------------------------------------- 1 | { 2 | "option": { 3 | "interface" : "Interface", 4 | "irc_opts" : "Chat Preferences", 5 | "notices" : "Notifications", 6 | "hotkeys" : "Hot Keys", 7 | 8 | "ENABLE_IMAGE_POPOUT" : "Pop images out on hover..?", 9 | "NICK_OV_STATUS" : "Show status (@/+) before nicknames in channel lines", 10 | "ACCEPT_SERVICE_INVITES" : "Automatically join channels when invited", 11 | "USE_HIDDENHOST" : "Hide your hostmask when authed (+x)", 12 | "LASTPOS_LINE" : "Show a last position indicator for each window", 13 | "HIDE_JOINPARTS" : "Hide JOINS/PARTS/QUITS", 14 | "BACKGROUND" : "Background colour", 15 | "FONT_COLOUR" : "Font colour", 16 | "SHOW_NICKLIST" : "Show nickname list in channels", 17 | "SHOW_TIMESTAMPS" : "Show timestamps", 18 | "FONT_SIZE" : "Font size (px)", 19 | "VOLUME" : "Volume", 20 | "AUTO_OPEN_PM" : "Automatically select window on private message", 21 | "FLASH" : "flash", 22 | "BEEP" : "beep", 23 | "PM" : "pm", 24 | "MENTION" : "mentioned", 25 | "ENABLE_BROUHAHA" : "Enable channel message aggregator (brouhaha)", 26 | "MESSAGE_PLACEHOLDER" : " something ... ", 27 | "NICK_PLACEHOLDER" : " someone ... ", 28 | "TYPE_PLACEHOLDER" : "type test", 29 | "DELETE_NOTICE" : "remove", 30 | "ADD_NOTICE" : "Add notifier", 31 | "USER_NOTICE" : "User:", 32 | "TYPE_NOTICE" : "Type:", 33 | "MESSAGE_NOTICE" : "Message:", 34 | "AUTOESCAPE" : "Escape text", 35 | "MENTIONED" : "Mentioned", 36 | "ESCAPE_HINT" : "This text is transformed into a regular expression - autoescaping will check for the exact text you entered", 37 | "DESKTOP_NOTICES" : "Receive desktop notifications if supported (on any notice with flash)", 38 | "IGNORE_CASE" : "Case insensitive", 39 | "NOTUS" : "Not us", 40 | "NOTUS_HINT" : "Not our message", 41 | "HIGHLIGHT" : "hl", 42 | "HIGHLIGHT_HINT" : "highlight", 43 | "QUIT_MSG" : "Set quit message: ", 44 | 45 | "NOTICE_SOUND" : "Sound played on notice", 46 | "TEST" : "Test", 47 | 48 | "standardNotices" : "Standard Notices", 49 | "customNotices" : "Custom Notices", 50 | 51 | "noticeDuration" : "Notification Duration", 52 | "noticeSupport" : "See notification support", 53 | 54 | "save" : "Save Changes", 55 | "revert" : "Revert" 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /lang/panes/options/en-US.json: -------------------------------------------------------------------------------- 1 | { 2 | "BACKGROUND" : "Background color", 3 | "FONT_COLOUR" : "Font color" 4 | } -------------------------------------------------------------------------------- /lang/panes/welcome/base.json: -------------------------------------------------------------------------------- 1 | { 2 | "welcome": { 3 | "title": "Welcome to {appTitle}", 4 | 5 | "visitOptions": "Also check out the new options", 6 | 7 | "browseHappy": "a current browser release", 8 | "supportsDesktopNotifications": "which supports desktop notifications", 9 | 10 | "enableNotificationMessage": "Before you login please enable desktop notifications", 11 | "enableNotifications": "Enable notifications", 12 | 13 | "noNotificationSupport": "Your browser does not support desktop notifications.", 14 | "considerThis": "Consider installing", 15 | 16 | "chromeFrame": "Chrome Frame for Internet Explorer", 17 | "chromeFrameTut": "You can follow this tutorial to set up chrome frame.", 18 | 19 | "ffExtension": "the Firefox Tab-notifier extension" 20 | } 21 | } -------------------------------------------------------------------------------- /less/.csslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "adjoining-classes": false, 3 | "box-sizing": false, 4 | "box-model": false, 5 | "compatible-vendor-prefixes": false, 6 | "floats": false, 7 | "font-sizes": false, 8 | "gradients": false, 9 | "important": false, 10 | "known-properties": false, 11 | "outline-none": false, 12 | "qualified-headings": false, 13 | "regex-selectors": false, 14 | "shorthand": false, 15 | "text-indent": false, 16 | "unique-headings": false, 17 | "universal-selector": false, 18 | "unqualified-attributes": false 19 | } 20 | -------------------------------------------------------------------------------- /less/bootstrap.less: -------------------------------------------------------------------------------- 1 | // Core variables and mixins 2 | @import "twbs/variables.less"; 3 | @import "twbs/mixins.less"; 4 | 5 | // Reset 6 | @import "twbs/normalize.less"; 7 | @import "twbs/print.less"; 8 | 9 | // Core CSS 10 | @import "twbs/scaffolding.less"; 11 | @import "twbs/type.less"; 12 | // @import "twbs/code.less"; 13 | @import "twbs/grid.less"; 14 | @import "twbs/tables.less"; 15 | @import "twbs/forms.less"; 16 | @import "twbs/buttons.less"; 17 | 18 | // Components 19 | @import "twbs/component-animations.less"; 20 | // @import "twbs/glyphicons.less"; 21 | @import "twbs/dropdowns.less"; 22 | @import "twbs/button-groups.less"; 23 | @import "twbs/input-groups.less"; 24 | @import "twbs/navs.less"; 25 | // @import "twbs/navbar.less"; 26 | // @import "twbs/breadcrumbs.less"; 27 | // @import "twbs/pagination.less"; 28 | @import "twbs/pager.less"; 29 | @import "twbs/labels.less"; 30 | // @import "twbs/badges.less"; 31 | @import "twbs/jumbotron.less"; 32 | // @import "twbs/thumbnails.less"; 33 | @import "twbs/alerts.less"; 34 | // @import "twbs/progress-bars.less"; 35 | // @import "twbs/media.less"; 36 | @import "twbs/list-group.less"; 37 | @import "twbs/panels.less"; 38 | @import "twbs/wells.less"; 39 | @import "twbs/close.less"; 40 | 41 | // Components w/ JavaScript 42 | @import "twbs/modals.less"; 43 | // @import "twbs/tooltip.less"; 44 | @import "twbs/popovers.less"; 45 | // @import "twbs/carousel.less"; 46 | 47 | // Utility classes 48 | @import "twbs/utilities.less"; 49 | @import "twbs/responsive-utilities.less"; 50 | -------------------------------------------------------------------------------- /less/qwebirc.less: -------------------------------------------------------------------------------- 1 | /* 2 | * qwebirc css by Graeme (megawac) Yeates 3 | * https://github.com/megawac/qwebirc-enhancements 4 | */ 5 | 6 | // Load core variables and mixins 7 | @import "twbs/variables.less"; 8 | @import "twbs/mixins.less"; 9 | @import "qwebirc/variables.less"; 10 | 11 | //customize bootstrap 12 | @import "qwebirc/bootstrap-theme"; 13 | 14 | @import "qwebirc/core"; 15 | @import "qwebirc/tabbar"; 16 | @import "qwebirc/panels"; 17 | @import "qwebirc/loginbox"; 18 | @import "qwebirc/detached-window"; 19 | 20 | @import "qwebirc/irc-colours"; 21 | 22 | 23 | //QUI Theme 24 | @import "qwebirc/qui"; 25 | -------------------------------------------------------------------------------- /less/qwebirc/bootstrap-theme.less: -------------------------------------------------------------------------------- 1 | /*** old bootstrap btn:default *****/ 2 | @send-grey: #474949; 3 | @send-grey-back: darken(@send-grey, 20%); 4 | 5 | // .send:hover, 6 | // .send:focus, 7 | // .send:active, 8 | // .send.active { 9 | // background-color: #3a3c3c; 10 | // border-color: #2e2f2f; 11 | // } 12 | 13 | .qwebirc { 14 | 15 | //remove bold... 16 | input { 17 | font-weight: 500; 18 | } 19 | 20 | .send { 21 | .button-variant(grey; @send-grey; @send-grey-back); 22 | padding: 2px 10px; 23 | } 24 | // http://www.helloerik.com/column-examples/example4.html 25 | //Probably shouldnt do this as its included in 3.1 with different padding 26 | .container-fluid { 27 | padding: 0; 28 | // margin: 0 auto; 29 | } 30 | 31 | // Loop over each grid item and generate the css to remove padding 32 | //http://stackoverflow.com/questions/15239785/how-to-generate-css-with-loop-in-less 33 | // .remove-padding(@class) { 34 | // .col (@index) when (@index =< @grid-columns) { 35 | // @item: ".col-@{class}-@{index}"; 36 | 37 | // @{item} { 38 | // padding: 5px; 39 | // } 40 | 41 | // // next iteration 42 | // .col((@index + 1)); 43 | // } 44 | // .col(1); 45 | // } 46 | 47 | // // "call" the remove-padding the first time with highest value 48 | // .remove-padding (xs); 49 | // .remove-padding (sm); 50 | 51 | .make-grid-columns() { 52 | @grid-gutter-width: 0; 53 | // Common styles for all sizes of grid columns, widths 1-12 54 | .col(@index) when (@index = 1) { // initial 55 | @item: ~".col-xs-@{index}, .col-sm-@{index}, .col-md-@{index}, .col-lg-@{index}, .col-xl-@{index}"; 56 | .col((@index + 1), @item); 57 | } 58 | .col(@index, @list) when (@index =< @grid-columns) { // general; "=<" isn't a typo 59 | @item: ~".col-xs-@{index}, .col-sm-@{index}, .col-md-@{index}, .col-lg-@{index}, .col-xl-@{index}"; 60 | .col((@index + 1), ~"@{list}, @{item}"); 61 | } 62 | .col(@index, @list) when (@index > @grid-columns) { // terminal 63 | @{list} { 64 | position: relative; 65 | // Prevent columns from collapsing when empty 66 | min-height: 1px; 67 | // Inner gutter via padding 68 | padding-left: (@grid-gutter-width / 2); 69 | padding-right: (@grid-gutter-width / 2); 70 | } 71 | } 72 | .col(1); // kickstart it 73 | } 74 | 75 | .make-grid-columns(); 76 | 77 | 78 | @screen-xl-min: 1500px; 79 | 80 | @media (min-width: @screen-xl-min) { 81 | .make-grid(xl); 82 | } 83 | 84 | } -------------------------------------------------------------------------------- /less/qwebirc/core.less: -------------------------------------------------------------------------------- 1 | /*! qwebirc -- Copyright (C) 2008-2012 Chris Porter and the qwebirc project --- All rights reserved. */ 2 | 3 | #noscript { 4 | text-align: center; 5 | font-weight: bold; 6 | } 7 | 8 | html, body { 9 | height: 100%; 10 | } 11 | 12 | 13 | // Core QWebirc styles and helpers 14 | 15 | .qwebirc { 16 | height: 100%; 17 | width: 100%; 18 | overflow: hidden; 19 | font-family: @qweb-sans-serif; 20 | 21 | // MISC 22 | &.signed-in .buttons { 23 | display: inline-block; 24 | cursor: pointer; 25 | } 26 | .modal .alert { 27 | margin: 0; 28 | } 29 | 30 | .modal .modal-footer { 31 | margin: 0; 32 | padding: 10px 20px 10px; 33 | } 34 | 35 | .btn-smaller { 36 | padding: 2px 5px; 37 | font-size: 12px; 38 | line-height: 1.5; 39 | border-radius: 3px; 40 | } 41 | 42 | 43 | .attach, .detach, .tab-close { 44 | cursor: pointer; 45 | } 46 | 47 | .handle { 48 | z-index: 2; 49 | position: absolute; 50 | background-repeat: no-repeat; 51 | margin: auto; 52 | } 53 | 54 | .buttons span { 55 | vertical-align: middle; 56 | display: inline-block; 57 | } 58 | 59 | .buttons { 60 | display: none; 61 | } 62 | 63 | .center { 64 | margin-top: 5%; 65 | } 66 | 67 | .init-channels { 68 | font-size: 95%; 69 | text-align: center; 70 | color: #928D8D; 71 | } 72 | 73 | .monospace { 74 | font-family: @qweb-mono; 75 | } 76 | 77 | /*.handle.vertical { 78 | top: 0; 79 | bottom: 0; 80 | width: 10px; 81 | cursor: col-resize; 82 | z-index: 10; 83 | } 84 | .qui .show-nicklist .content .handle { 85 | display: block; 86 | } 87 | .handle.horizontal { 88 | height: 10px; 89 | cursor: row-resize; 90 | left: 0; 91 | right: 0; 92 | z-index: 10; 93 | }*/ 94 | 95 | .loading { 96 | padding-left: 4px; 97 | padding-top: 3px; 98 | font-size: 0.8em; 99 | } 100 | 101 | } 102 | 103 | @import "input"; -------------------------------------------------------------------------------- /less/qwebirc/detached-window.less: -------------------------------------------------------------------------------- 1 | .qwebirc .detached { 2 | height: 0 !important; //override window wrapper default height 3 | 4 | .detached-window { 5 | border-radius: 5px; 6 | border: 4px solid #800000; 7 | z-index: 2; 8 | 9 | transform: translateZ(0); 10 | 11 | .body { 12 | position: absolute; 13 | top: 25px; 14 | bottom: 0; 15 | width: 100%; 16 | } 17 | } 18 | .header { 19 | padding: 4px 0; 20 | .title { 21 | padding-left: 10px; 22 | font-weight: bold; 23 | font-size: 16px; 24 | } 25 | 26 | .controls .entypo { 27 | font-size: 1.2em; 28 | padding-right: 4px; 29 | } 30 | } 31 | .resize-handle { 32 | margin: -35px -5px 0 0; 33 | padding: 0 5px 5px 0; 34 | position: absolute; 35 | bottom: 0; 36 | right: 0; 37 | cursor: se-resize; 38 | 39 | // transform: rotate(180deg); 40 | // writing-mode: bt-rl; 41 | } 42 | } 43 | 44 | .detached.active .detached-window { 45 | z-index: 10; 46 | } -------------------------------------------------------------------------------- /less/qwebirc/image-popover.less: -------------------------------------------------------------------------------- 1 | .qui .image-popover { 2 | max-width: none; 3 | 4 | .payload { 5 | max-width: 550px; 6 | max-height: 500px; 7 | } 8 | } -------------------------------------------------------------------------------- /less/qwebirc/input.less: -------------------------------------------------------------------------------- 1 | /* type ahead and input decorations */ 2 | .qwebirc { 3 | .tt-query { 4 | padding: 0; 5 | height: 26px; 6 | text-indent: 5px; 7 | position: relative; 8 | vertical-align: top; 9 | background-color: transparent; 10 | } 11 | 12 | //moved decoration to mcss 13 | .tt-hint { 14 | position: absolute; 15 | top: 0px; 16 | left: 0px; 17 | padding: 0; 18 | text-indent: 5px; 19 | box-shadow: none; 20 | color: #BDBDBD; 21 | } 22 | } 23 | 24 | /*end typeahead*/ -------------------------------------------------------------------------------- /less/qwebirc/irc-colours.less: -------------------------------------------------------------------------------- 1 | /*Highlighting*/ 2 | .lines, .colourline { 3 | 4 | .irc-fg0 { 5 | color: white; 6 | } 7 | 8 | .irc-fg1 { 9 | color: black; 10 | } 11 | 12 | .irc-fg2 { 13 | color: darkBlue; 14 | } 15 | 16 | .irc-fg3 { 17 | color: darkGreen; 18 | } 19 | 20 | .irc-fg4 { 21 | color: red; 22 | } 23 | 24 | .irc-fg5 { 25 | color: darkRed; 26 | } 27 | 28 | .irc-fg6 { 29 | color: purple; 30 | } 31 | 32 | .irc-fg7 { 33 | color: orange; 34 | } 35 | 36 | .irc-fg8 { 37 | color: yellow; 38 | } 39 | 40 | .irc-fg9 { 41 | color: green; 42 | } 43 | 44 | .irc-fg10 { 45 | color: teal; 46 | } 47 | 48 | .irc-fg11 { 49 | color: cyan; 50 | } 51 | 52 | .irc-fg12 { 53 | color: blue; 54 | } 55 | 56 | .irc-fg13 { 57 | color: fuchsia; 58 | } 59 | 60 | .irc-fg14 { 61 | color: dimGray; 62 | } 63 | 64 | .irc-fg15 { 65 | color: lightGray; 66 | } 67 | 68 | .irc-bg0 { 69 | background-color: white; 70 | } 71 | 72 | .irc-bg1 { 73 | background-color: black; 74 | } 75 | 76 | .irc-bg2 { 77 | background-color: darkBlue; 78 | } 79 | 80 | .irc-bg3 { 81 | background-color: darkGreen; 82 | } 83 | 84 | .irc-bg4 { 85 | background-color: red; 86 | } 87 | 88 | .irc-bg5 { 89 | background-color: darkRed; 90 | } 91 | 92 | .irc-bg6 { 93 | background-color: purple; 94 | } 95 | 96 | .irc-bg7 { 97 | background-color: orange; 98 | } 99 | 100 | .irc-bg8 { 101 | background-color: yellow; 102 | } 103 | 104 | .irc-bg9 { 105 | background-color: green; 106 | } 107 | 108 | .irc-bg10 { 109 | background-color: teal; 110 | } 111 | 112 | .irc-bg11 { 113 | background-color: cyan; 114 | } 115 | 116 | .irc-bg12 { 117 | background-color: blue; 118 | } 119 | 120 | .irc-bg13 { 121 | background-color: fuchsia; 122 | } 123 | 124 | .irc-bg14 { 125 | background-color: dimGray; 126 | } 127 | 128 | .irc-bg15 { 129 | background-color: lightGray; 130 | } 131 | 132 | .irc-bold { 133 | font-weight: bold; 134 | } 135 | 136 | .irc-underline { 137 | text-decoration: underline; 138 | } 139 | 140 | .irc-italic { 141 | font-style:italic 142 | } 143 | 144 | .warn { 145 | background-color: #ff9090; 146 | } 147 | 148 | .info { 149 | background-color: #9090ff; 150 | } 151 | } 152 | 153 | .lines .chan-notice, .lines .priv-notice { 154 | background-color: yellow !important; 155 | font-weight: bold; 156 | } 157 | 158 | .lines .server-notice { 159 | background: #C9C3B2; 160 | } 161 | -------------------------------------------------------------------------------- /less/qwebirc/irc-op-status.less: -------------------------------------------------------------------------------- 1 | .qwebirc { 2 | 3 | .user .status { 4 | border-radius: 50%; 5 | display: inline-block; 6 | margin-right: 3px; 7 | } 8 | 9 | .status { 10 | &.animate { 11 | animation-name: spin; 12 | animation-duration: 3s; 13 | animation-iteration-count: infinite; 14 | animation-timing-function: linear; 15 | 16 | width: 8px; 17 | height: 8px; 18 | } 19 | 20 | &.voice { 21 | background-color: rgb(223, 187, 47); 22 | background-image: radial-gradient(circle, yellow 0%, orange 100%, red 95%); 23 | } 24 | 25 | &.op { 26 | background-color: #7AE60E; 27 | background-image: radial-gradient(circle, #5fff4a 3%, #7ae60e 76%); 28 | 29 | // background-image: radial-gradient(45px 45px 45deg, circle, #5FFF4A 3%, #7AE60E 76%); 30 | // background-image: -moz-radial-gradient(45px 45px 45deg, circle, #5FFF4A 3%, #7AE60E 76%); 31 | // background-image: -o-radial-gradient(45px 45px, circle, #5FFF4A 3%, #7AE60E 76%); 32 | // background-image: -webkit-radial-gradient(45px 45px, circle, #5FFF4A 3%, #7AE60E 76%); 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /less/qwebirc/loginbox.less: -------------------------------------------------------------------------------- 1 | .qwebirc .window .login { 2 | text-align: center; 3 | // width: 500px; 4 | margin: 0 auto 5px; 5 | 6 | 7 | &.hide-auth .auth { 8 | display: none; 9 | visibility: hidden; 10 | } 11 | 12 | div { 13 | width: 385px; 14 | margin: .25em auto; 15 | } 16 | 17 | > * { 18 | margin: .5em 0; 19 | } 20 | 21 | .login-field { 22 | margin: 0 auto; 23 | input { 24 | width: 200px; 25 | } 26 | } 27 | 28 | input { 29 | margin-left: 5px; 30 | } 31 | 32 | .form-control { 33 | display: inline; 34 | height: auto; 35 | padding: 4px 8px; 36 | font-size: inherit; 37 | line-height: inherit; 38 | } 39 | } 40 | 41 | /************* Welcome *****************/ 42 | .qwebirc .welcome { 43 | position: absolute; 44 | bottom: 0; 45 | right: 10px; 46 | max-width: 700px; 47 | } -------------------------------------------------------------------------------- /less/qwebirc/panels.less: -------------------------------------------------------------------------------- 1 | @select-width: 200px; 2 | 3 | .qwebirc .custom { 4 | //generics 5 | .container { 6 | text-align: center; 7 | } 8 | 9 | .header { 10 | background: white; 11 | text-align: center; 12 | border-bottom: 1px solid gray; 13 | padding-top: 5px; 14 | padding-bottom: 5px; 15 | 16 | .subtitle { 17 | text-align: center; 18 | margin-top: 10px; 19 | } 20 | } 21 | 22 | .title { 23 | font-size: 3em; 24 | } 25 | 26 | table { 27 | display: inline-block; 28 | } 29 | } 30 | 31 | 32 | //************* OPTIONS ***************** 33 | .qwebirc .window .options { 34 | padding-left: 25px; 35 | padding-top: 25px; 36 | overflow-y: scroll; 37 | 38 | .actions button { 39 | margin-right: 5px; 40 | } 41 | 42 | .ui-options { 43 | .controls { 44 | padding-bottom: 4px; 45 | } 46 | input { 47 | &.color, &[type="number"] { 48 | width: 60px; 49 | float: left; 50 | margin-left: 10px; 51 | margin-right: 10px; 52 | } 53 | } 54 | } 55 | 56 | .control-label-inline select { 57 | display: inline; 58 | width: @select-width; //requires a width to be set :/ 59 | margin: 0 5px; 60 | } 61 | } 62 | 63 | /**************** Channel list *****************/ 64 | .qwebirc .channel-list { 65 | 66 | .heading { 67 | display: inline-block; 68 | font-size: 18px; 69 | } 70 | .filters { 71 | display: inline-block; 72 | font-size: 14px; 73 | float: right; 74 | } 75 | 76 | .filters label { 77 | margin-right: 5px; 78 | } 79 | table td { 80 | vertical-align: middle; 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /less/qwebirc/tabbar.less: -------------------------------------------------------------------------------- 1 | .qwebirc { 2 | 3 | .outertabbar { 4 | height: 26px; 5 | line-height: 20px; 6 | padding: 2px 0; 7 | 8 | > * { 9 | vertical-align: top; 10 | } 11 | 12 | .dropdown-tab { 13 | cursor: pointer; cursor: hand; 14 | display: inline-block; 15 | padding-left: 4px; 16 | width: 30px; 17 | } 18 | } 19 | 20 | .tabbar { 21 | display: inline-block; 22 | overflow-x: hidden; 23 | margin-left: 10px; 24 | font-size: 13px; 25 | height: 22px; 26 | 27 | .tab { 28 | padding: 2px; 29 | padding-right: 4px; 30 | cursor: default; 31 | margin-right: 3px; 32 | white-space: nowrap; 33 | font-weight: bold; 34 | border-radius: 4px; 35 | 36 | user-select: none; 37 | 38 | &:hover,&.selected { 39 | background: #fff; 40 | background: rgba(255, 255, 255, 0.9); 41 | } 42 | &.brouhaha { 43 | background-image: url("/images/b_background_unsel.gif"); 44 | padding-left: 65px; //width wont work here 45 | opacity: 0.8; 46 | 47 | &.selected { 48 | background-image: url("/images/b_background_sel2.gif"); 49 | } 50 | } 51 | 52 | &.hilight-activity { 53 | color: #009900; 54 | } 55 | &.hilight-speech { 56 | color: #0000ff; 57 | } 58 | &.hilight-us { 59 | color: #ff0000; 60 | background: #d8d88a; 61 | } 62 | } 63 | 64 | // too small imo at 10px 65 | .tab-close { 66 | font-size: 12px; 67 | padding-left: 3px; 68 | } 69 | .detach { 70 | font-size: 10px; 71 | padding-left: 3px; 72 | } 73 | } 74 | } -------------------------------------------------------------------------------- /less/qwebirc/variables.less: -------------------------------------------------------------------------------- 1 | //Import fonts 2 | // even though these are pretty slow to load as all the content is dynamic I dont think it will matter too much. Gotta profile... 3 | 4 | @qweb-sans-serif: Verdana, sans-serif; 5 | // @qweb-serif: "Tinos", Georgia, serif; 6 | @qweb-mono: Consolas, "Lucida Console", monospace; 7 | 8 | 9 | @qweb-lines: @qweb-mono; -------------------------------------------------------------------------------- /less/twbs/alerts.less: -------------------------------------------------------------------------------- 1 | // 2 | // Alerts 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base styles 7 | // ------------------------- 8 | 9 | .alert { 10 | padding: @alert-padding; 11 | margin-bottom: @line-height-computed; 12 | border: 1px solid transparent; 13 | border-radius: @alert-border-radius; 14 | 15 | // Headings for larger alerts 16 | h4 { 17 | margin-top: 0; 18 | // Specified for the h4 to prevent conflicts of changing @headings-color 19 | color: inherit; 20 | } 21 | // Provide class for links that match alerts 22 | .alert-link { 23 | font-weight: @alert-link-font-weight; 24 | } 25 | 26 | // Improve alignment and spacing of inner content 27 | > p, 28 | > ul { 29 | margin-bottom: 0; 30 | } 31 | > p + p { 32 | margin-top: 5px; 33 | } 34 | } 35 | 36 | // Dismissable alerts 37 | // 38 | // Expand the right padding and account for the close button's positioning. 39 | 40 | .alert-dismissable { 41 | padding-right: (@alert-padding + 20); 42 | 43 | // Adjust close link position 44 | .close { 45 | position: relative; 46 | top: -2px; 47 | right: -21px; 48 | color: inherit; 49 | } 50 | } 51 | 52 | // Alternate styles 53 | // 54 | // Generate contextual modifier classes for colorizing the alert. 55 | 56 | .alert-success { 57 | .alert-variant(@alert-success-bg; @alert-success-border; @alert-success-text); 58 | } 59 | .alert-info { 60 | .alert-variant(@alert-info-bg; @alert-info-border; @alert-info-text); 61 | } 62 | .alert-warning { 63 | .alert-variant(@alert-warning-bg; @alert-warning-border; @alert-warning-text); 64 | } 65 | .alert-danger { 66 | .alert-variant(@alert-danger-bg; @alert-danger-border; @alert-danger-text); 67 | } 68 | -------------------------------------------------------------------------------- /less/twbs/badges.less: -------------------------------------------------------------------------------- 1 | // 2 | // Badges 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base classes 7 | .badge { 8 | display: inline-block; 9 | min-width: 10px; 10 | padding: 3px 7px; 11 | font-size: @font-size-small; 12 | font-weight: @badge-font-weight; 13 | color: @badge-color; 14 | line-height: @badge-line-height; 15 | vertical-align: baseline; 16 | white-space: nowrap; 17 | text-align: center; 18 | background-color: @badge-bg; 19 | border-radius: @badge-border-radius; 20 | 21 | // Empty badges collapse automatically (not available in IE8) 22 | &:empty { 23 | display: none; 24 | } 25 | 26 | // Quick fix for badges in buttons 27 | .btn & { 28 | position: relative; 29 | top: -1px; 30 | } 31 | .btn-xs & { 32 | top: 0; 33 | padding: 1px 5px; 34 | } 35 | } 36 | 37 | // Hover state, but only for links 38 | a.badge { 39 | &:hover, 40 | &:focus { 41 | color: @badge-link-hover-color; 42 | text-decoration: none; 43 | cursor: pointer; 44 | } 45 | } 46 | 47 | // Account for counters in navs 48 | a.list-group-item.active > .badge, 49 | .nav-pills > .active > a > .badge { 50 | color: @badge-active-color; 51 | background-color: @badge-active-bg; 52 | } 53 | .nav-pills > li > a > .badge { 54 | margin-left: 3px; 55 | } 56 | -------------------------------------------------------------------------------- /less/twbs/breadcrumbs.less: -------------------------------------------------------------------------------- 1 | // 2 | // Breadcrumbs 3 | // -------------------------------------------------- 4 | 5 | 6 | .breadcrumb { 7 | padding: @breadcrumb-padding-vertical @breadcrumb-padding-horizontal; 8 | margin-bottom: @line-height-computed; 9 | list-style: none; 10 | background-color: @breadcrumb-bg; 11 | border-radius: @border-radius-base; 12 | 13 | > li { 14 | display: inline-block; 15 | 16 | + li:before { 17 | content: "@{breadcrumb-separator}\00a0"; // Unicode space added since inline-block means non-collapsing white-space 18 | padding: 0 5px; 19 | color: @breadcrumb-color; 20 | } 21 | } 22 | 23 | > .active { 24 | color: @breadcrumb-active-color; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /less/twbs/close.less: -------------------------------------------------------------------------------- 1 | // 2 | // Close icons 3 | // -------------------------------------------------- 4 | 5 | 6 | .close { 7 | float: right; 8 | font-size: (@font-size-base * 1.5); 9 | font-weight: @close-font-weight; 10 | line-height: 1; 11 | color: @close-color; 12 | text-shadow: @close-text-shadow; 13 | .opacity(.2); 14 | 15 | &:hover, 16 | &:focus { 17 | color: @close-color; 18 | text-decoration: none; 19 | cursor: pointer; 20 | .opacity(.5); 21 | } 22 | 23 | // Additional properties for button version 24 | // iOS requires the button element instead of an anchor tag. 25 | // If you want the anchor version, it requires `href="#"`. 26 | button& { 27 | padding: 0; 28 | cursor: pointer; 29 | background: transparent; 30 | border: 0; 31 | -webkit-appearance: none; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /less/twbs/code.less: -------------------------------------------------------------------------------- 1 | // 2 | // Code (inline and block) 3 | // -------------------------------------------------- 4 | 5 | 6 | // Inline and block code styles 7 | code, 8 | kbd, 9 | pre, 10 | samp { 11 | font-family: @font-family-monospace; 12 | } 13 | 14 | // Inline code 15 | code { 16 | padding: 2px 4px; 17 | font-size: 90%; 18 | color: @code-color; 19 | background-color: @code-bg; 20 | white-space: nowrap; 21 | border-radius: @border-radius-base; 22 | } 23 | 24 | // User input typically entered via keyboard 25 | kbd { 26 | padding: 2px 4px; 27 | font-size: 90%; 28 | color: @kbd-color; 29 | background-color: @kbd-bg; 30 | border-radius: @border-radius-small; 31 | box-shadow: inset 0 -1px 0 rgba(0,0,0,.25); 32 | } 33 | 34 | // Blocks of code 35 | pre { 36 | display: block; 37 | padding: ((@line-height-computed - 1) / 2); 38 | margin: 0 0 (@line-height-computed / 2); 39 | font-size: (@font-size-base - 1); // 14px to 13px 40 | line-height: @line-height-base; 41 | word-break: break-all; 42 | word-wrap: break-word; 43 | color: @pre-color; 44 | background-color: @pre-bg; 45 | border: 1px solid @pre-border-color; 46 | border-radius: @border-radius-base; 47 | 48 | // Account for some code outputs that place code tags in pre tags 49 | code { 50 | padding: 0; 51 | font-size: inherit; 52 | color: inherit; 53 | white-space: pre-wrap; 54 | background-color: transparent; 55 | border-radius: 0; 56 | } 57 | } 58 | 59 | // Enable scrollable blocks of code 60 | .pre-scrollable { 61 | max-height: @pre-scrollable-max-height; 62 | overflow-y: scroll; 63 | } 64 | -------------------------------------------------------------------------------- /less/twbs/component-animations.less: -------------------------------------------------------------------------------- 1 | // 2 | // Component animations 3 | // -------------------------------------------------- 4 | 5 | // Heads up! 6 | // 7 | // We don't use the `.opacity()` mixin here since it causes a bug with text 8 | // fields in IE7-8. Source: https://github.com/twitter/bootstrap/pull/3552. 9 | 10 | .fade { 11 | opacity: 0; 12 | .transition(opacity .15s linear); 13 | &.in { 14 | opacity: 1; 15 | } 16 | } 17 | 18 | .collapse { 19 | display: none; 20 | &.in { 21 | display: block; 22 | } 23 | } 24 | .collapsing { 25 | position: relative; 26 | height: 0; 27 | overflow: hidden; 28 | .transition(height .35s ease); 29 | } 30 | -------------------------------------------------------------------------------- /less/twbs/grid.less: -------------------------------------------------------------------------------- 1 | // 2 | // Grid system 3 | // -------------------------------------------------- 4 | 5 | 6 | // Container widths 7 | // 8 | // Set the container width, and override it for fixed navbars in media queries. 9 | 10 | .container { 11 | .container-fixed(); 12 | 13 | @media (min-width: @screen-sm-min) { 14 | width: @container-sm; 15 | } 16 | @media (min-width: @screen-md-min) { 17 | width: @container-md; 18 | } 19 | @media (min-width: @screen-lg-min) { 20 | width: @container-lg; 21 | } 22 | } 23 | 24 | 25 | // Fluid container 26 | // 27 | // Utilizes the mixin meant for fixed width containers, but without any defined 28 | // width for fluid, full width layouts. 29 | 30 | .container-fluid { 31 | .container-fixed(); 32 | } 33 | 34 | 35 | // Row 36 | // 37 | // Rows contain and clear the floats of your columns. 38 | 39 | .row { 40 | .make-row(); 41 | } 42 | 43 | 44 | // Columns 45 | // 46 | // Common styles for small and large grid columns 47 | 48 | .make-grid-columns(); 49 | 50 | 51 | // Extra small grid 52 | // 53 | // Columns, offsets, pushes, and pulls for extra small devices like 54 | // smartphones. 55 | 56 | .make-grid(xs); 57 | 58 | 59 | // Small grid 60 | // 61 | // Columns, offsets, pushes, and pulls for the small device range, from phones 62 | // to tablets. 63 | 64 | @media (min-width: @screen-sm-min) { 65 | .make-grid(sm); 66 | } 67 | 68 | 69 | // Medium grid 70 | // 71 | // Columns, offsets, pushes, and pulls for the desktop device range. 72 | 73 | @media (min-width: @screen-md-min) { 74 | .make-grid(md); 75 | } 76 | 77 | 78 | // Large grid 79 | // 80 | // Columns, offsets, pushes, and pulls for the large desktop device range. 81 | 82 | @media (min-width: @screen-lg-min) { 83 | .make-grid(lg); 84 | } 85 | -------------------------------------------------------------------------------- /less/twbs/jumbotron.less: -------------------------------------------------------------------------------- 1 | // 2 | // Jumbotron 3 | // -------------------------------------------------- 4 | 5 | 6 | .jumbotron { 7 | padding: @jumbotron-padding; 8 | margin-bottom: @jumbotron-padding; 9 | color: @jumbotron-color; 10 | background-color: @jumbotron-bg; 11 | 12 | h1, 13 | .h1 { 14 | color: @jumbotron-heading-color; 15 | } 16 | p { 17 | margin-bottom: (@jumbotron-padding / 2); 18 | font-size: @jumbotron-font-size; 19 | font-weight: 200; 20 | } 21 | 22 | .container & { 23 | border-radius: @border-radius-large; // Only round corners at higher resolutions if contained in a container 24 | } 25 | 26 | .container { 27 | max-width: 100%; 28 | } 29 | 30 | @media screen and (min-width: @screen-sm-min) { 31 | padding-top: (@jumbotron-padding * 1.6); 32 | padding-bottom: (@jumbotron-padding * 1.6); 33 | 34 | .container & { 35 | padding-left: (@jumbotron-padding * 2); 36 | padding-right: (@jumbotron-padding * 2); 37 | } 38 | 39 | h1, 40 | .h1 { 41 | font-size: (@font-size-base * 4.5); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /less/twbs/labels.less: -------------------------------------------------------------------------------- 1 | // 2 | // Labels 3 | // -------------------------------------------------- 4 | 5 | .label { 6 | display: inline; 7 | padding: .2em .6em .3em; 8 | font-size: 75%; 9 | font-weight: bold; 10 | line-height: 1; 11 | color: @label-color; 12 | text-align: center; 13 | white-space: nowrap; 14 | vertical-align: baseline; 15 | border-radius: .25em; 16 | 17 | // Add hover effects, but only for links 18 | &[href] { 19 | &:hover, 20 | &:focus { 21 | color: @label-link-hover-color; 22 | text-decoration: none; 23 | cursor: pointer; 24 | } 25 | } 26 | 27 | // Empty labels collapse automatically (not available in IE8) 28 | &:empty { 29 | display: none; 30 | } 31 | 32 | // Quick fix for labels in buttons 33 | .btn & { 34 | position: relative; 35 | top: -1px; 36 | } 37 | } 38 | 39 | // Colors 40 | // Contextual variations (linked labels get darker on :hover) 41 | 42 | .label-default { 43 | .label-variant(@label-default-bg); 44 | } 45 | 46 | .label-primary { 47 | .label-variant(@label-primary-bg); 48 | } 49 | 50 | .label-success { 51 | .label-variant(@label-success-bg); 52 | } 53 | 54 | .label-info { 55 | .label-variant(@label-info-bg); 56 | } 57 | 58 | .label-warning { 59 | .label-variant(@label-warning-bg); 60 | } 61 | 62 | .label-danger { 63 | .label-variant(@label-danger-bg); 64 | } 65 | -------------------------------------------------------------------------------- /less/twbs/list-group.less: -------------------------------------------------------------------------------- 1 | // 2 | // List groups 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base class 7 | // 8 | // Easily usable on