View Ticket
Not logged in
Ticket UUID: 369e246e508de6d0874ec8c400c79c6a5495b0d3
Title: Using EXTJS for JavaScript UI Framework
Status: Open Type: Feature_Request
Severity: Important Priority:
Subsystem: Resolution: Open
Last Modified: 2011-02-12 11:03:38
Version Found In: Fossil-076f7adff2
Description & Comments:
Fossil + EXTJS = Power + Beauty.

anonymous added on 2009-10-22 15:29:15:
<irony>I like jQuery..</irony>


anonymous claiming to be Dmitry Chestnykh added on 2009-10-22 16:57:06:
So, what do you propose, exactly? I don't see any feature requests here.


anonymous claiming to be Rene de Zwart added on 2009-11-02 08:42:03:
Adding an external javascript url to fossil means your cannot clone the repository anymore. Because the clone doesn't have the external javascript.


renez added on 2011-02-12 11:03:38 UTC:
I suggest to use a web page extern that will allow to load the file from the $HOME. If that fails it tries from /usr/share/fossil. I have coded an UNIX implementation. I'm not sure if and how security is compromised by this feature!

For windows some other paths need to be used/found

if I have a directory jscripts in $home and unpack tinymce there then I would code in header

html "<script type='text/javascript' src='extern/jscripts/tiny_mce/tiny_mce.js'></script>\n"

and extern is coded like:

/*
** WEBPAGE: extern
** URL: /extern/PATH
**
** if the file
**      $HOME/PATH is checked
** not exists then
**      /usr/share/fossil/PATH
** is tried.
**
** The content is returned straight without any interpretation or processing.
*/
void ext_page(void){
  const char *zName;                /* Argument to the /extern page */
  const char *zMime;                /* Document MIME type */
  Blob filebody;                    /* Content of the documentation file */
  char *zFullpath = (char *) 0;
  static const char const * zSystem = {"/usr/share/fossil"};

  login_check_credentials();
  if( !g.okRead ){ login_needed(); return; }
  zName = PD("name", "");
  while( zName[0]=='/' ){ zName++; }
  zFullpath = mprintf("%s/%s", g.zHome, zName);
  if( !file_isfile(zFullpath) ){
	  zFullpath = mprintf("%s/%s", zSystem, zName);
	  if( !file_isfile(zFullpath) ){
	    goto ext_not_found;
	  }
  }
  if( blob_read_from_file(&filebody, zFullpath)<0 ){
    goto ext_not_found;
  }
  zMime = P("mimetype");
  if( zMime==0 ){
    zMime = mimetype_from_name(zName);
  }
  cgi_set_content_type(zMime);
  cgi_set_content(&filebody);
  return;

ext_not_found:
  /* Jump here when unable to locate the document */
  style_header("External file Not Found");
  @ <p>No such external file: %s(zName) in %s(g.zHome) or %s(zSystem)</p>
  style_footer();
  return;
}