Skip to content

Commit

Permalink
Merge branch 'dev/125'
Browse files Browse the repository at this point in the history
  • Loading branch information
jinzhu committed Apr 5, 2012
2 parents 2699768 + 0348f95 commit ab148dc
Show file tree
Hide file tree
Showing 11 changed files with 194 additions and 136 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ Gemfile.lock
/src/files/features.html
/src/files/changelog.html
/src/files/thanks.html
/nbproject/
151 changes: 75 additions & 76 deletions Features.mkd

Large diffs are not rendered by default.

90 changes: 33 additions & 57 deletions README.mkd
Original file line number Diff line number Diff line change
@@ -1,77 +1,53 @@
##[Vrome](http://github.com/jinzhu/vrome) - The most cool, featured Vim keybindings extension for Chrome you could found!
##[Vrome](http://github.com/jinzhu/vrome) - Bringing Vim's elegance to Chrome

Vrome is a Vim keybindings extension for chrome, It is used to give you a more efficient browsing. Proudly recommend it to you!
Vrome is a Vim keybindings extension for chrome. Designed to provide a more efficient browsing experience. Vrome comes with its own additions that will surprise you.

It conver features about Navigation, Tab manipulation, Marks, Hint Mode, Scrolling, Zoom, History, Bookmark, Search, Shorten URL, InsertMode, External editor support, build your own keybindings...
Vim + Vimperator users will feel right at home.

