diff --git a/app/assets/javascripts/discourse/components/post-menu.js.es6 b/app/assets/javascripts/discourse/components/post-menu.js.es6 index 68346372eba..a6933a39fc4 100644 --- a/app/assets/javascripts/discourse/components/post-menu.js.es6 +++ b/app/assets/javascripts/discourse/components/post-menu.js.es6 @@ -15,10 +15,12 @@ export const Button = function(action, label, icon, opts) { }; function animateHeart($elem, start, end, complete) { + if (Ember.testing) { return Ember.run(this, complete); } + $elem.stop() .css('textIndent', start) .animate({ textIndent: end }, { - complete: complete, + complete, step(now) { $(this).css('transform','scale('+now+')'); }, diff --git a/test/javascripts/components/post-menu-test.js.es6 b/test/javascripts/components/post-menu-test.js.es6 index aef7c4b1a38..e94dc749b29 100644 --- a/test/javascripts/components/post-menu-test.js.es6 +++ b/test/javascripts/components/post-menu-test.js.es6 @@ -2,13 +2,51 @@ import componentTest from 'helpers/component-test'; moduleForComponent('post-menu', {integration: true}); -componentTest('render buttons', { - template: "{{post-menu post=post}}", - setup(store) { - const topic = store.createRecord('topic', {id: 123}); - this.set('post', store.createRecord('post', {id: 1, post_number: 1, topic})); - }, +function setup(store) { + const topic = store.createRecord('topic', {id: 123}); + const post = store.createRecord('post', { + id: 1, + post_number: 1, + topic, + like_count: 3, + actions_summary: [ + {id: 2, count: 3, hidden: false, can_act: true} + ] + }); + + this.on('toggleLike', function() { + post.toggleProperty('actionByName.like.acted'); + }); + + this.set('post', post); +} + +componentTest('basic render', { + template: '{{post-menu post=post}}', + setup, test(assert) { - assert.ok(this.$('.post-menu-area').length, 'it renders a post menu'); + assert.ok(!!this.$('.post-menu-area').length, 'it renders a post menu'); + assert.ok(!!this.$('.actions button[data-share-url]').length, 'it renders a share button'); + } +}); + +componentTest('liking', { + template: '{{post-menu post=post toggleLike="toggleLike"}}', + setup, + test(assert) { + assert.ok(!!this.$('.actions button.like').length); + assert.ok(!!this.$('.actions button.like-count').length); + + click('.actions button.like'); + andThen(() => { + assert.ok(!this.$('.actions button.like').length); + assert.ok(!!this.$('.actions button.has-like').length); + }); + + click('.actions button.has-like'); + andThen(() => { + assert.ok(!!this.$('.actions button.like').length); + assert.ok(!this.$('.actions button.has-like').length); + }); } }); diff --git a/test/javascripts/fixtures/site_fixtures.js.es6 b/test/javascripts/fixtures/site_fixtures.js.es6 index 219efa648fb..19465bf50eb 100644 --- a/test/javascripts/fixtures/site_fixtures.js.es6 +++ b/test/javascripts/fixtures/site_fixtures.js.es6 @@ -1,3 +1,574 @@ export default { - "site.json": {"site":{"default_archetype":"regular","notification_types":{"mentioned":1,"replied":2,"quoted":3,"edited":4,"liked":5,"private_message":6,"invited_to_private_message":7,"invitee_accepted":8,"posted":9,"moved_post":10,"linked":11,"granted_badge":12},"post_types":{"regular":1,"moderator_action":2},"group_names":["admins","discourse","everyone","mcneel","moderators","newrelic","plugin_authors","sitepoint","staff","translators","trust_level_0","trust_level_1","trust_level_2","trust_level_3","trust_level_4","ubuntu"],"filters":["latest","unread","new","starred","read","posted"],"periods":["yearly","monthly","weekly","daily"],"top_menu_items":["latest","unread","new","starred","read","posted","category","categories","top"],"anonymous_top_menu_items":["latest","top","categories","category","categories","top"],"uncategorized_category_id":17,"is_readonly":false,"categories":[{"id":3,"name":"meta","color":"aaa","text_color":"FFFFFF","slug":"meta","topic_count":122,"post_count":1023,"description":"Discussion about meta.discourse.org itself, the organization of this forum about Discourse, how it works, and how we can improve this site.","topic_url":"/t/category-definition-for-meta/24","read_restricted":false,"permission":1,"notification_level":null,"logo_url":null,"background_url":null},{"id":10,"name":"howto","color":"76923C","text_color":"FFFFFF","slug":"howto","topic_count":72,"post_count":1022,"description":"Tutorial topics that describe how to set up, configure, or install Discourse using a specific platform or environment. Topics in this category may only be created by trust level 2 and up. ","topic_url":"/t/category-definition-for-howto/2629","read_restricted":false,"permission":1,"notification_level":null,"logo_url":null,"background_url":null},{"id":26,"name":"spec","color":"33B0B0","text_color":"FFFFFF","slug":"spec","topic_count":20,"post_count":278,"description":"My idea here is to have mini specs for features we would like built but have no bandwidth to build","topic_url":"/t/about-the-spec-category/13965","read_restricted":false,"permission":1,"parent_category_id":2,"notification_level":null,"logo_url":null,"background_url":null},{"id":7,"name":"dev","color":"000","text_color":"FFFFFF","slug":"dev","topic_count":481,"post_count":3575,"description":"This category is for topics related to hacking on Discourse: submitting pull requests, configuring development environments, coding conventions, and so forth.","topic_url":"/t/category-definition-for-dev/1026","read_restricted":false,"permission":1,"notification_level":null,"logo_url":null,"background_url":null},{"id":6,"name":"support","color":"b99","text_color":"FFFFFF","slug":"support","topic_count":1603,"post_count":11075,"description":"Support on configuring, using, and installing Discourse. Not for software development related topics, but for admins and end users configuring and using Discourse.","topic_url":"/t/category-definition-for-support/389","read_restricted":false,"permission":1,"notification_level":null,"logo_url":null,"background_url":null},{"id":24,"name":"sso","color":"92278F","text_color":"FFFFFF","slug":"sso","topic_count":13,"post_count":53,"description":"Only include actual maintained SSO (single sign on) implementations in this category. See the <a href=\"https://meta.discourse.org/t/official-single-sign-on-for-discourse/13045\">official documentation on Discourse's SSO support</a>.","topic_url":"/t/about-the-sso-category/13110","read_restricted":false,"permission":1,"parent_category_id":5,"notification_level":null,"logo_url":null,"background_url":null},{"id":28,"name":"hack night","color":"B3B5B4","text_color":"FFFFFF","slug":"hack-night","topic_count":8,"post_count":33,"description":"This is a special, temporary category to organize work on the <a href=\"http://www.meetup.com/torontoruby/events/192168702/\">Discourse Hack Night</a> in Toronto. ","topic_url":"/t/about-the-hack-night-category/17878","read_restricted":false,"permission":1,"parent_category_id":7,"notification_level":null,"logo_url":null,"background_url":null},{"id":27,"name":"translations","color":"808281","text_color":"FFFFFF","slug":"translations","topic_count":95,"post_count":827,"description":"This category is for discussion about localizing Discourse.","topic_url":"/t/about-the-translations-category/14549","read_restricted":false,"permission":1,"parent_category_id":7,"notification_level":null,"logo_url":null,"background_url":null},{"id":4,"name":"faq","color":"33b","text_color":"FFFFFF","slug":"faq","topic_count":48,"post_count":501,"description":"Topics that come up very often when discussing Discourse will eventually be classified into this Frequently Asked Questions category. Should only be added to popular topics.","topic_url":"/t/category-definition-for-faq/25","read_restricted":false,"permission":1,"notification_level":null,"logo_url":null,"background_url":null},{"id":14,"name":"marketplace","color":"8C6238","text_color":"FFFFFF","slug":"marketplace","topic_count":66,"post_count":361,"description":"About commercial Discourse related stuff: jobs or paid gigs, plugins, themes, hosting, etc.","topic_url":"/t/category-definition-for-marketplace/5425","read_restricted":false,"permission":1,"notification_level":null,"logo_url":null,"background_url":null},{"id":12,"name":"discourse hub","color":"b2c79f","text_color":"FFFFFF","slug":"discourse-hub","topic_count":10,"post_count":164,"description":"Topics about current or future Discourse Hub functionality at discourse.org including nickname registration, global user pages, and the site directory.","topic_url":"/t/category-definition-for-discourse-hub/3038","read_restricted":false,"permission":1,"notification_level":null,"logo_url":null,"background_url":null},{"id":13,"name":"blog","color":"ED207B","text_color":"FFFFFF","slug":"blog","topic_count":22,"post_count":390,"description":"Discussion topics generated from the official Discourse Blog. These topics are linked from the bottom of each blog entry where the blog comments would normally be.","topic_url":"/t/category-definition-for-blog/5250","read_restricted":false,"permission":1,"notification_level":null,"logo_url":null,"background_url":null},{"id":5,"name":"extensibility","color":"FE8432","text_color":"FFFFFF","slug":"extensibility","topic_count":226,"post_count":1874,"description":"Topics about extending the functionality of Discourse with plugins, themes, add-ons, or other mechanisms for extensibility. ","topic_url":"/t/about-the-extensibility-category/28","read_restricted":false,"permission":1,"notification_level":null,"logo_url":null,"background_url":null},{"id":11,"name":"login","color":"edb400","text_color":"FFFFFF","slug":"login","topic_count":48,"post_count":357,"description":"Topics about logging in to Discourse, using any standard third party provider (Twitter, Facebook, Google), traditional username and password, or with a custom plugin.","topic_url":"/t/category-definition-for-login/2828","read_restricted":false,"permission":1,"notification_level":null,"logo_url":null,"background_url":null},{"id":22,"name":"plugin","color":"d47711","text_color":"FFFFFF","slug":"plugin","topic_count":40,"post_count":466,"description":"One post per plugin! Only plugin owners should post here. ","topic_url":"/t/about-the-plugin-category/12648","read_restricted":false,"permission":1,"parent_category_id":5,"notification_level":null,"logo_url":null,"background_url":null},{"id":1,"name":"bug","color":"e9dd00","text_color":"000000","slug":"bug","topic_count":1469,"post_count":9295,"description":"A bug report means something is broken, preventing normal/typical use of Discourse. Do be sure to search prior to submitting bugs. Include repro steps, and only describe one bug per topic please.","topic_url":"/t/category-definition-for-bug/2","read_restricted":false,"permission":1,"notification_level":null,"logo_url":null,"background_url":null,"can_edit":true},{"id":17,"name":"uncategorized","color":"AB9364","text_color":"FFFFFF","slug":"uncategorized","topic_count":342,"post_count":3090,"description":"Topics that don't need a category, or don't fit into any other existing category.","topic_url":null,"read_restricted":false,"permission":1,"notification_level":null,"logo_url":"","background_url":""},{"id":21,"name":"wordpress","color":"1E8CBE","text_color":"FFFFFF","slug":"wordpress","topic_count":26,"post_count":135,"description":"Support for the official Discourse WordPress plugin at <a href=\"https://github.com/discourse/wp-discourse\">https://github.com/discourse/wp-discourse</a>","topic_url":"/t/category-definition-for-wordpress/12282","read_restricted":false,"permission":1,"parent_category_id":6,"notification_level":null,"logo_url":null,"background_url":null},{"id":8,"name":"hosting","color":"74CCED","text_color":"FFFFFF","slug":"hosting","topic_count":100,"post_count":917,"description":"Topics about hosting Discourse, either on your own servers, in the cloud, or with specific hosting services.","topic_url":"/t/category-definition-for-hosting/2626","read_restricted":false,"permission":1,"notification_level":null,"logo_url":null,"background_url":null},{"id":9,"name":"ux","color":"5F497A","text_color":"FFFFFF","slug":"ux","topic_count":452,"post_count":4472,"description":"Discussion about the user interface of Discourse, how features are presented to the user in the client, including language and UI elements.","topic_url":"/t/category-definition-for-ux/2628","read_restricted":false,"permission":1,"notification_level":null,"logo_url":null,"background_url":null},{"id":2,"name":"feature","color":"0E76BD","text_color":"FFFFFF","slug":"feature","topic_count":1367,"post_count":11942,"description":"Discussion about features or potential features of Discourse: how they work, why they work, etc.","topic_url":"/t/category-definition-for-feature/11","read_restricted":false,"permission":1,"notification_level":null,"logo_url":null,"background_url":null}],"post_action_types":[{"name_key":"bookmark","name":"Bookmark","description":"Bookmark this post","long_form":"bookmarked this post","is_flag":false,"icon":null,"id":1,"is_custom_flag":false},{"name_key":"like","name":"Like","description":"Like this post","long_form":"liked this","is_flag":false,"icon":"heart","id":2,"is_custom_flag":false},{"name_key":"off_topic","name":"Off-Topic","description":"This post is radically off-topic in the current topic, and should probably be moved. If this is a topic, perhaps it does not belong here.","long_form":"flagged this as off-topic","is_flag":true,"icon":null,"id":3,"is_custom_flag":false},{"name_key":"inappropriate","name":"Inappropriate","description":"This post contains content that a reasonable person would consider offensive, abusive, or a violation of <a href=\"/guidelines\">our community guidelines</a>.","long_form":"flagged this as inappropriate","is_flag":true,"icon":null,"id":4,"is_custom_flag":false},{"name_key":"vote","name":"Vote","description":"Vote for this post","long_form":"voted for this post","is_flag":false,"icon":null,"id":5,"is_custom_flag":false},{"name_key":"spam","name":"Spam","description":"This post is an advertisement. It is not useful or relevant to the current topic, but promotional in nature.","long_form":"flagged this as spam","is_flag":true,"icon":null,"id":8,"is_custom_flag":false},{"name_key":"notify_user","name":"Notify {{username}}","description":"This post contains something I want to talk to this person directly and privately about. Does not cast a flag.","long_form":"notified user","is_flag":true,"icon":null,"id":6,"is_custom_flag":true},{"name_key":"notify_moderators","name":"Notify moderators","description":"This post requires general moderator attention based on the <a href=\"/guidelines\">guidelines</a>, <a href=\"/tos\">TOS</a>, or for another reason not listed above.","long_form":"notified moderators","is_flag":true,"icon":null,"id":7,"is_custom_flag":true}],"topic_flag_types":[{"name_key":"inappropriate","name":"Inappropriate","description":"This topic contains content that a reasonable person would consider offensive, abusive, or a violation of <a href=\"/guidelines\">our community guidelines</a>.","long_form":"flagged this as inappropriate","is_flag":true,"icon":null,"id":4,"is_custom_flag":false},{"name_key":"spam","name":"Spam","description":"This topic is an advertisement. It is not useful or relevant to this site, but promotional in nature.","long_form":"flagged this as spam","is_flag":true,"icon":null,"id":8,"is_custom_flag":false},{"name_key":"notify_moderators","name":"Notify moderators","description":"This topic requires general moderator attention based on the <a href=\"/guidelines\">guidelines</a>, <a href=\"/tos\">TOS</a>, or for another reason not listed above.","long_form":"notified moderators","is_flag":true,"icon":null,"id":7,"is_custom_flag":true}],"trust_levels":[{"id":0,"name":"new user"},{"id":1,"name":"basic user"},{"id":2,"name":"member"},{"id":3,"name":"regular"},{"id":4,"name":"leader"}],"archetypes":[{"id":"regular","name":"Regular Topic","options":[]},{"id":"banner","name":"translation missing: en.archetypes.banner.title","options":[]}]}} + "site.json":{ + "site":{ + "default_archetype":"regular", + "notification_types":{ + "mentioned":1, + "replied":2, + "quoted":3, + "edited":4, + "liked":5, + "private_message":6, + "invited_to_private_message":7, + "invitee_accepted":8, + "posted":9, + "moved_post":10, + "linked":11, + "granted_badge":12 + }, + "post_types":{ + "regular":1, + "moderator_action":2 + }, + "group_names":[ + "admins", + "discourse", + "everyone", + "mcneel", + "moderators", + "newrelic", + "plugin_authors", + "sitepoint", + "staff", + "translators", + "trust_level_0", + "trust_level_1", + "trust_level_2", + "trust_level_3", + "trust_level_4", + "ubuntu" + ], + "filters":[ + "latest", + "unread", + "new", + "starred", + "read", + "posted" + ], + "periods":[ + "yearly", + "monthly", + "weekly", + "daily" + ], + "top_menu_items":[ + "latest", + "unread", + "new", + "starred", + "read", + "posted", + "category", + "categories", + "top" + ], + "anonymous_top_menu_items":[ + "latest", + "top", + "categories", + "category", + "categories", + "top" + ], + "uncategorized_category_id":17, + "is_readonly":false, + "categories":[ + { + "id":3, + "name":"meta", + "color":"aaa", + "text_color":"FFFFFF", + "slug":"meta", + "topic_count":122, + "post_count":1023, + "description":"Discussion about meta.discourse.org itself, the organization of this forum about Discourse, how it works, and how we can improve this site.", + "topic_url":"/t/category-definition-for-meta/24", + "read_restricted":false, + "permission":1, + "notification_level":null, + "logo_url":null, + "background_url":null + }, + { + "id":10, + "name":"howto", + "color":"76923C", + "text_color":"FFFFFF", + "slug":"howto", + "topic_count":72, + "post_count":1022, + "description":"Tutorial topics that describe how to set up, configure, or install Discourse using a specific platform or environment. Topics in this category may only be created by trust level 2 and up. ", + "topic_url":"/t/category-definition-for-howto/2629", + "read_restricted":false, + "permission":1, + "notification_level":null, + "logo_url":null, + "background_url":null + }, + { + "id":26, + "name":"spec", + "color":"33B0B0", + "text_color":"FFFFFF", + "slug":"spec", + "topic_count":20, + "post_count":278, + "description":"My idea here is to have mini specs for features we would like built but have no bandwidth to build", + "topic_url":"/t/about-the-spec-category/13965", + "read_restricted":false, + "permission":1, + "parent_category_id":2, + "notification_level":null, + "logo_url":null, + "background_url":null + }, + { + "id":7, + "name":"dev", + "color":"000", + "text_color":"FFFFFF", + "slug":"dev", + "topic_count":481, + "post_count":3575, + "description":"This category is for topics related to hacking on Discourse: submitting pull requests, configuring development environments, coding conventions, and so forth.", + "topic_url":"/t/category-definition-for-dev/1026", + "read_restricted":false, + "permission":1, + "notification_level":null, + "logo_url":null, + "background_url":null + }, + { + "id":6, + "name":"support", + "color":"b99", + "text_color":"FFFFFF", + "slug":"support", + "topic_count":1603, + "post_count":11075, + "description":"Support on configuring, using, and installing Discourse. Not for software development related topics, but for admins and end users configuring and using Discourse.", + "topic_url":"/t/category-definition-for-support/389", + "read_restricted":false, + "permission":1, + "notification_level":null, + "logo_url":null, + "background_url":null + }, + { + "id":24, + "name":"sso", + "color":"92278F", + "text_color":"FFFFFF", + "slug":"sso", + "topic_count":13, + "post_count":53, + "description":"Only include actual maintained SSO (single sign on) implementations in this category. See the <a href=\"https://meta.discourse.org/t/official-single-sign-on-for-discourse/13045\">official documentation on Discourse's SSO support</a>.", + "topic_url":"/t/about-the-sso-category/13110", + "read_restricted":false, + "permission":1, + "parent_category_id":5, + "notification_level":null, + "logo_url":null, + "background_url":null + }, + { + "id":28, + "name":"hack night", + "color":"B3B5B4", + "text_color":"FFFFFF", + "slug":"hack-night", + "topic_count":8, + "post_count":33, + "description":"This is a special, temporary category to organize work on the <a href=\"http://www.meetup.com/torontoruby/events/192168702/\">Discourse Hack Night</a> in Toronto. ", + "topic_url":"/t/about-the-hack-night-category/17878", + "read_restricted":false, + "permission":1, + "parent_category_id":7, + "notification_level":null, + "logo_url":null, + "background_url":null + }, + { + "id":27, + "name":"translations", + "color":"808281", + "text_color":"FFFFFF", + "slug":"translations", + "topic_count":95, + "post_count":827, + "description":"This category is for discussion about localizing Discourse.", + "topic_url":"/t/about-the-translations-category/14549", + "read_restricted":false, + "permission":1, + "parent_category_id":7, + "notification_level":null, + "logo_url":null, + "background_url":null + }, + { + "id":4, + "name":"faq", + "color":"33b", + "text_color":"FFFFFF", + "slug":"faq", + "topic_count":48, + "post_count":501, + "description":"Topics that come up very often when discussing Discourse will eventually be classified into this Frequently Asked Questions category. Should only be added to popular topics.", + "topic_url":"/t/category-definition-for-faq/25", + "read_restricted":false, + "permission":1, + "notification_level":null, + "logo_url":null, + "background_url":null + }, + { + "id":14, + "name":"marketplace", + "color":"8C6238", + "text_color":"FFFFFF", + "slug":"marketplace", + "topic_count":66, + "post_count":361, + "description":"About commercial Discourse related stuff: jobs or paid gigs, plugins, themes, hosting, etc.", + "topic_url":"/t/category-definition-for-marketplace/5425", + "read_restricted":false, + "permission":1, + "notification_level":null, + "logo_url":null, + "background_url":null + }, + { + "id":12, + "name":"discourse hub", + "color":"b2c79f", + "text_color":"FFFFFF", + "slug":"discourse-hub", + "topic_count":10, + "post_count":164, + "description":"Topics about current or future Discourse Hub functionality at discourse.org including nickname registration, global user pages, and the site directory.", + "topic_url":"/t/category-definition-for-discourse-hub/3038", + "read_restricted":false, + "permission":1, + "notification_level":null, + "logo_url":null, + "background_url":null + }, + { + "id":13, + "name":"blog", + "color":"ED207B", + "text_color":"FFFFFF", + "slug":"blog", + "topic_count":22, + "post_count":390, + "description":"Discussion topics generated from the official Discourse Blog. These topics are linked from the bottom of each blog entry where the blog comments would normally be.", + "topic_url":"/t/category-definition-for-blog/5250", + "read_restricted":false, + "permission":1, + "notification_level":null, + "logo_url":null, + "background_url":null + }, + { + "id":5, + "name":"extensibility", + "color":"FE8432", + "text_color":"FFFFFF", + "slug":"extensibility", + "topic_count":226, + "post_count":1874, + "description":"Topics about extending the functionality of Discourse with plugins, themes, add-ons, or other mechanisms for extensibility. ", + "topic_url":"/t/about-the-extensibility-category/28", + "read_restricted":false, + "permission":1, + "notification_level":null, + "logo_url":null, + "background_url":null + }, + { + "id":11, + "name":"login", + "color":"edb400", + "text_color":"FFFFFF", + "slug":"login", + "topic_count":48, + "post_count":357, + "description":"Topics about logging in to Discourse, using any standard third party provider (Twitter, Facebook, Google), traditional username and password, or with a custom plugin.", + "topic_url":"/t/category-definition-for-login/2828", + "read_restricted":false, + "permission":1, + "notification_level":null, + "logo_url":null, + "background_url":null + }, + { + "id":22, + "name":"plugin", + "color":"d47711", + "text_color":"FFFFFF", + "slug":"plugin", + "topic_count":40, + "post_count":466, + "description":"One post per plugin! Only plugin owners should post here. ", + "topic_url":"/t/about-the-plugin-category/12648", + "read_restricted":false, + "permission":1, + "parent_category_id":5, + "notification_level":null, + "logo_url":null, + "background_url":null + }, + { + "id":1, + "name":"bug", + "color":"e9dd00", + "text_color":"000000", + "slug":"bug", + "topic_count":1469, + "post_count":9295, + "description":"A bug report means something is broken, preventing normal/typical use of Discourse. Do be sure to search prior to submitting bugs. Include repro steps, and only describe one bug per topic please.", + "topic_url":"/t/category-definition-for-bug/2", + "read_restricted":false, + "permission":1, + "notification_level":null, + "logo_url":null, + "background_url":null, + "can_edit":true + }, + { + "id":17, + "name":"uncategorized", + "color":"AB9364", + "text_color":"FFFFFF", + "slug":"uncategorized", + "topic_count":342, + "post_count":3090, + "description":"Topics that don't need a category, or don't fit into any other existing category.", + "topic_url":null, + "read_restricted":false, + "permission":1, + "notification_level":null, + "logo_url":"", + "background_url":"" + }, + { + "id":21, + "name":"wordpress", + "color":"1E8CBE", + "text_color":"FFFFFF", + "slug":"wordpress", + "topic_count":26, + "post_count":135, + "description":"Support for the official Discourse WordPress plugin at <a href=\"https://github.com/discourse/wp-discourse\">https://github.com/discourse/wp-discourse</a>", + "topic_url":"/t/category-definition-for-wordpress/12282", + "read_restricted":false, + "permission":1, + "parent_category_id":6, + "notification_level":null, + "logo_url":null, + "background_url":null + }, + { + "id":8, + "name":"hosting", + "color":"74CCED", + "text_color":"FFFFFF", + "slug":"hosting", + "topic_count":100, + "post_count":917, + "description":"Topics about hosting Discourse, either on your own servers, in the cloud, or with specific hosting services.", + "topic_url":"/t/category-definition-for-hosting/2626", + "read_restricted":false, + "permission":1, + "notification_level":null, + "logo_url":null, + "background_url":null + }, + { + "id":9, + "name":"ux", + "color":"5F497A", + "text_color":"FFFFFF", + "slug":"ux", + "topic_count":452, + "post_count":4472, + "description":"Discussion about the user interface of Discourse, how features are presented to the user in the client, including language and UI elements.", + "topic_url":"/t/category-definition-for-ux/2628", + "read_restricted":false, + "permission":1, + "notification_level":null, + "logo_url":null, + "background_url":null + }, + { + "id":2, + "name":"feature", + "color":"0E76BD", + "text_color":"FFFFFF", + "slug":"feature", + "topic_count":1367, + "post_count":11942, + "description":"Discussion about features or potential features of Discourse: how they work, why they work, etc.", + "topic_url":"/t/category-definition-for-feature/11", + "read_restricted":false, + "permission":1, + "notification_level":null, + "logo_url":null, + "background_url":null + } + ], + "post_action_types":[ + { + "name_key":"bookmark", + "name":"Bookmark", + "description":"Bookmark this post", + "long_form":"bookmarked this post", + "is_flag":false, + "icon":null, + "id":1, + "is_custom_flag":false + }, + { + "name_key":"like", + "name":"Like", + "description":"Like this post", + "long_form":"liked this", + "is_flag":false, + "icon":"heart", + "id":2, + "is_custom_flag":false + }, + { + "name_key":"off_topic", + "name":"Off-Topic", + "description":"This post is radically off-topic in the current topic, and should probably be moved. If this is a topic, perhaps it does not belong here.", + "long_form":"flagged this as off-topic", + "is_flag":true, + "icon":null, + "id":3, + "is_custom_flag":false + }, + { + "name_key":"inappropriate", + "name":"Inappropriate", + "description":"This post contains content that a reasonable person would consider offensive, abusive, or a violation of <a href=\"/guidelines\">our community guidelines</a>.", + "long_form":"flagged this as inappropriate", + "is_flag":true, + "icon":null, + "id":4, + "is_custom_flag":false + }, + { + "name_key":"vote", + "name":"Vote", + "description":"Vote for this post", + "long_form":"voted for this post", + "is_flag":false, + "icon":null, + "id":5, + "is_custom_flag":false + }, + { + "name_key":"spam", + "name":"Spam", + "description":"This post is an advertisement. It is not useful or relevant to the current topic, but promotional in nature.", + "long_form":"flagged this as spam", + "is_flag":true, + "icon":null, + "id":8, + "is_custom_flag":false + }, + { + "name_key":"notify_user", + "name":"Notify {{username}}", + "description":"This post contains something I want to talk to this person directly and privately about. Does not cast a flag.", + "long_form":"notified user", + "is_flag":true, + "icon":null, + "id":6, + "is_custom_flag":true + }, + { + "name_key":"notify_moderators", + "name":"Notify moderators", + "description":"This post requires general moderator attention based on the <a href=\"/guidelines\">guidelines</a>, <a href=\"/tos\">TOS</a>, or for another reason not listed above.", + "long_form":"notified moderators", + "is_flag":true, + "icon":null, + "id":7, + "is_custom_flag":true + } + ], + "topic_flag_types":[ + { + "name_key":"inappropriate", + "name":"Inappropriate", + "description":"This topic contains content that a reasonable person would consider offensive, abusive, or a violation of <a href=\"/guidelines\">our community guidelines</a>.", + "long_form":"flagged this as inappropriate", + "is_flag":true, + "icon":null, + "id":4, + "is_custom_flag":false + }, + { + "name_key":"spam", + "name":"Spam", + "description":"This topic is an advertisement. It is not useful or relevant to this site, but promotional in nature.", + "long_form":"flagged this as spam", + "is_flag":true, + "icon":null, + "id":8, + "is_custom_flag":false + }, + { + "name_key":"notify_moderators", + "name":"Notify moderators", + "description":"This topic requires general moderator attention based on the <a href=\"/guidelines\">guidelines</a>, <a href=\"/tos\">TOS</a>, or for another reason not listed above.", + "long_form":"notified moderators", + "is_flag":true, + "icon":null, + "id":7, + "is_custom_flag":true + } + ], + "trust_levels":[ + { + "id":0, + "name":"new user" + }, + { + "id":1, + "name":"basic user" + }, + { + "id":2, + "name":"member" + }, + { + "id":3, + "name":"regular" + }, + { + "id":4, + "name":"leader" + } + ], + "archetypes":[ + { + "id":"regular", + "name":"Regular Topic", + "options":[ + + ] + }, + { + "id":"banner", + "name":"translation missing: en.archetypes.banner.title", + "options":[ + ] + } + ] + } + } }; diff --git a/test/javascripts/helpers/site-settings.js b/test/javascripts/helpers/site-settings.js index 85398de95bb..68612e7530f 100644 --- a/test/javascripts/helpers/site-settings.js +++ b/test/javascripts/helpers/site-settings.js @@ -1,3 +1,97 @@ /*jshint maxlen:10000000 */ -Discourse.SiteSettingsOriginal = {"title":"Discourse Meta","logo_url":"/assets/logo.png","logo_small_url":"/assets/logo-single.png","mobile_logo_url":"","favicon_url":"//meta.discourse.org/uploads/default/2499/79d53726406d87af.ico","allow_user_locale":false,"suggested_topics":7,"track_external_right_clicks":false,"ga_universal_tracking_code":"","ga_universal_domain_name":"auto","ga_tracking_code":"UA-33736483-2","ga_domain_name":"","top_menu":"latest|new|unread|categories|top","post_menu":"like|share|flag|edit|bookmark|delete|admin|reply","post_menu_hidden_items":"edit|delete|admin","share_links":"twitter|facebook|google+|email","category_colors":"BF1E2E|F1592A|F7941D|9EB83B|3AB54A|12A89D|25AAE2|0E76BD|652D90|92278F|ED207B|8C6238|231F20|808281|B3B5B4|283890","enable_mobile_theme":true,"relative_date_duration":14,"category_featured_topics":4,"fixed_category_positions":false,"show_subcategory_list":false,"enable_badges":true,"invite_only":false,"login_required":false,"must_approve_users":false,"enable_local_logins":true,"allow_new_registrations":true,"enable_google_logins":true,"enable_google_oauth2_logins":false,"enable_yahoo_logins":true,"enable_twitter_logins":true,"enable_facebook_logins":true,"enable_github_logins":true,"enable_sso":false,"min_username_length":3,"max_username_length":20,"min_password_length":8,"enable_names":true,"invites_shown":30,"delete_user_max_post_age":60,"delete_all_posts_max":15,"min_post_length":20,"min_private_message_post_length":10,"max_post_length":32000,"min_topic_title_length":15,"max_topic_title_length":255,"min_private_message_title_length":2,"allow_uncategorized_topics":true,"min_title_similar_length":10,"min_body_similar_length":15,"edit_history_visible_to_public":true,"delete_removed_posts_after":24,"traditional_markdown_linebreaks":false,"suppress_reply_directly_below":true,"suppress_reply_directly_above":true,"newuser_max_images":0,"newuser_max_attachments":0,"display_name_on_posts":true,"short_progress_text_threshold":10000,"default_code_lang":"lang-auto","autohighlight_all_code":false,"email_in":false,"max_image_size_kb":3072,"max_attachment_size_kb":1024,"authorized_extensions":".jpg|.jpeg|.png|.gif|.svg|.txt|.ico|.yml","max_image_width":690,"max_image_height":500,"allow_profile_backgrounds":true,"allow_uploaded_avatars":true,"allow_animated_avatars":false,"tl1_requires_read_posts":30,"enable_long_polling":true,"polling_interval":3000,"anon_polling_interval":30000,"flush_timings_secs":5,"tos_url":"","privacy_policy_url":"","tos_accept_required":false,"faq_url":"","allow_restore":false,"maximum_backups":7,"version_checks":true,"suppress_uncategorized_badge":true,"min_search_term_length":3,"topic_views_heat_low":1000,"topic_views_heat_medium":2000,"topic_views_heat_high":5000,"global_notice":"","show_create_topics_notice":true,"available_locales":"cs|da|de|en|es|fr|he|id|it|ja|ko|nb_NO|nl|pl_PL|pt|pt_BR|ru|sv|uk|zh_CN|zh_TW","highlighted_languages":"apache|bash|cs|cpp|css|coffeescript|diff|xml|http|ini|json|java|javascript|makefile|markdown|nginx|objectivec|ruby|perl|php|python|sql|handlebars","enable_emoji":true}; +Discourse.SiteSettingsOriginal = { + "title":"Discourse Meta", + "logo_url":"/assets/logo.png", + "logo_small_url":"/assets/logo-single.png", + "mobile_logo_url":"", + "favicon_url":"//meta.discourse.org/uploads/default/2499/79d53726406d87af.ico", + "allow_user_locale":false, + "suggested_topics":7, + "track_external_right_clicks":false, + "ga_universal_tracking_code":"", + "ga_universal_domain_name":"auto", + "ga_tracking_code":"UA-33736483-2", + "ga_domain_name":"", + "top_menu":"latest|new|unread|categories|top", + "post_menu":"like-count|like|share|flag|edit|bookmark|delete|admin|reply", + "post_menu_hidden_items":"edit|delete|admin", + "share_links":"twitter|facebook|google+|email", + "category_colors":"BF1E2E|F1592A|F7941D|9EB83B|3AB54A|12A89D|25AAE2|0E76BD|652D90|92278F|ED207B|8C6238|231F20|808281|B3B5B4|283890", + "enable_mobile_theme":true, + "relative_date_duration":14, + "category_featured_topics":4, + "fixed_category_positions":false, + "show_subcategory_list":false, + "enable_badges":true, + "invite_only":false, + "login_required":false, + "must_approve_users":false, + "enable_local_logins":true, + "allow_new_registrations":true, + "enable_google_logins":true, + "enable_google_oauth2_logins":false, + "enable_yahoo_logins":true, + "enable_twitter_logins":true, + "enable_facebook_logins":true, + "enable_github_logins":true, + "enable_sso":false, + "min_username_length":3, + "max_username_length":20, + "min_password_length":8, + "enable_names":true, + "invites_shown":30, + "delete_user_max_post_age":60, + "delete_all_posts_max":15, + "min_post_length":20, + "min_private_message_post_length":10, + "max_post_length":32000, + "min_topic_title_length":15, + "max_topic_title_length":255, + "min_private_message_title_length":2, + "allow_uncategorized_topics":true, + "min_title_similar_length":10, + "min_body_similar_length":15, + "edit_history_visible_to_public":true, + "delete_removed_posts_after":24, + "traditional_markdown_linebreaks":false, + "suppress_reply_directly_below":true, + "suppress_reply_directly_above":true, + "newuser_max_images":0, + "newuser_max_attachments":0, + "display_name_on_posts":true, + "short_progress_text_threshold":10000, + "default_code_lang":"lang-auto", + "autohighlight_all_code":false, + "email_in":false, + "max_image_size_kb":3072, + "max_attachment_size_kb":1024, + "authorized_extensions":".jpg|.jpeg|.png|.gif|.svg|.txt|.ico|.yml", + "max_image_width":690, + "max_image_height":500, + "allow_profile_backgrounds":true, + "allow_uploaded_avatars":true, + "allow_animated_avatars":false, + "tl1_requires_read_posts":30, + "enable_long_polling":true, + "polling_interval":3000, + "anon_polling_interval":30000, + "flush_timings_secs":5, + "tos_url":"", + "privacy_policy_url":"", + "tos_accept_required":false, + "faq_url":"", + "allow_restore":false, + "maximum_backups":7, + "version_checks":true, + "suppress_uncategorized_badge":true, + "min_search_term_length":3, + "topic_views_heat_low":1000, + "topic_views_heat_medium":2000, + "topic_views_heat_high":5000, + "global_notice":"", + "show_create_topics_notice":true, + "available_locales":"cs|da|de|en|es|fr|he|id|it|ja|ko|nb_NO|nl|pl_PL|pt|pt_BR|ru|sv|uk|zh_CN|zh_TW", + "highlighted_languages":"apache|bash|cs|cpp|css|coffeescript|diff|xml|http|ini|json|java|javascript|makefile|markdown|nginx|objectivec|ruby|perl|php|python|sql|handlebars", + "enable_emoji":true +}; Discourse.SiteSettings = jQuery.extend(true, {}, Discourse.SiteSettingsOriginal);