Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: b2ae0d7a46
Fetching contributors…

Cannot retrieve contributors at this time

208 lines (145 sloc) 3.936 kb
<style>
body {
overflow: hidden;
margin: 0px;
padding: 0px;
background:#F7F7F7;
font-family:sans-serif;
}
h2{
font-family:sans-serif;
margin-bottom:10px;
font-size:15px;
font-weight:normal;
}
div#wrapper{
padding:20px;
overflow: hidden;
background:#F7F7F7;
}
.feature_set{
display: block;
margin-bottom:10px;
}
.feature_set a:link, .feature_set a:visited{
-webkit-box-shadow:inset 0px 1px 0px 0px #ffffff;
box-shadow:inset 0px 1px 0px 0px #ffffff;
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #ededed), color-stop(1, #dfdfdf) );
background-color:#ededed;
-webkit-border-radius:6px;
border-radius:6px;
border:1px solid #dcdcdc;
display:inline-block;
color:#777777;
font-family:arial;
font-size:15px;
font-weight:bold;
padding:6px 24px;
text-decoration:none;
text-shadow:1px 1px 0px #ffffff;
width:160px;
position: relative;
}
.feature_set a:hover{
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #e4e4e4), color-stop(1, #dfdfdf) );
}
.disabled a span{
background-color: #999;
height:8px;
width:8px;
position: absolute;
top:10px;
right:10px;
border:1px solid #777;
}
.enabled a span{
height:8px;
width:8px;
position: absolute;
top:10px;
right:10px;
background-color: #FF4040;
border: 1px solid #FF4040;
}
.enabled #enable_btn{
display: none;
}
.disabled #disable_btn{
display: none
}
.clear{
clear:both;
}
a#learn_more{
margin-left:20px;
font-size:13px;
}
a#learn_more:link,
a#learn_more:visited{
text-decoration:none;
}
a#learn_more:hover{
text-decoration:underline;
}
a#learn_more:focus{
outline:none;
}
</style>
<script>
function uiClick(event) {
event.preventDefault();
sendAction("invoke", event.target.href);
setTimeout("window.close()", 200);
}
function sendAction(action_id, params){
/*Send an action id to the content script and parse it*/
chrome.tabs.getSelected(null, function(tab) {
chrome.tabs.sendRequest(tab.id, {action: action_id, params:params}, function(response) {
parseResponse(response.response);
});
});
}
function parseResponse(response){
// the response object contains the action that was called and actual return value
//console.log(response.action, response.result);
if(response.action==="read"){
buildUI(response.result);
}
}
function buildUI(features_obj){
var wrapper = document.getElementById("wrapper");
// iterate throught features as sets
for(key in features_obj){
var feature = features_obj[key];
var features_set = document.createElement("div");
features_set.className="feature_set";
features_set.classList.add(String(feature.name).replace(" ","_"));
features_set.classList.add(feature.state);
//features_set.innerHTML = "<h3>"+ feature.name+"</h3>"
// iterate through features within feature set and make appropriate elements.
for(f in feature){
// check to make sure they are not just 'meta' (w/e) keys we only want function defs
if(f !== "name" && f !== "description" && f!=="state"){
var single_feature = feature[f];
var btn = document.createElement('a');
btn.innerText=single_feature.name;
btn.id = single_feature.ui_id;
btn.href = key + "/" + f; // the feature set key followed by the function key.
var btn_indicator = document.createElement('span');
btn.appendChild(btn_indicator);
btn.addEventListener("click", uiClick, false);
features_set.appendChild(btn);
}
}
wrapper.appendChild(features_set);
}
}
// gets invoked every time the pop up is opened
(function(){
sendAction("read");
})()
</script>
<div id = "wrapper">
<h2> Choose a feature:</h2>
</div>
<a id ="learn_more" href ="http://searchacha.angelmedrano.com" target="blank">Learn More</a>
Jump to Line
Something went wrong with that request. Please try again.