webinator-azure.continuous.ie
Open in
urlscan Pro
13.69.136.90
Public Scan
URL:
https://webinator-azure.continuous.ie/texis/webinator/search/dropin.js
Submission: On November 10 via manual from IE — Scanned from DE
Submission: On November 10 via manual from IE — Scanned from DE
Form analysis
0 forms found in the DOMText Content
"use strict"; // Javascript for Thunderstone search dropin var tsSearchHost = "https://webinator-azure.continuous.ie"; var tsSearchPath = "/texis/webinator/search"; var tsProfile = ""; jQuery(function($) { var ignoreHashChange=false; var searchSpinner = new Spinner({ lines: 9, // The number of lines to draw length: 4.5, // The length of each line width: 2, // The line thickness radius: 2, // The radius of the inner circle corners: 1, // Corner roundness (0..1) rotate: 0, // The rotation offset direction: 1, // 1: clockwise, -1: counterclockwise color: '#000', // #rgb or #rrggbb or array of colors speed: 1.5, // Rounds per second trail: 60, // Afterglow percentage shadow: false, // Whether to render a shadow hwaccel: false, // Whether to use hardware acceleration className: 'spinner', // The CSS class to assign to the spinner zIndex: 2e9, // The z-index (defaults to 2000000000) top: '0', // Top position relative to parent in px left: '0' // Left position relative to parent in px }); // if the form action has a query string, we need to remember that // for when we put together our own submissions var formQuerystring = ""; function followSearchLink(event) { event.preventDefault(); var href = $(event.target).attr("href"); // keep everything after the ?, before the # href = href.substring(href.indexOf('?') + 1); if(href.indexOf("#") != -1) { href = href.substring(0, href.indexOf("#")); } doSearch(href, true); } // parses the query string into an associative aray function parseQueryString(queryString) { var obj = { "pr": tsProfile }, i; var pairs = queryString.split("&"); for(i=0;i<pairs.length;i++) { if(pairs[i].indexOf("=")==-1) { continue; } var name = pairs[i].match("^[^=]*")[0]; if(name) { name = decodeURIComponent(name.replace(/\+/g," ")); } var value = pairs[i].match("=(.*)")[1]; if(value) { value = decodeURIComponent(value.replace(/\+/g," ")); } // don't let them override some parameters if(["callback","pr"].indexOf(name) != -1) { continue; } obj[name] = value; } return obj; } /* update any forms on the static HTML page. Some actions on the dropin * output can cause the query to change (clicking on spellSuggestions) * and we want to keep the outside form accurate. */ function updateOutsideForms(queryString) { var args = parseQueryString(queryString); if(!args["query"]) { return; } var forms = $("form.ThunderstoneForm[id!='ThunderstoneSearchForm']"); /* for every text input or select on that page, set it to * whatever was in the query string */ forms.find("input[type='text'],input:not([type]),select").each(function() { var name = $(this).attr("name"); if(args[name]) { $(this).val(args[name]); } }); } function constructQueryString(args) { } function buttonClicked(event) { event.preventDefault(); var button = event.currentTarget; var form = $(button).closest("form"), buttonContent=""; var name = button.getAttribute("name"), value=button.getAttribute("value"); if(name && value) { buttonContent = "&" + encodeURIComponent(name) + "=" + encodeURIComponent(value); } doSearch(form.serialize() + buttonContent, true); } function formSubmitted(event) { event.preventDefault(); doSearch($(event.target).serialize(), true); } function findForm(node) { var form; form = $(node).find(".ThunderstoneForm"); if(form.length !== 0) { return form; } // look for the unique id added with version 9 form = $(node).find("#SearchForm"); if(form.length !== 0) { return form; } // last chance: look for a form with /texis/ in the path form = undefined; $(node).find("form").each(function() { var action = $(this).attr("action"); if(action && action.indexOf("/texis/") >= 0) { form = $(this); } }); return form; } function fixupForm(form) { if(form.length) { form.submit(formSubmitted); form.find("input[type='submit']").click(buttonClicked); form.find("button").click(buttonClicked); var action = form.attr("action"); if(action.indexOf("?") != -1) { formQuerystring = "&" + action.slice(action.indexOf("?") + 1); } // Add hostname to the form action, even though we don't actully // "submit" the form (queryAutocomplete uses 'action') form.attr("action", tsSearchHost + form.attr("action")); } } function showError(msg) { $("#ThunderstoneSearch").html(msg); } function searchError(jqXHR, textStatus, errorThrown) { // the textStatus/errorThrown aren't helpful for JSONP requests // (we're using the plugin because it lets us get called at all!) // so just display the URL, which they can try in the browser var urlEscaped = jqXHR.url.replace(/&/g, '&').replace(/>/g, '>').replace(/</g, '<'); showError("Error fetching search <tt>" + urlEscaped + "</tt>"); } function updateContent(data) { if(data === "") { showError("Error: Empty response from search"); return; } var bodyHtml = data.match(/<body[\S\s]*<\/body>/i); if(bodyHtml !== null) { bodyHtml = bodyHtml[0]; } else { // there was no body tag, assume it was a fragment and show it all bodyHtml = data; } // in IE <= 7 mode, fix image SRCs before parsing the HTML if(document.documentMode && document.documentMode <= 7) { // We normally use DOM inspection below to fix img srcs, where we // detect that links need fixing because they start with / instead // of a full host. // // However, in IE <= 7 accessing src attribues will ALWAYS make // them absolute URLs, even if they weren't in the source. // // This means that when a page on site.com invokes the dropin // on search.site.com, the "/foo.png" images all already look // like "http:/site.com/foo.png", so we can't tell they need // fixed up at that point. bodyHtml = bodyHtml.replace(/ src=(['"])\//gi, " src=\$1" + tsSearchHost + "/"); } var node = $("<div/>").html(bodyHtml); // add our custom link handlers node.find("a[href*='/texis/']").each(function() { var href = this.getAttribute("href"); // don't intercept redir.html, that goes through normally // just slap the appliance hostname on the front // same with viewCached.html if(href && (href.indexOf("search/redir.html") >= 0 || href.indexOf("search/getCached.html") >= 0)) { if(document.documentMode && document.documentMode <= 7) { // If the link text is just the link and we change // the href, IE<=7 VERY HELPFULLY changes the displayed // text too. Add a token on the end that we'll remove after // the href change below to prevent this. $(this).html($(this).html()+"<wbr>"); // in IE<=7, the existing href has http://site.com // slapped on the front. strip it off before adding searchHost href = href.replace(/^[A-Za-z]+:\/\/[^/]+/, ""); } if(href.indexOf("://") === -1) { $(this).attr("href", tsSearchHost + href); } if(document.documentMode && document.documentMode <= 7) { // strip off the token added above $(this).html($(this).html().replace(/<wbr>$/i,"")); } } else { $(this).click(followSearchLink); } }); // fixup any image links // Bug 6501 also fix <iframe>s, other tags with URL SRCs // wtf also fix other non-SRC URL attributes, e.g. <body background> node.find("bgsound,frame,iframe,img,input,script,applet").each(function() { var src = $(this).attr("src"); if(src && src[0] == '/') { src = tsSearchHost + src; $(this).attr("src", src); } }); var form = findForm(node); // Bug 6502: Do not bail if our search form not found; also only // try to fix it up if present: if (form) { fixupForm(form); } var ts = $("#ThunderstoneSearch"); if(ts.length === 0) { showError("Error: Couldn't find ThunderstoneSearch element on dropin page"); } ts.html(""); node.children().each(function() { ts.append(this); }); searchSpinner.stop(); tsInitAutocomplete(); } function doSearch(queryString, setHash) { searchSpinner.spin($("#ThunderstoneSearch")[0]); queryString += formQuerystring; formQuerystring = ""; if(setHash && location.hash != "#" + queryString) { ignoreHashChange=true; location.hash = queryString; } updateOutsideForms(queryString); var args = parseQueryString(queryString); // hide autocomplete if it's showing, also need to cancel in-progress somehow... $(".ui-autocomplete").css("display", "none"); $.jsonp({ error: searchError, success: updateContent, url: tsSearchHost + tsSearchPath + "/dropinEntrypoint.js?" + jQuery.param(args) + "&callback=?" }); } function getDefaultSearchArgs() { var str = ""; if(location.hash) { str = location.hash.slice(1); if(str[0] == '?') { str = str.slice(1); } } else if(location.search) { str = location.search; if(str[0] == '?') { str = str.slice(1); } } // throw in the profile if it isn't there already, either because // there's nothing, or we were submitted to with just a query if(str.indexOf("pr=") == -1) { if(str) { str += "&pr=" + encodeURIComponent(tsProfile); } else { str = "pr=" + encodeURIComponent(tsProfile); } } return str; } $(window).on("hashchange", function() { if(ignoreHashChange) { // the hash changed because WE set it, from a clicked link // or a form submission. Don't do anything else. ignoreHashChange=false; return; } doSearch(getDefaultSearchArgs(), false); }); $("#ThunderstoneSearch").each(function() { $(this).css("min-height", 100); doSearch(getDefaultSearchArgs(), false); }); });