We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14218
    • 1 Posts
    This is an auto-generated support/comment thread for SaveMe.

    Use this forum to post any comments about this addition or any questions you have regarding its use.

    Brief Description:
    This takes the "save bar" and floats it at the top of the editor screen. This keeps the save bar fixed so longer pages are easier to save, without needing to scroll back to the top.
      • 36451
      • 264 Posts
      [Instructions:] Should be "Create a new plugin called ’SaveMe’ " instead of "Create a new snippet called ’SaveMe’ ".
      • Thanks, yoomai - I have moderated the Repository entry so that the install instructions now say ’Plugin’.

        Cheers, Garry
          Garry Nutting
          Senior Developer
          MODX, LLC

          Email: [email protected]
          Twitter: @garryn
          Web: modx.com
          • 24292
          • 28 Posts
          The cancel button didn’t work when I tried it.
          The document location seems to be hard wired into the button.
          onclick="'."document.location.href='index.php?a=3&id=79'".';"


          Should &id=79 be &id=$id
            • 24292
            • 28 Posts
            Also found a problem with ids of the save, delete and cancel buttons.
            They are Button1, Button2 and Button5 in the code so for instance in
            <td id="Button1" onclick="documentDirty=false; document.mutate.save.click();"><img src="media/images/icons/save.gif" align="absmiddle"> Save</td>
            <script>createButton(document.getElementById("Button1"));</script>

            createButton finds the existing element with id Button1
            I have changed the ids to SM_Button1, SM_Button2 and SM_Button5 and it seems to be working correctly.
            Full code with all my changes
            $e = & $modx->Event;
            switch ($e->name) {
               case "OnDocFormRender":
                  $html = '<div class="subTitle" style="position:absolute; top:0px; left:0px; width:100%; z-index:30; position:fixed;">
            	<span class="right"><img src="media/images/_tx_.gif" width="1" height="5"><br />Create/ edit document</span>
            
            	<table cellpadding="0" cellspacing="0">
            		<tr>
            			<td id="SM_Button1" onclick="documentDirty=false; document.mutate.save.click();"><img src="media/images/icons/save.gif" align="absmiddle"> Save</td>
            				<script>createButton(document.getElementById("SM_Button1"));</script>
            			<td id="SM_Button2" onclick="deletedocument();"><img src="media/images/icons/delete.gif" align="absmiddle"> Delete</span></td>
            				<script>createButton(document.getElementById("SM_Button2"));</script>
            
            							<td id="SM_Button5" onclick="'."document.location.href='index.php?a=3&id=$id'".';"><img src="media/images/icons/cancel.gif" align="absmiddle"> Cancel</td>
            				<script>createButton(document.getElementById("SM_Button5"));</script>
            		</tr>
            	</table>
            	<div class="subTitle">   
            	<table border="0" cellspacing="1" cellpadding="1">
            	<tr>
            		<td><span class="comment"> After saving:</span></td>
            		<td><input name="stay" type="radio" class="inputBox" value="1"   /></td><td><span class="comment">Add another</span></td> 
            		<td><input name="stay" type="radio" class="inputBox" value="2"   /></td><td><span class="comment">Continue editing</span></td>
            		<td><input name="stay" type="radio" class="inputBox" value=""  checked='."'checked'".' /></td><td><span class="comment">Close</span></td>
            	</tr>
            	</table>
            	</div>
            </div>';
                  $e->output($html);
            }
              • 27330
              • 884 Posts
              Anyone knows how to make "SaveMe" as default in manager and not just when editing documents?
              I wanna have it there also when editing chunks/TVs/plugins

              I tried to check few other boxes in System Events with similar names but doesn’t seem to help me here...
                • 27330
                • 884 Posts
                I really like this plugin, and I wanted it to be global whenevr I edit anything in MODx so I tweaked the code and now it’s working nice.
                I’m pretty novice when it comes to programing and I’m pretty sure there is a better, neater K.I.S.S way to add OR in case: situations like this. if anyone see’s a better way to code it please drop some text.

                anyway, this is the code I got now in the plugin.
                you’ll also need to check some boxes in System Events, in my case it was: OnChunkFormRender, OnDocFormRender, OnModFormRender, OnPluginFormRender, OnSnipFormRender, OnTVFormRender, OnTempFormRender.


                $e = & $modx->Event;
                switch ($e->name) {
                   case "OnDocFormRender":
                      $html = '<div class="subTitle" style="position:absolute; top:0px; left:0px; width:100%; z-index:30; position:fixed;">
                	<span class="right"><img src="media/images/_tx_.gif" width="1" height="5"><br />Create/ edit document</span>
                
                	<table cellpadding="0" cellspacing="0">
                		<tr>
                			<td id="Button1" onclick="documentDirty=false; document.mutate.save.click();"><img src="media/images/icons/save.gif" align="absmiddle"> Save</td>
                				<script>createButton(document.getElementById("Button1"));</script>
                			<td id="Button2" onclick="deletedocument();"><img src="media/images/icons/delete.gif" align="absmiddle"> Delete</span></td>
                				<script>createButton(document.getElementById("Button2"));</script>
                
                							<td id="Button5" onclick="'."document.location.href='index.php?a=3&id=79'".';"><img src="media/images/icons/cancel.gif" align="absmiddle"> Cancel</td>
                				<script>createButton(document.getElementById("Button5"));</script>
                		</tr>
                	</table>
                	<div class="subTitle">   
                	<table border="0" cellspacing="1" cellpadding="1">
                	<tr>
                		<td><span class="comment"> After saving:</span></td>
                		<td><input name="stay" type="radio" class="inputBox" value="1"   /></td><td><span class="comment">Add another</span></td> 
                		<td><input name="stay" type="radio" class="inputBox" value="2"   /></td><td><span class="comment">Continue editing</span></td>
                		<td><input name="stay" type="radio" class="inputBox" value=""  checked='."'checked'".' /></td><td><span class="comment">Close</span></td>
                	</tr>
                	</table>
                	</div>
                </div>';
                      $e->output($html);
                
                  // show also when creating Chunks
                   
                case "OnChunkFormRender":
                      $html = '<div class="subTitle" style="position:absolute; top:0px; left:0px; width:100%; z-index:30; position:fixed;">
                	<span class="right"><img src="media/images/_tx_.gif" width="1" height="5"><br />Create/ edit document</span>
                
                	<table cellpadding="0" cellspacing="0">
                		<tr>
                			<td id="Button1" onclick="documentDirty=false; document.mutate.save.click();"><img src="media/images/icons/save.gif" align="absmiddle"> Save</td>
                				<script>createButton(document.getElementById("Button1"));</script>
                			<td id="Button2" onclick="deletedocument();"><img src="media/images/icons/delete.gif" align="absmiddle"> Delete</span></td>
                				<script>createButton(document.getElementById("Button2"));</script>
                
                							<td id="Button5" onclick="'."document.location.href='index.php?a=3&id=79'".';"><img src="media/images/icons/cancel.gif" align="absmiddle"> Cancel</td>
                				<script>createButton(document.getElementById("Button5"));</script>
                		</tr>
                	</table>
                	<div class="subTitle">   
                	<table border="0" cellspacing="1" cellpadding="1">
                	<tr>
                		<td><span class="comment"> After saving:</span></td>
                		<td><input name="stay" type="radio" class="inputBox" value="1"   /></td><td><span class="comment">Add another</span></td> 
                		<td><input name="stay" type="radio" class="inputBox" value="2"   /></td><td><span class="comment">Continue editing</span></td>
                		<td><input name="stay" type="radio" class="inputBox" value=""  checked='."'checked'".' /></td><td><span class="comment">Close</span></td>
                	</tr>
                	</table>
                	</div>
                </div>';
                      $e->output($html);
                      
                      // show also when creating Modules
                      
                case "OnModFormRender":
                      $html = '<div class="subTitle" style="position:absolute; top:0px; left:0px; width:100%; z-index:30; position:fixed;">
                	<span class="right"><img src="media/images/_tx_.gif" width="1" height="5"><br />Create/ edit document</span>
                
                	<table cellpadding="0" cellspacing="0">
                		<tr>
                			<td id="Button1" onclick="documentDirty=false; document.mutate.save.click();"><img src="media/images/icons/save.gif" align="absmiddle"> Save</td>
                				<script>createButton(document.getElementById("Button1"));</script>
                			<td id="Button2" onclick="deletedocument();"><img src="media/images/icons/delete.gif" align="absmiddle"> Delete</span></td>
                				<script>createButton(document.getElementById("Button2"));</script>
                
                							<td id="Button5" onclick="'."document.location.href='index.php?a=3&id=79'".';"><img src="media/images/icons/cancel.gif" align="absmiddle"> Cancel</td>
                				<script>createButton(document.getElementById("Button5"));</script>
                		</tr>
                	</table>
                	<div class="subTitle">   
                	<table border="0" cellspacing="1" cellpadding="1">
                	<tr>
                		<td><span class="comment"> After saving:</span></td>
                		<td><input name="stay" type="radio" class="inputBox" value="1"   /></td><td><span class="comment">Add another</span></td> 
                		<td><input name="stay" type="radio" class="inputBox" value="2"   /></td><td><span class="comment">Continue editing</span></td>
                		<td><input name="stay" type="radio" class="inputBox" value=""  checked='."'checked'".' /></td><td><span class="comment">Close</span></td>
                	</tr>
                	</table>
                	</div>
                </div>';
                      $e->output($html);
                
                   // show also when creating Plugins
                
                case "OnPluginFormRender":
                      $html = '<div class="subTitle" style="position:absolute; top:0px; left:0px; width:100%; z-index:30; position:fixed;">
                	<span class="right"><img src="media/images/_tx_.gif" width="1" height="5"><br />Create/ edit document</span>
                
                	<table cellpadding="0" cellspacing="0">
                		<tr>
                			<td id="Button1" onclick="documentDirty=false; document.mutate.save.click();"><img src="media/images/icons/save.gif" align="absmiddle"> Save</td>
                				<script>createButton(document.getElementById("Button1"));</script>
                			<td id="Button2" onclick="deletedocument();"><img src="media/images/icons/delete.gif" align="absmiddle"> Delete</span></td>
                				<script>createButton(document.getElementById("Button2"));</script>
                
                							<td id="Button5" onclick="'."document.location.href='index.php?a=3&id=79'".';"><img src="media/images/icons/cancel.gif" align="absmiddle"> Cancel</td>
                				<script>createButton(document.getElementById("Button5"));</script>
                		</tr>
                	</table>
                	<div class="subTitle">   
                	<table border="0" cellspacing="1" cellpadding="1">
                	<tr>
                		<td><span class="comment"> After saving:</span></td>
                		<td><input name="stay" type="radio" class="inputBox" value="1"   /></td><td><span class="comment">Add another</span></td> 
                		<td><input name="stay" type="radio" class="inputBox" value="2"   /></td><td><span class="comment">Continue editing</span></td>
                		<td><input name="stay" type="radio" class="inputBox" value=""  checked='."'checked'".' /></td><td><span class="comment">Close</span></td>
                	</tr>
                	</table>
                	</div>
                </div>';
                      $e->output($html);
                
                // show also when creating Snippets
                
                case "OnSnipFormRender":
                      $html = '<div class="subTitle" style="position:absolute; top:0px; left:0px; width:100%; z-index:30; position:fixed;">
                	<span class="right"><img src="media/images/_tx_.gif" width="1" height="5"><br />Create/ edit document</span>
                
                	<table cellpadding="0" cellspacing="0">
                		<tr>
                			<td id="Button1" onclick="documentDirty=false; document.mutate.save.click();"><img src="media/images/icons/save.gif" align="absmiddle"> Save</td>
                				<script>createButton(document.getElementById("Button1"));</script>
                			<td id="Button2" onclick="deletedocument();"><img src="media/images/icons/delete.gif" align="absmiddle"> Delete</span></td>
                				<script>createButton(document.getElementById("Button2"));</script>
                
                							<td id="Button5" onclick="'."document.location.href='index.php?a=3&id=79'".';"><img src="media/images/icons/cancel.gif" align="absmiddle"> Cancel</td>
                				<script>createButton(document.getElementById("Button5"));</script>
                		</tr>
                	</table>
                	<div class="subTitle">   
                	<table border="0" cellspacing="1" cellpadding="1">
                	<tr>
                		<td><span class="comment"> After saving:</span></td>
                		<td><input name="stay" type="radio" class="inputBox" value="1"   /></td><td><span class="comment">Add another</span></td> 
                		<td><input name="stay" type="radio" class="inputBox" value="2"   /></td><td><span class="comment">Continue editing</span></td>
                		<td><input name="stay" type="radio" class="inputBox" value=""  checked='."'checked'".' /></td><td><span class="comment">Close</span></td>
                	</tr>
                	</table>
                	</div>
                </div>';
                      $e->output($html);
                
                // show also when creating TVs
                
                case "OnTVFormRender":
                      $html = '<div class="subTitle" style="position:absolute; top:0px; left:0px; width:100%; z-index:30; position:fixed;">
                	<span class="right"><img src="media/images/_tx_.gif" width="1" height="5"><br />Create/ edit document</span>
                
                	<table cellpadding="0" cellspacing="0">
                		<tr>
                			<td id="Button1" onclick="documentDirty=false; document.mutate.save.click();"><img src="media/images/icons/save.gif" align="absmiddle"> Save</td>
                				<script>createButton(document.getElementById("Button1"));</script>
                			<td id="Button2" onclick="deletedocument();"><img src="media/images/icons/delete.gif" align="absmiddle"> Delete</span></td>
                				<script>createButton(document.getElementById("Button2"));</script>
                
                							<td id="Button5" onclick="'."document.location.href='index.php?a=3&id=79'".';"><img src="media/images/icons/cancel.gif" align="absmiddle"> Cancel</td>
                				<script>createButton(document.getElementById("Button5"));</script>
                		</tr>
                	</table>
                	<div class="subTitle">   
                	<table border="0" cellspacing="1" cellpadding="1">
                	<tr>
                		<td><span class="comment"> After saving:</span></td>
                		<td><input name="stay" type="radio" class="inputBox" value="1"   /></td><td><span class="comment">Add another</span></td> 
                		<td><input name="stay" type="radio" class="inputBox" value="2"   /></td><td><span class="comment">Continue editing</span></td>
                		<td><input name="stay" type="radio" class="inputBox" value=""  checked='."'checked'".' /></td><td><span class="comment">Close</span></td>
                	</tr>
                	</table>
                	</div>
                </div>';
                      $e->output($html);
                    
                 // show also when creating Templates
                      
                      case "OnTempFormRender":
                      $html = '<div class="subTitle" style="position:absolute; top:0px; left:0px; width:100%; z-index:30; position:fixed;">
                	<span class="right"><img src="media/images/_tx_.gif" width="1" height="5"><br />Create/ edit document</span>
                
                	<table cellpadding="0" cellspacing="0">
                		<tr>
                			<td id="Button1" onclick="documentDirty=false; document.mutate.save.click();"><img src="media/images/icons/save.gif" align="absmiddle"> Save</td>
                				<script>createButton(document.getElementById("Button1"));</script>
                			<td id="Button2" onclick="deletedocument();"><img src="media/images/icons/delete.gif" align="absmiddle"> Delete</span></td>
                				<script>createButton(document.getElementById("Button2"));</script>
                
                							<td id="Button5" onclick="'."document.location.href='index.php?a=3&id=79'".';"><img src="media/images/icons/cancel.gif" align="absmiddle"> Cancel</td>
                				<script>createButton(document.getElementById("Button5"));</script>
                		</tr>
                	</table>
                	<div class="subTitle">   
                	<table border="0" cellspacing="1" cellpadding="1">
                	<tr>
                		<td><span class="comment"> After saving:</span></td>
                		<td><input name="stay" type="radio" class="inputBox" value="1"   /></td><td><span class="comment">Add another</span></td> 
                		<td><input name="stay" type="radio" class="inputBox" value="2"   /></td><td><span class="comment">Continue editing</span></td>
                		<td><input name="stay" type="radio" class="inputBox" value=""  checked='."'checked'".' /></td><td><span class="comment">Close</span></td>
                	</tr>
                	</table>
                	</div>
                </div>';
                      $e->output($html);
                
                }
                  • 6470
                  • 69 Posts
                  here in another transparent version of save ME

                  I left just SAVE button
                  and made it big, and fixed on the bottom of the page

                  /*saveMe
                  modification of the original Save Me by daniel K
                  4steps.ru
                  
                     case "OnDocFormRender":   $e->output($html);break;
                     case "OnChunkFormRender":$e->output($html);break;
                     case "OnPluginFormRender":$e->output($html);break;
                     case "OnModFormRender":$e->output($html);break;
                     case "OnSnipFormRender":$e->output($html);break;
                     case "OnTVFormRender":$e->output($html);break;
                  
                  produce a nice set of buttons on the left bottom of page
                  which are sticked to a fixed place
                  */
                  $html = '<ol style="bottom:0; left:3em; padding:1em; z-index:30; position:fixed;background:red;">
                        <li id="Button1" onclick="documentDirty=false; document.mutate.save.click();"><img src="media/style/MODxLight/images/icons/save.gif" align="absmiddle"> Save</li>
                                  
                       <li id="Button2" onclick="deletedocument();"><img src="media/style/MODxLight/images/icons/delete.gif" align="absmiddle"> Delete<li>
                                  
                  
                       <li id="Button5" onclick="'."document.location.href='index.php?a=3&id=79'".';"><img src="media/style/MODxLight/images/icons/cancel.gif" align="absmiddle"> Cancel</li>
                                  <script>createButton(document.getElementById("Button5"));</script>
                       </ol>';
                  
                  
                  $html='
                  <style>
                  .save_but {
                  background: #bee860 url(\'media/style/MODxLight/images/misc/greenfade.gif\') repeat-x;
                  
                   position:relative;
                  border:1px solid black;
                    padding:1em;
                    margin:0;
                     
                  }
                  div.w {
                  filter: alpha(opacity=40);
                  filter: progid:DXImageTransform.Microsoft.Alpha(opacity=40);
                   -moz-opacity: 0.40; opacity:0.5;}
                  
                  div.out .save_but:active, div.out .save_but:hover, div.out .save_but:focus, .out:active {
                   filter: alpha(opacity=100);
                   filter: progid:DXImageTransform.Microsoft.Alpha(opacity=100);
                   -moz-opacity: 1.00; opacity:2;
                  }
                  .save_but:active,.save_but:hover , .out:hover , .out:active {
                  background-position: 0 0;}
                  
                  .save_but p{
                    font:bold 3em arial;
                    vertical-align:middle;
                  
                    color:black;  }
                  .save_but p:before {
                    content: "Save";
                    display: block;
                    margin: 0 0 -1.2em 0.1em;
                    color:#e7f8c3;  }
                  
                  .out {
                    display:block;
                    background:;
                    border:1px solid #fff;
                    position:fixed;
                  z-index:30;
                    margin:1em 0;
                    padding:0;
                    width:10em;
                    left:4em;
                    bottom:15em;
                   
                  }
                  /**/<!--[if IE]>
                  * html, 
                  * html body { 
                  
                  height: 100%;
                  margin: 0;
                  padding: 0; 
                  }
                  * html #iefix { 
                  height: 100%;
                  
                  position: relative;
                  }
                  
                  * html .out{
                  position: absolute;
                  }
                  
                   
                  <![endif]-->
                  </style>
                  <div id="iefix"></div>
                  <div class="out"><div class="save_but" onclick="documentDirty=false; document.mutate.save.click();"><p>Save</p></div></div>';
                  
                  $e = & $modx->Event;
                  switch ($e->name) {
                     case "OnDocFormRender":   $e->output($html);break;
                     case "OnChunkFormRender":$e->output($html);break;
                     case "OnPluginFormRender":$e->output($html);break;
                     case "OnModFormRender":$e->output($html);break;
                     case "OnSnipFormRender":$e->output($html);break;
                     case "OnTVFormRender":$e->output($html);break;
                     
                   
                     }
                  
                  
                    • 28907
                    • 16 Posts
                    Is it possible that this will work in MODx 0.9.6.3?
                    • FYI, this plugin won’t be needed in Evo or Revo as the button bars are now static.
                        Ryan Thrash, MODX Co-Founder
                        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me