Created
August 25, 2015 07:23
-
-
Save lemoogle/1e6a4101010b3cbd9890 to your computer and use it in GitHub Desktop.
Bookmarklets for IDOL OnDemand
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
javascript:(function(){ | |
/*! | |
* description: Auto Suggestion Bookmarklet v1.0 using IDOL OnDemand's Expand Term v1.0 API & jQuery v1.11.0; | |
* author: Mahesh Kumar RP (mahesh-kumar.r-p@hp.com); Asia Pacific Information Analytics Sales Engineer; | |
* date: 25-April-2014; | |
* comments: Developed for IDOL OnDemand's Ultimate Hacker Challenge; | |
* tested: Works in FireFox v28.0, Google Chrome v34.0 & Internet Explorer v10.0; | |
* usage: select text box in website and click on the AutoSuggest bookmarklet to get suggestion from IOD repository; | |
*/ | |
/* Latest jQuery version */ | |
var jQueryVersion = "1.11.0"; | |
var jQueryMinorVersion = 11; | |
/* IDOL OnDemand details */ | |
var idolODURL = "https://api.idolondemand.com/1/api/sync/"; | |
var apiName = "expandterm"; | |
var apiVersion = "v1"; | |
var apiKey = "yourapikey"; | |
var idolODFullURL = idolODURL + apiName + "/" + apiVersion + "?apikey=" + apiKey; | |
/* inject jQuery */ | |
if (window.jQuery === undefined || parseInt(window.jQuery.fn.jquery.split('.')[1]) < jQueryMinorVersion) { | |
var done = false; | |
var script = document.createElement("script"); | |
script.src = "//ajax.googleapis.com/ajax/libs/jquery/" + jQueryVersion + "/jquery.min.js"; | |
script.onload = script.onreadystatechange = function(){ | |
if (!done && (!this.readyState || this.readyState == "loaded" || this.readyState == "complete")) { | |
done = true; | |
console.log("jQuery "+jQueryVersion+" loaded"); | |
} | |
}; | |
document.getElementsByTagName("head")[0].appendChild(script); | |
} else { | |
console.log("jQuery "+window.jQuery.fn.jquery+" is already loaded"); | |
} | |
/* Check for jQuery UI CSS existence */ | |
var styleSheets = document.styleSheets; | |
var jQueryUICSSExist = false; | |
for (var i = 0, max = styleSheets.length; i < max; i++) { | |
if (styleSheets[i].href == "https://code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css") | |
jQueryUICSSExist=true; | |
} | |
/*Include jQuery UI CSS*/ | |
if(!jQueryUICSSExist) | |
$('head').append("<link href='https://code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css' type='text/css' rel='stylesheet'>"); | |
/* Latest jQuery UI Plug-in version */ | |
var jQueryUIVersion = "1.10.4"; | |
var jQueryUIMinorVersion = 10; | |
/* inject jQuery UI Plug-in */ | |
if (window.jQuery.fn.draggable === undefined || parseInt(window.jQuery.ui.draggable.version.split('.')[1]) < jQueryUIMinorVersion) { | |
var done1 = false; | |
var script1 = document.createElement("script"); | |
script1.src = "//ajax.googleapis.com/ajax/libs/jqueryui/" + jQueryUIVersion + "/jquery-ui.min.js"; | |
script1.onload = script1.onreadystatechange = function(){ | |
if (!done1 && (!this.readyState || this.readyState == "loaded" || this.readyState == "complete")) { | |
done1 = true; | |
console.log("jQuery UI "+jQueryUIVersion+" loaded"); | |
initBookmarklet(); | |
} | |
}; | |
document.getElementsByTagName("head")[0].appendChild(script1); | |
} else { | |
console.log("jQuery UI"+ window.jQuery.ui.draggable.version +" is already loaded"); | |
initBookmarklet(); | |
} | |
function initBookmarklet() { | |
(window.myBookmarklet = function() { | |
$(document.activeElement).autocomplete({ | |
source: function(request, response) { | |
$.getJSON( | |
idolODFullURL, | |
{ text: request.term, expansion: "stem", max_terms: 10}, | |
function (data) { | |
response($.map(data.terms, function (el) { | |
return { | |
label: el.term | |
}; | |
})); | |
} | |
); | |
}, | |
minLength: 2 | |
}); | |
})(); | |
} | |
})(); |
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
javascript:(function(){ | |
/*! | |
* description: Entity Extraction Bookmarklet v1.0 using IDOL OnDemand's Entity Extraction v1.0 API & jQuery v1.11.0; | |
* author: Mahesh Kumar RP (mahesh-kumar.r-p@hp.com); Asia Pacific Information Analytics Sales Engineer; | |
* date: 24-April-2014; | |
* comments: Developed for IDOL OnDemand's Ultimate Hacker Challenge; | |
* tested: Works in FireFox v28.0, Google Chrome v34.0 & Internet Explorer v10.0; | |
* usage: Click the Entity Extraction Bookmarklet with any website page opened and the page is highlighted with entities like People, Place & Companies; | |
*/ | |
/* Latest jQuery version */ | |
var jQueryVersion = "1.11.0"; | |
var jQueryMinorVersion = 11; | |
/* IDOL OnDemand details */ | |
var idolODURL = "https://api.idolondemand.com/1/api/sync/"; | |
var apiName = "extractentities"; | |
var apiVersion = "v1"; | |
var apiKey = "yourapikey"; | |
var idolODFullURL = idolODURL + apiName + "/" + apiVersion + "?apikey=" + apiKey; | |
/* inject jQuery */ | |
if (window.jQuery === undefined || parseInt(window.jQuery.fn.jquery.split('.')[1]) < jQueryMinorVersion) { | |
var done = false; | |
var script = document.createElement("script"); | |
script.src = "//ajax.googleapis.com/ajax/libs/jquery/" + jQueryVersion + "/jquery.min.js"; | |
script.onload = script.onreadystatechange = function(){ | |
if (!done && (!this.readyState || this.readyState == "loaded" || this.readyState == "complete")) { | |
done = true; | |
console.log("jQuery "+jQueryVersion+" loaded"); | |
} | |
}; | |
document.getElementsByTagName("head")[0].appendChild(script); | |
} else { | |
console.log("jQuery "+window.jQuery.fn.jquery+" is already loaded"); | |
} | |
/* inject jQuery Highlight Plug-in */ | |
if (window.jQuery.fn.highlight === undefined) { | |
var done1 = false; | |
var script1 = document.createElement("script"); | |
script1.src = "https://raw.githubusercontent.com/bartaz/sandbox.js/master/jquery.highlight.js"; | |
script1.onload = script1.onreadystatechange = function(){ | |
if (!done1 && (!this.readyState || this.readyState == "loaded" || this.readyState == "complete")) { | |
done1 = true; | |
console.log("jQuery Highlighting loaded"); | |
initBookmarklet(); | |
} | |
}; | |
document.getElementsByTagName("head")[0].appendChild(script1); | |
} else { | |
console.log("jQuery Highlighting is already loaded"); | |
initBookmarklet(); | |
} | |
function initBookmarklet() { | |
(window.myBookmarklet = function() { | |
/*style for People entities*/ | |
setClassStyle("highlight_idol_people","background-color: #FFFF88"); | |
$.ajax({ | |
url: idolODFullURL, | |
data: {url:document.URL, entity_type:'people_eng'}, | |
success: function(data) { | |
if(typeof(data.entities) != "undefined") | |
for(var i=0;i<data.entities.length;i++){ | |
$("body").highlight(data.entities[i].original_text, {className: 'highlight_idol_people' }); | |
} | |
}, | |
dataType: "json" | |
}); | |
/*style for Place entities*/ | |
setClassStyle("highlight_idol_place","background-color: #FFA500"); | |
$.ajax({ | |
url: idolODFullURL, | |
data: {url:document.URL, entity_type:'places_eng'}, | |
success: function(data) { | |
if(typeof(data.entities) != "undefined") | |
for(var i=0;i<data.entities.length;i++){ | |
$("body").highlight(data.entities[i].original_text, {className: 'highlight_idol_place' }); | |
} | |
}, | |
dataType: "json" | |
}); | |
/*style for Companies entities*/ | |
setClassStyle("highlight_idol_companies","background-color: #0096D6"); | |
$.ajax({ | |
url: idolODFullURL, | |
data: {url:document.URL, entity_type:'companies_eng'}, | |
success: function(data) { | |
if(typeof(data.entities) != "undefined") | |
for(var i=0;i<data.entities.length;i++){ | |
$("body").highlight(data.entities[i].original_text, {className: 'highlight_idol_companies' }); | |
} | |
}, | |
dataType: "json" | |
}); | |
})(); | |
} | |
function setClassStyle(class_name, css) { | |
var style_sheet = document.createElement('style'); | |
if (style_sheet) { | |
style_sheet.setAttribute('type', 'text/css'); | |
var cstr = '.' + class_name + ' {' + css + '}'; | |
var rules = document.createTextNode(cstr); | |
if(style_sheet.styleSheet){ | |
style_sheet.styleSheet.cssText = rules.nodeValue; | |
} else { | |
style_sheet.appendChild(rules); | |
} | |
var head = document.getElementsByTagName('head')[0]; | |
if (head) { | |
head.appendChild(style_sheet); | |
} | |
} | |
} | |
})(); |
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
//http://www.yoursingapore.com/about-singapore/singapore-history/people-of-singapore.html | |
javascript:(function(){ | |
/*! | |
* description: Face Detection Bookmarklet v1.0 using IDOL OnDemand's Face Detection v1.0 API & jQuery v1.11.0; | |
* author: Mahesh Kumar RP (mahesh-kumar.r-p@hp.com); Asia Pacific Information Analytics Sales Engineer; | |
* date: 22-April-2014; | |
* comments: Developed for IDOL OnDemand's Ultimate Hacker Challenge; | |
* tested: Works in FireFox v28.0, Google Chrome v34.0 & Internet Explorer v10.0; | |
* usage: mouse-over on a <img> tag and IOD Face Detection API highlights detected face(s); | |
*/ | |
/* Latest jQuery version */ | |
var version = "1.11.0"; | |
var minorVersionLatest = 11; | |
/* IDOL OnDemand details */ | |
var idolODURL = "https://api.idolondemand.com/1/api/sync/"; | |
var apiName = "findfaces"; | |
var apiVersion = "v1"; | |
var apiKey = "yourapikey"; | |
var idolODFullURL = idolODURL + apiName + "/" + apiVersion + "?apikey=" + apiKey; | |
/* inject jQuery */ | |
if (window.jQuery === undefined || parseInt(window.jQuery.fn.jquery.split('.')[1]) < minorVersionLatest) { | |
var done = false; | |
var script = document.createElement("script"); | |
script.src = "http://ajax.googleapis.com/ajax/libs/jquery/" + version + "/jquery.min.js"; | |
script.onload = script.onreadystatechange = function(){ | |
if (!done && (!this.readyState || this.readyState == "loaded" || this.readyState == "complete")) { | |
done = true; | |
console.log("jQuery "+version+" loaded"); | |
initBookmarklet(); | |
} | |
}; | |
document.getElementsByTagName("head")[0].appendChild(script); | |
} else { | |
console.log("jQuery "+window.jQuery.fn.jquery+" is already loaded"); | |
initBookmarklet(); | |
} | |
function initBookmarklet() { | |
(window.myBookmarklet = function() { | |
$('img').hover( | |
function(e){ | |
var element = $(this).parent(); | |
element.css('position','relative'); | |
$.ajax({ | |
url: idolODFullURL, | |
data: {url:$(this).prop("src")}, | |
success: function(data) { | |
if(typeof(data.face) != "undefined") | |
for(var i=0;i<data.face.length;i++){ | |
console.log("width "+data.face[i].width+" height "+data.face[i].height+" top "+data.face[i].top+" left "+data.face[i].left); | |
element.append("<div style='left:"+data.face[i].left+"px;top:"+data.face[i].top+"px;width:"+data.face[i].width+"px;height:"+data.face[i].height+"px; border-color: red; border-style: solid; border-width: 2px; z-index:9; position: absolute;'></div>"); | |
} | |
}, | |
dataType: "json" | |
}); | |
$(this).css('border', '1px solid #0096D6'); | |
e.preventDefault(); | |
e.stopPropagation(); | |
return false; | |
},function(e){ | |
$(this).css('border', 'none'); | |
e.preventDefault(); | |
e.stopPropagation(); | |
return false; | |
} | |
); | |
})(); | |
} | |
})(); |
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
javascript:(function(){ | |
/*! | |
* description: Find Similar Document Bookmarklet v1.0 using IDOL OnDemand's Find Similar Document v1.0 API & jQuery v1.11.0; | |
* author: Mahesh Kumar RP (mahesh-kumar.r-p@hp.com); Asia Pacific Information Analytics Sales Engineer; | |
* date: 23-April-2014; | |
* comments: Developed for IDOL OnDemand's Ultimate Hacker Challenge; | |
* tested: Works in FireFox v28.0, Google Chrome v34.0 & Internet Explorer v10.0; | |
* usage: select text on any website and bookmarklet suggest similar documents from IOD repository; | |
*/ | |
/* Latest jQuery version */ | |
var jQueryVersion = "1.11.0"; | |
var jQueryMinorVersion = 11; | |
/* IDOL OnDemand details */ | |
var idolODURL = "https://api.idolondemand.com/1/api/sync/"; | |
var apiName = "findsimilar"; | |
var apiVersion = "v1"; | |
var apiKey = "yourapikey"; | |
var idolODFullURL = idolODURL + apiName + "/" + apiVersion + "?apikey=" + apiKey; | |
/* inject jQuery */ | |
if (window.jQuery === undefined || parseInt(window.jQuery.fn.jquery.split('.')[1]) < jQueryMinorVersion) { | |
var done = false; | |
var script = document.createElement("script"); | |
script.src = "//ajax.googleapis.com/ajax/libs/jquery/" + jQueryVersion + "/jquery.min.js"; | |
script.onload = script.onreadystatechange = function(){ | |
if (!done && (!this.readyState || this.readyState == "loaded" || this.readyState == "complete")) { | |
done = true; | |
console.log("jQuery "+jQueryVersion+" loaded"); | |
} | |
}; | |
document.getElementsByTagName("head")[0].appendChild(script); | |
} else { | |
console.log("jQuery "+window.jQuery.fn.jquery+" is already loaded"); | |
} | |
/* get the selected text */ | |
var selectedText = window.getSelection?window.getSelection():document.getSelection?document.getSelection():document.selection.createRange().text; | |
if(!selectedText || selectedText==""){ | |
if(document.activeElement.selectionStart){ | |
selectedText = document.activeElement.value.substring(document.activeElement.selectionStart,document.activeElement.selectionEnd) | |
} | |
} | |
if(!selectedText || selectedText=="") | |
selectedText = prompt("Enter%20term:"); | |
console.log("selectedText "+selectedText); | |
/* Store the text in a hidden field */ | |
$("body").append("<input type='hidden' id='hpautonomy_idol_ondemand_highlighted_text_id' value='"+selectedText+"'/>"); | |
/* Latest jQuery UI Plug-in version */ | |
var jQueryUIVersion = "1.10.4"; | |
var jQueryUIMinorVersion = 10; | |
/* inject jQuery UI Plug-in */ | |
if (window.jQuery.fn.draggable === undefined || parseInt(window.jQuery.ui.draggable.version.split('.')[1]) < jQueryUIMinorVersion) { | |
var done1 = false; | |
var script1 = document.createElement("script"); | |
script1.src = "//ajax.googleapis.com/ajax/libs/jqueryui/" + jQueryUIVersion + "/jquery-ui.min.js"; | |
script1.onload = script1.onreadystatechange = function(){ | |
if (!done1 && (!this.readyState || this.readyState == "loaded" || this.readyState == "complete")) { | |
done1 = true; | |
console.log("jQuery UI "+jQueryUIVersion+" loaded"); | |
initBookmarklet(); | |
} | |
}; | |
document.getElementsByTagName("head")[0].appendChild(script1); | |
} else { | |
console.log("jQuery UI"+ window.jQuery.ui.draggable.version +" is already loaded"); | |
initBookmarklet(); | |
} | |
function initBookmarklet() { | |
(window.myBookmarklet = function() { | |
console.log("inside initBookmarklet "+$("#hpautonomy_idol_ondemand_highlighted_text_id").val()); | |
if(document.getElementById("hpautonomy_idol_ondemand_results_div")) | |
document.body.removeChild(document.getElementById("hpautonomy_idol_ondemand_results_div")); | |
/* create a draggable div */ | |
$("body").append("<div id='hpautonomy_idol_ondemand_results_div' style='display:none;position:absolute;width:auto;height:auto;font-family:HP Simplified;font-size:20px !important;background:#0096D6;opacity:0.9;color:#fff !important;border:3px coral solid;textAlign:center;padding:10px;display:visible;z-index:999 !important'/>"); | |
if($("#hpautonomy_idol_ondemand_highlighted_text_id").val() != ""){ | |
$.ajax({ | |
url: idolODFullURL, | |
data: {text: $("#hpautonomy_idol_ondemand_highlighted_text_id").val(), max_results:10}, | |
success: function(data) { | |
var results="<a href='javascript:void(0)' style='color:#fff;' onclick=\"$('#hpautonomy_idol_ondemand_results_div').hide();\">Close</a>"; | |
results += "<h3 style='text-decoration:underline;text-align:center;color:#fff;HP Simplified;font-size:20px;'>HP IDOL OnDemand Conceptually Similar Documents</h3>"; | |
results += "<ul style='padding:5px !important;'>"; | |
if(typeof(data.documents) != "undefined") | |
for(var i=0;i<data.documents.length;i++){ | |
results += "<li style='padding:10px;'><span style='color:#fff;font-family:HP Simplified;font-size:15px;'>"+data.documents[i].weight+"%</span> <a style='color:#fff;font-family:HP Simplified;font-size:15px;' target='_blank' href='"+data.documents[i].reference+"'>"+data.documents[i].title+"</a></li>"; | |
} | |
results+="</ul>"; | |
$("#hpautonomy_idol_ondemand_results_div").html(results); | |
$("#hpautonomy_idol_ondemand_results_div").css("display","block"); | |
$("#hpautonomy_idol_ondemand_results_div").css("top", Math.max(0, (($(window).height() - $("#hpautonomy_idol_ondemand_results_div").outerHeight()) / 2) + $(window).scrollTop()) + "px"); | |
$("#hpautonomy_idol_ondemand_results_div").css("left", Math.max(0, (($(window).width() - $("#hpautonomy_idol_ondemand_results_div").outerWidth()) / 2) + $(window).scrollLeft()) + "px"); | |
$("#hpautonomy_idol_ondemand_results_div").draggable(); | |
}, | |
dataType: "json" | |
}); | |
if(document.getElementById("hpautonomy_idol_ondemand_highlighted_text_id")) | |
document.body.removeChild(document.getElementById("hpautonomy_idol_ondemand_highlighted_text_id")); | |
} | |
})(); | |
} | |
})(); |
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
javascript:(function(){ | |
/*! | |
* description: Twitter Sentiment Analysis Bookmarklet v1.0 using IDOL OnDemand's Sentiment v1.0 API; | |
* author: Mahesh Kumar RP (mahesh-kumar.r-p@hp.com); Asia Pacific Information Analytics Sales Engineer; | |
* date: 25-April-2014; | |
* comments: Developed for IDOL OnDemand's Ultimate Hacker Challenge; | |
* tested: Works in FireFox v39.0; | |
* usage: Login to Twitter and click Twitter Sentiment Analysis bookmarklet to highlight positive & negative tweets; | |
*/ | |
/* IDOL OnDemand details */ | |
var idolODURL = "https://api.idolondemand.com/1/api/sync/"; | |
var apiName = "analyzesentiment"; | |
var apiVersion = "v1"; | |
var apiKey = "yourapikey"; | |
var idolODFullURL = idolODURL + apiName + "/" + apiVersion + "?apikey=" + apiKey; | |
console.log("url "+idolODFullURL); | |
$(".tweet-text").each(function() { | |
var text=$(this).text(); | |
var element = $(this); | |
$.ajax({ | |
url: idolODFullURL, | |
data: {text:text}, | |
success: function(data) { | |
if(typeof(data.aggregate) != "undefined"){ | |
if(data.aggregate.sentiment=='positive') | |
element.css('background','#068806').css('font-weight','bold'); | |
else if(data.aggregate.sentiment=='negative') | |
element.css('background','#FF0039').css('font-weight','bold'); | |
} | |
}, | |
dataType: "json" | |
}) | |
}); | |
})(); |
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
javascript:(function(){ | |
/*! | |
* description: Unzip Bookmarklet v1.0 using IDOL OnDemand's Explode Container v1.0 API & jQuery v1.11.0; | |
* author: Mahesh Kumar RP (mahesh-kumar.r-p@hp.com); Asia Pacific Information Analytics Sales Engineer; | |
* date: 28-April-2014; | |
* comments: Developed for IDOL OnDemand's Ultimate Hacker Challenge; | |
* tested: Works in FireFox v28.0, Google Chrome v34.0 & Internet Explorer v10.0; | |
* usage: Select any website which contains downloadable zip files and click on the Unzip bookmarklet and just mouse-over on the hyperlink | |
to get the contents on the zip file without downloading; | |
*/ | |
/* Latest jQuery version */ | |
var jQueryVersion = "1.11.0"; | |
var jQueryMinorVersion = 11; | |
/* IDOL OnDemand details */ | |
var idolODURL = "https://api.idolondemand.com/1/api/sync/"; | |
var apiName = "explodecontainer"; | |
var apiVersion = "v1"; | |
var apiKey = "yourapikey"; | |
var idolODFullURL = idolODURL + apiName + "/" + apiVersion + "?apikey=" + apiKey; | |
/* inject jQuery */ | |
if (window.jQuery === undefined || parseInt(window.jQuery.fn.jquery.split('.')[1]) < jQueryMinorVersion) { | |
var done = false; | |
var script = document.createElement("script"); | |
script.src = "//ajax.googleapis.com/ajax/libs/jquery/" + jQueryVersion + "/jquery.min.js"; | |
script.onload = script.onreadystatechange = function(){ | |
if (!done && (!this.readyState || this.readyState == "loaded" || this.readyState == "complete")) { | |
done = true; | |
console.log("jQuery "+jQueryVersion+" loaded"); | |
initBookmarklet(); | |
} | |
}; | |
document.getElementsByTagName("head")[0].appendChild(script); | |
} else { | |
console.log("jQuery "+window.jQuery.fn.jquery+" is already loaded"); | |
initBookmarklet(); | |
} | |
if(document.getElementById("hpautonomy_idol_ondemand_results_div")) | |
document.body.removeChild(document.getElementById("hpautonomy_idol_ondemand_results_div")); | |
function initBookmarklet() { | |
(window.myBookmarklet = function() { | |
$('a').hover( | |
function(e){ | |
var ext = $(this).prop("href").split('.').pop(); | |
if(ext=='zip'){ | |
/* create a draggable div */ | |
$("body").append("<div id='hpautonomy_idol_ondemand_results_div' style='display:none;position:absolute;width:auto;height:auto;font-family:HP Simplified;font-size:15px;background:#0096D6;opacity:0.9;color:#fff;border:3px coral solid;textAlign:center;padding:10px;display:visible;z-index:999 !important;top:50px;'/>"); | |
var elementHref = $(this).prop("href"); | |
$.ajax({ | |
url: idolODFullURL, | |
data: { url:elementHref }, | |
success: function(data) { | |
var results = "<a href='javascript:void(0)' style='color:#fff;' onclick=\"$('#hpautonomy_idol_ondemand_results_div').hide();\">Close</a>"; | |
results += "<h3 style='text-decoration:underline;text-align:center;color:#fff;'>HP IDOL OnDemand Explode Container</h3>"; | |
results += "<span>Explode of "+elementHref+" is:</span>"; | |
results += "<ul style='padding:5px !important;'>"; | |
if(typeof(data.files) != "undefined") | |
for(var i=0;i<data.files.length;i++){ | |
results += "<li style='line-height:20px;'>"+data.files[i].name+"</li>"; | |
} | |
results+="</ul>"; | |
$("#hpautonomy_idol_ondemand_results_div").html(results); | |
$("#hpautonomy_idol_ondemand_results_div").css("display","block"); | |
$("#hpautonomy_idol_ondemand_results_div").css("left", Math.max(0, (($(window).width() - $("#hpautonomy_idol_ondemand_results_div").outerWidth()) / 2) + $(window).scrollLeft()) + "px"); | |
}, | |
dataType: "json" | |
}); | |
$(this).css('border','1px solid #0096D6'); | |
} | |
e.preventDefault(); | |
e.stopPropagation(); | |
return false; | |
},function(e){ | |
var ext = $(this).prop("href").split('.').pop(); | |
if(ext=='zip') | |
$(this).css('border', 'none'); | |
e.preventDefault(); | |
e.stopPropagation(); | |
return false; | |
} | |
); | |
})(); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment