bash script for thumbnails creation, version: 0.2.0, posted by Emiliano Gabrielli on Wed Feb 23 11:25:51 2005
|
The following script creates a thumbnail for image/ps/pdf files.
it can be used with "Execute edit" and "Execute new" configuration commands
in order to get resized thumbs of attachments.
It uses file(1), convert(1) for images, gs(1) is also required for ps and pdf.
You have to start elogd with the "-x" option to enable execution and put
something similar to the following in you configuration elog file:
Execute new = /path/to/make_thumbs -s 650 -q 95 $attachments
Execute edit = /path/to/make_thumbs -s 100 $attachments
make_thumbs have to be executable by the user running elogd, of course.
ChangeLog:
* version 0.2.0 Fixes a BUG in PDF creation |
JavaScript list auto-refresh, posted by Emiliano Gabrielli on Fri Jul 8 17:34:02 2005
|
Here is a simple piece of JS code to accomplish a smart page reload.
We don't reload if in some kind of editing mode.
You can put the code everywhere you like in the elog html page, my suggestion is to put it in Bottom Text (or Top Text):
;auto-refresh
Bottom text = [I]<script language="JavaScript">if (null==window.location.href.match('/[0-9]+$|.*(cmd|select)=.*') ) { window.setTimeout("location.reload();", 2*60*1000); now=new Date(); document.write('<br/>Last reload at '+now.getFullYear()+'/'+(now.getMonth()+1)+'/'+now.getDate()+', '+( ((h=now.getHours())<10) ? '0'+h :h)+':'+( ((m=now.getMinutes())<10) ? '0'+m :m)+':'+( ((s=now.getSeconds())<10) ? '0'+s :s)) }</script>[/I]
the timer is a product of # of minutes, #of seconds and milliseconds... 2 minutes in the above example 
Revision Tue Jul 12 12:36:16 2005 wrote: |
modified regular expression in order to not activate the auto-refresh in the signle entry view
|
|
How to run elogd on Gentoo Linux, posted by Exaos Lee on Mon Oct 10 18:47:09 2005
|
I have created some scripts for running elogd on Gentoo Linux. Please untar the attachment and read the file "elogd_gentoo_readme". Any comment is welcomed. |
Script for running ELOGD on Ubuntu Linux, posted by Exaos Lee on Wed Jan 10 23:08:27 2007
|
I prepared one init script for ELOGD running on Ubuntu Linux.
Please see the attachment. |
Multiple file upload for Firefox, posted by Diogo Alves on Tue Jan 29 23:18:39 2008
|
Here's a firefox extension that works extremely well if one uses drag n'drop to upload several attachment files at once:
https://addons.mozilla.org/en-US/firefox/addon/219
|
/etc/init.d/elog script for Debian-like distros, posted by T. Ribbrock on Thu Nov 27 11:43:32 2008
|
The attached script was used by the Debian package (which is no longer maintained) to start/stop elogd. I have changed it based on some comments in the forum (see script) to add some more functionality. As there is no mainatined elog package for Debian anymore, I'm placing it here in the hope that it might come in handy for users who want to run elog under Debian.
This script needs to be placed in /etc/init.d and expects elogd to be installed as /usr/sbin/elogd (can be changed, of course). |
Doing mathematical calculations with attributes, posted by Stefan Ritt on Mon Jul 20 14:23:56 2009
|
Following entry was written by Richard Stamper. I moved it here for persistency:
On the matter of automatic calculation of fields, it is possible using included javascript but you have to do the work yourself. For example, we have a log which computes responsivity as the ratio of a photocurrent and optical power. With log attributes called "Photocurrent", "Optical Power" and "Responsivity" there is a file in the logbooks directory called photomixer_javascript.html containing something like:
<script>
if (document.form1.Photocurrent) {
document.form1.Photocurrent.onchange = new Function(
"mod();"+
"var power = parseFloat(document.form1.Optical_Power.value);"+
"var current = parseFloat(document.form1.Photocurrent.value);"+
"if (!isNan(power) && !isNan(current) && power != 0.0) {"+
" document.form1.Responsivity.value = Math.round(current/power*100)/100.0"+
"}"
);
document.form1.Optical_Power.onchange = document.form1.Photocurrent.onchange;
}
</script>
and the elogd.cfg file includes
Bottom text = photomixer_javascript.html
for the relevant log.
The assignments to the onchange handlers are guarded because this javascript is included on all pages for that log, including the list pages where there is no such field as Photocurrent, (or Optical_Power) and the event handler function is defined dynamically for the same reason.
|
Custom input forms implementation, posted by Stefan Ritt on Fri Sep 17 06:19:39 2010 6x
|
Dear ELOG users,
starting with SVN revision 2328, custom input forms are implemented. This allows application specific formats for check lists etc. In our specific case we had to implement a shift check list, which was quite long. Furthermore the check list should be optimized for an iPad, which we take in the field and record various checks and readings (in our case some gas pressure gauges at the PSI particle accelerator). Since the standard ELOG interface was too inflexible, a completely hand-written form was needed. The form can be activated by the new configuration options Custom New Form, Custom Edit Form and Custom Display Form, one for a new entry, an entry to edit and and entry to display. In our case we used the same form for all three cases. This is how the shift check list looks under the Safari Browser on a PC:

