4 | {{ initial_text }} 5 |
6 |├── agora
├── __init__.py
├── templatetags
│ ├── __init__.py
│ └── cmarkdown.py
├── tests.py
├── static
│ └── agora
│ │ ├── img
│ │ ├── stars.png
│ │ ├── emptystars.png
│ │ ├── fullreps.png
│ │ ├── physvote.png
│ │ ├── topictree.png
│ │ ├── voteflow-icon3.ico
│ │ ├── voteflow-logo3.jpg
│ │ ├── voteflow-logo3.png
│ │ ├── default_profile_pic.png
│ │ └── ratings
│ │ │ ├── ratings.css
│ │ │ ├── 2.svg
│ │ │ ├── 7.svg
│ │ │ ├── 6.svg
│ │ │ ├── 4.svg
│ │ │ ├── 5.svg
│ │ │ ├── 3.svg
│ │ │ ├── 1.svg
│ │ │ ├── orig-2.svg
│ │ │ ├── orig-7.svg
│ │ │ ├── orig-6.svg
│ │ │ ├── orig-1.svg
│ │ │ ├── orig-4.svg
│ │ │ ├── orig-5.svg
│ │ │ └── orig-3.svg
│ │ ├── fontawesome
│ │ └── fonts
│ │ │ ├── FontAwesome.otf
│ │ │ ├── fontawesome-webfont.eot
│ │ │ ├── fontawesome-webfont.svgz
│ │ │ ├── fontawesome-webfont.ttf
│ │ │ └── fontawesome-webfont.woff
│ │ ├── js
│ │ ├── voteflow.js
│ │ ├── crsf.js
│ │ ├── wweditor.js
│ │ ├── inlinesvg.min.js
│ │ ├── rangy-selectionsaverestore.js
│ │ ├── dselect.js
│ │ ├── to-markdown.js
│ │ ├── sankey.js
│ │ └── showdown.js
│ │ ├── css
│ │ └── hallo.css
│ │ └── style.css
├── templates
│ └── agora
│ │ ├── inc_user_micro.html
│ │ ├── grouppath
│ │ ├── pathto_ul.html
│ │ ├── fullpath_ul.html
│ │ ├── pathto.html
│ │ └── fullpath.html
│ │ ├── topicpath
│ │ ├── pathto_ul.html
│ │ ├── fullpath_ul.html
│ │ ├── pathto.html
│ │ ├── autopath.html
│ │ └── fullpath.html
│ │ ├── inc_vote_mini.html
│ │ ├── api_post_list.html
│ │ ├── posts
│ │ ├── filtering.html
│ │ ├── autopath.html
│ │ ├── inc_dselect.html
│ │ ├── inc_filter.html
│ │ └── scatterplus.html
│ │ ├── api_tag_list_parents.html
│ │ ├── api_user_list.html
│ │ ├── api_post_list_recur.html
│ │ ├── api_post_list_parents.html
│ │ ├── inc_topic_mini_recur.html
│ │ ├── inc_post_mini_recur.html
│ │ ├── inc_post_mini_pparent.html
│ │ ├── inc_vote_notification.html
│ │ ├── api_user_rep_picker.html
│ │ ├── groups
│ │ ├── inc_micro.html
│ │ ├── api_pending_members_list.html
│ │ ├── pending_members_list.html
│ │ ├── rules_list.html
│ │ └── members_list.html
│ │ ├── inc_stars.html
│ │ ├── index.html
│ │ ├── search.html
│ │ ├── inc_topic_micro.html
│ │ ├── newuser.html
│ │ ├── inc_user_li.html
│ │ ├── inc_group_mini.html
│ │ ├── inc_user.html
│ │ ├── all_groups.html
│ │ ├── newtopic.html
│ │ ├── inc_topic_mini.html
│ │ ├── users.html
│ │ ├── alltags.html
│ │ ├── basic_form.html
│ │ ├── new_rep_confirm.html
│ │ ├── util
│ │ ├── hallohead.html
│ │ └── halloitem.html
│ │ ├── ratings
│ │ └── mixed7.html
│ │ ├── advlogin.html
│ │ ├── notifications.html
│ │ ├── inc_post_mini.html
│ │ ├── all_topics.html
│ │ ├── fancy_group.html
│ │ ├── base_template.html
│ │ ├── login.html
│ │ ├── topics.html
│ │ ├── navbar.html
│ │ ├── tags.html
│ │ ├── group.html
│ │ ├── user.html
│ │ ├── root.html
│ │ ├── new_rep.html
│ │ ├── sunburst.html
│ │ ├── forcearrows.html
│ │ ├── fancy_post.html
│ │ ├── sankey.html
│ │ ├── inc_search.html
│ │ └── inc_post_list.html
├── admin.py
├── pipeline.py
├── compare_user.py
├── forms.py
└── urls.py
├── MeshDemoc
├── __init__.py
├── wsgi.py
├── urls.py
└── settings.py
├── manage.py
├── localsettings.json.example
├── .gitignore
└── README.md
/agora/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/MeshDemoc/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/agora/templatetags/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/agora/tests.py:
--------------------------------------------------------------------------------
1 | from django.test import TestCase
2 |
3 | # Create your tests here.
4 |
--------------------------------------------------------------------------------
/agora/static/agora/img/stars.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/VoteFlow/master/agora/static/agora/img/stars.png
--------------------------------------------------------------------------------
/agora/static/agora/img/emptystars.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/VoteFlow/master/agora/static/agora/img/emptystars.png
--------------------------------------------------------------------------------
/agora/static/agora/img/fullreps.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/VoteFlow/master/agora/static/agora/img/fullreps.png
--------------------------------------------------------------------------------
/agora/static/agora/img/physvote.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/VoteFlow/master/agora/static/agora/img/physvote.png
--------------------------------------------------------------------------------
/agora/static/agora/img/topictree.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/VoteFlow/master/agora/static/agora/img/topictree.png
--------------------------------------------------------------------------------
/agora/static/agora/img/voteflow-icon3.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/VoteFlow/master/agora/static/agora/img/voteflow-icon3.ico
--------------------------------------------------------------------------------
/agora/static/agora/img/voteflow-logo3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/VoteFlow/master/agora/static/agora/img/voteflow-logo3.jpg
--------------------------------------------------------------------------------
/agora/static/agora/img/voteflow-logo3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/VoteFlow/master/agora/static/agora/img/voteflow-logo3.png
--------------------------------------------------------------------------------
/agora/static/agora/img/default_profile_pic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/VoteFlow/master/agora/static/agora/img/default_profile_pic.png
--------------------------------------------------------------------------------
/agora/static/agora/fontawesome/fonts/FontAwesome.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/VoteFlow/master/agora/static/agora/fontawesome/fonts/FontAwesome.otf
--------------------------------------------------------------------------------
/agora/templates/agora/inc_user_micro.html:
--------------------------------------------------------------------------------
1 | {{ user.username }}
2 |
--------------------------------------------------------------------------------
/agora/static/agora/fontawesome/fonts/fontawesome-webfont.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/VoteFlow/master/agora/static/agora/fontawesome/fonts/fontawesome-webfont.eot
--------------------------------------------------------------------------------
/agora/static/agora/fontawesome/fonts/fontawesome-webfont.svgz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/VoteFlow/master/agora/static/agora/fontawesome/fonts/fontawesome-webfont.svgz
--------------------------------------------------------------------------------
/agora/static/agora/fontawesome/fonts/fontawesome-webfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/VoteFlow/master/agora/static/agora/fontawesome/fonts/fontawesome-webfont.ttf
--------------------------------------------------------------------------------
/agora/static/agora/fontawesome/fonts/fontawesome-webfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chozabu/VoteFlow/master/agora/static/agora/fontawesome/fonts/fontawesome-webfont.woff
--------------------------------------------------------------------------------
/agora/templates/agora/grouppath/pathto_ul.html:
--------------------------------------------------------------------------------
1 |
Oops, invalid username or password
9 | {% endif %} 10 | 15 | {% endblock %} -------------------------------------------------------------------------------- /agora/templates/agora/inc_user_li.html: -------------------------------------------------------------------------------- 1 | {% if user.is_authenticated %} 2 |No groups found...
20 | {% endif %} 21 | 22 | New Group 23 | 24 | {% endblock %} 25 | -------------------------------------------------------------------------------- /agora/static/agora/img/ratings/2.svg: -------------------------------------------------------------------------------- 1 | 2 | 8 | -------------------------------------------------------------------------------- /agora/templates/agora/newtopic.html: -------------------------------------------------------------------------------- 1 | {% extends 'agora/base_template.html' %} 2 | {% block title %} 3 | Create Topic 4 | {% endblock %} 5 | 6 | {% block body_block %} 7 | {% include "agora/topicpath/fullpath_ul.html" %} 8 | {% if form.errors %} 9 |FORM ERROR!!
10 | {% endif %} 11 | 19 | {% endblock %} -------------------------------------------------------------------------------- /agora/templates/agora/inc_topic_mini.html: -------------------------------------------------------------------------------- 1 |11 |
Representation Map
13 | Show Sunburst Map
15 | {% if recur %} 16 | Hide sub-topics 17 | {% else %} 18 | Show Full Tree 19 | {% endif %} 20 |
21 | 22 |sort method: {{ sort_method }} ( 23 | created_at 24 | subscription_set 25 | post_set 26 | )
27 | 28 | {% if topic_list %} 29 |No sub-topics found...
42 | {% endif %} 43 | 44 | 45 | 47 | 48 | 49 | 50 | {% endblock %} 51 | -------------------------------------------------------------------------------- /agora/templates/agora/groups/rules_list.html: -------------------------------------------------------------------------------- 1 | {% extends 'agora/base_template.html' %} 2 | 3 | {% block title %} 4 | {{ group.name }} Members 5 | {% endblock %} 6 | 7 | 8 | {% block body_block %} 9 | 10 | {% include "agora/grouppath/pathto_ul.html" %} 11 |In Voteflow groups have "rules" or "permissions" that say who may create/delete posts, topics,
17 | or perform other actions inside that group
18 | Each member of a group also has a "level" for their group.
19 |
21 | Your level must be at least as high as the rule to perform an action.
22 | In this group, your level must be at least equal to "edit_rules" to make any changes on this page.
23 |
4 | {{ initial_text }} 5 |
6 |Oops, invalid username or password
42 | {% endif %} 43 | 49 |Subscribed! (unsub)
18 | {% else %} 19 | 20 | {% endif %} 21 | 22 | {% if rep %} 23 | Representitive: {{ rep.rep }} 24 |No sub-topics found...
44 | {% endif %} 45 | 46 | 47 | 49 | 50 | 51 |No sub-groups found...
55 | {% endif %} 56 | 57 | 59 | 60 | 61 |{{ similarity }}% similar votes to you over {{ compared_vote_count }} vote(s)
16 | {% endif %} 17 | {% if own_profile %} 18 | {% if fb_ss %} 19 |Connected with FaceBook!
20 | {% else %} 21 | 22 | {% endif %} 23 | 24 | {% if goog_ss %} 25 |Connected with Google!
26 | {% else %} 27 | Connect with Google 28 | {% endif %} 29 | {% endif %} 30 | 31 |
16 |
17 | Rather than one person Represent you for everything, you can pick representatives for topics.
26 |
You should pick someone you know and trust as a representative for you on a topic.
27 |
Representatives can pick people to represent them in the same or subtopics
28 |
Meaning you get Chains, or trees of representation.
29 |
Particularly as you get deeper into sub-topics, a person may be able to represent a massive number of people.
30 |
You are always able see what your representatives do, override their decisions - or pick someone else.
31 |
This is a Discussion & voting system inspired by Liquid Democracy
33 |
56 | UserInfo
57 | {% include "agora/inc_user.html" %}
58 |
This chart based on mbostock’s block 101 | #5480307
102 | 103 | {% endblock %} -------------------------------------------------------------------------------- /agora/templates/agora/forcearrows.html: -------------------------------------------------------------------------------- 1 | {% extends 'agora/base_template.html' %} 2 | {% block title %} 3 | Representation 4 | {% endblock %} 5 | {% block head_block %} 6 | 41 | {% endblock %} 42 | 43 | {% block body_block %} 44 | {% load staticfiles %} 45 | 49 | 50 | 137 |This chart based on mbostock’s block 138 | #1153292
139 | 140 | {% endblock %} -------------------------------------------------------------------------------- /agora/templates/agora/fancy_post.html: -------------------------------------------------------------------------------- 1 | {% extends 'agora/base_template.html' %} 2 | {% block title %} 3 | New Post 4 | {% endblock %} 5 | 6 | {% block head_block %} 7 | {% load staticfiles %} 8 | 9 | {% include 'agora/util/hallohead.html' %} 10 | 11 | 12 | {% endblock %} 13 | 14 | {% block body_block %} 15 |This chart shows who is being represented in the votes on this post 51 |
This chart based on mbostock’s Sankey Diagrams
151 |
152 | {% endblock %}
--------------------------------------------------------------------------------
/agora/static/agora/js/dselect.js:
--------------------------------------------------------------------------------
1 | var dselect_rdict = {
2 | "liquid_value":"Rating (Vote Average)",
3 | "liquid_sum":"Sum (Vote Count)",
4 | "created_at":"Date",
5 | "direct_value":"Direct Rating",
6 | "direct_sum":"Direct Sum",
7 | "tag":"Tag ..."
8 | }
9 | function getdselectitem(achild){
10 | var mainbox = $(this).parentsUntil(".ruleitem");
11 | if (mainbox.length == 0){
12 | //console.log(achild.parent());
13 | return achild.parent();
14 | }
15 | //console.log(mainbox.parent());
16 | return mainbox.parent();
17 |
18 | }
19 | function getrealdselectitem(achild){
20 | var mainbox = $(this).parentsUntil(".dselectitem");
21 | if (mainbox.length == 0){
22 | //console.log(achild.parent());
23 | return achild.parent();
24 | }
25 | //console.log(mainbox.parent());
26 | return mainbox.parent();
27 |
28 | }
29 |
30 | function postdselectbox_changed(event){
31 | //console.log("---")
32 | //console.log($(this));
33 | var mainbox = getdselectitem($(this))
34 | var newval = $(this)[0].value;
35 | //console.log(newval);
36 | var tagbox = mainbox.find('#tagselectcontainer');
37 | //console.log(floatbox);
38 | if( $.inArray( newval, [ "tag" ] ) != -1){
39 | tagbox.show();
40 | } else {
41 | tagbox.hide();
42 | }
43 | }
44 |
45 | function get_dselects(fcontainername){
46 | var fbox = $(fcontainername).children();
47 | return get_dselect(fbox);
48 | }
49 | function set_dselects(fcontainername, query){
50 | var fbox = $(fcontainername).children();
51 | return set_dselect(fbox, query);
52 | }
53 | function print_dselect(event){
54 | console.log("printing dselect")
55 | var mainbox = $(this).parent().parent()
56 | console.log(mainbox);
57 | dselect = get_dselect(mainbox);
58 | console.log(dselect);
59 | mainbox.find('#outbox')[0].textContent=JSON.stringify(dselect);
60 | }
61 |
62 |
63 | function get_dselect(mainbox){
64 | //console.log("mainbox");
65 | //console.log(mainbox);
66 | //console.log(mainbox.find('#postdselectbox'));
67 |
68 | var first = mainbox.find('#postdselectbox')[0].value;
69 | if( $.inArray( first, [ "tag" ] ) != -1){
70 | var second = mainbox.find('#tagnamebox')[0].value;
71 | var third = mainbox.find('#tagdselectbox')[0].value;
72 | return first+"__"+second+"__"+third;
73 | }
74 | return first;
75 | }
76 | function set_dselect(mainbox, query){
77 | var items = query.split("__");
78 | //console.log("##########DEBUG LVAL#######");
79 | //console.log("mainbox");
80 | //console.log(mainbox);
81 | //console.log(mainbox.find('#postdselectbox'));
82 |
83 | console.log("ITEMS:", items, items.length)
84 | var first = items[0];
85 | var second = "";
86 | var third = "";
87 | if (items.length>1)
88 | second = items[1];
89 | if (items.length>2)
90 | third = items[2];
91 | //console.log("ITEMS:", first, second, third)
92 |
93 | mainbox.find('#postdselectbox')[0].value = first;
94 | mainbox.find('#postdselectbox').trigger('change');
95 | console.log("first!!!!!:")
96 | console.log(first)
97 | if( $.inArray( first, [ "tag" ] ) != -1){
98 | console.log("tagnamebox:")
99 | console.log(mainbox.find('#tagnamebox')[0])
100 | mainbox.find('#tagnamebox')[0].value = second;
101 | mainbox.find('#tagdselectbox')[0].value = third;
102 | //mainbox.find('#tagdselectbox')[0].value = second;
103 | //mainbox.find('#tagdselectbox').trigger('change');
104 | }
105 | }
106 |
107 | //$('#postdselectbox').change(postdselectbox_changed);
108 |
109 |
110 |
111 | function new_dselect_action(foe){
112 | //console.log("new dselect");
113 | //console.log($('#dselectproto'));
114 | var newdselect = $('#dselectproto').clone(true);
115 | newdselect.find('#postdselectbox').change();
116 | newdselect[0].id="adselect";
117 | newdselect.show();
118 | $(foe).append(newdselect);
119 | $('#newrulebutton').click(new_rule);
120 | return newdselect;
121 | }
122 |
123 | function new_dselect_from_json(jin, foe){
124 | if (foe==undefined)foe = '#currentdselectsbox';
125 | newdselect = new_dselect_action(foe);
126 | //get the key and value object
127 |
128 | var query = "";
129 | var val = "";
130 | a=newdselect.find('#postdselectpair')
131 | var first = true;
132 | for (k in jin){
133 | query=k;
134 | val=jin[k];
135 | if (first==false) a=new_rule_on(newdselect);
136 | set_dselect(a, query, val);
137 | first = false;
138 | }
139 | //split key by __s?
140 | //same structure as getdselect, but setting values
141 |
142 | var rootbox = $(foe);
143 | var psf = rootbox.find('#presetdselects');
144 | console.log("SETTING dselect",JSON.stringify(jin))
145 | psf[0].value=JSON.stringify(jin);
146 |
147 | }
148 | function set_dselect_from_json(jin, dselectbox){
149 | var query = "";
150 | var val = "";
151 | dselectbox.find('#postdselectpair').remove()
152 | var first = true;
153 | for (k in jin){
154 | query=k;
155 | val=jin[k];
156 | a=new_rule_on(dselectbox);
157 | set_dselect(a, query, val);
158 | first = false;
159 | }
160 | //split key by __s?
161 | //same structure as getdselect, but setting values
162 | }
163 |
--------------------------------------------------------------------------------
/agora/templates/agora/posts/inc_filter.html:
--------------------------------------------------------------------------------
1 |
5 | This is a sytem to let you graph posts in voteflow - much like on
23 | the physical "wall of ideas"
24 | ");
317 | str+="
18 | ]*>`([\s\S]*)`<\/pre>/gi, function(str, innerHTML) {
109 | innerHTML = innerHTML.replace(/^\t+/g, ' '); // convert tabs to spaces (you know it makes sense)
110 | innerHTML = innerHTML.replace(/\n/g, '\n ');
111 | return '\n\n ' + innerHTML + '\n';
112 | });
113 |
114 | // Lists
115 |
116 | // Escape numbers that could trigger an ol
117 | string = string.replace(/(\d+). /g, '$1\\. ');
118 |
119 | // Converts lists that have no child lists (of same type) first, then works it's way up
120 | var noChildrenRegex = /<(ul|ol)\b[^>]*>(?:(?!/gi;
121 | while(string.match(noChildrenRegex)) {
122 | string = string.replace(noChildrenRegex, function(str) {
123 | return replaceLists(str);
124 | });
125 | }
126 |
127 | function replaceLists(html) {
128 |
129 | html = html.replace(/<(ul|ol)\b[^>]*>([\s\S]*?)<\/\1>/gi, function(str, listType, innerHTML) {
130 | var lis = innerHTML.split('');
131 | lis.splice(lis.length - 1, 1);
132 |
133 | for(i = 0, len = lis.length; i < len; i++) {
134 | if(lis[i]) {
135 | var prefix = (listType === 'ol') ? (i + 1) + ". " : "* ";
136 | lis[i] = lis[i].replace(/\s*
]*>((?:(?!
/gi;
153 | while(string.match(deepest)) {
154 | string = string.replace(deepest, function(str) {
155 | return replaceBlockquotes(str);
156 | });
157 | }
158 |
159 | function replaceBlockquotes(html) {
160 | html = html.replace(/
]*>([\s\S]*?)<\/blockquote>/gi, function(str, inner) {
161 | inner = inner.replace(/^\s+|\s+$/g, '');
162 | inner = cleanUp(inner);
163 | inner = inner.replace(/^/gm, '> ');
164 | inner = inner.replace(/^(>([ \t]{2,}>)+)/gm, '> >');
165 | return inner;
166 | });
167 | return html;
168 | }
169 |
170 | function cleanUp(string) {
171 | string = string.replace(/^[\t\r\n]+|[\t\r\n]+$/g, ''); // trim leading/trailing whitespace
172 | string = string.replace(/\n\s+\n/g, '\n\n');
173 | string = string.replace(/\n{3,}/g, '\n\n'); // limit consecutive linebreaks to 2
174 | return string;
175 | }
176 |
177 | return cleanUp(string);
178 | };
179 |
180 | if (typeof exports === 'object') {
181 | exports.toMarkdown = toMarkdown;
182 | }
183 |
--------------------------------------------------------------------------------
/agora/templates/agora/inc_search.html:
--------------------------------------------------------------------------------
1 |
11 |
12 | {% include 'agora/posts/inc_filter.html' with filterdivid="searchfilter" %}
13 |
14 |
15 | Sorting
23 |
27 |
30 |
26 | {% if items %}
27 | {% for child_post in items %}
28 | {% if recur_posts %}
29 |
36 |
39 |
42 |
47 |
48 |
83 |
--------------------------------------------------------------------------------
/agora/templates/agora/posts/scatterplus.html:
--------------------------------------------------------------------------------
1 | {% extends 'agora/base_template.html' %}
2 |
3 | {% block title %}
4 | Wall of Ideas
5 | {% endblock %}
6 |
7 |
8 | {% block head_block %}
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | {% endblock %}
17 |
18 | {% block body_block %}
19 |
20 | Wall Of Ideas
21 |
22 |
25 | Though, rather than being limited to 2 fixed axies, you can customise!
26 | Have a look at a graph of
28 | Posts popularity and how challenging they are
29 |
30 | Or
32 | The difference representation makes
33 |
34 | Perhaps
36 | Time Posted, and rating
37 |
38 |
41 | Y-Axis: {% include 'agora/posts/inc_dselect.html' with dselectdivid="yaxis" %}
42 |
43 | {% include 'agora/posts/inc_filter.html' with filterdivid="woithing" %}
44 |
45 |
46 |
47 |
48 |
49 |
51 |
52 |
194 | {% endblock %}
195 |
196 |
--------------------------------------------------------------------------------
/agora/static/agora/js/sankey.js:
--------------------------------------------------------------------------------
1 | d3.sankey = function() {
2 | var sankey = {},
3 | nodeWidth = 24,
4 | nodePadding = 8,
5 | size = [1, 1],
6 | nodes = [],
7 | links = [];
8 |
9 | sankey.nodeWidth = function(_) {
10 | if (!arguments.length) return nodeWidth;
11 | nodeWidth = +_;
12 | return sankey;
13 | };
14 |
15 | sankey.nodePadding = function(_) {
16 | if (!arguments.length) return nodePadding;
17 | nodePadding = +_;
18 | return sankey;
19 | };
20 |
21 | sankey.nodes = function(_) {
22 | if (!arguments.length) return nodes;
23 | nodes = _;
24 | return sankey;
25 | };
26 |
27 | sankey.links = function(_) {
28 | if (!arguments.length) return links;
29 | links = _;
30 | return sankey;
31 | };
32 |
33 | sankey.size = function(_) {
34 | if (!arguments.length) return size;
35 | size = _;
36 | return sankey;
37 | };
38 |
39 | sankey.layout = function(iterations) {
40 | computeNodeLinks();
41 | computeNodeValues();
42 | computeNodeBreadths();
43 | computeNodeDepths(iterations);
44 | computeLinkDepths();
45 | return sankey;
46 | };
47 |
48 | sankey.relayout = function() {
49 | computeLinkDepths();
50 | return sankey;
51 | };
52 |
53 | sankey.link = function() {
54 | var curvature = .5;
55 |
56 | function link(d) {
57 | var x0 = d.source.x + d.source.dx,
58 | x1 = d.target.x,
59 | xi = d3.interpolateNumber(x0, x1),
60 | x2 = xi(curvature),
61 | x3 = xi(1 - curvature),
62 | y0 = d.source.y + d.sy + d.dy / 2,
63 | y1 = d.target.y + d.ty + d.dy / 2;
64 | return "M" + x0 + "," + y0
65 | + "C" + x2 + "," + y0
66 | + " " + x3 + "," + y1
67 | + " " + x1 + "," + y1;
68 | }
69 |
70 | link.curvature = function(_) {
71 | if (!arguments.length) return curvature;
72 | curvature = +_;
73 | return link;
74 | };
75 |
76 | return link;
77 | };
78 |
79 | // Populate the sourceLinks and targetLinks for each node.
80 | // Also, if the source and target are not objects, assume they are indices.
81 | function computeNodeLinks() {
82 | nodes.forEach(function(node) {
83 | node.sourceLinks = [];
84 | node.targetLinks = [];
85 | });
86 | links.forEach(function(link) {
87 | var source = link.source,
88 | target = link.target;
89 | if (typeof source === "number") source = link.source = nodes[link.source];
90 | if (typeof target === "number") target = link.target = nodes[link.target];
91 | source.sourceLinks.push(link);
92 | target.targetLinks.push(link);
93 | });
94 | }
95 |
96 | // Compute the value (size) of each node by summing the associated links.
97 | function computeNodeValues() {
98 | nodes.forEach(function(node) {
99 | node.value = Math.max(
100 | d3.sum(node.sourceLinks, value),
101 | d3.sum(node.targetLinks, value)
102 | );
103 | });
104 | }
105 |
106 | // Iteratively assign the breadth (x-position) for each node.
107 | // Nodes are assigned the maximum breadth of incoming neighbors plus one;
108 | // nodes with no incoming links are assigned breadth zero, while
109 | // nodes with no outgoing links are assigned the maximum breadth.
110 | function computeNodeBreadths() {
111 | var remainingNodes = nodes,
112 | nextNodes,
113 | x = 0;
114 |
115 | while (remainingNodes.length) {
116 | nextNodes = [];
117 | remainingNodes.forEach(function(node) {
118 | node.x = x;
119 | node.dx = nodeWidth;
120 | node.sourceLinks.forEach(function(link) {
121 | nextNodes.push(link.target);
122 | });
123 | });
124 | remainingNodes = nextNodes;
125 | ++x;
126 | }
127 |
128 | //
129 | moveSinksRight(x);
130 | scaleNodeBreadths((width - nodeWidth) / (x - 1));
131 | }
132 |
133 | function moveSourcesRight() {
134 | nodes.forEach(function(node) {
135 | if (!node.targetLinks.length) {
136 | node.x = d3.min(node.sourceLinks, function(d) { return d.target.x; }) - 1;
137 | }
138 | });
139 | }
140 |
141 | function moveSinksRight(x) {
142 | nodes.forEach(function(node) {
143 | if (!node.sourceLinks.length) {
144 | node.x = x - 1;
145 | }
146 | });
147 | }
148 |
149 | function scaleNodeBreadths(kx) {
150 | nodes.forEach(function(node) {
151 | node.x *= kx;
152 | });
153 | }
154 |
155 | function computeNodeDepths(iterations) {
156 | var nodesByBreadth = d3.nest()
157 | .key(function(d) { return d.x; })
158 | .sortKeys(d3.ascending)
159 | .entries(nodes)
160 | .map(function(d) { return d.values; });
161 |
162 | //
163 | initializeNodeDepth();
164 | resolveCollisions();
165 | for (var alpha = 1; iterations > 0; --iterations) {
166 | relaxRightToLeft(alpha *= .99);
167 | resolveCollisions();
168 | relaxLeftToRight(alpha);
169 | resolveCollisions();
170 | }
171 |
172 | function initializeNodeDepth() {
173 | var ky = d3.min(nodesByBreadth, function(nodes) {
174 | return (size[1] - (nodes.length - 1) * nodePadding) / d3.sum(nodes, value);
175 | });
176 |
177 | nodesByBreadth.forEach(function(nodes) {
178 | nodes.forEach(function(node, i) {
179 | node.y = i;
180 | node.dy = node.value * ky;
181 | });
182 | });
183 |
184 | links.forEach(function(link) {
185 | link.dy = link.value * ky;
186 | });
187 | }
188 |
189 | function relaxLeftToRight(alpha) {
190 | nodesByBreadth.forEach(function(nodes, breadth) {
191 | nodes.forEach(function(node) {
192 | if (node.targetLinks.length) {
193 | var y = d3.sum(node.targetLinks, weightedSource) / d3.sum(node.targetLinks, value);
194 | node.y += (y - center(node)) * alpha;
195 | }
196 | });
197 | });
198 |
199 | function weightedSource(link) {
200 | return center(link.source) * link.value;
201 | }
202 | }
203 |
204 | function relaxRightToLeft(alpha) {
205 | nodesByBreadth.slice().reverse().forEach(function(nodes) {
206 | nodes.forEach(function(node) {
207 | if (node.sourceLinks.length) {
208 | var y = d3.sum(node.sourceLinks, weightedTarget) / d3.sum(node.sourceLinks, value);
209 | node.y += (y - center(node)) * alpha;
210 | }
211 | });
212 | });
213 |
214 | function weightedTarget(link) {
215 | return center(link.target) * link.value;
216 | }
217 | }
218 |
219 | function resolveCollisions() {
220 | nodesByBreadth.forEach(function(nodes) {
221 | var node,
222 | dy,
223 | y0 = 0,
224 | n = nodes.length,
225 | i;
226 |
227 | // Push any overlapping nodes down.
228 | nodes.sort(ascendingDepth);
229 | for (i = 0; i < n; ++i) {
230 | node = nodes[i];
231 | dy = y0 - node.y;
232 | if (dy > 0) node.y += dy;
233 | y0 = node.y + node.dy + nodePadding;
234 | }
235 |
236 | // If the bottommost node goes outside the bounds, push it back up.
237 | dy = y0 - nodePadding - size[1];
238 | if (dy > 0) {
239 | y0 = node.y -= dy;
240 |
241 | // Push any overlapping nodes back up.
242 | for (i = n - 2; i >= 0; --i) {
243 | node = nodes[i];
244 | dy = node.y + node.dy + nodePadding - y0;
245 | if (dy > 0) node.y -= dy;
246 | y0 = node.y;
247 | }
248 | }
249 | });
250 | }
251 |
252 | function ascendingDepth(a, b) {
253 | return a.y - b.y;
254 | }
255 | }
256 |
257 | function computeLinkDepths() {
258 | nodes.forEach(function(node) {
259 | node.sourceLinks.sort(ascendingTargetDepth);
260 | node.targetLinks.sort(ascendingSourceDepth);
261 | });
262 | nodes.forEach(function(node) {
263 | var sy = 0, ty = 0;
264 | node.sourceLinks.forEach(function(link) {
265 | link.sy = sy;
266 | sy += link.dy;
267 | });
268 | node.targetLinks.forEach(function(link) {
269 | link.ty = ty;
270 | ty += link.dy;
271 | });
272 | });
273 |
274 | function ascendingSourceDepth(a, b) {
275 | return a.source.y - b.source.y;
276 | }
277 |
278 | function ascendingTargetDepth(a, b) {
279 | return a.target.y - b.target.y;
280 | }
281 | }
282 |
283 | function center(node) {
284 | return node.y + node.dy / 2;
285 | }
286 |
287 | function value(link) {
288 | return link.value;
289 | }
290 |
291 | return sankey;
292 | };
293 |
--------------------------------------------------------------------------------
/agora/static/agora/style.css:
--------------------------------------------------------------------------------
1 | body {
2 | background: url("http://chozabu.net/autopush/cloud_background.png") no-repeat center center fixed;
3 | background-size: cover;
4 | font-family: verdana;
5 | }
6 |
7 | h1 {
8 | font-family: 'Roboto' light;
9 | padding-top: 20px;
10 | text-align: center;
11 | font-size: 56px;
12 | }
13 |
14 | h2 {
15 | font-family: 'Roboto';
16 | padding-top: 0px;
17 | text-align: center;
18 | font-size: 36px;
19 | }
20 |
21 | h3 {
22 | font-family: 'Roboto';
23 | padding: 10px;
24 | text-align: center;
25 | font-size: 20px;
26 | color: rgba(042, 036, 004, 0.98);
27 | }
28 |
29 | p {
30 | margin: 10px 42px 10px;
31 | font-family: 'Roboto' light;
32 | }
33 |
34 | #mainContentPanel+ svg {
35 | 10px: inherit;display: block;margin: auto;}
36 | hr {
37 | margin: 20px;
38 | border: none;
39 | border-bottom: thin solid rgba(255, 255, 255, .1);
40 | }
41 | div.title {
42 | font-size: 2em;
43 | }
44 | h1 span {
45 | font-weight: 300;
46 | color: #Fd4;
47 | }
48 | .userimage{
49 | float:left;
50 | margin: 2px;
51 | }
52 | .postminicontent {
53 | display:inline-block;
54 | text-align: left;
55 | }
56 | .topicminititle, .groupminititle {
57 | font-size: 150%;
58 | background-color: rgba(222, 226, 234, 0.48);
59 | display: inline-block;
60 | width: 100%;
61 | margin: .1em;
62 | margin-left: -.45em;
63 | /* margin-right: -.8em; */
64 | padding: .3em;
65 | border-radius: .1em;
66 | }
67 |
68 | .align-mid {
69 | text-align: center;
70 | }
71 |
72 | .notificationbox{
73 | margin: 5px;
74 | }
75 |
76 | #topicslist > li > .topicminititle {
77 | background-color: rgba(226, 96, 0, 0.23);
78 | }
79 |
80 | span.topicsubsspan {
81 | /* height: 30px; */
82 | /* width: 60px; */
83 | /* line-height: 60px; */
84 | -moz-border-radius: 30px;/* or 50% */
85 | border-radius: 30px;/* or 50% */
86 | background-color: rgba(58, 187, 99, 0.78);
87 | color: white;
88 | text-align: center;
89 | font-size: 1.3em;
90 | padding-left: .3em;
91 | padding-right: .3em;
92 | }
93 |
94 | #miniul:first-child {
95 | background-color: rgba(0, 255, 255, 0.48);
96 | }
97 | .topicmicrotitle {
98 | font-size: 150%;
99 | /* background-color: rgba(178, 196, 212, 0.31); */
100 | display: inline-block;
101 | margin: .1em;
102 | padding: .2em;
103 | border-radius: .5em;
104 | text-align: center;
105 | }
106 | .topicmicroitem {
107 | background-color: rgba(213, 111, 236, 0.31);
108 | display: inline-block;
109 | margin: .1em;
110 | padding: .2em;
111 | border-radius: .5em;
112 | text-align: center;
113 | }
114 | .mincotopicholder {
115 | background-color: rgba(245, 242, 255, 0);
116 | margin: .1em;
117 | padding: .2em;
118 | /* border-radius: .7em; */
119 | text-align: center;
120 | /* display: inline-block; */
121 | }
122 | .postminititle {
123 | font-size: 150%;
124 | }
125 | .ilb {
126 | display: inline-block;
127 | vertical-align: text-top;
128 | border-radius: 4px;
129 | border-width: 1px;
130 | padding: 4px;
131 | margin-left: 2px;
132 | border: #bdb8b2 1px solid;
133 | text-align: center;
134 | margin-left: 0.4em;
135 | box-shadow: 0px 0px 50px rgba(29, 120, 144, 0.11);
136 | }
137 | .ilb h2 {
138 | background-color: transparent;
139 | box-shadow: none;
140 | padding: 2px;
141 | margin: 2px;
142 | }
143 | .ilb li {
144 | list-style-type: none;
145 | }
146 | .ilb li:nth-of-type(odd) {
147 | border: #bdb8b2 1px solid;
148 | margin-left: 0.4em;
149 | border-radius: 5px;
150 | background-color: #f3f3f3;
151 | }
152 | .ilb li:nth-of-type(even) {
153 | border: #f4eee7 1px solid;
154 | margin-left: 0.4em;
155 | border-radius: 5px;
156 | background-color: #e8e8e8;
157 | }
158 | #basic-post-info,
159 | #extra-post-info {
160 | padding-left: .5em;
161 | }
162 | #starscontainer {
163 | width: 100px;
164 | height: 20px;
165 | position: relative;
166 | display: inline-block;
167 | }
168 | #fullstars,
169 | #emptystars {
170 | width: 100px;
171 | height: 20px;
172 | position: absolute;
173 | top: 0;
174 | left: 0;
175 | }
176 | #emptystars {
177 | z-index: 10;
178 | background-image: url("/static/agora/img/emptystars.png");
179 | }
180 | #fullstars {
181 | background-image: url("/static/agora/img/stars.png");
182 | }
183 | ul {
184 | list-style-type: none;
185 | margin-top: 10px;
186 | }
187 |
188 | ul.miniul {
189 | margin-right: -.2%;
190 | /* margin-right: 10px; */
191 | }
192 | .miniul li,
193 | .postpreview {
194 | padding: 9px;
195 | padding-right: 0px;
196 | /* margin-left: 2px; */
197 | border-radius: 4px;
198 | /* border: #FFFFFF 1px solid; */
199 | /* margin-left: 0.4em; */
200 | box-shadow: 0px 0px 2px rgba(50, 50, 50, 0.22);
201 | /* margin-right: -.1px; */
202 | }
203 | .postpreview {
204 | text-align: center;
205 |
206 | }
207 | #mainContentPanel {
208 | padding: 5px;
209 | border-radius: 10px;
210 | border: 1px solid rgb(189, 184, 178);
211 | margin-left: auto;
212 | box-shadow: -4px 4px 5px rgba(50, 50, 50, 0.1);
213 | margin-right: auto;
214 | width: 80%;
215 | min-width: 600px;
216 | background-color: rgba(255, 255, 255, 0.82);
217 | }
218 | .floatonright {
219 | padding: 5px;
220 | margin-left: 2px;
221 | border-radius: 4px;
222 | border: #bdb8b2 1px solid;
223 | margin-left: 0.4em;
224 | box-shadow: -4px 4px 5px rgba(50, 50, 50, 0.2);
225 | float: right;
226 | max-width: 70%;
227 | }
228 | h1,
229 | h2 {
230 | background-color: rgba(225, 230, 239, 0.43);
231 | color: #3B646B;
232 | padding: 15px 16%;
233 | border-radius: 2px;
234 | text-align: center;
235 | /* margin-left: -.2em; */
236 | /* box-shadow: -4px 4px 5px rgba(50, 50, 50, 0.2); */
237 | }
238 |
239 | h2 {
240 | font-size: 26px;
241 | text-align: center;
242 | /* color: aqua; */
243 | }
244 |
245 | h2 a {
246 | color: #3B646B;
247 | }
248 | .tagspan {
249 | background-color: #e2fff6;
250 | color: #000000;
251 | padding: 5px 5px;
252 | text-decoration: none;
253 | border-radius: 5px;
254 | }
255 | ul#topic_path {
256 | margin-top: 7px;
257 | padding: 0;
258 | display: inline-block;
259 | }
260 | ul#topic_path li {
261 | display: inline;
262 | }
263 | /*
264 | ul#topic_path li:not(:last-child)::after {
265 | content: "⇒";
266 | }*/
267 | ul#topic_path li::after {
268 | content: "⇒";
269 | }
270 | ul#topic_path li a {
271 | background-color: #ECF3EB;
272 | color: #000000;
273 | margin-top: -10px;
274 | padding: 10px 20px;
275 | text-decoration: none;
276 | border-radius: 5px;
277 | }
278 | ul#topic_path li a:hover {
279 | background-color: #caffca;
280 | }
281 | ul#post_path {
282 | padding: .2em;
283 | display: inline-block;
284 | }
285 | ul#post_path li {
286 | display: inline;
287 | }
288 | ul#post_path li::after {
289 | content: "▶";
290 | }
291 | ul#post_path li a {
292 | background-color: #c9daff;
293 | color: #000000;
294 | padding: 5px 10px;
295 | margin: 1px 1px;
296 | text-decoration: none;
297 | border-radius: 5px;
298 | border-color: black;
299 | }
300 | ul#post_path li a:hover {
301 | background-color: #bfc7ff;
302 | }
303 | .mainContentPanel {
304 | margin-top: 2em padding: 1em;
305 | }
306 | a {
307 | color: #3E302E;
308 | text-shadow: 0 0 2px rgba(200, 200, 255, 128);
309 | font-family: 'Roboto';
310 | }
311 | a:hover {
312 | color: #3783ff;
313 | }
314 | .tinyUserThumb {
315 | margin: 2px;
316 | width: 32px;
317 | float: left;
318 | }
319 |
320 | #post_middle{
321 | }
322 |
323 | .votepics {
324 | width:intrinsic; /* For Safari, see https://developer.mozilla.org/en-US/docs/CSS/width */
325 | width:-moz-fit-content;
326 | width:-webkit-fit-content;
327 | width:fit-content;
328 | margin:0 auto;
329 | overflow:hidden; /* Contain the floated li elements */
330 | }
331 | .votepics svg {
332 | width: 50px;
333 | height: 50px;
334 | -webkit-transition: width .2s; /* Safari */
335 | transition: width .2s;
336 | }
337 | .votepics svg:hover {
338 | -webkit-filter: drop-shadow( -0px -0px 5px #77F );
339 | filter: drop-shadow( -0px -0px 5px #AAF ); /* Same syntax as box-shadow */
340 |
341 | }
342 | .svgwrapper {
343 | width: 50px;
344 | height: 50px;
345 | position: relative;
346 | z-index: 100;
347 | }
348 |
349 |
350 | #svgr1 * {
351 |
352 | stroke: red !important;
353 | }
354 | #svgr2 * {
355 |
356 | stroke: #DC154C !important;
357 | }
358 | #svgr3 * {
359 |
360 | stroke: #B81ACC !important;
361 | }
362 | #svgr4 * {
363 |
364 | stroke: #1319E0 !important;
365 | }
366 | #svgr5 * {
367 |
368 | stroke: #328FC5 !important;
369 | }
370 | #svgr6 * {
371 |
372 | stroke: green !important;
373 | }
374 | #svgr7 * {
375 |
376 | stroke: #00D600 !important;
377 | }
378 |
379 | .voteslider{
380 | width: 300px;
381 | position:relative;
382 | height:20px;
383 | /* border:1px solid #cccccc; */
384 | width:90% !important;
385 | margin: auto;
386 | }
387 |
388 | .post-main {
389 | text-align: center;
390 | }
391 | .authorinfo {
392 | display:inline-block;
393 | }
394 |
395 | .popover{
396 | max-width: 100%; /* Max Width of the popover (depending on the container!) */
397 | }
398 |
399 | .filterouterbox {
400 | background-color: rgba(133, 255, 133, 0.12);
401 | border: 2px solid rgba(177, 255, 177, 0.22);
402 | border-radius: 10px;
403 | padding: 2px;
404 | margin: 2px;
405 | }
406 | .excludeouterbox {
407 | background-color: rgba(255, 133, 133, 0.12);
408 | border: 2px solid rgba(255, 177, 177, 0.22);
409 | border-radius: 10px;
410 | padding: 2px;
411 | margin: 2px;
412 | }
--------------------------------------------------------------------------------
/agora/static/agora/js/showdown.js:
--------------------------------------------------------------------------------
1 | /*
2 | A A L Source code at:
3 | T C A
");
70 | _19=_19.replace(/^[ ]{0,2}([ ]?\*[ ]?){3,}[ \t]*$/gm,key);
71 | _19=_19.replace(/^[ ]{0,2}([ ]?\-[ ]?){3,}[ \t]*$/gm,key);
72 | _19=_19.replace(/^[ ]{0,2}([ ]?\_[ ]?){3,}[ \t]*$/gm,key);
73 | _19=_1d(_19);
74 | _19=_1e(_19);
75 | _19=_1f(_19);
76 | _19=_7(_19);
77 | _19=_20(_19);
78 | return _19;
79 | };
80 | var _21=function(_22){
81 | _22=_23(_22);
82 | _22=_24(_22);
83 | _22=_25(_22);
84 | _22=_26(_22);
85 | _22=_27(_22);
86 | _22=_28(_22);
87 | _22=_11(_22);
88 | _22=_29(_22);
89 | _22=_22.replace(/ +\n/g,"
\n");
90 | return _22;
91 | };
92 | var _24=function(_2a){
93 | var _2b=/(<[a-z\/!$]("[^"]*"|'[^']*'|[^'">])*>|)/gi;
94 | _2a=_2a.replace(_2b,function(_2c){
95 | var tag=_2c.replace(/(.)<\/?code>(?=.)/g,"$1`");
96 | tag=_2e(tag,"\\`*_");
97 | return tag;
98 | });
99 | return _2a;
100 | };
101 | var _27=function(_2f){
102 | _2f=_2f.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,_30);
103 | _2f=_2f.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\]\([ \t]*()(.*?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,_30);
104 | _2f=_2f.replace(/(\[([^\[\]]+)\])()()()()()/g,_30);
105 | return _2f;
106 | };
107 | var _30=function(_31,m1,m2,m3,m4,m5,m6,m7){
108 | if(m7==undefined){
109 | m7="";
110 | }
111 | var _39=m1;
112 | var _3a=m2;
113 | var _3b=m3.toLowerCase();
114 | var url=m4;
115 | var _3d=m7;
116 | if(url==""){
117 | if(_3b==""){
118 | _3b=_3a.toLowerCase().replace(/ ?\n/g," ");
119 | }
120 | url="#"+_3b;
121 | if(_1[_3b]!=undefined){
122 | url=_1[_3b];
123 | if(_2[_3b]!=undefined){
124 | _3d=_2[_3b];
125 | }
126 | }else{
127 | if(_39.search(/\(\s*\)$/m)>-1){
128 | url="";
129 | }else{
130 | return _39;
131 | }
132 | }
133 | }
134 | url=_2e(url,"*_");
135 | var _3e=""+_3a+"";
142 | return _3e;
143 | };
144 | var _26=function(_3f){
145 | _3f=_3f.replace(/(!\[(.*?)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,_40);
146 | _3f=_3f.replace(/(!\[(.*?)\]\s?\([ \t]*()(\S+?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,_40);
147 | return _3f;
148 | };
149 | var _40=function(_41,m1,m2,m3,m4,m5,m6,m7){
150 | var _49=m1;
151 | var _4a=m2;
152 | var _4b=m3.toLowerCase();
153 | var url=m4;
154 | var _4d=m7;
155 | if(!_4d){
156 | _4d="";
157 | }
158 | if(url==""){
159 | if(_4b==""){
160 | _4b=_4a.toLowerCase().replace(/ ?\n/g," ");
161 | }
162 | url="#"+_4b;
163 | if(_1[_4b]!=undefined){
164 | url=_1[_4b];
165 | if(_2[_4b]!=undefined){
166 | _4d=_2[_4b];
167 | }
168 | }else{
169 | return _49;
170 | }
171 | }
172 | _4a=_4a.replace(/"/g,""");
173 | url=_2e(url,"*_");
174 | var _4e="";
179 | return _4e;
180 | };
181 | var _1a=function(_4f){
182 | _4f=_4f.replace(/^(.+)[ \t]*\n=+[ \t]*\n+/gm,function(_50,m1){
183 | return _1c("
"+_21(m1)+"
");
184 | });
185 | _4f=_4f.replace(/^(.+)[ \t]*\n-+[ \t]*\n+/gm,function(_52,m1){
186 | return _1c(""+_21(m1)+"
");
187 | });
188 | _4f=_4f.replace(/^(\#{1,6})[ \t]*(.+?)[ \t]*\#*\n+/gm,function(_54,m1,m2){
189 | var _57=m1.length;
190 | return _1c("
";
254 | return _1c(_77)+_78;
255 | });
256 | _73=_73.replace(/~0/,"");
257 | return _73;
258 | };
259 | var _1c=function(_7a){
260 | _7a=_7a.replace(/(^\n+|\n+$)/g,"");
261 | return "\n\n~K"+(_3.push(_7a)-1)+"K\n\n";
262 | };
263 | var _23=function(_7b){
264 | _7b=_7b.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,function(_7c,m1,m2,m3,m4){
265 | var c=m3;
266 | c=c.replace(/^([ \t]*)/g,"");
267 | c=c.replace(/[ \t]*$/g,"");
268 | c=_79(c);
269 | return m1+""+_77+"\n"+c+"";
270 | });
271 | return _7b;
272 | };
273 | var _79=function(_82){
274 | _82=_82.replace(/&/g,"&");
275 | _82=_82.replace(//g,">");
277 | _82=_2e(_82,"*_{}[]\\",false);
278 | return _82;
279 | };
280 | var _29=function(_83){
281 | _83=_83.replace(/(\*\*|__)(?=\S)([^\r]*?\S[*_]*)\1/g,"$2");
282 | _83=_83.replace(/(\*|_)(?=\S)([^\r]*?\S)\1/g,"$2");
283 | return _83;
284 | };
285 | var _1f=function(_84){
286 | _84=_84.replace(/((^[ \t]*>[ \t]?.+\n(.+\n)*\n*)+)/gm,function(_85,m1){
287 | var bq=m1;
288 | bq=bq.replace(/^[ \t]*>[ \t]?/gm,"~0");
289 | bq=bq.replace(/~0/g,"");
290 | bq=bq.replace(/^[ \t]+$/gm,"");
291 | bq=_9(bq);
292 | bq=bq.replace(/(^|\n)/g,"$1 ");
293 | bq=bq.replace(/(\s*[^\r]+?<\/pre>)/gm,function(_88,m1){
294 | var pre=m1;
295 | pre=pre.replace(/^ /mg,"~0");
296 | pre=pre.replace(/~0/g,"");
297 | return pre;
298 | });
299 | return _1c("\n"+bq+"\n
");
300 | });
301 | return _84;
302 | };
303 | var _20=function(_8b){
304 | _8b=_8b.replace(/^\n+/g,"");
305 | _8b=_8b.replace(/\n+$/g,"");
306 | var _8c=_8b.split(/\n{2,}/g);
307 | var _8d=new Array();
308 | var end=_8c.length;
309 | for(var i=0;i