Jump to content

Beluga

Members
  • Posts

    528
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by Beluga

  1. Yep, caching might be nice going forward. Anyway, I can solve this right now with the static JS (well, in theory - have not tried yet what the effect on load time is). It is great to hear you have a plan for RockTabulator regarding this!
  2. I am wondering how to optimise a query. It is taking 23 seconds on a server with 4GB of memory. It is live here: https://mattikuusiproverbtypology.fi/references/ I have considered moving to static JS data as the data in the db does not change very often. The query is: $finder1 = new RockFinder('template=A-T', ['code', 'nb', 'variation', 'name', 'page1', 'page2', 'page3', 'runningnb', 'additnb', 'abbrevat']); $finder2 = new RockFinder('template=M6books', ['abbrev', 'author_editor', 'booktitle']); $at = $finder1->getSQL(); $m6books = $finder2->getSQL(); $sql = "SELECT * FROM ($at) AS at LEFT JOIN ($m6books) as m6books ON (at.abbrevat = m6books.abbrev)"; $this->setData($sql); I temporarily enabled slow_query_log like so in my.cnf: long_query_time=1 slow_query_log=1 slow_query_log_file=/var/log/mysql/slow-query.log (with /var/log/mysql owned by mysql user) Below is the slow query log - for some reason it contains two identical queries, each taking over 9 seconds. I wonder why that is? Due to ajax? Does this happen to others? My MySQL settings on the server are: Results from mysqltuner:
  3. I got ajax working, it was pretty simple in the end. In RockGridItem.js: xhr.onreadystatechange = function() { if (xhr.readyState == 4 && xhr.status == 200) { var httpResult = JSON.parse(xhr.responseText); // Tabulator change var table = RockGrid.table; table.setData(httpResult); grid.getDOM().dispatchEvent(new Event('RockGridAjaxDone', {bubbles:true})); } };
  4. Woooaw - with your query and renaming the fields of the other template, I got a perfect result!! (You were right that the column names have to be different) Thanks a lot. This is using my old hacky Tabulator grid ?
  5. I am trying to figure out how to join pages from two templates into a grid. I will attach a picture of an incorrect result just as a talking point: The goal would be to plonk the data from unive into the grid, with rows filled only when code and number match the ones in the main (A-T) grid. The incorrectly repeating result in the screenshot was reached with this: $finder1 = new RockFinder('template=A-T', ['code', 'nb', 'variation', 'name']); $finder2 = new RockFinder('template=unive3', ['code', 'nb', 'proverbtype']); // join finder $finder1->join($finder2, 'unive', ['code' => 'code']); $this->setData($finder1); So how can I match by two fields to get what I want?
  6. Due to the tooltip problem, the only safe way to copy anything from the forum is to quote the message and then copy from the message composing area.
  7. "Anti-snobbery" resulted in my boss recently sending me an email with a link to javascript:void(0);
  8. I assume this would be for the admin. I have never used the other modules, but if you have experienced the need for something more, I'm sure it is sensible to build it ?
  9. According to the instructions in this thread, you should be able to run it from the command line with "sublime"
  10. This is supposed to be pretty lean, but I have no idea of how well it works with modern web pages: https://www.netsurf-browser.org/
  11. Latest docs: http://tabulator.info/docs/4.2/clipboard
  12. I am willing to work on it ? I was just about to come back to this as I recently completed a couple of unrelated website rebuilds. I also want to resume my JavaScript studies (halfway through Eloquent JS at the moment). I haven't ran into any downsides or lacking features yet, but the issue tracker might be an enlightening place in that regard.
  13. The module is working otherwise great (thanks a lot!), but when visiting www. subdomain, the URLs of the rootParent children lack the domain. $siteRoot = $page->rootParent; $nav = ""; foreach ($siteRoot->children as $child) { $nav .= "<a href='$child->url'>$child->title</a>\n"; } This produces urls like https://pagename I can use <a href='/$child->name'> instead to make them work as relative URLs, but it would be nice to know what is going wrong. Setup: - Home - mysite.com - myothersite.com $config->MultisiteDomains = array( "mysite.com" => array( "root" => "mysite.com", "http404" => 27 ), "www.mysite.com" => array( "root" => "mysite.com", "http404" => 27 ), "myothersite.com" => array( "root" => "myothersite.com", "http404" => 1017 ), "www.myothersite.com" => array( "root" => "myothersite.com", "http404" => 1017 ) ); $config->httpHosts = array('mysite.com','www.mysite.com','myothersite.com','www.myothersite.com'); If I don't have the separate www. entries in MultisiteDomains, it does not work. It just throws me to the "Home" page, if I try to navigate to www. subdomain.
  14. Why didn't you call me? That's what everyone else I know does when they get printer trouble. Besides, a PW contributor like you gets free lifetime phone support from me. Regarding trying new distros, it should be possible to install the printer-related packages to a live system running from a USB stick and thus test without the hurdle of an actual OS installation. Anyway, that pink bug sounds fascinating!
  15. While the forum is getting some attention, how about disabling the quote tooltip that drives everyone crazy with its evil span insertion ways?
  16. Nope, just sad that there was the unnecessary fork. The forker could have just waited for a moment. It does not seem the two projects will be merging in the future.
  17. I continue the use of sexy Apex Charts. It is in the process of being updated to use SVG.js 3.0. It seems to have attracted a nice amount of attention and is getting patches from various contributors. C3.js had an unfortunate incident, where a developer thought it was abandoned and decided to fork it. Since the fork, the development of C3.js continued (slowly), so now there is the lovely situation of duplicated work and fractured user base typical in FOSS.
  18. Some weeks ago I started developing a fairly simple multisite using Soma's module, so I was suddenly faced with the need to use "fake domains" locally. After a lot of digging I happened upon a setup that works perfectly with Docker. I was surprised about how smooth it was in the end, because I had read a crazy amount of topics dealing with weird acrobatic methods to achieve this with Docker. I used a tutorial on setting up DNS caching (they have an Ubuntu version as well). It worked fine with my Arch Linux. Later I noticed Arch wiki has a topic about the same thing. My /etc/dnsmasq.conf looks like this: listen-address=127.0.0.1 port=53 bind-interfaces user=dnsmasq group=dnsmasq pid-file=/var/run/dnsmasq.pid domain-needed bogus-priv no-hosts dns-forward-max=150 cache-size=1000 no-negcache neg-ttl=3600 resolv-file=/etc/resolv.dnsmasq no-poll address=/test/127.0.0.1 The last line allows me to use any .test domain. I copied the old contents of my /etc/resolv.conf to /etc/resolv.dnsmasq. I changed /etc/resolv.conf to only contain nameserver 127.0.0.1 Then just sudo systemctl restart dnsmasq to see the thing in action. Finally, I had to protect /etc/resolv.conf. There are various ways, but I found I only needed to stop NetworkManager from overwriting it. In /etc/NetworkManager/NetworkManager.conf I added [main] dns=none Now I just use this in my Caddyfile and enjoy life: mysite.test, anothersite.test tls off
      • 2
      • Like
  19. It is interesting and because it is Korean, they support older IE versions ? Yet, we come to the question of "dependency rot" as for drawing SVGs, it depends on RaphaelJS, which is unmaintained. If the deps issue does not scare you, there is a WIP PHP class for feeding data to it.
  20. From Ryan's original post, I understood that PRs and requests would be a collective effort as well ("I thought we’d then move on to the requests repo and PRs if possible").
  21. I found this tip originally for WordPress. function filter_ptags_on_images($content){ return preg_replace('/<p>\\s*?(<a .*?><img.*?><\\/a>|<img.*?>)?\\s*<\\/p>/s', '\1', $content); } $text = filter_ptags_on_images($page->text); echo $text;
  22. Well, RockGrid and RockFinder are still essential to make it work with PW no matter which JS lib we use ? I will look into donating to Tabulator next to cover all bases. Regarding the earlier discussion about creating a module that makes RockGrid and Apex Charts talk to each other: I might look into it after my plate is cleared of various stuff (such as launching this proverb project).
  23. Sorry and thanks. Fixed the semantic ui blunder (feel free to use any of the themes offered by Tabulator and hack the .module.php accordingly). Added example to readme. The example references variables and functions that you do not have access to (codesObj, afterFilter). It is not meant to be used as-is, but as a reference. I can clarify this later in the example comments. https://github.com/mestaritonttu/FieldtypeRockGrid/tree/tabulator As said, this is a hack-in-progress and the start of a discussion, so I am ignoring the plugin errors right now. Regarding your questions on server-side validation and buttons, I do not have answers. I can only point you to http://tabulator.info/docs/4.1/validate http://tabulator.info/docs/4.1/update Perhaps you can build a custom validator that does what you want. See the last entry "Delete Row" in the Update section.
  24. Pinging the grid heads: @bernhard @jmartsch @mel47 @dragan @szabesz In short, I have modified RockGrid to work with Tabulator instead of ag-Grid. I left out ajax and plugins for now. I fully understand, if Bernhard is not interested in switching the "engine" of RockGrid, but at least it is food for thought and a proven alternate solution ? The "HackGrid" can be found here: https://github.com/mestaritonttu/FieldtypeRockGrid/tree/tabulator Longer story: During the last week of November I ran into Tabulator by accident. It occurred to me "someone in the early days of RockGrid suggested some other solution". I searched the PW forums and found out that someone was szabesz and the solution was Tabulator! Now, the important thing here is that since the PW forum discussion (April 2018), Tabulator has seen significant changes. It got rid of jQuery & jQuery UI dependencies and added a ton of features. Why have I decided to switch to Tabulator? Lately ag-Grid has left a bad taste in my mouth - the performance of its row autoheight sucks, so I had to work around it - inside the autoheight workaround I had to add another workaround to avoid an infinite event triggering/listening loop - the closed nature is showing its bad sides more and more, like not being able to see the content in their enterprise bug tracker So what do we get with Tabulator? - row autoheight that just works - dropdown filter out of the box, so I don't need my awkward external filter - features matching the enterprise version of ag-Grid, such as http://tabulator.info/docs/4.1/select#setup-range http://tabulator.info/docs/4.1/group http://tabulator.info/docs/4.1/download#xlsx http://tabulator.info/docs/4.1/tree http://tabulator.info/examples/4.1#nested-tables http://tabulator.info/docs/4.1/clipboard What are the philosophical differences? In the words of the Tabulator main dev, ag-Grid focuses on being a fully functional spreadsheet while Tabulator goes more down the route of interactive table. I would have announced this already nearly 3 weeks ago, but caught pneumonia ? Use on the RockGrid side is really not much different. Mostly just using col.title instead of col.headerName. For some reason the grid.js stuff is lost (to get the field titles), but I did not have time to investigate.
  25. I just now went looking in their issue trackers and found this in their enterprise support tracker (in category tab "Standard Feature Requests): AG-1202 Allow rendering rows dynamically adapting their height to their content That does sound like what I want, but thanks to their closed system, we have no way of knowing the exact contents of the issue! ??? There is also this, which would only be for paying customers: Enterprise Row Model AG-1039 Allow dynamic row heights and maxBlocksInCache This is in Parked category: AG-2228 Allow lazy loading of rows when using autoHeight, ie on scroll to configured amount of rows, append n more rows at the bottom So looks like this stuff is on their radar (which I would have assumed based on how they acknowledge the pain point in their docs). Let's wait and see and for now enjoy my hack ? All this hacking does have the effect of improving my self-confidence and wanting to learn JS more deeply ?
×
×
  • Create New...