Skip to content

Commit

Permalink
merge #5
Browse files Browse the repository at this point in the history
  • Loading branch information
andreacfm committed Jun 5, 2014
1 parent a17e851 commit 13213c4
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 21 deletions.
10 changes: 5 additions & 5 deletions build.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#Fri, 23 May 2014 15:25:04 +0200
build.time=15\:25\:04
build.number=578
build.date=Friday May 23, 2014
#Thu, 05 Jun 2014 13:47:01 +0200
build.time=13\:47\:01
build.number=579
build.date=Thursday Jun 05, 2014
build.authorEmail=andrea@getrailo.org
build.projectVersion=1.0.0
build.year=2014
build.timestamp=2014-05-23T15\:25\:04
build.timestamp=2014-06-05T13\:47\:01
build.author=Railo Technologies
37 changes: 22 additions & 15 deletions build/tag/railo/core/ajax/JSLoader.cfc
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
<cfcomponent>
<cfcomponent output="false">

<!---Init--->
<cffunction name="init" output="false" returntype="void">
<cfreturn this />
</cffunction>

<!---get--->
<cffunction name="get" output="false" returntype="string" returnformat="plain" access="remote">
<cfargument name="lib" type="string" required="false" default="" />
<cfset var filePath = expandPath('js/#arguments.lib#.js')/>
<cfset var local = {result=""} /><cfcontent type="text/javascript">
<cfsavecontent variable="local.result">
<cfif fileExists(filePath)>
<cfinclude template="js/#arguments.lib#.js"/>
</cfif>
</cfsavecontent>
<cfreturn local.result />
<cffunction name="get" access="remote" output="false" returntype="string" returnformat="plain">
<cfargument name="lib" type="string">

<!--- restrict to files from JS directory !--->
<cfif arguments.lib CT "..">
<cfheader statuscode="400">
<cfreturn "// 400 - Bad Request">
</cfif>

<cfset var relPath = "js/#arguments.lib#.js">

<cfif fileExists( expandPath( relPath ) )>

<cfcontent type="text/javascript">
<cfsavecontent variable="local.result"><cfinclude template="#relPath#"></cfsavecontent>
<cfreturn result>
<cfelse>

<cfheader statuscode="404">
<cfreturn "// 404 - Not Found">
</cfif>
</cffunction>


Expand Down
Loading

0 comments on commit 13213c4

Please sign in to comment.