From f908e86e48dbb1173f080c4a2fa1cf5128cfe70f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20Hn=C3=A1t?= Date: Thu, 3 Nov 2022 12:03:32 +0100 Subject: [PATCH] Filter still not done --- __pycache__/dashboard.cpython-310.pyc | Bin 1562 -> 1576 bytes dashboard_static/lib/tweets.js | 19 +++++++++++-------- eca/__pycache__/arff.cpython-310.pyc | Bin 10596 -> 10610 bytes eca/__pycache__/generators.cpython-310.pyc | Bin 3899 -> 3913 bytes 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/__pycache__/dashboard.cpython-310.pyc b/__pycache__/dashboard.cpython-310.pyc index 8e88d6080d3215bc1a15d6c85dbf30afd3dd732c..ef5ec2f0cc6e928b529135e87c698e9eebc9de8a 100644 GIT binary patch delta 94 zcmbQmvx0{&pO=@50SL5aB_;o6-N={7=;)&#TAW%`te>BgS(aLqk(XGa?~+=aU6Nm* wA6inLnpcvlADNn1WT@|(pHiBWYN%gQo>@|oTBKW0l%JKFT%x~u5n}}l0Ei?YApigX delta 80 zcmZ3%GmD2WpO=@50SMX~lah_tHu5Dh8rwNr#e^2878S>oWagG<#<=7sm*%GCl@!PL i=BJeAq$(K3l$2+dl%y8v78K=Yr6!leY~H|F!2$r#T^jTN diff --git a/dashboard_static/lib/tweets.js b/dashboard_static/lib/tweets.js index 52bb011..94bc051 100644 --- a/dashboard_static/lib/tweets.js +++ b/dashboard_static/lib/tweets.js @@ -68,12 +68,12 @@ var process_entities = function(message, entities) { block.fn.tweets = function(config) { var options = $.extend({ - memory: 100 + memory: 20 }, config); // store list for later - var $list = $("div.tweetcontainer"); - console.log(this.$element.find("div")) + // var $list = $("div.tweetcontainer"); + var $list = document.querySelector("#latest") // register default handler for handling tweet data this.actions(function(e, tweet){ @@ -86,16 +86,19 @@ block.fn.tweets = function(config) { } window.sessionStorage.setItem('tweets', JSON.stringify(tweets)); + // remove stale tweets + // if ($list.childElementCount > options.memory) { + // console.log("Deleted") + // // delete last child element + // // $list.removeChild($list.lastChild); + // } + $list.replaceChildren(); // tweets = filterTweets(tweets, filters.blockedWords, filters.searchedWords + filters.sports, filters.sorted, filters.order); // tweets = sortTweets(tweets); - for (i = 0; i < tweets.length; i++){ + for (i = 0; i < options.memory-1; i++){ $list.prepend(tweetCell(tweets[i])); } - // remove stale tweets - if ($list.children().length > options.memory) { - $list.children().last().remove(); - } }); return this.$element; diff --git a/eca/__pycache__/arff.cpython-310.pyc b/eca/__pycache__/arff.cpython-310.pyc index dab7427d1e834bcde8ccb59363edf0b65174b18e..1516621a59785020207256a2be42150d073cc160 100644 GIT binary patch delta 112 zcmaD7^eKohpO=@50SL;sh9?KBZ{*`-cJe*3Zw$EK4oQ$V)8IcS$YIF3B&@ z4=pKA%_~XOk4#N0GSv6YPbtkwHPkOD&nziPEz&J0%FjwoF40d-PSoG*#~jPbcx&?- Nj#yzJ#U&HP3jk99CVl__ delta 98 zcmewq^dyKcpO=@50SN3L#3x_Y*vQApY;Nmp6%$&VT2vfUl9^kc8RL?lT$-DjS5h3~ zo1apeld51CQ&OH;Qj%JvTTqmrm6}`=3N}I!azzwCW;pTiyb1` diff --git a/eca/__pycache__/generators.cpython-310.pyc b/eca/__pycache__/generators.cpython-310.pyc index 01498c6c8ba1f70d9813f18b01d362c22d8e231b..155bc4d8708199018b99b564bcb0b143f7aecc2c 100644 GIT binary patch delta 97 zcmdljcT$cwpO=@50SL;sh9~=Opw_A=kpO=@50SN3L#3vu!$h(Ni+}YVGCbT%Us5qu1Gq*f5#w9