home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 2000 July / macformat-092.iso / Dreamweaver 3 / Configuration / Menus / MM / Site_File.js < prev    next >
Encoding:
Text File  |  1999-12-01  |  2.8 KB  |  139 lines

  1. // Copyright 1999 Macromedia, Inc. All rights reserved.
  2.  
  3.     function receiveArguments()
  4.     {
  5.         var itemID = arguments[0];
  6.         var docPath = dw.getDocumentPath('document');
  7.         if (itemID == "connect")
  8.         {
  9.             if (site.getConnectionState() == true)
  10.                 site.setConnectionState(false);
  11.             else
  12.                 site.setConnectionState(true);
  13.         }
  14.         if (itemID == "put")
  15.         {
  16.             if (dw.getFocus() == 'site')
  17.                 site.put("site");
  18.             else
  19.                 site.put(docPath);
  20.         }
  21.         if (itemID == "get")
  22.         {
  23.             if (dw.getFocus() == 'site')
  24.                 site.get("site");
  25.             else
  26.                 site.get(docPath);
  27.         }
  28.         if (itemID == "checkout")
  29.         {
  30.             if (dw.getFocus() == 'site')
  31.                 site.checkOut("site");
  32.             else
  33.                 site.checkOut(docPath);
  34.         }
  35.         if (itemID == "checkin")
  36.         {
  37.             if (dw.getFocus() == 'site')
  38.                 site.checkIn("site");
  39.             else
  40.                 site.checkIn(docPath);
  41.         }
  42.         if (itemID == "undocheckout")
  43.         {
  44.             if (dw.getFocus() == 'site')
  45.                 site.undoCheckOut("site");
  46.             else
  47.                 site.undoCheckOut(docPath);
  48.         }
  49.         if (itemID == "findlocal")
  50.         {
  51.             if (dw.getFocus() == 'site')
  52.                 site.findInSiteFiles("local","site");
  53.             else
  54.                 site.findInSiteFiles("local", docPath);
  55.         }
  56.         if (itemID == "findremote")
  57.         {
  58.             if (dw.getFocus() == 'site')
  59.                 site.findInSiteFiles("remote","site");
  60.             else
  61.                 site.findInSiteFiles("remote", docPath);
  62.         }
  63.  
  64.    }
  65.  
  66.    function canAcceptCommand()
  67.    {
  68.         var itemID = arguments[0];
  69.         var docPath = dw.getDocumentPath('document');
  70.         if (itemID == "connect")
  71.         {
  72.             return dw.getFocus() == 'site' && site.canConnect();
  73.         }
  74.         if (itemID == "put")
  75.         {
  76.             if (dw.getFocus() == 'site')
  77.                 return site.canPut("site");
  78.             else
  79.                 return site.canPut(docPath);
  80.         }
  81.         if (itemID == "get")
  82.         {
  83.             if (dw.getFocus() == 'site')
  84.                 return site.canGet("site");
  85.             else
  86.                 return site.canGet(docPath);
  87.         }
  88.         if (itemID == "checkout")
  89.         {
  90.             if (dw.getFocus() == 'site')
  91.                 return site.canCheckOut("site");
  92.             else
  93.                 return site.canCheckOut(docPath);
  94.         }
  95.         if (itemID == "checkin")
  96.         {
  97.             if (dw.getFocus() == 'site')
  98.                 return site.canCheckIn("site");
  99.             else
  100.                 return site.canCheckIn(docPath);
  101.         }
  102.         if (itemID == "undocheckout")
  103.         {
  104.             if (dw.getFocus() == 'site')
  105.                 return site.canUndoCheckOut("site");
  106.             else
  107.                 return site.canUndoCheckOut(docPath);
  108.         }
  109.         if (itemID == "findlocal")
  110.         {
  111.             if (dw.getFocus() == 'site')
  112.                 return site.canFindInSiteFiles("local","site");
  113.             else
  114.                 return site.canFindInSiteFiles("local",docPath);
  115.         }
  116.         if (itemID == "findremote")
  117.         {
  118.             if (dw.getFocus() == 'site')
  119.                 return site.canFindInSiteFiles("remote","site");
  120.             else
  121.                 return site.canFindInSiteFiles("remote",docPath);
  122.         }
  123.         return true;
  124.    }
  125.  
  126.    function setMenuText()
  127.    {
  128.         var itemID = arguments[0];
  129.          if (itemID == "connect")
  130.         {
  131.             if (site.getConnectionState() == true)
  132.                 return MENU_Disconnect;
  133.             else
  134.                 return MENU_Connect;
  135.         }
  136.         else
  137.             return "";
  138.    }
  139.