And here is how it looks on the iPad:

Each section can be collapsed and expanded (blue arrows at the left), and various internal checks are made before the check list can be submitted.
Implementing such forms is however more something for the advanced user, since you have to hand-write HTML with CSS and JavaScript code. It can then however be a powerful method for check lists. Please find in the attachments the elogd.cfg configuration for that logbook and the shiftcheck.html source code file. It is a bit complicated since the page is a static page, elogd just serves it from the file. This requires all the dynamic functions to be implemented inside the HTML file with JavaScript. To display an entry for example, the JavaScript loads the raw data with the "?cmd=Download" command and the populates the form fields. The collapsing and expanding is done by using CSS properties. The integrated style sheet was optimized for the rendering on an iPad. Rather large fonts were chosen so that the items can be checked easily with your finger tips. Various parameters are sent between the browser and the elogd program via hidden fields and cookies. So only something for experts! But if you go through the effort and hand-write the form, it can be very handy. Note that you have to upgrade to SVN revision 2328 for the three new options.
|
Javascript verification of simple attributes with regexp, posted by JacekK on Tue May 24 22:43:38 2011
|
Hi,
I added possibility for a new verification of required fields in generated Javascript "function chkform() ". To do this I added new logbook option "ValidPattern", in which you can set regular expression for an attribute, for example
ValidPattern HexDigits=[0-9a-fA-F]+
If there is a pattern set for required field, then in chkform() function is generated additional verification, if value of the field matches validation regexp.
Changes I made should not decrease performance of elogd. Let me know please if you can add it to regular version.
Jacek |
Re: JavaScript list auto-refresh, posted by Stefan Ritt on Tue Aug 23 12:07:51 2011
|
Emiliano Gabrielli wrote: | Here is a simple piece of JS code to accomplish a smart page reload.
We don't reload if in some kind of editing mode.
You can put the code everywhere you like in the elog html page, my suggestion is to put it in Bottom Text (or Top Text):
;auto-refresh
Bottom text = [I]<script language="JavaScript">if (null==window.location.href.match('/[0-9]+$|.*(cmd|select)=.*') ) { window.setTimeout("location.reload();", 2*60*1000); now=new Date(); document.write('<br/>Last reload at '+now.getFullYear()+'/'+(now.getMonth()+1)+'/'+now.getDate()+', '+( ((h=now.getHours())<10) ? '0'+h :h)+':'+( ((m=now.getMinutes())<10) ? '0'+m :m)+':'+( ((s=now.getSeconds())<10) ? '0'+s :s)) }</script>[/I]
the timer is a product of # of minutes, #of seconds and milliseconds... 2 minutes in the above example 
Revision Tue Jul 12 12:36:16 2005 wrote: |
modified regular expression in order to not activate the auto-refresh in the signle entry view
|
|
Starting with SVN revision 2422, there is a new config option
refresh = <seconds>
which lets you do the same thing. |