Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace cdn urls for preview widget #34

Merged
merged 8 commits into from
May 5, 2016

Conversation

exaroth
Copy link
Contributor

@exaroth exaroth commented May 4, 2016

This PR replaces cdn links for preview - this is needed because of firefox problem with javascript workers which don't support crossdomain requests.

@@ -88,7 +88,7 @@ filepicker.extend('util', function(){
*/
var getFPUrl = function(url){
if (typeof url === 'string') {
var matched = url.match(/cdn.filestackcontent.[\S]*\/([\S]{20,})/);
var matched = url.match(/(cdn.filestackcontent.com|cdn.filepicker.io)[\S]*\/([\S]{20,})/);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dots should be escaped. Dot has meaning in regexp.

@@ -532,7 +532,7 @@ filepicker.extend('widgets', function(){
var constructPreview = function(domElement) {
var url = domElement.getAttribute('data-fp-url'),
css = domElement.getAttribute('data-fp-custom-css');

url = fp.util.getFPUrl(url);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • The ; in line 534 means that url variable is global!
  • Broken indent

@szwacz szwacz merged commit f87c417 into develop May 5, 2016
@szwacz szwacz deleted the feature/replace_cdn_urls_for_preview_widget branch August 17, 2016 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants