• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

[HELPED]ifs default directory

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [HELPED]ifs default directory

    How can I set my source editor to automatically drill down to a specified directory without manually doing it each startup?

  • #2
    There's no feature for that in the Nitro Source Editor. Maybe someone will respond with a suggested customization.

    Comment


    • #3
      iDav,

      I have made a small modification to The Editor so that it will look at local storage for a default location. If found it will use that instead of the default '/'.

      Code:
                      var defaultLoc = (localStorage) ? localStorage.getItem(window.location.host + 'defaultFolder') : null;
                      var tree = new Nitro.editor.tree.IfsExplorer({
                          region: 'west',
                          collapsible: true,
                          split: true,
                          width: 200,
                          root: {
                              id: (defaultLoc) ? defaultLoc : '/',
                              text: (defaultLoc) ? defaultLoc : 'IFS Root',
                              expanded: true,
                              iconCls: (defaultLoc) ? 'folder' : 'server'
                          },
                          listeners: {
                              opensource: function(o) {
                                  mainpanel.openSource(o);
                              },
                              createnewblankfile: function(fileName, node) {
                                  mainpanel.createNewBlankFile(fileName, node);
                              }
                          }
                      });
      1. Replace the index.html file with the one attached in this post. The index.html location on the ifs is yourValenceDirectory/html/nitro/editor/index.html
      2. Using Chrome/Firefox navigate to the valence login page and open the developer console and set you default directory using localStorage.setItem. Example on setting the Valence 3.2 base html as your default root folder "localStorage.setItem(window.location.host + 'defaultFolder', '/valence-3.2/html');"


      Using "window.location.host" as part of the item identifier will allow you to have a default location of each valence instance if your using multiple instances.

      At anytime you can change the default folder by running the localStorage.setItem always passing the first variable of "window.location.host + 'defaultFolder'" and the second param would be a valid folder path on your ifs.

      If you want to go back so that The Editor looks at the root of the ifs just perform "localStorage.removeItem(window.location.host + 'defaultFolder');"

      I have attached two files one screenshot of setting the default folder and the index.html (in the zip file) that you would need to replace.

      Thanks

      Screen Shot 2013-06-20 at 10.09.40 AM.jpgindex.html.zip

      Comment

      Working...
      X