Open jpadvo opened 14 years ago
[I'm a noob. I learned about the ability to request a pull, so I did that with this code. Cheers! ]
I am building a wordpress theme, and have topup installed in a folder with this url:
http://localhost/project_name/wp-content/themes/theme_name/topup/javascripts/top_up.js
But scriptHost returns as follows:
http://localhost/images/top_up/
This can be fixed by replacing the regular expression inside scriptHost (line 15) as follows:
current: /^\w+:\/\// fixed: /.\/(?=([^\/])(\/[^\/]*)$)/
This uses a positive lookahead to trim off 'javascripts/top_up.js' or 'javascripts/top_up-min.js'.
[I'm a noob. I learned about the ability to request a pull, so I did that with this code. Cheers! ]
I am building a wordpress theme, and have topup installed in a folder with this url:
http://localhost/project_name/wp-content/themes/theme_name/topup/javascripts/top_up.js
But scriptHost returns as follows:
http://localhost/images/top_up/
This can be fixed by replacing the regular expression inside scriptHost (line 15) as follows:
current: /^\w+:\/\// fixed: /.\/(?=([^\/])(\/[^\/]*)$)/
This uses a positive lookahead to trim off 'javascripts/top_up.js' or 'javascripts/top_up-min.js'.