Advertisement
Guest User

Untitled

a guest
Mar 14th, 2017
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 30.83 KB | None | 0 0
  1. <!--COMPLETING REPORT-->
  2. <div id="completing-report" class="completing-report-modal loaders hide">
  3. <h1 style="margin-bottom: 20px;">Compiling Your Report</h1>
  4. <div class="row">
  5. <div class="col-sm-5 text-left-sm">
  6. <h2 style="margin: 0;">David Alan Raynsford</h2>
  7. <p><span class="icon-map-marker"></span> Woodland Park, Co | Age: 50</p>
  8. </div>
  9. <div class="col-sm-7 time-remaining">
  10. <p class="text-right-sm">Approximately <span class="time" style="font-weight: bold;" data-seconds="120">2 minutes </span> remaining</p>
  11. </div>
  12. </div>
  13. <div class="progress visible-xs visible-ms" style="margin: 10px 20px 23px; height: 40px; position: relative; background-color: #bebebf;">
  14. <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;">
  15. </div>
  16. <p class="text-center percentage" style="position: absolute; width: 100%; color: white; font-weight: bold; padding-top: 10px;">0%</p>
  17. </div>
  18. <div class="row text-left">
  19. <div class="col-sm-5 hidden-xs hidden-ms">
  20. <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>
  21. <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>
  22. <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>
  23. <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>
  24. <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>
  25. <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>
  26. </div>
  27. <div class="col-sm-7">
  28. <div class="box box-bordered box-category box-personal-info">
  29. <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>
  30. <div class="box-content" style="font-weight: 300;">
  31. <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>
  32. </div>
  33. </div>
  34. <div class="box box-bordered box-category box-address">
  35. <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>
  36. <div class="box-content" style="font-weight: 300;">
  37. <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>
  38. </div>
  39. </div>
  40. <div class="box box-bordered box-category box-criminal">
  41. <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>
  42. <div class="box-content" style="font-weight: 300;">
  43. <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>
  44. </div>
  45. </div>
  46. <div class="box box-bordered box-category box-relatives">
  47. <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>
  48. <div class="box-content" style="font-weight: 300;">
  49. <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>
  50. </div>
  51. </div>
  52. <div class="box box-bordered box-category box-civil">
  53. <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>
  54. <div class="box-content" style="font-weight: 300;">
  55. <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>
  56. </div>
  57. </div>
  58. <div class="box box-bordered box-category box-miscellaneous">
  59. <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>
  60. <div class="box-content" style="font-weight: 300;">
  61. <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>
  62. </div>
  63. </div>
  64. </div>
  65. </div>
  66. <div class="progress hidden-xs hidden-ms" style="margin: 10px 20px 23px; height: 40px; position: relative; background-color: #bebebf;">
  67. <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;">
  68. </div>
  69. <p class="text-center percentage" style="position: absolute; width: 100%; color: white; font-weight: bold; padding-top: 10px;">0%</p>
  70. </div>
  71. </div>
  72. </div>
  73.  
  74. <!-- QUESTIONNARE MODALS -->
  75. <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;">
  76. <div class="row">
  77. <div class="col-sm-offset-2 col-sm-4 col-md-offset-3 col-md-3">
  78. <p style="font-size: 16px;">
  79. <span class="icon-exclamation-sign"></span> CONFIRM INFORMATION
  80. </p>
  81. </div>
  82. <div class="col-sm-6 col-md-5" style="min-height: 100px;">
  83. <div class="questionnaire-questions info-available-questions">
  84. <p class="questionnaire-question">Is David Alan Raynsford over 30 years old?</p>
  85. <p class="questionnaire-question">Do you think David Alan Raynsford has a criminal record?</p>
  86. </div>
  87.  
  88. <div class="questionnaire-questions personal-info">
  89. <p class="questionnaire-question">
  90. Has David Alan Raynsford ever gone by the name Dave Raynsford?
  91. </p>
  92. </div>
  93.  
  94.  
  95. <div class="questionnaire-questions property-info">
  96.  
  97.  
  98. <p class="questionnaire-question">
  99. Has David Alan Raynsford ever lived in
  100.  
  101. Woodland Park, CO,
  102.  
  103. Florissant, CO, or
  104.  
  105. Colorado Springs, CO?
  106. </p>
  107. </div>
  108.  
  109.  
  110. <div class="questionnaire-questions family-members">
  111.  
  112.  
  113. <p class="questionnaire-question">Is David Alan Raynsford related to Ramona Lynn Luckett or Lucy L Raynsford?</p>
  114. </div>
  115.  
  116. <div class="questionnaire-questions miscellaneous">
  117. <p class="questionnaire-question">Will you search for others with your unlimited Whitepages Premium lookups?</p>
  118. </div>
  119. <div class="questionnaire-answers">
  120. <a href="#" class="btn btn-primary questionnaire-answer">Yes</a>
  121. <a href="#" class="btn btn-primary questionnaire-answer">No</a>
  122. <a href="#" class="btn btn-link questionnaire-answer skip" style="font-weight: 300;">Skip Question</a>
  123. </div>
  124. <div class="questionnaire-confirmation">
  125. <p class="animated-ellipsis"><span class="icon-ok text-contrast"></span> Great! Narrowing your search</p>
  126. </div>
  127. </div>
  128. </div>
  129. </div>
  130.  
  131. </div>
  132. </div>
  133. </section>
  134. </div>
  135.  
  136. <footer id="footer" class="text-center">
  137. <p class="text-muted">
  138. &copy; 2017 Whitepages Inc.
  139. </p>
  140. </footer>
  141. <script type="text/javascript" src="https://cdnmatador.global.ssl.fastly.net/assets/whitepages-beccf4d7d1f20d600d5fc5e51d0e5c3e.js"></script>
  142. <script type="text/javascript">
  143. /* ========================================================================
  144. * Global variables
  145. * ======================================================================== */
  146.  
  147. // SET UP CSRF
  148. var csrfToken = "1489539598##0ba7f4b6bf167c3378440e9211b3ddbd5e2354c0";
  149.  
  150. $.ajaxPrefilter(function (options, originalOptions, jqXHR) {
  151. jqXHR.setRequestHeader('X-CSRF-Token', csrfToken);
  152. });
  153.  
  154. var SEARCHING = false;
  155.  
  156.  
  157.  
  158. /* ========================================================================
  159. * General
  160. * ======================================================================== */
  161. (function ($) {
  162. 'use strict';
  163. // TAB SWITCHING
  164. // ============================================================
  165. function changeTabs() {
  166. var hash = window.location.hash;
  167. var dropdown = $('#tab-select');
  168. if(hash) {
  169. dropdown.val(hash);
  170. if ($('a[data-toggle=tab][data-target='+hash+']').length > 0) {
  171. $('a[data-toggle=tab][data-target='+hash+']').tab('show');
  172. }
  173. } else {
  174. var tabs = $('a[data-toggle=tab]');
  175. if (tabs.length > 0) {
  176. $('#tab-select .default').attr("selected", "selected");
  177. $(tabs[0]).tab('show');
  178. }
  179. }
  180. }
  181. $(window).load(changeTabs).on('hashchange', changeTabs);
  182.  
  183. $('#tab-select').change(function() {
  184. $('a[data-toggle=tab][data-target='+this.value+']').tab('show');
  185. var scrollHeight = $(window).scrollTop();
  186. window.location.hash = $(this).attr('value');
  187. $(window).scrollTop(scrollHeight);
  188. });
  189. $('a[data-toggle="tab"]').on('click', function (e) {
  190. $(this).tab('show');
  191. var scrollHeight = $(window).scrollTop();
  192. window.location.hash = $(this).attr('data-target');
  193. $(window).scrollTop(scrollHeight);
  194. });
  195.  
  196. // AGE SLIDER
  197. // ============================================================
  198. $(".age-range-slider").each(function(index) {
  199. $(this).slider({
  200. range: true,
  201. min: 18,
  202. max: 120,
  203. values: [$(this).data('min'), $(this).data('max')],
  204. slide: function(event, ui) {
  205. $(".min-age", this.form).val(ui.values[0])
  206. .text(ui.values[0]);
  207. $(".max-age", this.form).val(ui.values[1])
  208. .text(ui.values[1]);
  209. }
  210. });
  211. });
  212.  
  213. $('.clear-filters').on('click', function(evt) {
  214. var $form = $(this.form);
  215. $form.find('input:visible, .min-age, .max-age').val('');
  216. $form.submit();
  217. });
  218.  
  219. // COLLAPSE LINKS - see if you can delete this
  220. // ============================================================
  221. $('.collapse-link').click(function(event) {
  222. event.preventDefault();
  223. if($(this).data('status') == 'collapsed') {
  224. $(this).html($(this).data('text-expanded'));
  225. $(this).data('status', 'expanded');
  226. $($(this).data('target')).collapse('show');
  227. } else {
  228. $(this).html($(this).data('text-collapsed'));
  229. $(this).data('status', 'collapsed');
  230. $($(this).data('target')).collapse('hide');
  231. }
  232. });
  233. })(jQuery);
  234.  
  235. /* ========================================================================
  236. * Prevents words from appearing on a new line by themselves.
  237. * window.premium.util.removeOrphans(CSS selector [, parameters]);
  238. *
  239. * e.g. removeOrphans('h1, h2') -> Removes orphans from top- and second-level headings
  240. *
  241. * parameter options:
  242. * - allowedLength: If the final word in an element is beyond this length,
  243. * then that element will be skipped. Useful if the last word would look
  244. * okay on its own line.
  245. * - siblings: Be default, the orphan will have one sibling on the new line.
  246. * If more than one is required, set sibling to control how many words
  247. * should accompany the orphan on the new line.
  248. * ======================================================================== */
  249.  
  250. (function(window, document, undefined) {
  251.  
  252. 'use strict';
  253.  
  254. function removeOphanFromElement(element, siblings) {
  255. var orphanHTML = element.innerHTML;
  256. var inTag = false;
  257. var siblingsSoFar = 0;
  258. for (var j = orphanHTML.length - 1; j >= 0; j--) {
  259. if (orphanHTML.charAt(j) === '>' || orphanHTML.charAt(j) === '<') {
  260. inTag = !inTag;
  261. continue;
  262. }
  263. if (!inTag && orphanHTML.charAt(j) === ' ') {
  264. var beginning = orphanHTML.substring(0, j);
  265. var ending = orphanHTML.substring(j + 1, orphanHTML.lenth);
  266. orphanHTML = beginning + '&nbsp;' + ending;
  267. siblingsSoFar++;
  268. if (siblingsSoFar >= siblings) {
  269. break;
  270. }
  271. }
  272. }
  273. return orphanHTML;
  274. }
  275.  
  276. window.premium.util.removeOrphans = function(elements, options) {
  277. options = options || {};
  278. var siblings = options.siblings || 1;
  279. var allowedLength = options.allowedLength || undefined;
  280. var orphans = document.querySelectorAll(elements);
  281. for (var i = 0; i < orphans.length; i++) {
  282. if (allowedLength) {
  283. // textContent not supported in IE8, fallback to non-standard innerText
  284. var words = (orphans[i].textContent || orphans[i].innerText).split(' ');
  285. if (words[words.length - 1].length < allowedLength) {
  286. orphans[i].innerHTML = removeOphanFromElement(orphans[i], siblings);
  287. }
  288. } else {
  289. orphans[i].innerHTML = removeOphanFromElement(orphans[i], siblings);
  290. }
  291. }
  292. };
  293. })(window, document);
  294.  
  295. /* ========================================================================
  296. * Jquery validation - additional methods
  297. * ======================================================================== */
  298. (function ($) {
  299. 'use strict';
  300.  
  301. // JQUERY REQUIRE AT LEAST ONE CHECKBOX
  302. // ============================================================
  303. jQuery.validator.addMethod('requireone', function(value) {
  304. return $("[data-rule-requireone]:checked").size() > 0;
  305. }, 'Please check at least one box.');
  306.  
  307. // GENERAL ON FOCUS OUT VALIDATION
  308. // ============================================================
  309. jQuery.validator.defaults.onfocusout = function (element, event) {
  310. // if the element should only be validated on form submit, don't validate
  311. if ($(element).data("control") === "on-submit-only") {
  312. return;
  313. }
  314. this.element(element);
  315. }
  316.  
  317. // US PHONE VALIDATION
  318. // ============================================================
  319. jQuery.validator.addMethod('phoneUS', function(phone_number, element) {
  320. phone_number = phone_number.replace(/[^\x00-\x7F]|\s+/g, '');
  321. 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}$/);
  322. }, 'Please enter a valid phone number.')
  323.  
  324. // BIRTH DATE VALIDATION (Month/Year, Month/Day, and Month/Day/Year allowed)
  325. // ============================================================
  326. jQuery.validator.addMethod("require_valid_birthdate", function(value, element, options) {
  327. var birth_month = $("select[name$='birth_month']", element.form);
  328. var birth_day = $("select[name$='birth_day']", element.form);
  329. var birth_year = $("select[name$='birth_year']", element.form);
  330. if(birth_month.val() > 0) {
  331. return birth_day.val() > 0 || birth_year.val() > 0;
  332. }
  333. if(birth_day.val() > 0 || birth_year.val() > 0) {
  334. return birth_month.val() > 0;
  335. }
  336. return true;
  337. // {0} below is the 0th item in the options field
  338. }, jQuery.format("Only Month/Year, Month/Day, and Month/Day/Year are allowed."));
  339. /* */
  340. })(jQuery);
  341.  
  342.  
  343. /* ========================================================================
  344. * Modals
  345. * ======================================================================== */
  346. (function ($) {
  347. 'use strict';
  348.  
  349. function logConsumeCreditAttempt(remainingCredits) {
  350. if (window.analytics) {
  351. premium.analytics.track('AttemptConsumeReportCredit',
  352. { 'remainingCredits': remainingCredits },
  353. { sendToSegment: true });
  354. }
  355. }
  356.  
  357. // USE COMP REPORT CREDIT TO BUY REPORT MODAL
  358. // ============================================================
  359. $('.confirm').click(function(event) {
  360. var form = $(this).closest("form");
  361. var creditsAvailable = $(form).attr("data-credits");
  362. var message;
  363. if (creditsAvailable == 1) {
  364. message = "This will use your <strong>last</strong> available Background Report credit.";
  365. } else {
  366. message = "This will use <strong>1</strong> of your <strong>" + creditsAvailable + "</strong> available Background Report credits.";
  367. }
  368. 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";
  369. var dialog = bootbox.dialog({
  370. size: 'small',
  371. title: title,
  372. message: message,
  373. closeButton: false,
  374.  
  375. animate: true,
  376.  
  377. buttons: {
  378. cancel: {
  379. label: "Cancel",
  380. className: "btn-secondary"
  381. },
  382. confirm: {
  383. label: "Upgrade Report",
  384. className: "btn-inverse",
  385. callback: function(result){
  386. if (result) {
  387. // This will disable both the submit and the cancel buttons
  388. var remainingCredits = parseInt(creditsAvailable) - 1;
  389. logConsumeCreditAttempt(remainingCredits);
  390. dialog.find('.btn').prop('disabled', true)
  391. form.submit();
  392. return false;
  393. }
  394. }
  395. }
  396. }
  397. })
  398. event.preventDefault();
  399. });
  400.  
  401. function cancelingPleaseWaitModal() {
  402. bootbox.dialog({
  403. closeButton: false,
  404. message: "<div class='text-center' style='padding: 60px 0 30px;'><h2 class='large-header'>Canceling Your Subscription...</h2>" +
  405. "<img src='https://cdnmatador.global.ssl.fastly.net/assets/flatty/ajax-loaders/wp_loading-0d83c208c9254fffcaafc555c60c8b06.gif' alt='' /></div>"
  406. });
  407. }
  408.  
  409. // CANCEL SUBSCRIPTION MODAL
  410. // ============================================================
  411. function showCancelDataCollectModal(form, cancelDataCollectModalUrl) {
  412. $.ajax({
  413. type: 'GET',
  414. url: cancelDataCollectModalUrl,
  415. success: function(data) {
  416. var dialog = bootbox.dialog({
  417. message: data,
  418. closeButton: false,
  419. buttons: {
  420. cancel: {
  421. label: "NEVER MIND",
  422. className: "btn-secondary"
  423. },
  424. success: {
  425. label: "CONFIRM",
  426. className: "btn-primary",
  427. callback: function() {
  428. var cancelDataForm = $('form#cancel-data');
  429. cancelDataForm.validate({
  430. errorPlacement: function(error, el) {
  431. error.css('display', 'block');
  432. error.insertBefore(el);
  433. },
  434. errorClass: "text-error",
  435. errorElement: "span"
  436. });
  437. cancelDataForm.click(function() {
  438. $('label.text-error').hide();
  439. });
  440. if(cancelDataForm.valid()) {
  441. $.ajax({
  442. type: 'POST',
  443. data: $(form).serialize(),
  444. url: form.action,
  445. success: function(data) {
  446. if(data.redirect) {
  447. window.location.href = data.redirect;
  448. } else {
  449. location.reload();
  450. }
  451. }
  452. });
  453. var eventProperties = {};
  454. eventProperties.reason = $("input[name='reason']:checked").val();
  455. eventProperties.msg = $("textarea[name='msg']").val();
  456. eventProperties.step = 'finish';
  457. if(window.analytics) {
  458. analytics.track('ViewedCancelSubscriptionModal', eventProperties);
  459. }
  460. dialog.find('.btn').prop('disabled', true)
  461. cancelingPleaseWaitModal();
  462. } else { return false; }
  463. }
  464. }
  465. }
  466. });
  467. }
  468. });
  469. }
  470. $(document).on('click', '.cancel-subscription-link', function(evt) {
  471. if(window.analytics) {
  472. var eventProperties = {};
  473. eventProperties.step = 'start';
  474. analytics.track('ViewedCancelSubscriptionModal', eventProperties);
  475. }
  476. var cancelModalUrl = $(this).data('url');
  477. var cancelDataCollectModalUrl = $(this).data('cancel-data-url');
  478. var form = this.form;
  479.  
  480.  
  481.  
  482. $(form).one("submit", function(event){
  483. event.preventDefault();
  484. $.ajax({
  485. type: 'GET',
  486. url: cancelModalUrl,
  487. success: function(data) {
  488. bootbox.dialog({
  489. message: data,
  490. closeButton: false,
  491. buttons: {
  492. cancel: {
  493. label: "NEVER MIND",
  494. className: "btn-secondary"
  495. },
  496. success: {
  497. label: "PROCEED",
  498. className: "btn-primary",
  499. callback: function() {
  500. if(window.analytics) {
  501. var eventProperties = {};
  502. eventProperties.step = 'cancel_intent';
  503. analytics.track('ViewedCancelSubscriptionModal', eventProperties);
  504. }
  505. showCancelDataCollectModal(form, cancelDataCollectModalUrl);
  506. }
  507. }
  508. }
  509. });
  510. }
  511. });
  512. });
  513. });
  514. })(jQuery);
  515.  
  516. // iOS Modal Hack
  517. // This addresses the issue where blurring an input and hiding the keyboard
  518. // causes a graphical glitch on iOS devices
  519. // https://github.com/twbs/bootstrap/issues/9023
  520. // ============================================================
  521.  
  522. if(navigator.userAgent.match(/iPhone|iPad|iPod/i)) {
  523. scrollLocation = $(window).scrollTop();
  524. $(window).on('shown.bs.modal', function() {
  525. if(!$('.modal').find('input').empty()) {
  526. $('.modal').addClass('modal-ios')
  527. .height($(window).height())
  528. .css({'margin-top': scrollLocation + 'px'});
  529. }
  530. });
  531. $('.modal-ios input').on('blur', function() {
  532. setTimeout(function() {
  533. // This causes iOS to refresh, fixes problems when virtual keyboard closes
  534. $(window).scrollLeft(0);
  535.  
  536. var $focused = $(':focus');
  537. // Needed in case user clicks directly from one input to another
  538. if(!$focused.is('input')) {
  539. // Otherwise reset the scoll to the top of the modal
  540. $(window).scrollTop(scrollLocation);
  541. }
  542. }, 0);
  543. });
  544. }
  545.  
  546. /* ========================================================================
  547. * Search
  548. * ======================================================================== */
  549. (function ($) {
  550. 'use strict';
  551.  
  552. // TITLEIZE SEARCH INPUTS
  553. // ============================================================
  554. function titleize(str) {
  555. return str.replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1);});
  556. }
  557.  
  558. $("input.titleize, input.typeahead").keyup(function(event) {
  559. if (!this.setSelectionRange) {
  560. return;
  561. }
  562. var input = $(this);
  563. var start = this.selectionStart;
  564. var end = this.selectionEnd;
  565. if (!input.data('last-value')) {
  566. input.data('last-value', '');
  567. }
  568. var value = titleize(input.val());
  569. if (input.data('last-value') != value) {
  570. input.val(value);
  571. input.data('last-value', value);
  572. this.setSelectionRange(start, end);
  573. event.preventDefault();
  574. }
  575. });
  576.  
  577. // CITY/STATE TYPEAHEAD
  578. // ============================================================
  579. var cityState = new Bloodhound({
  580. datumTokenizer: function (datum) {
  581. return Bloodhound.tokenizers.whitespace(datum.value);
  582. },
  583. queryTokenizer: Bloodhound.tokenizers.whitespace,
  584. remote: {
  585. url: "/autocomplete/cities?query=%QUERY",
  586. wildcard: '%QUERY',
  587. rateLimitWait: 200,
  588. filter: function (response) {
  589. return $.map(response.cities, function (value) {
  590. return {
  591. value: value
  592. };
  593. });
  594. }
  595. }
  596. });
  597.  
  598. cityState.initialize();
  599.  
  600. $('.typeahead').typeahead(
  601. {
  602. minLength: 3
  603. },
  604. {
  605. displayKey: 'value',
  606. limit: 8,
  607. source: cityState
  608. }
  609. );
  610.  
  611. $('.typeahead').on('typeahead:render', function() {
  612. $(this).parent().find('.tt-selectable:first').addClass('tt-cursor');
  613. });
  614.  
  615. // CLEAR MOBILE SEARCH INPUT
  616. // ============================================================
  617. $('.clear-input').on('click', function(evt) {
  618. evt.preventDefault();
  619. $(this).parent().find('input').val('').focus();
  620. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement