Changeset 9364
- Timestamp:
- 07/04/08 17:37:55 (2 months ago)
- Files:
-
- playground/trunk/modules/APIs/jquery/plugins/jquery.dimensions.js (added)
- playground/trunk/modules/APIs/jsmath/easy/load.js (modified) (1 diff)
- playground/trunk/modules/citeline/MOD-INF/builder.js (modified) (6 diffs)
- playground/trunk/modules/citeline/MOD-INF/main.js (modified) (2 diffs)
- playground/trunk/modules/citeline/index.html (modified) (9 diffs)
- playground/trunk/modules/citeline/scripts/client.js (modified) (11 diffs)
- playground/trunk/modules/citeline/scripts/exhibit-builder/urls.js (modified) (1 diff)
- playground/trunk/modules/citeline/styles/structure.css (moved) (moved from playground/trunk/modules/citeline/styles/style.css) (7 diffs)
- playground/trunk/modules/playground/MOD-INF/exhibit-builder/edit-mode-composition.vt (modified) (1 diff)
- playground/trunk/modules/playground/json_viewer.html (added)
- playground/trunk/modules/playground/scripts/exhibit-builder/facet-region.js (modified) (5 diffs)
- playground/trunk/modules/playground/scripts/exhibit-builder/inner-builder.js (modified) (4 diffs)
- playground/trunk/modules/playground/scripts/exhibit-builder/urls.js (modified) (1 diff)
- playground/trunk/modules/playground/scripts/exhibit-builder/view-builders/tile-view-builder.js (modified) (1 diff)
- playground/trunk/modules/playground/scripts/exhibit-builder/view-builders/timeline-view-builder.js (modified) (1 diff)
- playground/trunk/modules/playground/scripts/exhibit-builder/view-region.js (modified) (5 diffs)
- playground/trunk/modules/playground/scripts/exhibit-jsmath.js (modified) (1 diff)
- playground/trunk/modules/playground/templates/bibtex-basic/styles.css (modified) (1 diff)
- playground/trunk/modules/playground/templates/bibtex-bookworm/layout.html (modified) (1 diff)
- playground/trunk/modules/playground/templates/bibtex-bookworm/styles.css (modified) (1 diff)
- playground/trunk/modules/playground/templates/bibtex-classic/images/csail-logo.png (added)
- playground/trunk/modules/playground/templates/bibtex-classic/images/mit-logo.gif (added)
- playground/trunk/modules/playground/templates/bibtex-classic/images/sample-logo.png (deleted)
- playground/trunk/modules/playground/templates/bibtex-classic/layout.html (modified) (1 diff)
- playground/trunk/modules/playground/templates/bibtex-classic/styles.css (modified) (1 diff)
- playground/trunk/modules/playground/templates/bibtex-clean/styles.css (modified) (1 diff)
- playground/trunk/modules/playground/templates/bibtex-dark/styles.css (modified) (1 diff)
- playground/trunk/modules/playground/templates/bibtex-essential/styles.css (modified) (1 diff)
- playground/trunk/modules/repository/MOD-INF/src/edu/mit/simile/playground/repository/ScriptableRepository.java (modified) (1 diff)
- playground/trunk/modules/skins/citeline-skin/style.css (modified) (5 diffs)
- playground/trunk/modules/skins/default/exhibit-builder.css (modified) (3 diffs)
- playground/trunk/modules/skins/default/images/closed.png (added)
- playground/trunk/modules/skins/default/images/open.png (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
playground/trunk/modules/APIs/jsmath/easy/load.js
r9363 r9364 98 98 // 99 99 //loadFiles: ["plugins/tex2math.js"], 100 loadFiles: [], 100 101 101 102 // playground/trunk/modules/citeline/MOD-INF/builder.js
r9363 r9364 19 19 var method = request.getMethod(); 20 20 21 if (method == "GET") { 21 if (method == "HEAD") { 22 execute2(request, response, function(temp) { 23 var exists = repository.exists(id,temp); 24 if (exists) { 25 butterfly.sendString(request, response, "", "UTF-8", "text/html"); 26 } else { 27 butterfly.sendError(request, response, 401, "Not Authorized"); 28 } 29 }); 30 } else if (method == "GET") { 22 31 if (action == "editable") { 23 32 var template = request.getParameter("template"); 24 33 var title; 25 var format; 34 var settings; 35 26 36 execute2(request, response, function(temp) { 27 title = repository.getProperty(id, temp, "title"); 28 format = repository.getProperty(id, temp, "original-format"); 37 settings = repository.getMetadata(id, temp); 38 if (settings && settings.settableTexts) { 39 title = settings.settableTexts["the-title"].text; 40 } 29 41 if (template == null || template == "") { 30 template = repository.getProperty(id, temp, "template"); 31 } 32 }); 42 template = settings.template; 43 } 44 }); 45 33 46 title = (title != null && title != "") ? title : "Untitled Exhibit"; 34 47 template = (template != null && template != "") ? template : default_template; … … 48 61 49 62 } else if (action == "info") { 50 var data = getInfo(request, response);51 var format;52 63 execute2(request, response, function(temp) { 53 data.template = repository.getProperty(data.active_playground, temp, "template"); 54 format = repository.getProperty(data.active_playground, temp, "original-format"); 55 }); 56 if (!("template" in data) || data.template == null || data.template == "") { 57 data.template = default_template; 58 } 59 60 butterfly.sendJSON(request, response, data); 64 var data = getInfo(request, response); 65 var template = repository.getProperty(data.active_playground, temp, "template"); 66 data.template = (template) ? template : default_template; 67 butterfly.sendJSON(request, response, data); 68 }); 61 69 } else if (action == "metadata") { 62 70 execute(request, response, function(verifiedID) { … … 88 96 } 89 97 }); 98 99 } else if (action == "facets.json") { 100 getPlayground(id, "facet-map",request,response); 90 101 } else if (action == "data.json") { 91 102 getPlayground(id, "json",request,response); … … 97 108 }); 98 109 110 } else if (action == "json_viewer.html") { 111 butterfly.sendText(request, response, "json_viewer.html", "UTF-8", "text/html"); 112 99 113 } else if (action == "__history__.html") { 100 114 butterfly.sendString(request, response, "<html><body></body></html>", "UTF-8", "text/html"); … … 110 124 execute2(request, response, function(temp) { 111 125 settings = repository.getMetadata(id, temp); 112 title = settings.title; 113 format = settings.original-format; 126 title = settings.settableTexts["the-title"].text; 114 127 template = settings.template; 115 128 content = repository.readFile(id, temp, "json"); … … 194 207 }); 195 208 196 } 209 } 197 210 198 211 } playground/trunk/modules/citeline/MOD-INF/main.js
r9363 r9364 179 179 while (results && results.hasNext()) { 180 180 var s = results.next(); 181 var uri = s.getObject().toString();182 var pgProps = triplestore.getAll(uri, null, null);181 var id = s.getObject().toString().substring(10); 182 butterfly.log("id: " + id); 183 183 var props = {}; 184 while (pgProps && pgProps.hasNext()) { 185 var p = pgProps.next(); 186 var pred = p.getPredicate().toString(); 187 var value = p.getObject().toString(); 188 props[pred.substring(7)] = value; 184 var metadata = repository.getMetadata(id, true); 185 if (metadata) { 186 props.title = metadata.settableTexts["the-title"].text; 187 props.created = metadata.created; 189 188 } 190 189 playgrounds[uri.substring(10)] = props; … … 206 205 var uri = "urn:pg:pg:" + pg; 207 206 triplestore.add(accountURI, "urn:pg:owns", uri); 208 for (property in metadata) {209 triplestore.add(uri, "urn:pg:" + property, metadata[property], true);210 }211 207 cache.remove(accountURI,"playgrounds"); 212 208 getPlaygrounds(accountURI); // re-populate the cache playground/trunk/modules/citeline/index.html
r9363 r9364 3 3 4 4 <head> 5 <title>MIT Libraries | Citeline</title> 5 6 <!--+ 7 | Citeline - An exhibit authoring system for citation collections 8 | 9 | Stefano Mazzocchi <stefanom@mit.edu> 10 | David Huynh <dfhuynh@csail.mit.edu> 11 | Ryan Lee <ryanlee@csail.mit.edu> 12 | 13 +--> 14 15 <title>Citeline</title> 6 16 7 17 <link type="text/css" rel="stylesheet" href="[#skin#]/reset.css" media="screen"/> 8 <link type="text/css" rel="stylesheet" href="styles/st yle.css" media="screen"/>18 <link type="text/css" rel="stylesheet" href="styles/structure.css" media="screen"/> 9 19 <link type="text/css" rel="stylesheet" href="[#skin#]/style.css" media="screen"/> 10 20 … … 12 22 <script type="text/javascript" src="scripts/utils.js"></script> 13 23 <script type="text/javascript" src="scripts/client.js"></script> 24 25 <noscript> 26 <p>Sorry, but <a href="http://simile.mit.edu/wiki/Citeline">Citeline</a> needs a browser that supports Javascript scripting.</p> 27 </noscript> 28 14 29 </head> 15 30 16 31 <body> 17 32 33 <div id="top"></div> 34 18 35 <div id="header"> 19 <div id="logo">< /div>36 <div id="logo"><a href="http://libraries.mit.edu/"><img src="[#skin#]/images/library_logo.png"/></a></div> 20 37 <div id="title"></div> 21 38 </div> 22 39 23 40 <div id="path"> 24 <span><a href="../">Citeline</a></span> » <span id="current"></span> 41 <div class="authenticated auth_exhibit_builder anon_exhibit_builder pane"> 42 <table class="wide"> 43 <tr> 44 <td align="left" width="25%"> 45 <span class="auth_exhibit_builder pane"><a title="My Exhibits" class="my_exhibits action">My Exhibits</a></span><span> </span> 46 </td> 47 <td align="center" style="font-size: 90%" width="50%"> 48 <a href="http://simile.mit.edu/wiki/Citeline_User%27s_Guide" target="_blank">Help</a> | <a href="mailto:citeline-lib@mit.edu" title="Contact us for assistance">Contact Us for Assistance</a> 49 </td> 50 <td align="right" width="25%"> 51 <div class="anon_exhibit_builder pane"><a title="Sign In" class="signin action">Sign In and Claim Your Exhibit</a></div> 52 <div class="authenticated auth_exhibit_builder pane"><a title="Sign Out" class="signout action">Sign Out</a></div> 53 </td> 54 </tr> 55 </table> 56 </div> 25 57 </div> 26 27 <div id="signout">Sign Out »</div>28 58 29 59 <div id="body"> 30 60 31 61 <!-- ============== Anonymous Main Pane =================== --> 32 33 <div id="anonymous" class="pane">34 <p class="first centered short">Welcome to the <strong>Citeline</strong>, a service to facilitate the publishing on the web of bibliographies and citation collections as interactive <a href="http://simile.mit.edu/exhibit/">exhibits</a> and facilitate the sharing of thisdata.</p>62 63 <div class="anonymous pane"> 64 <p class="first centered short">Welcome to <strong>Citeline</strong>, a service to facilitate the web publishing of bibliographies and citation collections as interactive <em>exhibits</em> and facilitate the sharing of this type of data.</p> 35 65 <p class="centered">Here are some of our featured interactive publication exhibits:</p> 36 66 37 <table style="margin: 2em auto"><tbody><tr> 67 <table style="margin: 2em auto;"> 68 <tr> 38 69 <td align="center"> 39 70 <div class="thumbnail"><a title="David Karger's Bibliography" href="http://simile.mit.edu/citeline/240c8e56a51e83b58424371353c30608dfbe8ed4/"><img height="126px" width="150px" class="reflect" src="images/exhibit4.png"/></a></div> … … 44 75 <div><a href="http://erikdemaine.org/">Erik Demaine</a>'s Selected Publications<br/>317 publications</div> 45 76 </td> 46 </tr></tbody></table> 47 48 <table> 77 </tr> 78 </table> 79 80 <table class="spaced"> 49 81 <tr> 50 82 <td> … … 53 85 <div class="label">Make your own exhibit from a <a href="http://en.wikipedia.org/wiki/BibTeX">BibTeX</a> file:</div> 54 86 <div><input class="input" type="file" name="file" size="20"/></div> 55 <div class="submit"><a class=" action" id="upload_submit">Make your exhibit</a></div>56 <p class="output error" style="display: none">Please, select a BibTEX file to upload.</p>87 <div class="submit"><a class="upload action">Make your exhibit</a></div> 88 <p class="output error">Please, select a BibTEX file to upload.</p> 57 89 </form> 58 90 </div> … … 62 94 <div id="signin"> 63 95 <div>Manage your existing exhibits.</div> 64 <div><a title="Sign In" id="sign_in_link" class="action">Sign In</a></div>96 <div><a title="Sign In" class="signin action">Sign In</a></div> 65 97 </div> 66 98 </td> 67 99 </tr> 68 100 </table> 69 70 <p class="centered">Don't have a BibTeX file? No worries, <a title="Where do I get a BibTEX file?" href="http://simile.mit.edu/wiki/Citeline_FAQ#Where_do_I_get_a_BibTeX_file.3F">we can help</a>.</p> 101 102 <p class="centered" style="margin: 1em;"> 103 <a title="Where do I get a BibTEX file?" href="http://simile.mit.edu/wiki/Citeline_FAQ#Where_do_I_get_a_BibTeX_file.3F" style="margin-right: 2em">How to create a BibTeX file »</a> 104 <a title="Citeline User's Guide" href="http://simile.mit.edu/wiki/Citeline_User%27s_Guide">Citeline User's Guide »</a> 105 </p> 71 106 72 107 <div id="zotero" class="boxed centered"> 73 <p>< img src="images/zotero.png"/> user?</p>108 <p><a href="http://www.zotero.org/" title="Zotero"><img src="images/zotero.png"/></a> user?</p> 74 109 <p>Install <a href="http://simile.mit.edu/dist/zotz/zotz.xpi">our Zotz add-on</a> and build your citation publication directly from Zotero. Learn <a href="http://simile.mit.edu/wiki/Citeline_FAQ#How_do_I_use_Citeline_from_Zotero.3F">how</a>.</p> 75 110 </div> … … 78 113 <!-- ============== Authenticated Main Pane =================== --> 79 114 80 <div id="authenticated" class="pane">115 <div class="authenticated pane" style="margin: 1em;"> 81 116 <h1>My Exhibits</h1> 117 <div class="message" style="margin: 2em;"> 118 <p>You currently don't have any exhibit associated with this account.</p> 119 <p>Use the form below to create one.</p> 120 </div> 82 121 <ul></ul> 83 <div style="margin-top: 2em;" class="centered">122 <div style="margin-top: 4em;" class="centered"> 84 123 <form name="new" action="add_data" method="post" enctype="multipart/form-data" accept-charset="UTF-8"> 85 124 <div class="label">Make a new exhibit from a <a href="http://en.wikipedia.org/wiki/BibTeX">BibTeX</a> file:</div> 86 125 <div><input class="input" type="file" name="file" size="20"/></div> 87 <div class="submit"><a class="action" id="new_submit">Make a new exhibit</a></div> 126 <div class="submit"><a class="upload action">Make a new exhibit</a></div> 127 <p class="output error">Please, select a BibTEX file to upload.</p> 88 128 </form> 89 129 </div> … … 92 132 <!-- ============== Exhibit Pane ============================== --> 93 133 94 <div id="exhibit_builder" class="pane"> 95 <table id="main-control-panel" width="100%"> 96 <tr> 97 <td align="left"> 98 <input id="delete" type="button" value="Delete this Exhibit"> 99 </td> 100 <td align="center"> 101 <span>Style</span><br/> 102 <select onchange="switchTemplate();" id="template-select"> 103 <option value="bibtex-classic">Classic</option> 104 <option value="bibtex-clean">Clean</option> 105 <option value="bibtex-bookworm">Bookworm</option> 106 <option value="bibtex-dark">Dark</option> 107 <option value="bibtex-basic">Basic</option> 108 <option value="bibtex-essential">Essential</option> 109 </select> 110 </td> 111 <td align="right"> 112 <a id="public" target="_blank">view public version »</a><br/> 113 <a id="download" target="_blank">download »</a> 114 </td> 115 </tr> 116 </table> 117 118 <iframe id="exhibit-container"></iframe> 134 <div class="auth_exhibit_builder anon_exhibit_builder pane"> 135 <table id="exhibit_controls" class="wide spaced" style="margin-bottom: 0.5em"> 136 <tr> 137 <td align="left" width="40%"> 138 <input class="delete" type="button" value="Delete this Exhibit"> 139 <input class="show_settings hidden" type="button" value="Show Data"> 140 <input class="hide_settings hidden" type="button" value="Hide Data"> 141 </td> 142 <td align="center" width="20%"> 143 <span>Style:</span> 144 <select id="template-select"> 145 <option value="bibtex-classic">Classic</option> 146 <option value="bibtex-clean">Clean</option> 147 <option value="bibtex-bookworm">Bookworm</option> 148 <option value="bibtex-dark">Dark</option> 149 <option value="bibtex-basic">Basic</option> 150 <option value="bibtex-essential">Essential</option> 151 </select> 152 </td> 153 <td align="right" width="40%"> 154 <a class="public" target="_blank">preview</a> | <a class="download" target="_blank">download</a> 155 </td> 156 </tr> 157 </table> 158 159 <table class="wide"> 160 <tr> 161 <td style="vertical-align: top" class="nopadding"><iframe id="exhibit-container"></iframe></td> 162 <td class="nopadding hidden" id="exhibit-metadata-holder" style="vertical-align: top; padding-left: 0.5em"> 163 <iframe id="exhibit-metadata-container"></iframe> 164 <div id="exhibit-metadata-selector" style="text-align: right; margin-top: 0.5em;">Data: <select> 165 <option value="metadata">Settings</option> 166 <option value="facets.json">Facets</option> 167 <option value="data.json">Data</option> 168 </select></div> 169 </td> 170 </tr> 171 </table> 172 119 173 </div> 120 121 </div> <!-- end of div#body -->174 175 </div> 122 176 123 177 <div id="footer"> … … 126 180 127 181 <div id="info"></div> 128 129 130 131 182 132 183 … … 236 287 <p>We're terribly sorry but an error occurred within the application that prevented 237 288 it from completing the action that you requested.</p> 238 <p>This error has been already reported to the applicationmaintenance crew289 <p>This error has been already automatically reported to the maintenance crew 239 290 that will try to diagnose and correct the problem as soon as possible.</p> 240 291 <p>You can either try again and see if the error was temporary, or come back later. playground/trunk/modules/citeline/scripts/client.js
r9363 r9364 3 3 */ 4 4 5 var debug = true; 5 var show_data = true; 6 var show_info = false; 6 7 7 8 var min_latency = 300; … … 78 79 function reveal(pane) { 79 80 var callback = function() { 80 current_pane = $(" #" + pane).fadeIn(50);81 current_pane = $("." + pane).fadeIn(50); 81 82 } 82 83 if (current_pane) { … … 133 134 } 134 135 135 if ( debug) {136 if (show_info) { 136 137 var infoDiv = $("#info"); 137 138 infoDiv.setTemplate("<div>Latency: {$T.latency}ms</div>" … … 156 157 }); 157 158 }).fadeIn(80); 158 $("#debug").fadeIn(80);159 159 } 160 160 }, … … 164 164 load("authenticated"); 165 165 } else { 166 if ($.info.active_playground) { 167 load("exhibit_builder"); 168 } else { 169 $("#sign_in_link").click(signIn); 166 var ifExisting = function() { 167 load("anon_exhibit_builder"); 168 } 169 170 var ifNot = function() { 171 removeActiveExhibit(); 172 $(".signin").click(signIn); 170 173 $('img.reflect').reflect( { 171 174 height: 0.3, … … 175 178 reveal("anonymous"); 176 179 } 180 181 focusOnActiveExhibit(ifExisting,ifNot); 177 182 } 178 183 }, … … 182 187 load("anonymous"); 183 188 } else { 184 $("#signout").click(signOut).fadeIn(300); 185 if ($.info.active_playground) { 186 load("exhibit_builder"); 187 } else { 188 prepareUpload("new", "new_submit"); 189 var ifExisting = function() { 190 load("auth_exhibit_builder"); 191 } 192 193 var ifNot = function() { 194 removeActiveExhibit(); 195 $(".signout").click(signOut); 189 196 $.getJSON("playgrounds", 190 197 function(pgs) { 191 var pane = $(" #authenticated");198 var pane = $(".authenticated"); 192 199 var list = pane.find("ul").html(""); 193 200 var found = false; 194 for ( var pg in pgs) {201 for (var pg in pgs) { 195 202 var data = pgs[pg]; 203 var title = data. 196 204 var title = (!data.title) ? '[untitled]' : data.title; 197 list.append("<li><a href='" + pg + "/'>" + title + "</a></li>"); 205 list.append("<li><a class='action' title='" + title + "'>" + title + "</a></li>").find("a").click( function () { 206 setActiveExhibit(pg); 207 load("auth_exhibit_builder"); 208 }); 198 209 found = true; 199 210 } 200 211 if (!found) { 201 list.html("<p>You have no exhibits associated with this account.</p>");212 pane.find(".message").fadeIn(200); 202 213 } 203 214 }); 215 prepareUpload("new", "new_submit"); 204 216 reveal("authenticated"); 205 217 } 218 219 focusOnActiveExhibit(ifExisting,ifNot); 206 220 } 207 221 }, 208 222 209 exhibit_builder: function() { 210 log("init exhibit_builder"); 211 212 var resizeExhibit = function() { 213 var elmt = $("#exhibit-container")[0]; 214 //elmt.style.width = (window.innerWidth - 40) + "px"; 215 elmt.style.height = (window.innerHeight - 100) + "px"; 216 } 217 218 $(window).bind("resize", resizeExhibit); 219 220 reveal("exhibit_builder"); 221 222 instrumentExhibitBuilder(); 223 224 var formElement = $("#delete").click( function() { 225 if (confirm("Are you sure you want to delete this exhibit?")) { 226 $.ajax( { 227 type: "delete", 228 url: $.info.active_playground + "/", 229 error: error, 230 success: function(data) { 231 $.cookie('apg', null, { path :'/' }); 232 redirect(''); 233 } 234 }); 235 } 236 }); 237 238 $("#template-select").change(switchTemplate); 239 240 $("#exhibit-container")[0].src = $.info.active_playground + "/editable"; 241 242 resizeExhibit(); 223 auth_exhibit_builder: function() { 224 if (!authenticated()) { 225 load("anon_exhibit_builder"); 226 } else { 227 initExhibitBuilder("auth_exhibit_builder"); 228 $(".my_exhibits").click(function() { 229 removeActiveExhibit(); 230 load("authenticated"); 231 }); 232 } 243 233 }, 244 234 235 anon_exhibit_builder: function() { 236 if (authenticated()) { 237 load("auth_exhibit_builder"); 238 } else { 239 initExhibitBuilder("anon_exhibit_builder"); 240 } 241 }, 242 245 243 sign_up: function() { 246 244 passwordHandler("signup"); … … 256 254 257 255 // -------------------------------------------------- 256 257 function focusOnActiveExhibit(ifExisting, ifNot) { 258 if ($.info.active_playground) { 259 $.ajax({ 260 type: "HEAD", 261 url: $.info.active_playground + "/", 262 success: ifExisting, 263 error: ifNot 264 }); 265 } else { 266 ifNot(); 267 } 268 } 258 269 259 270 function prepareUpload(form, action) { … … 266 277 var ready = (str != "file="); 267 278 if (!ready) { 268 var dialog = formElement.find(".output :eq(0)").show();279 var dialog = formElement.find(".output").show(); 269 280 setTimeout( function() { 270 281 dialog.fadeOut(1000); … … 285 296 }); 286 297 287 $('#' + action).click( function() { 288 $("form[@name='" + form + "']").submit(); 289 }); 290 298 formElement.find('.upload').click( function() { 299 formElement.submit(); 300 }); 301 302 formElement.find('.output').hide(); 303 } 304 305 function initExhibitBuilder(paneName) { 306 $(window).bind("resize", onResize); 307 308 $(".signin").click(signIn); 309 310 var pane = $("." + paneName); 311 pane.find("a.public").mouseover(function() { 312 $(this).attr("href", $.info.active_playground + "/" + encode(getTitle()) + ".html"); 313 }).mouseover(); 314 pane.find("a.download").mouseover(function() { 315 $(this).attr("href", $.info.active_playground + "/" + encode(getTitle()) + ".html?mode=download"); 316 }).mouseover(); 317 318 var formElement = $(".delete").click( function() { 319 if (confirm("Are you sure you want to delete this exhibit?")) { 320 $.ajax( { 321 type: "delete", 322 url: $.info.active_playground + "/", 323 error: error, 324 success: function(data) { 325 removeActiveExhibit(); 326 load(''); 327 } 328 }); 329 } 330 }); 331 332 $("#template-select").change(function () { 333 var newTemplate = $(this)[0].value; 334 if (newTemplate != $.info.template) { 335 $("#exhibit-container")[0].contentWindow.saveTemplateSettings( function() { 336 $.post($.info.active_playground + "/template", { 337 "pg": $.info.active_playground, 338 "template": newTemplate 339 }, function() { 340 $.info.template = newTemplate; 341 $("#exhibit-container")[0].src = $.info.active_playground + "/editable?template=" + $.info.template; 342 }); 343 }); 344 } 345 }); 346 347 $("#exhibit-container")[0].src = $.info.active_playground + "/editable"; 348 349 if (show_data) { 350 $(".show_settings").click( function() { 351 $("#exhibit-metadata-holder").show()[0].style.width = "30%"; 352 $("#exhibit-metadata-container")[0].src = $.info.active_playground + "/json_viewer.html?data=metadata"; 353 $(this).hide(); 354 $(".hide_settings").show(); 355 onResize(); 356 }).show(); 357 358 $(".hide_settings").click( function() { 359 $("#exhibit-metadata-holder").hide()[0].style.width = "0%"; 360 $(this).hide() 361 $(".show_settings").show(); 362 }).hide(); 363 364 $("#exhibit-metadata-holder select").change(function() { 365 var newMetadata = $(this)[0].value; 366 $("#exhibit-metadata-container")[0].src = $.info.active_playground + "/json_viewer.html?data=" + newMetadata; 367 })[0].selectedIndex = 0; 368 369 $("#exhibit-container").bind("load", function() { 370 var exhibit = $(this)[0].contentWindow; 371 var oldSavingFunction = exhibit.saveTemplateSettings; 372 exhibit.saveTemplateSettings = function(f) { 373 oldSavingFunction(f); 374 setTimeout(function() { 375 $("#exhibit-metadata-container")[0].contentWindow.location.reload(); 376 },500); 377 }; 378 }); 379 } 380 381 reveal(paneName); 382 383 onResize(); 384 } 385 386 function onResize() { 387 var total = window.innerHeight; 388 389 var space = $("#header").outerHeight({ margin: true }) + 390 $("#path").outerHeight({ margin: true }) + 391 $("#exhibit_controls").outerHeight({ margin: true }) + 392 $("#footer").outerHeight({ margin: true }); 393 394 resizeIframes(total - space - 2); // 2 is the iframe border 395 } 396 397 function resizeIframes(h) { 398 var selector = $("#exhibit-metadata-selector").outerHeight({ margin: true }); 399 $("#exhibit-metadata-container").height(h - selector); 400 $("#exhibit-container").height(h); 401 } 402 403 function encode(str) { 404 return encodeURI(str.toLowerCase().replace(/\s/g,'_')); 405 } 406 407 function getTitle() { 408 var iframe = $("#exhibit-container")[0].contentWindow; 409 var title = "Untilted Exhibit"; 410 if (iframe.getSettings) { 411 var settings = iframe.getSettings(); 412 if (settings && settings.settableTexts) { 413 title = settings.settableTexts["the-title"].text; 414 } 415 } 416 return title; 291 417 } 292 418 … … 296 422 } 297 423 298 function saveSettings() { 299 $("#exhibit-container")[0].contentWindow.saveTemplateSettings(); 300 } 301 302 function encode(str) { 303 return encodeURI(str.toLowerCase().replace(/\s/g,'_')); 304 } 305 306 function instrumentExhibitBuilder() { 307 var filename = $.info.title ? encode($.info.title) : "untitled_exhibit" ; 308 var playgroundURL = $.info.active_playground + "/"; 309 var exhibitURL = playgroundURL + filename + ".html"; 310 $("#public").attr("href", exhibitURL); 311 $("#download").attr("href", exhibitURL + "?mode=download"); 312 } 313 314 function switchTemplate() { 315 var newTemplate = $("#template-select")[0].value; 316 log("new template: " + newTemplate); 317 if (newTemplate != $.info.template) { 318 $("#exhibit-container")[0].contentWindow.saveTemplateSettings( function() { 319 $.post("template", { 320 "pg": $.info.active_playground, 321 "template": newTemplate 322 }, function() { 323 $.info.template = newTemplate; 324 $("#exhibit-container")[0].src = $.info.active_playground + "/editable?template=" + $.info.template; 325 }); 326 }); 327 } 328 saveSettings(); 329 instrumentExhibitBuilder(); 424 function removeActiveExhibit() { 425 delete $.info.active_playground; 426 $.cookie('apg', null, { path :'/' }); 330 427 } 331 428 playground/trunk/modules/citeline/scripts/exhibit-builder/urls.js
r9363 r9364 17 17 } 18 18 }; 19 20 var Views = { 21 toString: function() { 22 return "<option value='Timeline'>Timeline</option>"; 23 } 24 } playground/trunk/modules/citeline/styles/structure.css
r9363 r9364 37 37 } 38 38 39 table { 40 margin: 1em auto; 41 } 42 43 table td { 39 table.spaced { 40 margin: 1em auto; 41 } 42 43 table.wide { 44 width: 100%; 45 } 46 47 td { 44 48 padding: 0em 0.5em; 45 49 } 46 50 51 td.wide { 52 width: 100%; 53 } 54 55 td.nopadding { 56 padding: 0px; 57 } 58 47 59 li { 48 60 padding: 0.5em 0 0 1em; … … 51 63 p { 52 64 padding: 0.5em 0; 65 } 66 67 iframe { 68 width: 100%; 53 69 } 54 70 … … 169 185 /* ------------------------------- misc ------------------------------------- */ 170 186 187 .hidden { 188 display: none; 189 } 190 171 191 .short { 172 192 margin: 0 15%; … … 213 233 } 214 234 235 .message { 236 display: none; 237 } 238 215 239 /* ----------------------------------------------------- */ 240 241 #top { 242 position: absolute; 243 top: 0px; 244 left: 0px; 245 width: 100%; 246 } 247 248 #path { 249 } 216 250 217 251 #body { … … 221 255 #footer { 222 256 margin-top: 10px; 223 padding: 20px; 224 padding-bottom: 100px; 257 padding: 10px; 225 258 text-align: center; 226 259 font-size: 90%; … … 237 270 } 238 271 239 #path {240 display: none;241 position: absolute;242 top: 10px;243 left: 10px;244 }245 246 272 #debug { 247 273 display: none; … … 251 277 width: 150px; 252 278 } 279 playground/trunk/modules/playground/MOD-INF/exhibit-builder/edit-mode-composition.vt
r9363 r9364 26 26 <link type="text/css" rel="stylesheet" href="[#skin#]/exhibit-builder-base.css" media="screen"> 27 27 <link type="text/css" rel="stylesheet" href="[#skin#]/exhibit-builder.css" media="screen"> 28 28 29 29 <style> 30 30 #parse($styles) playground/trunk/modules/playground/scripts/exhibit-builder/facet-region.js
r8768 r9364 30 30 "div", 31 31 "<div class='playground-exhibitBuilder-facetRegion-controls-section'>" + 32 "<div>Add SimpleFacet:</div>" +32 "<div>Add Facet:</div>" + 33 33 "<div>" + 34 34 "<select id='simpleFacetSelect'>" + 35 "<option value=''>--add a simplefacet--</option>" +35 "<option value=''>--add facet--</option>" + 36 36 "<option value='*text-search*'>text search</option>" + 37 37 "</select>" + … … 183 183 this._justConstructFacet(configuration, index); 184 184 this._settings.facets.splice(index, 0, configuration); 185 setTimeout(saveTemplateSettings,100); <
