You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

29 lines
869 B

  1. /** @license
  2. * RequireJS plugin for loading files without adding the JS extension, useful for
  3. * JSONP services and any other kind of resource that already contain a file
  4. * extension or that shouldn't have one (like dynamic scripts).
  5. * Author: Miller Medeiros
  6. * Version: 0.3.1 (2011/12/07)
  7. * Released under the MIT license
  8. */
  9. define(function(){
  10. var QUERY_PARAM = 'noext';
  11. //API
  12. return {
  13. load : function(name, req, onLoad, config){
  14. req([req.toUrl(name)], function(mod){
  15. onLoad(mod);
  16. });
  17. },
  18. normalize : function(name, norm){
  19. //append query string to avoid adding .js extension
  20. //needs to be on normalize otherwise it won't work after build
  21. name += (name.indexOf('?') < 0)? '?' : '&';
  22. return name + QUERY_PARAM +'=1';
  23. }
  24. };
  25. });