Skip to content
Permalink
Browse files

Added support for server side processing of javascript files (use .qj…

…s for file extension)
  • Loading branch information
dblain committed Mar 26, 2011
1 parent 8b6f1fb commit b706fb907ec3892fecf825604f33c61dc34a826e
@@ -6,7 +6,7 @@
<link rel="stylesheet" href="/css/site.css" type="text/css">
<link rel="icon" href="/images/favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon">
<script language="JavaScript" type="text/javascript" src="/js/util.js"></script>
<script language="JavaScript" type="text/javascript" src="/js/util.qjs"></script>
<script language="JavaScript" type="text/javascript" src="/js/jquery.min.js"></script>


@@ -1,6 +1,9 @@
var gHostName = "";
<% var myth = new Myth(); %>

var gHostName = "<%= myth.GetHostName() %>";

function getHostName() {
/*
if (gHostName.length == 0) {
$.ajaxSetup({ async: false });
$.post("/Myth/GetHostName",
@@ -11,7 +14,7 @@ function getHostName() {
});
$.ajaxSetup({ async: true });
}

*/
return gHostName;
}

@@ -103,7 +103,10 @@ bool HtmlServerExtension::ProcessRequest( HttpWorkerThread *, HTTPRequest *pRequ
// Is this a Qt Server Page (File contains script)...
// ------------------------------------------------------

if (oInfo.suffix().compare( "qsp", Qt::CaseInsensitive ) == 0)
QString sSuffix = oInfo.suffix();

if ((sSuffix.compare( "qsp", Qt::CaseInsensitive ) == 0) ||
(sSuffix.compare( "qjs", Qt::CaseInsensitive ) == 0))
{
pRequest->m_eResponseType = ResponseTypeHTML;

@@ -65,7 +65,9 @@ static MIMETypes g_MIMETypes[] =
{ "png" , "image/png" },
{ "htm" , "text/html" },
{ "html", "text/html" },
{ "js" , "text/html" },
{ "qsp" , "text/html" },
{ "js" , "application/javascript" },
{ "qjs" , "application/javascript" },
{ "txt" , "text/plain" },
{ "xml" , "text/xml" },
{ "pdf" , "application/pdf" },

0 comments on commit b706fb9

Please sign in to comment.
You can’t perform that action at this time.