https://wiki.jmol.org/index.php?title=Recycling_Corner/Duplicate_Pop-up&feed=atom&action=history Recycling Corner/Duplicate Pop-up - Revision history 2024-03-29T07:57:16Z Revision history for this page on the wiki MediaWiki 1.32.0 https://wiki.jmol.org/index.php?title=Recycling_Corner/Duplicate_Pop-up&diff=8265&oldid=prev AngelHerraez: Adding Jaime's contribution about PlatformSpeed 2014-01-21T10:31:24Z <p>Adding Jaime&#039;s contribution about PlatformSpeed</p> <table class="diff diff-contentalign-left" data-mw="interface"> <col class="diff-marker" /> <col class="diff-content" /> <col class="diff-marker" /> <col class="diff-content" /> <tr class="diff-title" lang="en"> <td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td> <td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 10:31, 21 January 2014</td> </tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l18" >Line 18:</td> <td colspan="2" class="diff-lineno">Line 18:</td></tr> <tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>   else { t = null; }</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>   else { t = null; }</div></td></tr> <tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>   JSmolCloneData.type = t;</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>   JSmolCloneData.type = t;</div></td></tr> <tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">  JSmolCloneData.platformSpeed = Jmol.evaluate(JSmolObject, 'platformSpeed + 0');</ins></div></td></tr> <tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>   JSmolCloneData.state = Jmol.getPropertyAsString(JSmolObject, 'stateInfo');</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>   JSmolCloneData.state = Jmol.getPropertyAsString(JSmolObject, 'stateInfo');</div></td></tr> <tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>   window.open('JSmolPopup.htm','JSmolPopup','resizable, width=500, height=500');</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>   window.open('JSmolPopup.htm','JSmolPopup','resizable, width=500, height=500');</div></td></tr> <tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l58" >Line 58:</td> <td colspan="2" class="diff-lineno">Line 59:</td></tr> <tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>};</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>};</div></td></tr> <tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Jmol.getApplet(&quot;JSmolClone&quot;, cloneInfo);</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Jmol.getApplet(&quot;JSmolClone&quot;, cloneInfo);</div></td></tr> <tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">Jmol.script(JSmolClone,&quot;set platformSpeed &quot; + opener.JSmolCloneData.platformSpeed);</ins></div></td></tr> <tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>&lt;/script&gt;</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>&lt;/script&gt;</div></td></tr> <tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>&lt;/body&gt;</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>&lt;/body&gt;</div></td></tr> </table> AngelHerraez https://wiki.jmol.org/index.php?title=Recycling_Corner/Duplicate_Pop-up&diff=8138&oldid=prev AngelHerraez: moving long sections to subpages 2013-10-23T14:05:30Z <p>moving long sections to subpages</p> <p><b>New page</b></p><div>== Opening a duplicate of the model in a resizable pop-up window ==<br /> The model, with is current state, is duplicated or cloned into a new (pop-up) window so it may be displayed at a larger size (and the user may resize that window at will).<br /> <br /> The classic version (not shown here) is good for Jmol.js-based JmolApplet.<br /> <br /> This version is for [[JSmol]] (in either HTML5, Java or WebGL modalities).<br /> <br /> You need a portion of JavaScript code included in your page and a separate html file (for the pop-up), also with the relevant code.<br /> <br /> 1. Code in your page:<br /> &lt;pre&gt;&lt;script type=&quot;text/javascript&quot;&gt;<br /> var JSmolCloneData = {};<br /> function cloneJSmol(JSmolObject) {<br /> var t = JSmolObject._jmolType; //temp<br /> if ( /_Canvas2D/.test(t) ) { t = 'HTML5'; }<br /> else if ( /_Canvas3D/.test(t) ) { t = 'WebGL'; }<br /> else if ( /_Applet/.test(t) ) { t = 'Java'; }<br /> else { t = null; }<br /> JSmolCloneData.type = t;<br /> JSmolCloneData.state = Jmol.getPropertyAsString(JSmolObject, 'stateInfo');<br /> window.open('JSmolPopup.htm','JSmolPopup','resizable, width=500, height=500');<br /> }<br /> &lt;/script&gt;<br /> <br /> &lt;input type=&quot;button&quot; value=&quot;clone JSmol in a popup window&quot; onClick=&quot;cloneJSmol(myJmol)&quot;&gt;<br /> &lt;/pre&gt;<br /> <br /> Note: &lt;code&gt;myJmol&lt;/code&gt; should be changed to whatever you have named your JSmol object - and it is the object itself, not a text string.<br /> <br /> 2. Source code of the {{file|JSmolPopup.htm}} file:<br /> &lt;pre&gt;&lt;!DOCTYPE html&gt;<br /> &lt;html&gt;<br /> &lt;title&gt;cloned JSmol&lt;/title&gt;<br /> &lt;head&gt;<br /> &lt;meta charset=&quot;utf-8&quot;&gt;<br /> &lt;style type=&quot;text/css&quot;&gt;<br /> html , body { height:100%; overflow:hidden; margin:0; padding:0; }<br /> &lt;/style&gt;<br /> &lt;script type=&quot;text/javascript&quot; src=&quot;JSmol.min.js&quot;&gt;&lt;/script&gt;<br /> &lt;script type=&quot;text/javascript&quot;&gt;<br /> if (opener.JSmolCloneData.type == 'WebGL') {<br /> document.writeln('&lt;script src=&quot;js/JSmolThree.js&quot; type=&quot;text/javascript&quot;&gt;&lt;'+'/script&gt;');<br /> document.writeln('&lt;script src=&quot;js/JSmolGLmol.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/'+'script&gt;');<br /> }<br /> &lt;/script&gt;<br /> &lt;/head&gt;<br /> &lt;body&gt;<br /> &lt;script type=&quot;text/javascript&quot;&gt;<br /> var cloneInfo = {<br /> height: '100%',<br /> width: '100%',<br /> isSigned: false,<br /> jarFile: 'JmolApplet0.jar',<br /> jarPath: 'java',<br /> j2sPath: 'j2s',<br /> script: opener.JSmolCloneData.state.replace(/zoomLarge true/i,'zoomLarge false'),<br /> use: opener.JSmolCloneData.type<br /> };<br /> Jmol.getApplet(&quot;JSmolClone&quot;, cloneInfo);<br /> &lt;/script&gt;<br /> &lt;/body&gt;<br /> &lt;/pre&gt;<br /> <br /> Note: you need to adjust the paths to {{file|JSmol.min.js}}, {{folder|j2s}} and {{folder|java}}</div> AngelHerraez