Skip to content

Commit a63d9eb

Browse files
committed
- updated jquery and added some jquery effects stuff<br/>
- added multi-param stuff for $GET/$POST<br/> - added a page to the guide on said multi-param stuff<br/> - removed the blog.html file<br/> - added newlispServerWIn.bat<br/> - updated README and TROUBLESHOOTING on how to use said bat file
1 parent d1c31b1 commit a63d9eb

File tree

11 files changed

+47
-62
lines changed

11 files changed

+47
-62
lines changed

CHANGES

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ Version 0.51
22

33
* added redirection script when running the built-in newLISP server
44
* changed recommendations to run ./newlispServer
5+
* added newlispServerWin.bat file provided by m35
6+
* support for PHP-like multi-params by appending [] to the var name
7+
* added documentation for $GET/$POST/$FILES and multiparams to guide
8+
* updated the RSS feed on the example-site for 0.50
59

610
Version 0.50
711

README

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@ Congratulations on choosing Dragonfly!
44

55
./newlispServer
66

7-
If you're on Windows open that file and run the command that's
8-
inside of it manually instead, i.e.:
9-
10-
newlisp dragonfly-framework/newlisp-redirection.lsp -http -d 8080 -w .
7+
On Windows double-click on 'newlispServerWin' instead.
118

129
Open Your browser and visit http://localhost:8080/ - have FUN!
1310

TROUBLESHOOTING

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ the 'example-site' directory, or whatever contains your
2424

2525
./newlispServer
2626

27-
Or, if you're on Windows:
28-
29-
newlisp dragonfly-framework/newlisp-redirection.lsp -http -d 8080 -w .
27+
On Windows double-click on 'newlispServerWin' instead.
3028

3129
+=================+
3230
APACHE AS SERVER

example-site/dragonfly-framework/lib/request.lsp

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
(define (parse-query query)
7878
(when (starts-with query "?") (pop query))
7979
(push "&" query)
80-
(find-all REGEX_QUERY query (list $1 (url-decode $2)) 0x10000)
80+
(find-all REGEX_QUERY query (list (url-decode $1) (url-decode $2)) 0x10000)
8181
)
8282

8383
(define (regex-captcha regex-str str (options 0) (captcha 1))
@@ -115,13 +115,24 @@
115115
)
116116
)
117117

118+
(define (add-keyvalue-to-ctx key value ctx)
119+
; support PHP-like multi-params
120+
(if (ends-with key "[]")
121+
(if (list? (ctx key))
122+
(push value (ctx key) -1)
123+
(ctx key (list value))
124+
)
125+
(ctx key value)
126+
)
127+
)
128+
118129
;===============================================================================
119130
; !$GET
120131
;===============================================================================
121132

122133
(when QUERY_STRING
123134
(dolist (pair (parse-query QUERY_STRING))
124-
($GET (first pair) (last pair))
135+
(add-keyvalue-to-ctx (first pair) (last pair) $GET)
125136
)
126137
)
127138

@@ -137,7 +148,7 @@
137148
(handle-multipart-data)
138149
(and (read-buffer (device) temp MAX_POST_LENGTH) temp)
139150
(dolist (pair (parse-query temp))
140-
($POST (first pair) (last pair))
151+
(add-keyvalue-to-ctx (first pair) (last pair) $POST)
141152
)
142153
)
143154
;)

example-site/dragonfly-framework/plugins-active/dragonfly_basic.lsp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
;; <p>Writes a title including the current navigation entry.</p>
123123
;;
124124
(define (title websitename)
125-
(print (string (title-case (replace "_" (copy viewname) " ")) " " websitename ))
125+
(println (string (title-case (replace "_" (copy viewname) " ")) " " websitename ))
126126
)
127127

128128
;; @syntax (Dragonfly:css <css-media> <css-location>)
@@ -131,7 +131,7 @@
131131
;; <p>Writes a standard stylesheet HTML tag.</p>
132132
;;
133133
(define (css css-media css-location)
134-
(print "<link rel='stylesheet' type='text/css' media='"css-media"' href='"css-location"' />")
134+
(println "<link rel='stylesheet' type='text/css' media='"css-media"' href='"css-location"' />")
135135
)
136136

