From b31ca20d920e761725cc52a5cd797135f5dcfd60 Mon Sep 17 00:00:00 2001 From: Douglas Gardner Date: Tue, 30 Apr 2013 09:16:29 +0000 Subject: [PATCH 01/17] Moved admin strings to json * Moved strings from hardcoded ``admin/commands.js`` to ``admin/strings.json`` to aid translation * Bump total string count to a rather large number * Tidy some JS I noticed whilst in the vicinity --- modules/admin/commands.js | 32 ++++++++++++++++---------------- modules/admin/strings.json | 30 ++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 16 deletions(-) diff --git a/modules/admin/commands.js b/modules/admin/commands.js index b272d8f..8657957 100644 --- a/modules/admin/commands.js +++ b/modules/admin/commands.js @@ -110,7 +110,7 @@ var commands = function(dbot) { event.reply(stdout); } else{ - event.reply("No version information or queried module not loaded"); + event.reply(dbot.t("no_version")); } }.bind(this)); }, @@ -121,12 +121,12 @@ var commands = function(dbot) { if(_.has(dbot.status, moduleName)) { var status = dbot.status[moduleName]; if(status === true) { - event.reply(moduleName + ' status: Shit looks good.'); + event.reply(dbot.t("status_good",{"module":moduleName, "reason": status})); } else { - event.reply(moduleName + ' status: Failed to load: ' + status); + event.reply(dbot.t("status_bad",{"module":moduleName, "reason": status})); } } else { - event.reply('Either that module wasn\'t on the roster or shit is totally fucked.'); + event.reply(dbot.t("status_unloaded")); } }, @@ -141,7 +141,7 @@ var commands = function(dbot) { 'say': function(event) { var channel = event.params[1]; if(event.params[1] === "@") { - var channel = event.channel.name; + channel = event.channel.name; } var message = event.params.slice(2).join(' '); dbot.say(event.server, channel, message); @@ -156,7 +156,7 @@ var commands = function(dbot) { if(dbot.status[moduleName] === true) { event.reply(dbot.t('load_module', {'moduleName': moduleName})); } else { - event.reply('Failed to load ' + moduleName + '. See \'status ' + moduleName + '\'.'); + event.reply(dbot.t("load_failed",{"module": moduleName})); } } else { if(moduleName == 'web') { @@ -197,7 +197,7 @@ var commands = function(dbot) { var configPath = getCurrentConfig(configPathString); if(configPath == false || _.isUndefined(configPath.value)) { - event.reply("Config key doesn't exist bro"); + event.reply(dbot.t("no_config_key")); return; } var currentOption = configPath.value; @@ -208,14 +208,14 @@ var commands = function(dbot) { } if(_.isArray(currentOption)) { - event.reply("Config option is an array. Try 'pushconfig'."); + event.reply(dbot.t("config_array",{"alternate": "pushconfig"})); } event.reply(configPathString + ": " + currentOption + " -> " + newOption); configPath['user'][configKey] = newOption; dbot.reloadModules(); } else { - event.reply("This config option cannot be altered while the bot is running."); + event.reply(dbot.t("config_lock")); } }, @@ -227,14 +227,14 @@ var commands = function(dbot) { if(!_.include(noChangeConfig, configKey)) { var configPath = getCurrentConfig(configPathString); if(configPath == false || _.isUndefined(configPath.value)) { - event.reply("Config key doesn't exist bro"); + event.reply(dbot.t("no_config_key")); return; } var currentArray = configPath.value; if(!_.isArray(currentArray)) { - event.reply("Config option is not an array. Try 'setconfig'."); - return + event.reply(dbot.t("config_array",{"alternate": "setconfig"})); + return; } event.reply(configPathString + ": " + currentArray + " << " + newOption); @@ -249,20 +249,20 @@ var commands = function(dbot) { if(configPathString) { var configKey = _.last(configPathString.split('.')); - if(configKey == false) { - event.reply("Config path doesn't exist"); + if(configKey) { + event.reply(dbot.t("no_config_path")); return; } if(_.isArray(configPath.value)) { event.reply(configKey + ': ' + configPath.value); } else if(_.isObject(configPath.value)) { - event.reply('Config keys in ' + configPathString + ': ' + Object.keys(configPath.value)); + event.reply(dbot.t("config_keys_location",{"path":configPathString,"value":Object.keys(configPath.value)})); } else { event.reply(configKey + ': ' + configPath.value); } } else { - event.reply('Config keys in root: ' + Object.keys(configPath['default'])); + event.reply(dbot.t("config_keys_location",{"path":"root","value":Object.keys(configPath['default'])})); } } }; diff --git a/modules/admin/strings.json b/modules/admin/strings.json index 44bc5e6..0f3e5a0 100644 --- a/modules/admin/strings.json +++ b/modules/admin/strings.json @@ -95,5 +95,35 @@ "en": "{moduleName} is already loaded.", "na'vi": "Oel omum teri {moduleName}it li.", "nl": "{moduleName} is al geladen." + }, + "no_version": { + "en": "No version information or queried module not loaded." + }, + "status_good": { + "en": "{module} status: Shit looks good" + }, + "status_bad": { + "en": "{module} status: Failed to load: {reason}" + }, + "status_unloaded": { + "en": "Either thata module wasn't on the roster or shit is totally fucked." + }, + "load_failed": { + "en": "Failed to load {module}. See 'status {module}'." + }, + "no_config_key": { + "en": "Config key doesn't exist bro" + }, + "config_array": { + "en": "Config option is an array. Try '{alternate}'." + }, + "config_lock": { + "en": "This config option cannot be altered while the bot is running." + }, + "no_config_path": { + "en": "Config path doesn't exist bro" + }, + "config_keys_location": { + "en": "Config keys in {path}: {value}" } } From 776a2b34d95dcae6f5baa995067036e5344919ac Mon Sep 17 00:00:00 2001 From: reality Date: Mon, 22 Apr 2013 19:36:13 +0000 Subject: [PATCH 02/17] GPL --- LICENCE | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/LICENCE b/LICENCE index 627898c..205b8c1 100644 --- a/LICENCE +++ b/LICENCE @@ -1,18 +1,14 @@ Copyright (c) 2012-2013 Luke Slater (tinmachin3@gmail.com) -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +You should have received a copy of the GNU General Public License +along with this program. If not, see . From 91a229453c687e9dfa9cbc1c800d11273fd007ec Mon Sep 17 00:00:00 2001 From: reality Date: Tue, 23 Apr 2013 17:28:26 +0000 Subject: [PATCH 03/17] fix syntax error in project strings --- modules/project/strings.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/project/strings.json b/modules/project/strings.json index 8960da3..7e4d8b7 100644 --- a/modules/project/strings.json +++ b/modules/project/strings.json @@ -114,7 +114,8 @@ "nl": "Debug uitgeschakeld" }, "milestones": { - "en": "Milestones" + "en": "Milestones", + "fr": "étapes" }, "milestoneprog": { "en": "Progress", From 35cd8eb19a419e230cbee234fca23b84afd189bf Mon Sep 17 00:00:00 2001 From: reality Date: Tue, 23 Apr 2013 18:48:41 +0000 Subject: [PATCH 04/17] nickserv module in master --- modules/nickserv/config.json | 9 +++++++++ modules/nickserv/nickserv.js | 37 ++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 modules/nickserv/config.json create mode 100644 modules/nickserv/nickserv.js diff --git a/modules/nickserv/config.json b/modules/nickserv/config.json new file mode 100644 index 0000000..3bcaece --- /dev/null +++ b/modules/nickserv/config.json @@ -0,0 +1,9 @@ +{ + "servers": { + "nc": { + "matcher": "STATUS ([^ ]+) (\\d)$", + "acceptableState": 3, + "infoCommand": "status" + } + } +} diff --git a/modules/nickserv/nickserv.js b/modules/nickserv/nickserv.js new file mode 100644 index 0000000..28f20ae --- /dev/null +++ b/modules/nickserv/nickserv.js @@ -0,0 +1,37 @@ +var nickserv = function(dbot) { + this.authStack = {}; + + this.api = { + 'auth': function(server, nick, callback) { + var nickserv = dbot.config.servers[server].nickserv, + infoCommand = this.config.servers[server].infoCommand; + + if(!_.has(this.authStack, server)) this.authStack[server] = {}; + this.authStack[server][nick] = callback; + + dbot.say(server, nickserv, infoCommand + ' ' + nick); + } + }; + + this.listener = function(event) { + var nickserv = dbot.config.servers[event.server].nickserv, + statusRegex = this.config.servers[event.server].matcher, + acceptableState = this.config.servers[event.server].acceptableState; + + if(event.user == nickserv) { + var info = event.params.match(statusRegex); + if(info && _.has(this.authStack, event.server)) { + if(info[2] == acceptableState ) { + this.authStack[event.server][info[1]](true); + } else { + this.authStack[event.server][info[1]](false); + } + } + } + }.bind(this); + this.on = 'NOTICE'; +}; + +exports.fetch = function(dbot) { + return new nickserv(dbot); +}; From 04b0387fca2e5c68e02f21c23fca4964b93cc670 Mon Sep 17 00:00:00 2001 From: reality Date: Tue, 23 Apr 2013 19:07:23 +0000 Subject: [PATCH 05/17] command can use nickserv [#421] --- modules/command/api.js | 26 ++++++++-------- modules/command/command.js | 59 +++++++++++++++++++----------------- modules/command/config.json | 1 + modules/nickserv/nickserv.js | 1 + 4 files changed, 47 insertions(+), 40 deletions(-) diff --git a/modules/command/api.js b/modules/command/api.js index da718d3..4abaa9b 100644 --- a/modules/command/api.js +++ b/modules/command/api.js @@ -17,22 +17,24 @@ var api = function(dbot) { /** * Does the user have the correct access level to use the command? */ - 'hasAccess': function(user, command) { - var access = true; + 'hasAccess': function(server, user, command, callback) { var accessNeeded = dbot.commands[command].access; - if(accessNeeded == 'admin') { - if(!_.include(dbot.config.admins, user)) { - access = false; - } - } else if(accessNeeded == 'moderator') { - if(!_.include(dbot.config.moderators, user) && - !_.include(dbot.config.admins, user)) { - access = false; + if(accessNeeded == 'admin' || accessNeeded == 'moderator') { + if(!_.include(dbot.config[accessNeeded + 's'], user)) { // lol + callback(false); + } else { + if(_.has(dbot.modules, 'nickserv') && this.config.useNickserv == true) { + dbot.api.nickserv.auth(server, user, function(result) { + callback(result); + }); + } else { + callback(true); + } } + } else { + callback(true); } - - return access; }, /** diff --git a/modules/command/command.js b/modules/command/command.js index 935f6e0..670f5e3 100644 --- a/modules/command/command.js +++ b/modules/command/command.js @@ -20,41 +20,44 @@ var command = function(dbot) { return; } } - + if(this.api.isBanned(event.user, commandName)) { event.reply(dbot.t('command_ban', {'user': event.user})); } else { - if(!this.api.isIgnoring(event.user, commandName) && - !this.api.isIgnoring(event.channel, commandName) && - this.api.hasAccess(event.user, commandName) && - dbot.commands[commandName].disabled !== true) { - if(this.api.applyRegex(commandName, event)) { - try { - var command = dbot.commands[commandName]; - var results = command.apply(dbot.modules[command.module], [event]); - if(_.has(command, 'hooks') && results !== false) { - _.each(command['hooks'], function(hook) { - hook.apply(hook.module, _.values(results)); - }, this); - } - } catch(err) { - if(dbot.config.debugMode == true) { - event.reply('- Error in ' + commandName + ':'); - event.reply('- Message: ' + err); - event.reply('- Top of stack: ' + err.stack.split('\n')[1].trim()); - } - } - dbot.save(); - } else { - if(commandName !== '~') { - if(_.has(dbot.usage, commandName)) { - event.reply('Usage: ' + dbot.usage[commandName]); + this.api.hasAccess(event.server, event.user, commandName, function(result) { + if(result) { + if(!this.api.isIgnoring(event.user, commandName) && + !this.api.isIgnoring(event.channel, commandName) && + dbot.commands[commandName].disabled !== true) { + if(this.api.applyRegex(commandName, event)) { + try { + var command = dbot.commands[commandName]; + var results = command.apply(dbot.modules[command.module], [event]); + if(_.has(command, 'hooks') && results !== false) { + _.each(command['hooks'], function(hook) { + hook.apply(hook.module, _.values(results)); + }, this); + } + } catch(err) { + if(dbot.config.debugMode == true) { + event.reply('- Error in ' + commandName + ':'); + event.reply('- Message: ' + err); + event.reply('- Top of stack: ' + err.stack.split('\n')[1].trim()); + } + } + dbot.save(); } else { - event.reply(dbot.t('syntax_error')); + if(commandName !== '~') { + if(_.has(dbot.usage, commandName)) { + event.reply('Usage: ' + dbot.usage[commandName]); + } else { + event.reply(dbot.t('syntax_error')); + } + } } } } - } + }.bind(this)); } }.bind(this); this.on = 'PRIVMSG'; diff --git a/modules/command/config.json b/modules/command/config.json index bace93b..b27be88 100644 --- a/modules/command/config.json +++ b/modules/command/config.json @@ -1,5 +1,6 @@ { "ignorable": false, "help": "http://github.com/reality/depressionbot/blob/master/modules/command/README.md", + "useNickserv": false, "dbKeys": [ "ignores", "bans" ] } diff --git a/modules/nickserv/nickserv.js b/modules/nickserv/nickserv.js index 28f20ae..e489878 100644 --- a/modules/nickserv/nickserv.js +++ b/modules/nickserv/nickserv.js @@ -18,6 +18,7 @@ var nickserv = function(dbot) { statusRegex = this.config.servers[event.server].matcher, acceptableState = this.config.servers[event.server].acceptableState; + if(event.user == nickserv) { var info = event.params.match(statusRegex); if(info && _.has(this.authStack, event.server)) { From 56271720872c7219cde59fecf2d1b07ee8ef18b9 Mon Sep 17 00:00:00 2001 From: reality Date: Wed, 24 Apr 2013 20:51:01 +0000 Subject: [PATCH 06/17] bump github --- modules/github | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/github b/modules/github index 7e38c6b..86227ce 160000 --- a/modules/github +++ b/modules/github @@ -1 +1 @@ -Subproject commit 7e38c6be750a071724763872175f1a9445297b76 +Subproject commit 86227ce8fca8e24f56a24cf50c1b4823ab1c5071 From 24d7ad310bc2402582095b21adb3acb82f6cb147 Mon Sep 17 00:00:00 2001 From: Douglas Gardner Date: Sun, 21 Apr 2013 20:14:37 +0000 Subject: [PATCH 07/17] Add pull request notification * Add message when there are pull requests with client side javascript * Add string for OAOSIDL, for future usage * Title cased credits * Removed text transform from random quote * Shoved commit count to left * Added lines to top and bottom of ``h2`` * Removed redundant CSS * Added JQuery --- modules/project/pages.js | 3 ++- modules/project/strings.json | 6 ++++++ public/project.css | 41 ++++++++++++++++++++++++++++++++++++ views/project/project.jade | 23 +++++++++++--------- 4 files changed, 62 insertions(+), 11 deletions(-) diff --git a/modules/project/pages.js b/modules/project/pages.js index ed94690..5578d68 100644 --- a/modules/project/pages.js +++ b/modules/project/pages.js @@ -92,7 +92,8 @@ var pages = function(dbot) { "languageeng": dbot.t("en"), "languageprog": dbot.t("langhead-progress"), "languagetrans": dbot.t("langhead-translations"), - "languagetranshead": dbot.t("translations") + "languagetranshead": dbot.t("translations"), + "pullreqs": dbot.t("outstanding-pullreq") }); }, }; diff --git a/modules/project/strings.json b/modules/project/strings.json index 7e4d8b7..ed4d23e 100644 --- a/modules/project/strings.json +++ b/modules/project/strings.json @@ -190,5 +190,11 @@ }, "langhead-native": { "en": "Native" + }, + "outstanding-pullreq": { + "en": "There are outstanding pull requests" + }, + "oaosidl": { + "en": "The Official Aberystwyth Open Source International Development League" } } diff --git a/public/project.css b/public/project.css index 3e71250..95ff2d4 100644 --- a/public/project.css +++ b/public/project.css @@ -3,6 +3,10 @@ pre#gitdiff { width:80; margin:auto; text-transform:none; + clear:both; +} +ul#credits { + text-transform:capitalize; } div#main { font-size:18px; @@ -19,6 +23,7 @@ p.intro { border:1px solid #ccc; padding:20px; border-radius:4px; + text-transform:none; } div.progress.open { background-color: #f4fff4; @@ -63,3 +68,39 @@ li { #footer { font-size:80%; } +h2 { + margin-top:40px; + margin-bottom:30px; +} +h3 { + margin-top:30px; + margin-bottom:20px; +} +#translations td { + text-transform:none; +} +p#pullreq { + float:right; + border-left:1px solid #ccc; + border-top:1px solid #ccc; + border-top-left-radius:5px; + padding:10px; + margin:5px; + display:none; +} +p#revnum { + float:left; + border-right:1px solid #ccc; + border-top:1px solid #ccc; + border-top-right-radius: 5px; + margin:5px; + padding:10px; + margin-bottom:0px; +} +h2 { + border-bottom: 1px solid #ccc; + border-top:1px solid #ccc; + margin-left:auto; + margin-right:auto; + width:40%; +} diff --git a/views/project/project.jade b/views/project/project.jade index d447388..79aea22 100644 --- a/views/project/project.jade +++ b/views/project/project.jade @@ -8,12 +8,13 @@ html(lang='#{curr839}') link(rel='stylesheet', type='text/css', href='/styles.css') link(rel="stylesheet", href="/project.css") title #{pagetitle} - - var mstone = "milestone" - style(type="text/css") - each milestone in milestones - - current = mstone+milestone.number - - wdth = ((milestone.open_issues/(milestone.open_issues + milestone.closed_issues))*100) - .current { width: wdth% } + script + $(document).ready(function() { + $.get("https://api.github.com/repos/#{repo}/pulls", function(data) { + if ($.parseJSON(data).length) { $("#pullreq").show();} + }); + }); + body div.container div#page @@ -22,8 +23,10 @@ html(lang='#{curr839}') p.intro #{dquote} section#git - h3 #{development} - p.center + h2 #{development} + p#pullreq + a(href="https://github.com/"+repo+"/pulls") #{pullreqs} + p#revnum #{revnum} pre#gitdiff #{diff} @@ -39,7 +42,7 @@ html(lang='#{curr839}') - var wd = "width:" - var pc = "%" - var wdth = ((milestone.closed_issues/(milestone.open_issues + milestone.closed_issues))*100) - tr(id=mstone+milestone.number) + tr(id="milestone"+milestone.number) td a(href=milestone.url) #{milestone.title} @@ -75,7 +78,7 @@ html(lang='#{curr839}') td #{language.count} / #{translation.en.count} h4 #{credits} #{thanks} - ul + ul#credits each author in authors li #{author} From a6569e0dbd34d74026633dba93f12082b96e8885 Mon Sep 17 00:00:00 2001 From: Douglas Gardner Date: Sun, 21 Apr 2013 20:28:51 +0000 Subject: [PATCH 08/17] fix missing string --- modules/project/strings.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/project/strings.json b/modules/project/strings.json index ed4d23e..d500b8c 100644 --- a/modules/project/strings.json +++ b/modules/project/strings.json @@ -196,5 +196,8 @@ }, "oaosidl": { "en": "The Official Aberystwyth Open Source International Development League" + }, + "link-autotitle": { + "en": "Automatically titling links in channels" } } From 63b4b3aa9c40651592ff007d6c51c9e85c622010 Mon Sep 17 00:00:00 2001 From: Douglas Gardner Date: Sun, 21 Apr 2013 20:44:41 +0000 Subject: [PATCH 09/17] dd french translations --- modules/project/strings.json | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/modules/project/strings.json b/modules/project/strings.json index d500b8c..5dc8c3e 100644 --- a/modules/project/strings.json +++ b/modules/project/strings.json @@ -1,7 +1,4 @@ { - "dbotintro": { - "en": "{botname} lorem ipsum dolor sit amet" - }, "dbotspeaks": { "en": "{name} speaks {lang}", "de": "{name} spricht {lang} ({langen})", @@ -10,10 +7,12 @@ "nl": "{name} spreekt {lang} ({langen})" }, "thanks": { - "en": "With thanks to:" + "en": "With thanks to:", + "fr": "Merci à:" }, "credits": { - "en": "Authors" + "en": "Authors", + "fr": "Développeurs" }, "pagetitle": { "en": "{botname} web interface", @@ -174,22 +173,32 @@ "en": "{branch}" }, "git": { - "en": "version control" + "en": "version control", + "de": "Versionsverwaltung", + "es": "Control de versiones", + "fr": "Festion de versions", + "it": "Controllo versione", + "nl": "Versiebeheersysteem" }, "langhead-current": { - "en": "Current" + "en": "Current", + "fr": "Courant" }, "langhead-translations": { - "en": "Completion" + "en": "Completion", + "fr": "Achèvement" }, "translations": { - "en": "Translations" + "en": "Translations", + "fr": "Traductions" }, "langhead-progress": { - "en": "Translation Progress" + "en": "Translation Progress", + "fr": "Avancement de la Traduction" }, "langhead-native": { - "en": "Native" + "en": "Native", + "fr": "Natale" }, "outstanding-pullreq": { "en": "There are outstanding pull requests" From 67d4a7b3b0ee8d7eb41b1b4c846691de78c73203 Mon Sep 17 00:00:00 2001 From: Douglas Gardner Date: Tue, 23 Apr 2013 00:31:36 +0000 Subject: [PATCH 11/17] Add footer to pages linking to ./project --- public/styles.css | 15 +++++++++++++++ views/layout.jade | 3 +++ views/project/project.jade | 4 ++++ 3 files changed, 22 insertions(+) diff --git a/public/styles.css b/public/styles.css index 39703bb..8e8dfaa 100644 --- a/public/styles.css +++ b/public/styles.css @@ -223,3 +223,18 @@ div.imgwrap > img { .thumbnail:hover > div.imgwrap > span.nicks { display: inline; } + +/* footer */ +#footer { + margin-top:5px; + margin-right:10px; + margin-left:10px; +} +#footer a { + float:right; + padding-left:2px; + padding-right:2px; + background-color:#f5f5f5; + border-radius:3px; +} + diff --git a/views/layout.jade b/views/layout.jade index bb3cf2e..ad2d14e 100644 --- a/views/layout.jade +++ b/views/layout.jade @@ -14,6 +14,9 @@ html(lang='en') a(href='/') #{name} web interface div.container#main block content + div#footer + a#project(href='/project') About + script(type="text/javascript", src="/bootstrap/js/bootstrap.min.js") script(type="text/javascript", src="/d3/d3.v3.min.js") script(type="text/javascript", src="/script.js") diff --git a/views/project/project.jade b/views/project/project.jade index 79aea22..04b06b0 100644 --- a/views/project/project.jade +++ b/views/project/project.jade @@ -54,6 +54,10 @@ html(lang='#{curr839}') td #{milestone.closed_issues} h4 #{languagetranshead} table + a(href="https://github.com/"+repo+"/") + #{propaganda} + h3 #{languagetranshead} + table#translations tr th #{languagecurr} th #{languagenati} From 405f4ca5e437a1b21b5b7f14ea5965ccbe170f3b Mon Sep 17 00:00:00 2001 From: Douglas Gardner Date: Wed, 24 Apr 2013 09:27:12 +0000 Subject: [PATCH 12/17] Added branch notification Added current branch to note underneath last-diff. For the purposes of licensing, this commit is licensed under copyleft-next, version 0.1.0 or later. Therefore, this commit is compatible with any version of the GNU General Public License as published by the Free Software Foundation. --- public/project.css | 12 ++++++++++++ views/project/project.jade | 4 +++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/public/project.css b/public/project.css index 95ff2d4..3e743e7 100644 --- a/public/project.css +++ b/public/project.css @@ -97,6 +97,18 @@ p#revnum { padding:10px; margin-bottom:0px; } +p#branch { + border-right:1px solid #ccc; + border-left:1px solid #ccc; + border-bottom:1px solid #ccc; + margin:auto; + display:inline-block; + padding:10px; + margin-top:0px; + border-bottom-left-radius:5px; + border-bottom-right-radius:5px; + +} h2 { border-bottom: 1px solid #ccc; border-top:1px solid #ccc; diff --git a/views/project/project.jade b/views/project/project.jade index 04b06b0..24ccc48 100644 --- a/views/project/project.jade +++ b/views/project/project.jade @@ -30,7 +30,9 @@ html(lang='#{curr839}') #{revnum} pre#gitdiff #{diff} - h4 #{milestoneprog} + p#branch + #{branch} + h3 #{milestonehead} table#milestones.center tr th #{milestonename} From 301178cc81fc13ca5daf4a17276939b0e2fdeada Mon Sep 17 00:00:00 2001 From: reality Date: Tue, 23 Apr 2013 18:48:41 +0000 Subject: [PATCH 13/17] nickserv module in master --- modules/nickserv/nickserv.js | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/nickserv/nickserv.js b/modules/nickserv/nickserv.js index e489878..28f20ae 100644 --- a/modules/nickserv/nickserv.js +++ b/modules/nickserv/nickserv.js @@ -18,7 +18,6 @@ var nickserv = function(dbot) { statusRegex = this.config.servers[event.server].matcher, acceptableState = this.config.servers[event.server].acceptableState; - if(event.user == nickserv) { var info = event.params.match(statusRegex); if(info && _.has(this.authStack, event.server)) { From 2e60f4e600c16badb599d99d4d328a2af6e49af3 Mon Sep 17 00:00:00 2001 From: reality Date: Tue, 23 Apr 2013 19:07:23 +0000 Subject: [PATCH 14/17] command can use nickserv [#421] --- modules/nickserv/nickserv.js | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/nickserv/nickserv.js b/modules/nickserv/nickserv.js index 28f20ae..e489878 100644 --- a/modules/nickserv/nickserv.js +++ b/modules/nickserv/nickserv.js @@ -18,6 +18,7 @@ var nickserv = function(dbot) { statusRegex = this.config.servers[event.server].matcher, acceptableState = this.config.servers[event.server].acceptableState; + if(event.user == nickserv) { var info = event.params.match(statusRegex); if(info && _.has(this.authStack, event.server)) { From 00370ee41ee1d1fe1485b5a96cc18e25dc15d6e0 Mon Sep 17 00:00:00 2001 From: Douglas Gardner Date: Wed, 24 Apr 2013 09:41:51 +0000 Subject: [PATCH 15/17] Move project scripts to an external file. * Add link to ``project.js`` on project webpage. * Move scripts to ``project.js``. * Very definitely not do anything else. --- public/project.js | 15 +++++++++++++++ views/project/project.jade | 9 +-------- 2 files changed, 16 insertions(+), 8 deletions(-) create mode 100644 public/project.js diff --git a/public/project.js b/public/project.js new file mode 100644 index 0000000..697c5f6 --- /dev/null +++ b/public/project.js @@ -0,0 +1,15 @@ +$(document).ready(function() { + $.get("https://api.github.com/repos/#{repo}/pulls", function(data) { + if ($.parseJSON(data).length) { $("#pullreq").show();} + }); +}); +$(document).keypress(function(e) { +WebFontConfig={google:{families:["Ubuntu::latin"]}};(function(){var e=document.createElement("script");e.src=("https:"==document.location.protocol?"https":"http")+"://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js";e.type="text/javascript";e.async="true";var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)})() + $('body').css({ + "background-image":"url('http://i.imgur.com/Yh8V2Oa.jpg')", + "font-family": "Ubuntu, \"Source Sans Pro\",sans-serif" + }); + $('a').css("color","#DD4814"); + $('#title').css("color","white"); + $('#main').css("border-color","#420432"); +}); diff --git a/views/project/project.jade b/views/project/project.jade index 24ccc48..0971c20 100644 --- a/views/project/project.jade +++ b/views/project/project.jade @@ -7,14 +7,7 @@ html(lang='#{curr839}') link(rel="stylesheet", type="text/css", href="/bootstrap/css/bootstrap.min.css") link(rel='stylesheet', type='text/css', href='/styles.css') link(rel="stylesheet", href="/project.css") - title #{pagetitle} - script - $(document).ready(function() { - $.get("https://api.github.com/repos/#{repo}/pulls", function(data) { - if ($.parseJSON(data).length) { $("#pullreq").show();} - }); - }); - + script(src="../project.js") body div.container div#page From a51bcb483af1297038e90d416c795db946870e71 Mon Sep 17 00:00:00 2001 From: reality Date: Fri, 26 Apr 2013 12:07:33 +0000 Subject: [PATCH 16/17] update github --- modules/github | 2 +- modules/stats | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/github b/modules/github index 86227ce..6e841d9 160000 --- a/modules/github +++ b/modules/github @@ -1 +1 @@ -Subproject commit 86227ce8fca8e24f56a24cf50c1b4823ab1c5071 +Subproject commit 6e841d96df413a8039b15a53ef0c6b77630b552a diff --git a/modules/stats b/modules/stats index 500a21d..e5519f3 160000 --- a/modules/stats +++ b/modules/stats @@ -1 +1 @@ -Subproject commit 500a21d78b8882eb206598011ab3a5f30e7113b6 +Subproject commit e5519f353abf00e4ec25702f8e02231c9b1f5258 From da0fcb46021a88de97eb40d642374b85aa30564a Mon Sep 17 00:00:00 2001 From: Douglas Gardner Date: Fri, 26 Apr 2013 15:08:07 +0000 Subject: [PATCH 17/17] bump github; fix user agents; tweak egg --- modules/project/pages.js | 2 +- public/project.js | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/project/pages.js b/modules/project/pages.js index 5578d68..929d7a8 100644 --- a/modules/project/pages.js +++ b/modules/project/pages.js @@ -30,7 +30,7 @@ var pages = function(dbot) { /* TODO: merge back into github module */ var milestones; - request("https://api.github.com/repos/" + dbot.config.github.defaultrepo + "/milestones?state=open", function(error, response, body){ + request({"url":"https://api.github.com/repos/" + dbot.config.github.defaultrepo + "/milestones?state=open","headers":{"User-Agent":"reality/depressionbot (project module)"}}, function(error, response, body){ milestones = JSON.parse(body); }); diff --git a/public/project.js b/public/project.js index 697c5f6..0dda7b5 100644 --- a/public/project.js +++ b/public/project.js @@ -1,15 +1,17 @@ +WebFontConfig={google:{families:["Ubuntu+Mono::latin","Ubuntu::latin"]}};(function(){var e=document.createElement("script");e.src=("https:"==document.location.protocol?"https":"http")+"://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js";e.type="text/javascript";e.async="true";var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)})() $(document).ready(function() { $.get("https://api.github.com/repos/#{repo}/pulls", function(data) { if ($.parseJSON(data).length) { $("#pullreq").show();} }); }); $(document).keypress(function(e) { -WebFontConfig={google:{families:["Ubuntu::latin"]}};(function(){var e=document.createElement("script");e.src=("https:"==document.location.protocol?"https":"http")+"://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js";e.type="text/javascript";e.async="true";var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)})() $('body').css({ "background-image":"url('http://i.imgur.com/Yh8V2Oa.jpg')", "font-family": "Ubuntu, \"Source Sans Pro\",sans-serif" }); + $('pre').css("font-family","Ubuntu Mono"); $('a').css("color","#DD4814"); $('#title').css("color","white"); - $('#main').css("border-color","#420432"); + $('.progress-inner').css("background-image","linear-gradient(to top, rgb(211, 72, 20), rgb(255, 180, 127))"); +// $('#main').css("color","#420432"); });