-
Notifications
You must be signed in to change notification settings - Fork 0
/
site.min.js
2 lines (2 loc) · 2.12 KB
/
site.min.js
1
2
/*! mywebsite 2016-08-21 */
function TypeName(a){console.log(a),this.Name=a,this.TypeOut()}function KonamiComputer(){var a=[],b="38,38,40,40,37,39,37,39,66,65";$(document).keydown(function(c){a.push(c.keyCode),a.toString().indexOf(b)>=0&&($(document).unbind("keydown",arguments.callee),window.location="http://levelgame.net")})}function MissYou(a){$(function(){var b=a;$(window).blur(function(){b=$("title").text(),$("title").text(":( come back")}),$(window).focus(function(){$("title").text(b)})})}function parse_json(a){try{var b=$.parseJSON(a)}catch(c){throw"JSON parse error: "+a}return b}function ProjectDisplay(a){this.initialize(a),console.log("id",a)}!function(a){a(document).ready(function(){a("#cssmenu").prepend('<div id="menu-button">Menu</div>'),a("#cssmenu #menu-button").on("click",function(){var b=a(this).next("ul");b.hasClass("open")?b.removeClass("open"):b.addClass("open")})})}(jQuery),TypeName.prototype.TypeOut=function(){$(function(){$(".Typed").typed({strings:["Programmer","Artist","Puzzle Solver"],typeSpeed:100,backDelay:800,backSpeed:50,loop:!0})})},ProjectDisplay.prototype.initialize=function(a){var b=this,c=11;0!=a&&(c=parseInt(a)-1);var d=0;11!=a&&(d=parseInt(a)+1);var e=$(".previous");console.log("button previous",e),b.installListener(e,c);var f=$(".next");console.log("button next",f),console.log("idplus",d),b.installListener(f,d)},ProjectDisplay.prototype.installListener=function(a,b){var c=this;console.log("listernerid",b),a.click(function(a){a.preventDefault(),$.ajax({url:"page-post.php",data:{id:b,ajax:!0},method:"POST",success:function(a){console.log("close");var d=parse_json(a);console.log(d),console.log(d.ok),console.log("Title"),console.log(d.Title),d.ok&&c.update(d.NewProject,b,d.Source,d.Title)},error:function(a,b,d){c.message("<p>Error: "+d+"</p>")}})})},ProjectDisplay.prototype.update=function(a,b,c,d){var e=this;console.log("NewProject:"),console.log(a),$(".jumbotron").slideUp(500,"swing",function(){$(".jumbotron").html(a),$(".alert").html(c),$("title").html(d),e.initialize(b)}).delay(500).slideDown(500,"swing")},ProjectDisplay.prototype.message=function(a){$("jumbotron").fadeOut(1e3),$("jumbotron").html(a)};