Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!--COMPLETING REPORT-->
- <div id="completing-report" class="completing-report-modal loaders hide">
- <h1 style="margin-bottom: 20px;">Compiling Your Report</h1>
- <div class="row">
- <div class="col-sm-5 text-left-sm">
- <h2 style="margin: 0;">David Alan Raynsford</h2>
- <p><span class="icon-map-marker"></span> Woodland Park, Co | Age: 50</p>
- </div>
- <div class="col-sm-7 time-remaining">
- <p class="text-right-sm">Approximately <span class="time" style="font-weight: bold;" data-seconds="120">2 minutes </span> remaining</p>
- </div>
- </div>
- <div class="progress visible-xs visible-ms" style="margin: 10px 20px 23px; height: 40px; position: relative; background-color: #bebebf;">
- <div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%; background-color: #4f4f4f;">
- </div>
- <p class="text-center percentage" style="position: absolute; width: 100%; color: white; font-weight: bold; padding-top: 10px;">0%</p>
- </div>
- <div class="row text-left">
- <div class="col-sm-5 hidden-xs hidden-ms">
- <p class="category" data-reference=".box-personal-info" data-questions=".questionnaire-questions.personal-info">Personal Info <img class="pull-right" src="https://cdnmatador.global.ssl.fastly.net/assets/flatty/ajax-loaders/11-3b3cafd18281ba3ecf47dce0c8cea753.gif" alt="" style="width: 16px;" /><span class="pull-right icon-check text-contrast icon-2x"></span></p>
- <p class="category" data-reference=".box-address" data-questions=".questionnaire-questions.property-info">Property <img class="pull-right" src="https://cdnmatador.global.ssl.fastly.net/assets/flatty/ajax-loaders/11-3b3cafd18281ba3ecf47dce0c8cea753.gif" alt="" style="width: 16px;" /><span class="pull-right icon-check text-contrast icon-2x"></span></p>
- <p class="category" data-reference=".box-criminal">Criminal <img class="pull-right" src="https://cdnmatador.global.ssl.fastly.net/assets/flatty/ajax-loaders/11-3b3cafd18281ba3ecf47dce0c8cea753.gif" alt="" style="width: 16px;" /><span class="pull-right icon-check text-contrast icon-2x"></span></p>
- <p class="category" data-reference=".box-relatives" data-questions=".questionnaire-questions.family-members">Family Members <img class="pull-right" src="https://cdnmatador.global.ssl.fastly.net/assets/flatty/ajax-loaders/11-3b3cafd18281ba3ecf47dce0c8cea753.gif" alt="" style="width: 16px;" /><span class="pull-right icon-check text-contrast icon-2x"></span></p>
- <p class="category" data-reference=".box-civil">Civil Records <img class="pull-right" src="https://cdnmatador.global.ssl.fastly.net/assets/flatty/ajax-loaders/11-3b3cafd18281ba3ecf47dce0c8cea753.gif" alt="" style="width: 16px;" /><span class="pull-right icon-check text-contrast icon-2x"></span></p>
- <p class="category" data-reference=".box-miscellaneous" data-questions=".questionnaire-questions.miscellaneous">Miscellaneous <img class="pull-right" src="https://cdnmatador.global.ssl.fastly.net/assets/flatty/ajax-loaders/11-3b3cafd18281ba3ecf47dce0c8cea753.gif" alt="" style="width: 16px;" /><span class="pull-right icon-check text-contrast icon-2x"></span></p>
- </div>
- <div class="col-sm-7">
- <div class="box box-bordered box-category box-personal-info">
- <div class="box-header"><span style="display: inline-block; margin-top: 10px;">Personal</span> <img class="pull-right" src="https://cdnmatador.global.ssl.fastly.net/assets/illustrations/report_illustration-c9d3bd4b0872fbd4e8ead8340008174e.svg" onerror="this.src='https://cdnmatador.global.ssl.fastly.net/assets/illustrations/report_illustration_1x-4d264419add938deaf15a8bf159cdd31.png'; this.onerror=null;" alt="" style="height: 50px;" /></div>
- <div class="box-content" style="font-weight: 300;">
- <p>Our reports on Personal Information are very thorough. We scour a multitude of databases to reveal, where available, full names, maiden names, phone details, aliases, address history sorted by "last seen", as well as current address. Phone numbers may contain current owner name and information about people potentially associated with those numbers. We display current address with an interactive map and satellite imagery and provide users with access to detailed property reports that include home values and sales information.</p>
- </div>
- </div>
- <div class="box box-bordered box-category box-address">
- <div class="box-header"><span style="display: inline-block; margin-top: 10px;">Properties</span> <img class="pull-right" src="https://cdnmatador.global.ssl.fastly.net/assets/illustrations/property_illustration-4f83d3e18dc76102e3cd2396f127ec66.svg" onerror="this.src='https://cdnmatador.global.ssl.fastly.net/assets/illustrations/property_illustration_1x-8b393f85c1f689dddc4fb80e71ed28fe.png'; this.onerror=null;" alt="" style="height: 50px;" /></div>
- <div class="box-content" style="font-weight: 300;">
- <p>Property records are associated with individual people in our database. Our reports on individuals will attempt to locate available records on current and historical real estate holdings with detailed property reports that include home values and sales information. Reports can also include satellite maps, parcel numbers, property tax amounts via country assessor data, property values, and building information. Along with buyer and seller information, we also display available sales prices.</p>
- </div>
- </div>
- <div class="box box-bordered box-category box-criminal">
- <div class="box-header"><span style="display: inline-block; margin-top: 10px;">Criminal</span> <img class="pull-right" src="https://cdnmatador.global.ssl.fastly.net/assets/illustrations/cuff_illustration-37b48f03dc1a8f4a0cc270e521f48196.svg" onerror="this.src='https://cdnmatador.global.ssl.fastly.net/assets/illustrations/cuff_illustration_1x-137e5b996e21b0e3f027e9469c7d7b0c.png'; this.onerror=null;" alt="" style="height: 50px;" /></div>
- <div class="box-content" style="font-weight: 300;">
- <p>Criminal History Reports contain available information about arrests, convictions, outstanding warrants, and traffic violations such as speeding tickets. Information about criminal offenses includes available date and location of the crime, as well as information about how the record was matched with a given person. This is important because records can sometimes be associated with the wrong person. Our reports are compiled using federal, state, county, and local databases and include available results from corrections departments, state and federal courts, and Sex Offender and Most Wanted lists.</p>
- </div>
- </div>
- <div class="box box-bordered box-category box-relatives">
- <div class="box-header"><span style="display: inline-block; margin-top: 10px;">Family Members</span> <img class="pull-right" src="https://cdnmatador.global.ssl.fastly.net/assets/illustrations/license_illustration-d6f3a144c95ceadb0f0cb767285ef512.svg" onerror="this.src='https://cdnmatador.global.ssl.fastly.net/assets/illustrations/license_illustration_1x-1fe8e896c63a6903673bfe37e704fed4.png'; this.onerror=null;" alt="" style="height: 50px;" /></div>
- <div class="box-content" style="font-weight: 300;">
- <p>Family members in our reports are not limited to just relatives. We will also seek out any available information we can source on "significant others", business partners, roommates, business associates, and spouses and/or ex-spouses. We have premium access to mutiple sources of the hardest to find public records data, which allows us to best infer close relationships for your targeted searches.</p>
- </div>
- </div>
- <div class="box box-bordered box-category box-civil">
- <div class="box-header"><span style="display: inline-block; margin-top: 10px;">Civil Records</span> <img class="pull-right" src="https://cdnmatador.global.ssl.fastly.net/assets/illustrations/court_illustration-eaf9e8f20d20982c53049b066779dd64.svg" onerror="this.src='https://cdnmatador.global.ssl.fastly.net/assets/illustrations/court_illustration_1x-c2efa3ef50d8dbcd858aa31b3d4f4c65.png'; this.onerror=null;" alt="" style="height: 50px;" /></div>
- <div class="box-content" style="font-weight: 300;">
- <p>Civil Records may contain bankruptcy records that may include the type of bankruptcy, actions, legal representation involved in the case, as well as name and address information about the trustees. Foreclosures information may include available loan information including loan dates, lender information, and assessor's parcel number. Our Civil Records Reports provide extremely detailed information on liens, judgments, bankruptcy information, and other civil matters.</p>
- </div>
- </div>
- <div class="box box-bordered box-category box-miscellaneous">
- <div class="box-header"><span style="display: inline-block; margin-top: 10px;">Miscellaneous</span> <img class="pull-right" src="https://cdnmatador.global.ssl.fastly.net/assets/illustrations/cell_illustration-4c952212a79d01c5778934436640a202.svg" onerror="this.src='https://cdnmatador.global.ssl.fastly.net/assets/illustrations/cell_illustration_1x-19993403f06774a50872a4cec09e8f22.png'; this.onerror=null;" alt="" style="height: 50px;" /></div>
- <div class="box-content" style="font-weight: 300;">
- <p>We also give you the ability to run reverse telephone and addresses searches to see who owns a telephone number or lives at an address. Our court record search allows you to search through our comprehensive criminal and civil records databases to uncover additional information about a search subject.</p>
- </div>
- </div>
- </div>
- </div>
- <div class="progress hidden-xs hidden-ms" style="margin: 10px 20px 23px; height: 40px; position: relative; background-color: #bebebf;">
- <div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%; background-color: #4f4f4f;">
- </div>
- <p class="text-center percentage" style="position: absolute; width: 100%; color: white; font-weight: bold; padding-top: 10px;">0%</p>
- </div>
- </div>
- </div>
- <!-- QUESTIONNARE MODALS -->
- <div class="questionnaire-modal text-white" style="position: fixed; bottom: -250px; left: 0; right: 0; background-color: rgba(34, 34, 34, .85); z-index: 2; padding: 15px; display: none;">
- <div class="row">
- <div class="col-sm-offset-2 col-sm-4 col-md-offset-3 col-md-3">
- <p style="font-size: 16px;">
- <span class="icon-exclamation-sign"></span> CONFIRM INFORMATION
- </p>
- </div>
- <div class="col-sm-6 col-md-5" style="min-height: 100px;">
- <div class="questionnaire-questions info-available-questions">
- <p class="questionnaire-question">Is David Alan Raynsford over 30 years old?</p>
- <p class="questionnaire-question">Do you think David Alan Raynsford has a criminal record?</p>
- </div>
- <div class="questionnaire-questions personal-info">
- <p class="questionnaire-question">
- Has David Alan Raynsford ever gone by the name Dave Raynsford?
- </p>
- </div>
- <div class="questionnaire-questions property-info">
- <p class="questionnaire-question">
- Has David Alan Raynsford ever lived in
- Woodland Park, CO,
- Florissant, CO, or
- Colorado Springs, CO?
- </p>
- </div>
- <div class="questionnaire-questions family-members">
- <p class="questionnaire-question">Is David Alan Raynsford related to Ramona Lynn Luckett or Lucy L Raynsford?</p>
- </div>
- <div class="questionnaire-questions miscellaneous">
- <p class="questionnaire-question">Will you search for others with your unlimited Whitepages Premium lookups?</p>
- </div>
- <div class="questionnaire-answers">
- <a href="#" class="btn btn-primary questionnaire-answer">Yes</a>
- <a href="#" class="btn btn-primary questionnaire-answer">No</a>
- <a href="#" class="btn btn-link questionnaire-answer skip" style="font-weight: 300;">Skip Question</a>
- </div>
- <div class="questionnaire-confirmation">
- <p class="animated-ellipsis"><span class="icon-ok text-contrast"></span> Great! Narrowing your search</p>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </section>
- </div>
- <footer id="footer" class="text-center">
- <p class="text-muted">
- © 2017 Whitepages Inc.
- </p>
- </footer>
- <script type="text/javascript" src="https://cdnmatador.global.ssl.fastly.net/assets/whitepages-beccf4d7d1f20d600d5fc5e51d0e5c3e.js"></script>
- <script type="text/javascript">
- /* ========================================================================
- * Global variables
- * ======================================================================== */
- // SET UP CSRF
- var csrfToken = "1489539598##0ba7f4b6bf167c3378440e9211b3ddbd5e2354c0";
- $.ajaxPrefilter(function (options, originalOptions, jqXHR) {
- jqXHR.setRequestHeader('X-CSRF-Token', csrfToken);
- });
- var SEARCHING = false;
- /* ========================================================================
- * General
- * ======================================================================== */
- (function ($) {
- 'use strict';
- // TAB SWITCHING
- // ============================================================
- function changeTabs() {
- var hash = window.location.hash;
- var dropdown = $('#tab-select');
- if(hash) {
- dropdown.val(hash);
- if ($('a[data-toggle=tab][data-target='+hash+']').length > 0) {
- $('a[data-toggle=tab][data-target='+hash+']').tab('show');
- }
- } else {
- var tabs = $('a[data-toggle=tab]');
- if (tabs.length > 0) {
- $('#tab-select .default').attr("selected", "selected");
- $(tabs[0]).tab('show');
- }
- }
- }
- $(window).load(changeTabs).on('hashchange', changeTabs);
- $('#tab-select').change(function() {
- $('a[data-toggle=tab][data-target='+this.value+']').tab('show');
- var scrollHeight = $(window).scrollTop();
- window.location.hash = $(this).attr('value');
- $(window).scrollTop(scrollHeight);
- });
- $('a[data-toggle="tab"]').on('click', function (e) {
- $(this).tab('show');
- var scrollHeight = $(window).scrollTop();
- window.location.hash = $(this).attr('data-target');
- $(window).scrollTop(scrollHeight);
- });
- // AGE SLIDER
- // ============================================================
- $(".age-range-slider").each(function(index) {
- $(this).slider({
- range: true,
- min: 18,
- max: 120,
- values: [$(this).data('min'), $(this).data('max')],
- slide: function(event, ui) {
- $(".min-age", this.form).val(ui.values[0])
- .text(ui.values[0]);
- $(".max-age", this.form).val(ui.values[1])
- .text(ui.values[1]);
- }
- });
- });
- $('.clear-filters').on('click', function(evt) {
- var $form = $(this.form);
- $form.find('input:visible, .min-age, .max-age').val('');
- $form.submit();
- });
- // COLLAPSE LINKS - see if you can delete this
- // ============================================================
- $('.collapse-link').click(function(event) {
- event.preventDefault();
- if($(this).data('status') == 'collapsed') {
- $(this).html($(this).data('text-expanded'));
- $(this).data('status', 'expanded');
- $($(this).data('target')).collapse('show');
- } else {
- $(this).html($(this).data('text-collapsed'));
- $(this).data('status', 'collapsed');
- $($(this).data('target')).collapse('hide');
- }
- });
- })(jQuery);
- /* ========================================================================
- * Prevents words from appearing on a new line by themselves.
- * window.premium.util.removeOrphans(CSS selector [, parameters]);
- *
- * e.g. removeOrphans('h1, h2') -> Removes orphans from top- and second-level headings
- *
- * parameter options:
- * - allowedLength: If the final word in an element is beyond this length,
- * then that element will be skipped. Useful if the last word would look
- * okay on its own line.
- * - siblings: Be default, the orphan will have one sibling on the new line.
- * If more than one is required, set sibling to control how many words
- * should accompany the orphan on the new line.
- * ======================================================================== */
- (function(window, document, undefined) {
- 'use strict';
- function removeOphanFromElement(element, siblings) {
- var orphanHTML = element.innerHTML;
- var inTag = false;
- var siblingsSoFar = 0;
- for (var j = orphanHTML.length - 1; j >= 0; j--) {
- if (orphanHTML.charAt(j) === '>' || orphanHTML.charAt(j) === '<') {
- inTag = !inTag;
- continue;
- }
- if (!inTag && orphanHTML.charAt(j) === ' ') {
- var beginning = orphanHTML.substring(0, j);
- var ending = orphanHTML.substring(j + 1, orphanHTML.lenth);
- orphanHTML = beginning + ' ' + ending;
- siblingsSoFar++;
- if (siblingsSoFar >= siblings) {
- break;
- }
- }
- }
- return orphanHTML;
- }
- window.premium.util.removeOrphans = function(elements, options) {
- options = options || {};
- var siblings = options.siblings || 1;
- var allowedLength = options.allowedLength || undefined;
- var orphans = document.querySelectorAll(elements);
- for (var i = 0; i < orphans.length; i++) {
- if (allowedLength) {
- // textContent not supported in IE8, fallback to non-standard innerText
- var words = (orphans[i].textContent || orphans[i].innerText).split(' ');
- if (words[words.length - 1].length < allowedLength) {
- orphans[i].innerHTML = removeOphanFromElement(orphans[i], siblings);
- }
- } else {
- orphans[i].innerHTML = removeOphanFromElement(orphans[i], siblings);
- }
- }
- };
- })(window, document);
- /* ========================================================================
- * Jquery validation - additional methods
- * ======================================================================== */
- (function ($) {
- 'use strict';
- // JQUERY REQUIRE AT LEAST ONE CHECKBOX
- // ============================================================
- jQuery.validator.addMethod('requireone', function(value) {
- return $("[data-rule-requireone]:checked").size() > 0;
- }, 'Please check at least one box.');
- // GENERAL ON FOCUS OUT VALIDATION
- // ============================================================
- jQuery.validator.defaults.onfocusout = function (element, event) {
- // if the element should only be validated on form submit, don't validate
- if ($(element).data("control") === "on-submit-only") {
- return;
- }
- this.element(element);
- }
- // US PHONE VALIDATION
- // ============================================================
- jQuery.validator.addMethod('phoneUS', function(phone_number, element) {
- phone_number = phone_number.replace(/[^\x00-\x7F]|\s+/g, '');
- return this.optional(element) || phone_number.length > 9 && phone_number.match(/^(1-?)?(\([2-9]\d{2}\)|[2-9]\d{2})-?[2-9]\d{2}-?\d{4}$/);
- }, 'Please enter a valid phone number.')
- // BIRTH DATE VALIDATION (Month/Year, Month/Day, and Month/Day/Year allowed)
- // ============================================================
- jQuery.validator.addMethod("require_valid_birthdate", function(value, element, options) {
- var birth_month = $("select[name$='birth_month']", element.form);
- var birth_day = $("select[name$='birth_day']", element.form);
- var birth_year = $("select[name$='birth_year']", element.form);
- if(birth_month.val() > 0) {
- return birth_day.val() > 0 || birth_year.val() > 0;
- }
- if(birth_day.val() > 0 || birth_year.val() > 0) {
- return birth_month.val() > 0;
- }
- return true;
- // {0} below is the 0th item in the options field
- }, jQuery.format("Only Month/Year, Month/Day, and Month/Day/Year are allowed."));
- /* */
- })(jQuery);
- /* ========================================================================
- * Modals
- * ======================================================================== */
- (function ($) {
- 'use strict';
- function logConsumeCreditAttempt(remainingCredits) {
- if (window.analytics) {
- premium.analytics.track('AttemptConsumeReportCredit',
- { 'remainingCredits': remainingCredits },
- { sendToSegment: true });
- }
- }
- // USE COMP REPORT CREDIT TO BUY REPORT MODAL
- // ============================================================
- $('.confirm').click(function(event) {
- var form = $(this).closest("form");
- var creditsAvailable = $(form).attr("data-credits");
- var message;
- if (creditsAvailable == 1) {
- message = "This will use your <strong>last</strong> available Background Report credit.";
- } else {
- message = "This will use <strong>1</strong> of your <strong>" + creditsAvailable + "</strong> available Background Report credits.";
- }
- var title = "<img class='pull-left' src='https://cdnmatador.global.ssl.fastly.net/assets/illustrations/report_illustration-c9d3bd4b0872fbd4e8ead8340008174e.svg' onerror=\"this.src='https://cdnmatador.global.ssl.fastly.net/assets/illustrations/report_illustration_1x-4d264419add938deaf15a8bf159cdd31.png'; this.onerror=null;\" alt='' style='height: 50px;' /> Upgrade " + $(form).attr("data-name") + "'s Report";
- var dialog = bootbox.dialog({
- size: 'small',
- title: title,
- message: message,
- closeButton: false,
- animate: true,
- buttons: {
- cancel: {
- label: "Cancel",
- className: "btn-secondary"
- },
- confirm: {
- label: "Upgrade Report",
- className: "btn-inverse",
- callback: function(result){
- if (result) {
- // This will disable both the submit and the cancel buttons
- var remainingCredits = parseInt(creditsAvailable) - 1;
- logConsumeCreditAttempt(remainingCredits);
- dialog.find('.btn').prop('disabled', true)
- form.submit();
- return false;
- }
- }
- }
- }
- })
- event.preventDefault();
- });
- function cancelingPleaseWaitModal() {
- bootbox.dialog({
- closeButton: false,
- message: "<div class='text-center' style='padding: 60px 0 30px;'><h2 class='large-header'>Canceling Your Subscription...</h2>" +
- "<img src='https://cdnmatador.global.ssl.fastly.net/assets/flatty/ajax-loaders/wp_loading-0d83c208c9254fffcaafc555c60c8b06.gif' alt='' /></div>"
- });
- }
- // CANCEL SUBSCRIPTION MODAL
- // ============================================================
- function showCancelDataCollectModal(form, cancelDataCollectModalUrl) {
- $.ajax({
- type: 'GET',
- url: cancelDataCollectModalUrl,
- success: function(data) {
- var dialog = bootbox.dialog({
- message: data,
- closeButton: false,
- buttons: {
- cancel: {
- label: "NEVER MIND",
- className: "btn-secondary"
- },
- success: {
- label: "CONFIRM",
- className: "btn-primary",
- callback: function() {
- var cancelDataForm = $('form#cancel-data');
- cancelDataForm.validate({
- errorPlacement: function(error, el) {
- error.css('display', 'block');
- error.insertBefore(el);
- },
- errorClass: "text-error",
- errorElement: "span"
- });
- cancelDataForm.click(function() {
- $('label.text-error').hide();
- });
- if(cancelDataForm.valid()) {
- $.ajax({
- type: 'POST',
- data: $(form).serialize(),
- url: form.action,
- success: function(data) {
- if(data.redirect) {
- window.location.href = data.redirect;
- } else {
- location.reload();
- }
- }
- });
- var eventProperties = {};
- eventProperties.reason = $("input[name='reason']:checked").val();
- eventProperties.msg = $("textarea[name='msg']").val();
- eventProperties.step = 'finish';
- if(window.analytics) {
- analytics.track('ViewedCancelSubscriptionModal', eventProperties);
- }
- dialog.find('.btn').prop('disabled', true)
- cancelingPleaseWaitModal();
- } else { return false; }
- }
- }
- }
- });
- }
- });
- }
- $(document).on('click', '.cancel-subscription-link', function(evt) {
- if(window.analytics) {
- var eventProperties = {};
- eventProperties.step = 'start';
- analytics.track('ViewedCancelSubscriptionModal', eventProperties);
- }
- var cancelModalUrl = $(this).data('url');
- var cancelDataCollectModalUrl = $(this).data('cancel-data-url');
- var form = this.form;
- $(form).one("submit", function(event){
- event.preventDefault();
- $.ajax({
- type: 'GET',
- url: cancelModalUrl,
- success: function(data) {
- bootbox.dialog({
- message: data,
- closeButton: false,
- buttons: {
- cancel: {
- label: "NEVER MIND",
- className: "btn-secondary"
- },
- success: {
- label: "PROCEED",
- className: "btn-primary",
- callback: function() {
- if(window.analytics) {
- var eventProperties = {};
- eventProperties.step = 'cancel_intent';
- analytics.track('ViewedCancelSubscriptionModal', eventProperties);
- }
- showCancelDataCollectModal(form, cancelDataCollectModalUrl);
- }
- }
- }
- });
- }
- });
- });
- });
- })(jQuery);
- // iOS Modal Hack
- // This addresses the issue where blurring an input and hiding the keyboard
- // causes a graphical glitch on iOS devices
- // https://github.com/twbs/bootstrap/issues/9023
- // ============================================================
- if(navigator.userAgent.match(/iPhone|iPad|iPod/i)) {
- scrollLocation = $(window).scrollTop();
- $(window).on('shown.bs.modal', function() {
- if(!$('.modal').find('input').empty()) {
- $('.modal').addClass('modal-ios')
- .height($(window).height())
- .css({'margin-top': scrollLocation + 'px'});
- }
- });
- $('.modal-ios input').on('blur', function() {
- setTimeout(function() {
- // This causes iOS to refresh, fixes problems when virtual keyboard closes
- $(window).scrollLeft(0);
- var $focused = $(':focus');
- // Needed in case user clicks directly from one input to another
- if(!$focused.is('input')) {
- // Otherwise reset the scoll to the top of the modal
- $(window).scrollTop(scrollLocation);
- }
- }, 0);
- });
- }
- /* ========================================================================
- * Search
- * ======================================================================== */
- (function ($) {
- 'use strict';
- // TITLEIZE SEARCH INPUTS
- // ============================================================
- function titleize(str) {
- return str.replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1);});
- }
- $("input.titleize, input.typeahead").keyup(function(event) {
- if (!this.setSelectionRange) {
- return;
- }
- var input = $(this);
- var start = this.selectionStart;
- var end = this.selectionEnd;
- if (!input.data('last-value')) {
- input.data('last-value', '');
- }
- var value = titleize(input.val());
- if (input.data('last-value') != value) {
- input.val(value);
- input.data('last-value', value);
- this.setSelectionRange(start, end);
- event.preventDefault();
- }
- });
- // CITY/STATE TYPEAHEAD
- // ============================================================
- var cityState = new Bloodhound({
- datumTokenizer: function (datum) {
- return Bloodhound.tokenizers.whitespace(datum.value);
- },
- queryTokenizer: Bloodhound.tokenizers.whitespace,
- remote: {
- url: "/autocomplete/cities?query=%QUERY",
- wildcard: '%QUERY',
- rateLimitWait: 200,
- filter: function (response) {
- return $.map(response.cities, function (value) {
- return {
- value: value
- };
- });
- }
- }
- });
- cityState.initialize();
- $('.typeahead').typeahead(
- {
- minLength: 3
- },
- {
- displayKey: 'value',
- limit: 8,
- source: cityState
- }
- );
- $('.typeahead').on('typeahead:render', function() {
- $(this).parent().find('.tt-selectable:first').addClass('tt-cursor');
- });
- // CLEAR MOBILE SEARCH INPUT
- // ============================================================
- $('.clear-input').on('click', function(evt) {
- evt.preventDefault();
- $(this).parent().find('input').val('').focus();
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement