#foswiki 2016-11-17,Thu

↑back Search ←Prev date Next date→ Show only urls(Click on time to select a line by its url)

WhoWhatWhen
***ChanServ sets mode: +o Lynnwood [04:48]
........... (idle for 52mn)
gac410 has left [05:40]
...... (idle for 26mn)
GuilainC_away is now known as GuilainC [06:06]
........... (idle for 54mn)
ChanServ sets mode: +o MichaelDaum [07:00]
....... (idle for 34mn)
GuilainC is now known as GuilainC_away [07:34]
............................. (idle for 2h20mn)
zak256Is there another way to define a local variable (only needed within a page) without varSET ? [09:54]
GithubBot[OEmbedPlugin] MichaelDaum pushed 1 new commit to master: https://git.io/vXHOk
OEmbedPlugin/master 11901be MichaelDaum: Item14220: converted from Any::Moose to Moo...
[10:01]
***GithubBot has left [10:01]
FoswikiBothttps://foswiki.org/Tasks/Item14220 [ Item14220: Any::Moose is deprecated ] [10:01]
.................... (idle for 1h39mn)
stefan_slightzak256: i don't think so. you could try to use an section and an include to do something eventually similar..
http://foswiki.org/System/VarINCLUDE
[11:40]
zak256Hmm... yes I know INCLUDE, thanks. That gives me an idea for my current problem (%IF{ %SEARCH-yields-results% then...}% )
Hmm... no... doesn't work
[11:41]
stefan_slightwhat is your problem? [11:53]
zak256I am in quoting hell again here... :-( I got the %IF{ %SEARCH{...}% then="true" else="false" }% working
But now I need to insert a %TWISTY{...}% as 'true' value
I wrote ...then="%INCLUDE{...}%" now, and put the TWISTY into that section
But now all I see on the page is: <div class=
[11:54]
GithubBot[OEmbedPlugin] MichaelDaum pushed 1 new commit to master: https://git.io/vXHR6
OEmbedPlugin/master 7f24702 MichaelDaum: Item14220: added facebook(video)...
[11:58]
***GithubBot has left [11:58]
FoswikiBothttps://foswiki.org/Tasks/Item14220 [ Item14220: Any::Moose is deprecated ] [11:58]
zak256Yes... I did it. Whew....
If the same SEARCH appears more than once on a page, is it cached or is it processed several times then?
[11:59]
JulianLevenszak256: You can use %CALC% and the zeroresults= param of %SEARCH to $SET a local variable to indicate no results from search
you'll need a corresponding %CALC% within format= to set an alternative value to indicate search did return results
[12:05]
zak256@JulianLevens: That would be better in my case probably... $set is a search parameter? I'll look.... [12:07]
JulianLevensThere is some caching in retrieving topic data for the search. It's not code I've looked at in depth
No $SET is a function of SpreadSheetPlugin
[12:07]
zak256Ok, the variable can then be retrieved outside of the SEARCH as common %MYVAR% macro? [12:09]
***ColasNahaboo has quit IRC (Ping timeout: 246 seconds)
colas has quit IRC (Ping timeout: 256 seconds)
[12:09]
JulianLevensNo you retrieve it with %CALC{$SET(myvar)}%
Sorry, you retrieve it with %CALC{$GET(myvar)}%
[12:11]
zak256ah, ok. I will try... [12:13]
Hmm... I wrote the following:
.... format="%CALC{"$SET(results, 1)"}%" footer="" zeroresults="%CALC{"$SET(results, 0)"}%"
But I always get 0
[12:22]
..... (idle for 22mn)
JulianLevenstry zeroresults="$percntCALC{$SET(results,1)}$percnt"
Just checking my code. I did not need to $SET for the default case, but
I needed %CALC{$ISDIGIT($GET(zero))}% to test for true (i.e. no-results) in later code
I actually had zeroresults="$percntCALC{$SET(zero,1)}$percnt"
I think setting to a numeric and possibly not 0 was important
[12:44]
....... (idle for 32mn)
***ChanServ sets mode: +o MichaelDaum [13:20]
.... (idle for 18mn)
zak256@JulianLevens: It works now, thanks! [13:38]
@JulianLevens: It works now, thanks! [13:44]
JulianLevensyw [13:44]
....... (idle for 34mn)
***ChanServ sets mode: +o gac410 [14:18]
zak256@JulianLevens: I experience differences when reloading the page. Sometimes the value I set before with CALC{$set...} is not retrieved correctly with CALC{$get...} apparently.
I just press reload several times without changing anything and sometimes it works, sometimes not.
[14:21]
JulianLevensHmm, I didn't have that problem [14:34]
zak256And now I have two SEARCHes after another, with exactly the same zeroresults parameter %CALC{$SET...}%, the first one works, but the second macro is just displayed on the wiki page and not evaluated [14:36]
JulianLevensThe failure of the second macro sounds like a bug either in your code or Foswiki, but I've no idea which
I could even be completely wrong :(
[14:38]
zak256Maybe foswiki stops at some point evaluating macros? But they aren't even nested... [14:39]
JulianLevensTry adding a $percntCALC{$SET(zero,0)}$percnt to part of the format to force a clear true/false depending on search evaluation
Foswiki evaluates all macros every time
[14:40]
zak256If I add the zero-CALC to the format, exactly this expression is printed in my results, with the $percnt replaced by %
%CALC{$SET(zero,0)}%
[14:42]
JulianLevensAlas I cannot test easily, the App I used this is has been retired so I have example code but not the whole thing to test with [14:43]
zak256No problem... I will experiment further. [14:43]
gac410zak256: Are you still on a 1.1.x release? And are you using FastCGI or mod_perl [14:46]
zak256Yes, unfortunately it's the 1.1.2 release. We use mod_perl. [14:47]
gac410There was a bug Item13811 - found a while back. Some variables are not cleared across transactions. [14:48]
FoswikiBothttps://foswiki.org/Tasks/Item13811 [ Item13811: SpreadSheetPlugin CALCULATE macro leaks information on fcgi / mod_perl sites. ] [14:48]
gac410Fixed in Foswiki 2.0.3 If you are having strangeness with $SET/$GET variables, that could possibly explain it. [14:49]
zak256So this would explain the differences when reloading probably, but also the case, where a second macro isn't even evaluated?
I just see the code on the page: %CALC{$SET(zeroresults, 1)}%
[14:50]
gac410Second macro not evaluated. ... that's something different IIRC. Another change in recent SSP was %CALCULATE% macro which is evaluated with the traditional inside-out left-right mechanims
%CALC uses a common tags handler to process all the |table| data. %CALCULATE% does not.
Item4798
[14:51]
FoswikiBothttps://foswiki.org/Tasks/Item4798 [ Item4798: TWiki variables such as CALC are not expanded inside formatted search if CALC is also used elsewhere on same line ] [14:52]
gac410That's a real old bug, fixed by changing from CALC to CALCULATE but still listed as open as its really not fixed [14:53]
zak256so I should replace CALC with CALCULATE everywhere? [14:53]
gac410no. Not on your release! [14:53]
zak256ah... I see ... :-( [14:53]
gac410Fixed in Foswiki 2.0.3 [14:53]
zak256Why do people always want new stuff before the new release is ready :-( [14:54]
gac410I would be very wary of trying to run the latest SpreadSheetPlugin on that old a foswiki release. It *might* work but would need careful testing. [14:54]
zak256No... I will not try that. Would be too much hassle.
Is there maybe any workaround for this?
[14:54]
gac410Not that I'm aware of. [14:55]
memic_gac410, imageplugin doesnt seem to support metadata to images as well [14:55]
gac410Did you ask MichaelDaum?
MichaelDaum: memic_ wanted some way to add copyright info to images. I didn't think so but figured you would know best
[14:56]
MichaelDaummemic_, do you mean exif data embedded in image files? [14:56]
gac410MichaelDaum: when you get a spare second :D Item14219 is nice - certainly something I have wanted. But css probably needs some review / prettying [14:59]
FoswikiBothttps://foswiki.org/Tasks/Item14219 [ Item14219: Add WebSideBar toggle cookbook contributed by [[Main.StefanKr├╝ger][StefanKr├╝ger]] ] [14:59]
memic_not exif but extra data in the upload form of the images [14:59]
MichaelDaummemic_, you could have it in the comment field [15:00]
JulianLevensMichaelDaum: Note that there is already an extension HiddenPatternSidebarSkin [15:01]
gac410JulianLevens: wow... I didn't know about that one. [15:02]
JulianLevensIt does need some TLC, I don't think it was ever really completed [15:02]
gac410The CSS from stefan is pretty simple, and seems like a reasonable thing to add as a cookbook.
One other change I made to my own site to control the bots a bit, was a skin for guests that adds a TABLE sort=off to the attachments table. Damn bots were sorting the tables on every possible up / down / off variation.
[15:02]
memic_MichaelDaum, can foswiki display exif data? [15:03]
gac410Found it in the cache variations., [15:03]
MichaelDaumI like the way the sidebar is toggled [15:04]
gac410With stefan's css? [15:04]
MichaelDaumelegant solution [15:04]
JulianLevensThat's fine, but I'm wondering if we should remove that extension - at least mark it as needing TLC and point to the CSS solution [15:04]
MichaelDaumJulianLevens, y [15:04]
gac410we have an Extensions/Archived web for that purpose, [15:04]
MichaelDaummemic_, no not ootb
memic_, have a try creating a new ExifPlugin ... based on https://metacpan.org/pod/Image::ExifTool maybe
%EXIF{"image.jpeg" topic="some.topic" format="Exposure=$exposure, Aperture=$aperture, ..."}%
[15:05]
gac410JulianLevens: MichaelDaum: I tested the Item14219 css - Added the two *SET statement to my Main.GeorgeClark profile. Works nicely, but the css of the button is pretty ugly and needs some "help" .. probably beyond me. [15:08]
memic_is there any how to start writing a plugin site? [15:08]
gac410Foswiki:Development.DevelopersBible [15:09]
FoswikiBothttps://foswiki.org/Development.DevelopersBible [ DevelopersBible ] [15:09]
gac410memic_: Firefox has an exif viewer extension ... There are also javascript solutions to grab /display exif data from the image.
(I have not tried either of them)
[15:11]
memic_ok [15:12]
gac410I guess one thing you need to know memic_ is the purpose of the info. Images can be displayed inline in a topic, but can also be directly downloaded from the /pub/... URL.
If you want the copyright to "follow" your image regardless of how downloaded, then getting it into the exif is most important.
[15:13]
memic_gac410, yes [15:14]
gac410Then an %EXIF% plugin/macro could display it in the page, or js or ff, or some other tool could display it for the image. [15:14]
memic_still investigating requirements
i think most important is that this is easy to use
add metadata while uploading
in a form with some extra field
[15:15]
gac410memic_: Image::ExifTool in addition to the perl access, has a command line tool for manipulating the exif data.
exiftool someimage.jpg -copyright="the copyright data" sets the data just fine.
So an %EXIF% macro for retrieving that sounds quite simple to do. But setting it during upload is a bit more difficult
Blindly setting it is probably not good - say a user uploads an image that already has a copyright. Overwriting it would not be good.
[15:30]
memic_yes
so i would need some logic after uploding
[15:37]
...... (idle for 26mn)
stefan_slightcan someone point me to where the 'patternWebIndicator' is generated?
is this hardcoded in some file or is it also in some Wiki Topic?
[16:04]
gac410Look like it's in the skin templates. [16:05]
stefan_slight(i would like to try out some different styles/layouts for the text in it..)
hm ok -
[16:05]
JulianLevensPatternSkinCss [16:05]
stefan_slightthan i have to learn more about this template things.. [16:05]
gac410templates/viewsidebar.pattern.tmpl
gac410 just reporting results of a grep
[16:06]
stefan_slightthat looks fine.. thanks! [16:08]
gac410generally to change a template, you copy the part you want to modify to a new file ... like viewsidebar.myskin.tmp. Have that file include viewsidebar, and then override the skin with SKIN = myskin,natedit,pattern [16:09]
stefan_slightok that worked - if i only want to overwrite one part of the original tmpl i only have to do this or? the missing things in my tmpl will be searched for in the 'parrent skin'? [16:15]
gac410As long as you TMPL:INCLUDE the template first, and then override just the template you want to change.
For ex. view.pattern.tmpl first line is %TMPL:INCLUDE{"view"}%
Which knows not to recursively include itself. It uses the template search order.
There are a few other tricks to know as well. There is a TMPL:PREV. Say you want to override a template, but only under certain conditions. So you can recover the original defin with TMPL:PREV or something like that.
[16:16]
stefan_slightah ok -
so for the viewsidebar.myskin.tmp i need %TMPL:INCLUDE{"viewsidebar"}% ?
[16:24]
gac410Yes I think so. [16:25]
stefan_slightok i try [16:25]
gac410The only time you would not need an include is if you plan to completely duplicate the template you are modifying.
But that generally makes upgrades harder. Try to modify as little as possible. Less to fit after an upgrade then.
Another area that can be very tricky with templates is trailing white space. It can cause content after the </html> ending tag.
That explains some of the %{template comments}% here and there. Comments eat the trailing newline.
If you turn on FOSWIKI_ASSERTS in bin/LocalLib.cfg, you will get an ASSERT if your template changes added cruft after </html>
Used to be a real pain - find an editor that could delete the final newline in a template file. Easier to just add a %{comment}% at the end
[16:26]
.......... (idle for 46mn)
***JulianLevens has left
zak256 has left
[17:17]
.... (idle for 17mn)
GuilainC_away is now known as GuilainC [17:38]
............... (idle for 1h10mn)
stefan_slightgac410: hm - thats really a problem - my editor defaults to add a trailing newline on save....
i mean - it checks if the last line is a empty one - and if not it adds one... seems thats 100% against the needed behaviour..
[18:48]
........................ (idle for 1h56mn)
gac410stefan_slight: (sorry I was away ... and leaving again shortly) Just add a %{comment}% at the end of the last line. That will "eat" the newline when the template is processed. [20:46]
.... (idle for 15mn)
***GuilainC is now known as GuilainC_away [21:01]

↑back Search ←Prev date Next date→ Show only urls(Click on time to select a line by its url)