On Mon, Aug 25, 2014 at 8:16 PM, Rintze Zelle <[email protected]>
wrote:
> On Fri, Aug 22, 2014 at 10:14 AM, Carles Pina <[email protected]>
> wrote:
> > a) when I copy-paste a URL and press "Enter": it seems that doesn't
> > work. It works if I use the mouse and I press on "Validate" (it
> > confused me a little bit)
> > b) would be nice to have a spinning wheel while it's doing the
> > request. I thought that nothing was happening
>
> The newest version should now start the validation when you press
> Enter in the URL field, and during validation the button should become
> inactive and show a spinning wheel.
>
> > d) would be maybe nice to be able to generate links such as
> >
> http://validator.citationstyles.org/?url=https://www.zotero.org/styles/apa&version=1.0.1
>
> Can somebody explain to me how to implement this? A pointer to a
> relevant tutorial would do. I guess we want the validator to be able
> to both generate such links, and accept them (i.e., take the
> parameters and use them to prepopulate the input selections).
>
If I understand correctly, you're trying to do all of this entirely via
HTML/CSS/JavaScript, with no server-side scripting whatsoever. In that
case, see
http://stackoverflow.com/questions/979975/how-to-get-the-value-from-url-parameter
for a general idea for accepting URL parameters. You would probably run
this on page load (then maybe even submit the form automatically). For
updating the URL, you want to use window.history.pushState/replaceState
<https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Manipulating_the_browser_history>
[1],
since that allows navigation via forward/back buttons. We do something
similar in the style repo
<https://github.com/zotero/styles-repo/blob/master/htdocs/styles-files/js/js.js#L45>
[2]
[1]
https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Manipulating_the_browser_history
[2]
https://github.com/zotero/styles-repo/blob/master/htdocs/styles-files/js/js.js#L45
> On Sat, Aug 23, 2014 at 3:22 AM, Aurimas Vinckevicius
> <[email protected]> wrote:
> > * How about having it tidy up the formatting as well? E.g. fix indents
> (both
> > amount of indenting and spaces instead of tabs), spacing before />, etc.
>
> I found http://www.eslinstructor.net/vkbeautify/, which might do the
> trick. But we probably want to pretty print the input before sending
> it to validator.nu, and I don't know how to do that for the "File
> Upload" and "URL" options.
>
File upload could be manageable if you read the file contents
<http://www.html5rocks.com/en/tutorials/file/dndfiles/> [3] before
submitting the form and then submit it as text. Unfortunately, reading
contents from links might be more problematic due to cross-origin
restrictions. You probably won't be able to do this without some sort of
server-side proxy.
[3] http://www.html5rocks.com/en/tutorials/file/dndfiles/
>
> Rintze
>
>
> ------------------------------------------------------------------------------
> Slashdot TV.
> Video for Nerds. Stuff that matters.
> http://tv.slashdot.org/
> _______________________________________________
> xbiblio-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/xbiblio-devel
>
Aurimas
------------------------------------------------------------------------------
Slashdot TV.
Video for Nerds. Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
xbiblio-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbiblio-devel