'.' to expand new entries, allow bare domain in url fields
This commit is contained in:
parent
b4e907912c
commit
1956a59bb0
10 changed files with 1552 additions and 31 deletions
|
@ -12,6 +12,6 @@ chmod-socket=666
|
|||
module=woodwind.wsgi
|
||||
import=timers
|
||||
|
||||
attach-daemon=venv/bin/rqworker high
|
||||
#attach-daemon=venv/bin/rqworker high
|
||||
attach-daemon=venv/bin/rqworker high low
|
||||
attach-daemon=venv/bin/python -m woodwind.websocket_server
|
||||
|
|
1478
woodwind/static/cassis.js
Normal file
1478
woodwind/static/cassis.js
Normal file
File diff suppressed because one or more lines are too long
|
@ -69,7 +69,6 @@ $(function(){
|
|||
$(".show-like-form").off('click').click(clickShowLikeForm);
|
||||
|
||||
$(".micropub-form button[type='submit']").off('click').click(submitMicropubForm);
|
||||
|
||||
$(".micropub-form .content").focus(function (){
|
||||
$(this).animate({ height: "4em" }, 200);
|
||||
});
|
||||
|
@ -111,9 +110,17 @@ $(function(){
|
|||
}
|
||||
|
||||
attachListeners();
|
||||
|
||||
$(document).on("keypress", function(e) {
|
||||
if (e.which === 46) {
|
||||
clickUnfoldLink();
|
||||
}
|
||||
});
|
||||
|
||||
if (WS_TOPIC) {
|
||||
webSocketSubscribe(WS_TOPIC);
|
||||
}
|
||||
|
||||
updateTimestamps();
|
||||
window.setInterval(updateTimestamps, 60 * 1000);
|
||||
|
||||
|
|
|
@ -432,7 +432,8 @@ article {
|
|||
article header {
|
||||
color: #484a47;
|
||||
border-bottom: 1px solid #687d77;
|
||||
margin-bottom: 0.5em; }
|
||||
margin-bottom: 0.5em;
|
||||
overflow: auto; }
|
||||
article header img {
|
||||
vertical-align: middle;
|
||||
margin: inherit;
|
||||
|
|
BIN
woodwind/static/syndication-icons/twitter.com.png
Normal file
BIN
woodwind/static/syndication-icons/twitter.com.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 726 B |
|
@ -11,7 +11,7 @@
|
|||
<button type="submit" name="action" value="repost"><i class="fa fa-retweet"></i></button>
|
||||
<button type="submit" name="action" value="like"><i class="fa fa-star"></i></button>
|
||||
</div>
|
||||
<div>
|
||||
<div class="syndication-toggles">
|
||||
{% for target in current_user.get_setting('syndicate-to', []) %}
|
||||
<div class="syndication-toggle">
|
||||
<input id="sc-{{entry.id}}-{{loop.index}}" type="checkbox" name="syndicate-to[]" value="{{ target }}"/>
|
||||
|
|
|
@ -12,6 +12,8 @@
|
|||
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css"/>
|
||||
<script src="//code.jquery.com/jquery-2.1.3.min.js"></script>
|
||||
<script src="{{ url_for('static', filename='moment.min.js') }}"></script>
|
||||
<script src="{{ url_for('static', filename='cassis.js') }}"></script>
|
||||
|
||||
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
|
||||
|
||||
{% block head %}{% endblock %}
|
||||
|
@ -48,7 +50,7 @@
|
|||
{% endif %}
|
||||
{% if not current_user.is_authenticated() %}
|
||||
<form action="{{ url_for('.login') }}" method="POST">
|
||||
<input type="text" name="me" placeholder="mydomain.com" />
|
||||
<input type="url" name="me" placeholder="https://yourdomain.com" />
|
||||
<input type="hidden" name="next" placeholder="{{ request.path }}" />
|
||||
<button style="text-align: right;" type="submit">Login</button>
|
||||
</form>
|
||||
|
@ -66,5 +68,29 @@
|
|||
{% block body %}{% endblock %}
|
||||
</main>
|
||||
{% block foot %}{% endblock %}
|
||||
|
||||
<script>
|
||||
$("input[type='url']").blur(function() {
|
||||
if (this.value.trim() != '') {
|
||||
this.value = web_address_to_uri(this.value, true);
|
||||
}
|
||||
});
|
||||
|
||||
$("input[type='url']").on("invalid", function() {
|
||||
this.value = web_address_to_uri(this.value, true);
|
||||
if (this.willValidate) {
|
||||
this.setCustomValidity('');
|
||||
this.parentNode.submit();
|
||||
return false;
|
||||
} else if (document.getElementById('error')) {
|
||||
return;
|
||||
} else {
|
||||
$html = document.createElement("div");
|
||||
$html.id = 'error';
|
||||
$html.innerHTML = "Oops! looks like you didn't enter a URL. Try starting with http://";
|
||||
this.parentNode.appendChild($html)
|
||||
}
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
{% if ws_topic %}
|
||||
<script>var WS_TOPIC = "{{ ws_topic }}";</script>
|
||||
{% endif %}
|
||||
<script src="{{url_for('static', filename='feed.js', version='2015-05-28')}}"></script>
|
||||
<script src="{{url_for('static', filename='feed.js', version='2015-07-13')}}"></script>
|
||||
|
||||
{% if current_user and current_user.settings
|
||||
and current_user.settings.get('reply-method') == 'indie-config' %}
|
||||
|
@ -49,4 +49,6 @@
|
|||
</div>
|
||||
{% endif %}
|
||||
|
||||
<iframe style="display:none;" src="https://www.subtome.com/register-no-ui.html?name=Woodwind&url=https%3A%2F%2Freader.kylewm.com%2Fsubscribe%3Forigin%3D%7Burl%7D"></iframe>
|
||||
|
||||
{% endblock body %}
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
{% extends "base.jinja2" %}
|
||||
{% block body %}
|
||||
<main>
|
||||
{% set reply_method = settings.get('reply-method') %}
|
||||
|
||||
<form name="settings" action="{{ url_for('.settings') }}" method="POST">
|
||||
<form id="settings" name="settings" action="{{ url_for('.settings') }}"
|
||||
method="POST" data-reply-method="{{reply_method}}">
|
||||
|
||||
<button type="submit">Save Changes</button>
|
||||
|
||||
<div id="reply-mechanism-settings">
|
||||
{% set reply_method = settings.get('reply-method') %}
|
||||
|
||||
<h2>Reply Mechanism</h2>
|
||||
<p>
|
||||
|
@ -66,6 +68,7 @@
|
|||
</p>
|
||||
{% set selectedActions = settings.get('indie-config-actions', []) %}
|
||||
|
||||
<p>
|
||||
{% for action in ['like', 'favorite', 'reply', 'repost', 'bookmark'] %}
|
||||
<label>
|
||||
<input type="checkbox" name="indie-config-action" value="{{ action }}"
|
||||
|
@ -91,6 +94,9 @@
|
|||
</div>
|
||||
<button id="add-action">Add</button>
|
||||
|
||||
</div>
|
||||
<button type="submit">Save Changes</button>
|
||||
|
||||
</form>
|
||||
</main>
|
||||
|
||||
|
@ -103,11 +109,12 @@ $('#add-action').click(function(evt) {
|
|||
});
|
||||
|
||||
function showRelevantSection() {
|
||||
var savedReplyMethod = $('form').data('reply-method')
|
||||
var replyMethod = $('input[name=reply-method]:checked').val();
|
||||
$('#micropub-settings').hide();
|
||||
$('#indie-config-settings').hide();
|
||||
$('#action-urls-settings').hide();
|
||||
if (replyMethod == 'micropub') {
|
||||
if (replyMethod == 'micropub' && savedReplyMethod == 'micropub') {
|
||||
$('#micropub-settings').show();
|
||||
} else if (replyMethod == 'indie-config') {
|
||||
$('#indie-config-settings').show();
|
||||
|
|
|
@ -285,29 +285,29 @@ def load_user(url):
|
|||
@views.route('/subscribe', methods=['GET', 'POST'])
|
||||
@flask_login.login_required
|
||||
def subscribe():
|
||||
if flask.request.method == 'POST':
|
||||
origin = flask.request.form.get('origin')
|
||||
if origin:
|
||||
type = None
|
||||
feed = None
|
||||
typed_feed = flask.request.form.get('feed')
|
||||
if typed_feed:
|
||||
type, feed = typed_feed.split('|', 1)
|
||||
else:
|
||||
feeds = find_possible_feeds(origin)
|
||||
if not feeds:
|
||||
flask.flash('No feeds found for: ' + origin)
|
||||
return flask.redirect(flask.url_for('.index'))
|
||||
if len(feeds) > 1:
|
||||
return flask.render_template(
|
||||
'select-feed.jinja2', origin=origin, feeds=feeds)
|
||||
feed = feeds[0]['feed']
|
||||
type = feeds[0]['type']
|
||||
new_feed = add_subscription(origin, feed, type)
|
||||
flask.flash('Successfully subscribed to: {}'.format(new_feed.name))
|
||||
return flask.redirect(flask.url_for('.index'))
|
||||
origin = flask.request.form.get('origin') or flask.request.args.get('origin')
|
||||
if origin:
|
||||
type = None
|
||||
feed = None
|
||||
typed_feed = flask.request.form.get('feed')
|
||||
if typed_feed:
|
||||
type, feed = typed_feed.split('|', 1)
|
||||
else:
|
||||
flask.abort(400)
|
||||
feeds = find_possible_feeds(origin)
|
||||
if not feeds:
|
||||
flask.flash('No feeds found for: ' + origin)
|
||||
return flask.redirect(flask.url_for('.index'))
|
||||
if len(feeds) > 1:
|
||||
return flask.render_template(
|
||||
'select-feed.jinja2', origin=origin, feeds=feeds)
|
||||
feed = feeds[0]['feed']
|
||||
type = feeds[0]['type']
|
||||
new_feed = add_subscription(origin, feed, type)
|
||||
flask.flash('Successfully subscribed to: {}'.format(new_feed.name))
|
||||
return flask.redirect(flask.url_for('.index'))
|
||||
|
||||
if flask.request.method == 'POST':
|
||||
flask.abort(400)
|
||||
|
||||
return flask.render_template('subscribe.jinja2')
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue