1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-04 20:52:43 +01:00
phorge-phorge/webroot/rsrc/js/application/phame/phame-post-blogs.js
Bob Trahan ae13d33859 Phame - introduce blogs
Summary:
blogs are collections of posts. a blog also has metadata like a name, description and "bloggers" that can edit the metadata of the blog and contribute posts.

changes include the post edit flow where bloggers can now select which blogs to publish to. also made various small tweaks throughout the UI to make things sensical and clean as the concept of blogs is introduced.

there's edges powering this stuff.  bloggers <=> blogs and posts <=> blogs in particular.

Test Plan:
made blogs, deleted blogs, tried to make blogs with no bloggers. all went well.
verified ui to publish only showed up for public posts, published posts to blogs, un-published posts to blogs, re-published posts to blogs, deleted posts and verified they disappeared from blogs.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1373

Differential Revision: https://secure.phabricator.com/D3003
2012-07-19 09:03:10 -07:00

23 lines
571 B
JavaScript

/**
* @provides javelin-behavior-phame-post-blogs
* @requires javelin-behavior
* javelin-dom
*/
JX.behavior('phame-post-blogs', function(config) {
var visibility_select = JX.$(config.visibility.select_id);
var blogs_widget = JX.$(config.blogs.checkbox_id);
var visibilityCallback = function(e) {
if (visibility_select.value == config.visibility.published) {
JX.DOM.show(blogs_widget);
} else {
JX.DOM.hide(blogs_widget);
}
e.kill();
}
JX.DOM.listen(visibility_select, 'change', null, visibilityCallback);
});