1HJCONTAINER.components.ringLandingPage = function(con) { 2 con.init = function() { 3 $('#savedRingLogin').click(function(e) { 4 e.preventDefault(); 5 con.viewSavedRing(); 6 }); 7 8 con.promoId = null; 9 con.genderOnLeft = false; 10 11 $(".designYourRing").on("click", con.designYourRingMakeGenderCallback(false)); 12 $(".promoArea .imageWithSubtitles").on("click", con.designYourRingMakeGenderCallback(true)); 13 14 $(".galleryLinks").on("click", con.miniGalleryLinkClicked); 15 }; 16 17 con.miniGalleryLinkClicked = function(e) { 18 var id = $(this).attr("href"); 19 id = id.split("/"); 20 id = id[id.length-1]; 21 id = "ringid=" + id; 22 window.location = "/secom/rings/gallery?" + id; 23 return false; 24 }; 25 26 con.viewSavedRing = function() { 27 $.ajax({ 28 url: con.relativePath + '/modals/loginViewSavedRing.jsp', 29 type: 'GET', 30 success: function( data ) { 31 $('#modalContainer').html( data ).addClass('loginContainer'); 32 launchModal($('#modalContainer'), 'show', "rings/loginViewSavedRing"); 33 34 $('.loginBtn').click(function( e ) { 35 e.preventDefault(); 36 var el = $(this); 37 con.standaloneLogin( el , 'viewRings'); 38 }); 39 40 $('#viewSavedRingFacebookLoginButton').click(function(e) { 41 console.log('fb login clicked from showLoginSaveRing'); 42 var url = con.relativePath + '/social/facebook/signin?sRedirect=' + con.relativePath + '/myaccount/savedRings'; 43 window.location = url; 44 }); 45 46 }, 47 error: function( data ) { 48 console.log( data ); 49 } 50 }); 51 }; 52}; 53 54 55HJCONTAINER.components.ringStepPage = function(con) { 56 con.init = function() { 57 $('body').on("click", ".saveRing", function() { 58 var loggedIn = $('#content').attr('data-loggedIn'); 59 60 if($('#stepHolder').attr('ringid')) { 61 //var id = $('#stepHolder').attr('ringid'); 62 //con.removeSavedRing( id ); 63 // just save 64 } else { 65 if( loggedIn == "false" ) { 66 con.showLoginSaveRing( 'saveRing' ); 67 } 68 } 69 70 }); 71 72 $('body').on("click", '[data-info="shareLink"]', function(e) { 73 e.preventDefault(); 74 75 var shareType = $(this).attr('data-service'); 76 var loggedIn = $('#content').attr('data-loggedIn'); 77 var quote = $(this).attr('data-quote'); 78 if (quote == "yes") { 79 $('#requestQuoteFlag').val("true"); 80 } else { 81 $('#requestQuoteFlag').val("false"); 82 } 83 //var productMode = ($('#content').attr('data-productMode')).toUpperCase(); 84 85 if( loggedIn == "false"){// && productMode !== 'BROWSE') { 86 con.showLoginSaveRing( 'sharing' , shareType ); 87 } 88 89 }); 90 91 $('#savedRingLogin').click(function(e) { 92 e.preventDefault(); 93 con.viewSavedRing(); 94 }); 95 96 $('body').on('click', '.wallButton', function(e) { 97 var loggedIn = $('#content').attr('data-loggedIn'); 98 99 if (loggedIn === 'true') { 100 if ( $('#stepHolder').attr('ringId') ) { 101 // ring already saved 102 $.ajax({ 103 method: 'GET', 104 url: '/secom/rings/gallery/add/' + $('#stepHolder').attr('ringId'), 105 success: function( data ) { 106 con.updateGalleryTextOnceRingAdded(); 107 }, 108 error: function() {} 109 }); 110 } else { 111 con.updateGalleryTextOnceRingAdded(); 112 } 113 } else { 114 con.showLoginSaveRing( 'addRingToGallery' ); 115 } 116 117 }); 118 119 $('#multipleRingsNotAllowed #cancel').on("click", function(){ 120 window.history.go(-2); 121 }); 122 123 con.postFacebookLoginRingSpecifics(); 124 125 }; 126 con.updateGalleryTextOnceRingAdded = function() { 127 $('#sharePopoverContent h3').text('Your ring has been added to the Gallery.'); 128 $('#addToRingGalleryButton').remove(); 129 }; 130 con.viewSavedRing = function() { 131 $.ajax({ 132 url: con.relativePath + '/modals/loginViewSavedRing.jsp', 133 type: 'GET', 134 success: function( data ) { 135 $('#modalContainer').html( data ).addClass('loginContainer'); 136 launchModal($('#modalContainer'), 'show', "rings/loginViewSavedRing"); 137 138 $('.loginBtn').click(function( e ) { 139 e.preventDefault(); 140 var el = $(this); 141 con.standaloneLogin( el , 'viewRings'); 142 }); 143 }, 144 error: function( data ) { 145 console.log( data ); 146 } 147 }); 148 149 }; 150 con.getShareEmail = function( url ) { 151 var modalContainer = $('#modalContainer'); 152 var modalContent; 153 154 modalContainer.removeClass('loginContainer'); 155
156 $.ajax({ 157 url: con.relativePath + '/modals/emailShare.jsp', 158 type: 'GET', 159 success: function( data ) { 160 modalContainer.html( data ).addClass('emailShare'); 161 launchModal(modalContainer, 'show', "rings/shareEmail"); 162 163 var repEmailStr = $('#repEmail').val(); 164 // Refs #1763 Set up changes for Request Quote modal: 165 var reqQuote = $('#requestQuoteFlag').val(); 166 167 if (reqQuote == "false") { 168 $('#requestQuoteSpan').hide(); 169 $('.modalHeaderTitle').text("Share with friends"); 170 $('#receipient').val(""); 171 $('#receipient').attr("disabled",false); 172 $('#message').val("Hey! I just designed my High School Class Ring. It was fun and easy and it tells a little about me. :) Let me know what you think of it."); 173 if (repEmailStr === undefined || repEmailStr.length < 1) { 174 $('#sendToRepSpan').hide(); 175 } else { 176 $('#sendToRepSpan').show(); 177 } 178 } else { 179 $('#requestQuoteSpan').show(); 180 $('#sendToRepSpan').hide(); 181 $('#receipient').val($('#repEmail').val()); 182 $('#receipient').attr("disabled",true); 183 $('.modalHeaderTitle').text("Request quote"); 184 $('#message').val("I am interested in getting a price quote on the ring I designed."); 185 } 186 187 var repEmailStr = $('#repEmail').val(); 188 189 $('#shareViaEmail').click(con.shareEmail); 190 $('#sendToRep').click(function( e ) { 191 e.preventDefault(); 192 $('#sendToRepSpan').hide(); 193 $('#receipient').val($('#repEmail').val()); 194 $('#receipient').attr("disabled",true); 195 }); 196 $('#shareUrl').val( url ); 197 198 }, 199 error: function( data ) { 200 console.log( data ); 201 } 202 }); 203 }; 204 con.shareEmail = function( e ) { 205 e.preventDefault(); 206 207 var _this = $(this); 208 var container = _this.closest('.shareEmailForm'); 209 var from = $("#sender"); 210 var to = $('#receipient'); 211 var phone = $('#requestQuotePhone'); 212 var name = $('#requestQuoteName'); 213 var message = $('#message'); 214 var errors = ""; 215 216 container.find('.inputError').removeClass('inputError'); 217 container.find('.errors').hide(); 218 219 if( con.validateEmail(to.val()) ) { 220 errors += "Please provide a valid receiptient address.<br/>"; 221 to.addClass('inputError'); 222 } 223 224 if( con.validateEmail(from.val()) ) { 225 errors += "Please provide a valid sender address.<br/>"; 226 from.addClass('inputError'); 227 } 228 229 // Refs #2163 If Request Quote, validate phone number: 230 var reqQuote = $('#requestQuoteFlag').val(); 231 if (reqQuote == "true") { 232 if( !name.val() ) { 233 errors += "Please provide your name to request a quote.<br/>"; 234 name.addClass('inputError'); 235 } 236 if ( con.validatePhone(phone.val()) ) { 237 errors += "Please provide a valid phone number.<br/>"; 238 phone.addClass('inputError'); 239 } 240 } 241 242 if( !message.val() ) { 243 errors += "Please provide a message to your friend.<br/>"; 244 message.addClass('inputError'); 245 } 246 247 if( errors != "") { 248 container.find('.errors').html( errors ).show(); 249 } else { 250 container.find('.msgs').html('<div class="loadingGif"></div>').show(); 251 var data = '{"toEmail":"' + $('#receipient').val() + '","ringId":"' + $('#stepHolder').attr('ringid') + '","fromEmail":"' + $("#sender").val() + '","requestQuoteName":"' + $("#requestQuoteName").val() + '","requestQuotePhone":"' + $("#requestQuotePhone").val() + '","schoolName":"' + $("#rqSchoolName").val() + '", "customMessage":"' + $('#message').val() + '"}'; 252 $.ajax({ 253 url: con.relativePath + '/ringconfig/shareRingEmail', 254 contentType: "application/json", 255 data: data, 256 type: 'POST', 257 success: function( data ) { 258 $(container).empty(); 259 $(container).append('<p>Your message has been successfully sent.</p>'); 260 }, 261 error: function( data ) { 262 console.log( data ); 263 $(container).append('<p>We are sorry but an error occured.</p>'); 264 } 265 }); 266 267 } 268 269 } 270}; 271
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.