[What's new?](https://github.com/jinzhu/vrome/blob/master/ChangeLog.mkd)

##### *NOTE* Chrome does not allow extensions to run on Chrome Webstore, Setting page and New Tab page!
##### *NOTE* Vrome is a open source project. It's Reliable. We won't use your personal information! All permissions required are used for features. You could check the source code here: [http://github.com/jinzhu/vrome](http://github.com/jinzhu/vrome)
##### *NOTE* You need to refresh all tabs to enable all Vrome features after install. Tip: use "\<C-r\>" (Control + R) to refresh one tab, then try Vrome command "R" to refresh all.
##### *NOTE* Vrome would only works in incognito mode and file URLs after you allow it. You could allow it in [chrome://extensions](chrome://extensions) page.
##### *NOTE* Type \<F1\> to show help document.
### Keybindings for:

* URL navigation
* Tab manipulation
* Key Marks + bookmarks
* Page navigation + Scrolling + Zoom + Search
* History
* External editor support
* [**and much much More**](https://github.com/jinzhu/vrome/blob/master/Features.mkd)

### Install
### Important notes:
* Chrome does not allow extensions to run in the Chrome Webstore, Settings/Extensions page or "New Tab" page!
* Vrome is an open-source project. We do not log your personal information! All required permissions are used for features. You can check the source code here: [http://github.com/jinzhu/vrome](http://github.com/jinzhu/vrome)
* After install/upgrade, please refresh all tabs to enable all/new Vrome features. Tip: use "\<C-r\>" (Control + R) to refresh a tab, then try Vrome command "R" to refresh all tabs.
* Please enable Vrome in incognito mode in order to use commands that require incognito. Check [chrome://extensions](chrome://extensions) page.
##### *NOTE* Type \<F1\> to display Help page.

##### RECOMMEND: Install the latest stable Vrome from [Chrome Web Store](https://chrome.google.com/webstore/detail/godjoomfiimiddapohpmfklhgmbfffjj/details). then it would be automatically updated when a new version is available!

You can also install it from source. please refer [Develop Guide](https://github.com/jinzhu/vrome/wiki/Develop-Guide) in our [WIKI](https://github.com/jinzhu/vrome/wiki)
### Installation

* (Recommended) Install the latest stable Vrome from [Chrome Web Store](https://chrome.google.com/webstore/detail/godjoomfiimiddapohpmfklhgmbfffjj/details). Afterwards, extension will be automatically updated when a new version is available!
* (Manual) From source [Manual Install](https://github.com/jinzhu/vrome/wiki/Manual-Install).

### Features
### Improve it
* Vrome uses [GitHub Issue Tracker](https://github.com/jinzhu/vrome/issues) to track bugs/features/ideas
* [Read more before posting](https://github.com/jinzhu/vrome/wiki/Issue-tracker)
* GitHub accounts are free. No GitHub? Send us an email [email protected]
* [Hack it](https://github.com/jinzhu/vrome/wiki/Collaboration-process)

Vrome is a vim keybindings extension for Chrome, inspiration from the Vim text editor and Vimperator for Firefox. So it works almost like Vim and Vimperator.

But there are some additions to make Vrome sweet! hope there are some surprises for you! ;)

Lots of features can't list all them here. But if you want to be more effective with Vrome, you do need to check them out! [The Features List](https://github.com/jinzhu/vrome/blob/master/Features.mkd)

Go ahead and enjoy!


### Custom

After install Vrome. you could customize the keybindings, disable sites, external editor and other settings in Vrome's option page.

* Click the Vrome icon on the right of main Google Chrome toolbar after install
* In popup page, click "Option" to navigate to Vrome's option page
* You can add your config to the textarea named `.Vromerc`.
Vrome even support remotely config, you just need to input the URL to the `Online .Vromerc` field.
It would be useful for those want to share config between multiple computers like me.
(I have uploaded my very own one config to [github](https://raw.github.com/jinzhu/configure/master/.vromerc))
* Checkout the [example configure](http://wiki.github.com/jinzhu/vrome/vromerc-example-file) for available options


### ChangeLog

[https://github.com/jinzhu/vrome/blob/master/ChangeLog.mkd](https://github.com/jinzhu/vrome/blob/master/ChangeLog.mkd)


### Contributing

##### Reporting an Issue
* Vrome uses [GitHub Issue Tracking](https://github.com/jinzhu/vrome/issues) to track issues
* If you’ve found a bug in Vrome, this is the place to start. (A free github account is required to submit issues)
### Share!
* Tell about Vrome to your friends via Twitter, Facebook, Google+, Blog, YouTube... (be sure to let us know)
* Share your custom configuration here [Examples](https://github.com/jinzhu/vrome/wiki/Config-Examples) OR put your .vromerc on GitHub
* Rate Vrome in [Chrome Web Store](https://chrome.google.com/webstore/detail/godjoomfiimiddapohpmfklhgmbfffjj/details)

##### Bugfix or Implement new features
* Checkout bugs or feature requests on [GitHub Issue Tracking](https://github.com/jinzhu/vrome/issues)
* If you found some interesting things want to work on, fork vrome and start hacking! When you're done, send a pull request on Github
* Checkout our [Develop Guide](https://github.com/jinzhu/vrome/wiki/Develop-Guide) for start

##### Contributing to Documentation
* Find errors in README? Fix it according Bugfix way or send an email to let me know ([email protected])
* Correct our [WIKI](https://github.com/jinzhu/vrome/wiki) or Add more useful things
### Find more information in our [WIKI](https://github.com/jinzhu/vrome/wiki)

##### Make more people know and love Vrome
* Tell Vrome to your friends with Twitter, Facebook, Google+...
* Rate Vrome in [Chrome Web Store](https://chrome.google.com/webstore/detail/godjoomfiimiddapohpmfklhgmbfffjj/details)
* Write blog, tutorial or even record videos. Be sure add your links to our [WIKI](https://github.com/jinzhu/vrome/wiki) ;)

#### Thanks!
### Thanks!

## Author ##
**Jinzhu**
* <http://github.com/jinzhu>
* <[email protected]>
* <http://twitter.com/zhangjinzhu>
* <http://twitter.com/zhangjinzhu>
4 changes: 2 additions & 2 deletions src/manifest_pretty.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Vrome",
"description": "The most cool, featured Vim keybindings extension for Chrome you could found!",
"description": "Bringing Vim's elegance to Chrome",
"background_page": "background/background.html",
"version": "0.6.5",
"content_scripts":[{
Expand All @@ -12,7 +12,7 @@
"offline_enabled": true,
"permissions": [
"tabs",
"bookmarks",
"bookmarks",
"history",
"clipboardRead",
"clipboardWrite",
Expand Down
2 changes: 1 addition & 1 deletion src/styles/debug.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<body>
This is <span id="__vrome_search_highlight_current" class="__vrome_search_highlight">Vrome</span> test page.<br/><br/>

Vrome is the most cool, featured Vim keybindings extension for Chrome you could found!<br/><br/>
Bringing Vim's elegance to Chrome<br/><br/>

You could install it from <a href="https://chrome.google.com/webstore/detail/godjoomfiimiddapohpmfklhgmbfffjj/details" vrome_highlight='hint_elem'>chrome offical store</a><br/><br/>

Expand Down
13 changes: 13 additions & 0 deletions system/ruby/bin/vrome
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ class VromeServer < WEBrick::HTTPServlet::AbstractServlet
response.status = status
response['Content-Type'] = content_type
response.body = body
response['Content-Type'] = "text/plain"
response['Access-Control-Allow-Origin'] = '*'
response['Access-Control-Allow-Methods'] = 'POST'
response['Access-Control-Allow-Headers'] = 'Content-Type, Cache-Control'
response['Access-Control-Max-Age'] = 5
end

def open_editor(request)
Expand All @@ -37,6 +42,14 @@ class VromeServer < WEBrick::HTTPServlet::AbstractServlet

return 200, "text/plain", text
end

def get_latest_version(request)
filename = File.dirname(File.expand_path(__FILE__)) + "/../../../utils/version.txt"
version = (File.read(filename)) if File.exists?(filename)
return 200, "text/plain", version
end


end

puts "Starting Vrome server..."
Expand Down
1 change: 1 addition & 0 deletions utils/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/version.txt
7 changes: 7 additions & 0 deletions utils/doc.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version.txt -- generated version number. updated whenever a change is made to the js file by watch_and_do scripts

update_version.rb -- called by watch_and_do to update version.txt

reload_extension.js -- makes calls to server.rb every X seconds and reloads the extension if the version number has been updated i.e files have been changed

refresh_server.sh -- reloads the ruby server when files have been modified
10 changes: 10 additions & 0 deletions utils/refresh_server.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

# script to restart server whenever changes are made
# watch_and_do /home/hassen/workspace/vrome/system/ruby/lib rb /home/hassen/workspace/vrome/refresh_server.sh
pid=`lsof -t -i :20000`
echo $pid
kill -9 $pid

echo "restarting server..."
nohup ./system/ruby/bin/vrome >> /tmp/vrome_server.out 2>> /tmp/vrome_server.err < /dev/null &
36 changes: 36 additions & 0 deletions utils/reload_extension.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// put your extension ID here
var myExtensionID = 'fecemdkpacpnmlbkjfadknbkfhadnnjm';
var latestVersion = -1;
var time = 500; // reload every X ms

function reload_ext()
{
document.getElementById("toggle-" + myExtensionID).click();
}

function reloadExtension()
{
var xhr = new XMLHttpRequest();
var url = 'http://127.0.0.1:20000';
xhr.open("POST", url, true);
xhr.onreadystatechange = function() {
if(xhr.readyState == 4 && xhr.status == 200) {
if(latestVersion != xhr.responseText)
{
chrome.send('reload', [myExtensionID]);
// recent versions of chrome
reload_ext();
setTimeout('reload_ext()', 500);
console.log("RELOADING at " + new Date());
latestVersion = xhr.responseText;
}
}
}

xhr.setRequestHeader("Content-type", "text/plain");
xhr.send(JSON.stringify({
'method':'get_latest_version'
}));
}

window.setInterval('reloadExtension()', time);
15 changes: 15 additions & 0 deletions utils/update_version.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env ruby

filename = File.dirname(File.expand_path(__FILE__)) + "/version.txt"

version = 0
if File.exists? filename
version = eval(File.read(filename))
end
version += 1

tmpfile = File.new filename, "w"
tmpfile.write version
tmpfile.flush

puts version

0 comments on commit ab148dc

Please sign in to comment.