Version 1.2 - file uploading, "autocomplete on property", etc.

9 views
Skip to first unread message

Yaron Koren

unread,
May 28, 2008, 10:57:31 AM5/28/08
to semanti...@googlegroups.com
Hi everyone,

Version 1.2 of Semantic Forms has been released. This is a fairly big version: by far the most important change is that form-based file uploading is now possible. All you have to do is add the new parameter "uploadable" to a field declaration within a form definition, and in the form, a link named "Upload file" (in the user's language) will appear next to the entry. This link will pop up a "lightbox"-style window that lets the user upload a file, and then, when they're done, automatically inserts the name of that file into the text entry. You can see a demo here, in my nonsense testing form:

http://discoursedb.org/wiki/Special:AddData/Fields_test/Some_new_page

Click on "Upload file" near the "Image" field (feel free to upload an image, if you want to). This feature uses the fantastic open-source Floatbox Javascript library, written by Byron McGregor, which handles all of the popup functionality. I also have to give a big thanks to the development team at Chickipedia, who came up with both the concept and implementation for how file upload could work in SF; I'm essentially just using their PHP code. While I'm giving thanks, I should note both of the predecessors to the Floatbox library: Lightbox, created by Lokesh Dhakar, and Lytebox, created by Markus F. Hay; my understanding is that Floatbox couldn't have been created without the important contributions of these two previous libraries.

And, actually, the thanks wouldn't be complete if I didn't thank all of you on this list who have been whining about this feature for nearly a year now. If it hadn't been for the frequent questions and complaints, I don't think I ever would have been motivated enough to look into file uploading through forms; I didn't even really think it was possible in the first place. And now that it's here, I have to admit that I really like the feature - it's brought Semantic Forms a big step closer to being the sought-after complete solution. So, keep up the good work. :)

Other changes and additions in this version:

- There's a new parser function: 'arraymaptemplate'. This is very similar to the existing 'arraymap' function, which does a mapping onto a delimited string; except that, instead of the mapping being defined right in the function call, this function takes in a template, and applies that template onto each value in the string. It's intended for mappings that are more complex or involved than can be done in 'arraymap'. See the documentation for how exactly it's called. Thanks to Sergey Chernyshev for this new parser function.

- There were also some minor improvements made to handling of the 'arraymap' function; thanks again to Sergey for that.

- A fix was made in the handling of timestamps, so that trying to save a page that was modified by someone else after the user started editing with a form now leads to a warning message.

- Another new parameter for fields has been added: "autocomplete on property=". This lets you set autocompletion to use a different semantic property than the one the field is attached to (or set a new one, if the field doesn't correspond to a semantic property).

- Also, the parameter "autocomplete on=" has been renamed to "autocomplete on category=", for consistency with "autocomplete on namespace=" and the new "autocomplete on property=". "autocomplete on=" will still work, for backwards compatibility.

- Similarly, disabling autocompletion for a field, which before was done by adding "autocomplete on=" with a blank value, is now done through another new parameter, "no autocomplete". Again, the old version will still work, for backwards compatibility.

- The parameter "maxlength=" has also been added for fields; it sets the "maxlength" HTML property for text inputs.

- Finally, language support was added for Ripuarian.

-Yaron

robertuva

unread,
May 28, 2008, 12:16:55 PM5/28/08
to Semantic Forms
Yaron,

Great update and thanks so much! One question - this follows the
capabilities of the "Main Image" functionality on chickipedia. They
also have the ability to upload an image that adds that image onto the
string of images separated by comma. This is their "Insert Images" or
"Free Image Text" area. Is there support for that in this release, or
is it the "Main Image" (or single image upload) functionality only?

Thanks again - this is great stuff!

Bobby

張致信 Michael Chang

unread,
May 28, 2008, 12:21:09 PM5/28/08
to semanti...@googlegroups.com
Hi Yaron and everybody.
It's really a good news to see that file uploading kit has been developed. I have another problem.
Could it possible to define the value of "Destination filename:" field in the "lightbox"-style window by collecting two or more fields in it's mother form. for example.
In the form, there are three fields like following:
Date=2008-05-29   (Maybe the "2008-05-29" is filled by autocomplete or other things)
Name=Michael
Imageformat=png
Than, I can get the Destination filename=MichaelChange.png
Thanks!
Michael

2008/5/28 Yaron Koren <yar...@gmail.com>:

張致信 Michael Chang

unread,
May 28, 2008, 12:22:43 PM5/28/08
to semanti...@googlegroups.com
Hi Yaron and everybody.
It's really a good news to see that file uploading kit has been developed. I have another problem.
Could it possible to define the value of "Destination filename:" field in the "lightbox"-style window by collecting two or more fields in it's mother form. for example.
In the form, there are three fields like following:
Date=2008-05-29   (Maybe the "2008-05-29" is filled by autocomplete or other things)
Name=Michael
Imageformat=png
Than, I can get the Destination filename=2008-05-29MichaelChange.png

張致信 Michael Chang

unread,
May 28, 2008, 12:25:04 PM5/28/08
to semanti...@googlegroups.com
Hi Yaron and everybody.
It's really a good news to see that file uploading kit has been developed. I have another problem.
Could it possible to define the value of "Destination filename:" field in the "lightbox"-style window by collecting two or more fields in it's mother form. for example.
In the form, there are three fields like following:
Date=2008-05-29   (Maybe the "2008-05-29" is filled by autocomplete or other things)
Name=Michael Chang
Imageformat=png
Than, I can get the Destination filename=2008-05-29Michael Chang.png
Thanks!
Michael

 

Mike

unread,
May 28, 2008, 12:28:27 PM5/28/08
to Semantic Forms

Nice update, thanks a lot!

Yaron Koren

unread,
May 28, 2008, 12:35:13 PM5/28/08
to semanti...@googlegroups.com
Hi,

Cool, I'm glad it's working for other people.

Bobby - no, it only supports setting the file name inside a specific form field. In theory, it would be possible to make an "add file name to free text" feature, though it would be more work, and I figured that most other wikis wouldn't need it as much as Chickipedia does, since few are as image-based.

Michael - I guess what you're asking about is defaulting the name of the image being uploaded. That could be a nice feature, and it might be possible, though I think it would be technically tricky to do, and it would probably involve creating another mini-language, like the one that automatic-page-name setting uses.

-Yaron

Guoqian Jiang

unread,
May 28, 2008, 2:21:12 PM5/28/08
to semanti...@googlegroups.com
Hi,
 
This is a very nice feature.
 
I just tested the upload feature and found that it works well in Firefox but not for IE. In IE, clicking link "Upload file", it does not show pop-up window, instead it goes to a special page index.php?title=Special:UploadWindow&wpInputID=input_43, although my IE browser works well for your testing form.
 
Am I missing something?
 
Thanks,
 
-Guoqian





Date: Wed, 28 May 2008 10:57:31 -0400
From: yar...@gmail.com
To: semanti...@googlegroups.com
Subject: [Semantic Forms] Version 1.2 - file uploading, "autocomplete on property", etc.

Sergey Chernyshev

unread,
May 28, 2008, 2:23:23 PM5/28/08
to semanti...@googlegroups.com
Yaron,

Thanks a lot for this release! Image uploading was one of the most wanted features by non-technical users of our wikis ;) We'll keep bugging you about features we need and hopefully will be more helpful with patches.

Please, do the release tag in SVN - this will help debugging stuff much easier. Now is probably good time for that. BTW, since you already keep dates of releases, it might make sense to do tagging for previous releases as well (at least previous one).

       Sergey

Yaron Koren

unread,
May 28, 2008, 2:54:06 PM5/28/08
to semanti...@googlegroups.com
Oh no, IE problems... the dread of every web programmer. :)

I've actually seen something like this a few times during testing, so my guess is that it's just a matter of IE being cached and not loading the Javascript. Can you try launching a new window in IE, going to the same URL, and seeing if that works?

-Yaron

dominik rodler

unread,
May 29, 2008, 2:30:06 AM5/29/08
to semanti...@googlegroups.com

Brilliant work!

Thank you so much for the upload feature and the arraymaptemplate and all
the rest.

cheers
Dominik

--
View this message in context: http://www.nabble.com/Version-1.2---file-uploading%2C-%22autocomplete-on-property%22%2C-etc.-tp17514673p17528453.html
Sent from the Semantic Forms mailing list archive at Nabble.com.

Reply all
Reply to author
Forward
0 new messages