Permalink
Browse files

- 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
  • Loading branch information...
1 parent d1c31b1 commit a63d9eb0d4aff559e31507083b30e5e479a9f869 @taoeffect committed Nov 16, 2009
View
@@ -2,6 +2,10 @@ Version 0.51
* added redirection script when running the built-in newLISP server
* changed recommendations to run ./newlispServer
+ * added newlispServerWin.bat file provided by m35
+ * support for PHP-like multi-params by appending [] to the var name
+ * added documentation for $GET/$POST/$FILES and multiparams to guide
+ * updated the RSS feed on the example-site for 0.50
Version 0.50
View
@@ -4,10 +4,7 @@ Congratulations on choosing Dragonfly!
./newlispServer
-If you're on Windows open that file and run the command that's
-inside of it manually instead, i.e.:
-
- newlisp dragonfly-framework/newlisp-redirection.lsp -http -d 8080 -w .
+On Windows double-click on 'newlispServerWin' instead.
Open Your browser and visit http://localhost:8080/ - have FUN!
View
@@ -24,9 +24,7 @@ the 'example-site' directory, or whatever contains your
./newlispServer
-Or, if you're on Windows:
-
- newlisp dragonfly-framework/newlisp-redirection.lsp -http -d 8080 -w .
+On Windows double-click on 'newlispServerWin' instead.
+=================+
APACHE AS SERVER
@@ -77,7 +77,7 @@
(define (parse-query query)
(when (starts-with query "?") (pop query))
(push "&" query)
- (find-all REGEX_QUERY query (list $1 (url-decode $2)) 0x10000)
+ (find-all REGEX_QUERY query (list (url-decode $1) (url-decode $2)) 0x10000)
)
(define (regex-captcha regex-str str (options 0) (captcha 1))
@@ -115,13 +115,24 @@
)
)
+(define (add-keyvalue-to-ctx key value ctx)
+ ; support PHP-like multi-params
+ (if (ends-with key "[]")
+ (if (list? (ctx key))
+ (push value (ctx key) -1)
+ (ctx key (list value))
+ )
+ (ctx key value)
+ )
+)
+
;===============================================================================
; !$GET
;===============================================================================
(when QUERY_STRING
(dolist (pair (parse-query QUERY_STRING))
- ($GET (first pair) (last pair))
+ (add-keyvalue-to-ctx (first pair) (last pair) $GET)
)
)
@@ -137,7 +148,7 @@
(handle-multipart-data)
(and (read-buffer (device) temp MAX_POST_LENGTH) temp)
(dolist (pair (parse-query temp))
- ($POST (first pair) (last pair))
+ (add-keyvalue-to-ctx (first pair) (last pair) $POST)
)
)
;)
@@ -122,7 +122,7 @@
;; <p>Writes a title including the current navigation entry.</p>
;;
(define (title websitename)
- (print (string (title-case (replace "_" (copy viewname) " ")) " " websitename ))
+ (println (string (title-case (replace "_" (copy viewname) " ")) " " websitename ))
)
;; @syntax (Dragonfly:css <css-media> <css-location>)
@@ -131,7 +131,7 @@
;; <p>Writes a standard stylesheet HTML tag.</p>
;;
(define (css css-media css-location)
- (print "<link rel='stylesheet' type='text/css' media='"css-media"' href='"css-location"' />")
+ (println "<link rel='stylesheet' type='text/css' media='"css-media"' href='"css-location"' />")
)
;; @syntax (Dragonfly:meta <meta-name> <meta-content>)
@@ -140,7 +140,7 @@
;; <p>Writes a standard meta HTML tag.</p>
;;
(define (meta meta-name meta-content)
- (print "<meta name='"meta-name"' content='"meta-content"' />")
+ (println "<meta name='"meta-name"' content='"meta-content"' />")
)
;; @syntax (Dragonfly:rss <rss-title> <rss-location>)
@@ -149,15 +149,15 @@
;; <p>Writes a standard RSS HTML tag.</p>
;;
(define (rss rss-title rss-location)
- (print "<link rel='alternate' type='application/rss+xml' title='"rss-title"' href='"rss-location"' />")
+ (println "<link rel='alternate' type='application/rss+xml' title='"rss-title"' href='"rss-location"' />")
)
;; @syntax (Dragonfly:script <script-location>)
;; @param <script-location> a string containing the script location
;; <p>Writes a standard script HTML tag.</p>
;;
(define (script script-location)
- (print "<script type='text/javascript' src='"script-location"'></script>")
+ (println "<script type='text/javascript' src='"script-location"'></script>")
)
;; @syntax (Dragonfly:autoload-css css-media css-screen css-iphone)
@@ -236,7 +236,7 @@
;; <p>Writes a standard HTML image.</p>
;;
(define (image image-name image-url, image-options)
- (print "<img src='"image-url"' alt='"image-name"' title='"image-name"' border='0' "image-options" />")
+ (println "<img src='"image-url"' alt='"image-name"' title='"image-name"' border='0' "image-options" />")
)
@@ -123,9 +123,8 @@ body img {
#content div.resultbox {
padding:10px;
- border:1px solid #DDD;
+ border:1px solid #CCC;
margin-top: 10px;
- background-color: #EEE;
}
#content div#demo-error {
Oops, something went wrong.
@@ -0,0 +1,14 @@
+@ECHO OFF
+SET NEWLISP_REDIRECTION=.\dragonfly-framework\newlisp-redirection.lsp
+
+IF NOT EXIST "%NEWLISP_REDIRECTION%" GOTO NOFILE
+
+ECHO If all goes well visit http://localhost:8080 in your browser
+newlisp "%NEWLISP_REDIRECTION%" -http -d 8080 -w . %*
+
+GOTO END
+
+:NOFILE
+ECHO ERROR: cannot find file: %NEWLISP_REDIRECTION%
+
+:END
@@ -1,41 +0,0 @@
-<% (display-partial "doctype") %>
-<head>
- <% (display-partial "header") %>
-</head>
-
-<body>
-
-<div id="wrap">
- <div id="header">
- <% (display-partial "navigation") %>
- <div class="clear"></div>
- </div>
-
- <div id="content">
-
- <div class="title nomargin">
- <p><% (title "| runDragonfly.com") %><p>
- </div>
-
- <% (load-database "blog.nldb") %>
- <% (set 'data (nldb:select-rows 'entries true true 'ID > )) %>
- <%
-
- (dolist (element data)
- (print "<h3>"(element 1)"</h3>")
- (print "<p class='author'>"(element 2)" | "(element 4)"</p>")
- (print "<p>"(element 3)"</p>")
- )
- %>
-
- <div class="line-dotted"></div>
-
- <% (benchmark-result) %>
-
- <div class="line-dotted"></div>
-
-
- </div><!-- END CONTENT -->
-
-</div><!-- END WRAP -->
-<% (display-partial "footer") %>
@@ -5,5 +5,5 @@
(css "screen" (web-root "includes/css/screen.css"))
(script (web-root "includes/js/jquery-1.3.2.min.js"))
(script (web-root "includes/js/dragonfly.js"))
-(rss "Dragonfly web framework RSS Feed" (web-root "?dragonfly_rssfeed/xml"))
+(rss "Dragonfly web framework RSS Feed" (web-root "dragonfly_rssfeed"))
%>
@@ -17,6 +17,9 @@
<dd><% (link_to "Creating templates and views" "dragonfly_templates") %></dd>
<dd><% (link_to "Handling errors using templates" "dragonfly_errors") %></dd>
+ <dt>Parameters and forms</dt>
+ <dd><% (link_to "$GET, $POST, $FILES..." "dragonfly_getpost") %></dd>
+
<dt>Plugins</dt>
<dd><% (link_to "Using and creating plugins" "dragonfly_plugins") %></dd>
<dd><% (link_to "List of included plugins" "dragonfly_builtin_plugins") %></dd>

0 comments on commit a63d9eb

Please sign in to comment.