Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions PluginDirectories/1/webref.bundle/examples.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
html ~html(button)
css ~css(margin)
9 changes: 9 additions & 0 deletions PluginDirectories/1/webref.bundle/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "webref",
"displayName": "WebReference",
"description": "Search using WebReference",
"examples": ["css text-align", "html div"],
"categories": ["Developer"],
"creator_name": "anVlad11",
"creator_url": "https://twiitter.com/anvlad11"
}
26 changes: 26 additions & 0 deletions PluginDirectories/1/webref.bundle/plugin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/python

import sys,urllib,os

def results(fields, original_query):
if '~html' in fields:
sub = 'html'
tag = fields['~html']
elif '~css' in fields:
sub = 'css'
tag = fields['~css']
else:
return
{
"title": "Print something"
}
html = open("webref.html").read().replace("<!--SUB-->", sub).replace("<!--TAG-->",tag)
return {
"title": "Search {0} manual for '{1}'".format(sub,tag),
"html":html,
"webview_transparent_background": False,
"run_args":[sub,tag]
}

def run(sub,tag):
os.system('open "http://webref.ru/{0}/{1}"'.format(urllib.quote(sub),urllib.quote(tag)))
Binary file added PluginDirectories/1/webref.bundle/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions PluginDirectories/1/webref.bundle/webref.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'/>
<script>
var sub = "<!--SUB-->";
var tag = "<!--TAG-->";
function load()
{
var url = "https://webref.ru/" + encodeURIComponent(sub) + '/' + encodeURIComponent(tag);
setTimeout(function() {
window.location.href = url;
}, 500);
}
load();
</script>
<style>
div.loading
{
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial;
line-height: 5;
position: relative;
text-align: center;
font-size:50px;
}
</style>
</head>
<body>
<div class="loading">Loading</div>
</body>
</html>