Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
Add Icons and Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
qianlifeng committed Aug 17, 2014
1 parent 47f3672 commit f5617e7
Show file tree
Hide file tree
Showing 171 changed files with 507 additions and 25 deletions.
26 changes: 2 additions & 24 deletions DocSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,33 +38,11 @@ public void Load(string pluginDirectory)
Name = docName,
DBPath = dbPath,
DBType = CheckTableExists("searchIndex", dbPath) ? DocType.DASH : DocType.ZDASH,
IconPath = GetDocIcon(docName, docPath)
IconPath = pluginDirectory + "\\Images\\icons\\" + docName.Replace(" ", "_") + ".png"
});
}
}

private string GetDocIcon(string name, string path)
{
string url = "https://raw.github.com/jkozera/zeal/master/zeal/icons/" + name.Replace(".docset", "").Replace(" ", "_") + ".png";
string imagePath = Path.Combine(path, "icon.png");
if (!File.Exists(imagePath))
{
HttpWebRequest lxRequest = (HttpWebRequest)WebRequest.Create(url);
using (HttpWebResponse lxResponse = (HttpWebResponse)lxRequest.GetResponse())
{
using (BinaryReader reader = new BinaryReader(lxResponse.GetResponseStream()))
{
Byte[] lnByte = reader.ReadBytes(1 * 1024 * 1024 * 10);
using (FileStream lxFS = new FileStream(imagePath, FileMode.Create))
{
lxFS.Write(lnByte, 0, lnByte.Length);
}
}
}
}
return imagePath;
}

