Ero sivun ”Widget:ThreadsX” versioiden välillä
Järvi-meriwikistä
(10 välissä olevaa versiota samalta käyttäjältä ei näytetä) | |||
Rivi 10: | Rivi 10: | ||
var amountNr = <!--{$amount|default:5|escape:'html'}-->; | var amountNr = <!--{$amount|default:5|escape:'html'}-->; | ||
var lang = "<!--{$lang|default:fi|escape:'html'}-->"; | var lang = "<!--{$lang|default:fi|escape:'html'}-->"; | ||
− | var | + | var nothreads = "<!--{$nothreads|default:Nothreads|escape:'html'}-->"; |
var searchStr = "action=query"; | var searchStr = "action=query"; | ||
Rivi 26: | Rivi 26: | ||
var threads = request.query.threads; | var threads = request.query.threads; | ||
+ | var threadsA = []; | ||
+ | var threadsO = {}; | ||
+ | /* | ||
+ | for ( var t in threads ) { threadsA.push( threads[ t ] ); } | ||
+ | threadsA.sort(function(a,b) { return parseFloat(a.created) - parseFloat(b.created) } ); | ||
+ | |||
+ | for ( var t in threadsA ) { | ||
+ | id = threadsA[ t ].id; | ||
+ | parent = threadsA[ t ].parent; | ||
+ | if ( parent === null ) { | ||
+ | threadsO[ id ]; | ||
+ | if ( typeof threadsO[ threadsA[ t ].id ] | ||
+ | threadsO.push( threads[ t ] ); } | ||
+ | |||
+ | console.log(threadsA); | ||
+ | */ | ||
var threadsArr = new Array(); | var threadsArr = new Array(); | ||
− | var output = '<div class="rss-box"><ul class="rss-items">'; | + | var output = '<div class="rss-box"><ul class="lake-rss-items">'; |
var alternate = 0; | var alternate = 0; | ||
Rivi 78: | Rivi 94: | ||
if (added == 0) { | if (added == 0) { | ||
− | output += | + | output += nothreads; |
} | } | ||