From 9786652aa91b8db70ded616cd548107bd50455ed Mon Sep 17 00:00:00 2001 From: Jeremy Goecks Date: Tue, 16 Mar 2010 12:00:10 -0400 Subject: [PATCH] Fixes to item embedding in pages. In particular, fixed the editor color changes that were occurring when moving the cursor through embedded items. --- static/june_2007_style/blue/embed_item.css | 16 ++++++++----- static/june_2007_style/embed_item.css.tmpl | 25 +++++++++++++++++++- static/wymeditor/iframe/galaxy/wymiframe.css | 12 +++++++--- templates/embed_base.mako | 2 +- templates/page/editor.mako | 11 +++++---- templates/workflow/embed.mako | 1 + 6 files changed, 51 insertions(+), 16 deletions(-) diff --git a/static/june_2007_style/blue/embed_item.css b/static/june_2007_style/blue/embed_item.css index f88a51342dc..aceef267b5e 100644 --- a/static/june_2007_style/blue/embed_item.css +++ b/static/june_2007_style/blue/embed_item.css @@ -1,10 +1,14 @@ -.embedded-item{margin-left:auto;margin-right:auto;width:90%;padding: 0.5em;-moz-border-radius:0.5em;-webkit-border-radius:0.5em;border-radius:0.5em;} -.embedded-item.history{background-color:#C1C9E5} -.embedded-item.dataset{background-color:#CFC} -.embedded-item.workflow{background-color:#EBD9B2} +.embedded-item{margin-left:auto;margin-right:auto;width:90%;-moz-border-radius:0.5em;-webkit-border-radius:0.5em;border-radius:0.5em;} +.embedded-item.display {padding: 0.5em;} +.embedded-item.history{background-color:#C1C9E5} +.embedded-item.history p{background:#C1C9E5 no-repeat 2px 2px;margin-top:0;margin-bottom:0;} +.embedded-item.dataset{background-color:#CFC} +.embedded-item.dataset p{background:#CFC no-repeat 2px 2px;margin-top:0;margin-bottom:0;} +.embedded-item.workflow{background-color:#EBD9B2} +.embedded-item.workflow p{background:#EBD9B2 no-repeat 2px 2px;margin-top:0;margin-bottom:0;} .embedded-item.placeholder{} -.embedded-item .item-content{max-height:25em;overflow:auto;} -.embedded-item .title{vertical-align:top;text-align:center;} +.embedded-item .item-content{max-height:25em;overflow:auto;display:none;} +.embedded-item .title{vertical-align:top;text-align:center;font-weight:bold;} .embedded-item.placeholder .content{padding: 1em 1em;font-style:italic;text-align:center;} table.annotated-item{width:100%;border-collapse:collapse;} table.annotated-item td,th{padding:0;} diff --git a/static/june_2007_style/embed_item.css.tmpl b/static/june_2007_style/embed_item.css.tmpl index a74aa48be60..a3ab78086f2 100644 --- a/static/june_2007_style/embed_item.css.tmpl +++ b/static/june_2007_style/embed_item.css.tmpl @@ -1,35 +1,58 @@ + .embedded-item { margin-left:auto; margin-right:auto; width:90%; - padding: 0.5em; -moz-border-radius:0.5em; -webkit-border-radius:0.5em; border-radius:0.5em; } +.embedded-item.display { + padding: 0.5em; +} + .embedded-item.history { background-color:#C1C9E5 } +.embedded-item.history p { + background:#C1C9E5 no-repeat 2px 2px; + margin-top:0; + margin-bottom:0; +} + .embedded-item.dataset { background-color:#CFC } +.embedded-item.dataset p { + background:#CFC no-repeat 2px 2px; + margin-top:0;margin-bottom:0; +} + .embedded-item.workflow { background-color:#EBD9B2 } +.embedded-item.workflow p { + background:#EBD9B2 no-repeat 2px 2px; + margin-top:0; + margin-bottom:0; +} + .embedded-item.placeholder{} .embedded-item .item-content { max-height: 25em; overflow: auto; + display: none; } .embedded-item .title { vertical-align:top; text-align:center; + font-weight: bold; } .embedded-item.placeholder .content { diff --git a/static/wymeditor/iframe/galaxy/wymiframe.css b/static/wymeditor/iframe/galaxy/wymiframe.css index f48d3580648..165a7165a16 100644 --- a/static/wymeditor/iframe/galaxy/wymiframe.css +++ b/static/wymeditor/iframe/galaxy/wymiframe.css @@ -1,3 +1,7 @@ +/* + * JG: edited to remove '!important' from rules so that embedded Galaxy items can have unique background colors. + */ + /* * WYMeditor : what you see is What You Mean web-based editor * Copyright (c) 2005 - 2009 Jean-Francois Hovinne, http://www.wymeditor.org/ @@ -33,9 +37,9 @@ ol, table, blockquote, - pre { background: #FFFFFF no-repeat 2px 2px !important; - padding:8px 5px 5px !important; - margin:10px !important; } + pre { background: #FFFFFF no-repeat 2px 2px; /* JG removed: !important */ + padding:8px 5px 5px; /* JG removed: !important */ + margin:10px} /* JG removed: !important */ td { background: #F0F4F8; } th { background: #ffffcc; } ul, @@ -52,6 +56,7 @@ td { height: 1.6em; } /* labels */ +/* JG commented out: p { background-image: url(lbl-p.png); } h1 { background-image: url(lbl-h1.png); } h2 { background-image: url(lbl-h2.png); } @@ -61,6 +66,7 @@ h6 { background-image: url(lbl-h6.png); } blockquote{ background-image: url(lbl-blockquote.png); } pre { background-image: url(lbl-pre.png); } +*/ /* specific HTML elements */ caption { text-align: left; } diff --git a/templates/embed_base.mako b/templates/embed_base.mako index 2e934d84b79..e888353f9e6 100644 --- a/templates/embed_base.mako +++ b/templates/embed_base.mako @@ -6,7 +6,7 @@ <%namespace file="/display_common.mako" import="*" /> ## HTML structure. -
+
${self.render_title( item )}
diff --git a/templates/page/editor.mako b/templates/page/editor.mako index 7685d8cf9cf..31e285dab97 100644 --- a/templates/page/editor.mako +++ b/templates/page/editor.mako @@ -459,17 +459,18 @@ // all non-standard attributes when it returns its content (e.g. it will not return an element attribute of the form // item_class='History'). var item_embed_html = - "

\ + "\

\ -
Embedded Galaxy " + item_info.singular + " '" + item_name + "'
\ -
\ +

Embedded Galaxy " + item_info.singular + " '" + item_name + "'

\ +

\ [Do not edit this block; Galaxy will fill it in with the annotated " + item_info.singular.toLowerCase() + " when it is displayed.]

\ -
\ -

"; +

\ +

"; // Insert embedded representation into document. + // TODO: maybe try replace() instead to handle indenting? wym.insert(item_embed_html); }); hide_modal(); diff --git a/templates/workflow/embed.mako b/templates/workflow/embed.mako index 037a086688b..f896906f9f1 100644 --- a/templates/workflow/embed.mako +++ b/templates/workflow/embed.mako @@ -4,6 +4,7 @@ %> <%def name="render_summary_content( workflow, steps )"> + ##