private bool CheckTableExists(string table, string path)
{
string dbPath = "Data Source =" + path;
Expand Down Expand Up @@ -110,7 +88,7 @@ private List<Result> QuerySqllite(Doc doc, string key)
Action = (c) =>
{
string url = string.Format(@"{0}\{1}\Contents\Resources\Documents\{2}#{3}", docsetPath,
doc.Name, docPath, name);
doc.Name+".docset", docPath, name);
string browser = GetDefaultBrowserPath();
Process.Start(browser, String.Format("\"file:///{0}\"", url));
return true;
Expand Down
Binary file added Images/icons/AWS_JavaScript.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/icons/ActionScript.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/icons/Akka.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/icons/Android.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/icons/Angular.dart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/icons/AngularJS.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/icons/Ansible.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/icons/Apache_HTTP_Server.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/icons/Appcelerator_Titanium.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/icons/AppleScript.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/icons/Arduino.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/icons/BackboneJS.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/icons/Bash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/icons/Boost.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/icons/Bootstrap_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/icons/Bootstrap_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/icons/C++.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/icons/C.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/icons/CMake.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/icons/CSS.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/icons/CakePHP.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/icons/Cappuccino.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/icons/Chai.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/icons/Chef.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/icons/Clojure.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/icons/Cocos2D-X.png
Binary file added Images/icons/Cocos2D.png
Binary file added Images/icons/Cocos3D.png
Binary file added Images/icons/CodeIgniter.png
Binary file added Images/icons/CoffeeScript.png
Binary file added Images/icons/ColdFusion.png
Binary file added Images/icons/Common_Lisp.png
Binary file added Images/icons/Compass.png
Binary file added Images/icons/Cordova.png
Binary file added Images/icons/Corona.png
Binary file added Images/icons/D3JS.png
Binary file added Images/icons/Dart.png
Binary file added Images/icons/Django.png
Binary file added Images/icons/Dojo.png
Binary file added Images/icons/Drupal.png
Binary file added Images/icons/Drupal_7.png
Binary file added Images/icons/Drupal_8.png
Binary file added Images/icons/ElasticSearch.png
Binary file added Images/icons/Elixir.png
Binary file added Images/icons/Emacs_Lisp.png
Binary file added Images/icons/EmberJS.png
Binary file added Images/icons/Emmet.png
Binary file added Images/icons/Erlang.png
Binary file added Images/icons/Express.png
Binary file added Images/icons/ExpressionEngine.png
Binary file added Images/icons/ExtJS.png
Binary file added Images/icons/Flask.png
Binary file added Images/icons/Font_Awesome.png
Binary file added Images/icons/Foundation.png
Binary file added Images/icons/GLib.png
Binary file added Images/icons/Go.png
Binary file added Images/icons/Grails.png
Binary file added Images/icons/Groovy.png
Binary file added Images/icons/Groovy_JDK.png
Binary file added Images/icons/Grunt.png
Binary file added Images/icons/HTML.png
Binary file added Images/icons/Haml.png
Binary file added Images/icons/Haskell.png
Binary file added Images/icons/Jade.png
Binary file added Images/icons/Jasmine.png
Binary file added Images/icons/JavaFX.png
Binary file added Images/icons/JavaScript.png
Binary file added Images/icons/Java_EE6.png
Binary file added Images/icons/Java_EE7.png
Binary file added Images/icons/Java_SE6.png
Binary file added Images/icons/Java_SE7.png
Binary file added Images/icons/Java_SE8.png
Binary file added Images/icons/Joomla.png
Binary file added Images/icons/KnockoutJS.png
Binary file added Images/icons/Kobold2D.png
Binary file added Images/icons/LaTeX.png
Binary file added Images/icons/Laravel.png
Binary file added Images/icons/Less.png
Binary file added Images/icons/Lo-Dash.png
Binary file added Images/icons/Lua_5.1.png
Binary file added Images/icons/Lua_5.2.png
Binary file added Images/icons/MATLAB.png
Binary file added Images/icons/MarionetteJS.png
Binary file added Images/icons/Markdown.png
Binary file added Images/icons/Meteor.png
Binary file added Images/icons/MomentJS.png
Binary file added Images/icons/MongoDB.png
Binary file added Images/icons/Mongoose.png
Binary file added Images/icons/Mono.png
Binary file added Images/icons/MooTools.png
Binary file added Images/icons/MySQL.png
Binary file added Images/icons/NET_Framework.png
Binary file added Images/icons/Nginx.png
Binary file added Images/icons/NodeJS.png
Binary file added Images/icons/NumPy.png
Binary file added Images/icons/OCaml.png
Binary file added Images/icons/OpenCV_C++.png
Binary file added Images/icons/OpenCV_C.png
Binary file added Images/icons/OpenCV_Java.png
Binary file added Images/icons/OpenCV_Python.png
Binary file added Images/icons/OpenGL_2.png
Binary file added Images/icons/OpenGL_3.png
Binary file added Images/icons/OpenGL_4.png
Binary file added Images/icons/PHP.png
Binary file added Images/icons/PHPUnit.png
Binary file added Images/icons/Perl.png
Binary file added Images/icons/PhoneGap.png
Binary file added Images/icons/Play_Java.png
Binary file added Images/icons/Play_Scala.png
Binary file added Images/icons/Polymer.dart.png
Binary file added Images/icons/PostgreSQL.png
Binary file added Images/icons/Processing.png
Binary file added Images/icons/PrototypeJS.png
Binary file added Images/icons/Puppet.png
Binary file added Images/icons/Python_2.png
Binary file added Images/icons/Python_3.png
Binary file added Images/icons/Qt_4.png
Binary file added Images/icons/Qt_5.png
Binary file added Images/icons/R.png
Binary file added Images/icons/Redis.png
Binary file added Images/icons/RequireJS.png
Binary file added Images/icons/Ruby.png
Binary file added Images/icons/RubyMotion.png
Binary file added Images/icons/Ruby_2.png
Binary file added Images/icons/Ruby_on_Rails_3.png
Binary file added Images/icons/Ruby_on_Rails_4.png
Binary file added Images/icons/Rust.png
Binary file added Images/icons/SQLAlchemy.png
Binary file added Images/icons/SQLite.png
Binary file added Images/icons/SVG.png
Binary file added Images/icons/SaltStack.png
Binary file added Images/icons/Sass.png
Binary file added Images/icons/Scala.png
Binary file added Images/icons/SciPy.png
Binary file added Images/icons/Sencha_Touch.png
Binary file added Images/icons/Sinon.png
Binary file added Images/icons/Smarty.png
Binary file added Images/icons/Sparrow.png
Binary file added Images/icons/Spring_Framework.png
Binary file added Images/icons/Statamic.png
Binary file added Images/icons/Stylus.png
Binary file added Images/icons/Symfony.png
Binary file added Images/icons/TYPO3.png
Binary file added Images/icons/Tcl.png
Binary file added Images/icons/Tornado.png
Binary file added Images/icons/Twig.png
Binary file added Images/icons/Twisted.png
Binary file added Images/icons/UnderscoreJS.png
Binary file added Images/icons/Unity_3D.png
Binary file added Images/icons/VMware_vSphere.png
Binary file added Images/icons/Vagrant.png
Binary file added Images/icons/Vim.png
Binary file added Images/icons/WordPress.png
Binary file added Images/icons/XSLT.png
Binary file added Images/icons/XUL.png
Binary file added Images/icons/Xojo.png
Binary file added Images/icons/YUI.png
Binary file added Images/icons/Yii.png
Binary file added Images/icons/Zend_Framework.png
Binary file added Images/icons/Zend_Framework_1.png
Binary file added Images/icons/Zend_Framework_2.png
Binary file added Images/icons/ZeptoJS.png
Binary file added Images/icons/bourbon.png
Binary file added Images/icons/jQuery.png
Binary file added Images/icons/jQuery_Mobile.png
Binary file added Images/icons/jQuery_UI.png
Binary file added Images/icons/neat.png
Binary file added Images/icons/sproutcore.png
504 changes: 504 additions & 0 deletions Wox.Plugin.Doc.csproj

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"Name":"Dash.Doc",
"Description":"Offline doc, inspired by dash",
"Author":"qianlifeng",
"Version":"1.0",
"Version":"1.0.1",
"Language":"csharp",
"Website":"https://github.com/qianlifeng/Wox.Plugin.Doc",
"IcoPath":"Images\\doc.png",
Expand Down

0 comments on commit f5617e7

Please sign in to comment.