Enable transclusion of javascript and visual basic script files

The embedding of javascript and visual basic script attachments with ParserMarket/JavaScript and ParserMarket/VisualBasic is not working as the their mime types are not resolved properly: .js files are identified as application/x-javascript and .vbs files are identified returns none mime type. This behaviour was tested on Windows XP with Moin 1.8 and Python 2.5.

The following patch must be applied to wikiutil.py in order to resolve this:

   1 @@ -934,6 +934,7 @@
   2   '.py': 'text/x-python',
   3   '.cfg': 'text/plain',
   4   '.conf': 'text/plain',
   5 + '.vbs': 'text/visualbasic',
   6  }
   7  [mimetypes.add_type(mimetype, ext, True) for ext, mimetype in MIMETYPES_MORE.items()]
   8  
   9 @@ -943,6 +944,7 @@
  10      ('application', 'x-latex'): ('text', 'latex'),
  11      ('application', 'x-tex'): ('text', 'tex'),
  12      ('application', 'javascript'): ('text', 'javascript'),
  13 +    ('application', 'x-javascript'): ('text', 'javascript'),
  14  }
  15  
  16  MIMETYPES_spoil_mapping = {} # inverse mapping of above
wikiutil.patch

That is strange, where does windows store mimetype definitions?


CategoryFeatureRequest

MoinMoin: FeatureRequests/EnableTransclusionOfJavascriptAndVisualBasicScript (last edited 2009-09-05 22:24:27 by ReimarBauer)