diff --git a/Greenshot/AssemblyInfo.cs.template b/Greenshot/AssemblyInfo.cs.template index 1996bede2..2e15ddb95 100644 --- a/Greenshot/AssemblyInfo.cs.template +++ b/Greenshot/AssemblyInfo.cs.template @@ -47,4 +47,4 @@ using System.Runtime.InteropServices; // You can specify all values by your own or you can build default build and revision // numbers with the '*' character (the default): -[assembly: AssemblyVersion("1.0.4.$WCREV$")] +[assembly: AssemblyVersion("1.0.5.$WCREV$")] diff --git a/Greenshot/Greenshot.sln b/Greenshot/Greenshot.sln index 60ae08ba3..250a07fc3 100644 --- a/Greenshot/Greenshot.sln +++ b/Greenshot/Greenshot.sln @@ -18,13 +18,13 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GreenshotOCRPlugin", "..\Gr EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GreenshotOCRCommand", "..\GreenshotOCRCommand\GreenshotOCRCommand.csproj", "{D61E6ECE-E0B6-4467-B492-F08A06BA8F02}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GreenshotBoxPlugin", "..\..\Greenshot-Plugins\GreenshotBoxPlugin\GreenshotBoxPlugin.csproj", "{697CF066-9077-4F22-99D9-D989CCE7282B}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GreenshotBoxPlugin", "..\GreenshotBoxPlugin\GreenshotBoxPlugin.csproj", "{697CF066-9077-4F22-99D9-D989CCE7282B}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GreenshotDropboxPlugin", "..\..\Greenshot-Plugins\GreenshotDropboxPlugin\GreenshotDropboxPlugin.csproj", "{AD7CFFE2-40E7-46CF-A172-D48CF7AE9A12}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GreenshotDropboxPlugin", "..\GreenshotDropboxPlugin\GreenshotDropboxPlugin.csproj", "{AD7CFFE2-40E7-46CF-A172-D48CF7AE9A12}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GreenshotFlickrPlugin", "..\..\Greenshot-Plugins\GreenshotFlickrPlugin\GreenshotFlickrPlugin.csproj", "{7EC72A5A-D73A-4B4B-9CA1-2216C7D92D5E}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GreenshotFlickrPlugin", "..\GreenshotFlickrPlugin\GreenshotFlickrPlugin.csproj", "{7EC72A5A-D73A-4B4B-9CA1-2216C7D92D5E}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GreenshotPicasaPlugin", "..\..\Greenshot-Plugins\GreenshotPicasaPlugin\GreenshotPicasaPlugin.csproj", "{1893A2E4-A78A-4713-A8E7-E70058DABEE0}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GreenshotPicasaPlugin", "..\GreenshotPicasaPlugin\GreenshotPicasaPlugin.csproj", "{1893A2E4-A78A-4713-A8E7-E70058DABEE0}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GreenshotOfficePlugin", "..\GreenshotOfficePlugin\GreenshotOfficePlugin.csproj", "{92599C09-FF29-4ABD-B6E6-C48ECD781BAB}" EndProject diff --git a/GreenshotBoxPlugin/Box.png b/GreenshotBoxPlugin/Box.png new file mode 100644 index 000000000..199a09dfd Binary files /dev/null and b/GreenshotBoxPlugin/Box.png differ diff --git a/GreenshotImmioPlugin/ImmioConfiguration.cs b/GreenshotBoxPlugin/BoxConfiguration.cs similarity index 62% rename from GreenshotImmioPlugin/ImmioConfiguration.cs rename to GreenshotBoxPlugin/BoxConfiguration.cs index 7a969c684..80b5b9512 100644 --- a/GreenshotImmioPlugin/ImmioConfiguration.cs +++ b/GreenshotBoxPlugin/BoxConfiguration.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ @@ -20,41 +20,37 @@ */ using System.Windows.Forms; using Greenshot.IniFile; -using GreenshotPlugin.Controls; using GreenshotPlugin.Core; -namespace GreenshotImmioPlugin { +namespace GreenshotBoxPlugin { /// - /// Description of ImmioConfiguration. + /// Description of ImgurConfiguration. /// - [IniSection("Immio", Description="Greenshot Immio Plugin configuration")] - public class ImmioConfiguration : IniSection { + [IniSection("Box", Description = "Greenshot Box Plugin configuration")] + public class BoxConfiguration : IniSection { [IniProperty("UploadFormat", Description="What file type to use for uploading", DefaultValue="png")] public OutputFormat UploadFormat; + [IniProperty("UploadJpegQuality", Description="JPEG file save quality in %.", DefaultValue="80")] public int UploadJpegQuality; - [IniProperty("UploadReduceColors", Description="Reduce color amount of the uploaded image to 256", DefaultValue="False")] - public bool UploadReduceColors; - [IniProperty("UsePageLink", Description = "Use pagelink instead of direct link on the clipboard", DefaultValue = "False")] - public bool UsePageLink; + + [IniProperty("AfterUploadLinkToClipBoard", Description = "After upload send Box link to clipboard.", DefaultValue = "true")] + public bool AfterUploadLinkToClipBoard; + + [IniProperty("BoxToken", Description = "Token.", DefaultValue = "")] + public string BoxToken; /// - /// A form for username/password + /// A form for token /// /// bool true if OK was pressed, false if cancel public bool ShowConfigDialog() { - SettingsForm settingsForm = null; - - new PleaseWaitForm().ShowAndWait(ImmioPlugin.Attributes.Name, Language.GetString("immio", LangKey.communication_wait), - delegate() { - settingsForm = new SettingsForm(this); - } - ); - DialogResult result = settingsForm.ShowDialog(); + DialogResult result = new SettingsForm(this).ShowDialog(); if (result == DialogResult.OK) { return true; } return false; } + } } diff --git a/GreenshotBoxPlugin/BoxCredentials.cs b/GreenshotBoxPlugin/BoxCredentials.cs new file mode 100644 index 000000000..1b6b21674 --- /dev/null +++ b/GreenshotBoxPlugin/BoxCredentials.cs @@ -0,0 +1,31 @@ +/* + * Greenshot - a free and open source screenshot tool + * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom + * + * For more information see: http://getgreenshot.org/ + * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 1 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +using System; + +namespace GreenshotBoxPlugin { + /// + /// This class is merely a placeholder for the file keeping the API key and secret for Box integration. + /// Copy this file to BoxCredentials.private.cs and fill in valid credentials. (Or empty strings, but of course you won't be able to use the plugin then.) + /// + public static class BoxCredentials { + public static string API_KEY = empty; + } +} \ No newline at end of file diff --git a/GreenshotBoxPlugin/BoxCredentials.private.cs b/GreenshotBoxPlugin/BoxCredentials.private.cs new file mode 100644 index 000000000..83d4005f2 --- /dev/null +++ b/GreenshotBoxPlugin/BoxCredentials.private.cs @@ -0,0 +1,31 @@ +/* + * Greenshot - a free and open source screenshot tool + * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom + * + * For more information see: http://getgreenshot.org/ + * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 1 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +using System; + +namespace GreenshotBoxPlugin { + /// + /// This class is merely a placeholder for the file keeping the API key and secret for Box integration. + /// Copy this file to BoxCredentials.private.cs and fill in valid credentials. (Or empty strings, but of course you won't be able to use the plugin then.) + /// + public static class BoxCredentials { + public static string API_KEY = "gwjm9lx8df7y2xskay4f1yxkrakhgy7n"; + } +} \ No newline at end of file diff --git a/GreenshotImmioPlugin/ImmioDestination.cs b/GreenshotBoxPlugin/BoxDestination.cs similarity index 70% rename from GreenshotImmioPlugin/ImmioDestination.cs rename to GreenshotBoxPlugin/BoxDestination.cs index 978600cf6..36d817548 100644 --- a/GreenshotImmioPlugin/ImmioDestination.cs +++ b/GreenshotBoxPlugin/BoxDestination.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ @@ -24,44 +24,43 @@ using Greenshot.IniFile; using Greenshot.Plugin; using GreenshotPlugin.Core; -namespace GreenshotImmioPlugin { - /// - /// Description of ImmioDestination. - /// - public class ImmioDestination : AbstractDestination { - private static log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(ImmioDestination)); - private static ImmioConfiguration config = IniConfig.GetIniSection(); - private ImmioPlugin plugin = null; +namespace GreenshotBoxPlugin { + public class BoxDestination : AbstractDestination { + private static log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(BoxDestination)); + private static BoxConfiguration config = IniConfig.GetIniSection(); - public ImmioDestination(ImmioPlugin plugin) { + private BoxPlugin plugin = null; + public BoxDestination(BoxPlugin plugin) { this.plugin = plugin; } public override string Designation { get { - return "Immio"; + return "Box"; } } public override string Description { get { - return Language.GetString("immio", LangKey.upload_menu_item); + return Language.GetString("box", LangKey.upload_menu_item); } } public override Image DisplayIcon { get { - ComponentResourceManager resources = new ComponentResourceManager(typeof(ImmioPlugin)); - return (Image)resources.GetObject("Immio"); + ComponentResourceManager resources = new ComponentResourceManager(typeof(BoxPlugin)); + return (Image)resources.GetObject("Box"); } } public override ExportInformation ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails) { ExportInformation exportInformation = new ExportInformation(this.Designation, this.Description); using (Image image = surface.GetImageForExport()) { - string uploadURL = null; - exportInformation.ExportMade = plugin.Upload(captureDetails, image, out uploadURL); - exportInformation.Uri = uploadURL; + string uploadUrl = plugin.Upload(captureDetails, image); + if (uploadUrl != null) { + exportInformation.ExportMade = true; + exportInformation.Uri = uploadUrl; + } } ProcessExport(exportInformation, surface); return exportInformation; diff --git a/GreenshotOfficeCommunicatorPlugin/OfficeCommunicatorPlugin.cs b/GreenshotBoxPlugin/BoxPlugin.cs similarity index 51% rename from GreenshotOfficeCommunicatorPlugin/OfficeCommunicatorPlugin.cs rename to GreenshotBoxPlugin/BoxPlugin.cs index 54747e3da..07f0bdbb2 100644 --- a/GreenshotOfficeCommunicatorPlugin/OfficeCommunicatorPlugin.cs +++ b/GreenshotBoxPlugin/BoxPlugin.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ @@ -24,47 +24,30 @@ using System.ComponentModel; using System.Drawing; using System.IO; using System.Windows.Forms; -using System.Threading; - +using Greenshot.IniFile; using Greenshot.Plugin; using GreenshotPlugin.Controls; using GreenshotPlugin.Core; -using Greenshot.IniFile; -using CommunicatorAPI; -using System.Runtime.InteropServices; -namespace GreenshotOfficeCommunicatorPlugin { +namespace GreenshotBoxPlugin { /// - /// This is the OfficeCommunicatorPlugin + /// This is the Box base code /// - public class OfficeCommunicatorPlugin : IGreenshotPlugin { - private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(OfficeCommunicatorPlugin)); + public class BoxPlugin : IGreenshotPlugin { + private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(BoxPlugin)); + private static BoxConfiguration config; public static PluginAttribute Attributes; - private OfficeCommunicatorConfiguration config = IniConfig.GetIniSection(); private IGreenshotHost host; - private Communicator communicator; - public IGreenshotHost Host { - get { - return host; - } - } + private ComponentResourceManager resources; - public Communicator Communicator { - get { - return communicator; - } - set { - communicator = value; - } - } - - public OfficeCommunicatorPlugin() { + public BoxPlugin() { } public IEnumerable Destinations() { - yield return new OfficeCommunicatorDestination(this); + yield return new BoxDestination(this); } + public IEnumerable Processors() { yield break; } @@ -73,20 +56,27 @@ namespace GreenshotOfficeCommunicatorPlugin { /// Implementation of the IGreenshotPlugin.Initialize /// /// Use the IGreenshotPluginHost interface to register events - /// Use the ICaptureHost interface to register in the MainContextMenu /// My own attributes - /// true if plugin is initialized, false if not (doesn't show) public virtual bool Initialize(IGreenshotHost pluginHost, PluginAttribute myAttributes) { this.host = (IGreenshotHost)pluginHost; Attributes = myAttributes; - communicator = new Communicator(); - communicator.Signin(null, null); + // Register configuration (don't need the configuration itself) + config = IniConfig.GetIniSection(); + resources = new ComponentResourceManager(typeof(BoxPlugin)); + + ToolStripMenuItem itemPlugInConfig = new ToolStripMenuItem(); + itemPlugInConfig.Image = (Image)resources.GetObject("Box"); + itemPlugInConfig.Text = Language.GetString("box", LangKey.Configure); + itemPlugInConfig.Click += new System.EventHandler(ConfigMenuClick); + + PluginUtils.AddToContextMenu(host, itemPlugInConfig); + return true; } public virtual void Shutdown() { - LOG.Debug("OfficeCommunicator Plugin shutdown."); + LOG.Debug("Box Plugin shutdown."); } /// @@ -102,8 +92,40 @@ namespace GreenshotOfficeCommunicatorPlugin { /// /// public void Closing(object sender, FormClosingEventArgs e) { - LOG.Debug("Application closing, de-registering OfficeCommunicator Plugin!"); + LOG.Debug("Application closing, de-registering Box Plugin!"); Shutdown(); } + + public void ConfigMenuClick(object sender, EventArgs eventArgs) { + config.ShowConfigDialog(); + } + + /// + /// This will be called when the menu item in the Editor is clicked + /// + public string Upload(ICaptureDetails captureDetails, Image image) { + OutputSettings outputSettings = new OutputSettings(config.UploadFormat, config.UploadJpegQuality, false); + try { + string url = null; + string filename = Path.GetFileName(FilenameHelper.GetFilename(config.UploadFormat, captureDetails)); + ImageContainer imageToUpload = new ImageContainer(image, outputSettings, filename); + + new PleaseWaitForm().ShowAndWait(BoxPlugin.Attributes.Name, Language.GetString("box", LangKey.communication_wait), + delegate() { + url = BoxUtils.UploadToBox(imageToUpload, captureDetails.Title, filename); + } + ); + + if (url != null && config.AfterUploadLinkToClipBoard) { + ClipboardHelper.SetClipboardData(url); + } + + return url; + } catch (Exception ex) { + LOG.Error("Error uploading.", ex); + MessageBox.Show(Language.GetString("box", LangKey.upload_failure) + " " + ex.ToString()); + return null; + } + } } } diff --git a/GreenshotImmioPlugin/ImmioPlugin.resx b/GreenshotBoxPlugin/BoxPlugin.resx similarity index 86% rename from GreenshotImmioPlugin/ImmioPlugin.resx rename to GreenshotBoxPlugin/BoxPlugin.resx index 00ce7ed3d..57b6289de 100644 --- a/GreenshotImmioPlugin/ImmioPlugin.resx +++ b/GreenshotBoxPlugin/BoxPlugin.resx @@ -117,15 +117,8 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAMVJREFUOE9jDA0J - ZSAJADW8ffeOSAQyHaJhzvHXaGjR6TdoCKgMi4Zzj79+/vH3Pxg8ePfz2cdfQBGgTqBx2DVAlKKB9Zfe - 49QAlIOofvP1N9BsINp69QPEtdhtAEoAHbDi3FtMX+HUgKkUiw29m6e0rshsWORfO88WSLatyp+4fRqa - ThQbgKqBStuWO6ChpcdTFx+vXnh8IbofkFUvPOKDhhYciVlwtATFBojBmEqRRdA14FcNlEXRQFA1ugbS - Eh8wSRGPAL2C6QdnoO9oAAAAAElFTkSuQmCC - + + + box.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a \ No newline at end of file diff --git a/GreenshotBoxPlugin/BoxUtils.cs b/GreenshotBoxPlugin/BoxUtils.cs new file mode 100644 index 000000000..3c6352ad1 --- /dev/null +++ b/GreenshotBoxPlugin/BoxUtils.cs @@ -0,0 +1,132 @@ +/* + * Greenshot - a free and open source screenshot tool + * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel + * + * For more information see: http://getgreenshot.org/ + * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 1 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Net; +using System.Xml; +using Greenshot.IniFile; +using GreenshotPlugin.Controls; +using GreenshotPlugin.Core; + +namespace GreenshotBoxPlugin { + /// + /// Description of ImgurUtils. + /// + public class BoxUtils { + private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(BoxUtils)); + private static BoxConfiguration config = IniConfig.GetIniSection(); + + private BoxUtils() { + } + + private static string ParseTicket(string response) { + try { + XmlDocument doc = new XmlDocument(); + doc.LoadXml(response); + XmlNodeList nodes = doc.GetElementsByTagName("ticket"); + if(nodes.Count > 0) { + return nodes.Item(0).InnerText; + } + } catch (Exception ex) { + LOG.Error("Error parsing Box Response.", ex); + } + return null; + } + + private static bool Authorize() { + string ticketUrl = string.Format("https://www.box.com/api/1.0/rest?action=get_ticket&api_key={0}", BoxCredentials.API_KEY); + string ticketXML = NetworkHelper.GetAsString(new Uri(ticketUrl)); + string ticket = ParseTicket(ticketXML); + string authorizeUrl = string.Format("https://www.box.com/api/1.0/auth/{0}", ticket); + OAuthLoginForm loginForm = new OAuthLoginForm("Box Authorize", new Size(1060,600), authorizeUrl, "http://getgreenshot.org"); + loginForm.ShowDialog(); + if (loginForm.isOk) { + if (loginForm.CallbackParameters != null && loginForm.CallbackParameters.ContainsKey("auth_token")) { + config.BoxToken = loginForm.CallbackParameters["auth_token"]; + IniConfig.Save(); + return true; + } + } + return false; + } + + + /// + /// Upload file by post + /// + /// + /// + /// response + public static string HttpUploadFile(string url, Dictionary parameters) { + HttpWebRequest webRequest = (HttpWebRequest)NetworkHelper.CreateWebRequest(url); + webRequest.Method = "POST"; + webRequest.KeepAlive = true; + webRequest.Credentials = System.Net.CredentialCache.DefaultCredentials; + NetworkHelper.WriteMultipartFormData(webRequest, parameters); + + return NetworkHelper.GetResponse(webRequest); + } + + /// + /// Do the actual upload to Box + /// For more details on the available parameters, see: http://developers.box.net/w/page/12923951/ApiFunction_Upload%20and%20Download + /// + /// byte[] with image data + /// url to uploaded image + public static string UploadToBox(ImageContainer image, string title, string filename) { + string folderId = "0"; + if (string.IsNullOrEmpty(config.BoxToken)) { + if (!Authorize()) { + return null; + } + } + + string strUrl = string.Format("https://upload.box.net/api/1.0/upload/{0}/{1}?file_name={2}&new_copy=1", config.BoxToken, folderId, filename); + + Dictionary parameters = new Dictionary(); + parameters.Add("share", "1"); + parameters.Add("new_file", image); + + string response = HttpUploadFile(strUrl, parameters); + // Check if the token is wrong + if ("wrong auth token".Equals(response)) { + config.BoxToken = null; + IniConfig.Save(); + return UploadToBox(image, title, filename); + } + LOG.DebugFormat("Box response: {0}", response); + XmlDocument doc = new XmlDocument(); + doc.LoadXml(response); + XmlNodeList nodes = doc.GetElementsByTagName("status"); + if(nodes.Count > 0) { + if ("upload_ok".Equals(nodes.Item(0).InnerText)) { + nodes = doc.GetElementsByTagName("file"); + if (nodes.Count > 0) { + long id = long.Parse(nodes.Item(0).Attributes["id"].Value); + return string.Format("http://www.box.com/files/0/f/0/1/f_{0}", id); + } + } + } + return null; + } + } +} diff --git a/GreenshotOfficeCommunicatorPlugin/Forms/OfficeCommunicatorForm.cs b/GreenshotBoxPlugin/Forms/BoxForm.cs similarity index 73% rename from GreenshotOfficeCommunicatorPlugin/Forms/OfficeCommunicatorForm.cs rename to GreenshotBoxPlugin/Forms/BoxForm.cs index 126f4d2bc..b8aa634be 100644 --- a/GreenshotOfficeCommunicatorPlugin/Forms/OfficeCommunicatorForm.cs +++ b/GreenshotBoxPlugin/Forms/BoxForm.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ @@ -18,14 +18,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -using System; +using GreenshotPlugin.Controls; -namespace GreenshotOfficeCommunicatorPlugin { - /// - /// This class is needed for design-time resolving of the language files - /// - public class OfficeCommunicatorForm : GreenshotPlugin.Controls.GreenshotForm { - public OfficeCommunicatorForm() : base() { - } +namespace GreenshotBoxPlugin.Forms { + public class BoxForm : GreenshotForm { } -} +} \ No newline at end of file diff --git a/GreenshotImmioPlugin/Forms/SettingsForm.Designer.cs b/GreenshotBoxPlugin/Forms/SettingsForm.Designer.cs similarity index 59% rename from GreenshotImmioPlugin/Forms/SettingsForm.Designer.cs rename to GreenshotBoxPlugin/Forms/SettingsForm.Designer.cs index 18595162b..a1a0d777e 100644 --- a/GreenshotImmioPlugin/Forms/SettingsForm.Designer.cs +++ b/GreenshotBoxPlugin/Forms/SettingsForm.Designer.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ @@ -18,7 +18,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -namespace GreenshotImmioPlugin { +namespace GreenshotBoxPlugin { partial class SettingsForm { /// /// Designer variable used to keep track of non-visual components. @@ -50,70 +50,99 @@ namespace GreenshotImmioPlugin { this.buttonCancel = new GreenshotPlugin.Controls.GreenshotButton(); this.combobox_uploadimageformat = new GreenshotPlugin.Controls.GreenshotComboBox(); this.label_upload_format = new GreenshotPlugin.Controls.GreenshotLabel(); + this.label_AfterUpload = new GreenshotPlugin.Controls.GreenshotLabel(); + this.checkboxAfterUploadLinkToClipBoard = new GreenshotPlugin.Controls.GreenshotCheckBox(); this.SuspendLayout(); // // buttonOK // this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonOK.LanguageKey = "immio.OK"; - this.buttonOK.Location = new System.Drawing.Point(222, 88); + this.buttonOK.LanguageKey = "OK"; + this.buttonOK.Location = new System.Drawing.Point(267, 72); this.buttonOK.Name = "buttonOK"; this.buttonOK.Size = new System.Drawing.Size(75, 23); - this.buttonOK.TabIndex = 2; + this.buttonOK.TabIndex = 12; this.buttonOK.UseVisualStyleBackColor = true; this.buttonOK.Click += new System.EventHandler(this.ButtonOKClick); // // buttonCancel // this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonCancel.LanguageKey = "immio.CANCEL"; - this.buttonCancel.Location = new System.Drawing.Point(303, 88); + this.buttonCancel.LanguageKey = "CANCEL"; + this.buttonCancel.Location = new System.Drawing.Point(348, 72); this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Size = new System.Drawing.Size(75, 23); - this.buttonCancel.TabIndex = 3; + this.buttonCancel.TabIndex = 13; this.buttonCancel.UseVisualStyleBackColor = true; this.buttonCancel.Click += new System.EventHandler(this.ButtonCancelClick); // // combobox_uploadimageformat // + this.combobox_uploadimageformat.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.combobox_uploadimageformat.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.combobox_uploadimageformat.FormattingEnabled = true; - this.combobox_uploadimageformat.Location = new System.Drawing.Point(102, 7); + this.combobox_uploadimageformat.Location = new System.Drawing.Point(208, 12); this.combobox_uploadimageformat.Name = "combobox_uploadimageformat"; this.combobox_uploadimageformat.PropertyName = "UploadFormat"; - this.combobox_uploadimageformat.SectionName = "Immio"; - this.combobox_uploadimageformat.Size = new System.Drawing.Size(276, 21); - this.combobox_uploadimageformat.TabIndex = 8; + this.combobox_uploadimageformat.SectionName = "Box"; + this.combobox_uploadimageformat.Size = new System.Drawing.Size(215, 21); + this.combobox_uploadimageformat.TabIndex = 5; // // label_upload_format // - this.label_upload_format.LanguageKey = "immio.label_upload_format"; - this.label_upload_format.Location = new System.Drawing.Point(12, 10); + this.label_upload_format.LanguageKey = "box.label_upload_format"; + this.label_upload_format.Location = new System.Drawing.Point(10, 12); this.label_upload_format.Name = "label_upload_format"; - this.label_upload_format.Size = new System.Drawing.Size(84, 20); - this.label_upload_format.TabIndex = 9; + this.label_upload_format.Size = new System.Drawing.Size(192, 20); + this.label_upload_format.TabIndex = 4; + // + // label_AfterUpload + // + this.label_AfterUpload.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.label_AfterUpload.LanguageKey = "box.label_AfterUpload"; + this.label_AfterUpload.Location = new System.Drawing.Point(10, 46); + this.label_AfterUpload.Name = "label_AfterUpload"; + this.label_AfterUpload.Size = new System.Drawing.Size(84, 21); + this.label_AfterUpload.TabIndex = 8; + // + // checkboxAfterUploadLinkToClipBoard + // + this.checkboxAfterUploadLinkToClipBoard.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.checkboxAfterUploadLinkToClipBoard.AutoSize = true; + this.checkboxAfterUploadLinkToClipBoard.LanguageKey = "box.label_AfterUploadLinkToClipBoard"; + this.checkboxAfterUploadLinkToClipBoard.Location = new System.Drawing.Point(208, 48); + this.checkboxAfterUploadLinkToClipBoard.Name = "checkboxAfterUploadLinkToClipBoard"; + this.checkboxAfterUploadLinkToClipBoard.PropertyName = "AfterUploadLinkToClipBoard"; + this.checkboxAfterUploadLinkToClipBoard.SectionName = "Box"; + this.checkboxAfterUploadLinkToClipBoard.Size = new System.Drawing.Size(15, 14); + this.checkboxAfterUploadLinkToClipBoard.TabIndex = 10; + this.checkboxAfterUploadLinkToClipBoard.UseVisualStyleBackColor = true; // // SettingsForm // this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; - this.ClientSize = new System.Drawing.Size(387, 123); + this.ClientSize = new System.Drawing.Size(432, 104); + this.Controls.Add(this.checkboxAfterUploadLinkToClipBoard); + this.Controls.Add(this.label_AfterUpload); this.Controls.Add(this.label_upload_format); this.Controls.Add(this.combobox_uploadimageformat); this.Controls.Add(this.buttonCancel); this.Controls.Add(this.buttonOK); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.LanguageKey = "immio.settings_title"; + this.LanguageKey = "box.settings_title"; this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "SettingsForm"; this.ResumeLayout(false); this.PerformLayout(); - } private GreenshotPlugin.Controls.GreenshotComboBox combobox_uploadimageformat; private GreenshotPlugin.Controls.GreenshotLabel label_upload_format; private GreenshotPlugin.Controls.GreenshotButton buttonCancel; private GreenshotPlugin.Controls.GreenshotButton buttonOK; + private GreenshotPlugin.Controls.GreenshotLabel label_AfterUpload; + private GreenshotPlugin.Controls.GreenshotCheckBox checkboxAfterUploadLinkToClipBoard; } } diff --git a/GreenshotPhotobucketPlugin/Forms/SettingsForm.cs b/GreenshotBoxPlugin/Forms/SettingsForm.cs similarity index 83% rename from GreenshotPhotobucketPlugin/Forms/SettingsForm.cs rename to GreenshotBoxPlugin/Forms/SettingsForm.cs index 8c04847f5..af76b4593 100644 --- a/GreenshotPhotobucketPlugin/Forms/SettingsForm.cs +++ b/GreenshotBoxPlugin/Forms/SettingsForm.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ @@ -19,23 +19,28 @@ * along with this program. If not, see . */ using System; +using System.Drawing; using System.Windows.Forms; -using GreenshotPlugin.Core; -using GreenshotPlugin.Controls; -namespace GreenshotPhotobucketPlugin { +using GreenshotBoxPlugin.Forms; +using GreenshotPlugin.Core; + +namespace GreenshotBoxPlugin { /// /// Description of PasswordRequestForm. /// - public partial class SettingsForm : PhotobucketForm { - public SettingsForm(PhotobucketConfiguration config) : base() { + public partial class SettingsForm : BoxForm { + string boxTicket = string.Empty; + + public SettingsForm(BoxConfiguration config) { // // The InitializeComponent() call is required for Windows Forms designer support. // InitializeComponent(); this.Icon = GreenshotPlugin.Core.GreenshotResources.getGreenshotIcon(); + } - + void ButtonOKClick(object sender, EventArgs e) { this.DialogResult = DialogResult.OK; } diff --git a/GreenshotPhotobucketPlugin/GreenshotPhotobucketPlugin.csproj b/GreenshotBoxPlugin/GreenshotBoxPlugin.csproj similarity index 60% rename from GreenshotPhotobucketPlugin/GreenshotPhotobucketPlugin.csproj rename to GreenshotBoxPlugin/GreenshotBoxPlugin.csproj index c15664559..275f9fb6d 100644 --- a/GreenshotPhotobucketPlugin/GreenshotPhotobucketPlugin.csproj +++ b/GreenshotBoxPlugin/GreenshotBoxPlugin.csproj @@ -2,10 +2,10 @@ - {9C0ECC4C-7807-4111-916A-4F57BB29788A} + {697CF066-9077-4F22-99D9-D989CCE7282B} Library - GreenshotPhotobucketPlugin - GreenshotPhotobucketPlugin + GreenshotBoxPlugin + GreenshotBoxPlugin v2.0 Properties False @@ -13,16 +13,14 @@ 4 false OnBuildSuccess - - - 3.5 + - ..\Greenshot\Lib\log4net.dll + ..\lib\log4net.dll @@ -30,7 +28,12 @@ - + + + + + + Form @@ -39,45 +42,47 @@ SettingsForm.cs - - - - - - - Never - - - Never - - - Never - - - Never - - - - - PhotobucketPlugin.cs + + BoxPlugin.cs Designer - + + + + + + + + + + + {5B924697-4DCD-4F98-85F1-105CB84B7341} GreenshotPlugin - "$(SolutionDir)\tools\TortoiseSVN\SubWCRev.exe" "$(ProjectDir)\" "$(ProjectDir)\Properties\AssemblyInfo.cs.template" "$(ProjectDir)\Properties\AssemblyInfo.cs" - mkdir "$(SolutionDir)bin\$(Configuration)\Plugins\$(ProjectName)" -copy "$(ProjectDir)bin\$(Configuration)\$(TargetFileName)" "$(SolutionDir)bin\$(Configuration)\Plugins\$(ProjectName)\*.gsp" + if exist "$(ProjectDir)BoxCredentials.orig.cs" ( + rename "$(ProjectDir)BoxCredentials.cs" "BoxCredentials.private.cs" + rename "$(ProjectDir)BoxCredentials.orig.cs" "BoxCredentials.cs" +) else exit /b -1 + +mkdir "$(SolutionDir)bin\$(Configuration)\Plugins\$(ProjectName)" +copy "$(ProjectDir)bin\$(Configuration)\$(ProjectName).dll" "$(SolutionDir)bin\$(Configuration)\Plugins\$(ProjectName)\*.gsp" copy "$(ProjectDir)bin\$(Configuration)\$(ProjectName).pdb" "$(SolutionDir)bin\$(Configuration)\Plugins\$(ProjectName)\" mkdir "$(SolutionDir)bin\$(Configuration)\Languages\Plugins\$(ProjectName)" -copy "$(ProjectDir)\Languages\*.xml" "$(SolutionDir)bin\$(Configuration)\Languages\Plugins\$(ProjectName)\" +copy "$(ProjectDir)Languages\*.xml" "$(SolutionDir)bin\$(Configuration)\Languages\Plugins\$(ProjectName)\" + + "$(SolutionDir)\tools\TortoiseSVN\SubWCRev.exe" "$(ProjectDir)\" "$(ProjectDir)\Properties\AssemblyInfo.cs.template" "$(ProjectDir)\Properties\AssemblyInfo.cs" + +if exist "$(ProjectDir)BoxCredentials.private.cs" ( + rename "$(ProjectDir)BoxCredentials.cs" "BoxCredentials.orig.cs" + rename "$(ProjectDir)BoxCredentials.private.cs" "BoxCredentials.cs" +) else exit /b -1 False @@ -97,8 +102,8 @@ copy "$(ProjectDir)\Languages\*.xml" "$(SolutionDir)bin\$(Configuration)\Languag DEBUG;TRACE False True - None - false + Full + true TRACE diff --git a/GreenshotImmioPlugin/LanguageKeys.cs b/GreenshotBoxPlugin/LanguageKeys.cs similarity index 87% rename from GreenshotImmioPlugin/LanguageKeys.cs rename to GreenshotBoxPlugin/LanguageKeys.cs index f1799de38..db2c2516b 100644 --- a/GreenshotImmioPlugin/LanguageKeys.cs +++ b/GreenshotBoxPlugin/LanguageKeys.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ @@ -18,18 +18,16 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - -namespace GreenshotImmioPlugin { +namespace GreenshotBoxPlugin { public enum LangKey { upload_menu_item, settings_title, - label_url, label_upload_format, - OK, - CANCEL, upload_success, upload_failure, communication_wait, - configure + Configure, + label_AfterUpload, + label_AfterUploadLinkToClipBoard } } diff --git a/GreenshotBoxPlugin/Languages/language_Boxplugin-en-US.xml b/GreenshotBoxPlugin/Languages/language_Boxplugin-en-US.xml new file mode 100644 index 000000000..181603529 --- /dev/null +++ b/GreenshotBoxPlugin/Languages/language_Boxplugin-en-US.xml @@ -0,0 +1,32 @@ + + + + + Link to clipboard + + + After upload + + + Configure Box + + + Upload to Box + + + Box settings + + + Successfully uploaded image to Box! + + + An error occured while uploading to Box: + + + Image format + + + Communicating with Box. Please wait... + + + \ No newline at end of file diff --git a/GreenshotBoxPlugin/Languages/language_Boxplugin-fr-FR.xml b/GreenshotBoxPlugin/Languages/language_Boxplugin-fr-FR.xml new file mode 100644 index 000000000..fd8e7a72f --- /dev/null +++ b/GreenshotBoxPlugin/Languages/language_Boxplugin-fr-FR.xml @@ -0,0 +1,14 @@ + + + + Communication en cours avec le service de stockage en ligne. Veuillez patientez... + Configurer Box + Après téléversement + Copier le lien dans le presse-papier + Format image + Paramètres du stockage en ligne + Une erreur s'est produite lors du téléversement vers le stockage en ligne : + Téléverser vers le stockage en ligne + Image téléversée aves succès vers le stockage en ligne ! + + \ No newline at end of file diff --git a/GreenshotBoxPlugin/Languages/language_Boxplugin-ru-RU.xml b/GreenshotBoxPlugin/Languages/language_Boxplugin-ru-RU.xml new file mode 100644 index 000000000..712c01cbc --- /dev/null +++ b/GreenshotBoxPlugin/Languages/language_Boxplugin-ru-RU.xml @@ -0,0 +1,32 @@ + + + + + Ссылка в буфер обмена + + + После загрузки + + + Настройка Box + + + Загрузить на Box + + + Параметры Box + + + Изображение успешно загружено на Box! + + + Произошла ошибка при загрузке на Box: + + + Формат изображения + + + Обмен данными с Box. Подождите... + + + \ No newline at end of file diff --git a/GreenshotBoxPlugin/Languages/language_Boxplugin-uk-UA.xml b/GreenshotBoxPlugin/Languages/language_Boxplugin-uk-UA.xml new file mode 100644 index 000000000..6bf188bc8 --- /dev/null +++ b/GreenshotBoxPlugin/Languages/language_Boxplugin-uk-UA.xml @@ -0,0 +1,14 @@ + + + + Посилання в буфер обміну + Після вивантаження + Налаштувати Box + Вивантажити на Box + Параметри Box + Зображення вдало вивантажено на Box! + Відбулась помилка під час вивантаження на Box: + Формат зображення + З’єднання з Box. Будь ласка, зачекайте... + + diff --git a/GreenshotBoxPlugin/Languages/language_Boxplugin-zh-CN.xml b/GreenshotBoxPlugin/Languages/language_Boxplugin-zh-CN.xml new file mode 100644 index 000000000..1eb7f88f2 --- /dev/null +++ b/GreenshotBoxPlugin/Languages/language_Boxplugin-zh-CN.xml @@ -0,0 +1,14 @@ + + + + 正在连接Box。请稍后... + 配置Box + 上传之后 + 复制链接到剪贴板 + 图片格式 + Box设置 + 上传图片到Box时发生错误: + 上传到Box + 图片已成功上传到Box! + + \ No newline at end of file diff --git a/GreenshotPhotobucketPlugin/Properties/AssemblyInfo.cs.template b/GreenshotBoxPlugin/Properties/AssemblyInfo.cs.template similarity index 79% rename from GreenshotPhotobucketPlugin/Properties/AssemblyInfo.cs.template rename to GreenshotBoxPlugin/Properties/AssemblyInfo.cs.template index bd52d0b85..4784236a0 100644 --- a/GreenshotPhotobucketPlugin/Properties/AssemblyInfo.cs.template +++ b/GreenshotBoxPlugin/Properties/AssemblyInfo.cs.template @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ @@ -30,16 +30,16 @@ using Greenshot.Plugin; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("Greenshot-Photobucket-Plugin")] -[assembly: AssemblyDescription("A plugin to upload images to Photobucket")] +[assembly: AssemblyTitle("Greenshot-Box-Plugin")] +[assembly: AssemblyDescription("A plugin to upload images to Box")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Greenshot")] -[assembly: AssemblyProduct("Photobucket Plugin")] -[assembly: AssemblyCopyright("Copyright (C) 2007-2012")] +[assembly: AssemblyCompany("Greenshot & F. Noel")] +[assembly: AssemblyProduct("Box Plugin")] +[assembly: AssemblyCopyright("Copyright (C) 2012")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // The PluginAttribute describes the "entryType" and if the plugin is configurable -[assembly: PluginAttribute("GreenshotPhotobucketPlugin.PhotobucketPlugin", true)] +[assembly: PluginAttribute("GreenshotBoxPlugin.BoxPlugin", true)] // This sets the default COM visibility of types in the assembly to invisible. // If you need to expose a type to COM, use [ComVisible(true)] on that type. @@ -51,4 +51,4 @@ using Greenshot.Plugin; // // You can specify all the values or you can use the default the Revision and // Build Numbers by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.3.$WCREV$")] +[assembly: AssemblyVersion("1.0.5.$WCREV$")] diff --git a/GreenshotBoxPlugin/app.config b/GreenshotBoxPlugin/app.config new file mode 100644 index 000000000..3e588c04a --- /dev/null +++ b/GreenshotBoxPlugin/app.config @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/GreenshotConfluencePlugin/Properties/AssemblyInfo.cs.template b/GreenshotConfluencePlugin/Properties/AssemblyInfo.cs.template index 622cc5d9a..a7c771743 100644 --- a/GreenshotConfluencePlugin/Properties/AssemblyInfo.cs.template +++ b/GreenshotConfluencePlugin/Properties/AssemblyInfo.cs.template @@ -51,4 +51,4 @@ using Greenshot.Plugin; // // You can specify all the values or you can use the default the Revision and // Build Numbers by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.4.$WCREV$")] \ No newline at end of file +[assembly: AssemblyVersion("1.0.5.$WCREV$")] \ No newline at end of file diff --git a/GreenshotDropboxPlugin/DropBoxCredentials.cs b/GreenshotDropboxPlugin/DropBoxCredentials.cs new file mode 100644 index 000000000..b22d73e00 --- /dev/null +++ b/GreenshotDropboxPlugin/DropBoxCredentials.cs @@ -0,0 +1,31 @@ +/* + * Greenshot - a free and open source screenshot tool + * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom + * + * For more information see: http://getgreenshot.org/ + * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 1 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +namespace GreenshotDropboxPlugin { + /// + /// This class is merely a placeholder for the file keeping the API key and secret for dropbox integration. + /// Copy this file to DropBoxCredentials.private.cs and fill in valid credentials. (Or empty strings, but of course you won't be able to use the DropBox plugin then.) + /// + public static class DropBoxCredentials { + public static string CONSUMER_KEY = empty; + public static string CONSUMER_SECRET = empty; + } +} diff --git a/GreenshotDropboxPlugin/DropBoxCredentials.private.cs b/GreenshotDropboxPlugin/DropBoxCredentials.private.cs new file mode 100644 index 000000000..1be011828 --- /dev/null +++ b/GreenshotDropboxPlugin/DropBoxCredentials.private.cs @@ -0,0 +1,9 @@ +using System; + +namespace GreenshotDropboxPlugin +{ + public static class DropBoxCredentials { + public static string CONSUMER_KEY = "u7c1rpxht2x5s1r"; + public static string CONSUMER_SECRET = "apitf6xvdaysaww"; + } +} diff --git a/GreenshotDropboxPlugin/Dropbox.gif b/GreenshotDropboxPlugin/Dropbox.gif new file mode 100644 index 000000000..e09205da8 Binary files /dev/null and b/GreenshotDropboxPlugin/Dropbox.gif differ diff --git a/GreenshotPhotobucketPlugin/PhotobucketDestination.cs b/GreenshotDropboxPlugin/DropboxDestination.cs similarity index 66% rename from GreenshotPhotobucketPlugin/PhotobucketDestination.cs rename to GreenshotDropboxPlugin/DropboxDestination.cs index d363ade98..8dea2a10a 100644 --- a/GreenshotPhotobucketPlugin/PhotobucketDestination.cs +++ b/GreenshotDropboxPlugin/DropboxDestination.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ @@ -18,58 +18,51 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -using System; -using System.Collections.Generic; using System.ComponentModel; -using System.Diagnostics; using System.Drawing; -using System.IO; -using System.Windows; - +using Greenshot.IniFile; using Greenshot.Plugin; using GreenshotPlugin.Core; -using Greenshot.IniFile; +namespace GreenshotDropboxPlugin { + class DropboxDestination : AbstractDestination { + private static log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(DropboxDestination)); + private static DropboxPluginConfiguration config = IniConfig.GetIniSection(); -namespace GreenshotPhotobucketPlugin { - /// - /// Description of PhotobucketDestination. - /// - public class PhotobucketDestination : AbstractDestination { - private static log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(PhotobucketDestination)); - private static PhotobucketConfiguration config = IniConfig.GetIniSection(); - private PhotobucketPlugin plugin = null; - - public PhotobucketDestination(PhotobucketPlugin plugin) { + private DropboxPlugin plugin = null; + public DropboxDestination(DropboxPlugin plugin) { this.plugin = plugin; } public override string Designation { get { - return "Photobucket"; + return "Dropbox"; } } public override string Description { get { - return Language.GetString("photobucket", LangKey.upload_menu_item); + return Language.GetString("dropbox", LangKey.upload_menu_item); } } public override Image DisplayIcon { get { - ComponentResourceManager resources = new ComponentResourceManager(typeof(PhotobucketPlugin)); - return (Image)resources.GetObject("Photobucket"); + ComponentResourceManager resources = new ComponentResourceManager(typeof(DropboxPlugin)); + return (Image)resources.GetObject("Dropbox"); } } - - public override ExportInformation ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails) { + + public override ExportInformation ExportCapture(bool manually, ISurface surface, ICaptureDetails captureDetails) { ExportInformation exportInformation = new ExportInformation(this.Designation, this.Description); using (Image image = surface.GetImageForExport()) { string uploadURL = null; bool uploaded = plugin.Upload(captureDetails, image, out uploadURL); if (uploaded) { - exportInformation.ExportMade = true; exportInformation.Uri = uploadURL; + exportInformation.ExportMade = true; + if (config.AfterUploadLinkToClipBoard) { + ClipboardHelper.SetClipboardData(uploadURL); + } } } ProcessExport(exportInformation, surface); diff --git a/GreenshotImmioPlugin/ImmioPlugin.cs b/GreenshotDropboxPlugin/DropboxPlugin.cs similarity index 56% rename from GreenshotImmioPlugin/ImmioPlugin.cs rename to GreenshotDropboxPlugin/DropboxPlugin.cs index ebd9acc72..c3233cc72 100644 --- a/GreenshotImmioPlugin/ImmioPlugin.cs +++ b/GreenshotDropboxPlugin/DropboxPlugin.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ @@ -29,24 +29,25 @@ using Greenshot.Plugin; using GreenshotPlugin.Controls; using GreenshotPlugin.Core; -namespace GreenshotImmioPlugin { +namespace GreenshotDropboxPlugin { /// - /// This is the ImmioPlugin code + /// This is the Dropbox base code /// - public class ImmioPlugin : IGreenshotPlugin { - private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(ImmioPlugin)); - private static ImmioConfiguration config; + public class DropboxPlugin : IGreenshotPlugin { + private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(DropboxPlugin)); + private static DropboxPluginConfiguration config; public static PluginAttribute Attributes; private IGreenshotHost host; private ComponentResourceManager resources; - public ImmioPlugin() { + public DropboxPlugin() { } public IEnumerable Destinations() { - yield return new ImmioDestination(this); + yield return new DropboxDestination(this); } + public IEnumerable Processors() { yield break; } @@ -55,29 +56,28 @@ namespace GreenshotImmioPlugin { /// Implementation of the IGreenshotPlugin.Initialize /// /// Use the IGreenshotPluginHost interface to register events - /// Use the ICaptureHost interface to register in the MainContextMenu /// My own attributes - /// true if plugin is initialized, false if not (doesn't show) public virtual bool Initialize(IGreenshotHost pluginHost, PluginAttribute myAttributes) { this.host = (IGreenshotHost)pluginHost; Attributes = myAttributes; - // Get configuration - config = IniConfig.GetIniSection(); - resources = new ComponentResourceManager(typeof(ImmioPlugin)); - - ToolStripMenuItem itemPlugInRoot = new ToolStripMenuItem(Language.GetString("immio", LangKey.configure)); - itemPlugInRoot.Image = (Image)resources.GetObject("Immio"); - itemPlugInRoot.Click += delegate { - config.ShowConfigDialog(); - }; + // Register configuration (don't need the configuration itself) + config = IniConfig.GetIniSection(); + resources = new ComponentResourceManager(typeof(DropboxPlugin)); + + ToolStripMenuItem itemPlugInConfig = new ToolStripMenuItem(); + itemPlugInConfig.Text = Language.GetString("dropbox", LangKey.Configure); + itemPlugInConfig.Tag = host; + itemPlugInConfig.Click += new System.EventHandler(ConfigMenuClick); + itemPlugInConfig.Image = (Image)resources.GetObject("Dropbox"); + + PluginUtils.AddToContextMenu(host, itemPlugInConfig); - PluginUtils.AddToContextMenu(host, itemPlugInRoot); return true; } - + public virtual void Shutdown() { - LOG.Debug("Immio Plugin shutdown."); + LOG.Debug("Dropbox Plugin shutdown."); } /// @@ -93,44 +93,38 @@ namespace GreenshotImmioPlugin { /// /// public void Closing(object sender, FormClosingEventArgs e) { - LOG.Debug("Application closing, de-registering Immio Plugin!"); + LOG.Debug("Application closing, de-registering Dropbox Plugin!"); Shutdown(); } - + + public void ConfigMenuClick(object sender, EventArgs eventArgs) { + config.ShowConfigDialog(); + } + /// - /// Upload the capture to Immio + /// This will be called when the menu item in the Editor is clicked /// - /// - /// - /// out string for the url - /// true if the upload succeeded - public bool Upload(ICaptureDetails captureDetails, Image image, out string uploadURL) { - OutputSettings outputSettings = new OutputSettings(config.UploadFormat, config.UploadJpegQuality, config.UploadReduceColors); - uploadURL = null; + public bool Upload(ICaptureDetails captureDetails, Image image, out string uploadUrl) { + uploadUrl = null; + OutputSettings outputSettings = new OutputSettings(config.UploadFormat, config.UploadJpegQuality, false); try { - string filename = Path.GetFileName(FilenameHelper.GetFilename(config.UploadFormat, captureDetails)); - string url = null; - - // Run upload in the background - new PleaseWaitForm().ShowAndWait(Attributes.Name, Language.GetString("immio", LangKey.communication_wait), + string dropboxUrl = null; + new PleaseWaitForm().ShowAndWait(Attributes.Name, Language.GetString("dropbox", LangKey.communication_wait), delegate() { - url = ImmioUtils.UploadToImmio(image, outputSettings, captureDetails.Title, filename); + string filename = Path.GetFileName(FilenameHelper.GetFilename(config.UploadFormat, captureDetails)); + dropboxUrl = DropboxUtils.UploadToDropbox(image, outputSettings, filename); } ); - uploadURL = url; - - IniConfig.Save(); - try { - ClipboardHelper.SetClipboardData(url); - } catch (Exception ex) { - LOG.Error("Can't write to clipboard: ", ex); + if (dropboxUrl == null) { + return false; } + uploadUrl = dropboxUrl; return true; } catch (Exception e) { LOG.Error(e); - MessageBox.Show(Language.GetString("immio", LangKey.upload_failure) + " " + e.Message); + MessageBox.Show(Language.GetString("dropbox", LangKey.upload_failure) + " " + e.ToString()); + return false; } - return false; } } } diff --git a/GreenshotPhotobucketPlugin/PhotobucketPlugin.resx b/GreenshotDropboxPlugin/DropboxPlugin.resx similarity index 80% rename from GreenshotPhotobucketPlugin/PhotobucketPlugin.resx rename to GreenshotDropboxPlugin/DropboxPlugin.resx index 1727301b6..f386b11fa 100644 --- a/GreenshotPhotobucketPlugin/PhotobucketPlugin.resx +++ b/GreenshotDropboxPlugin/DropboxPlugin.resx @@ -1,136 +1,124 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAIsSURBVDhPjZLfT1JhHMbP39DOUcKy0LpptRi57hC6YToTwzIsl26tm35dJl2oQaiX0axs1ECE - xC1CLHWzBZLVlKy2qDZFsqX/xrl4ep+XaK6rc/GMd9/383nO+x6O0tQdsllcg5vW8/d1a/eYsQiWzsme - BzbF4hoqByKrGHhSgG98xVDI0qGr1LeM6oe8z2DumEDdmZihkKVDV9FOjejmjpgoiMHknkBte1SW7RXr - o5emZbjmrMpVf+mKgmFZcOLyczzOfMfL979w494ylta2kZz/hqm5InJrv3Ez9A59wzkZsnToKpozqPMJ - 4+kiQokCMtl1vMqXUO9+CmtvElMLP+APf5CzTG5DMmTp0FVU511Z8OhFEc7rM3j7ZQcHOytXMLmjUFvC - uDa6iGCkgPznHcmQ5T5dRXUExBUqBZ2355Fe2kTN6agEqqlpi2D69TpS2ZJkyNKhKwvqPDE59PjmkM6X - ZQFfaDW17eKFXoiL8rJkyNL5V7DfMymHzVfTyH/aRsO5BExC2h3OuEeGLJ2/BX79wNlJPEx9xViqiIy4 - wuJHUdIVhyqOznDNGffIkKWjOvziCs1+vaErgWMX4/D6ZuHtn8WVwALerPzEzPKWTHZ1S864R4YsHbqi - 4I5+WHxVvPfu7HGFYRF/JcP1//t06CqafVA/0pOEJo6qtUUNJgLpCFfZ5+gvN/XFcby38tkaCVk6dJXG - 1qDNbL9V0uwDuiaOZCiCpdPYOmL7A+GxSANdcOqRAAAAAElFTkSuQmCC - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + dropbox.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/GreenshotOfficeCommunicatorPlugin/OfficeCommunicatorConfiguration.cs b/GreenshotDropboxPlugin/DropboxPluginConfiguration.cs similarity index 53% rename from GreenshotOfficeCommunicatorPlugin/OfficeCommunicatorConfiguration.cs rename to GreenshotDropboxPlugin/DropboxPluginConfiguration.cs index d5b33907e..bde33ff4e 100644 --- a/GreenshotOfficeCommunicatorPlugin/OfficeCommunicatorConfiguration.cs +++ b/GreenshotDropboxPlugin/DropboxPluginConfiguration.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ @@ -18,36 +18,37 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -using System; -using System.Collections.Generic; using System.Windows.Forms; - -using GreenshotPlugin.Controls; -using GreenshotPlugin.Core; using Greenshot.IniFile; +using GreenshotPlugin.Core; -namespace GreenshotOfficeCommunicatorPlugin { + +namespace GreenshotDropboxPlugin { /// - /// Description of OfficeCommunicatorConfiguration. + /// Description of ImgurConfiguration. /// - [IniSection("OfficeCommunicator", Description="Greenshot OfficeCommunicator Plugin configuration")] - public class OfficeCommunicatorConfiguration : IniSection { - [IniProperty("Destination", Description = "The designation of the destination which is used to export via, the returned URL is used in the message.", DefaultValue = "FileDialog")] - public string DestinationDesignation; + [IniSection("Dropbox", Description = "Greenshot Dropbox Plugin configuration")] + public class DropboxPluginConfiguration : IniSection { + [IniProperty("UploadFormat", Description="What file type to use for uploading", DefaultValue="png")] + public OutputFormat UploadFormat; + [IniProperty("UploadJpegQuality", Description="JPEG file save quality in %.", DefaultValue="80")] + public int UploadJpegQuality; + + [IniProperty("AfterUploadLinkToClipBoard", Description = "After upload send Dropbox link to clipboard.", DefaultValue = "true")] + public bool AfterUploadLinkToClipBoard; + + [IniProperty("DropboxToken", Description = "The Dropbox token", Encrypted = true, ExcludeIfNull = true)] + public string DropboxToken; + [IniProperty("DropboxTokenSecret", Description = "The Dropbox token secret", Encrypted = true, ExcludeIfNull = true)] + public string DropboxTokenSecret; + /// - /// A form for username/password + /// A form for token /// /// bool true if OK was pressed, false if cancel public bool ShowConfigDialog() { - SettingsForm settingsForm = null; - - new PleaseWaitForm().ShowAndWait(OfficeCommunicatorPlugin.Attributes.Name, Language.GetString("officecommunicator", LangKey.communication_wait), - delegate() { - settingsForm = new SettingsForm(this); - } - ); - DialogResult result = settingsForm.ShowDialog(); + DialogResult result = new SettingsForm().ShowDialog(); if (result == DialogResult.OK) { return true; } diff --git a/GreenshotDropboxPlugin/DropboxUtils.cs b/GreenshotDropboxPlugin/DropboxUtils.cs new file mode 100644 index 000000000..e098ab3e3 --- /dev/null +++ b/GreenshotDropboxPlugin/DropboxUtils.cs @@ -0,0 +1,80 @@ +/* + * Greenshot - a free and open source screenshot tool + * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel + * + * For more information see: http://getgreenshot.org/ + * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 1 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +using System; +using System.Collections.Generic; +using System.Drawing; +using Greenshot.IniFile; +using Greenshot.Plugin; +using GreenshotPlugin.Core; + +namespace GreenshotDropboxPlugin { + /// + /// Description of DropboxUtils. + /// + public class DropboxUtils { + private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(DropboxUtils)); + private static DropboxPluginConfiguration config = IniConfig.GetIniSection(); + + private DropboxUtils() { + } + + public static string UploadToDropbox(Image image, OutputSettings outputSettings, string filename) { + OAuthSession oAuth = new OAuthSession(DropBoxCredentials.CONSUMER_KEY, DropBoxCredentials.CONSUMER_SECRET); + oAuth.BrowserSize = new Size(1080, 650); + oAuth.CheckVerifier = false; + oAuth.AccessTokenUrl = "https://api.dropbox.com/1/oauth/access_token"; + oAuth.AuthorizeUrl = "https://api.dropbox.com/1/oauth/authorize"; + oAuth.RequestTokenUrl = "https://api.dropbox.com/1/oauth/request_token"; + oAuth.LoginTitle = "Dropbox authorization"; + oAuth.Token = config.DropboxToken; + oAuth.TokenSecret = config.DropboxTokenSecret; + + try { + ImageContainer imageToUpload = new ImageContainer(image, outputSettings, filename); + string uploadResponse = oAuth.MakeOAuthRequest(HTTPMethod.POST, "https://api-content.dropbox.com/1/files_put/sandbox/" + OAuthSession.UrlEncode3986(filename), null, null, imageToUpload); + LOG.DebugFormat("Upload response: {0}", uploadResponse); + } catch (Exception ex) { + LOG.Error("Upload error: ", ex); + throw ex; + } finally { + if (!string.IsNullOrEmpty(oAuth.Token)) { + config.DropboxToken = oAuth.Token; + } + if (!string.IsNullOrEmpty(oAuth.TokenSecret)) { + config.DropboxTokenSecret = oAuth.TokenSecret; + } + } + + // Try to get a URL to the uploaded image + try { + string responseString = oAuth.MakeOAuthRequest(HTTPMethod.GET, "https://api.dropbox.com/1/shares/sandbox/" + OAuthSession.UrlEncode3986(filename), null, null, null); + LOG.DebugFormat("Parsing output: {0}", responseString); + IDictionary returnValues = JSONHelper.JsonDecode(responseString); + if (returnValues.ContainsKey("url")) { + return returnValues["url"] as string; + } + } catch (Exception ex) { + LOG.Error("Can't parse response.", ex); + } + return null; + } + } +} diff --git a/GreenshotImmioPlugin/Forms/ImmioForm.cs b/GreenshotDropboxPlugin/Forms/DropboxForm.cs similarity index 78% rename from GreenshotImmioPlugin/Forms/ImmioForm.cs rename to GreenshotDropboxPlugin/Forms/DropboxForm.cs index ed117daf5..faaaae165 100644 --- a/GreenshotImmioPlugin/Forms/ImmioForm.cs +++ b/GreenshotDropboxPlugin/Forms/DropboxForm.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ @@ -19,16 +19,9 @@ * along with this program. If not, see . */ using System; -using System.Windows.Forms; -using GreenshotPlugin.Core; using GreenshotPlugin.Controls; -namespace GreenshotImmioPlugin { - /// - /// Description of ImmioForm. - /// - public class ImmioForm : GreenshotForm { - public ImmioForm() : base() { - } +namespace GreenshotDropboxPlugin.Forms { + public class DropboxForm : GreenshotForm { } } diff --git a/GreenshotPhotobucketPlugin/Forms/SettingsForm.Designer.cs b/GreenshotDropboxPlugin/Forms/SettingsForm.Designer.cs similarity index 62% rename from GreenshotPhotobucketPlugin/Forms/SettingsForm.Designer.cs rename to GreenshotDropboxPlugin/Forms/SettingsForm.Designer.cs index fb1b23364..89d0711d2 100644 --- a/GreenshotPhotobucketPlugin/Forms/SettingsForm.Designer.cs +++ b/GreenshotDropboxPlugin/Forms/SettingsForm.Designer.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2011 Thomas Braun, Jens Klingen, Robin Krom * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ @@ -18,7 +18,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -namespace GreenshotPhotobucketPlugin { +namespace GreenshotDropboxPlugin { partial class SettingsForm { /// /// Designer variable used to keep track of non-visual components. @@ -44,115 +44,109 @@ namespace GreenshotPhotobucketPlugin { /// Do not change the method contents inside the source code editor. The Forms designer might /// not be able to load this method if it was changed manually. /// - private void InitializeComponent() - { + private void InitializeComponent() { this.buttonOK = new GreenshotPlugin.Controls.GreenshotButton(); this.buttonCancel = new GreenshotPlugin.Controls.GreenshotButton(); - this.label_url = new GreenshotPlugin.Controls.GreenshotLabel(); - this.textBoxUrl = new GreenshotPlugin.Controls.GreenshotTextBox(); this.combobox_uploadimageformat = new GreenshotPlugin.Controls.GreenshotComboBox(); this.label_upload_format = new GreenshotPlugin.Controls.GreenshotLabel(); - this.checkbox_usepagelink = new GreenshotPlugin.Controls.GreenshotCheckBox(); + this.label_AfterUpload = new GreenshotPlugin.Controls.GreenshotLabel(); + this.checkboxAfterUploadLinkToClipBoard = new GreenshotPlugin.Controls.GreenshotCheckBox(); this.SuspendLayout(); // // buttonOK // this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonOK.LanguageKey = "photobucket.OK"; - this.buttonOK.Location = new System.Drawing.Point(222, 129); + this.buttonOK.LanguageKey = "OK"; + this.buttonOK.Location = new System.Drawing.Point(267, 64); this.buttonOK.Name = "buttonOK"; this.buttonOK.Size = new System.Drawing.Size(75, 23); this.buttonOK.TabIndex = 2; + this.buttonOK.Text = "OK"; this.buttonOK.UseVisualStyleBackColor = true; this.buttonOK.Click += new System.EventHandler(this.ButtonOKClick); // // buttonCancel // this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonCancel.LanguageKey = "photobucket.CANCEL"; - this.buttonCancel.Location = new System.Drawing.Point(303, 129); + this.buttonCancel.LanguageKey = "CANCEL"; + this.buttonCancel.Location = new System.Drawing.Point(348, 64); this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Size = new System.Drawing.Size(75, 23); this.buttonCancel.TabIndex = 3; + this.buttonCancel.Text = "Cancel"; this.buttonCancel.UseVisualStyleBackColor = true; this.buttonCancel.Click += new System.EventHandler(this.ButtonCancelClick); // - // label_url - // - this.label_url.LanguageKey = "photobucket.label_url"; - this.label_url.Location = new System.Drawing.Point(12, 21); - this.label_url.Name = "label_url"; - this.label_url.Size = new System.Drawing.Size(84, 20); - this.label_url.TabIndex = 7; - // - // textBoxUrl - // - this.textBoxUrl.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.textBoxUrl.Location = new System.Drawing.Point(102, 21); - this.textBoxUrl.Name = "textBoxUrl"; - this.textBoxUrl.PropertyName = "PhotobucketApiUrl"; - this.textBoxUrl.SectionName = "Photobucket"; - this.textBoxUrl.Size = new System.Drawing.Size(276, 20); - this.textBoxUrl.TabIndex = 6; - // // combobox_uploadimageformat // + this.combobox_uploadimageformat.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.combobox_uploadimageformat.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.combobox_uploadimageformat.FormattingEnabled = true; - this.combobox_uploadimageformat.Location = new System.Drawing.Point(102, 47); + this.combobox_uploadimageformat.Location = new System.Drawing.Point(116, 9); this.combobox_uploadimageformat.Name = "combobox_uploadimageformat"; this.combobox_uploadimageformat.PropertyName = "UploadFormat"; - this.combobox_uploadimageformat.SectionName = "Photobucket"; - this.combobox_uploadimageformat.Size = new System.Drawing.Size(276, 21); + this.combobox_uploadimageformat.SectionName = "Dropbox"; + this.combobox_uploadimageformat.Size = new System.Drawing.Size(309, 21); this.combobox_uploadimageformat.TabIndex = 8; // // label_upload_format // - this.label_upload_format.LanguageKey = "photobucket.label_upload_format"; - this.label_upload_format.Location = new System.Drawing.Point(12, 50); + this.label_upload_format.LanguageKey = "dropbox.label_upload_format"; + this.label_upload_format.Location = new System.Drawing.Point(11, 12); this.label_upload_format.Name = "label_upload_format"; this.label_upload_format.Size = new System.Drawing.Size(84, 20); this.label_upload_format.TabIndex = 9; + this.label_upload_format.Text = "Image format"; // - // checkbox_usepagelink + // label_AfterUpload // - this.checkbox_usepagelink.AutoSize = true; - this.checkbox_usepagelink.LanguageKey = "photobucket.use_page_link"; - this.checkbox_usepagelink.Location = new System.Drawing.Point(15, 97); - this.checkbox_usepagelink.Name = "checkbox_usepagelink"; - this.checkbox_usepagelink.PropertyName = "UsePageLink"; - this.checkbox_usepagelink.SectionName = "Photobucket"; - this.checkbox_usepagelink.Size = new System.Drawing.Size(297, 17); - this.checkbox_usepagelink.TabIndex = 13; - this.checkbox_usepagelink.UseVisualStyleBackColor = true; + this.label_AfterUpload.LanguageKey = "dropbox.label_AfterUpload"; + this.label_AfterUpload.Location = new System.Drawing.Point(10, 37); + this.label_AfterUpload.Name = "label_AfterUpload"; + this.label_AfterUpload.Size = new System.Drawing.Size(84, 21); + this.label_AfterUpload.TabIndex = 22; + this.label_AfterUpload.Text = "After upload"; + // + // checkboxAfterUploadLinkToClipBoard + // + this.checkboxAfterUploadLinkToClipBoard.AutoSize = true; + this.checkboxAfterUploadLinkToClipBoard.LanguageKey = "dropbox.label_AfterUploadLinkToClipBoard"; + this.checkboxAfterUploadLinkToClipBoard.Location = new System.Drawing.Point(116, 37); + this.checkboxAfterUploadLinkToClipBoard.Name = "checkboxAfterUploadLinkToClipBoard"; + this.checkboxAfterUploadLinkToClipBoard.PropertyName = "AfterUploadLinkToClipBoard"; + this.checkboxAfterUploadLinkToClipBoard.SectionName = "Dropbox"; + this.checkboxAfterUploadLinkToClipBoard.Size = new System.Drawing.Size(104, 17); + this.checkboxAfterUploadLinkToClipBoard.TabIndex = 24; + this.checkboxAfterUploadLinkToClipBoard.Text = "Link to clipboard"; + this.checkboxAfterUploadLinkToClipBoard.UseVisualStyleBackColor = true; // // SettingsForm // this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; - this.ClientSize = new System.Drawing.Size(387, 168); - this.Controls.Add(this.checkbox_usepagelink); + this.ClientSize = new System.Drawing.Size(432, 96); + this.Controls.Add(this.checkboxAfterUploadLinkToClipBoard); + this.Controls.Add(this.label_AfterUpload); this.Controls.Add(this.label_upload_format); this.Controls.Add(this.combobox_uploadimageformat); - this.Controls.Add(this.label_url); - this.Controls.Add(this.textBoxUrl); this.Controls.Add(this.buttonCancel); this.Controls.Add(this.buttonOK); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.LanguageKey = "photobucket.settings_title"; + this.LanguageKey = "dropbox.settings_title"; this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "SettingsForm"; + this.Text = "Dropbox settings"; this.ResumeLayout(false); this.PerformLayout(); } private GreenshotPlugin.Controls.GreenshotComboBox combobox_uploadimageformat; private GreenshotPlugin.Controls.GreenshotLabel label_upload_format; - private GreenshotPlugin.Controls.GreenshotTextBox textBoxUrl; - private GreenshotPlugin.Controls.GreenshotLabel label_url; private GreenshotPlugin.Controls.GreenshotButton buttonCancel; private GreenshotPlugin.Controls.GreenshotButton buttonOK; - private GreenshotPlugin.Controls.GreenshotCheckBox checkbox_usepagelink; + private GreenshotPlugin.Controls.GreenshotLabel label_AfterUpload; + private GreenshotPlugin.Controls.GreenshotCheckBox checkboxAfterUploadLinkToClipBoard; } } diff --git a/GreenshotOfficeCommunicatorPlugin/Forms/SettingsForm.cs b/GreenshotDropboxPlugin/Forms/SettingsForm.cs similarity index 76% rename from GreenshotOfficeCommunicatorPlugin/Forms/SettingsForm.cs rename to GreenshotDropboxPlugin/Forms/SettingsForm.cs index 5cf2826b1..1c02aa711 100644 --- a/GreenshotOfficeCommunicatorPlugin/Forms/SettingsForm.cs +++ b/GreenshotDropboxPlugin/Forms/SettingsForm.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ @@ -20,22 +20,26 @@ */ using System; using System.Windows.Forms; +using GreenshotDropboxPlugin.Forms; using GreenshotPlugin.Core; -using GreenshotPlugin.Controls; +using Greenshot.IniFile; -namespace GreenshotOfficeCommunicatorPlugin { +namespace GreenshotDropboxPlugin { /// /// Description of PasswordRequestForm. /// - public partial class SettingsForm : OfficeCommunicatorForm { - public SettingsForm(OfficeCommunicatorConfiguration config) : base() { + public partial class SettingsForm : DropboxForm { + private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(SettingsForm)); + private static DropboxPluginConfiguration config = IniConfig.GetIniSection(); + + public SettingsForm() { // // The InitializeComponent() call is required for Windows Forms designer support. // InitializeComponent(); this.Icon = GreenshotPlugin.Core.GreenshotResources.getGreenshotIcon(); } - + void ButtonOKClick(object sender, EventArgs e) { this.DialogResult = DialogResult.OK; } diff --git a/GreenshotDropboxPlugin/GreenshotDropboxPlugin.csproj b/GreenshotDropboxPlugin/GreenshotDropboxPlugin.csproj new file mode 100644 index 000000000..395cb230f --- /dev/null +++ b/GreenshotDropboxPlugin/GreenshotDropboxPlugin.csproj @@ -0,0 +1,108 @@ + + + + + {AD7CFFE2-40E7-46CF-A172-D48CF7AE9A12} + Library + GreenshotDropboxPlugin + GreenshotDropboxPlugin + v2.0 + Properties + False + False + 4 + false + Always + 3.5 + + + + + + False + ..\lib\log4net.dll + + + + + + + + + + + + + + Form + + + Form + + + SettingsForm.cs + + + + + DropboxPlugin.cs + + + + + + + + + {5B924697-4DCD-4F98-85F1-105CB84B7341} + GreenshotPlugin + + + + if exist "$(ProjectDir)DropBoxCredentials.orig.cs" ( + rename "$(ProjectDir)DropBoxCredentials.cs" "DropBoxCredentials.private.cs" + rename "$(ProjectDir)DropBoxCredentials.orig.cs" "DropBoxCredentials.cs" +) else exit /b -1 + +mkdir "$(SolutionDir)bin\$(Configuration)\Plugins\$(ProjectName)" +copy "$(ProjectDir)bin\$(Configuration)\$(TargetFileName)" "$(SolutionDir)bin\$(Configuration)\Plugins\$(ProjectName)\*.gsp" +copy "$(ProjectDir)bin\$(Configuration)\$(ProjectName).pdb" "$(SolutionDir)bin\$(Configuration)\Plugins\$(ProjectName)\" +mkdir "$(SolutionDir)bin\$(Configuration)\Languages\Plugins\$(ProjectName)" +copy "$(ProjectDir)Languages\*.xml" "$(SolutionDir)bin\$(Configuration)\Languages\Plugins\$(ProjectName)\" + + "$(SolutionDir)\tools\TortoiseSVN\SubWCRev.exe" "$(ProjectDir)\" "$(ProjectDir)\Properties\AssemblyInfo.cs.template" "$(ProjectDir)\Properties\AssemblyInfo.cs" + +if exist "$(ProjectDir)DropBoxCredentials.private.cs" ( + rename "$(ProjectDir)DropBoxCredentials.cs" "DropBoxCredentials.orig.cs" + rename "$(ProjectDir)DropBoxCredentials.private.cs" "DropBoxCredentials.cs" +) else exit /b -1 + + + False + Off + 4194304 + x86 + 4096 + + + False + Off + 4194304 + AnyCPU + 4096 + + + DEBUG;TRACE + False + True + Full + true + + + TRACE + True + False + None + false + + \ No newline at end of file diff --git a/GreenshotPhotobucketPlugin/LanguageKeys.cs b/GreenshotDropboxPlugin/LanguageKeys.cs similarity index 82% rename from GreenshotPhotobucketPlugin/LanguageKeys.cs rename to GreenshotDropboxPlugin/LanguageKeys.cs index 82debdf6d..38bfa6505 100644 --- a/GreenshotPhotobucketPlugin/LanguageKeys.cs +++ b/GreenshotDropboxPlugin/LanguageKeys.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ @@ -18,25 +18,16 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -using System; - -namespace GreenshotPhotobucketPlugin { +namespace GreenshotDropboxPlugin { public enum LangKey { upload_menu_item, settings_title, - label_url, label_upload_format, - label_clear, - OK, - CANCEL, upload_success, upload_failure, communication_wait, - delete_question, - clear_question, - delete_title, - use_page_link, - history, - configure + Configure, + label_AfterUpload, + label_AfterUploadLinkToClipBoard } } diff --git a/GreenshotDropboxPlugin/Languages/language_dropboxplugin-en-US.xml b/GreenshotDropboxPlugin/Languages/language_dropboxplugin-en-US.xml new file mode 100644 index 000000000..682135288 --- /dev/null +++ b/GreenshotDropboxPlugin/Languages/language_dropboxplugin-en-US.xml @@ -0,0 +1,35 @@ + + + + + Link to clipboard + + + Open history + + + After upload + + + Configure Dropbox + + + Upload to Dropbox + + + Dropbox settings + + + Successfully uploaded image to Dropbox! + + + An error occured while uploading to Dropbox: + + + Image format + + + Communicating with Dropbox. Please wait... + + + \ No newline at end of file diff --git a/GreenshotDropboxPlugin/Languages/language_dropboxplugin-fr-FR.xml b/GreenshotDropboxPlugin/Languages/language_dropboxplugin-fr-FR.xml new file mode 100644 index 000000000..9f50c56d7 --- /dev/null +++ b/GreenshotDropboxPlugin/Languages/language_dropboxplugin-fr-FR.xml @@ -0,0 +1,14 @@ + + + + Communication en cours avec Dropbox. Veuillez patientez... + Configurer Dropbox + Après téléversement + Copier le lien dans le presse-papier + Format image + Paramètres Dropbox + Une erreur s'est produite lors du téléversement vers Dropbox : + Téléverser vers Dropbox + Image téléversée aves succès vers Dropbox ! + + \ No newline at end of file diff --git a/GreenshotDropboxPlugin/Languages/language_dropboxplugin-ru-RU.xml b/GreenshotDropboxPlugin/Languages/language_dropboxplugin-ru-RU.xml new file mode 100644 index 000000000..c63760cae --- /dev/null +++ b/GreenshotDropboxPlugin/Languages/language_dropboxplugin-ru-RU.xml @@ -0,0 +1,35 @@ + + + + +Ссылку в буфер обмена + + +Открыть историию + +После загрузки + + Настройка Dropbox + + + +Добавить в Dropbox + + + +Настройки Dropbox + + + +Изображение успешно загружено на Dropbox! + + + +Произошла ошибка при загрузке на Dropbox: + + + +Формат изображения + Обмен информацией с Dropbox. Подождите... + + \ No newline at end of file diff --git a/GreenshotDropboxPlugin/Languages/language_dropboxplugin-uk-UA.xml b/GreenshotDropboxPlugin/Languages/language_dropboxplugin-uk-UA.xml new file mode 100644 index 000000000..ee63423e9 --- /dev/null +++ b/GreenshotDropboxPlugin/Languages/language_dropboxplugin-uk-UA.xml @@ -0,0 +1,14 @@ + + + + Посилання в буфер обміну + Після вивантаження + Налаштувати Dropbox + Вивантажити на Dropbox + Параметри Dropbox + Зображення вдало вивантажено на Dropbox! + Відбулась помилка при вивантаженні зображення на Dropbox: + Формат зображення + З’єднання з Dropbox. Будь ласка, зачекайте... + + diff --git a/GreenshotDropboxPlugin/Languages/language_dropboxplugin-zh-CN.xml b/GreenshotDropboxPlugin/Languages/language_dropboxplugin-zh-CN.xml new file mode 100644 index 000000000..eacbbdd4c --- /dev/null +++ b/GreenshotDropboxPlugin/Languages/language_dropboxplugin-zh-CN.xml @@ -0,0 +1,14 @@ + + + + 正在连接Dropbox。请稍后... + 配置Dropbox + 上传之后 + 复制链接到剪贴板 + 图片格式 + Dropbox设置 + 在上传到Dropbox时发生错误: + 上传到Dropbox + 图片已成功上传到了Dropbox! + + \ No newline at end of file diff --git a/GreenshotOfficeCommunicatorPlugin/Properties/AssemblyInfo.cs.template b/GreenshotDropboxPlugin/Properties/AssemblyInfo.cs.template similarity index 78% rename from GreenshotOfficeCommunicatorPlugin/Properties/AssemblyInfo.cs.template rename to GreenshotDropboxPlugin/Properties/AssemblyInfo.cs.template index e67db7f4e..f38f7c889 100644 --- a/GreenshotOfficeCommunicatorPlugin/Properties/AssemblyInfo.cs.template +++ b/GreenshotDropboxPlugin/Properties/AssemblyInfo.cs.template @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ @@ -30,16 +30,16 @@ using Greenshot.Plugin; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("Greenshot-OfficeCommunicator-Plugin")] -[assembly: AssemblyDescription("A plugin to upload images to office communicator")] +[assembly: AssemblyTitle("Greenshot-Dropbox-Plugin")] +[assembly: AssemblyDescription("A plugin to upload images to Dropbox")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Greenshot")] -[assembly: AssemblyProduct("OfficeCommunicator Plugin")] -[assembly: AssemblyCopyright("Copyright (C) 2007-2012")] +[assembly: AssemblyCompany("Greenshot & F. Noel")] +[assembly: AssemblyProduct("Dropbox Plugin")] +[assembly: AssemblyCopyright("Copyright (C) 2012")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // The PluginAttribute describes the "entryType" and if the plugin is configurable -[assembly: PluginAttribute("GreenshotOfficeCommunicatorPlugin.OfficeCommunicatorPlugin", true)] +[assembly: PluginAttribute("GreenshotDropboxPlugin.DropboxPlugin", true)] // This sets the default COM visibility of types in the assembly to invisible. // If you need to expose a type to COM, use [ComVisible(true)] on that type. @@ -51,4 +51,4 @@ using Greenshot.Plugin; // // You can specify all the values or you can use the default the Revision and // Build Numbers by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.3.$WCREV$")] +[assembly: AssemblyVersion("1.0.5.$WCREV$")] diff --git a/GreenshotExternalCommandPlugin/Properties/AssemblyInfo.cs.template b/GreenshotExternalCommandPlugin/Properties/AssemblyInfo.cs.template index e07958dcf..6e99cd4b6 100644 --- a/GreenshotExternalCommandPlugin/Properties/AssemblyInfo.cs.template +++ b/GreenshotExternalCommandPlugin/Properties/AssemblyInfo.cs.template @@ -50,4 +50,4 @@ using Greenshot.Plugin; // // You can specify all the values or you can use the default the Revision and // Build Numbers by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.4.$WCREV$")] +[assembly: AssemblyVersion("1.0.5.$WCREV$")] diff --git a/GreenshotPhotobucketPlugin/PhotobucketConfiguration.cs b/GreenshotFlickrPlugin/FlickrConfiguration.cs similarity index 50% rename from GreenshotPhotobucketPlugin/PhotobucketConfiguration.cs rename to GreenshotFlickrPlugin/FlickrConfiguration.cs index 7a327bc30..7424e6778 100644 --- a/GreenshotPhotobucketPlugin/PhotobucketConfiguration.cs +++ b/GreenshotFlickrPlugin/FlickrConfiguration.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ @@ -18,53 +18,56 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -using System; -using System.Collections.Generic; using System.Windows.Forms; - -using GreenshotPlugin.Controls; -using GreenshotPlugin.Core; using Greenshot.IniFile; +using GreenshotPlugin.Core; -namespace GreenshotPhotobucketPlugin { +namespace GreenshotFlickrPlugin { + public enum SafetyLevel { + Safe = 1, + Moderate = 2, + Restricted = 3 + } /// - /// Description of PhotobucketConfiguration. + /// Description of FlickrConfiguration. /// - [IniSection("Photobucket", Description="Greenshot Photobucket Plugin configuration")] - public class PhotobucketConfiguration : IniSection { + [IniSection("Flickr", Description = "Greenshot Flickr Plugin configuration")] + public class FlickrConfiguration : IniSection { + [IniProperty("flickrIsPublic", Description = "IsPublic.", DefaultValue = "true")] + public bool IsPublic; + + [IniProperty("flickrIsFamily", Description = "IsFamily.", DefaultValue = "true")] + public bool IsFamily; + + [IniProperty("flickrIsFriend", Description = "IsFriend.", DefaultValue = "true")] + public bool IsFriend; + + [IniProperty("SafetyLevel", Description = "Safety level", DefaultValue = "Safe")] + public SafetyLevel SafetyLevel; + + [IniProperty("HiddenFromSearch", Description = "Hidden from search", DefaultValue = "false")] + public bool HiddenFromSearch; + [IniProperty("UploadFormat", Description="What file type to use for uploading", DefaultValue="png")] public OutputFormat UploadFormat; + [IniProperty("UploadJpegQuality", Description="JPEG file save quality in %.", DefaultValue="80")] public int UploadJpegQuality; - [IniProperty("UploadReduceColors", Description="Reduce color amount of the uploaded image to 256", DefaultValue="False")] - public bool UploadReduceColors; - [IniProperty("UsePageLink", Description = "Use pagelink instead of direct link on the clipboard", DefaultValue = "False")] - public bool UsePageLink; - [IniProperty("Token", Description = "The Photobucket token", Encrypted=true, ExcludeIfNull=true)] - public string Token; - [IniProperty("TokenSecret", Description = "The Photobucket token secret", Encrypted=true, ExcludeIfNull=true)] - public string TokenSecret; - [IniProperty("SubDomain", Description = "The Photobucket api subdomain", Encrypted = true, ExcludeIfNull = true)] - public string SubDomain; - - public int Credits { - get; - set; - } - /// - /// A form for username/password + [IniProperty("AfterUploadLinkToClipBoard", Description = "After upload send flickr link to clipboard.", DefaultValue = "true")] + public bool AfterUploadLinkToClipBoard; + + [IniProperty("FlickrToken", Description = "The Flickr token", Encrypted = true, ExcludeIfNull = true)] + public string FlickrToken; + [IniProperty("FlickrTokenSecret", Description = "The Flickr token secret", Encrypted = true, ExcludeIfNull = true)] + public string FlickrTokenSecret; + + /// + /// A form for token /// /// bool true if OK was pressed, false if cancel public bool ShowConfigDialog() { - SettingsForm settingsForm = null; - - new PleaseWaitForm().ShowAndWait(PhotobucketPlugin.Attributes.Name, Language.GetString("photobucket", LangKey.communication_wait), - delegate() { - settingsForm = new SettingsForm(this); - } - ); - DialogResult result = settingsForm.ShowDialog(); + DialogResult result = new SettingsForm(this).ShowDialog(); if (result == DialogResult.OK) { return true; } diff --git a/GreenshotFlickrPlugin/FlickrCredentials.cs b/GreenshotFlickrPlugin/FlickrCredentials.cs new file mode 100644 index 000000000..8cbbac87c --- /dev/null +++ b/GreenshotFlickrPlugin/FlickrCredentials.cs @@ -0,0 +1,31 @@ +/* + * Greenshot - a free and open source screenshot tool + * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom + * + * For more information see: http://getgreenshot.org/ + * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 1 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +namespace GreenshotFlickrPlugin { + /// + /// This class is merely a placeholder for the file keeping the API key and secret for dropbox integration. + /// Copy this file to FlickrCredentials.private.cs and fill in valid credentials. (Or empty strings, but of course you won't be able to use the DropBox plugin then.) + /// + public static class FlickrCredentials { + public static string ConsumerKey = empty; + public static string ConsumerSecret = empty; + } +} diff --git a/GreenshotFlickrPlugin/FlickrCredentials.private.cs b/GreenshotFlickrPlugin/FlickrCredentials.private.cs new file mode 100644 index 000000000..6d4b25296 --- /dev/null +++ b/GreenshotFlickrPlugin/FlickrCredentials.private.cs @@ -0,0 +1,8 @@ +using System; + +namespace GreenshotFlickrPlugin { + public static class FlickrCredentials { + public static string ConsumerKey = "f967e5148945cb3c4e149cc5be97796a"; + public static string ConsumerSecret = "4180a21a1d2f8666"; + } +} diff --git a/GreenshotFlickrPlugin/FlickrDestination.cs b/GreenshotFlickrPlugin/FlickrDestination.cs new file mode 100644 index 000000000..609c962cb --- /dev/null +++ b/GreenshotFlickrPlugin/FlickrDestination.cs @@ -0,0 +1,64 @@ +/* + * Greenshot - a free and open source screenshot tool + * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel + * + * For more information see: http://getgreenshot.org/ + * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 1 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +using System.ComponentModel; +using System.Drawing; +using Greenshot.IniFile; +using Greenshot.Plugin; +using GreenshotPlugin.Core; + +namespace GreenshotFlickrPlugin { + public class FlickrDestination : AbstractDestination { + private static log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(FlickrDestination)); + private static FlickrConfiguration config = IniConfig.GetIniSection(); + private FlickrPlugin plugin = null; + public FlickrDestination(FlickrPlugin plugin) { + this.plugin = plugin; + } + + public override string Designation { + get { + return "Flickr"; + } + } + + public override string Description { + get { + return Language.GetString("flickr", LangKey.upload_menu_item); + } + } + + public override Image DisplayIcon { + get { + ComponentResourceManager resources = new ComponentResourceManager(typeof(FlickrPlugin)); + return (Image)resources.GetObject("flickr"); + } + } + + public override ExportInformation ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails) { + ExportInformation exportInformation = new ExportInformation(this.Designation, this.Description); + using (Image image = surface.GetImageForExport()) { + plugin.Upload(captureDetails, image, exportInformation); + } + ProcessExport(exportInformation, surface); + return exportInformation; + } + } +} diff --git a/GreenshotPhotobucketPlugin/PhotobucketPlugin.cs b/GreenshotFlickrPlugin/FlickrPlugin.cs similarity index 50% rename from GreenshotPhotobucketPlugin/PhotobucketPlugin.cs rename to GreenshotFlickrPlugin/FlickrPlugin.cs index 98b106f90..b5090b715 100644 --- a/GreenshotPhotobucketPlugin/PhotobucketPlugin.cs +++ b/GreenshotFlickrPlugin/FlickrPlugin.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ @@ -24,31 +24,31 @@ using System.ComponentModel; using System.Drawing; using System.IO; using System.Windows.Forms; -using System.Threading; - +using Greenshot.IniFile; using Greenshot.Plugin; using GreenshotPlugin.Controls; using GreenshotPlugin.Core; -using Greenshot.IniFile; -namespace GreenshotPhotobucketPlugin { +namespace GreenshotFlickrPlugin +{ /// - /// This is the GreenshotPhotobucketPlugin base code + /// This is the Flickr base code /// - public class PhotobucketPlugin : IGreenshotPlugin { - private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(PhotobucketPlugin)); - private static PhotobucketConfiguration config; + public class FlickrPlugin : IGreenshotPlugin { + private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(FlickrPlugin)); + private static FlickrConfiguration config; public static PluginAttribute Attributes; private IGreenshotHost host; private ComponentResourceManager resources; - public PhotobucketPlugin() { + public FlickrPlugin() { } public IEnumerable Destinations() { - yield return new PhotobucketDestination(this); + yield return new FlickrDestination(this); } + public IEnumerable Processors() { yield break; } @@ -57,31 +57,29 @@ namespace GreenshotPhotobucketPlugin { /// Implementation of the IGreenshotPlugin.Initialize /// /// Use the IGreenshotPluginHost interface to register events - /// Use the ICaptureHost interface to register in the MainContextMenu /// My own attributes - /// true if plugin is initialized, false if not (doesn't show) public virtual bool Initialize(IGreenshotHost pluginHost, PluginAttribute myAttributes) { this.host = (IGreenshotHost)pluginHost; Attributes = myAttributes; - // Get configuration - config = IniConfig.GetIniSection(); - resources = new ComponentResourceManager(typeof(PhotobucketPlugin)); - - ToolStripMenuItem itemPlugInConfig = new ToolStripMenuItem("Photobucket " + Language.GetString("photobucket", LangKey.configure)); + + // Register configuration (don't need the configuration itself) + config = IniConfig.GetIniSection(); + resources = new ComponentResourceManager(typeof(FlickrPlugin)); + + ToolStripMenuItem itemPlugInConfig = new ToolStripMenuItem(); + itemPlugInConfig.Text = Language.GetString("flickr", LangKey.Configure); itemPlugInConfig.Tag = host; - itemPlugInConfig.Click += delegate { - config.ShowConfigDialog(); - }; - itemPlugInConfig.Image = (Image)resources.GetObject("Photobucket"); + itemPlugInConfig.Image = (Image)resources.GetObject("flickr"); + itemPlugInConfig.Click += new System.EventHandler(ConfigMenuClick); PluginUtils.AddToContextMenu(host, itemPlugInConfig); return true; } - + public virtual void Shutdown() { - LOG.Debug("Photobucket Plugin shutdown."); + LOG.Debug("Flickr Plugin shutdown."); } /// @@ -97,50 +95,38 @@ namespace GreenshotPhotobucketPlugin { /// /// public void Closing(object sender, FormClosingEventArgs e) { - LOG.Debug("Application closing, de-registering Photobucket Plugin!"); + LOG.Debug("Application closing, de-registering Flickr Plugin!"); Shutdown(); } - - /// - /// Upload the capture to Photobucket - /// - /// - /// - /// out string for the url - /// true if the upload succeeded - public bool Upload(ICaptureDetails captureDetails, Image image, out string uploadURL) { - OutputSettings outputSettings = new OutputSettings(config.UploadFormat, config.UploadJpegQuality, config.UploadReduceColors); + + public void ConfigMenuClick(object sender, EventArgs eventArgs) { + config.ShowConfigDialog(); + } + + public void Upload(ICaptureDetails captureDetails, Image image, ExportInformation exportInformation) { + OutputSettings outputSettings = new OutputSettings(config.UploadFormat, config.UploadJpegQuality, false); try { - string filename = Path.GetFileName(FilenameHelper.GetFilename(config.UploadFormat, captureDetails)); - PhotobucketInfo photobucketInfo = null; - - // Run upload in the background - new PleaseWaitForm().ShowAndWait(Attributes.Name, Language.GetString("photobucket", LangKey.communication_wait), + string flickrUrl = null; + new PleaseWaitForm().ShowAndWait(Attributes.Name, Language.GetString("flickr", LangKey.communication_wait), delegate() { - photobucketInfo = PhotobucketUtils.UploadToPhotobucket(image, outputSettings, captureDetails.Title, filename); + string filename = Path.GetFileName(FilenameHelper.GetFilename(config.UploadFormat, captureDetails)); + flickrUrl = FlickrUtils.UploadToFlickr(image, outputSettings, captureDetails.Title, filename); } ); - // This causes an exeption if the upload failed :) - LOG.DebugFormat("Uploaded to Photobucket page: " + photobucketInfo.Page); - uploadURL = null; - try { - if (config.UsePageLink) { - uploadURL = photobucketInfo.Page; - Clipboard.SetText(photobucketInfo.Page); - } else { - uploadURL = photobucketInfo.Original; - Clipboard.SetText(photobucketInfo.Original); - } - } catch (Exception ex) { - LOG.Error("Can't write to clipboard: ", ex); + + if (flickrUrl == null) { + exportInformation.ExportMade = false; + return; + } + exportInformation.ExportMade = true; + exportInformation.Uri = flickrUrl; + + if (config.AfterUploadLinkToClipBoard) { + ClipboardHelper.SetClipboardData(flickrUrl); } - return true; } catch (Exception e) { - LOG.Error(e); - MessageBox.Show(Language.GetString("photobucket", LangKey.upload_failure) + " " + e.Message); + MessageBox.Show(Language.GetString("flickr", LangKey.upload_failure) + " " + e.Message); } - uploadURL = null; - return false; } } } diff --git a/GreenshotFlickrPlugin/FlickrPlugin.resx b/GreenshotFlickrPlugin/FlickrPlugin.resx new file mode 100644 index 000000000..d4a65b3e2 --- /dev/null +++ b/GreenshotFlickrPlugin/FlickrPlugin.resx @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + flickr.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/GreenshotFlickrPlugin/FlickrUtils.cs b/GreenshotFlickrPlugin/FlickrUtils.cs new file mode 100644 index 000000000..0119e7bde --- /dev/null +++ b/GreenshotFlickrPlugin/FlickrUtils.cs @@ -0,0 +1,129 @@ +/* + * Greenshot - a free and open source screenshot tool + * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel + * + * For more information see: http://getgreenshot.org/ + * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 1 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Xml; +using Greenshot.IniFile; +using Greenshot.Plugin; +using GreenshotPlugin.Core; + +namespace GreenshotFlickrPlugin { + /// + /// Description of FlickrUtils. + /// + public class FlickrUtils { + private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(FlickrUtils)); + private static FlickrConfiguration config = IniConfig.GetIniSection(); + + private FlickrUtils() { + } + + + /// + /// Do the actual upload to Flickr + /// For more details on the available parameters, see: http://flickrnet.codeplex.com + /// + /// byte[] with image data + /// url to image + public static string UploadToFlickr(Image image, OutputSettings outputSettings, string title, string filename) { + OAuthSession oAuth = new OAuthSession(FlickrCredentials.ConsumerKey, FlickrCredentials.ConsumerSecret); + oAuth.BrowserSize = new Size(520, 800); + oAuth.CheckVerifier = false; + oAuth.AccessTokenUrl = "http://api.flickr.com/services/oauth/access_token"; + oAuth.AuthorizeUrl = "http://api.flickr.com/services/oauth/authorize"; + oAuth.RequestTokenUrl = "http://api.flickr.com/services/oauth/request_token"; + oAuth.LoginTitle = "Flickr authorization"; + oAuth.Token = config.FlickrToken; + oAuth.TokenSecret = config.FlickrTokenSecret; + if (string.IsNullOrEmpty(oAuth.Token)) { + if (!oAuth.Authorize()) { + return null; + } + if (!string.IsNullOrEmpty(oAuth.Token)) { + config.FlickrToken = oAuth.Token; + } + if (!string.IsNullOrEmpty(oAuth.TokenSecret)) { + config.FlickrTokenSecret = oAuth.TokenSecret; + } + IniConfig.Save(); + } + try { + IDictionary signedParameters = new Dictionary(); + signedParameters.Add("content_type","2"); // Screenshot + signedParameters.Add("tags","Greenshot"); + signedParameters.Add("is_public", config.IsPublic?"1":"0"); + signedParameters.Add("is_friend", config.IsFriend?"1":"0"); + signedParameters.Add("is_family", config.IsFamily?"1":"0"); + signedParameters.Add("safety_level", string.Format("{0}", (int)config.SafetyLevel)); + signedParameters.Add("hidden", config.HiddenFromSearch?"1":"2"); + IDictionary otherParameters = new Dictionary(); + otherParameters.Add("photo", new ImageContainer(image, outputSettings, filename)); + string response = oAuth.MakeOAuthRequest(HTTPMethod.POST, "http://api.flickr.com/services/upload/", signedParameters, otherParameters, null); + string photoId = GetPhotoId(response); + + // Get Photo Info + signedParameters = new Dictionary(); + signedParameters.Add("photo_id", photoId); + string photoInfo = oAuth.MakeOAuthRequest(HTTPMethod.POST, "http://api.flickr.com/services/rest/?method=flickr.photos.getInfo", signedParameters, null, null); + return GetUrl(photoInfo); + } catch (Exception ex) { + LOG.Error("Upload error: ", ex); + throw ex; + } finally { + if (!string.IsNullOrEmpty(oAuth.Token)) { + config.FlickrToken = oAuth.Token; + } + if (!string.IsNullOrEmpty(oAuth.TokenSecret)) { + config.FlickrTokenSecret = oAuth.TokenSecret; + } + } + } + + private static string GetUrl(string response) { + try { + XmlDocument doc = new XmlDocument(); + doc.LoadXml(response); + XmlNodeList nodes = doc.GetElementsByTagName("url"); + if(nodes.Count > 0) { + return nodes.Item(0).InnerText; + } + } catch (Exception ex) { + LOG.Error("Error parsing Flickr Response.", ex); + } + return null; + } + + private static string GetPhotoId(string response) { + try { + XmlDocument doc = new XmlDocument(); + doc.LoadXml(response); + XmlNodeList nodes = doc.GetElementsByTagName("photoid"); + if(nodes.Count > 0) { + return nodes.Item(0).InnerText; + } + } catch (Exception ex) { + LOG.Error("Error parsing Flickr Response.", ex); + } + return null; + } + } +} diff --git a/GreenshotPhotobucketPlugin/Forms/PhotobucketForm.cs b/GreenshotFlickrPlugin/Forms/FlickrForm.cs similarity index 76% rename from GreenshotPhotobucketPlugin/Forms/PhotobucketForm.cs rename to GreenshotFlickrPlugin/Forms/FlickrForm.cs index 5a2d509bc..da4ef5a13 100644 --- a/GreenshotPhotobucketPlugin/Forms/PhotobucketForm.cs +++ b/GreenshotFlickrPlugin/Forms/FlickrForm.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ @@ -19,13 +19,9 @@ * along with this program. If not, see . */ using System; +using GreenshotPlugin.Controls; -namespace GreenshotPhotobucketPlugin { - /// - /// This class is needed for design-time resolving of the language files - /// - public class PhotobucketForm : GreenshotPlugin.Controls.GreenshotForm { - public PhotobucketForm() : base() { - } +namespace GreenshotFlickrPlugin.Forms { + public class FlickrForm : GreenshotForm { } -} +} \ No newline at end of file diff --git a/GreenshotFlickrPlugin/Forms/SettingsForm.Designer.cs b/GreenshotFlickrPlugin/Forms/SettingsForm.Designer.cs new file mode 100644 index 000000000..b5f8d1b2b --- /dev/null +++ b/GreenshotFlickrPlugin/Forms/SettingsForm.Designer.cs @@ -0,0 +1,244 @@ +/* + * Greenshot - a free and open source screenshot tool + * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel + * + * For more information see: http://getgreenshot.org/ + * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 1 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +namespace GreenshotFlickrPlugin { + partial class SettingsForm { + /// + /// Designer variable used to keep track of non-visual components. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Disposes resources used by the form. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing) { + if (components != null) { + components.Dispose(); + } + } + base.Dispose(disposing); + } + + /// + /// This method is required for Windows Forms designer support. + /// Do not change the method contents inside the source code editor. The Forms designer might + /// not be able to load this method if it was changed manually. + /// + private void InitializeComponent() + { + this.buttonOK = new GreenshotPlugin.Controls.GreenshotButton(); + this.buttonCancel = new GreenshotPlugin.Controls.GreenshotButton(); + this.combobox_uploadimageformat = new GreenshotPlugin.Controls.GreenshotComboBox(); + this.label_upload_format = new GreenshotPlugin.Controls.GreenshotLabel(); + this.checkBoxPublic = new GreenshotPlugin.Controls.GreenshotCheckBox(); + this.checkBoxFamily = new GreenshotPlugin.Controls.GreenshotCheckBox(); + this.checkBoxFriend = new GreenshotPlugin.Controls.GreenshotCheckBox(); + this.label_SafetyLevel = new GreenshotPlugin.Controls.GreenshotLabel(); + this.combobox_safetyLevel = new GreenshotPlugin.Controls.GreenshotComboBox(); + this.label_AfterUpload = new GreenshotPlugin.Controls.GreenshotLabel(); + this.checkboxAfterUploadLinkToClipBoard = new GreenshotPlugin.Controls.GreenshotCheckBox(); + this.checkBox_hiddenfromsearch = new GreenshotPlugin.Controls.GreenshotCheckBox(); + this.SuspendLayout(); + // + // buttonOK + // + this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonOK.LanguageKey = "OK"; + this.buttonOK.Location = new System.Drawing.Point(270, 151); + this.buttonOK.Name = "buttonOK"; + this.buttonOK.Size = new System.Drawing.Size(75, 23); + this.buttonOK.TabIndex = 18; + this.buttonOK.Text = "OK"; + this.buttonOK.UseVisualStyleBackColor = true; + this.buttonOK.Click += new System.EventHandler(this.ButtonOKClick); + // + // buttonCancel + // + this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonCancel.LanguageKey = "CANCEL"; + this.buttonCancel.Location = new System.Drawing.Point(351, 151); + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.Size = new System.Drawing.Size(75, 23); + this.buttonCancel.TabIndex = 19; + this.buttonCancel.Text = "Cancel"; + this.buttonCancel.UseVisualStyleBackColor = true; + this.buttonCancel.Click += new System.EventHandler(this.ButtonCancelClick); + // + // combobox_uploadimageformat + // + this.combobox_uploadimageformat.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.combobox_uploadimageformat.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.combobox_uploadimageformat.FormattingEnabled = true; + this.combobox_uploadimageformat.Location = new System.Drawing.Point(174, 6); + this.combobox_uploadimageformat.Name = "combobox_uploadimageformat"; + this.combobox_uploadimageformat.PropertyName = "UploadFormat"; + this.combobox_uploadimageformat.SectionName = "Flickr"; + this.combobox_uploadimageformat.Size = new System.Drawing.Size(251, 21); + this.combobox_uploadimageformat.TabIndex = 4; + // + // label_upload_format + // + this.label_upload_format.LanguageKey = "flickr.label_upload_format"; + this.label_upload_format.Location = new System.Drawing.Point(11, 9); + this.label_upload_format.Name = "label_upload_format"; + this.label_upload_format.Size = new System.Drawing.Size(157, 20); + this.label_upload_format.TabIndex = 3; + this.label_upload_format.Text = "Image format"; + // + // checkBoxPublic + // + this.checkBoxPublic.AutoSize = true; + this.checkBoxPublic.LanguageKey = "flickr.public"; + this.checkBoxPublic.Location = new System.Drawing.Point(174, 88); + this.checkBoxPublic.Name = "checkBoxPublic"; + this.checkBoxPublic.PropertyName = "IsPublic"; + this.checkBoxPublic.SectionName = "Flickr"; + this.checkBoxPublic.Size = new System.Drawing.Size(55, 17); + this.checkBoxPublic.TabIndex = 11; + this.checkBoxPublic.Text = "Public"; + this.checkBoxPublic.UseVisualStyleBackColor = true; + // + // checkBoxFamily + // + this.checkBoxFamily.AutoSize = true; + this.checkBoxFamily.LanguageKey = "flickr.family"; + this.checkBoxFamily.Location = new System.Drawing.Point(265, 88); + this.checkBoxFamily.Name = "checkBoxFamily"; + this.checkBoxFamily.PropertyName = "IsFamily"; + this.checkBoxFamily.SectionName = "Flickr"; + this.checkBoxFamily.Size = new System.Drawing.Size(55, 17); + this.checkBoxFamily.TabIndex = 12; + this.checkBoxFamily.Text = "Family"; + this.checkBoxFamily.UseVisualStyleBackColor = true; + // + // checkBoxFriend + // + this.checkBoxFriend.AutoSize = true; + this.checkBoxFriend.LanguageKey = "flickr.friend"; + this.checkBoxFriend.Location = new System.Drawing.Point(350, 88); + this.checkBoxFriend.Name = "checkBoxFriend"; + this.checkBoxFriend.PropertyName = "IsFriend"; + this.checkBoxFriend.SectionName = "Flickr"; + this.checkBoxFriend.Size = new System.Drawing.Size(52, 17); + this.checkBoxFriend.TabIndex = 13; + this.checkBoxFriend.Text = "Fiend"; + this.checkBoxFriend.UseVisualStyleBackColor = true; + // + // label_SafetyLevel + // + this.label_SafetyLevel.LanguageKey = "flickr.label_SafetyLevel"; + this.label_SafetyLevel.Location = new System.Drawing.Point(11, 36); + this.label_SafetyLevel.Name = "label_SafetyLevel"; + this.label_SafetyLevel.Size = new System.Drawing.Size(157, 21); + this.label_SafetyLevel.TabIndex = 7; + this.label_SafetyLevel.Text = "Safety level"; + // + // combobox_safetyLevel + // + this.combobox_safetyLevel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.combobox_safetyLevel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.combobox_safetyLevel.FormattingEnabled = true; + this.combobox_safetyLevel.Location = new System.Drawing.Point(174, 33); + this.combobox_safetyLevel.Name = "combobox_safetyLevel"; + this.combobox_safetyLevel.PropertyName = "SafetyLevel"; + this.combobox_safetyLevel.SectionName = "Flickr"; + this.combobox_safetyLevel.Size = new System.Drawing.Size(251, 21); + this.combobox_safetyLevel.TabIndex = 8; + // + // label_AfterUpload + // + this.label_AfterUpload.LanguageKey = "flickr.label_AfterUpload"; + this.label_AfterUpload.Location = new System.Drawing.Point(12, 117); + this.label_AfterUpload.Name = "label_AfterUpload"; + this.label_AfterUpload.Size = new System.Drawing.Size(155, 21); + this.label_AfterUpload.TabIndex = 14; + this.label_AfterUpload.Text = "After upload"; + // + // checkboxAfterUploadLinkToClipBoard + // + this.checkboxAfterUploadLinkToClipBoard.AutoSize = true; + this.checkboxAfterUploadLinkToClipBoard.LanguageKey = "flickr.label_AfterUploadLinkToClipBoard"; + this.checkboxAfterUploadLinkToClipBoard.Location = new System.Drawing.Point(173, 116); + this.checkboxAfterUploadLinkToClipBoard.Name = "checkboxAfterUploadLinkToClipBoard"; + this.checkboxAfterUploadLinkToClipBoard.PropertyName = "AfterUploadLinkToClipBoard"; + this.checkboxAfterUploadLinkToClipBoard.SectionName = "Flickr"; + this.checkboxAfterUploadLinkToClipBoard.Size = new System.Drawing.Size(104, 17); + this.checkboxAfterUploadLinkToClipBoard.TabIndex = 16; + this.checkboxAfterUploadLinkToClipBoard.Text = "Link to clipboard"; + this.checkboxAfterUploadLinkToClipBoard.UseVisualStyleBackColor = true; + // + // checkBox_hiddenfromsearch + // + this.checkBox_hiddenfromsearch.AutoSize = true; + this.checkBox_hiddenfromsearch.LanguageKey = "flickr.label_HiddenFromSearch"; + this.checkBox_hiddenfromsearch.Location = new System.Drawing.Point(174, 60); + this.checkBox_hiddenfromsearch.Name = "checkBox_hiddenfromsearch"; + this.checkBox_hiddenfromsearch.PropertyName = "HiddenFromSearch"; + this.checkBox_hiddenfromsearch.SectionName = "Flickr"; + this.checkBox_hiddenfromsearch.Size = new System.Drawing.Size(118, 17); + this.checkBox_hiddenfromsearch.TabIndex = 20; + this.checkBox_hiddenfromsearch.Text = "Hidden from search"; + this.checkBox_hiddenfromsearch.UseVisualStyleBackColor = true; + // + // SettingsForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; + this.ClientSize = new System.Drawing.Size(432, 186); + this.Controls.Add(this.checkBox_hiddenfromsearch); + this.Controls.Add(this.checkboxAfterUploadLinkToClipBoard); + this.Controls.Add(this.label_AfterUpload); + this.Controls.Add(this.label_SafetyLevel); + this.Controls.Add(this.combobox_safetyLevel); + this.Controls.Add(this.checkBoxFriend); + this.Controls.Add(this.checkBoxFamily); + this.Controls.Add(this.checkBoxPublic); + this.Controls.Add(this.label_upload_format); + this.Controls.Add(this.combobox_uploadimageformat); + this.Controls.Add(this.buttonCancel); + this.Controls.Add(this.buttonOK); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.LanguageKey = "flickr.settings_title"; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "SettingsForm"; + this.Text = "Flickr settings"; + this.ResumeLayout(false); + this.PerformLayout(); + } + private GreenshotPlugin.Controls.GreenshotCheckBox checkBox_hiddenfromsearch; + private GreenshotPlugin.Controls.GreenshotComboBox combobox_uploadimageformat; + private GreenshotPlugin.Controls.GreenshotLabel label_upload_format; + private GreenshotPlugin.Controls.GreenshotButton buttonCancel; + private GreenshotPlugin.Controls.GreenshotButton buttonOK; + private GreenshotPlugin.Controls.GreenshotCheckBox checkBoxPublic; + private GreenshotPlugin.Controls.GreenshotCheckBox checkBoxFamily; + private GreenshotPlugin.Controls.GreenshotCheckBox checkBoxFriend; + private GreenshotPlugin.Controls.GreenshotLabel label_SafetyLevel; + private GreenshotPlugin.Controls.GreenshotComboBox combobox_safetyLevel; + private GreenshotPlugin.Controls.GreenshotLabel label_AfterUpload; + private GreenshotPlugin.Controls.GreenshotCheckBox checkboxAfterUploadLinkToClipBoard; + } +} diff --git a/GreenshotImmioPlugin/Forms/SettingsForm.cs b/GreenshotFlickrPlugin/Forms/SettingsForm.cs similarity index 82% rename from GreenshotImmioPlugin/Forms/SettingsForm.cs rename to GreenshotFlickrPlugin/Forms/SettingsForm.cs index b8d3e3236..7da2a02af 100644 --- a/GreenshotImmioPlugin/Forms/SettingsForm.cs +++ b/GreenshotFlickrPlugin/Forms/SettingsForm.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ @@ -19,16 +19,20 @@ * along with this program. If not, see . */ using System; +using System.Drawing; using System.Windows.Forms; -using GreenshotPlugin.Core; -using GreenshotPlugin.Controls; -namespace GreenshotImmioPlugin { +using GreenshotFlickrPlugin.Forms; +using GreenshotPlugin.Core; + +namespace GreenshotFlickrPlugin { /// /// Description of PasswordRequestForm. /// - public partial class SettingsForm : ImmioForm { - public SettingsForm(ImmioConfiguration config) : base() { + public partial class SettingsForm : FlickrForm { + private string flickrFrob = string.Empty; + + public SettingsForm(FlickrConfiguration config) { // // The InitializeComponent() call is required for Windows Forms designer support. // diff --git a/GreenshotImmioPlugin/GreenshotImmioPlugin.csproj b/GreenshotFlickrPlugin/GreenshotFlickrPlugin.csproj similarity index 64% rename from GreenshotImmioPlugin/GreenshotImmioPlugin.csproj rename to GreenshotFlickrPlugin/GreenshotFlickrPlugin.csproj index 4c4a8c046..d94e10010 100644 --- a/GreenshotImmioPlugin/GreenshotImmioPlugin.csproj +++ b/GreenshotFlickrPlugin/GreenshotFlickrPlugin.csproj @@ -2,10 +2,10 @@ - {B7B30064-1034-4C53-AB7C-17A007360C19} + {7EC72A5A-D73A-4B4B-9CA1-2216C7D92D5E} Library - GreenshotImmioPlugin - GreenshotImmioPlugin + GreenshotFlickrPlugin + GreenshotFlickrPlugin v2.0 Properties False @@ -13,16 +13,12 @@ 4 false Always - - - 3.5 - - ..\Greenshot\Lib\log4net.dll + ..\lib\log4net.dll @@ -30,56 +26,56 @@ - + + + + Form + Form SettingsForm.cs - - - - + + + - - Never + + Always + Designer - - - ImmioPlugin.cs + + FlickrPlugin.cs - + + + + {5B924697-4DCD-4F98-85F1-105CB84B7341} GreenshotPlugin - "$(SolutionDir)\tools\TortoiseSVN\SubWCRev.exe" "$(ProjectDir)\" "$(ProjectDir)\Properties\AssemblyInfo.cs.template" "$(ProjectDir)\Properties\AssemblyInfo.cs" - - mkdir "$(SolutionDir)bin\$(Configuration)\Plugins\$(ProjectName)" + if exist "$(ProjectDir)FlickrCredentials.orig.cs" ( + rename "$(ProjectDir)FlickrCredentials.cs" "FlickrCredentials.private.cs" + rename "$(ProjectDir)FlickrCredentials.orig.cs" "FlickrCredentials.cs" +) else exit /b -1 + +mkdir "$(SolutionDir)bin\$(Configuration)\Plugins\$(ProjectName)" copy "$(ProjectDir)bin\$(Configuration)\$(TargetFileName)" "$(SolutionDir)bin\$(Configuration)\Plugins\$(ProjectName)\*.gsp" copy "$(ProjectDir)bin\$(Configuration)\$(ProjectName).pdb" "$(SolutionDir)bin\$(Configuration)\Plugins\$(ProjectName)\" mkdir "$(SolutionDir)bin\$(Configuration)\Languages\Plugins\$(ProjectName)" -copy "$(ProjectDir)\Languages\*.xml" "$(SolutionDir)bin\$(Configuration)\Languages\Plugins\$(ProjectName)\" - - - - True - False - Full - true - TRACE - - - False - Off - 4194304 - AnyCPU - 4096 +copy "$(ProjectDir)Languages\*.xml" "$(SolutionDir)bin\$(Configuration)\Languages\Plugins\$(ProjectName)\" + "$(SolutionDir)\tools\TortoiseSVN\SubWCRev.exe" "$(ProjectDir)\" "$(ProjectDir)\Properties\AssemblyInfo.cs.template" "$(ProjectDir)\Properties\AssemblyInfo.cs" + +if exist "$(ProjectDir)FlickrCredentials.private.cs" ( + rename "$(ProjectDir)FlickrCredentials.cs" "FlickrCredentials.orig.cs" + rename "$(ProjectDir)FlickrCredentials.private.cs" "FlickrCredentials.cs" +) else exit /b -1 False @@ -88,11 +84,25 @@ copy "$(ProjectDir)\Languages\*.xml" "$(SolutionDir)bin\$(Configuration)\Languag x86 4096 + + False + Off + 4194304 + AnyCPU + 4096 + + DEBUG;TRACE False True Full true - DEBUG;TRACE + + + TRACE + True + False + None + false \ No newline at end of file diff --git a/GreenshotOfficeCommunicatorPlugin/LanguageKeys.cs b/GreenshotFlickrPlugin/LanguageKeys.cs similarity index 81% rename from GreenshotOfficeCommunicatorPlugin/LanguageKeys.cs rename to GreenshotFlickrPlugin/LanguageKeys.cs index 8dc67c329..6f3fd2b92 100644 --- a/GreenshotOfficeCommunicatorPlugin/LanguageKeys.cs +++ b/GreenshotFlickrPlugin/LanguageKeys.cs @@ -1,6 +1,6 @@ /* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ @@ -18,25 +18,18 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -using System; - -namespace GreenshotOfficeCommunicatorPlugin { +namespace GreenshotFlickrPlugin { public enum LangKey { upload_menu_item, settings_title, - label_url, label_upload_format, - label_clear, - OK, - CANCEL, upload_success, upload_failure, communication_wait, - delete_question, - clear_question, - delete_title, - use_page_link, - history, - configure + Configure, + label_HiddenFromSearch, + label_SafetyLevel, + label_AfterUpload, + label_AfterUploadLinkToClipBoard } } diff --git a/GreenshotFlickrPlugin/Languages/language_flickrplugin-en-US.xml b/GreenshotFlickrPlugin/Languages/language_flickrplugin-en-US.xml new file mode 100644 index 000000000..448920b39 --- /dev/null +++ b/GreenshotFlickrPlugin/Languages/language_flickrplugin-en-US.xml @@ -0,0 +1,47 @@ + + + + + Hidden form search + + + Safety level + + + Link to clipboard + + + After upload + + + Configure Flickr + + + Upload to Flickr + + + Flickr settings + + + Successfully uploaded image to Flickr! + + + An error occured while uploading to Flickr: + + + Image format + + + Communicating with Flickr. Please wait... + + + Public + + + Family + + + Fiend + + + \ No newline at end of file diff --git a/GreenshotFlickrPlugin/Languages/language_flickrplugin-fr-FR.xml b/GreenshotFlickrPlugin/Languages/language_flickrplugin-fr-FR.xml new file mode 100644 index 000000000..c464fc191 --- /dev/null +++ b/GreenshotFlickrPlugin/Languages/language_flickrplugin-fr-FR.xml @@ -0,0 +1,19 @@ + + + + Communication en cours avec Flickr. Veuillez patientez... + Configurer Flickr + Famille + Ami + Après téléversement + Copier le lien dans le presse-papier + Caché dans les recherches + Niveau de sécurité + Format image + Publique + Paramètres Flickr + Une erreur s'est produite lors du téléversement vers Flickr : + Téléverser vers Flickr + Image téléversée aves succès vers Flickr ! + + \ No newline at end of file diff --git a/GreenshotFlickrPlugin/Languages/language_flickrplugin-it-IT.xml b/GreenshotFlickrPlugin/Languages/language_flickrplugin-it-IT.xml new file mode 100644 index 000000000..88347e287 --- /dev/null +++ b/GreenshotFlickrPlugin/Languages/language_flickrplugin-it-IT.xml @@ -0,0 +1,47 @@ + + + + + Visibilità + + + Liv. sicurezza + + + Collegamento agli appunti + + + Dopo il carico + + + Configurazione Flickr + + + Carica su Flickr + + + Impostazioni di Flickr + + + Immagine caricata correttamente su Flickr! + + + Si è verificato un errore durante il caricamento su Flickr: + + + Formato immagine + + + Comunicazione con Flickr. Attendere prego... + + + Pubblica + + + Famiglia + + + Amici + + + \ No newline at end of file diff --git a/GreenshotFlickrPlugin/Languages/language_flickrplugin-ru-RU.xml b/GreenshotFlickrPlugin/Languages/language_flickrplugin-ru-RU.xml new file mode 100644 index 000000000..11a82f1b4 --- /dev/null +++ b/GreenshotFlickrPlugin/Languages/language_flickrplugin-ru-RU.xml @@ -0,0 +1,40 @@ + + + + + Поиск скрытых форм + + Уровень безопасности + + Ссылка в буфер обмена + + После загрузки + + Настройка Flickr + + + Загрузить на Flickr + + + Параметры Flickr + + + Изображение успешно загружено на Flickr! + + + Произошла ошибка при загрузке на Flickr: + + + Формат изображения + + Общение с Flickr. Подождите... + + + Общество + + Семья + + Друг + + + \ No newline at end of file diff --git a/GreenshotFlickrPlugin/Languages/language_flickrplugin-uk-UA.xml b/GreenshotFlickrPlugin/Languages/language_flickrplugin-uk-UA.xml new file mode 100644 index 000000000..01a72f6b6 --- /dev/null +++ b/GreenshotFlickrPlugin/Languages/language_flickrplugin-uk-UA.xml @@ -0,0 +1,19 @@ + + + + Приховати з пошуку + Рівень безпеки + Посилання в буфер обміну + Після вивантаження + Налаштувати Flickr + Вивантажити на Flickr + Параметри Flickr + Зображення вдало вивантажено на Flickr! + Відбулась помилка при вивантаженні зображення на Flickr: + Формат зображення + З’єднання з Flickr. Будь ласка, зачекайте... + Загальне + Родина + Друзі + + diff --git a/GreenshotFlickrPlugin/Languages/language_flickrplugin-zh-CN.xml b/GreenshotFlickrPlugin/Languages/language_flickrplugin-zh-CN.xml new file mode 100644 index 000000000..6c3e41a0c --- /dev/null +++ b/GreenshotFlickrPlugin/Languages/language_flickrplugin-zh-CN.xml @@ -0,0 +1,19 @@ + + + + 正在连接到Flickr。请稍后... + 配置Flickr + 家庭 + 朋友 + 上传之后 + 复制链接到剪贴板 + 从搜索结果中隐藏 + 安全级别 + 图片格式 + 公开 + Flickr设置 + 上除到Flickr时发生错误! + 上传到Flickr + 图片已成功上传到了Flickr! + + \ No newline at end of file diff --git a/GreenshotNetworkImportPlugin/Properties/AssemblyInfo.cs.template b/GreenshotFlickrPlugin/Properties/AssemblyInfo.cs.template similarity index 73% rename from GreenshotNetworkImportPlugin/Properties/AssemblyInfo.cs.template rename to GreenshotFlickrPlugin/Properties/AssemblyInfo.cs.template index f8dbc4b26..5efcf88fb 100644 --- a/GreenshotNetworkImportPlugin/Properties/AssemblyInfo.cs.template +++ b/GreenshotFlickrPlugin/Properties/AssemblyInfo.cs.template @@ -1,6 +1,6 @@ -/* +/* * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2011 Thomas Braun, Jens Klingen, Robin Krom + * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom, Francis Noel * * For more information see: http://getgreenshot.org/ * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ @@ -30,15 +30,16 @@ using Greenshot.Plugin; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("GreenshotNetworkImportPlugin")] -[assembly: AssemblyDescription("")] +[assembly: AssemblyTitle("Greenshot-Flickr-Plugin")] +[assembly: AssemblyDescription("A plugin to upload images to Flickr")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Greenshot")] -[assembly: AssemblyProduct("Network import Plugin")] -[assembly: AssemblyCopyright("Copyright (C) 2007-2011")] +[assembly: AssemblyCompany("Greenshot & F. Noel")] +[assembly: AssemblyProduct("Flickr Plugin")] +[assembly: AssemblyCopyright("Copyright (C) 2012")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -[assembly: PluginAttribute("GreenshotNetworkImportPlugin.NetworkImportPlugin", false)] +// The PluginAttribute describes the "entryType" and if the plugin is configurable +[assembly: PluginAttribute("GreenshotFlickrPlugin.FlickrPlugin", true)] // This sets the default COM visibility of types in the assembly to invisible. // If you need to expose a type to COM, use [ComVisible(true)] on that type. @@ -50,4 +51,4 @@ using Greenshot.Plugin; // // You can specify all the values or you can use the default the Revision and // Build Numbers by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.$WCREV$")] +[assembly: AssemblyVersion("1.0.5.$WCREV$")] diff --git a/GreenshotFlickrPlugin/flickr.png b/GreenshotFlickrPlugin/flickr.png new file mode 100644 index 000000000..578575f9a Binary files /dev/null and b/GreenshotFlickrPlugin/flickr.png differ diff --git a/GreenshotImgurPlugin/Properties/AssemblyInfo.cs.template b/GreenshotImgurPlugin/Properties/AssemblyInfo.cs.template index b8b7c0ae1..a4aee095e 100644 --- a/GreenshotImgurPlugin/Properties/AssemblyInfo.cs.template +++ b/GreenshotImgurPlugin/Properties/AssemblyInfo.cs.template @@ -51,4 +51,4 @@ using Greenshot.Plugin; // // You can specify all the values or you can use the default the Revision and // Build Numbers by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.4.$WCREV$")] +[assembly: AssemblyVersion("1.0.5.$WCREV$")] diff --git a/GreenshotImmioPlugin/ImmioUtils.cs b/GreenshotImmioPlugin/ImmioUtils.cs deleted file mode 100644 index e3bd659d9..000000000 --- a/GreenshotImmioPlugin/ImmioUtils.cs +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom - * - * For more information see: http://getgreenshot.org/ - * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 1 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -using System.Collections.Generic; -using System.Drawing; -using System.Net; -using Greenshot.IniFile; -using Greenshot.Plugin; -using GreenshotPlugin.Core; - -namespace GreenshotImmioPlugin { - /// - /// Description of ImmioUtils. - /// - public class ImmioUtils { - private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(ImmioUtils)); - private static ImmioConfiguration config = IniConfig.GetIniSection(); - - private ImmioUtils() { - } - - /// - /// Do the actual upload to Immio - /// - /// Image to upload - /// OutputSettings for the image file format - /// Title - /// Filename - /// ImmioInfo with details - public static string UploadToImmio(Image image, OutputSettings outputSettings, string title, string filename) { - - string responseString = null; - HttpWebRequest webRequest = (HttpWebRequest)NetworkHelper.CreateWebRequest("http://imm.io/store/"); - webRequest.Method = "POST"; - webRequest.ServicePoint.Expect100Continue = false; - - IDictionary uploadParameters = new Dictionary(); - uploadParameters.Add("name", filename); - uploadParameters.Add("image", new ImageContainer(image, outputSettings, null)); - NetworkHelper.WriteMultipartFormData(webRequest, uploadParameters); - - responseString = NetworkHelper.GetResponse(webRequest); - - IDictionary parsedResponse = JSONHelper.JsonDecode(responseString); - return (string)parsedResponse["uri"]; - } - } -} diff --git a/GreenshotJiraPlugin/Properties/AssemblyInfo.cs.template b/GreenshotJiraPlugin/Properties/AssemblyInfo.cs.template index dfebd3150..cabc03a13 100644 --- a/GreenshotJiraPlugin/Properties/AssemblyInfo.cs.template +++ b/GreenshotJiraPlugin/Properties/AssemblyInfo.cs.template @@ -51,4 +51,4 @@ using Greenshot.Plugin; // // You can specify all the values or you can use the default the Revision and // Build Numbers by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.4.$WCREV$")] \ No newline at end of file +[assembly: AssemblyVersion("1.0.5.$WCREV$")] \ No newline at end of file diff --git a/GreenshotNetworkImportPlugin/Browser-Plugins/Chrome/background.html b/GreenshotNetworkImportPlugin/Browser-Plugins/Chrome/background.html deleted file mode 100644 index f2ed0af1d..000000000 --- a/GreenshotNetworkImportPlugin/Browser-Plugins/Chrome/background.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/GreenshotNetworkImportPlugin/Browser-Plugins/Chrome/background.js b/GreenshotNetworkImportPlugin/Browser-Plugins/Chrome/background.js deleted file mode 100644 index dd22a4c93..000000000 --- a/GreenshotNetworkImportPlugin/Browser-Plugins/Chrome/background.js +++ /dev/null @@ -1,29 +0,0 @@ -function sendCaptureToGreenshot(dataURL) { - window.console.info('Sending data...'); - $.ajax({ - cache: false, - type: "POST", - contentType: "image/png;base64", - dataType: "text", - processData: false, - data: dataURL, - url: 'http://localhost:11234', - success : function (text) { - window.console.info('Got: ' + text); - }, - error : function () { - alert("Couldn't send capture, please check if Greenshot is running!"); - } - }); -} - -function capture() { - window.console.info('Starting capture'); - try { - chrome.tabs.captureVisibleTab(null, {format:'png'}, captureTaken); - } catch(exception) { - alert( exception.toString()); - } -} - -chrome.browserAction.onClicked.addListener(function(tab) {capture();}); diff --git a/GreenshotNetworkImportPlugin/Browser-Plugins/Chrome/greenshot.png b/GreenshotNetworkImportPlugin/Browser-Plugins/Chrome/greenshot.png deleted file mode 100644 index 2087c5b13..000000000 Binary files a/GreenshotNetworkImportPlugin/Browser-Plugins/Chrome/greenshot.png and /dev/null differ diff --git a/GreenshotNetworkImportPlugin/Browser-Plugins/Chrome/jquery-1.7.1.min.js b/GreenshotNetworkImportPlugin/Browser-Plugins/Chrome/jquery-1.7.1.min.js deleted file mode 100644 index 198b3ff07..000000000 --- a/GreenshotNetworkImportPlugin/Browser-Plugins/Chrome/jquery-1.7.1.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery v1.7.1 jquery.com | jquery.org/license */ -(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"":"")+""),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;g=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
a",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="
"+""+"
",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="
t
",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="
",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")}; -f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&i.push({elem:this,matches:d.slice(e)});for(j=0;j0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
","
"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function() -{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); \ No newline at end of file diff --git a/GreenshotNetworkImportPlugin/Browser-Plugins/Chrome/manifest.json b/GreenshotNetworkImportPlugin/Browser-Plugins/Chrome/manifest.json deleted file mode 100644 index 85e4c53ba..000000000 --- a/GreenshotNetworkImportPlugin/Browser-Plugins/Chrome/manifest.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "Greenshot", - "version": "1.0", - "description": "Adds a Greenshot capture button", - "icons": { "128": "greenshot.png" }, - "permissions": [ - "tabs", - "clipboardRead", - "clipboardWrite", - "http://*/*" - ], - "background_page": "background.html", - "browser_action": { - "default_icon": "greenshot.png", - "default_title": "Greenshot" - } -} \ No newline at end of file diff --git a/GreenshotNetworkImportPlugin/Browser-Plugins/Firefox/greenshot.xpi b/GreenshotNetworkImportPlugin/Browser-Plugins/Firefox/greenshot.xpi deleted file mode 100644 index a21066588..000000000 Binary files a/GreenshotNetworkImportPlugin/Browser-Plugins/Firefox/greenshot.xpi and /dev/null differ diff --git a/GreenshotNetworkImportPlugin/Browser-Plugins/Firefox/greenshot/chrome.manifest b/GreenshotNetworkImportPlugin/Browser-Plugins/Firefox/greenshot/chrome.manifest deleted file mode 100644 index 8f440cefd..000000000 --- a/GreenshotNetworkImportPlugin/Browser-Plugins/Firefox/greenshot/chrome.manifest +++ /dev/null @@ -1,3 +0,0 @@ -content greenshot content/ -skin greenshot greenshotskin skin/ -overlay chrome://browser/content/browser.xul chrome://greenshot/content/overlay.xul \ No newline at end of file diff --git a/GreenshotNetworkImportPlugin/Browser-Plugins/Firefox/greenshot/content/jquery-1.7.1.min.js b/GreenshotNetworkImportPlugin/Browser-Plugins/Firefox/greenshot/content/jquery-1.7.1.min.js deleted file mode 100644 index 198b3ff07..000000000 --- a/GreenshotNetworkImportPlugin/Browser-Plugins/Firefox/greenshot/content/jquery-1.7.1.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery v1.7.1 jquery.com | jquery.org/license */ -(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"":"")+""),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;g=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
a",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="
"+""+"
",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="
t
",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="
",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")}; -f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&i.push({elem:this,matches:d.slice(e)});for(j=0;j0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
","
"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function() -{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); \ No newline at end of file diff --git a/GreenshotNetworkImportPlugin/Browser-Plugins/Firefox/greenshot/content/overlay.js b/GreenshotNetworkImportPlugin/Browser-Plugins/Firefox/greenshot/content/overlay.js deleted file mode 100644 index e67ce99b1..000000000 --- a/GreenshotNetworkImportPlugin/Browser-Plugins/Firefox/greenshot/content/overlay.js +++ /dev/null @@ -1,181 +0,0 @@ -/// Javscript logic for the Greenshot extension -var greenshotPrefObserver = { - register: function() { - // First we'll need the preference services to look for preferences. - var prefService = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService); - // For this._branch we ask that the preferences for extensions.myextension. and children - this._branch = prefService.getBranch("extensions.greenshot."); - // Now we queue the interface called nsIPrefBranch2. This interface is described as: - // "nsIPrefBranch2 allows clients to observe changes to pref values." - this._branch.QueryInterface(Components.interfaces.nsIPrefBranch2); - // Finally add the observer. - this._branch.addObserver("", this, false); - }, - unregister: function() { - if (!this._branch) return; - this._branch.removeObserver("", this); - }, - readDestination: function() { - return "http://" + this._branch.getCharPref("host") + ":" + this._branch.getIntPref("port"); - }, - observe: function(aSubject, aTopic, aData) { - if(aTopic != "nsPref:changed") return; - // aSubject is the nsIPrefBranch we're observing (after appropriate QI) - // aData is the name of the pref that's been changed (relative to aSubject) - switch (aData) { - case "host": - this.readDestination(); - break; - case "port": - this.readDestination(); - break; - } - } -} -greenshotPrefObserver.register(); - -function doMenuClick() { - capture(); -} -function doStatusbarClick() { - capture(); -} - -function sendImage(dataUrl, title) { - var destination = greenshotPrefObserver.readDestination(); - try { - // Send the image via a HTTP Request to our localhost - $.ajax({ - cache: false, - type: "POST", - contentType: "image/png;base64", - dataType: "text", - processData: false, - data: dataUrl, - url: destination + '?title=' + escape(encodeUTF8(title)), - success : function (text) { - document.getElementById("statusbar-display").label = "Greenshot: " + text; - }, - error : function () { - alert("Couldn't send image to '" + destination + "' please check if Greenshot is running!"); - } - }); - } catch (exception) { - alert(exception.message); - } -} -/// -/// Capture the current opened window -/// and send it to Greenshot -/// -function capture() { - // Used variables - var width; - var height; - var xOffset; - var yOffset; - var context; - - try { - // Get document width & height - width = $(window.content.document).width(); - height = $(window.content.document).height(); - - // Create canvas - var canvas = window.content.document.createElement('canvas'); - - // change the canvas size to the document size - canvas.setAttribute('width', width); - canvas.setAttribute('height', height); - - // Get the drawing context - context = canvas.getContext("2d"); - - // Set the scroll location to top-left, so we don't have problems with funny banners that move while scrolling - xOffset = window.content.window.scrollX; - yOffset = window.content.window.scrollY; - window.content.window.scrollTo(0,0); - - } catch (exception) { - } - // continue after timeout, so the page is scrolled correctly and has time to move it's items, e.g. for Jira - setTimeout( function(){ - try { - // Draw the window to the context - context.drawWindow(window.content.window, 0, 0, width, height, 'rgb(255,255,255)'); - window.content.window.scrollTo(xOffset,yOffset); - - // Send the canvas - - sendImage(canvas.toDataURL("image/png"), window.content.document.title); - } catch (exception) { - alert(exception.message); - } - }, 300); -} - -function captureImage(imageToCapture) { - try { - var canvas = window.content.document.createElement('canvas'); - - // change the canvas size to the document size - canvas.setAttribute('width', imageToCapture.width); - canvas.setAttribute('height', imageToCapture.height); - - // Get the drawing context - context = canvas.getContext("2d"); - context.drawImage(imageToCapture, 0, 0); - - // Get filename from url - var title - if (imageToCapture.alt) { - title =imageToCapture.alt; - } else { - title = imageToCapture.src.replace(/\?.*/,'').replace(/^.*(\\|\/|\:)/, '').replace(/\.[^.]*/,''); - } - // Send the canvas - sendImage(canvas.toDataURL("image/png"), title); - } catch (exception) { - alert(exception.message); - } -} - -// private method for UTF-8 encoding -function encodeUTF8(string) { - string = string.replace(/\r\n/g,"\n"); - var utftext = ""; - for (var n = 0; n < string.length; n++) { - var c = string.charCodeAt(n); - if (c < 128) { - utftext += String.fromCharCode(c); - } else if((c > 127) && (c < 2048)) { - utftext += String.fromCharCode((c >> 6) | 192); - utftext += String.fromCharCode((c & 63) | 128); - } else { - utftext += String.fromCharCode((c >> 12) | 224); - utftext += String.fromCharCode(((c >> 6) & 63) | 128); - utftext += String.fromCharCode((c & 63) | 128); - } - } - return utftext; -} - -function ShowHideGreenshotMenuItem(event) { - try { - gContextMenu.showItem("greenshot-menu-item", gContextMenu.onImage); - } catch (exception) { - alert(exception.message); - } -} - -function InitializeGreenshotExtension() { - try { - var contextMenu = document.getElementById("contentAreaContextMenu"); - if (contextMenu) { - contextMenu.addEventListener("popupshowing", ShowHideGreenshotMenuItem, false); - } - } catch (exception) { - alert(exception.message); - } -} -window.addEventListener("load", InitializeGreenshotExtension, false); diff --git a/GreenshotNetworkImportPlugin/Browser-Plugins/Firefox/greenshot/content/overlay.xul b/GreenshotNetworkImportPlugin/Browser-Plugins/Firefox/greenshot/content/overlay.xul deleted file mode 100644 index f81c1787b..000000000 --- a/GreenshotNetworkImportPlugin/Browser-Plugins/Firefox/greenshot/content/overlay.xul +++ /dev/null @@ -1,14 +0,0 @@ - - -