137137
;; @syntax (Dragonfly:meta <meta-name> <meta-content>)
@@ -140,7 +140,7 @@
140140
;; <p>Writes a standard meta HTML tag.</p>
141141
;;
142142
(define (meta meta-name meta-content)
143-
(print "<meta name='"meta-name"' content='"meta-content"' />")
143+
(println "<meta name='"meta-name"' content='"meta-content"' />")
144144
)
145145

146146
;; @syntax (Dragonfly:rss <rss-title> <rss-location>)
@@ -149,15 +149,15 @@
149149
;; <p>Writes a standard RSS HTML tag.</p>
150150
;;
151151
(define (rss rss-title rss-location)
152-
(print "<link rel='alternate' type='application/rss+xml' title='"rss-title"' href='"rss-location"' />")
152+
(println "<link rel='alternate' type='application/rss+xml' title='"rss-title"' href='"rss-location"' />")
153153
)
154154

155155
;; @syntax (Dragonfly:script <script-location>)
156156
;; @param <script-location> a string containing the script location
157157
;; <p>Writes a standard script HTML tag.</p>
158158
;;
159159
(define (script script-location)
160-
(print "<script type='text/javascript' src='"script-location"'></script>")
160+
(println "<script type='text/javascript' src='"script-location"'></script>")
161161
)
162162

163163
;; @syntax (Dragonfly:autoload-css css-media css-screen css-iphone)
@@ -236,7 +236,7 @@
236236
;; <p>Writes a standard HTML image.</p>
237237
;;
238238
(define (image image-name image-url, image-options)
239-
(print "<img src='"image-url"' alt='"image-name"' title='"image-name"' border='0' "image-options" />")
239+
(println "<img src='"image-url"' alt='"image-name"' title='"image-name"' border='0' "image-options" />")
240240
)
241241

242242

example-site/includes/css/screen.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,8 @@ body img {
123123

124124
#content div.resultbox {
125125
padding:10px;
126-
border:1px solid #DDD;
126+
border:1px solid #CCC;
127127
margin-top: 10px;
128-
background-color: #EEE;
129128
}
130129

131130
#content div#demo-error {

example-site/includes/js/jquery-1.3.2.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example-site/newlispServerWin.bat

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
@ECHO OFF
2+
SET NEWLISP_REDIRECTION=.\dragonfly-framework\newlisp-redirection.lsp
3+
4+
IF NOT EXIST "%NEWLISP_REDIRECTION%" GOTO NOFILE
5+
6+
ECHO If all goes well visit http://localhost:8080 in your browser
7+
newlisp "%NEWLISP_REDIRECTION%" -http -d 8080 -w . %*
8+
9+
GOTO END
10+
11+
:NOFILE
12+
ECHO ERROR: cannot find file: %NEWLISP_REDIRECTION%
13+
14+
:END

example-site/views/blog.html

Lines changed: 0 additions & 41 deletions
This file was deleted.

example-site/views/partials/header.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
(css "screen" (web-root "includes/css/screen.css"))
66
(script (web-root "includes/js/jquery-1.3.2.min.js"))
77
(script (web-root "includes/js/dragonfly.js"))
8-
(rss "Dragonfly web framework RSS Feed" (web-root "?dragonfly_rssfeed/xml"))
8+
(rss "Dragonfly web framework RSS Feed" (web-root "dragonfly_rssfeed"))
99
%>

example-site/views/partials/navigation.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
<dd><% (link_to "Creating templates and views" "dragonfly_templates") %></dd>
1818
<dd><% (link_to "Handling errors using templates" "dragonfly_errors") %></dd>
1919

20+
<dt>Parameters and forms</dt>
21+
<dd><% (link_to "$GET, $POST, $FILES..." "dragonfly_getpost") %></dd>
22+
2023
<dt>Plugins</dt>
2124
<dd><% (link_to "Using and creating plugins" "dragonfly_plugins") %></dd>
2225
<dd><% (link_to "List of included plugins" "dragonfly_builtin_plugins") %></dd>

0 commit comments

Comments
 (0)