Commit c9144528 authored by Mirko Vucicevich's avatar Mirko Vucicevich

Merge branch 'v2.1' into 'p01'

Small fixes

See merge request !34
parents 4dc6524e ee73e48d
......@@ -22,7 +22,7 @@ def get_tweets(q, num=20, time_since=5):
try:
api = tweepy.API(auth)
if '#' in q:
search = api.search(q, rpp=num)
search = api.search(q, rpp=num, tweet_mode='extended')
elif '@' in q:
search = api.user_timeline(screen_name=q.replace('@', ''), tweet_mode='extended')
tweets = []
......
{% extends 'base.html' %}
{% block pagetitle %}
Article: {{name}}
{% endblock %}
{% block body %}
{{body|safe}}
......
<html>
<html lang="en-US">
<head>
<link rel="stylesheet" href="/static/independoc/base.css">
<title>Scinage Documentation and Tutorial Videos</title>
{% block head %}
{% endblock %}
</head>
<body>
<section id="sidebar">
<header>
<span id="header-title">{{config.site_title}}</span>
<a href="{{config.return_url}}">Back to site</a>
</header>
......@@ -13,10 +15,8 @@
</section>
<div id="content">
<main>
<h1 id="page-title">
{% block pagetitle %}
{% endblock %}
</h1>
{% block body %}
{% endblock %}
</main>
......
......@@ -122,7 +122,11 @@
}));
});
$( "#slidelist" ).sortable({
containment: '#slidelist',
cursor: "move",
revert: true,
scroll: false,
helper: 'clone',
update: function( event, ui ) {
reorder();
}
......@@ -145,31 +149,31 @@
$('#listSlidesLoader').on('click', '.slideItem .addslidebutton', function(evt){
evt.preventDefault();
var slideItem = $(this).closest('.slideItem');
// Get highest layer
var index_highest = 0;
$("#slidelist>.activeIcon").each(function() {
var index_current = parseInt($(".slideForm>.order",this).val());
if(index_current > index_highest) {
index_highest = index_current;
}
});
var count = $('#slidelist>.slideIcon').length;
var owner = slideItem.find('.owner').text()
var title = slideItem.find('h4>span>b').text()
var tmplMarkup = $('#emptyslide').html();
var compiledTmpl = tmplMarkup.replace(/__prefix__/g, count).replace(/__title__/g, title).replace(/__owner__/g, owner);
$('#slidelist').append(compiledTmpl);
//Grab this newest slide we just added...
var newlayer = $('#slidelist .slideIcon:last-child')
// Fill it with goodies from the jsonData
$(".slideForm>.order", newlayer).val(index_highest+1)
$(".slideForm>.slide", newlayer).val(slideItem.data('id'))
$('.slideContent', newlayer).prepend(slideItem.find('.info').html())
// update form count
$('#id_slide-TOTAL_FORMS').attr('value', count+1);
$('#slidesModal').modal('hide');
reorder();
newlayer.find('.timeselect').flatpickr({enableTime: true});
// Get highest layer
var index_highest = 0;
$("#slidelist>.activeIcon").each(function() {
var index_current = parseInt($(".slideForm>.order",this).val());
if(index_current > index_highest) {
index_highest = index_current;
}
});
var count = $('#slidelist>.slideIcon').length;
var owner = slideItem.find('.owner').text()
var title = slideItem.find('h4>span>b').text()
var tmplMarkup = $('#emptyslide').html();
var compiledTmpl = tmplMarkup.replace(/__prefix__/g, count).replace(/__title__/g, title).replace(/__owner__/g, owner);
$('#slidelist').append(compiledTmpl);
//Grab this newest slide we just added...
var newlayer = $('#slidelist .slideIcon:last-child')
// Fill it with goodies from the jsonData
$(".slideForm>.order", newlayer).val(index_highest+1)
$(".slideForm>.slide", newlayer).val(slideItem.data('id'))
$('.slideContent', newlayer).prepend(slideItem.find('.info').html())
// update form count
$('#id_slide-TOTAL_FORMS').attr('value', count+1);
$('#slidesModal').modal('hide');
reorder();
newlayer.find('.timeselect').flatpickr({enableTime: true});
})
$(".timeselect").flatpickr({enableTime: true});
$("#slidelist").on('click', '.clear-time', function(){
......
......@@ -73,12 +73,20 @@ function nextframe(source, time, index){
$('.next').css('z-index', 4);
$('.next').toggleClass('next current')
current.attr('src', 'about:blank').load().css('z-index', 1).toggleClass('next current');
$.get('/slideshows/nextslide/{{slideshow.id}}/'+String(index)+'/', function(data){
$('#bg').css('opacity', 0);
setTimeout(function(){
setTimeout(function(){nextframe(data.slide, data.time, data.index)}, time)
}, 600);
})
function getIt(){
$.get('/slideshows/nextslide/{{slideshow.id}}/'+String(index)+'/', function(data){
$('#bg').css('opacity', 0);
setTimeout(function(){
setTimeout(function(){nextframe(data.slide, data.time, data.index)}, time)
}, 600);
}).fail(function(error){
console.log('fail', this)
setTimeout(function(){
getIt()
}, 6000)
})
}
getIt()
}, 600)
})
}
......
......@@ -40,7 +40,7 @@
<div class="row">
<div class="col-lg-6 col-lg-push-6 col-xs-12">
<h2>Videos <small class="text-muted">Upload and delete videos.</small></h2>
<p>Videos can be used in widgets. They can be supplied via url or by uploading the video. Videos can also be deleted (if they are not in use).</p>
<p>Videos can be used in widgets. They can be supplied via url or by uploading the video. Uploaded videos can also be deleted (if they are not in use).</p>
<h4><b>There are no thumbnails.</b></h4>
<button id="upload-video" class="btn btn-primary btn-lg">Upload video</button>
</div>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment