1///////////////////////////////////////////////////////////////////////////////////////////// 2 3var vi = false; 4var gh = false; // go home 5var gd = false; // go delete 6var gr = false; // go rename 7var gp = false; // go project 8var g3 = false; // go 3d 9 10function doOnSave(data) { 11try { 12document.getElementById('action').innerHTML = 'SAVED!'; 13} catch(e) { 14document.getElementById('action').innerHTML = ' '; 15} 16 17 18var result = ''; 19var alias = ''; 20var items = window.api.state.items.length; 21for (var i = 0;i<items;i++) { 22var name = window.api.state.items[i].asset.name; // also, .id 23var id= window.api.state.items[i].asset.id; 24var ap = name.indexOf('Item # ')+7; 25if(ap>=7) { 26alias = name.substring(ap); 27} 28} 29 30 31 32if(gd) { 33vi = false; 34gh = false; 35gd = false; 36gr = false; 37gp = false; 38g3 = false; 39window.location.href=ACC.config.contextPath+'/floorplanner'; 40 41} 42if(vi) { 43vi = false; 44alert("view project"); 45gh = false; 46gd = false; 47gr = false; 48gp = false; 49g3 = false; 50//window.location.href='http://content.elcinside.com/community/landing.aspx?campaignid=1033&aliases='+result; 51//window.location.href='http://content.elcinside.com/community/landing.aspx?campaignid=1033&aliases='+result+'&pid=68791209&name=My+Project+X'; 52} 53if(gh) { 54vi = false; 55alert("go home"); 56gh = false; 57gd = false; 58gr = false; 59gp = false; 60g3 = false; 61//window.location.href='http://content.elcinside.com/community/landing.aspx?campaignid=8000'; 62} 63 64if(gr) { 65vi = false; 66gh = false; 67gd = false; 68gr = false; 69gp = false; 70g3 = false; 71//var name = prompt('Please enter a new name','My Project X'); 72if(name) { 73if(name.length>0) { 74//window.location.href='/MyPerfectClassroom/Designer.asp?pid=68791209&action=rename&newname='+encodeURIComponent(name)+'&key='+Math.random(); 75} 76} 77} 78 79if(gp) { 80vi = false; 81alert("view project id"); 82gh = false; 83gd = false; 84gr = false; 85gp = false; 86g3 = false; 87//window.location.href='http://content.elcinside.com/community/landing.aspx?campaignid=1029'; 88} 89 90if(g3) { 91vi = false; 92gh = false; 93gd = false; 94gr = false; 95gp = false; 96g3 = false; 97//var pid=window.api.project.id; 98//window.open('/my-perfect-classroom/getThreeDImage/'+pid); 99} 100 101} 102 103/*$('#3DImage').click(function() { 104 event.preventDefault(); 105try { 106window.api.save(); 107 var xhttp = new XMLHttpRequest(); 108 xhttp.onreadystatechange = function() { 109 if (this.readyState == 4 && this.status == 200) { 110 var response=JSON.parse(this.responseText); 111 $.ajax({ 112 type: "POST", 113 url: ACC.config.contextPath +"/my-perfect-classroom/thumbnailImage/"+"projectID", 114 data: 'thumbnailurl='+response.project.thumbnail_3d+','+response.project.thumbnail, 115 success: function(msg){ 116 //alert('Image Saved'); 117 } 118 }); 119 window.open(ACC.config.contextPath +"/my-perfect-classroom/getThreeDImage/"+"projectID",'_blank'); 120 } 121 }; 122 xhttp.open("POST", "https://floorplanner.com/api/v2/projects/"+"projectID"+"/export.json?auth_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhY3Rpb24iOiJsb2dpbiIsIm1vZGVsIjoiVXNlciIsImlkIjo0NjYxNTAwNiwiaWF0IjoxNTIyOTQ4ODA3fQ.pTpA1TdOI9nB3nB-UTkHi0GahQmsozd9HdbZmD9XwLY&fmt=jpg&type=3d", true); 123 xhttp.send(); 124return; 125 } catch (e) { 126} 127 128}); 129*/ 130function goHome() { 131try { 132window.api.save(); 133gh = true; 134vi = false; 135gd = false; 136gr = false; 137gp = false; 138g3 = false; 139return; 140} 141catch(e) { 142} 143} 144 145$('.dashboard').click(function() { 146 alert("dashboard"); 147 event.preventDefault(); 148try { 149window.api.save(); 150gd = true; 151gh = false; 152vi = false; 153gr = false; 154gp = false; 155g3 = false; 156return; 157 } catch (e) { 158} 159}); 160 161/*$('#rename').click(function(){ 162 event.preventDefault(); 163try { 164 alert("rename"); 165window.api.save(); 166gr = true; 167gh = false; 168gd = false; 169vi = false; 170gp = false; 171g3 = false; 172return; 173 } catch (e) { 174} 175});*/ 176 177 178$('#productlist').click(function(){ 179 180 try { 181 var productAlias = ''; 182 var items = window.api.state.items.length; 183 var pid = window.api.project.id; 184 var pname = window.api.project.name; 185 pname=encodeURIComponent(pname); 186 if(items == 0) 187 { 188 alert('No Products !') 189 return; 190 } 191 //alert(items); 192 for (var i = 0;i<items;i++) 193 { 194 if(i==items-1) 195 productAlias += window.api.state.items[i].asset.sku; 196 else 197 productAlias += window.api.state.items[i].asset.sku+","; 198 } 199 window.location.href='/floorplanner/showMPCProductsList?pname='+pname+'&pid='+pid+'&productC
199odePost='+productAlias; 200 201 } 202 catch(e) { 203 } 204 205}); 206 207function redirect() { 208 //window.location.href = ACC.config.contextPath +'/cart'; 209 $(".AddToCartModal").css("display","none"); 210} 211 212$('#addtocart').click(function(){ 213 event.preventDefault(); 214 try { 215 window.api.save(); 216 gr = false; 217 gh = false; 218 gd = false; 219 vi = false; 220 gp = false; 221 g3 = false; 222 var alias = ''; 223 var result = ''; 224 var items = window.api.state.items.length; 225 //alert(items); 226 if(items == 0) 227 { 228 alert('No Products !') 229 return; 230 } 231 for (var i = 0;i<items;i++) { 232 if(i==items-1) 233 alias += window.api.state.items[i].asset.sku; 234 else 235 alias += window.api.state.items[i].asset.sku+","; 236 } 237 //alert(alias); 238 $.ajax({ 239 type: "POST", 240 url: ACC.config.contextPath +"/floorplanner/addMPCProductsToCart", 241 data: 'productCodePost='+alias, 242 success: function(msg){ 243 //alert('Products Added to the Cart.'); 244 //modal.style.display = "block"; 245 $("#productAddedMessage").text(msg); 246 $(".AddToCartModal").css("display","block"); 247 setTimeout(redirect, $( "input[name='timeout']" ).val()); 248 } 249 }); 250 return; 251 } 252 catch(e) { 253 } 254 }); 255 256/* 257$('#delete').click(function(){ 258 event.preventDefault(); 259 if (confirm('Are you sure you wish to delete this project? This action cannot be undone!')) { 260 window.location.href='/MyPerfectClassroom/Designer.asp?pid=68791209&action=delete&key='+Math.random(); 261 } 262 return; 263}); 264*/ 265 266//Get the modal 267var modal = document.getElementById("AddToCartModal"); 268 269// Get the button that opens the modal 270//var btn = document.getElementById("myBtn"); 271 272// Get the <span> element that closes the modal 273var span = document.getElementsByClassName("closemessage")[0]; 274 275// When the user clicks the button, open the modal 276/*btn.onclick = function() { 277 AddToCartModal.style.display = "block"; 278}*/ 279 280// When the user clicks on <span> (x), close the modal 281/*span.onclick = function() { 282 //alert("hi"); 283 $(".AddToCartModal").css("display","none"); 284}*/ 285 286// When the user clicks anywhere outside of the modal, close it 287window.onclick = function(event) { 288 /*if (event.target == modal) { 289 $(".modal").css("display","none"); 290 }*/ 291} 292 293$('#AddToCartModalModal').click(function(){ 294$(".AddToCartModal").css("display","none"); 295}); 296 297$('.viewitems').click(function() { 298try { 299window.api.save(); 300vi = true; 301gh = false; 302gd = false; 303gr = false; 304gp = false; 305g3 = false; 306return; 307 } catch (e) { 308} 309return 310var result = ''; 311var alias = ''; 312var items = window.api.state.items.length; 313 314 315for (var i = 0;i<items;i++) { 316var name = window.api.state.items[i].asset.name; // also, .id 317var ap = name.indexOf('Item # ')+7; 318if(ap>=7) { 319alias = name.substring(ap); 320result += alias + ','; 321} 322} 323}); 324 325function loadDoc() { 326 327alert('loading document'); 328var xhttp = new XMLHttpRequest(); 329xhttp.onreadystatechange = function() { 330if (this.readyState == 4 && this.status == 200) { 331alert("Inner HTML" + document.getElementById("action").innerHTML); 332document.getElementById("action").innerHTML = this.responseText; 333alert(this.responseText); 334} 335}; 336xhttp.open("GET", "ajax_info.txt", true); 337xhttp.send(); 338} 339 340function doExport(data) { 341//alert(JSON.stringify(data)); 342} 343 344function doOnSelected(data) { 345doOnSave(data); 346return; 347//document.getElementById('selected').innerHTML = JSON.stringify(data); 348document.getElementById('action').innerHTML = ' '; 349try { 350document.getElementById('selected').innerHTML = data.obj.asset.name; 351document.getElementById('box').innerHTML = data.obj.asset.name; 352document.getElementById('box').style.display = ''; 353} catch(e) { 354document.getElementById('selected').innerHTML = ' '; 355document.getElementById('box').innerHTML = ' '; 356document.getElementById('box').style.display = 'none'; 357} 358} 359 360function doOnUpdated(data) { 361doOnSave(data); 362} 363 364function doOnZoomUpdated(data) { 365} 366 367function doOnExport() { 368try { 369console.log('exported!'); 370 window.api.save(); 371 g3 = true; 372 gp = false; 373 gh = false; 374 vi = false; 375 gd = false; 376 gr = false;
377return false; 378} catch(e) { 379// Call Houston. 380} 381} 382 383function doOnQuit(data) { 384//viewItems(); 385try { 386vi = false; 387gh = false; 388gd = true; 389gr = false; 390gp = false; 391g3 = false; 392window.api.save(); 393return; 394 } catch (e) { 395} 396} 397 398function m(e) { 399var bx = document.getElementById('box'); 400bx.style.left = e.pageX+10; 401bx.style.top = e.pageY+10; 402} 403 404$('#createNewProject').click(function(){ 405 var name = prompt('Please enter a name for your project:',' My Project'); 406 if(name === null){ 407 return false; 408 }else{ 409 name=encodeURIComponent(name); 410 if(name.length>0) { 411 $.ajax({ 412 url: ACC.config.contextPath +'/floorplanner/create-new-project?pname='+name, 413 type: 'POST', 414 success: function(pid){ 415 window.open('/floorplanner/editor?pname='+name+'&pid='+pid); 416 }, 417 error: function(msg){ 418 alert(msg.responseText); 419 } 420 }) 421 } 422 else{ 423 alert("Please enter a name"); 424 } 425}}); 426 427$('#copy-project-btn').click(function(){ 428 var $this = $(this); 429 var email = prompt($this.attr('data-enter-email')); 430 var pid = $this.attr('data-project-id'); 431 if(email === null) 432 { 433 return false; 434 } 435 else 436 { 437 email=encodeURIComponent(email); 438 if(email.length>0) 439 { 440 $.ajax({ 441 url: ACC.config.contextPath +'/floorplanner/copy-project?pid='+pid+'&email='+email, 442 type: 'POST', 443 success: function(msg){ 444 ACC.colorbox.open($this.attr('data-copy-project'),{ 445 html:msg 446 }); 447 } 448 }); 449 } 450 else 451 { 452 alert($this.attr('data-mail-required')); 453 } 454 } 455}); 456 457function selectionChanged(list) { 458 if(list.value>0) { 459 window.location.href='/excelligencestorefront/MyPerfectClassroom/Designer.asp?pid='+list.value; 460 } 461} 462 463function goDelete(pid) { 464 if (confirm('Are you sure you wish to delete this project? This action cannot be undone!')) { 465 $.ajax({ 466 url: ACC.config.contextPath +'/floorplanner/delete-project/'+pid, 467 type: 'DELETE', 468 success: function(){ 469 window.location.href=ACC.config.contextPath +'/floorplanner' 470 }, 471 error:function(){ 472 alert("Project could not be deleted"); 473 } 474 }) 475 } 476 return; 477} 478 479 480function goRename(pid,oldname) { 481 var name = prompt('Please enter a new name',oldname); 482 if(name === null){ 483 return false; 484 }else{ 485 name=encodeURIComponent(name); 486 if(name.length>0) { 487 $.ajax({ 488 url: ACC.config.contextPath +'/floorplanner/rename-project?pid='+pid+'&pname='+name, 489 type: 'PUT', 490 success: function(){ 491 window.location.href=ACC.config.contextPath +'/floorplanner/editor?pid='+pid+'&pname='+name 492 }, 493 error: function(){ 494 alert("Project could not be renamed"); 495 } 496 }) 497 } 498 else{ 499 alert("Please enter a name"); 500 } 501 }} 502 503 $(document).on("click",'a[href*="/home/projects/"]',function(event){ 504 event.preventDefault(); 505 window.location.href=ACC.config.contextPath + '/floorplanner'; 506 }); 507 508
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.