From b32bb76429fc8d84d363be769fe8997d533cbd41 Mon Sep 17 00:00:00 2001 From: barisusakli <barisusakli@gmail.com> Date: Fri, 23 May 2014 14:30:59 -0400 Subject: [PATCH 01/15] #1562 --- src/database/mongo/sorted.js | 43 ++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/src/database/mongo/sorted.js b/src/database/mongo/sorted.js index e0c2e2cb9b..3edaea5392 100644 --- a/src/database/mongo/sorted.js +++ b/src/database/mongo/sorted.js @@ -26,7 +26,7 @@ module.exports = function(db, module) { .sort({score: sort}) .toArray(function(err, data) { if (err || !data) { - return callback(err, null); + return callback(err); } if (!withScores) { @@ -48,7 +48,7 @@ module.exports = function(db, module) { }; module.getSortedSetRevRangeWithScores = function(key, start, stop, callback) { - getSortedSetRange(key, start, stop, -1, true, callback) + getSortedSetRange(key, start, stop, -1, true, callback); }; module.getSortedSetRangeByScore = function(key, start, count, min, max, callback) { @@ -144,4 +144,43 @@ module.exports = function(db, module) { callback(null, returnData); }); }; + + module.getSortedSetUnion = function(sets, start, stop, callback) { + getSortedSetUnion(sets, 1, start, stop, callback); + }; + + module.getSortedSetRevUnion = function(sets, start, stop, callback) { + getSortedSetUnion(sets, -1, start, stop, callback); + }; + + function getSortedSetUnion(sets, sort, start, stop, callback) { + if (typeof start === 'function') { + callback = start; + start = 0; + stop = -1; + } else if (typeof stop === 'function') { + callback = stop; + stop = -1; + } + var limit = stop - start + 1; + if (limit < 0) { + limit = 0; + } + + db.collection('objects').find({_key:{$in: sets}}, {fields: {_id: 0, value: 1, score: 1}}) + .limit(limit) + .skip(start) + .sort({score: sort}) + .toArray(function(err, data) { + if (err || !data) { + return callback(err); + } + + data = data.map(function(item) { + return item.value; + }); + + callback(null, data); + }); + } }; \ No newline at end of file From abe01ba7203965d1b84fa47b55b2304a767c41b7 Mon Sep 17 00:00:00 2001 From: psychobunny <rodrigues.andrew@gmail.com> Date: Fri, 23 May 2014 14:38:07 -0400 Subject: [PATCH 02/15] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 62a50e06bb..238512891c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# <img alt="NodeBB" src="http://i.imgur.com/3yj1n6N.png" /> +# <img alt="NodeBB" src="http://i.imgur.com/KBsf81i.png" /> [](https://travis-ci.org/designcreateplay/NodeBB) [](https://david-dm.org/designcreateplay/nodebb) [](https://codeclimate.com/github/designcreateplay/NodeBB) From 4ca04067f0ea88e3278d805a40c391cc2da60d0a Mon Sep 17 00:00:00 2001 From: Julian Lam <julian@nodebb.org> Date: Fri, 23 May 2014 14:42:50 -0400 Subject: [PATCH 03/15] updated badges --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 238512891c..aead259499 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # <img alt="NodeBB" src="http://i.imgur.com/KBsf81i.png" /> -[](https://travis-ci.org/designcreateplay/NodeBB) -[](https://david-dm.org/designcreateplay/nodebb) +[](https://travis-ci.org/nodebb/nodebb) +[](https://david-dm.org/nodebb/nodebb) [](https://codeclimate.com/github/designcreateplay/NodeBB) **NodeBB Forum Software** is powered by Node.js and built on a Redis database. It utilizes web sockets for instant interactions and real-time notifications. NodeBB is compatible down to IE8 and has many modern features out of the box such as social network integration and streaming discussions. From dbf07f786d63525a9c488d8f47b97dfc7a323380 Mon Sep 17 00:00:00 2001 From: barisusakli <barisusakli@gmail.com> Date: Fri, 23 May 2014 15:01:06 -0400 Subject: [PATCH 04/15] closes #1565 --- public/src/modules/composer/tags.js | 3 ++- src/topics/tags.js | 17 ++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/public/src/modules/composer/tags.js b/public/src/modules/composer/tags.js index 4f6a6294f4..e5b1a34b83 100644 --- a/public/src/modules/composer/tags.js +++ b/public/src/modules/composer/tags.js @@ -13,7 +13,8 @@ define(function() { } tagEl.tagsinput({ - maxTags: config.tagsPerTopic + maxTags: config.tagsPerTopic, + confirmKeys: [13, 188] }); addTags(postData.tags, tagEl); diff --git a/src/topics/tags.js b/src/topics/tags.js index 492723f750..63e67eddd4 100644 --- a/src/topics/tags.js +++ b/src/topics/tags.js @@ -11,9 +11,13 @@ module.exports = function(Topics) { Topics.createTags = function(tags, tid, timestamp, callback) { if(Array.isArray(tags)) { tags = tags.slice(0, meta.config.tagsPerTopic || 5); + async.each(tags, function(tag, next) { - tag = utils.removePunctuation(tag.trim().toLowerCase()).substr(0, meta.config.maximumTagLength || 15); + tag = cleanUpTag(tag); + if (tag.length < (meta.config.minimumTagLength || 3)) { + return next(); + } db.setAdd('topic:' + tid + ':tags', tag); db.sortedSetAdd('tag:' + tag + ':topics', timestamp, tid, function(err) { @@ -26,6 +30,17 @@ module.exports = function(Topics) { } }; + function cleanUpTag(tag) { + tag = tag.trim().toLowerCase(); + var matches = tag.match(/^-*(.+?)-*$/); + if (matches && matches.length > 1) { + tag = matches[1]; + } + tag = tag.replace(/[\.,\/#!$%\^&\*;:{}=_`<>'"~()?\|]/g, ''); + tag = tag.substr(0, meta.config.maximumTagLength || 15); + return tag; + } + function updateTagCount(tag) { Topics.getTagTopicCount(tag, function(err, count) { if (!err) { From 5f6217e831519cafe7e02a3e4fa07daf91c18f03 Mon Sep 17 00:00:00 2001 From: psychobunny <psycho.bunny@hotmail.com> Date: Fri, 23 May 2014 15:21:36 -0400 Subject: [PATCH 05/15] update all docs with new url --- docs/configuring/databases/mongo.rst | 2 +- docs/help/help.rst | 2 +- docs/helping/index.rst | 4 ++-- docs/index.rst | 2 +- docs/installing/cloud/cloud9.rst | 2 +- docs/installing/cloud/heroku.rst | 4 ++-- docs/installing/cloud9.rst | 2 +- docs/installing/heroku.rst | 4 ++-- docs/installing/os/debian.rst | 4 ++-- docs/installing/os/smartos.rst | 4 ++-- docs/installing/os/ubuntu.rst | 2 +- docs/installing/os/windows8.rst | 2 +- docs/plugins/create.rst | 2 +- docs/plugins/hooks.rst | 2 +- docs/plugins/settings.rst | 4 ++-- docs/resources.rst | 2 +- docs/upgrading/index.rst | 4 ++-- docs/widgets/create.rst | 2 +- 18 files changed, 25 insertions(+), 25 deletions(-) diff --git a/docs/configuring/databases/mongo.rst b/docs/configuring/databases/mongo.rst index 922eee9c59..64955a9133 100644 --- a/docs/configuring/databases/mongo.rst +++ b/docs/configuring/databases/mongo.rst @@ -36,7 +36,7 @@ Enter the following into the terminal, replacing `/path/to/nodebb/install/locati .. code:: bash $ cd /path/to/nodebb/install/location - $ git clone git://github.com/designcreateplay/NodeBB.git nodebb + $ git clone git://github.com/NodeBB/NodeBB.git nodebb Step 5: Install The Required NodeBB Dependencies ------------------------- diff --git a/docs/help/help.rst b/docs/help/help.rst index 5bb75b5af9..f951c9df55 100644 --- a/docs/help/help.rst +++ b/docs/help/help.rst @@ -80,7 +80,7 @@ If successful, running the following command should show a version higher than 0 Submit Bugs on our Issue Tracker -------------------------------- -Before reporting bugs, please ensure that the issue has not already been filed on our `tracker <https://github.com/designcreateplay/NodeBB/issues?state=closed>`_, or has already been resolved on our `support forum <http://community.nodebb.org/category/6/bug-reports>`_. If it has not been filed, feel free to create an account on GitHub and `create a new issue <https://github.com/designcreateplay/NodeBB/issues>`_. +Before reporting bugs, please ensure that the issue has not already been filed on our `tracker <https://github.com/NodeBB/NodeBB/issues?state=closed>`_, or has already been resolved on our `support forum <http://community.nodebb.org/category/6/bug-reports>`_. If it has not been filed, feel free to create an account on GitHub and `create a new issue <https://github.com/NodeBB/NodeBB/issues>`_. Ask the NodeBB Community diff --git a/docs/helping/index.rst b/docs/helping/index.rst index d76ca54da4..de31b48803 100644 --- a/docs/helping/index.rst +++ b/docs/helping/index.rst @@ -7,7 +7,7 @@ NodeBB is an open source project, and will forever remain free. Here's a number * `Follow us on Twitter <http://www.twitter.com/NodeBB>`_ and perhaps tweet **#NodeBB is most awesome forum software @NodeBB** * Update our wiki! ;) We need everything from development/design tutorials to user friendly how-to guides. * Tell everybody about NodeBB, including your grandma and her cats. -* `Submit a pull request, or two, or three.. <http://www.github.com/designcreateplay/NodeBB>`_ +* `Submit a pull request, or two, or three.. <http://www.github.com/NodeBB/NodeBB>`_ * Build a new theme * Write a plugin * Keep the link back to us on the footer of your own NodeBB :) @@ -27,7 +27,7 @@ Writing Documentation These docs were written using `Sphinx <http://sphinx-doc.org/>`_ and published using `rtfd.org <http://readthedocs.org/>`_. -You can edit these docs `directly on GitHub <https://github.com/designcreateplay/NodeBB/tree/master/docs>`_, or by clicking on "View page source" on the top right of any page. +You can edit these docs `directly on GitHub <https://github.com/NodeBB/NodeBB/tree/master/docs>`_, or by clicking on "View page source" on the top right of any page. If you wish, you can clone the repository and compile the documentation yourself. Check out the `Getting Started <https://read-the-docs.readthedocs.org/en/latest/getting_started.html>`_ section for more info on how to accomplish the latter. diff --git a/docs/index.rst b/docs/index.rst index c086e5b737..7ec6a0561f 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -3,7 +3,7 @@ | **NodeBB** is a next-generation discussion platform that utilizes web sockets for instant interactions and real-time notifications. NodeBB forums have many modern features out of the box such as social network integration and streaming discussions. -NodeBB is an open source project which can be forked on `GitHub <https://github.com/designcreateplay/NodeBB/>`_. Don't forget to check out the ways that you can help contribute to this project, from translations, pull requests, and telling your friends. +NodeBB is an open source project which can be forked on `GitHub <https://github.com/NodeBB/NodeBB/>`_. Don't forget to check out the ways that you can help contribute to this project, from translations, pull requests, and telling your friends. Table of Contents ================= diff --git a/docs/installing/cloud/cloud9.rst b/docs/installing/cloud/cloud9.rst index 0e5d2e0594..8a857335ea 100644 --- a/docs/installing/cloud/cloud9.rst +++ b/docs/installing/cloud/cloud9.rst @@ -7,7 +7,7 @@ The following are installation instructions for the `Cloud 9 <https://c9.io/>`_ .. code:: bash - git clone git://github.com/designcreateplay/NodeBB.git nodebb + git clone git://github.com/NodeBB/NodeBB.git nodebb The nodebb command after the git url will create a file called nodebb so you have to CD into the file after you have cloned NodeBB. diff --git a/docs/installing/cloud/heroku.rst b/docs/installing/cloud/heroku.rst index e6aaa6f27a..a5e6c22dbe 100644 --- a/docs/installing/cloud/heroku.rst +++ b/docs/installing/cloud/heroku.rst @@ -6,7 +6,7 @@ Heroku 1. Download and install `Heroku Toolbelt <https://toolbelt.heroku.com/>`_ for your operating system 2. Log into your Heroku account: ``heroku login`` 3. Verify your Heroku account by adding a credit card (at http://heroku.com/verify) -4. Clone the repository: ``git clone https://github.com/designcreateplay/NodeBB.git /path/to/repo/clone`` +4. Clone the repository: ``git clone https://github.com/NodeBB/NodeBB.git /path/to/repo/clone`` 5. ``cd /path/to/repo/clone`` 6. Install dependencies locally ``npm install`` 7. Create the heroku app: ``heroku create`` @@ -46,7 +46,7 @@ Heroku 16. Initialise a single dyno: ``heroku ps:scale web=1`` 17. Visit your app! -If these instructions are unclear or if you run into trouble, please let us know by `filing an issue <https://github.com/designcreateplay/NodeBB/issues>`_. +If these instructions are unclear or if you run into trouble, please let us know by `filing an issue <https://github.com/NodeBB/NodeBB/issues>`_. Keeping it up to date --------------------- diff --git a/docs/installing/cloud9.rst b/docs/installing/cloud9.rst index 0e5d2e0594..8a857335ea 100644 --- a/docs/installing/cloud9.rst +++ b/docs/installing/cloud9.rst @@ -7,7 +7,7 @@ The following are installation instructions for the `Cloud 9 <https://c9.io/>`_ .. code:: bash - git clone git://github.com/designcreateplay/NodeBB.git nodebb + git clone git://github.com/NodeBB/NodeBB.git nodebb The nodebb command after the git url will create a file called nodebb so you have to CD into the file after you have cloned NodeBB. diff --git a/docs/installing/heroku.rst b/docs/installing/heroku.rst index 23ad0f0ee3..f484531e3f 100644 --- a/docs/installing/heroku.rst +++ b/docs/installing/heroku.rst @@ -6,7 +6,7 @@ Heroku 1. Download and install `Heroku Toolbelt <https://toolbelt.heroku.com/>`_ for your operating system 2. Log into your Heroku account: ``heroku login`` 3. Verify your Heroku account by adding a credit card (at http://heroku.com/verify) -4. Clone the repository: ``git clone https://github.com/designcreateplay/NodeBB.git /path/to/repo/clone`` +4. Clone the repository: ``git clone https://github.com/NodeBB/NodeBB.git /path/to/repo/clone`` 5. ``cd /path/to/repo/clone`` 6. Install dependencies locally ``npm install`` 7. Create the heroku app: ``heroku create`` @@ -32,7 +32,7 @@ Heroku 14. Initialise a single dyno: ``heroku ps:scale web=1`` 15. Visit your app! -If these instructions are unclear or if you run into trouble, please let us know by `filing an issue <https://github.com/designcreateplay/NodeBB/issues>`_. +If these instructions are unclear or if you run into trouble, please let us know by `filing an issue <https://github.com/NodeBB/NodeBB/issues>`_. Keeping it up to date --------------------- diff --git a/docs/installing/os/debian.rst b/docs/installing/os/debian.rst index b1df1d5db1..8c59d7f0f9 100644 --- a/docs/installing/os/debian.rst +++ b/docs/installing/os/debian.rst @@ -139,7 +139,7 @@ Next clone this repository : .. code:: bash $ cd /path/to/nodebb/install/location - $ git clone git://github.com/designcreateplay/NodeBB.git nodebb + $ git clone git://github.com/NodeBB/NodeBB.git nodebb Now we are going to install all dependencies for NodeBB via NPM : @@ -172,6 +172,6 @@ And after all.. let's run the NodeBB forum Extras, tips and Advice ^^^^^^^^^^^^^^^^^^^^^^^ -You should secure your NodeBB installation, `take a look here <https://github.com/designcreateplay/NodeBB#securing-nodebb>`_. +You should secure your NodeBB installation, `take a look here <https://github.com/NodeBB/NodeBB#securing-nodebb>`_. You should use Nginx (or similar) in order to reverse proxy your NodeBB installation on the port 80, :doc:`take a look here <../../configuring/proxies>` \ No newline at end of file diff --git a/docs/installing/os/smartos.rst b/docs/installing/os/smartos.rst index cbc194c9c1..c28f4d8457 100644 --- a/docs/installing/os/smartos.rst +++ b/docs/installing/os/smartos.rst @@ -86,7 +86,7 @@ Installation .. code:: bash - $ git clone git://github.com/designcreateplay/NodeBB.git nodebb + $ git clone git://github.com/NodeBB/NodeBB.git nodebb 5. Install NodeBB's npm dependencies: @@ -125,7 +125,7 @@ Installation **Note:** With port 80 the `:80` does not need to be entered. -**Note:** If these instructions are unclear or if you run into trouble, please let us know by `filing an issue <https://github.com/designcreateplay/NodeBB/issues>`_. +**Note:** If these instructions are unclear or if you run into trouble, please let us know by `filing an issue <https://github.com/NodeBB/NodeBB/issues>`_. Upgrading NodeBB ---------------- diff --git a/docs/installing/os/ubuntu.rst b/docs/installing/os/ubuntu.rst index f1a663e0b7..2efd3963ac 100644 --- a/docs/installing/os/ubuntu.rst +++ b/docs/installing/os/ubuntu.rst @@ -26,7 +26,7 @@ Next, clone this repository: .. code:: bash $ cd /path/to/nodebb/install/location - $ git clone git://github.com/designcreateplay/NodeBB.git nodebb + $ git clone git://github.com/NodeBB/NodeBB.git nodebb Obtain all of the dependencies required by NodeBB: diff --git a/docs/installing/os/windows8.rst b/docs/installing/os/windows8.rst index cfb0d41c7a..274254f45a 100644 --- a/docs/installing/os/windows8.rst +++ b/docs/installing/os/windows8.rst @@ -27,7 +27,7 @@ Open Git Shell, and type the following commands. Clone NodeBB repo: .. code:: bash - git clone https://github.com/designcreateplay/NodeBB.git + git clone https://github.com/NodeBB/NodeBB.git Enter directory: diff --git a/docs/plugins/create.rst b/docs/plugins/create.rst index 568c9ece8d..5f5193b8f8 100644 --- a/docs/plugins/create.rst +++ b/docs/plugins/create.rst @@ -16,7 +16,7 @@ There are two types of hooks: **filters** and **actions**. **Actions** are executed at certain points of NodeBB, and are useful if you'd like to *do* something after a certain trigger. For example, an action hook can be used to notify an admin if a certain user has posted. Other uses include analytics recording, or automatic welcome posts on new user registration. -When you are writing your plugin, make sure a hook exists where you'd like something to happen. If a hook isn't present, `file an issue <https://github.com/designcreateplay/NodeBB/issues>`_ and we'll include it in the next version of NodeBB. +When you are writing your plugin, make sure a hook exists where you'd like something to happen. If a hook isn't present, `file an issue <https://github.com/NodeBB/NodeBB/issues>`_ and we'll include it in the next version of NodeBB. Configuration ------------------ diff --git a/docs/plugins/hooks.rst b/docs/plugins/hooks.rst index 4540cdc822..c8e5267358 100644 --- a/docs/plugins/hooks.rst +++ b/docs/plugins/hooks.rst @@ -5,7 +5,7 @@ The following is a list of all hooks present in NodeBB. This list is intended to There are two types of hooks, **filters**, and **actions**. Filters take an input (provided as a single argument), parse it in some way, and return the changed value. Actions take multiple inputs, and execute actions based on the inputs received. Actions do not return anything. -**Important**: This list is by no means exhaustive. Hooks are added on an as-needed basis (or if we can see a potential use case ahead of time), and all requests to add new hooks to NodeBB should be sent to us via the `issue tracker <https://github.com/designcreateplay/NodeBB/issues>`_. +**Important**: This list is by no means exhaustive. Hooks are added on an as-needed basis (or if we can see a potential use case ahead of time), and all requests to add new hooks to NodeBB should be sent to us via the `issue tracker <https://github.com/NodeBB/NodeBB/issues>`_. Filters diff --git a/docs/plugins/settings.rst b/docs/plugins/settings.rst index 7ab7febb53..94e32da115 100644 --- a/docs/plugins/settings.rst +++ b/docs/plugins/settings.rst @@ -299,8 +299,8 @@ All methods get called within Settings-scope. ``trim`` Whether the value is assumed as trimmed. For further impression take a look at the -`default plugins <https://github.com/designcreateplay/NodeBB/tree/master/public/src/modules/settings>`_. +`default plugins <https://github.com/NodeBB/NodeBB/tree/master/public/src/modules/settings>`_. You should also take a look at the helper-functions within -`Settings <https://github.com/designcreateplay/NodeBB/tree/master/public/src/modules/settings.js>`_ in order to create +`Settings <https://github.com/NodeBB/NodeBB/tree/master/public/src/modules/settings.js>`_ in order to create your own plugins. There are a few methods that take response to call the methods of other plugins when fittingly. diff --git a/docs/resources.rst b/docs/resources.rst index ae0f398dfc..47984ad9da 100644 --- a/docs/resources.rst +++ b/docs/resources.rst @@ -10,7 +10,7 @@ Developer's Resources Core ---- -* `Building a new Admin Page <https://github.com/designcreateplay/NodeBB/wiki/How-to-build-a-new-Admin-Page>`_ (Out of date) +* `Building a new Admin Page <https://github.com/NodeBB/NodeBB/wiki/How-to-build-a-new-Admin-Page>`_ (Out of date) Plugins diff --git a/docs/upgrading/index.rst b/docs/upgrading/index.rst index be5ce29edf..12c1b3d1e0 100644 --- a/docs/upgrading/index.rst +++ b/docs/upgrading/index.rst @@ -1,7 +1,7 @@ Upgrading NodeBB ====================== -NodeBB's periodic releases are located in the `Releases <https://github.com/designcreateplay/NodeBB/releases>`_. These releases contain what is usually considered the most bug-free code, and is designed to be used on production-level instances of NodeBB. +NodeBB's periodic releases are located in the `Releases <https://github.com/NodeBB/NodeBB/releases>`_. These releases contain what is usually considered the most bug-free code, and is designed to be used on production-level instances of NodeBB. You can utilise git to install a specific version of NodeBB, and upgrade periodically as new releases are made. @@ -124,7 +124,7 @@ If not upgrading between branches, just run the following command: This should retrieve the latest (and greatest) version of NodeBB from the repository. -Alternatively, download and extract the latest versioned copy of the code from `the Releases Page <https://github.com/designcreateplay/NodeBB/releases>`_. Overwrite any files as necessary. This method is not supported. +Alternatively, download and extract the latest versioned copy of the code from `the Releases Page <https://github.com/NodeBB/NodeBB/releases>`_. Overwrite any files as necessary. This method is not supported. 4. Run the NodeBB upgrade script ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/docs/widgets/create.rst b/docs/widgets/create.rst index b3f0041bc3..e3c11f1039 100644 --- a/docs/widgets/create.rst +++ b/docs/widgets/create.rst @@ -74,5 +74,5 @@ Pass this back in the array: } -And that's all. You can define as many Widget Areas in your theme as you wish. If you're still stuck, have a look at `this commit <https://github.com/designcreateplay/nodebb-theme-cerulean/commit/50e49a9da5a89484fa8001bbda2e613b69f18e86>`_ which upgraded the Cerulean theme to use the widget system. +And that's all. You can define as many Widget Areas in your theme as you wish. If you're still stuck, have a look at `this commit <https://github.com/NodeBB/nodebb-theme-cerulean/commit/50e49a9da5a89484fa8001bbda2e613b69f18e86>`_ which upgraded the Cerulean theme to use the widget system. From 4cd86affae0b85aeb301d0a038cbefb121315e8b Mon Sep 17 00:00:00 2001 From: psychobunny <psycho.bunny@hotmail.com> Date: Fri, 23 May 2014 15:21:51 -0400 Subject: [PATCH 06/15] update all files with new url --- README.md | 4 ++-- app.js | 2 +- nodebb | 4 ++-- package.json | 4 ++-- public/src/overrides.js | 2 +- src/install.js | 2 +- src/upgrade.js | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index aead259499..ad27e00882 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Credit: [Convoe](http://www.convoe.com), [Kano](http://www.kano.me), [Manchester ## How can I follow along/contribute? -* Our feature roadmap is hosted on the project wiki's [Version History / Roadmap](https://github.com/designcreateplay/NodeBB/wiki/Version-History-%26-Roadmap) +* Our feature roadmap is hosted on the project wiki's [Version History / Roadmap](https://github.com/NodeBB/NodeBB/wiki/Version-History-%26-Roadmap) * If you are a developer, feel free to check out the source and submit pull requests. We also have a wide array of [plugins](http://community.nodebb.org/category/7/nodebb-plugins) which would be a great starting point for learning the codebase. * If you are a designer, [NodeBB needs themes](http://community.nodebb.org/category/10/nodebb-themes)! NodeBB's theming system allows extention of the base templates as well as styling via LESS or CSS. NodeBB's base theme utilizes [Bootstrap 3](http://getbootstrap.com/) but themes can choose to use a different framework altogether. * Please don't forget to **like**, **follow**, and **star our repo**! Join our growing [community](http://community.nodebb.org) to keep up to date with the latest NodeBB development. @@ -55,4 +55,4 @@ It is important to ensure that your NodeBB and database servers are secured. Bea ## Upgrading NodeBB -Detailed upgrade instructions are listed in [Upgrading NodeBB](https://github.com/designcreateplay/NodeBB/wiki/Upgrading-NodeBB) +Detailed upgrade instructions are listed in [Upgrading NodeBB](https://github.com/NodeBB/NodeBB/wiki/Upgrading-NodeBB) diff --git a/app.js b/app.js index fddded63db..26cdf378cf 100644 --- a/app.js +++ b/app.js @@ -332,7 +332,7 @@ function displayHelp() { winston.info('Options:'); winston.info(' --help displays this usage information'); winston.info(' --setup configure your environment and setup NodeBB'); - winston.info(' --upgrade upgrade NodeBB, first read: github.com/designcreateplay/NodeBB/wiki/Upgrading-NodeBB'); + winston.info(' --upgrade upgrade NodeBB, first read: github.com/NodeBB/NodeBB/wiki/Upgrading-NodeBB'); winston.info(' --reset soft resets NodeBB; disables all plugins and restores selected theme to Vanilla'); winston.info(' --start manually start NodeBB (default when no options are given)'); } diff --git a/nodebb b/nodebb index 2d09f734db..7399f472ea 100755 --- a/nodebb +++ b/nodebb @@ -99,14 +99,14 @@ case "$1" in dev) echo "Launching NodeBB in \"development\" mode." echo "To run the production build of NodeBB, please use \"forever\"." - echo "More Information: https://github.com/designcreateplay/NodeBB/wiki/How-to-run-NodeBB" + echo "More Information: https://github.com/NodeBB/NodeBB/wiki/How-to-run-NodeBB" NODE_ENV=development "$node" loader --no-daemon "$@" ;; watch) echo "Launching NodeBB in \"development\" mode." echo "To run the production build of NodeBB, please use \"forever\"." - echo "More Information: https://github.com/designcreateplay/NodeBB/wiki/How-to-run-NodeBB" + echo "More Information: https://github.com/NodeBB/NodeBB/wiki/How-to-run-NodeBB" NODE_ENV=development supervisor -q --ignore public/templates --extensions 'node|js|tpl|less' -- app "$@" ;; diff --git a/package.json b/package.json index 8226b165c2..ce6195791b 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "homepage": "http://www.nodebb.org", "repository": { "type": "git", - "url": "https://github.com/designcreateplay/NodeBB/" + "url": "https://github.com/NodeBB/NodeBB/" }, "main": "app.js", "scripts": { @@ -56,7 +56,7 @@ "mocha": "~1.13.0" }, "bugs": { - "url": "https://github.com/designcreateplay/NodeBB/issues" + "url": "https://github.com/NodeBB/NodeBB/issues" }, "engines": { "node": ">=0.8" diff --git a/public/src/overrides.js b/public/src/overrides.js index e77371fa71..f3b36e54d2 100644 --- a/public/src/overrides.js +++ b/public/src/overrides.js @@ -54,7 +54,7 @@ if ('undefined' !== typeof window) { })(jQuery || {fn:{}}); - // FIX FOR #1245 - https://github.com/designcreateplay/NodeBB/issues/1245 + // FIX FOR #1245 - https://github.com/NodeBB/NodeBB/issues/1245 // from http://stackoverflow.com/questions/15931962/bootstrap-dropdown-disappear-with-right-click-on-firefox // obtain a reference to the original handler var _clearMenus = $._data(document, "events").click.filter(function (el) { diff --git a/src/install.js b/src/install.js index f8a3182a08..ef78d10dba 100644 --- a/src/install.js +++ b/src/install.js @@ -418,7 +418,7 @@ function setCopyrightWidget(next) { db.init(function(err) { if (!err) { - db.setObjectField('widgets:global', 'footer', "[{\"widget\":\"html\",\"data\":{\"html\":\"<footer id=\\\"footer\\\" class=\\\"container footer\\\">\\r\\n\\t<div class=\\\"copyright\\\">\\r\\n\\t\\tCopyright © 2014 <a target=\\\"_blank\\\" href=\\\"https://www.nodebb.com\\\">NodeBB Forums</a> | <a target=\\\"_blank\\\" href=\\\"//github.com/designcreateplay/NodeBB/graphs/contributors\\\">Contributors</a>\\r\\n\\t</div>\\r\\n</footer>\",\"title\":\"\",\"container\":\"\"}}]", next); + db.setObjectField('widgets:global', 'footer', "[{\"widget\":\"html\",\"data\":{\"html\":\"<footer id=\\\"footer\\\" class=\\\"container footer\\\">\\r\\n\\t<div class=\\\"copyright\\\">\\r\\n\\t\\tCopyright © 2014 <a target=\\\"_blank\\\" href=\\\"https://www.nodebb.com\\\">NodeBB Forums</a> | <a target=\\\"_blank\\\" href=\\\"//github.com/NodeBB/NodeBB/graphs/contributors\\\">Contributors</a>\\r\\n\\t</div>\\r\\n</footer>\",\"title\":\"\",\"container\":\"\"}}]", next); } }); } diff --git a/src/upgrade.js b/src/upgrade.js index 35329511ce..0dcc134de5 100644 --- a/src/upgrade.js +++ b/src/upgrade.js @@ -521,7 +521,7 @@ Upgrade.upgrade = function(callback) { thisSchemaDate = Date.UTC(2014, 3, 31, 12, 30); if (schemaDate < thisSchemaDate) { - db.setObjectField('widgets:global', 'footer', "[{\"widget\":\"html\",\"data\":{\"html\":\"<footer id=\\\"footer\\\" class=\\\"container footer\\\">\\r\\n\\t<div class=\\\"copyright\\\">\\r\\n\\t\\tCopyright © 2014 <a target=\\\"_blank\\\" href=\\\"https://www.nodebb.com\\\">NodeBB Forums</a> | <a target=\\\"_blank\\\" href=\\\"//github.com/designcreateplay/NodeBB/graphs/contributors\\\">Contributors</a>\\r\\n\\t</div>\\r\\n</footer>\",\"title\":\"\",\"container\":\"\"}}]", function(err) { + db.setObjectField('widgets:global', 'footer', "[{\"widget\":\"html\",\"data\":{\"html\":\"<footer id=\\\"footer\\\" class=\\\"container footer\\\">\\r\\n\\t<div class=\\\"copyright\\\">\\r\\n\\t\\tCopyright © 2014 <a target=\\\"_blank\\\" href=\\\"https://www.nodebb.com\\\">NodeBB Forums</a> | <a target=\\\"_blank\\\" href=\\\"//github.com/NodeBB/NodeBB/graphs/contributors\\\">Contributors</a>\\r\\n\\t</div>\\r\\n</footer>\",\"title\":\"\",\"container\":\"\"}}]", function(err) { if (err) { winston.error('[2014/3/31] Problem re-adding copyright message into global footer widget'); next(); From d728c54b30bef34a6cbdcab6af73862f55bbdd7d Mon Sep 17 00:00:00 2001 From: psychobunny <rodrigues.andrew@gmail.com> Date: Fri, 23 May 2014 15:32:43 -0400 Subject: [PATCH 07/15] updated logo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ad27e00882..a1fb3a1b21 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# <img alt="NodeBB" src="http://i.imgur.com/KBsf81i.png" /> +# <img alt="NodeBB" src="http://i.imgur.com/Gtesm7S.png" /> [](https://travis-ci.org/nodebb/nodebb) [](https://david-dm.org/nodebb/nodebb) [](https://codeclimate.com/github/designcreateplay/NodeBB) From 7895bf3e2f1c65dacabb6cf49b9c8bdfd28aa93b Mon Sep 17 00:00:00 2001 From: psychobunny <rodrigues.andrew@gmail.com> Date: Fri, 23 May 2014 15:34:20 -0400 Subject: [PATCH 08/15] updated logo again --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a1fb3a1b21..d5d364ffc1 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# <img alt="NodeBB" src="http://i.imgur.com/Gtesm7S.png" /> +# <img alt="NodeBB" src="http://i.imgur.com/mYxPPtB.png" /> [](https://travis-ci.org/nodebb/nodebb) [](https://david-dm.org/nodebb/nodebb) [](https://codeclimate.com/github/designcreateplay/NodeBB) From 7585b7264406b1a2b8c8da979b4848ac42b1bad2 Mon Sep 17 00:00:00 2001 From: barisusakli <barisusakli@gmail.com> Date: Fri, 23 May 2014 15:36:54 -0400 Subject: [PATCH 09/15] remove duplicates --- src/database/mongo/sorted.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/database/mongo/sorted.js b/src/database/mongo/sorted.js index 3edaea5392..2bf159f25d 100644 --- a/src/database/mongo/sorted.js +++ b/src/database/mongo/sorted.js @@ -180,6 +180,10 @@ module.exports = function(db, module) { return item.value; }); + data = data.filter(function(value, index, array) { + return array.indexOf(value) === index; + }); + callback(null, data); }); } From b7fcde446b2a14acfe9a57bdb4c28b6557b9b602 Mon Sep 17 00:00:00 2001 From: barisusakli <barisusakli@gmail.com> Date: Fri, 23 May 2014 17:03:53 -0400 Subject: [PATCH 10/15] proper score aggregation #1562 --- src/database/mongo/sorted.js | 39 +++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/src/database/mongo/sorted.js b/src/database/mongo/sorted.js index 2bf159f25d..d0c6308b32 100644 --- a/src/database/mongo/sorted.js +++ b/src/database/mongo/sorted.js @@ -163,28 +163,35 @@ module.exports = function(db, module) { stop = -1; } var limit = stop - start + 1; - if (limit < 0) { + if (limit <= 0) { limit = 0; } - db.collection('objects').find({_key:{$in: sets}}, {fields: {_id: 0, value: 1, score: 1}}) - .limit(limit) - .skip(start) - .sort({score: sort}) - .toArray(function(err, data) { - if (err || !data) { - return callback(err); - } + var pipeline = [ + { $match: { _key: {$in: sets}} }, + { $group: { _id: {value: '$value'}, totalScore: {$sum : "$score"}} }, + { $sort: { totalScore: sort} } + ]; - data = data.map(function(item) { - return item.value; - }); + if (start) { + pipeline.push({ $skip: start }); + } - data = data.filter(function(value, index, array) { - return array.indexOf(value) === index; - }); + if (limit > 0) { + pipeline.push({ $limit: limit }); + } - callback(null, data); + pipeline.push({ $project: { _id: 0, value: '$_id.value' }}); + + db.collection('objects').aggregate(pipeline, function(err, data) { + if (err || !data) { + return callback(err); + } + + data = data.map(function(item) { + return item.value; }); + callback(null, data); + }); } }; \ No newline at end of file From e505a9a6ac1f90fe94571e0ebcce1690d2ddab9d Mon Sep 17 00:00:00 2001 From: barisusakli <barisusakli@gmail.com> Date: Fri, 23 May 2014 19:07:39 -0400 Subject: [PATCH 11/15] changed order of cleanup --- src/topics/tags.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/topics/tags.js b/src/topics/tags.js index 63e67eddd4..9326f6fddb 100644 --- a/src/topics/tags.js +++ b/src/topics/tags.js @@ -32,12 +32,12 @@ module.exports = function(Topics) { function cleanUpTag(tag) { tag = tag.trim().toLowerCase(); + tag = tag.replace(/[\.,\/#!$%\^&\*;:{}=_`<>'"~()?\|]/g, ''); + tag = tag.substr(0, meta.config.maximumTagLength || 15); var matches = tag.match(/^-*(.+?)-*$/); if (matches && matches.length > 1) { tag = matches[1]; } - tag = tag.replace(/[\.,\/#!$%\^&\*;:{}=_`<>'"~()?\|]/g, ''); - tag = tag.substr(0, meta.config.maximumTagLength || 15); return tag; } From d74de798fc0d8611a8367d77de6799e85e151448 Mon Sep 17 00:00:00 2001 From: Julian Lam <julian@designcreateplay.com> Date: Fri, 23 May 2014 19:12:54 -0400 Subject: [PATCH 12/15] removing backwards compatibility fixed in preparation for 0.5.0. Prepare for stuff to break!!!!! --- src/meta.js | 2 -- src/middleware/index.js | 11 ----------- src/plugins.js | 14 ++------------ 3 files changed, 2 insertions(+), 25 deletions(-) diff --git a/src/meta.js b/src/meta.js index a655249b1f..8df7667a21 100644 --- a/src/meta.js +++ b/src/meta.js @@ -259,7 +259,6 @@ var fs = require('fs'), jsPaths = scripts.map(function (jsPath) { jsPath = path.normalize(jsPath); - // The filter:scripts.get plugin will be deprecated as of v0.5.0, specify scripts in plugin.json instead if (jsPath.substring(0, 7) === 'plugins') { var matches = _.map(plugins.staticDirs, function(realPath, mappedPath) { if (jsPath.match(mappedPath)) { @@ -283,7 +282,6 @@ var fs = require('fs'), } }); - // Remove scripts that could not be found (remove this line at v0.5.0) Meta.js.scripts = jsPaths.filter(function(path) { return path !== null; }); diff --git a/src/middleware/index.js b/src/middleware/index.js index 197f0a9c8d..13e0df1aee 100644 --- a/src/middleware/index.js +++ b/src/middleware/index.js @@ -61,17 +61,6 @@ function routeCurrentTheme(app, themeId, themesData) { // Theme's templates path nconf.set('theme_templates_path', themeObj.templates ? path.join(themesPath, themeObj.id, themeObj.templates) : nconf.get('base_templates_path')); themeTemplatesPath = nconf.get('theme_templates_path'); - - // Theme's static directory (to be deprecated for 0.5.0) - if (themeObj.staticDir) { - app.use(relativePath + '/css/assets', express.static(path.join(themesPath, themeObj.id, themeObj.staticDir), { - maxAge: app.enabled('cache') ? 5184000000 : 0 - })); - - if (process.env.NODE_ENV === 'development') { - winston.info('Static directory routed for theme: ' + themeObj.id); - } - } } function compileTemplates(pluginTemplates) { diff --git a/src/plugins.js b/src/plugins.js index a1c715711b..61276bfffe 100644 --- a/src/plugins.js +++ b/src/plugins.js @@ -195,18 +195,8 @@ var fs = require('fs'), } Plugins.cssFiles = Plugins.cssFiles.concat(pluginData.css.map(function(file) { - if (fs.existsSync(path.join(__dirname, '../node_modules', pluginData.id, file))) { - return path.join(pluginData.id, file); - } else { - // Backwards compatibility with < v0.4.0, remove this for v0.5.0 - if (pluginData.staticDir) { - return path.join(pluginData.id, pluginData.staticDir, file); - } else { - winston.error('[plugins/' + pluginData.id + '] This plugin\'s CSS is incorrectly configured, please contact the plugin author.'); - return null; - } - } - }).filter(function(path) { return path })); // Filter out nulls, remove this for v0.5.0 + return path.join(pluginData.id, file); + })); } next(); From b6e0a2eccefbea5cd56a3dbe20aaeb9641ca8717 Mon Sep 17 00:00:00 2001 From: barisusakli <barisusakli@gmail.com> Date: Fri, 23 May 2014 22:55:54 -0400 Subject: [PATCH 13/15] parseInt --- public/src/forum/account/profile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/src/forum/account/profile.js b/public/src/forum/account/profile.js index 9c45bf6e7b..6b6d38ad66 100644 --- a/public/src/forum/account/profile.js +++ b/public/src/forum/account/profile.js @@ -43,7 +43,7 @@ define(['forum/account/header'], function(header) { } function updateButtons() { - var isSelfOrNotLoggedIn = yourid === theirid || yourid === '0'; + var isSelfOrNotLoggedIn = yourid === theirid || parseInt(yourid, 10) === 0; $('#follow-btn').toggleClass('hide', isFollowing || isSelfOrNotLoggedIn); $('#unfollow-btn').toggleClass('hide', !isFollowing || isSelfOrNotLoggedIn); $('#chat-btn').toggleClass('hide', isSelfOrNotLoggedIn); From 1a753bf64de08cf1fd0d0620992e92bdef76f5fd Mon Sep 17 00:00:00 2001 From: barisusakli <barisusakli@gmail.com> Date: Sat, 24 May 2014 06:29:44 -0400 Subject: [PATCH 14/15] fixes forking if there are no tags just return --- src/topics/tags.js | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/src/topics/tags.js b/src/topics/tags.js index 9326f6fddb..f113720dfa 100644 --- a/src/topics/tags.js +++ b/src/topics/tags.js @@ -9,25 +9,27 @@ var async = require('async'), module.exports = function(Topics) { Topics.createTags = function(tags, tid, timestamp, callback) { - if(Array.isArray(tags)) { - tags = tags.slice(0, meta.config.tagsPerTopic || 5); + if (!Array.isArray(tags) || !tags.length) { + return callback(); + } - async.each(tags, function(tag, next) { - tag = cleanUpTag(tag); + tags = tags.slice(0, meta.config.tagsPerTopic || 5); - if (tag.length < (meta.config.minimumTagLength || 3)) { - return next(); - } - db.setAdd('topic:' + tid + ':tags', tag); + async.each(tags, function(tag, next) { + tag = cleanUpTag(tag); - db.sortedSetAdd('tag:' + tag + ':topics', timestamp, tid, function(err) { - if (!err) { - updateTagCount(tag); - } - next(err); - }); - }, callback); - } + if (tag.length < (meta.config.minimumTagLength || 3)) { + return next(); + } + db.setAdd('topic:' + tid + ':tags', tag); + + db.sortedSetAdd('tag:' + tag + ':topics', timestamp, tid, function(err) { + if (!err) { + updateTagCount(tag); + } + next(err); + }); + }, callback); }; function cleanUpTag(tag) { From e0a5cb2b441693dd1e41e397eababe76967267fa Mon Sep 17 00:00:00 2001 From: Aziz Khoury <bentael@gmail.com> Date: Sat, 24 May 2014 10:21:20 -0400 Subject: [PATCH 15/15] my bad :/ --- public/src/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/src/utils.js b/public/src/utils.js index 356df294c3..712171ea04 100644 --- a/public/src/utils.js +++ b/public/src/utils.js @@ -355,7 +355,7 @@ if(props !== undefined && !(obj[prop] instanceof Object) ) obj[prop] = {}; - return util.props(obj[prop], newProps, value); + return utils.props(obj[prop], newProps, value); } };