-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
port the chrome extension to Firefox
- Loading branch information
Showing
8 changed files
with
538 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
$jq = jQuery.noConflict(); | ||
|
||
/** | ||
* Create and trigger native DOM event | ||
* @param DOMElement $el | ||
* @param string type event type | ||
* @param boolean bubbles | ||
* @param boolean cancelable | ||
*/ | ||
function triggerDOMEvent(el, type, bubbles, cancelable) { | ||
|
||
if (typeof bubbles == "undefined") { | ||
bubbles = true; | ||
} | ||
if (typeof cancelable == "undefined") { | ||
cancelable = true; | ||
} | ||
|
||
var evt = document.createEvent("HTMLEvents"); | ||
evt.initEvent(type, bubbles, cancelable); | ||
el.dispatchEvent(evt); | ||
} | ||
|
||
;(function($) { | ||
$('.recording_content .menu_content').each(function() { | ||
var $this = $(this); | ||
var $select = $this.find('select'); | ||
var closeDiv = $this.find('div.close'); | ||
|
||
$select.chosen({ width: '260px' }) | ||
.bind('change', function(e) { | ||
e.stopImmediatePropagation(); | ||
|
||
$(this).unbind('change'); | ||
|
||
triggerDOMEvent(this, 'change', false, true); | ||
}); | ||
|
||
$('<a class="refresh" href="#">Refresh</a>') | ||
.on('click', function(e) { | ||
e.preventDefault(); | ||
$select.trigger("chosen:updated"); | ||
}) | ||
.insertAfter(closeDiv) | ||
; | ||
}); | ||
|
||
$('.recording_content .menu_target').click(function() { | ||
$(this).parent().find('.menu_content select').trigger('chosen:updated'); | ||
}); | ||
})(jQuery); |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
div.recording div.file_recording.active_menu { | ||
width: 300px !important; | ||
} | ||
ul.chosen-results li { | ||
color: #000 !important; | ||
font-size: 11px !important; | ||
padding: 5px 6px !important; | ||
} | ||
ul.chosen-results li.highlighted { | ||
color: #fff !important; | ||
} | ||
|
||
div.recording div.menu_content .close { | ||
float: left; | ||
width: 30px; | ||
} | ||
div.recording div.menu_content a.refresh { | ||
margin-left: 10px; | ||
color: #666; | ||
} | ||
div.recording div.menu_content a.refresh:hover { | ||
color: #fff; | ||
background-color: #666; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Import the page-mod API | ||
var pageMod = require("sdk/page-mod"); | ||
|
||
// Import the self API | ||
var self = require("sdk/self"); | ||
|
||
// Create a page mod | ||
// It will run a script whenever a ".org" URL is loaded | ||
// The script replaces the page contents with a message | ||
pageMod.PageMod({ | ||
include: "*.highrisehq.com", | ||
contentScriptFile: [ | ||
self.data.url('jquery-1.11.1.min.js'), | ||
self.data.url('chosen/chosen.jquery.min.js'), | ||
self.data.url("contentscript.js") | ||
], | ||
contentStyleFile: [ | ||
self.data.url('chosen/chosen.css'), | ||
self.data.url('styles.css') | ||
] | ||
}); |