owncloud/core — pull request #462 by eMerzh (2012-11-15 23:42:21+00:00)
Title: Add a Build Url function in OC to avoid quirck url constructions

In owncloud JS,
we have a lot of quircky constructed url...
having to encode every param is boring an fault prone...
sometimes you forget to do it, sometimes you do it twice....
let's add a util function that use the current filePath option and add a data paramter...

the function also test for the ? or & to concatenate the data:

just use it as

``` js

window.location = OC.buildUrl('files', 'ajax', 'download.php', {file: filename, dir: $('#dir').val()} );

OC.buildUrl('core', 'ajax', 'vcategories/edit.php', {type: type });
```

instead of

```
window.location = OC.filePath('files', 'ajax', 'download.php') + '?files=' + encodeURIComponent(filename) + '&dir=' + encodeURIComponent($('#dir').val());

//unescape
OC.filePath('core', 'ajax', 'vcategories/edit.php') + '?type=' + type
```

What do you guys think about this...?