|
From: <kro...@us...> - 2010-11-11 13:42:36
|
Revision: 3925
http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3925&view=rev
Author: kroko_koenig
Date: 2010-11-11 13:42:29 +0000 (Thu, 11 Nov 2010)
Log Message:
-----------
xulrunner needs to be extracted first in Setup
Modified Paths:
--------------
trunk/plugins/BrowseTheWeb/Release/BrowseTheWeb.mpe1
trunk/plugins/BrowseTheWeb/Release/BrowseTheWeb.xml
trunk/plugins/BrowseTheWeb/Release/BrowseTheWeb.xmp2
trunk/plugins/BrowseTheWeb/Release/Plugins/Windows/BrowseTheWeb.dll
trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs
trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/Setup.cs
trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb.suo
Modified: trunk/plugins/BrowseTheWeb/Release/BrowseTheWeb.mpe1
===================================================================
(Binary files differ)
Modified: trunk/plugins/BrowseTheWeb/Release/BrowseTheWeb.xml
===================================================================
--- trunk/plugins/BrowseTheWeb/Release/BrowseTheWeb.xml 2010-11-11 12:43:03 UTC (rev 3924)
+++ trunk/plugins/BrowseTheWeb/Release/BrowseTheWeb.xml 2010-11-11 13:42:29 UTC (rev 3925)
@@ -150,8 +150,8 @@
<ExtensionDescription>Webrowser based on xulrunner and the "Gecko Browser" / " Webbrowser.
</ExtensionDescription>
- <VersionDescription>add thumbs for bookmarks
-ready for info service by silent exception
+ <VersionDescription>add thumbs for bookmarks
+ready for info service by silent exception
skin changes for bookmarks</VersionDescription>
<DevelopmentStatus>Stable</DevelopmentStatus>
<OnlineLocation>https://mp-plugins.svn.sourceforge.net/svnroot/mp-plugins/trunk/plugins/BrowseTheWeb/Release/BrowseTheWeb.mpe1</OnlineLocation>
@@ -197,5 +197,102 @@
<FolderGroups />
</ProjectSettings>
</PackageClass>
+ <PackageClass>
+ <Version>2.0</Version>
+ <Groups>
+ <Items>
+ <GroupItem Name="Default">
+ <DisplayName>Default</DisplayName>
+ <DefaulChecked>true</DefaulChecked>
+ <Description>Default</Description>
+ <Files>
+ <Items />
+ </Files>
+ </GroupItem>
+ <GroupItem Name="Blue3">
+ <DisplayName>Blue3</DisplayName>
+ <DefaulChecked>true</DefaulChecked>
+ <Description>Blue3</Description>
+ <Files>
+ <Items />
+ </Files>
+ </GroupItem>
+ <GroupItem Name="Blue3wide">
+ <DisplayName>Blue3wide</DisplayName>
+ <DefaulChecked>true</DefaulChecked>
+ <Description>Blue3wide</Description>
+ <Files>
+ <Items />
+ </Files>
+ </GroupItem>
+ </Items>
+ </Groups>
+ <Sections>
+ <Items />
+ </Sections>
+ <Dependencies>
+ <Items />
+ </Dependencies>
+ <GeneralInfo>
+ <Name>Browse The Web</Name>
+ <Id>2869e8cd-579e-4fdb-ad6d-19ff5bd4e46f</Id>
+ <Author>Mark Koenig (kroko) 2010</Author>
+ <HomePage>http://www.team-mediaportal.com</HomePage>
+ <ForumPage>http://forum.team-mediaportal.com/mediaportal-plugins-47/plugin-browse-web-webbrowser-89101/</ForumPage>
+ <UpdateUrl>https://mp-plugins.svn.sourceforge.net/svnroot/mp-plugins/trunk/plugins/BrowseTheWeb/Release/BrowseTheWeb.xml</UpdateUrl>
+ <Version>
+ <Major>0</Major>
+ <Minor>2</Minor>
+ <Build>1</Build>
+ <Revision>0</Revision>
+ </Version>
+ <ExtensionDescription>Webrowser based on xulrunner and the "Gecko Browser" / " Webbrowser.
+
+</ExtensionDescription>
+ <VersionDescription>extract xulrunner first in setup</VersionDescription>
+ <DevelopmentStatus>Stable</DevelopmentStatus>
+ <OnlineLocation>https://mp-plugins.svn.sourceforge.net/svnroot/mp-plugins/trunk/plugins/BrowseTheWeb/Release/BrowseTheWeb.mpe1</OnlineLocation>
+ <ReleaseDate>2010-11-06T15:09:04.5514802+01:00</ReleaseDate>
+ <Tags>webbrowser, internet, web</Tags>
+ <Location>C:\AAA\BrowseTheWeb\Release\BrowseTheWeb.mpe1</Location>
+ <Params>
+ <Items>
+ <SectionParam Name="Icon">
+ <Value>C:\AAA\BrowseTheWeb\Source\BrowseTheWeb\xulrunner.png</Value>
+ <ValueType>File</ValueType>
+ <Description>The icon file of the package (jpg,png,bmp)</Description>
+ </SectionParam>
+ <SectionParam Name="Online Icon">
+ <Value />
+ <ValueType>String</ValueType>
+ <Description>The icon file of the package stored online (jpg,png,bmp)</Description>
+ </SectionParam>
+ <SectionParam Name="Configuration file">
+ <Value />
+ <ValueType>Template</ValueType>
+ <Description>The file used to configure the extension.
+ If have .exe extension the will be executed
+ If have .dll extension used like MP plugin configuration</Description>
+ </SectionParam>
+ <SectionParam Name="Online Screenshots">
+ <Value>https://mp-plugins.svn.sourceforge.net/svnroot/mp-plugins/trunk/plugins/BrowseTheWeb/Release/browser1.jpg;https://mp-plugins.svn.sourceforge.net/svnroot/mp-plugins/trunk/plugins/BrowseTheWeb/Release/setup3.jpg</Value>
+ <ValueType>String</ValueType>
+ <Description>Online stored screenshot urls separated by ; </Description>
+ </SectionParam>
+ <SectionParam Name="Force to uninstall on update">
+ <Value>yes</Value>
+ <ValueType>Bool</ValueType>
+ <Description>Show dialog and force to uninstall previous version when updating an extension. Should only be disabled if you are using an NSIS/MSI installer.</Description>
+ </SectionParam>
+ </Items>
+ </Params>
+ </GeneralInfo>
+ <UniqueFileList>
+ <Items />
+ </UniqueFileList>
+ <ProjectSettings>
+ <FolderGroups />
+ </ProjectSettings>
+ </PackageClass>
</Items>
</ExtensionCollection>
\ No newline at end of file
Modified: trunk/plugins/BrowseTheWeb/Release/BrowseTheWeb.xmp2
===================================================================
--- trunk/plugins/BrowseTheWeb/Release/BrowseTheWeb.xmp2 2010-11-11 12:43:03 UTC (rev 3924)
+++ trunk/plugins/BrowseTheWeb/Release/BrowseTheWeb.xmp2 2010-11-11 13:42:29 UTC (rev 3925)
@@ -268,15 +268,13 @@
<Version>
<Major>0</Major>
<Minor>2</Minor>
- <Build>0</Build>
+ <Build>1</Build>
<Revision>0</Revision>
</Version>
<ExtensionDescription>Webrowser based on xulrunner and the "Gecko Browser" / " Webbrowser.
</ExtensionDescription>
- <VersionDescription>add thumbs for bookmarks
-ready for info service by silent exception
-skin changes for bookmarks</VersionDescription>
+ <VersionDescription>extract xulrunner first in setup</VersionDescription>
<DevelopmentStatus>Stable</DevelopmentStatus>
<OnlineLocation>https://mp-plugins.svn.sourceforge.net/svnroot/mp-plugins/trunk/plugins/BrowseTheWeb/Release/BrowseTheWeb.mpe1</OnlineLocation>
<ReleaseDate>2010-11-06T15:09:04.5514802+01:00</ReleaseDate>
@@ -397,7 +395,7 @@
<Param1 />
<UpdateOption>OverwriteIfOlder</UpdateOption>
<LocalFileName>..\Source\BrowseTheWeb\xulrunner.png</LocalFileName>
- <ZipFileName>Installer{CopyFile}\{9a94ef91-aa09-44e9-8f71-1036499d40dc}-xulrunner.png</ZipFileName>
+ <ZipFileName>Installer{CopyFile}\{debd9c09-d52c-4596-9ee1-447c6aeb3022}-xulrunner.png</ZipFileName>
<DestinationFilename />
</FileItem>
</Items>
Modified: trunk/plugins/BrowseTheWeb/Release/Plugins/Windows/BrowseTheWeb.dll
===================================================================
(Binary files differ)
Modified: trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs
===================================================================
--- trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs 2010-11-11 12:43:03 UTC (rev 3924)
+++ trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs 2010-11-11 13:42:29 UTC (rev 3925)
@@ -495,62 +495,102 @@
}
private void webBrowser_DocumentCompleted(object sender, EventArgs e)
{
- #region MP gui stuff
- string str = DateTime.Now.ToLongTimeString();
- str += " Completed";
+ MyLog.debug("page completetd : " + webBrowser.Url.ToString());
- GUIPropertyManager.SetProperty("#btWeb.status", str);
- #endregion
+ try
+ {
+ #region MP gui stuff
+ string str = DateTime.Now.ToLongTimeString();
+ str += " Completed";
- #region add links to page
- _htmlLinkNumbers = new List<HtmlLinkNumber>();
+ GUIPropertyManager.SetProperty("#btWeb.status", str);
+ #endregion
- _links = webBrowser.Document.Links;
- int i = 1;
+ #region add links to page
+ _htmlLinkNumbers = new List<HtmlLinkNumber>();
- foreach (GeckoElement element in _links)
- {
- string link = element.GetAttribute("href");
+ _links = webBrowser.Document.Links;
+ int i = 1;
- if (!link.StartsWith("javascript:"))
+ foreach (GeckoElement element in _links)
{
- if (!element.InnerHtml.Contains("gecko_id"))
+ string link = element.GetAttribute("href");
+
+ if (!link.StartsWith("javascript:"))
{
- element.InnerHtml += string.Format(_span, i, "", "LINK");
- }
+ if (!element.InnerHtml.Contains("gecko_id"))
+ {
+ element.InnerHtml += string.Format(_span, i, "", "LINK");
+ }
- string gb = element.GetAttribute("gb");
- string id = element.GetAttribute("id");
- string name = element.GetAttribute("name");
- if (string.IsNullOrEmpty(gb))
- {
- element.SetAttribute("gb", "gecko_link" + i);
+ string gb = element.GetAttribute("gb");
+ string id = element.GetAttribute("id");
+ string name = element.GetAttribute("name");
+ if (string.IsNullOrEmpty(gb))
+ {
+ element.SetAttribute("gb", "gecko_link" + i);
+ }
+ if (string.IsNullOrEmpty(id))
+ {
+ element.SetAttribute("id", "gb" + i);
+ id = "gb" + i;
+ }
+ _htmlLinkNumbers.Add(new HtmlLinkNumber(i, id, name, link, HtmlInputType.Link));
+ i++;
}
- if (string.IsNullOrEmpty(id))
- {
- element.SetAttribute("id", "gb" + i);
- id = "gb" + i;
- }
- _htmlLinkNumbers.Add(new HtmlLinkNumber(i, id, name, link, HtmlInputType.Link));
- i++;
}
- }
- _forms = webBrowser.Document.GetElementsByTagName("form");
- HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument();
- foreach (GeckoElement element in _forms)
- {
- string action = element.GetAttribute("action");
- doc.LoadHtml(element.InnerHtml);
- foreach (HtmlAgilityPack.HtmlNode link in doc.DocumentNode.SelectNodes("//*"))
+ _forms = webBrowser.Document.GetElementsByTagName("form");
+ HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument();
+ foreach (GeckoElement element in _forms)
{
- if (link.OriginalName == "input")
+ string action = element.GetAttribute("action");
+ doc.LoadHtml(element.InnerHtml);
+ foreach (HtmlAgilityPack.HtmlNode link in doc.DocumentNode.SelectNodes("//*"))
{
- if (link.Attributes["type"] != null)
+ if (link.OriginalName == "input")
{
- if (link.Attributes["type"].Value != "hidden")
+ if (link.Attributes["type"] != null)
{
+ if (link.Attributes["type"].Value != "hidden")
+ {
+ string gb = link.GetAttributeValue("gb", "");
+ string id = link.GetAttributeValue("id", "");
+ string name = link.GetAttributeValue("name", "");
+ string outerHtml = link.OuterHtml;
+ if (string.IsNullOrEmpty(gb))
+ {
+ link.SetAttributeValue("gb", "gecko_link" + i);
+ }
+ if (string.IsNullOrEmpty(id))
+ {
+ link.SetAttributeValue("id", "gb" + i);
+ id = "gb" + i;
+ }
+
+ if (!element.InnerHtml.Contains("gecko_id=\"" + i + "\""))
+ {
+ string newLink = link.OuterHtml + string.Format(_span, i, action, "INPUT");
+ element.InnerHtml = element.InnerHtml.Replace(outerHtml, newLink);
+ }
+ if (link.Attributes["type"].Value == "submit" ||
+ link.Attributes["type"].Value == "reset" ||
+ link.Attributes["type"].Value == "radio" ||
+ link.Attributes["type"].Value == "image" ||
+ link.Attributes["type"].Value == "checkbox")
+ {
+ _htmlLinkNumbers.Add(new HtmlLinkNumber(i, id, name, action, HtmlInputType.Action));
+ }
+ else
+ {
+ _htmlLinkNumbers.Add(new HtmlLinkNumber(i, id, name, action, HtmlInputType.Input));
+ }
+ i++;
+ }
+ }
+ else
+ {
string gb = link.GetAttributeValue("gb", "");
string id = link.GetAttributeValue("id", "");
string name = link.GetAttributeValue("name", "");
@@ -570,90 +610,59 @@
string newLink = link.OuterHtml + string.Format(_span, i, action, "INPUT");
element.InnerHtml = element.InnerHtml.Replace(outerHtml, newLink);
}
- if (link.Attributes["type"].Value == "submit" ||
- link.Attributes["type"].Value == "reset" ||
- link.Attributes["type"].Value == "radio" ||
- link.Attributes["type"].Value == "image" ||
- link.Attributes["type"].Value == "checkbox")
- {
- _htmlLinkNumbers.Add(new HtmlLinkNumber(i, id, name, action, HtmlInputType.Action));
- }
- else
- {
- _htmlLinkNumbers.Add(new HtmlLinkNumber(i, id, name, action, HtmlInputType.Input));
- }
+
+ _htmlLinkNumbers.Add(new HtmlLinkNumber(i, id, name, action, HtmlInputType.Input));
i++;
}
}
- else
- {
- string gb = link.GetAttributeValue("gb", "");
- string id = link.GetAttributeValue("id", "");
- string name = link.GetAttributeValue("name", "");
- string outerHtml = link.OuterHtml;
- if (string.IsNullOrEmpty(gb))
- {
- link.SetAttributeValue("gb", "gecko_link" + i);
- }
- if (string.IsNullOrEmpty(id))
- {
- link.SetAttributeValue("id", "gb" + i);
- id = "gb" + i;
- }
-
- if (!element.InnerHtml.Contains("gecko_id=\"" + i + "\""))
- {
- string newLink = link.OuterHtml + string.Format(_span, i, action, "INPUT");
- element.InnerHtml = element.InnerHtml.Replace(outerHtml, newLink);
- }
-
- _htmlLinkNumbers.Add(new HtmlLinkNumber(i, id, name, action, HtmlInputType.Input));
- i++;
- }
}
}
- }
- #endregion
+ #endregion
- #region reset zoom
- if (zoomPage)
- {
- webBrowser.Zoom = defaultZoom;
- zoom = defaultZoom;
- GUIPropertyManager.SetProperty("#btWeb.status", "Zoom set to " + (int)(zoom * 100));
- }
- if (zoomDomain)
- {
- if (lastDomain != webBrowser.Document.Domain)
+ #region reset zoom
+ if (zoomPage)
{
+ webBrowser.Zoom = defaultZoom;
+ zoom = defaultZoom;
+ GUIPropertyManager.SetProperty("#btWeb.status", "Zoom set to " + (int)(zoom * 100));
+ }
+ if (zoomDomain)
+ {
+ if (lastDomain != webBrowser.Document.Domain)
{
- webBrowser.Zoom = defaultZoom;
- zoom = defaultZoom;
- GUIPropertyManager.SetProperty("#btWeb.status", "Zoom set to " + (int)(zoom * 100));
+ {
+ webBrowser.Zoom = defaultZoom;
+ zoom = defaultZoom;
+ GUIPropertyManager.SetProperty("#btWeb.status", "Zoom set to " + (int)(zoom * 100));
+ }
}
+ lastDomain = webBrowser.Document.Domain;
}
- lastDomain = webBrowser.Document.Domain;
- }
- #endregion
+ #endregion
- #region save snapshot
+ #region save snapshot
- if (webBrowser.Url.ToString() != "about:blank")
- {
- if (cacheThumbs)
+ if (webBrowser.Url.ToString() != "about:blank")
{
- Bitmap snap = new Bitmap(webBrowser.Width, webBrowser.Height);
- webBrowser.DrawToBitmap(snap, new Rectangle(0, 0, webBrowser.Width, webBrowser.Height));
+ if (cacheThumbs)
+ {
+ Bitmap snap = new Bitmap(webBrowser.Width, webBrowser.Height);
+ webBrowser.DrawToBitmap(snap, new Rectangle(0, 0, webBrowser.Width, webBrowser.Height));
- snap = MediaPortal.Util.BitmapResize.Resize(ref snap, 300, 400, false, true);
+ snap = MediaPortal.Util.BitmapResize.Resize(ref snap, 300, 400, false, true);
- Graphics g = Graphics.FromImage((Image)snap);
- g.DrawRectangle(new Pen(Color.Black, 2), new Rectangle(1, 1, snap.Width - 2, snap.Height - 2));
+ Graphics g = Graphics.FromImage((Image)snap);
+ g.DrawRectangle(new Pen(Color.Black, 2), new Rectangle(1, 1, snap.Width - 2, snap.Height - 2));
- Bookmark.SaveSnap(snap, webBrowser.Url.ToString());
+ Bookmark.SaveSnap(snap, webBrowser.Url.ToString());
+ }
}
+ #endregion
}
- #endregion
+ catch (Exception ex)
+ {
+ MyLog.debug("on completed exception : " + ex.Message + "\n" + ex.StackTrace);
+ }
}
private void OnLinkId(string LinkId)
Modified: trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/Setup.cs
===================================================================
--- trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/Setup.cs 2010-11-11 12:43:03 UTC (rev 3924)
+++ trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/Setup.cs 2010-11-11 13:42:29 UTC (rev 3925)
@@ -53,6 +53,34 @@
public Setup()
{
InitializeComponent();
+
+ #region create xulrunner if needed
+ string dir = Config.GetFolder(MediaPortal.Configuration.Config.Dir.Config) + "\\xulrunner";
+ string dirCache = Config.GetFolder(MediaPortal.Configuration.Config.Dir.Cache);
+
+ try
+ {
+ if (!Directory.Exists(dir))
+ {
+ System.Diagnostics.ProcessStartInfo procStartInfo =
+ new System.Diagnostics.ProcessStartInfo("cmd", "/c unzip.exe -o xulrunner -d ../");
+ procStartInfo.WorkingDirectory = dirCache;
+
+ procStartInfo.RedirectStandardOutput = true;
+ procStartInfo.UseShellExecute = false;
+
+ procStartInfo.CreateNoWindow = true;
+
+ System.Diagnostics.Process proc = new System.Diagnostics.Process();
+ proc.StartInfo = procStartInfo;
+ proc.Start();
+
+ string result = proc.StandardOutput.ReadToEnd();
+ }
+ }
+ catch { }
+ #endregion
+
Xpcom.Initialize(Config.GetFolder(MediaPortal.Configuration.Config.Dir.Config) + "\\xulrunner");
}
@@ -102,33 +130,6 @@
listBox1.Items.Add("right\t\tright\t\tmove right");
listBox1.Items.Add("X\t\tRed\t\ttoggle statusbar");
#endregion
-
- #region create xulrunner if needed
- string dir = Config.GetFolder(MediaPortal.Configuration.Config.Dir.Config) + "\\xulrunner";
- string dirCache = Config.GetFolder(MediaPortal.Configuration.Config.Dir.Cache);
-
- try
- {
- if (!Directory.Exists(dir))
- {
- System.Diagnostics.ProcessStartInfo procStartInfo =
- new System.Diagnostics.ProcessStartInfo("cmd", "/c unzip.exe -o xulrunner -d ../");
- procStartInfo.WorkingDirectory = dirCache;
-
- procStartInfo.RedirectStandardOutput = true;
- procStartInfo.UseShellExecute = false;
-
- procStartInfo.CreateNoWindow = true;
-
- System.Diagnostics.Process proc = new System.Diagnostics.Process();
- proc.StartInfo = procStartInfo;
- proc.Start();
-
- string result = proc.StandardOutput.ReadToEnd();
- }
- }
- catch { }
- #endregion
}
private void btnSave_Click(object sender, EventArgs e)
Modified: trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb.suo
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|