Commit 63fd5a1d authored by Dave Cooper's avatar Dave Cooper
Browse files

Now toggling some sections based on js-to-eval -- still have to synchronize...

Now toggling some sections based on js-to-eval -- still have to synchronize this with underlying model so that page refresh will retain current state.
parent eb88c1d3
......@@ -9,6 +9,8 @@
(lang (the language choice value))
(right-section-inner-html (the current-right-section right-section-inner-html))
(right-section-js-to-eval (the current-right-section right-section-js-to-eval))
(right-section-js-always-to-eval (the current-right-section right-section-js-to-eval))
(link-title "Home")
......
......@@ -5,6 +5,9 @@
:computed-slots
((link-title "Configurator")
(right-section-js-to-eval "$j('#all-go').hide(200);$j('#product-image').show(200);")
(right-section-inner-html (with-cl-who-string ()
((:a :name "Top"))
(:h1 "Configure Your Weapon: $" (fmt "~:d" (ceiling (the current-price))))
......
......@@ -69,6 +69,7 @@
(discount-func #'(lambda(price key)
(ecase key
(:none price)
(:sbcl price)
(:acl-32 (* (the acl-uplift) price))
(:acl-64 (* (the acl-uplift) price))
(:lw-32-base (* (the lw-uplift) price))
......
......@@ -10,6 +10,8 @@
((title "Genworks International - Contact Us")
(link-title "Contact us")
(right-section-js-to-eval "$j('#tickete').hide(200);$j('#address').show(200);")
(right-section-inner-html
(with-cl-who-string ()
(:h2 "Contact Genworks") ((:div :id "contact"))
......
......@@ -3,8 +3,10 @@
(define-object product-licensing (base-site-sheet)
:computed-slots
((title "Genworks International - Product Descriptions")
(link-title "Descriptions")
((title "Genworks International - Product Licensing")
(link-title "Licensing")
(right-section-js-to-eval "$j('#all-go').hide(200);$j('#product-image').show(200);")
(right-section-inner-html
(with-cl-who-string ()
......
......@@ -26,6 +26,18 @@ Generative Programming, Dynamic Languages, 3D Geometry, NURBS, Solid Modeling, D
(:script "
$j = jQuery.noConflict();
function show_x3dom ()
{
/* var x3d_element;
x3d_element = document.getElementById('the_element');
x3d_element.style.width = \"526px\";
x3d_element.style.height = \"420px\"; */
$j(\"all-go\").show();
alert('hey now - shown');
}
$j(document).ready(function() {
var canvas;
var gl, experimental;
......@@ -76,7 +88,7 @@ Generative Programming, Dynamic Languages, 3D Geometry, NURBS, Solid Modeling, D
$j(\"#all-go\").show();
}
});
});
")))
......@@ -90,29 +102,30 @@ Generative Programming, Dynamic Languages, 3D Geometry, NURBS, Solid Modeling, D
(the right-section)
(the footer-section)))
(length 420)
(length 444)
(width 526)
(background-color :silver )
(background-color :silver)
(main-sheet-body
(with-cl-who-string ()
((:canvas :id "x3dom-logo" :style "display:none"))
((:div :id "wrapper")
((:div :id "header-nobg")
((:div :id "header-nobg")
((:div :id "no-webgl-no-flash" :class "header-nobg" :style "display:none;")
(str (the vector-graphics)))
((:div :id "all-go" :class "header-nobg" :style "display:none;")
(the write-embedded-x3dom-world))
#+nil
((:div :id "all-go" :class "product-image" :style "display:none;")
(:img :src "/newsite-static/images/Gendl-dave-low-521.png" )))
((:div :id "all-go" :class "header-nobg" :style "display:none;")
(the write-embedded-x3dom-world))
((:div :id "product-image" :class "product-image" :style "display:none;")
(:img :src "/newsite-static/images/Gendl-dave-low-521.png" )))
((:div :id "left")
((:div :id "logo") (if *developing?* (str (the development-links))
(htm (:H1 "Genworks International"))))
(str (the nav-section main-div))
(str (the news-section main-div))
(str (the support-section main-div)))
......@@ -123,6 +136,8 @@ Generative Programming, Dynamic Languages, 3D Geometry, NURBS, Solid Modeling, D
(right-section-inner-html (with-cl-who-string ()
(:h2 "Empty Template")))
(right-section-js-to-eval "$j('#product-image').hide(200); $j('#all-go').show(200); $j('#address').hide(200); $j('#tickete').show(200);")
(link-title (the strings-for-display))
......@@ -151,27 +166,33 @@ Generative Programming, Dynamic Languages, 3D Geometry, NURBS, Solid Modeling, D
:hidden-objects
((nav-section :type 'sheet-section
:dom-id "nav"
:inner-html (with-cl-who-string ()
(:ul (dolist (page (the pages))
(htm (:li ((:span :class (format nil "clickable~a" (if (eql (the current-right-section) page) " selected" ""))
:onclick (the (gdl-ajax-call :function-key (if (the-object page child-pages)
:toggle-children!
:set-right-section-rp!)
:arguments (list page))))
(str (the-object page link-title)))
;;
;; FLAG - make this recursive
;;
(when (the-object page show-child-links?)
(htm (dolist (child (the-object page children))
(htm (:li ((:span :class (format nil "clickable submenu~a" (if (eql (the current-right-section) child) " selected" ""))
:onclick (the (gdl-ajax-call :function-key (if (the-object child child-pages)
:toggle-children!
:set-right-section-rp!)
:arguments (list child))))
"  " (str (the-object child link-title))))))))))))))
((nav-section
:type 'sheet-section
:dom-id "nav"
:inner-html
(with-cl-who-string ()
(:ul (dolist (page (the pages))
(htm (:li ((:span :class (format nil "clickable~a"
(if (eql (the current-right-section) page) " selected" ""))
:onclick (the (gdl-ajax-call :function-key (if (the-object page child-pages)
:toggle-children!
:set-right-section-rp!)
:arguments (list page))))
(str (the-object page link-title)))
;;
;; FLAG - make this recursive
;;
(when (the-object page show-child-links?)
(htm (dolist (child (the-object page children))
(htm (:li ((:span :class
(format nil "clickable submenu~a"
(if (eql (the current-right-section) child) " selected" ""))
:onclick (the (gdl-ajax-call
:function-key (if (the-object child child-pages)
:toggle-children!
:set-right-section-rp!)
:arguments (list child))))
"  " (str (the-object child link-title))))))))))))))
(news-section :type 'sheet-section
:dom-id "news"
......@@ -193,23 +214,22 @@ Generative Programming, Dynamic Languages, 3D Geometry, NURBS, Solid Modeling, D
(htm ((:p :class "more")
((:a :href (the (relative-url-to (the news url)))) "more...")))))))
(support-section :type 'sheet-section
:dom-id "support"
:inner-html (with-cl-who-string ()
((:div :class "support")
(:img :src "/newsite-static/images/support.jpg"))
#+nil
(:ul
(:li (:h3 ((:a :href "http://dl.dropbox.com/u/19667598/static/documents/gdl-documentation.pdf" :target "_fresh")
"Prototype GenDL Manual")))
(:li (:h3 ((:a :href "/yadd" :target "_fresh")
"Live Reference Docs (YADD)"))))))
(support-section
:type 'sheet-section
:dom-id "support"
:inner-html (with-cl-who-string ()
((:div :id "tickete" :class "support" :style "display:block")
(:img :src "/newsite-static/images/support.jpg"))
((:div :id "address" :class "support" :style "display:none")
"255 E Brown Street, Suite 310" :br
"Birmingham, MI 48009 USA" :br
"+1 248-327-3253" :br
"info@genworks.com")))
(right-section :type 'sheet-section
:dom-id "right"
:js-to-eval (the right-section-js-to-eval)
:js-always-to-eval (the right-section-js-to-eval)
:inner-html (the right-section-inner-html))
(footer-section :type 'sheet-section
......
......@@ -5,6 +5,8 @@
:computed-slots
((title "Genworks International - Product Descriptions")
(link-title "Descriptions")
(right-section-js-to-eval "$j('#all-go').hide(200);$j('#product-image').show(200);")
(right-section-inner-html
(with-cl-who-string ()
......
......@@ -66,12 +66,22 @@ body {
}
.header-nobg {
position: absolute;
top: -1px;
left: 0px;
width: 526px;
height: 420px;
}
.product-image {
/*background: url(../images/Gendl-dave-low-521.png) no-repeat;*/
padding-top: 10px;
padding-left: 2px;
width: 535px;
height: 420px;
}
#header-people {
......@@ -213,7 +223,6 @@ body {
/* padding: 3px;*/
height: 97px;
width: 243px;
color: #0000FF;
}
#support a {color: blue;}
......
......@@ -340,6 +340,33 @@ to call the :write-embedded-x3d-world function."))
(the :view-object :height) :align :center :valign :center)
(:big (:b "No Graphics Object Specified")))))))
(t
(with-cl-who ()
(:p
((:|X3D| :id "the_element"
:swfpath "/static/3rdpty/x3dom/x3dom.swf"
:width "100%"
:height "100%"
;;:width (the view-object page-width)
;;:height (the view-object page-length)
)
(:|Scene|
(with-format (x3d *stream*) (write-the view-object cad-output)))))
((:script :type "text/javascript"
:src "/static/3rdpty/x3dom/x3dom.js" :id "xdom_script"))
(when (the x3dom-view-controls?)
(htm (:tr (:td ((:span :style "color: blue; cursor: pointer;"
:onclick "document.getElementById('the_element').runtime.showAll();")
"Show All")))))))
#+nil
(with-cl-who ()
((:table :cellspacing 0 :cellpadding 0)
(:tr
......@@ -359,7 +386,9 @@ to call the :write-embedded-x3d-world function."))
(when (the x3dom-view-controls?)
(htm (:tr (:td ((:span :style "color: blue; cursor: pointer;"
:onclick "document.getElementById('the_element').runtime.showAll();")
"Show All")))))))))))
"Show All")))))))
)))
(web3d-graphics
()
......
......@@ -123,7 +123,6 @@
(let ((timeout? nil))
(multiple-value-bind (string error backtrace)
(ignore-errors-with-backtrace
(the-object section inner-html))
(cond ((typep error 'error)
(with-output-to-string(ss)
......@@ -138,15 +137,23 @@
You can reload to get previous state" *ajax-timeout*))
(:pre (esc backtrace)))))
(t string))))
(multiple-value-bind (string error)
(ignore-errors (the-object section js-to-eval))
(if (typep error 'error)
(with-output-to-string(ss)
(with-html-output(ss)
(:i (fmt "alert('This section threw error: ~a !!');" error))))
(or string (the-object section js-always-to-eval) ""))))
replace-list))))
(if t ;;(eql js-status :unbound)
(multiple-value-bind (string error)
(ignore-errors (the-object section js-to-eval))
(if (typep error 'error)
(with-output-to-string(ss)
(with-html-output(ss)
(:i (fmt "alert('This section threw error: ~a !!');" error))))
(or string (the-object section js-always-to-eval) "")))
""))
replace-list)))
(when *debug?* (print-variables (the-object section js-always-to-eval)))
)
(when *debug?* (print-variables replace-list))
......@@ -160,9 +167,10 @@ You can reload to get previous state" *ajax-timeout*))
(:|newHTML| (str (wrap-cdata (if security-ok?
(second replace-pair)
"<i>Security Error</i>"))))
(:|jsToEval| (str (wrap-cdata (if security-ok?
(third replace-pair)
""))))))))))))))
(:|jsToEval| (when (third replace-pair)
(str (wrap-cdata (if security-ok?
(third replace-pair)
"")))))))))))))))
(defun remove-html-sections (sections string)
(remove-substrings string (mapsend sections :main-div)))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment