<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; HTA: записная книжка]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=2417&amp;type=atom" />
	<updated>2008-11-05T12:59:11Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=2417</id>
		<entry>
			<title type="html"><![CDATA[HTA: записная книжка]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=15557#p15557" />
			<content type="html"><![CDATA[<p>Программа для хранения текстов, мелких записей, статеек, ссылок и прочей плохо поддающейся структурированию информации.<br />Своеобразный аналог <a href="http://www.amlpages.com/about.shtml">http://www.amlpages.com/about.shtml</a> или <a href="http://www.script-coding.com/ScrapBook.html">ScrapBook</a>.<br /></p><div class="codebox"><pre><code>&lt;HTML&gt;&lt;HEAD&gt;
&lt;TITLE&gt;DataMix(null created)&lt;/TITLE&gt;
&lt;meta content=&quot;HTML 4.0&quot; name=vs_targetSchema&gt;
&lt;META content=JavaScript name=vs_defaultClientScript&gt;
&lt;META http-equiv=Content-Type content=&quot;text/html; charset=windows-1251&quot;&gt;&lt;hta:application id=DataMix 
applicationname=&quot;DataMix&quot; border=&quot;thick&quot; borderstyle=&quot;normal&quot; caption=&quot;yes&quot; 
contextmenu=&quot;yes&quot; innerborder=&quot;yes&quot; maximizebutton=&quot;yes&quot; minimizebutton=&quot;yes&quot; 
navigable=&quot;no&quot; scroll=&quot;auto&quot; scrollflat=&quot;no&quot; showintaskbar=&quot;yes&quot; 
singleinstance=&quot;no&quot; sysmenu=&quot;yes&quot; version=&quot;1.0&quot; windowstate=&quot;normal&quot; /&gt;
&lt;!-- body * { font:9pt/11pt Verdana; color:#005 } --&gt;
&lt;style type=text/css&gt;
  body { margin:0; background:#eee; font-family: verdana; font-size:10px;  }
  td { background:#eee; padding:0.1em; text-indent:0.1em;font-family: verdana; }
  select { width: 270px;}
      
  a.help { text-decoration:none;}
  a.help span { display:none;}
  a.help:hover { position:relative; }
  a.help:hover span { position:absolute; display:block; left:10px; top:-15px;
  

&lt;/style&gt;

&lt;SCRIPT event=onunload for=window&gt;
    if (RemoteDataOnlyName!= &quot;Data.xml&quot;)
    {
      SaveBase=window.confirm(&quot;Используемая вами база, загружена из интернета и имеет имя отличное от Data.xml, Сохранить использумую базу в текущую папку под именем Data.xml?\nЕсли в текущей папке имеется файл с именем Data.xml, то он будет перезаписан.\nТекущая используемая база - &quot;+ RemoteData);
      if (SaveBase==true)
        {
          xmldoc.save(&quot;Data.xml&quot;);
        }
    }
&lt;/SCRIPT&gt;

&lt;SCRIPT language=javascript&gt;
  &lt;!-- скрыть скрипт от браузеров не поддерживающих их
  
  
  var WshShell = new ActiveXObject(&quot;WScript.Shell&quot;);
  var xmldoc = new ActiveXObject(&quot;MSXML.DomDocument&quot;);
  var RemoteXML = new ActiveXObject(&quot;Microsoft.XMLHTTP&quot;);
  var fso = new ActiveXObject(&quot;Scripting.FileSystemObject&quot;);
  var objIE = new ActiveXObject (&quot;InternetExplorer.Application&quot;);
  var UrlPath=window.location.pathname;
  var FileNamePath=UrlPath.replace(/%20/g,&quot; &quot;);
  var FolderPath = fso.GetParentFolderName(FileNamePath);   
  var XmlPath = FolderPath+&quot;\\Data.xml&quot;;
  var RemoteData=XmlPath;
  var RemoteDataOnlyName=&quot;Data.xml&quot;;
  
  function resize()    // изменение размера окна к приемлемому виду
  {
    window.resizeTo(screen.width-(screen.width/5),screen.height-(screen.height/6));
  }
  
  function LoadForm()
  {
    window.ListThemes.setAttribute(&quot;size&quot;,23);

    window.filedialog.style.display=&quot;none&quot;;
    window.AddForm.style.display=&quot;none&quot;;
    window.xmltools.style.display=&quot;none&quot;;
        
    function CreateData_xml()
    {
      try
      {
      var File = fso.CreateTextFile(XmlPath, true);
      File.WriteLine(&#039;&lt;?xml version=&quot;1.0&quot; encoding=&quot;windows-1251&quot;?&gt;&#039;);
      BaseName=window.prompt(&quot;Введите имя базы&quot;,&quot;DataMix&quot;); 
      File.WriteLine(&#039;&lt;root name=&quot;&#039;+BaseName+&#039;&quot;&gt;&#039;);
      GroupName=window.prompt(&quot;Введите имя первой создаваемой вами группы&quot;,&quot;group&quot;); 
      NodeName=window.prompt(&quot;Введите имя темы&quot;,&quot;node&quot;); 
      File.WriteLine(&#039;&lt;group name=&quot;&#039;+GroupName+&#039;&quot;&gt;&#039;);
      File.WriteLine(&#039;&lt;node name=&quot;&#039;+NodeName+&#039;&quot;&gt;&#039;);
      File.WriteLine(&quot;&lt;![CDATA[&quot;);
      File.WriteLine(&quot;]]&gt;&quot;);
      File.WriteLine(&quot;&lt;![CDATA[&quot;);
      File.WriteLine(&quot;]]&gt;&quot;);
      File.WriteLine(&quot;&lt;/node&gt;&lt;/group&gt;&lt;/root&gt;&quot;);
      File.close();
      xmldoc.load(&quot;Data.xml&quot;);
      RemoteDataOnlyName=&quot;Data.xml&quot;;
      }
      catch (err)
      {
        alert (&quot;Ошибка создания файла Data.xml - &quot;+err.description);
        window.close();
      }
    }
        
    if (fso.FileExists(XmlPath))
    { 
      if (!xmldoc.load(&quot;Data.xml&quot;))
      {
        alert(&quot;ОШИБКА ПАРСИНГА: &quot; + xmldoc.parseError.reason);
        NewBase=window.confirm(&quot;Переписать Data.xml?&quot;);
        if (NewBase==true)
        {
          CreateData_xml();
        }
        else
        {
          window.close(); 
        }
      }   
    }
    else
    {
      NewBase=window.confirm(&quot;Файл Data.xml не найден в текущей папке.\n\nOK-Создать новый файл\nОТМЕНА-Выбрать файл базы&quot;);
      if (NewBase==true)
        {
          CreateData_xml();
          alert (&quot;Создана новая пустая база&quot;);
        }
      else
        {
          //диалог выбора файла
          window.filedialog.click();
          if (window.filedialog.value == &quot;&quot;)
          {
            alert (&quot;Вы ничего не выбрали&quot;);
            window.close();
          }
          if (!xmldoc.load(window.filedialog.value))
          {
          alert(&quot;ОШИБКА ПАРСИНГА: &quot; + xmldoc.parseError.reason);
          window.close();
          }
          RemoteData=window.filedialog.value;
          alert(&quot;Выбрана база -&quot;+ RemoteData);
        }
    }
  RemoteDataXml.innerHTML=&quot;&lt;small&gt;Используемая база - &quot;+RemoteData+&quot;&lt;/small&gt;&quot;;
  try
  {
    document.title=xmldoc.documentElement.attributes(0).text;
  }
  catch(err)
  {
    document.title=&quot;DATAMIX - &quot;+RemoteData;
  }
  }
  
  function loadxml()
  {
    URL=window.prompt(&quot;Введите адрес (или путь к файлу) с которого вы хотите загрузить базу&quot;,&quot;http://x-r-w.narod.ru/Data.xml&quot;);
    if (URL!=null)
    {
    RemoteBase=window.confirm(&quot;Переписать локальный файл Data.xml?\n\nOK-Переписать\nОТМЕНА-Использовать другое имя&quot;);
    BaseName=window.prompt(&quot;Введите имя базы&quot;,&quot;OtherData.xml&quot;);
    if (RemoteBase==true)
      {
        RemoteData=FolderPath+&quot;\\Data.xml&quot;;
        RemoteDataOnlyName=&quot;Data.xml&quot;;
      }
    else
      {
        RemoteData=FolderPath+&quot;\\&quot;+BaseName;
        RemoteDataOnlyName=BaseName;
      }
    try
    {
      RemoteXML.open(&quot;GET&quot;, URL, false);
      RemoteXML.send();
      var XmlData = RemoteXML.responseText;
    
      var oStream = new ActiveXObject(&quot;ADODB.Stream&quot;)
      adTypeText = 2
      adSaveCreateOverWrite = 2
      oStream.type = 2
      oStream.open ()
      oStream.WriteText(XmlData)
      oStream.savetofile (RemoteData,adSaveCreateOverWrite);
      oStream.close();
      xmldoc.load(RemoteData);
      alert(&quot;База загружена из интернета, и сохранена под именем:\n&quot;+RemoteData);
      FillListGroup(ListGroup);
      FillListThemes(ListThemes,ListGroup);
      RemoteDataXml.innerHTML=&quot;&lt;small&gt;Используемая база - &quot;+RemoteData+&quot;&lt;/small&gt;&quot;;
    }
    catch (err) {alert (&quot;Ошибка загрузки - &quot;+err.description+&quot;&quot;);}
    }
  }
  
  function loadxmlfromfile()
  {
    window.filedialog.click();
    if (window.filedialog.value == &quot;&quot;)
    {
      alert (&quot;Вы ничего не выбрали&quot;);
    }
    else
    {
    if (!xmldoc.load(window.filedialog.value))
    {
    alert(&quot;ОШИБКА ПАРСИНГА: &quot; + xmldoc.parseError.reason);
    window.close();
    }
  
  RemoteData=window.filedialog.value;  
  RemoteDataXml.innerHTML=&quot;&lt;small&gt;Используемая база - &quot;+RemoteData+&quot;&lt;/small&gt;&quot;;
  try
  {
    document.title=xmldoc.documentElement.attributes(0).text+&quot; - &quot;+RemoteData;
  }
  catch (err)
  {
    document.title=&quot;DATAMIX - &quot;+RemoteData;
  }
  
  window.AddForm.style.display=&quot;none&quot;;
  window.xmltools.style.display=&quot;none&quot;;
  window.resultat.style.display=&quot;&quot;;
  FillListGroup(ListGroup);
  FillListThemes(ListThemes,ListGroup)
  }
  }
  
  function Run(CommandString)  // запуск программ
  {
    WshShell.Run(CommandString,1);  
  }
  
  function keyDown()
  {
    var code=event.keyCode;
    
    switch(code) 
    {
      case 112:
           alert(&quot;DataMix (null created)&quot;);
           break;
      case 116:
           alert (&quot;Внимание нажата клавиша F5, сейчас будет перегружен документ, и будет использоваться стандартная база Data.xml&quot;);
    }
  }
  
  function ClearChilds(Element, begin)
  {
    while(Element.length &gt; begin)
    {
      child = Element.item(begin);
      Element.removeChild(child);  
    }
  }
  
  function FillListGroup(ElementNameForFill)
  {
      ClearChilds(ElementNameForFill,0);
      try
      {
        for(i=0; i&lt;xmldoc.documentElement.childNodes.length; i++)
        {
          node = xmldoc.documentElement.childNodes(i);
          var oNewNode = document.createElement(&quot;option&quot;);  // создаем элемент для списка селект
          ElementNameForFill.appendChild(oNewNode);            // добавляем новый узел в dbsource
          oNewNode.innerText=node.attributes(0).text; //добавляем очередной элемент
          oNewNode.value=i;
        }
      }
      catch (err)
      {
        alert(&quot;Кривая база. Проверьте базу или создайте новую!&quot;);
        window.close();
      }
  }
  
  function FillListThemes(ElementNameForFill, ParentNode) // parentnode - елемент селект на форме из которого берется имя элемента группы темы которой мы хотим отобразить в текущем селекте
  {
    ClearChilds(ElementNameForFill,0);
    
      ElementNameForFill.clearAttributes();
      if (ElementNameForFill==ListThemes)
      {
      ElementNameForFill.setAttribute(&quot;multiple&quot;,true);
      window.ListThemes.setAttribute(&quot;size&quot;,23);
      }
    try
    {
      ListGroupName=xmldoc.documentElement.childNodes(ParentNode.value).childNodes;
            
    for(i=0;i&lt;ListGroupName.length;i++)
    {
    node = ListGroupName(i);        
    
    switch(node.nodeType)    // PDATA и CDATA
      {
        case 1:
          var oNewNode = document.createElement(&quot;option&quot;);  // создаем элемент для списка селект
          ElementNameForFill.appendChild(oNewNode);            // добавляем новый узел в dbsource
          oNewNode.innerText=node.attributes(0).text; //добавляем очередной элемент
          oNewNode.value=i;
        break;
      }   
    }
    }
    catch (err)
    {
      alert(&quot;У группы не существует тем, или у темы нет необходимых аттрибутов.\nПоправьте базу или создайте новую.&quot;);      
    }
  }
  function FillAreas()
  {
      try
      {
      ListValuesOfTheme=xmldoc.documentElement.childNodes(window.ListGroup.value).childNodes(window.ListThemes.value).childNodes;
      switch (ListValuesOfTheme(1).text)
      {
        case &quot;text&quot;:
          resultat.innerText= ListValuesOfTheme(0).text;
          break;
        case &quot;html&quot;:
          resultat.innerHTML= ListValuesOfTheme(0).text;
          break;
          default:
          resultat.innerText= ListValuesOfTheme(0).text;
          break;
      }
      }
      catch (err)
      {
        alert(&quot;Ошибка отображения текста. Проверьте вашу базу&quot;);
        window.close();
      }
  }
  
  
  function ShowAddTheme()
  {
    AddThemeGroupAdd.value=&quot;&quot;;
    NewThemesForAddTheme.value=&quot;&quot;;
    try
    {
      Theme = xmldoc.documentElement.childNodes(window.ListGroup.value).childNodes(window.ListThemes.value);
      NewThemeName.value=Theme.attributes(0).text ;
    }
    catch (err) {}
    NewThemesForAddTheme.value=&quot;&quot;;
    window.resultat.style.display=&quot;none&quot;;
    window.AddForm.style.display=&quot;&quot;;
    window.xmltools.style.display=&quot;none&quot;;
    
    FillListGroup(ListGroupForAddTheme);
    window.ListGroupForAddTheme.focus();
    window.ListGroupForAddTheme.selectedIndex =window.ListGroup.value;
    window.ListGroupForAddTheme.focus();
    
    FillListThemes(ListThemesForAddTheme,ListGroupForAddTheme);
    window.ListThemesForAddTheme.focus();
    window.ListThemesForAddTheme.selectedIndex=window.ListThemes.value;
    NodeTextAndNotes();
    window.ListThemesForAddTheme.focus();
    
    try
    {
      Theme=Theme.childNodes;
      AddThemeTypeText.value=Theme(1).text;
    }
    catch(err){}
    AddThemeTypeText.focus();
    window.AddThemeText.focus();
  }
  
  function ShowText()  // показываем ячейку в которой отбражается текст
  {
    window.resultat.style.display=&quot;&quot;;
    window.AddForm.style.display=&quot;none&quot;;
    window.xmltools.style.display=&quot;none&quot;;
  }
  
  function showXmlTools()
  {
    window.resultat.style.display=&quot;none&quot;;
    window.AddForm.style.display=&quot;none&quot;;
    window.xmltools.style.display=&quot;&quot;;
  }
  
  function AddTheme(Pre) // добавление темы в xml документ
  {
     try
     {
     var Element;
     if (NewThemesForAddTheme.value==&quot;&quot;)
     {
       Element = xmldoc.documentElement.childNodes(ListGroupForAddTheme.value).childNodes(ListThemesForAddTheme.value);
       OldNodeText=Element.childNodes(0);
       NewNodeText=Element.childNodes(0);
       if (Pre == &quot;Pre&quot;)
       {
         NewNodeText.text=&quot;&lt;pre&gt;&quot;+AddThemeText.value+&quot;&lt;/pre&gt;&quot;;
       }
       else
       {
         NewNodeText.text=AddThemeText.value;
       }
       Element.replaceChild(NewNodeText,OldNodeText);
       
       OldNodeNote=Element.childNodes(1);
       NewNodeNote=Element.childNodes(1);
       NewNodeNote.text=AddThemeTypeText.value;
       Element.replaceChild(NewNodeNote,OldNodeNote);
       
       xmldoc.save(RemoteData);
       alert(&quot;Тема изменена &quot;);
     }
     else
     {
       Element=xmldoc.documentElement.childNodes(ListGroupForAddTheme.value).appendChild(xmldoc.createElement(&quot;Node&quot;));
       attribute=xmldoc.createAttribute(&quot;Name&quot;);
       attribute.value=NewThemesForAddTheme.value;
       Element.setAttributeNode(attribute);
       Element.appendChild(xmldoc.createCDATASection(&quot; &quot;));
       Element.appendChild(xmldoc.createCDATASection(&quot; &quot;));
       
       OldNodeText=Element.childNodes(0);
       NewNodeText=Element.childNodes(0);
          
       if (Pre == &quot;Pre&quot;)
       {
         NewNodeText.text=&quot;&lt;pre&gt;&quot;+AddThemeText.value+&quot;&lt;/pre&gt;&quot;;
       }
       else
       {
         NewNodeText.text=AddThemeText.value;
       }
       Element.replaceChild(NewNodeText,OldNodeText);
       
       OldNodeNote=Element.childNodes(1);
       NewNodeNote=Element.childNodes(1);
       
       NewNodeNote.text=AddThemeTypeText.value;
       Element.replaceChild(NewNodeNote,OldNodeNote);
       
       xmldoc.save(RemoteData);
       alert(&quot;Тема добавлена!&quot;);
     }
     }
     catch (err)
     {
     alert (&quot;В группе нет тем. Введите имя новой создаваемой темы.&quot;);
     window.NewThemesForAddTheme.focus();
     }
   }
     
  
  function AddGroup()
  {
    if(AddThemeGroupAdd.value != &quot;&quot;)
    {
      group=xmldoc.documentElement.appendChild(xmldoc.createElement(&quot;group&quot;));
      attribute=xmldoc.createAttribute(&quot;Name&quot;)
      attribute.value=AddThemeGroupAdd.value;
      group.setAttributeNode(attribute);
      xmldoc.save(RemoteData);
      FillListGroup(ListGroup);
      FillListGroup(ListGroupForAddTheme);
      alert(&quot;Группа добавлена&quot;);
    }
    else
    {
    alert(&quot;Введите имя группы&quot;);
    }
  }
  
  function NodeTextAndNotes()
  {
    try
    {
      Element = xmldoc.documentElement.childNodes(ListGroupForAddTheme.value).childNodes(ListThemesForAddTheme.value);
      AddThemeText.value=Element.childNodes(0).text;
      window.ListThemesForAddTheme.selectedIndex=window.ListThemes.value;
      //AddThemeTypeText.value=Element.childNodes(1).text;
    }
    catch(err)
    {
      AddThemeText.value=&quot; &quot;;
      //AddThemeTypeText.value=&quot; &quot;;
    }
    
  }
  
  function RemoveTheme()
  {
    var Remove=false;
    try
    {
      Element=xmldoc.documentElement.childNodes(ListGroup.value).childNodes(ListThemes.value);
      Remove=window.confirm(&quot;Удалить тему - &quot;+Element.attributes(0).text+&quot; ?&quot;);
    }
    catch(err)
    {
      alert (&quot;Ошибка! Выберите тему для удаления&quot;);
    }
    
    if (Remove==true)
    {
      xmldoc.documentElement.childNodes(ListGroup.value).removeChild(Element);
      xmldoc.save(RemoteData);
      FillListGroup(ListGroup);
      FillListThemes(ListThemes,ListGroup)
      
      RemoteDataXml.innerHTML=&quot;&lt;small&gt;Используемая база - &quot;+RemoteData+&quot;&lt;/small&gt;&quot;;
      
    }
  }
  
  function RemoveGroup()
  {
    var Remove=false;
    try
    {
      Element=xmldoc.documentElement.childNodes(ListGroup.value);
      Remove=window.confirm(&quot;Удалить группу - &quot;+Element.attributes(0).text+&quot; ?&quot;);
    }
    catch(err)
    {
      alert (&quot;Ошибка! Выберите группу для удаления&quot;);
    }
    
    if (Remove==true)
    {
      if (ListGroupName.length &gt;0)
      {
        RemoveNotEmpty=window.confirm(&quot;Группа - &quot;+Element.attributes(0).text+&quot; не пустая. Удалить группу со всеми темами?&quot;);
        if(RemoveNotEmpty == true)
        {
          xmldoc.documentElement.removeChild(Element);
          xmldoc.save(RemoteData);
          FillListGroup(ListGroup);
          FillListThemes(ListThemes,ListGroup);
          RemoteDataXml.innerHTML=&quot;&lt;small&gt;Используемая база - &quot;+RemoteData+&quot;&lt;/small&gt;&quot;;
        }
      }
      else
      {
        xmldoc.documentElement.removeChild(Element);
        xmldoc.save(RemoteData);
        FillListGroup(ListGroup);
        FillListThemes(ListThemes,ListGroup);
        
        RemoteDataXml.innerHTML=&quot;&lt;small&gt;Используемая база - &quot;+RemoteData+&quot;&lt;/small&gt;&quot;;
      }
    }
  }
  function InsertURL()
  {
    if (AddThemeTypeText.value == &quot;URL&quot;)
    {
      address=window.prompt(&quot;Введите URL&quot;,&quot;http://www.ya.ru&quot;);
      opisanie=window.prompt(&quot;Введите описание для URL&quot;,&quot;яндекс&quot;);
      AddThemeText.value +=&#039; &lt;br&gt;&lt;hr width=90% align=center&gt;&lt;a href=&#039;+address+&#039;&gt;&#039;+opisanie+&#039;&lt;/a&gt;&lt;br&gt;&#039;;
      AddThemeTypeText.selectedIndex=0;
      window.AddThemeText.focus();
    }
  }
  
  function backupxml()
  {
    xmldoc.save(RemoteData+&quot;.backup&quot;);
    alert (&quot;BackUP сделан&quot;);
  }
  
  function RenameTheme()
  {
    if (NewThemeName.value != &quot;&quot;)
    {
      try
      {
        Theme = xmldoc.documentElement.childNodes(window.ListGroup.value).childNodes(window.ListThemes.value).attributes(0);
        Theme.text = NewThemeName.value;
        alert (&quot;Тема переименована&quot;);
        xmldoc.save(RemoteData);
        FillListGroup(ListGroup);
        FillListThemes(ListThemes,ListGroup);
      }
      catch(err)
      {
        alert (&quot;Выберите тему для переименования из главного списка&quot;);
      }
    }
    else
    {
      alert (&quot;Введите имя темы&quot;);
      NewThemeName.focus();
      xmldoc.save(RemoteData);
      FillListGroup(ListGroup);
      FillListThemes(ListThemes,ListGroup);
    }
    
  }
  
  function Upload()
  {
    window.uploadprocess.innerHTML=&quot;&quot;;
    window.clipboardData.setData(&quot;Text&quot;, RemoteData);
    objIE.Navigate (&quot;http://passport.yandex.ru/passport?mode=auth&amp;retpath=http://narod.yandex.ru/&quot;);  //переходим на страницу ввода пароля 
    while(objIE.Busy) { }
    
    login = UserInput(&quot;Для того чтобы загрузить базу на www.narod.ru, введите\nЛОГИН:&quot;, &quot;login&quot;);
    if (login != 0)
    {
      passwd=UserInput(&quot;ПАРОЛЬ:&quot;, &quot;passwd&quot;);
      if ( passwd !=0 )
      {
        try
        {
        window.uploadprocess.innerHTML=&quot;&lt;small&gt;Авторизуемся на narod.ru ...&lt;/small&gt;&quot;;
        //заполняем  форму ввода логина, и посылаем данные
        objForm = objIE.Document.forms(&quot;MainLogin&quot;);
        objForm.elements(&quot;login&quot;).value = login;
        objForm.elements(&quot;passwd&quot;).value = passwd;
        objForm.elements(&quot;In&quot;).click();
        window.uploadprocess.innerHTML=&quot;Переходим в мастерскую ...&quot;;
                
        while(objIE.Busy) { }
        objIE.document.getElementsByTagName(&quot;b&quot;).item(3).click();  //нажимаем на кнопку - Мастреская
        window.uploadprocess.innerHTML=&quot;Переходим к странице - загрузка файлов на сайт ...&quot;;
        
        while(objIE.Busy) { }
        objIE.document.getElementsByTagName(&quot;a&quot;).item(34).click(); //переходим по ссылке - Загрузка файлов на сайт
        
        while(objIE.Busy) { }
        window.uploadprocess.innerHTML=&quot;Устанавливаем фокус на кнопке выбора файла для загрузки ...&quot;;
        localfile = objIE.Document.forms(&quot;upload&quot;).elements(&quot;userfile0&quot;);  //получаем диалог указания пути к загружаемому файлу
        localfile.focus();
        objIE.document.parentWindow.resizeTo(0,0);
        window.uploadprocess.innerHTML=&quot;Уменьшаем окно IE до миниума, и делаем видимым&quot;;
        objIE.Visible=1;
        WshShell.AppActivate(&quot;Народ&quot;);
        setTimeout(&#039;WshShell.SendKeys(&quot;^v&quot;); window.uploadprocess.innerHTML=&quot;&lt;small&gt;Загружаем базу на сайт&lt;/small&gt;&quot;&#039;, 10*300);
        setTimeout(&#039;objIE.Visible=0&#039;, 10*400);
        setTimeout(&#039;objIE.Document.forms(&quot;upload&quot;).submit();&#039;, 10*500);
        setTimeout(&#039;while(objIE.Busy) { }; window.uploadprocess.innerText=&quot;&quot;;alert(&quot;База успешно загружена на narod.ru!&quot;);&#039;, 10*500);
        }
        catch (err)
        {
        alert (&quot;Ошибка загрузки - &quot;+err.decription+&quot;\nОшибка произошла на этапе: &quot;+window.uploadprocess.innerText);
        }
      }
    }
  }
  
  function UserInput(text, value)
  {
    userText=window.prompt(text,value);
    switch(userText)
    {
      case null:
        return 0;
        break;
      case &quot;&quot;:
        alert (&quot;Вы ничего не ввели&quot;);
        return 0;
      default:
        return userText;
        break;
    }
  }
  --&gt;
&lt;/SCRIPT&gt;
&lt;/HEAD&gt;
&lt;BODY onkeydown=keyDown() bgColor=silver 
onload=resize();LoadForm();FillListGroup(ListGroup);FillListThemes(ListThemes,ListGroup)&gt;
&lt;TABLE height=&quot;95%&quot; width=&quot;100%&quot; align=center border=0&gt;                                &lt;!-- главная таблица --&gt;
  &lt;TR&gt;
    &lt;TD vAlign=top&gt;
      &lt;table class=border height=&quot;95%&quot; width=&quot;100%&quot; align=center border=1 
      &gt;
        &lt;TBODY&gt;
        &lt;tr&gt;
          &lt;td vAlign=top align=middle&gt;
            &lt;table align=center border=0 width=&quot;95%&quot;&gt;
              &lt;tr&gt;
                &lt;td align=middle colSpan=2&gt;
                &lt;select id=ListGroup onclick=FillListThemes(ListThemes,ListGroup)&gt; 
                &lt;option value=GroupS selected &gt;- - - - - - - - - - - GroupS - - - - - - - - - - -&lt;/option&gt;&lt;/select&gt; &lt;/td&gt;&lt;/tr&gt;
              &lt;tr&gt;
                &lt;td align=middle colSpan=2&gt;&lt;select 
                  id=ListThemes onchange=ShowText();FillAreas() multiple size=30 
                  &gt; &lt;option value=ThemeS 
                    &gt;- - - - - - - - - - - ThemeS - - - - - 
                    - - - - - -&lt;/option&gt;&lt;/select&gt; &lt;/td&gt;&lt;/tr&gt;
              &lt;tr&gt;
                &lt;td id=RemoteDataXml align=middle colSpan=2 
                &gt;&lt;/td&gt;&lt;/tr&gt;
              &lt;tr&gt;
                &lt;td align=middle&gt;
                  &lt;hr&gt;
                  &lt;button style=&quot;WIDTH: 180px; HEIGHT: 25px&quot; 
                  onclick=FillListGroup(ListGroupForAddTheme);FillListThemes(ListThemesForAddTheme,ListGroupForAddTheme);ShowAddTheme();NodeTextAndNotes() 
                  type=button&gt;
                  &lt;center&gt;Добавить/Изменить 
                  тему&lt;/center&gt;&lt;/button&gt; &lt;/td&gt;&lt;/tr&gt;
              &lt;tr&gt;
                &lt;td align=middle&gt;&lt;br 
                  &gt;&lt;button 
                  style=&quot;WIDTH: 180px; HEIGHT: 25px&quot; onclick=RemoveTheme() 
                  type=button&gt;
                  &lt;center&gt;Удалить тему&lt;/center&gt;&lt;/button&gt; 
              &lt;/td&gt;&lt;/tr&gt;
              &lt;tr&gt;
                &lt;td align=middle&gt;&lt;br 
                  &gt;&lt;button 
                  style=&quot;WIDTH: 180px; HEIGHT: 25px&quot; onclick=RemoveGroup() 
                  type=button&gt;
                  &lt;center&gt;Удалить группу&lt;/center&gt;&lt;/button&gt; 
                  &lt;hr&gt;
                &lt;/td&gt;&lt;/tr&gt;
              &lt;tr&gt;
                &lt;td align=middle&gt;&lt;button id=Button1 
                  style=&quot;WIDTH: 180px; HEIGHT: 25px&quot; onclick=showXmlTools() 
                  type=button&gt;
                  &lt;center&gt;Xml инструменты&lt;/center&gt;&lt;/button&gt; &lt;/td&gt;&lt;/tr&gt;
                  &lt;/table&gt;&lt;/td&gt;
          &lt;TD id=resultat vAlign=top align=left width=&quot;80%&quot; rowSpan=1 &gt;&lt;br&gt;&lt;/TD&gt;
          &lt;td id=AddForm vAlign=top align=left width=&quot;80%&quot; rowSpan=1&gt;
            &lt;!-- сюда вставляется код для добавления темы в xml файл --&gt;
            &lt;table&gt;
              &lt;tr&gt;
                &lt;td&gt;Создать новую группу &lt;/td&gt;
                &lt;td align=left&gt;&lt;input id=AddThemeGroupAdd type=text size=38&gt; &lt;/td&gt;
                &lt;td align=left&gt;&lt;input id=AddGroupButton onclick=AddGroup() type=button value=выполнить&gt; 
                &lt;/td&gt;&lt;/tr&gt;
            &lt;tr&gt;
              &lt;td&gt;
                Переименовать Тему
              &lt;/td&gt;
              &lt;td align=left&gt;&lt;input id=NewThemeName type=text size=38&gt; &lt;/td&gt;
              &lt;td align=left&gt;
                &lt;input id=RenameThemeButton onclick=RenameTheme() type=button value=выполнить&gt; 
              &lt;/td&gt;
            &lt;/tr&gt;
            &lt;/table&gt;
            &lt;hr&gt;

            &lt;table align=left&gt;
              &lt;tr&gt;
                &lt;td&gt;&lt;/td&gt;
                &lt;td colSpan=2&gt;&lt;u 
                  &gt;Создать/Изменить тему&lt;/u&gt; &lt;/td&gt;&lt;/tr&gt;
              &lt;tr align=left&gt;
                &lt;td noWrap align=left width=&quot;20%&quot; 
                  &gt;Выберите группу &lt;/td&gt;
                &lt;td align=left width=&quot;80%&quot;&gt;&lt;select 
                  id=ListGroupForAddTheme 
                  onclick=FillListThemes(ListThemesForAddTheme,ListGroupForAddTheme) 
                  onchange=FillListThemes(ListThemesForAddTheme,ListGroupForAddTheme);NodeTextAndNotes() 
                  &gt; &lt;option value=GroupS selected &gt;GroupS&lt;/option&gt;&lt;/select&gt; &lt;/td&gt;&lt;/tr&gt;
              &lt;tr&gt;
                &lt;td noWrap&gt;Выберите тему&lt;/td&gt;
                &lt;td align=left&gt;&lt;select 
                  id=ListThemesForAddTheme onclick=NodeTextAndNotes() 
                  &gt; &lt;option value=ThemeS selected &gt;ThemeS&lt;/option&gt;&lt;/select&gt; &lt;/td&gt;
              &lt;tr&gt;
                &lt;td noWrap&gt;или создайте новую &lt;/td&gt;
                &lt;td&gt;&lt;input id=NewThemesForAddTheme 
                  type=text maxLength=40 size=41&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tr&gt;
              &lt;tr&gt;
                &lt;td colSpan=3 rowSpan=1&gt;&lt;textarea id=AddThemeText rows=25 cols=85&gt;&lt;/textarea&gt; 

                  &lt;center&gt;Тип содержимого &lt;br 
                  &gt;&lt;select id=AddThemeTypeText onchange=InsertURL()&gt; 
                  &lt;option value=html selected&gt;html&lt;/option&gt;
                  &lt;option value=text&gt;text&lt;/option&gt;
                  &lt;option value=URL&gt;URL&lt;/option&gt;
                  &lt;/select&gt; &lt;/center&gt;&lt;/td&gt;&lt;/tr&gt;
              &lt;tr&gt;
              
                &lt;td align=middle colSpan=3&gt;&lt;input id=AddThemeButton onclick=&#039;AddTheme(&quot;&quot;);javascript:ListGroup.onclick()&#039; type=button value=Выполнить&gt; 
&lt;input id=Button2 onclick=&#039;AddTheme(&quot;Pre&quot;);javascript:ListGroup.onclick()&#039; type=button value=&quot;Выполнить PRE&quot;&gt; 
                &lt;/td&gt;
                
                &lt;/tr&gt;&lt;/table&gt;
                &lt;td id=xmltools valign=top width=&quot;80%&quot;&gt;
                  &lt;table align=center&gt;
                    &lt;tr&gt;
                      &lt;td&gt;
                        &lt;button id=BUTTON4 style=&quot;WIDTH: 180px; HEIGHT: 25px&quot; onclick=loadxml() type=button&gt;
                        &lt;center&gt;Загрузить Xml с сайта &lt;/center&gt;&lt;/button&gt;   
                      &lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                      &lt;td&gt;
                        &lt;button id=Button5 style=&quot;WIDTH: 180px; HEIGHT: 25px&quot; onclick=loadxmlfromfile() type=button&gt;
                        &lt;center&gt;Загрузить Xml из файла &lt;/center&gt;&lt;/button&gt;   
                      &lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                      &lt;td&gt;
                        &lt;br&gt;
                        &lt;button id=Button3 style=&quot;WIDTH: 180px; HEIGHT: 25px&quot; onclick=backupxml() type=button&gt;
                        &lt;center&gt;Backup xml&lt;/center&gt;&lt;/button&gt; 
                      &lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                      &lt;td&gt;
                        &lt;br&gt;
                        &lt;button id=UpLoadButton style=&quot;WIDTH: 180px; HEIGHT: 25px&quot; onclick=Upload() type=button&gt;
                        &lt;center&gt;UpLoad (narod.ru)&lt;/center&gt;&lt;/button&gt; 
                      &lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                      &lt;td id=uploadprocess align=middle&gt;
                      
                      &lt;/td&gt;
                    &lt;/tr&gt;
                  &lt;/table&gt;
                &lt;/td&gt;
                
                &lt;/td&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TABLE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;input 
id=filedialog type=file&gt;

&lt;/BODY&gt;&lt;/HTML&gt;</code></pre></div><p>Автор программы - <strong>null</strong>.</p>]]></content>
			<author>
				<name><![CDATA[The gray Cardinal]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=2</uri>
			</author>
			<updated>2008-11-05T12:59:11Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=15557#p15557</id>
		</entry>
</feed>
