home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 May / Chip Mayıs 2001.iso / prog / share / 30 / setup.exe / data1.cab / Fsi_-_English / InitService / Service.js < prev    next >
Encoding:
Text File  |  2001-03-15  |  7.4 KB  |  168 lines

  1. function createService(service, name, accountName, serviceId)
  2. {
  3.     if (name == 'Counter')
  4.     {
  5.         service.SetPlaceholderImage(".\\InitService\\Counter.gif");
  6.         service.SetHTML("<!-- Counter code version 1.0. Do NOT alter this code!\n" +
  7.             "  http://counter.mycomputer.com -->\n" +
  8.             "<SCRIPT language=JavaScript\n" +
  9.             "  src=\"http://counter.mycomputer.com/get_counter.html?u=" + 
  10.                accountName + "&c=" + 
  11.                serviceId + "\">\n" +
  12.             "<" + "/SCRIPT>\n" +
  13.             "<NOSCRIPT>\n" +
  14.             "  <a href=\"http://counter.mycomputer.com/\"><img alt=\"Counter\"\n" +
  15.             "src=\"http://counter.mycomputer.com/c.count?u=" +
  16.                accountName + "&c=" + 
  17.                serviceId + "\" border=0></a>\n" +
  18.             "</NOSCRIPT>\n" +
  19.             "<!-- End of Counter Code -->");
  20.     }
  21.     else if (name == 'Superstats')
  22.     {
  23.         service.SetPlaceholderImage(".\\InitService\\superstats.gif");
  24.         service.SetHTML('<!-- Start Superstats code version 3.0b. http://v2.superstats.com -->\n' +
  25.                         '<script language="JavaScript">\n' +
  26.                         'var pageName = "%pagename%";\n' +
  27.                         'var server = "Server";\n' +
  28.                         'var channel = "Channel";\n' +
  29.                         '/**** DO NOT ALTER ANYTHING BELOW THIS LINE! ****/\n' +
  30.                         'var code = \' \'; </script>\n' +
  31.                         '<script src="http://code.superstats.com/code/ss/' + accountName + '/0/30b">\n' +
  32.                         '</script><script language="JavaScript">\n' +
  33.                         'br = navigator.appName + parseInt(navigator.appVersion);\n' +
  34.                         'if (code != \' \' || br == \'Netscape2\') document.write(code);\n' +
  35.                         'else document.write(\'<a\'\n' +
  36.                         '+ \' href="http://stats.superstats.com/c/ss/' + accountName + '" target="_top"><img\'\n' +
  37.                         '+ \' src="http://stats.superstats.com/b/ss/' + accountName + '/0\'\n' +
  38.                         '+ \'?pageName=\' + escape(pageName) + \'&server=\' + escape(server)\n' +
  39.                         '+ \'&channel=\' + escape(channel) + \'" border=0></a>\');\n' +
  40.                         'document.write(\'<\'); document.write(\'!-- \');\n' +
  41.                         '</script><noscript><a\n' +
  42.                         'href="http://stats.superstats.com/c/ss/' + accountName + '"\n' +
  43.                         'target="_top"><img src="http://stats.superstats.com/b/ss/' + accountName + '/1"\n' +
  44.                         'border=0></a></noscript>\n' +
  45.                         '<script language="JavaScript">\n' +
  46.                         'document.write(\' --\'); document.write(\'>\');\n' +
  47.                         '</script> <!-- End Superstats banner code. -->');
  48.     }
  49.     else if (name == 'SiteMiner')
  50.     {
  51.         service.SetPlaceholderImage(".\\InitService\\siteminer.gif");
  52.         service.SetHTML('<!-- MyComputer.com SiteMiner code version 2.0.\n' +
  53.                         'Do NOT alter this code! http://siteminer.mycomputer.com -->\n' +
  54.                         '<NOSCRIPT>\n' +
  55.                         '<a href="http://siteminer.mycomputer.com/searchpage.html?u=' + accountName + '&s=' + serviceId + '">\n' +
  56.                         ' Click here to search my site</a>\n' +
  57.                         '</NOSCRIPT>\n' +
  58.                         '<script Language="JavaScript" \n' +
  59.                         ' src="http://siteminer.mycomputer.com/get_searchbox.html?u=' + accountName + '&s=' + serviceId + '">\n' +
  60.                         '</script>\n' +
  61.                         '<!-- End of MyComputer.com SiteMiner code. -->');
  62.     }
  63.     else if (name == 'EZPolls' || name == 'EzPolls')
  64.     {
  65.         service.SetPlaceholderImage(".\\InitService\\ezpolls.gif");
  66.         service.SetHTML('<!-- Start of EZPoll Code v1.5- brought to you by MyComputer.com\n' +
  67.                         'www.mycomputer.com -- Do NOT alter this code! -->\n' +
  68.                         '<script language="Javascript">\n' +
  69.                         'var zcode = " "\n' +
  70.                         '</script>\n' +
  71.                         '<script src="http://ezpolls.mycomputer.com/ezpoll.html?u=' + accountName + '&p=' + serviceId + '">\n' +
  72.                         '</script>\n' +
  73.                         '<script language="Javascript">\n' +
  74.                         'document.write(zcode)\n' +
  75.                         '</script>\n' +
  76.                         '<!-- End of EZPoll Code -->');
  77.     }
  78.     else if (name == 'Guestbook')
  79.     {
  80.         service.SetPlaceholderImage(".\\InitService\\guestbook.gif");
  81.         service.SetHTML('<!-- Start of GuestBook code version 1.0 - brought to you by MyComputer.com\n' +
  82.                         'www.mycomputer.com -- Do NOT alter this code! -->\n' +
  83.                         '<NOSCRIPT><A HREF="http://guestbook.mycomputer.com/guest.html?u=' + accountName + '&b=' + serviceId + '">Sign my Guestbook.</A></NOSCRIPT>\n' +
  84.                         '<NOSCRIPT><A HREF="http://guestbook.mycomputer.com/guest.html?u=' + accountName + '&b=' + serviceId + '&show=1">View my Guestbook.</A></NOSCRIPT>\n' +
  85.                         '<SCRIPT Language=JavaScript src="http://guestbook.mycomputer.com/get_guestbook.html?u=' + accountName + '&b=' + serviceId + '">\n' +
  86.                         '</SCRIPT>\n' +
  87.                         '<!-- End of MyComputer.com\'s GuestBook code. -->');
  88.     }
  89.     else if (name == 'BoardServer')
  90.     {
  91.         service.SetPlaceholderImage(".\\InitService\\boardserver.gif");
  92.         service.SetHTML('<!-- Start BoardServer.com code version 1.0a. \n' +
  93.                         'Do not alter this code! http://boardserver.mycomputer.com -->\n' +
  94.                         '<script language="JavaScript"> \n' +
  95.                         ' var boardserver = " ";</script>\n' +
  96.                         '<script src=\'http://boardserver.mycomputer.com/getcode.html?u=' + accountName + '&f=' + serviceId + '\'></script>\n' +
  97.                         '<script language="JavaScript"> \n' +
  98.                         ' document.write(boardserver);\n' +
  99.                         '</script><!-- End Boardserver.com code. -->');
  100.     }
  101.  
  102.     service.Initialized = true;
  103.     service.SetVar("accountName", accountName);
  104.     service.SetVar("serviceId", serviceId);
  105.     service.Name = name;
  106.     service.Location = '.\\InitService\\ConfigService.html';
  107.     service.Method = 'run()';
  108. }
  109.  
  110. function configService()
  111. {
  112.     choice = window.showModalDialog("ServiceConfig.html", 0,
  113.             "status:no;help:no;border:thin;dialogWidth:290px;dialogHeight:240px;center:yes;scroll:no;");
  114.  
  115.     if (!choice)
  116.         return;
  117.  
  118.     app = new ActiveXObject('FSI.FSIApplication');            
  119.     service = app.GetCurrentComponent();
  120.     accountName = service.GetVar('accountName');
  121.     serviceId = service.GetVar('serviceId');
  122.  
  123.     app.SetSystemVar('myc_current_account', accountName);
  124.  
  125.     w = window.screen.availWidth;
  126.     h = window.screen.availHeight;
  127.     if (w > 700)
  128.         w = 700;
  129.  
  130.     pw = '';
  131.  
  132.     if (service.Name == 'Superstats')
  133.         pw = 'mycst_'
  134.     else
  135.         pw = 'myc_'
  136.  
  137.     pw += accountName;
  138.  
  139.     if (!app.HasPassword(pw))
  140.     {
  141.         app.SetInstVar('accountName', accountName);
  142.         choice = window.showModalDialog("Password.html", 0,
  143.                 "status:no;help:no;border:thin;dialogWidth:260px;dialogHeight:160px;center:yes;scroll:no;");
  144.         if (!choice)
  145.             return;
  146.     }
  147.  
  148.     name = service.Name;
  149.  
  150.     if (name == 'Counter')
  151.         app.OpenDialog('http://counter.mycomputer.com/configure.html?username=' + accountName +
  152.                         '&password=%pw_myc_' + accountName + '%&c=' + serviceId, '', w, h);
  153.     else if (name == 'Superstats')
  154.         app.OpenDialog('http://v2.superstats.com/v3/reports/ss_manager.html?username=' + accountName +
  155.                         '&password=%pw_mycst_' + accountName + '%', '', w, h);
  156.     else if (name == 'SiteMiner')
  157.         app.OpenDialog('http://siteminer.mycomputer.com/configure2.html?username=' + accountName +
  158.                         '&password=%pw_myc_' + accountName + '%&site=' + serviceId, '', w, h);
  159.     else if (name == 'EZPolls' || name == 'EzPolls')
  160.         app.OpenDialog('http://ezpolls.mycomputer.com/editpoll.html?username=' + accountName +
  161.                         '&password=%pw_myc_' + accountName + '%&pollid=' + serviceId, '', w, h);
  162.     else if (name == 'Guestbook')
  163.         app.OpenDialog('http://guestbook.mycomputer.com/config.html?username=' + accountName +
  164.                         '&password=%pw_myc_' + accountName + '%&bookid=' + serviceId, '', w, h);
  165.     else if (name == 'BoardServer')
  166.         app.OpenDialog('http://boardserver.mycomputer.com/configure2.html?username=' + accountName +
  167.                         '&password=%pw_myc_' + accountName + '%&fid=' + serviceId, '', w, h);
  168. }