Download(Multiple) feature for items, added on index page

Codereview: http://codereview.appspot.com/4810068/ [PatchSet 2]

Issues:

i)This plugin selects the link(url) to download only once(on page load), but in ours we are changing the links any time based on selection. What this plugin does is it saves all the downloadable links in a array and when download button triggers it firs the downloading, but we need to change the entry of that link array based on the selection. in a nutshell that plugin can't be configured dynamically.

So to cope from this i have added some extra things like first nullifying the download url and enabling it when the item is selected. ( but this is redundancy, as script is running unnecessary for the unselected items but with null url).

ii) I have installed the Xstatic package of this multiDownload js, and i can see it in the folders (env/lib/..), but when i include that file on index.html it is not getting loaded, do i need to do anything else after downloading/installing (rather than restarting the moin), So just to move with work i have temporarily copied that script inside static, but how could i use the xstatic package ?

reply Have you added it also in wikiconfig to mod_names?

-    mod_names = ['jquery', 'jquery_file_upload', 'ckeditor', 'svgweb', 'svgedit
_moin', 'twikidraw_moin', 'anywikidraw', 'mathjax', ]
+    mod_names = ['jquery', 'jquery_file_upload', 'ckeditor', 'svgweb', 'svgedit
_moin', 'twikidraw_moin', 'anywikidraw', 'mathjax', 'jquery_multi_download']

(You get its name from e.g. ls env/lib/python2.6/site-packages/xstatic/pkg/)

For calling

<script src="{{ url_for('serve.files', name='jquery_multi_download', filename='jquery.multiDownload.js') }}"></script>

Please add XStatic-multiDownload to setup.py

And the selection/downloading isnt working for Recently uploaded items, i will add them in a different changesets. reply ok And also currently the downloaded item contenttype is default, will set it custom(as application/moin) in coming changeset.

reply you can do this similiar to the force_attachment parameter, e.g. mimetype. see download_item

comments

It looks to me that with the current patch drag and drop uploading and also the upload button is broken for a newly created item. If I drag an image to the browser then the browser renders its source.

reply works with a new clone

MoinMoin: AkashSinha/Gsoc2011Diary/2011-08-05 (last edited 2011-08-07 07:00:30 by ReimarBauer)