diff --git a/Lib/Portoa.Lucene.dll b/Lib/Portoa.Lucene.dll
index 9e2f882..da4f5ad 100644
Binary files a/Lib/Portoa.Lucene.dll and b/Lib/Portoa.Lucene.dll differ
diff --git a/Lib/Portoa.Web.dll b/Lib/Portoa.Web.dll
index f7bb451..f04b3ed 100644
Binary files a/Lib/Portoa.Web.dll and b/Lib/Portoa.Web.dll differ
diff --git a/Lib/Portoa.dll b/Lib/Portoa.dll
index f39757a..f3cdac7 100644
Binary files a/Lib/Portoa.dll and b/Lib/Portoa.dll differ
diff --git a/Lib/Portoa.xml b/Lib/Portoa.xml
index 939dd6b..a971ae3 100644
--- a/Lib/Portoa.xml
+++ b/Lib/Portoa.xml
@@ -713,6 +713,12 @@
The object that needs its index updated
+
+
+ Deletes the index for the specified
+
+ The object that needs its index deleted
+
Adds an index builder to the collection
@@ -755,6 +761,12 @@
The entity that needs its index updated
+
+
+ Deletes the index for the specified
+
+ The entity that needs its index deleted
+
Determines if this object should be logged
diff --git a/Src/VideoGameQuotes.Web/media/css/vgquotes.css b/Src/VideoGameQuotes.Web/media/css/vgquotes.css
index 61fcc26..7a3c7d8 100644
--- a/Src/VideoGameQuotes.Web/media/css/vgquotes.css
+++ b/Src/VideoGameQuotes.Web/media/css/vgquotes.css
@@ -96,7 +96,7 @@ dd {
body {
background-color: #EEEEEE;
color: #000000;
- font-family: Calibri, Corbel, Helvetica, Arial;
+ font-family: Calibri, Corbel, Arial;
font-size: 1em;
height: 100%;
}
@@ -511,7 +511,7 @@ a.external {
.quote-links {
float: right;
text-align: right;
- width: 100px;
+ width: 125px;
}
.flag-dialog {
diff --git a/Src/VideoGameQuotes.Web/media/js/quoteform.compressed.js b/Src/VideoGameQuotes.Web/media/js/quoteform.compressed.js
index a17db6e..43eeea7 100644
--- a/Src/VideoGameQuotes.Web/media/js/quoteform.compressed.js
+++ b/Src/VideoGameQuotes.Web/media/js/quoteform.compressed.js
@@ -1 +1 @@
-(function(g,e,i){var d=function(k){return function(){g("#create-"+k+"-form").find("input[type='text']").val("").end().find("input[type='checkbox']").removeAttr("checked").end().find("> .edit-mode").val(0).end().find("> fieldset > legend").text("Create new "+k).end().clearModelErrors().toggle();g("#"+k+"-select").toggle();return false}};var a=function(n,p,k,q,o){var m=n.find("tr:last");if(m.find("td").length===o){m=g(" ");n.append(m)}var l=g(" ").append(g(" ").attr({type:"checkbox",name:p,value:k,id:p+"_"+k,checked:"checked"})).append(g(" ").attr("for",p+"_"+k).text(q));m.append(l);n.append(m)};var f=function(){g("#create-system-link, #create-system-cancel").click(d("system"));g("#create-system-submit").click(function(){var k=false;return function(){if(k){return false}k=true;var l=g("#create-system-form");var n=g(this).find(".submit-icon");var m={SystemName:g("#SystemName").val(),SystemAbbreviation:g("#SystemAbbreviation").val(),SystemReleaseDate:g("#SystemReleaseDate").val(),SystemIcon:g("#SystemIcon").val()};var p="/system/create";var o=l.find("> .edit-mode").val();if(o>0){p="/system/edit";m.SystemId=o}g.ajax(p,{type:"POST",data:m,beforeSend:function(){l.clearModelErrors();n.toggleClass("submit-icon loading-icon")},success:function(q,r,s){if(q.Error!==null){l.applyModelErrors(q.Error,q.Data);return}if(o<=0){a(g("#system-checkbox-table"),"SystemIds",q.Data.Id,q.Data.Abbreviation,6)}else{g("#system-checkbox-table").find("input[value='"+q.Data.Id+"'] + label").text(q.Data.Abbreviation)}d("system")()},complete:function(){k=false;n.toggleClass("submit-icon loading-icon")}});return false}}());g(".edit-system-link").click(function(){var l=g(this);l.toggleClass("edit-icon loading-icon");var k=l.siblings("input[name='SystemIds']").val();g.vgquotes.getResourceById("system",k,function(m){l.toggleClass("edit-icon loading-icon");if(m===null){alert("Unable to fetch system "+k);return}d("system")();g("#create-system-form > .edit-mode").val(k);g("#create-system-form > fieldset > legend").text("Edit System");g("#SystemName").val(m.Name);g("#SystemAbbreviation").val(m.Abbreviation);g("#SystemReleaseDate").val(g.vgquotes.parseAndFormatDate(m.ReleaseDate));g("#SystemIcon").val(m.Icon)});return false});g(".delete-system-link").click(function(){var l=g(this);l.toggleClass("delete-icon loading-icon");var k=l.siblings("input[name='SystemIds']").val();g.ajax("/system/delete",{type:"POST",data:{id:k},success:function(m,n,o){if(m.Error!==null){alert(m.Error);return}l.parent().empty()},complete:function(){l.toggleClass("delete-icon loading-icon")}});return false})};var h=function(){g("#create-game-link, #create-game-cancel").click(d("game"));g("#create-game-submit").click(function(){var k=false;return function(){if(k){return false}k=true;var l=[],q=[],m=[],p={GameName:g("#GameName").val(),GameWebsite:g("#GameWebsite").val(),GameIcon:g("#GameIcon").val()};g("input:checked[name='GameRegions']").each(function(u,t){if(typeof(p.GameRegions)==="undefined"){p.GameRegions=[]}p.GameRegions.push(t.value)});g("input:checked[name='SystemIds']").each(function(u,t){if(typeof(p.SystemIds)==="undefined"){p.SystemIds=[]}p.SystemIds.push(t.value)});g("input:checked[name='PublisherIds']").each(function(u,t){if(typeof(p.PublisherIds)==="undefined"){p.PublisherIds=[]}p.PublisherIds.push(t.value)});var s=g("#create-game-form");var r=g(this).find(".submit-icon");var o="/game/create";var n=g("#create-game-form > .edit-mode").val()==1;if(n){o="/game/edit";p.GameId=g("#GameId").val()}g.ajax(o,{type:"POST",data:p,traditional:true,beforeSend:function(){s.clearModelErrors();r.toggleClass("submit-icon loading-icon")},success:function(t,u,v){if(t.Error!==null){s.applyModelErrors(t.Error,t.Data);return}if(!n){g("#GameId").append(g(" ").attr({value:t.Data.Id}).text(t.Data.Name)).val(t.Data.Id)}else{g("#GameId option[value='"+t.Data.Id+"']").text(t.Data.Name)}d("game")()},complete:function(){k=false;r.toggleClass("submit-icon loading-icon")}});return false}}());g("#edit-game-link").click(function(){g("#edit-game-link").toggleClass("edit-icon loading-icon");var k=g("#GameId").val();g.vgquotes.getResourceById("game",k,function(l){g("#edit-game-link").toggleClass("edit-icon loading-icon");if(l===null){alert("Unable to fetch game "+k);return}d("game")();g("#create-game-form > .edit-mode").val(1);g("#create-game-form > fieldset > legend").text("Edit Game");g("#GameName").val(l.Name);g("#GameWebsite").val(l.Website);g("#GameIcon").val(l.Icon);g.each(l.Regions,function(){g("input[name='GameRegions'][value='"+this+"']").attr("checked","checked")});g.each(l.Systems,function(){g("input[name='SystemIds'][value='"+this.Id+"']").attr("checked","checked")});g.each(l.Publishers,function(){g("input[name='PublisherIds'][value='"+this.Id+"']").attr("checked","checked")})});return false});g("#delete-game-link").click(function(){var l=g(this);var k=g("#GameId").val();g.ajax("/game/delete",{type:"POST",data:{id:k},beforeSend:function(){l.toggleClass("delete-icon loading-icon")},success:function(m,n,o){if(m.Error!==null){alert(m.Error);return}g("#GameId option[value='"+k+"']").remove()},complete:function(){l.toggleClass("delete-icon loading-icon")}});return false})};var b=function(){g("#create-publisher-link, #create-publisher-cancel").click(d("publisher"));g("#create-publisher-submit").click(function(){var k=false;return function(){if(k){return false}k=true;var l=g("#create-publisher-form");var n=g(this).find(".submit-icon");var m={PublisherName:g("#PublisherName").val(),PublisherWebsite:g("#PublisherWebsite").val()};var o="/publisher/create";var p=l.find("> .edit-mode").val();if(p>0){o="/publisher/edit";m.PublisherId=p}g.ajax(o,{type:"POST",data:m,beforeSend:function(){l.clearModelErrors();n.toggleClass("submit-icon loading-icon")},success:function(q,r,s){if(q.Error!==null){l.applyModelErrors(q.Error,q.Data);return}if(p<=0){a(g("#publisher-checkbox-table"),"PublisherIds",q.Data.Id,q.Data.Name,4)}else{g("#publisher-checkbox-table").find("input[value='"+q.Data.Id+"'] + label").text(q.Data.Name)}d("publisher")()},complete:function(){k=false;n.toggleClass("submit-icon loading-icon")}});return false}}());g(".edit-publisher-link").click(function(){var l=g(this);l.toggleClass("edit-icon loading-icon");var k=l.siblings("input[name='PublisherIds']").val();g.vgquotes.getResourceById("publisher",k,function(m){l.toggleClass("edit-icon loading-icon");if(m===null){alert("Unable to fetch publisher "+k);return}d("publisher")();g("#create-publisher-form > .edit-mode").val(k);g("#create-publisher-form > fieldset > legend").text("Edit Publisher");g("#PublisherName").val(m.Name);g("#PublisherWebsite").val(m.Website)});return false});g(".delete-publisher-link").click(function(){var k=g(this);k.toggleClass("delete-icon loading-icon");g.ajax("/publisher/delete",{type:"POST",data:{id:k.siblings("input[name='PublisherIds']").val()},success:function(l,m,n){if(l.Error!==null){alert(l.Error);return}k.parent().empty()},complete:function(){k.toggleClass("delete-icon loading-icon")}});return false})};var c=function(){var k=function(s){if(g("#new-category-name").length>0){return}var p=function(){var v=g(this);var t="/category/create";var u={CategoryName:o.val()};if(s!==i){t="/category/edit";u.CategoryId=s}g.ajax(t,{data:u,type:"POST",beforeSend:function(){v.toggleClass("submit-icon loading-icon")},success:function(w,y,z){if(w.Error!==null){alert(w.Error);return}if(s===i){var A=g(" ").css("display","none").attr({id:"category_"+w.Data.Id,type:"checkbox",name:"CategoryIds",checked:"checked"}).val(w.Data.Id);var x=g(" ").css("display","none").attr("for",A.attr("id")).text(w.Data.Name);g("#new-category-name").before(A).before(x)}else{g("#new-category-name").siblings("label").text(w.Data.Name)}},complete:function(){v.toggleClass("submit-icon loading-icon");var w=g("#new-category-name").parent();w.children(":visible").remove().end().children().show()}});return false};var r=g("#category-checkbox-table"),q;var n=g(" ").attr({href:"#",title:"submit"}).addClass("submit-icon").click(p);var m=g(" ").attr({href:"#",title:"cancel"}).addClass("cancel-icon");var o=g(" ").attr({id:"new-category-name",type:"text"}).bind("keyup",function(t){console.log(t.which);if(t.which===13){t.preventDefault();p.call(g(this).siblings(".submit-icon").get(0))}else{if(t.which===27){t.preventDefault();m.click()}}});if(s!==i){q=r.find("input[value='"+s+"']").parent();q.children().hide();m.click(function(){o.remove();n.remove();m.remove();q.children().show();return false});o.val(q.find("label").text());q.append(o).append(n).append(m);o.select();return}var l=r.find("tr:last");q=g(" ");if(l.find("td").length===5){l=g(" ");r.append(l)}l.append(q);o.val("Category name");m.click(function(){q.remove();return false});q.append(o).append(n).append(m);o.select()};g("#create-category-link").click(function(){k.call(this);return false});g(".edit-category-link").click(function(){var l=g(this).siblings("input[name='CategoryIds']").val();k.call(this,l);return false});g(".delete-category-link").click(function(){var m=g(this).siblings("input[name='CategoryIds']").val();var l=g(this);g.ajax("/category/delete",{type:"POST",data:{id:m},beforeSend:function(){l.toggleClass("delete-icon loading-icon")},success:function(n){if(n.Error!==null){alert(n.Error);return}g("#category-checkbox-table").find("input[value='"+m+"']").parent().empty()},complete:function(){l.toggleClass("delete-icon loading-icon")}});return false})};var j=function(){g(".dismiss-flag-link").click(function(){var l=g(this);var k=l.parents(".quote-flag");var n=k.find(".quote-flag-id").val();var m=g("#quote-id").val();g.ajax("/dismiss-flag",{type:"POST",data:{quoteId:m,flagId:n},success:function(o,p,q){if(o.Error!==null){alert(o.Error);return}k.remove()}});return false})};(function(){g(document).ready(function(){h();f();b();c();j()})}())}(jQuery,window));
\ No newline at end of file
+(function(g,e,i){var d=function(k){return function(){g("#create-"+k+"-form").find("input[type='text']").val("").end().find("input[type='checkbox']").removeAttr("checked").end().find("> .edit-mode").val(0).end().find("> fieldset > legend").text("Create new "+k).end().clearModelErrors().toggle();g("#"+k+"-select").toggle();return false}};var a=function(n,p,k,q,o){var m=n.find("tr:last");if(m.find("td").length===o){m=g(" ");n.append(m)}var l=g(" ").append(g(" ").attr({type:"checkbox",name:p,value:k,id:p+"_"+k,checked:"checked"})).append(g(" ").attr("for",p+"_"+k).text(q));m.append(l);n.append(m)};var f=function(){g("#create-system-link, #create-system-cancel").click(d("system"));g("#create-system-submit").click(function(){var k=false;return function(){if(k){return false}k=true;var l=g("#create-system-form");var n=g(this).find(".submit-icon");var m={SystemName:g("#SystemName").val(),SystemAbbreviation:g("#SystemAbbreviation").val(),SystemReleaseDate:g("#SystemReleaseDate").val(),SystemIcon:g("#SystemIcon").val()};var p="/system/create";var o=l.find("> .edit-mode").val();if(o>0){p="/system/edit";m.SystemId=o}g.ajax(p,{type:"POST",data:m,beforeSend:function(){l.clearModelErrors();n.toggleClass("submit-icon loading-icon")},success:function(q,r,s){if(q.Error!==null){l.applyModelErrors(q.Error,q.Data);return}if(o<=0){a(g("#system-checkbox-table"),"SystemIds",q.Data.Id,q.Data.Abbreviation,6)}else{g("#system-checkbox-table").find("input[value='"+q.Data.Id+"'] + label").text(q.Data.Abbreviation)}d("system")()},complete:function(){k=false;n.toggleClass("submit-icon loading-icon")}});return false}}());g(".edit-system-link").click(function(){var l=g(this);l.toggleClass("edit-icon loading-icon");var k=l.siblings("input[name='SystemIds']").val();g.vgquotes.getResourceById("system",k,function(m){l.toggleClass("edit-icon loading-icon");if(m===null){alert("Unable to fetch system "+k);return}d("system")();g("#create-system-form > .edit-mode").val(k);g("#create-system-form > fieldset > legend").text("Edit System");g("#SystemName").val(m.Name);g("#SystemAbbreviation").val(m.Abbreviation);g("#SystemReleaseDate").val(g.vgquotes.parseAndFormatDate(m.ReleaseDate));g("#SystemIcon").val(m.Icon)});return false});g(".delete-system-link").click(function(){var l=g(this);l.toggleClass("delete-icon loading-icon");var k=l.siblings("input[name='SystemIds']").val();g.ajax("/system/delete",{type:"POST",data:{id:k},success:function(m,n,o){if(m.Error!==null){alert(m.Error);return}l.parent().empty()},complete:function(){l.toggleClass("delete-icon loading-icon")}});return false})};var h=function(){g("#create-game-link, #create-game-cancel").click(d("game"));g("#create-game-submit").click(function(){var k=false;return function(){if(k){return false}k=true;var l=[],q=[],m=[],p={GameName:g("#GameName").val(),GameWebsite:g("#GameWebsite").val(),GameIcon:g("#GameIcon").val()};g("input:checked[name='GameRegions']").each(function(u,t){if(typeof(p.GameRegions)==="undefined"){p.GameRegions=[]}p.GameRegions.push(t.value)});g("input:checked[name='SystemIds']").each(function(u,t){if(typeof(p.SystemIds)==="undefined"){p.SystemIds=[]}p.SystemIds.push(t.value)});g("input:checked[name='PublisherIds']").each(function(u,t){if(typeof(p.PublisherIds)==="undefined"){p.PublisherIds=[]}p.PublisherIds.push(t.value)});var s=g("#create-game-form");var r=g(this).find(".submit-icon");var o="/game/create";var n=g("#create-game-form > .edit-mode").val()==1;if(n){o="/game/edit";p.GameId=g("#GameId").val()}g.ajax(o,{type:"POST",data:p,traditional:true,beforeSend:function(){s.clearModelErrors();r.toggleClass("submit-icon loading-icon")},success:function(t,u,v){if(t.Error!==null){s.applyModelErrors(t.Error,t.Data);return}if(!n){g("#GameId").append(g(" ").attr({value:t.Data.Id}).text(t.Data.Name)).val(t.Data.Id)}else{g("#GameId option[value='"+t.Data.Id+"']").text(t.Data.Name)}d("game")()},complete:function(){k=false;r.toggleClass("submit-icon loading-icon")}});return false}}());g("#edit-game-link").click(function(){g("#edit-game-link").toggleClass("edit-icon loading-icon");var k=g("#GameId").val();g.vgquotes.getResourceById("game",k,function(l){g("#edit-game-link").toggleClass("edit-icon loading-icon");if(l===null){alert("Unable to fetch game "+k);return}d("game")();g("#create-game-form > .edit-mode").val(1);g("#create-game-form > fieldset > legend").text("Edit Game");g("#GameName").val(l.Name);g("#GameWebsite").val(l.Website);g("#GameIcon").val(l.Icon);g.each(l.Regions,function(){g("input[name='GameRegions'][value='"+this+"']").attr("checked","checked")});g.each(l.Systems,function(){g("input[name='SystemIds'][value='"+this.Id+"']").attr("checked","checked")});g.each(l.Publishers,function(){g("input[name='PublisherIds'][value='"+this.Id+"']").attr("checked","checked")})});return false});g("#delete-game-link").click(function(){var l=g(this);var k=g("#GameId").val();g.ajax("/game/delete",{type:"POST",data:{id:k},beforeSend:function(){l.toggleClass("delete-icon loading-icon")},success:function(m,n,o){if(m.Error!==null){alert(m.Error);return}g("#GameId option[value='"+k+"']").remove()},complete:function(){l.toggleClass("delete-icon loading-icon")}});return false})};var b=function(){g("#create-publisher-link, #create-publisher-cancel").click(d("publisher"));g("#create-publisher-submit").click(function(){var k=false;return function(){if(k){return false}k=true;var l=g("#create-publisher-form");var n=g(this).find(".submit-icon");var m={PublisherName:g("#PublisherName").val(),PublisherWebsite:g("#PublisherWebsite").val()};var o="/publisher/create";var p=l.find("> .edit-mode").val();if(p>0){o="/publisher/edit";m.PublisherId=p}g.ajax(o,{type:"POST",data:m,beforeSend:function(){l.clearModelErrors();n.toggleClass("submit-icon loading-icon")},success:function(q,r,s){if(q.Error!==null){l.applyModelErrors(q.Error,q.Data);return}if(p<=0){a(g("#publisher-checkbox-table"),"PublisherIds",q.Data.Id,q.Data.Name,4)}else{g("#publisher-checkbox-table").find("input[value='"+q.Data.Id+"'] + label").text(q.Data.Name)}d("publisher")()},complete:function(){k=false;n.toggleClass("submit-icon loading-icon")}});return false}}());g(".edit-publisher-link").click(function(){var l=g(this);l.toggleClass("edit-icon loading-icon");var k=l.siblings("input[name='PublisherIds']").val();g.vgquotes.getResourceById("publisher",k,function(m){l.toggleClass("edit-icon loading-icon");if(m===null){alert("Unable to fetch publisher "+k);return}d("publisher")();g("#create-publisher-form > .edit-mode").val(k);g("#create-publisher-form > fieldset > legend").text("Edit Publisher");g("#PublisherName").val(m.Name);g("#PublisherWebsite").val(m.Website)});return false});g(".delete-publisher-link").click(function(){var k=g(this);k.toggleClass("delete-icon loading-icon");g.ajax("/publisher/delete",{type:"POST",data:{id:k.siblings("input[name='PublisherIds']").val()},success:function(l,m,n){if(l.Error!==null){alert(l.Error);return}k.parent().empty()},complete:function(){k.toggleClass("delete-icon loading-icon")}});return false})};var c=function(){var k=function(s){if(g("#new-category-name").length>0){return}var p=function(){var v=g(this);var t="/category/create";var u={CategoryName:o.val()};if(s!==i){t="/category/edit";u.CategoryId=s}g.ajax(t,{data:u,type:"POST",beforeSend:function(){v.toggleClass("submit-icon loading-icon")},success:function(w,y,z){if(w.Error!==null){alert(w.Error);return}if(s===i){var A=g(" ").css("display","none").attr({id:"category_"+w.Data.Id,type:"checkbox",name:"CategoryIds",checked:"checked"}).val(w.Data.Id);var x=g(" ").css("display","none").attr("for",A.attr("id")).text(w.Data.Name);g("#new-category-name").before(A).before(x)}else{g("#new-category-name").siblings("label").text(w.Data.Name)}},complete:function(){v.toggleClass("submit-icon loading-icon");var w=g("#new-category-name").parent();w.children(":visible").remove().end().children().show()}});return false};var r=g("#category-checkbox-table"),q;var n=g(" ").attr({href:"#",title:"submit"}).addClass("submit-icon").click(p);var m=g(" ").attr({href:"#",title:"cancel"}).addClass("cancel-icon");var o=g(" ").attr({id:"new-category-name",type:"text"}).bind("keyup",function(t){if(t.which===13){t.preventDefault();p.call(g(this).siblings(".submit-icon").get(0))}else{if(t.which===27){t.preventDefault();m.click()}}});if(s!==i){q=r.find("input[value='"+s+"']").parent();q.children().hide();m.click(function(){o.remove();n.remove();m.remove();q.children().show();return false});o.val(q.find("label").text());q.append(o).append(n).append(m);o.select();return}var l=r.find("tr:last");if(l.length===0){l=g(" ");r.append(l)}q=g(" ");if(l.find("td").length===5){l=g(" ");r.append(l)}l.append(q);o.val("Category name");m.click(function(){q.remove();return false});q.append(o).append(n).append(m);o.select()};g("#create-category-link").click(function(){k.call(this);return false});g(".edit-category-link").click(function(){var l=g(this).siblings("input[name='CategoryIds']").val();k.call(this,l);return false});g(".delete-category-link").click(function(){var m=g(this).siblings("input[name='CategoryIds']").val();var l=g(this);g.ajax("/category/delete",{type:"POST",data:{id:m},beforeSend:function(){l.toggleClass("delete-icon loading-icon")},success:function(n){if(n.Error!==null){alert(n.Error);return}g("#category-checkbox-table").find("input[value='"+m+"']").parent().empty()},complete:function(){l.toggleClass("delete-icon loading-icon")}});return false})};var j=function(){g(".dismiss-flag-link").click(function(){var l=g(this);var k=l.parents(".quote-flag");var n=k.find(".quote-flag-id").val();var m=g("#quote-id").val();g.ajax("/dismiss-flag",{type:"POST",data:{quoteId:m,flagId:n},success:function(o,p,q){if(o.Error!==null){alert(o.Error);return}k.remove()}});return false})};(function(){g(document).ready(function(){h();f();b();c();j()})}())}(jQuery,window));
\ No newline at end of file
diff --git a/Src/VideoGameQuotes.Web/media/js/quoteform.js b/Src/VideoGameQuotes.Web/media/js/quoteform.js
index b9d0efd..bcc99ee 100644
--- a/Src/VideoGameQuotes.Web/media/js/quoteform.js
+++ b/Src/VideoGameQuotes.Web/media/js/quoteform.js
@@ -428,13 +428,11 @@
var $submit = $(" ").attr({ href: "#", title: "submit" }).addClass("submit-icon").click(submitCategory);
var $cancel = $(" ").attr({ href: "#", title: "cancel" }).addClass("cancel-icon");
var $input = $(" ").attr({ id: "new-category-name", type: "text" }).bind("keyup", function(e) {
- console.log(e.which);
if (e.which === 13) {
e.preventDefault(); //make sure the parent form doesn't get submitted
submitCategory.call($(this).siblings(".submit-icon").get(0)); //make sure to invoke it with the correct context
} else if (e.which === 27) {
e.preventDefault();
- //$cancel.onclick.call($(this).siblings(".cancel-icon").get(0));
$cancel.click();
}
});
@@ -457,6 +455,10 @@
}
var $row = $table.find("tr:last");
+ if ($row.length === 0) {
+ $row = $(" ");
+ $table.append($row);
+ }
$cell = $(" ");
if ($row.find("td").length === 5) {
$row = $(" ");
diff --git a/Src/VideoGameQuotes.Web/media/js/vgquotes.compressed.js b/Src/VideoGameQuotes.Web/media/js/vgquotes.compressed.js
index d42fa93..e2b9ee4 100644
--- a/Src/VideoGameQuotes.Web/media/js/vgquotes.compressed.js
+++ b/Src/VideoGameQuotes.Web/media/js/vgquotes.compressed.js
@@ -1 +1 @@
-(function(b,a){b.cookie=function(m,c,e){if(typeof c!="undefined"){e=e||{};if(c===null){c="";e.expires=-1}var d="";if(e.expires&&(typeof e.expires=="number"||e.expires.toUTCString)){var h;if(typeof e.expires=="number"){h=new Date();h.setTime(h.getTime()+(e.expires*24*60*60*1000))}else{h=e.expires}d="; expires="+h.toUTCString()}var j=e.path?"; path="+(e.path):"";var l=e.domain?"; domain="+(e.domain):"";var o=e.secure?"; secure":"";document.cookie=[m,"=",encodeURIComponent(c),d,j,l,o].join("")}else{var n=null;if(document.cookie&&document.cookie!=""){var k=document.cookie.split(";");for(var f=0;f1){g=a("#"+f)}if(g.length===1){if(g[0].localName==="INPUT"){g.addClass("input-validation-error")}a(" ").addClass("field-validation-error").append(a(" ").addClass("error-icon")).append(a(" ").text(e)).insertAfter(g)}});return this};a.fn.clearModelErrors=function(){this.find(".field-validation-error").remove().end().find(".input-validation-error").removeClass("input-validation-error").end().find(".error-summary").empty().hide();return this}}(jQuery));(function(e,c){var a="jquery.refresh.fragment";var d=function(){var g=c.location.href;var f=g.lastIndexOf("#");if(f>=0){if(f!==g.length-1){e.cookie(a,g.substring(f+1))}g=g.substring(0,f)}c.location.href=g};var b=function(){var f=e.cookie(a);if(f!==null){c.location.href+="#"+f;e.cookie(a,null)}};e(document).ready(b);e.refresh=d}(jQuery,window));(function(e,c,a){e.vgquotes=function(){var h=function(j,i){return function(k){if(typeof(k)==="undefined"||typeof(k.Error)==="undefined"||k.Error!==null){i.call(null,null);return}i.call(null,k.Data.records[0])}};return{parseDate:function(i){return new Date(parseInt(i.substr(6)))},formatDate:function(i){return i.getFullYear()+"-"+(i.getMonth()+1)+"-"+i.getDate()},parseAndFormatDate:function(i){return e.vgquotes.formatDate(e.vgquotes.parseDate(i))},ajaxErrorHandler:function(i){alert("An error occurred ("+i.status+")")},preload:function(i){e.each(i,function(){e(" ")[0].src=this})},loadingGif:"/media/images/loading.gif",getResourceById:function(j,i,k){i=i.toString();e.ajax("/api/"+j+"/"+i,{type:"GET",success:h(j,k),error:h(j,k)})},createDialog:function(i){e("body").append(e("
").attr("id","modal-background")).append(i);i.center()},closeDialog:function(i){e("#modal-background").remove();i.remove()}}}();var b=function(){var h=function(){var i=e.trim(e("#search-query").val());if(i.length>0){c.location="/search/"+i}return false};e(document).ready(function(){e("#search-query").keypress(function(i){if(i.which===13){h()}});e("#search-submit").click(h)})};var g=function(){var h=false;e(".vote-for, .vote-against").live("click",function(){if(h){alert("Please wait for the current vote to process before voting again");return false}h=true;var l=e(this);var n=l.parents(".quote-container");var k=l.hasClass("vote-for")?1:0;var i=n.find("input.quote-id").val();var m=n.find(".quote-score");var j=m.text();e.ajax("/vote",{type:"POST",data:{QuoteId:i,Direction:k},beforeSend:function(){m.empty().append(e(" ").attr({src:e.vgquotes.loadingGif,title:"submitting your vote"+String.fromCharCode(8230)}))},success:function(o,p,q){if(o.Error!==null){c.alert(o.Error);return}j=o.Data.score;m.attr("title","+"+o.Data.upVotes+", -"+o.Data.downVotes);l.remove();if(k===1){if(n.find(".vote-against").length===0){e(" ").addClass("vote-against").attr("title","I hate this quote").text(String.fromCharCode(9660)).appendTo(n.find(".vote-container:last"))}}else{if(n.find(".vote-for").length===0){e(" ").addClass("vote-for").attr("title","I like this quote").text(String.fromCharCode(9650)).appendTo(n.find(".vote-container:first"))}}},complete:function(){h=false;var o=m.find("img");if(o.length){o.remove()}m.text(j)}});return false})};var f=function(){e("a.quote-flag-icon").click(function(){if(e(".flag-dialog").length>0){return false}var p=e(this).parents(".quote-container");var j=p.find("input.quote-id").val();var o=e(" ");var n=[[1,"Inaccurate"],[2,"Duplicate"],[3,"Spam"],[4,"Fake"],[0,"Other"]];for(var h=0;h'+n[h][1]+" ";o.append(e(l))}var m=e("
").addClass("dialog flag-dialog");var k=e(" ").attr({href:"#",title:"submit"}).addClass("button-link").append(e(" ").addClass("submit-icon")).append(e(" ").text("Submit")).click(function(){var i=e(this).find(".submit-icon");i.toggleClass("submit-icon loading-icon");e.ajax("/flag",{type:"POST",data:{QuoteId:j,Comment:m.find("textarea").val(),FlagType:m.find("input[name='flagType']:checked").val()},success:function(r,s,t){if(r.Error!==null){alert(r.Error);return}e.vgquotes.closeDialog(m)},complete:function(){i.toggleClass("submit-icon loading-icon")}});return false});var q=e(" ").attr({href:"#",title:"cancel"}).addClass("button-link").append(e(" ").addClass("cancel-icon")).append(e(" ").text("Cancel")).click(function(){e.vgquotes.closeDialog(m);return false});m.append(e("
").addClass("label").text("Flag as:")).append(e("").append(o)).append(e("
").addClass("label").text("Comment")).append(e("")).append(e("
").addClass("submit-container").append(k).append(q));m.find("#flag-type-0").attr("checked","checked");e.vgquotes.createDialog(m);return false})};var d=function(){var h=function(){var i=e("#login-dialog");if(i.length>0){e.vgquotes.closeDialog(i);return false}var j=e(" ").attr({type:"text",id:"login-username"});var m=e(" ").attr({type:"password",id:"login-password"});var l=e(" ").attr("type","submit").css("display","none");var k=e("").attr({method:"post",action:"/login"}).submit(function(){e.ajax("/login",{type:"POST",data:{username:j.val(),password:m.val()},success:function(n,o,p){if(n.Error!==null){alert(n.Error);return}e.refresh()}});return false});i=e("
").addClass("dialog").attr("id","login-dialog");k.append(j).append(m).append(l);i.append(k);e.vgquotes.createDialog(i);j.focus();return false};e(document).ready(function(){e("#login-link").click(h)})};(function(){d();b();e(document).ready(function(){e.vgquotes.preload([e.vgquotes.loadingGif]);f();g();e("body").ajaxError(function(k,h,j,i){e.vgquotes.ajaxErrorHandler.call(this,h)});e("#search-query").focus();e(document).keyup(function(h){if(h.keyCode===27){e.vgquotes.closeDialog(e(".dialog"))}})})}())}(jQuery,window));
\ No newline at end of file
+(function(b,a){b.cookie=function(m,c,e){if(typeof c!="undefined"){e=e||{};if(c===null){c="";e.expires=-1}var d="";if(e.expires&&(typeof e.expires=="number"||e.expires.toUTCString)){var h;if(typeof e.expires=="number"){h=new Date();h.setTime(h.getTime()+(e.expires*24*60*60*1000))}else{h=e.expires}d="; expires="+h.toUTCString()}var j=e.path?"; path="+(e.path):"";var l=e.domain?"; domain="+(e.domain):"";var o=e.secure?"; secure":"";document.cookie=[m,"=",encodeURIComponent(c),d,j,l,o].join("")}else{var n=null;if(document.cookie&&document.cookie!=""){var k=document.cookie.split(";");for(var f=0;f1){g=a("#"+f)}if(g.length===1){if(g[0].localName==="INPUT"){g.addClass("input-validation-error")}a(" ").addClass("field-validation-error").append(a(" ").addClass("error-icon")).append(a(" ").text(e)).insertAfter(g)}});return this};a.fn.clearModelErrors=function(){this.find(".field-validation-error").remove().end().find(".input-validation-error").removeClass("input-validation-error").end().find(".error-summary").empty().hide();return this}}(jQuery));(function(e,c){var a="jquery.refresh.fragment";var d=function(){var g=c.location.href;var f=g.lastIndexOf("#");if(f>=0){if(f!==g.length-1){e.cookie(a,g.substring(f+1))}g=g.substring(0,f)}c.location.href=g};var b=function(){var f=e.cookie(a);if(f!==null){c.location.href+="#"+f;e.cookie(a,null)}};e(document).ready(b);e.refresh=d}(jQuery,window));(function(f,d,a){f.vgquotes=function(){var i=function(k,j){return function(l){if(typeof(l)==="undefined"||typeof(l.Error)==="undefined"||l.Error!==null){j.call(null,null);return}j.call(null,l.Data.records[0])}};return{parseDate:function(j){return new Date(parseInt(j.substr(6)))},formatDate:function(j){return j.getFullYear()+"-"+(j.getMonth()+1)+"-"+j.getDate()},parseAndFormatDate:function(j){return f.vgquotes.formatDate(f.vgquotes.parseDate(j))},ajaxErrorHandler:function(j){alert("An error occurred ("+j.status+")")},preload:function(j){f.each(j,function(){f(" ")[0].src=this})},loadingGif:"/media/images/loading.gif",getResourceById:function(k,j,l){j=j.toString();f.ajax("/api/"+k+"/"+j,{type:"GET",success:i(k,l),error:i(k,l)})},createDialog:function(j){f("body").append(f("
").attr("id","modal-background")).append(j);j.center()},closeDialog:function(j){f("#modal-background").remove();j.remove()}}}();var b=function(){var i=function(){var j=f.trim(f("#search-query").val());if(j.length>0){d.location="/search/"+j}return false};f(document).ready(function(){f("#search-query").keypress(function(j){if(j.which===13){i()}});f("#search-submit").click(i)})};var h=function(){var i=false;f(".vote-for, .vote-against").live("click",function(){if(i){alert("Please wait for the current vote to process before voting again");return false}i=true;var m=f(this);var o=m.parents(".quote-container");var l=m.hasClass("vote-for")?1:0;var j=o.find("input.quote-id").val();var n=o.find(".quote-score");var k=n.text();f.ajax("/vote",{type:"POST",data:{QuoteId:j,Direction:l},beforeSend:function(){n.empty().append(f(" ").attr({src:f.vgquotes.loadingGif,title:"submitting your vote"+String.fromCharCode(8230)}))},success:function(p,q,r){if(p.Error!==null){d.alert(p.Error);return}k=p.Data.score;n.attr("title","+"+p.Data.upVotes+", -"+p.Data.downVotes);m.remove();if(l===1){if(o.find(".vote-against").length===0){f(" ").addClass("vote-against").attr("title","I hate this quote").text(String.fromCharCode(9660)).appendTo(o.find(".vote-container:last"))}}else{if(o.find(".vote-for").length===0){f(" ").addClass("vote-for").attr("title","I like this quote").text(String.fromCharCode(9650)).appendTo(o.find(".vote-container:first"))}}},complete:function(){i=false;var p=n.find("img");if(p.length){p.remove()}n.text(k)}});return false})};var g=function(){f(".quote-flag-link").click(function(){if(f(".flag-dialog").length>0){return false}var q=f(this).parents(".quote-container");var k=q.find("input.quote-id").val();var p=f(" ");var o=[[1,"Inaccurate"],[2,"Duplicate"],[3,"Spam"],[4,"Fake"],[0,"Other"]];for(var j=0;j'+o[j][1]+" ";p.append(f(m))}var n=f("
").addClass("dialog flag-dialog");var l=f(" ").attr({href:"#",title:"submit"}).addClass("button-link").append(f(" ").addClass("submit-icon")).append(f(" ").text("Submit")).click(function(){var i=f(this).find(".submit-icon");i.toggleClass("submit-icon loading-icon");f.ajax("/flag",{type:"POST",data:{QuoteId:k,Comment:n.find("textarea").val(),FlagType:n.find("input[name='flagType']:checked").val()},success:function(s,t,u){if(s.Error!==null){alert(s.Error);return}f.vgquotes.closeDialog(n)},complete:function(){i.toggleClass("submit-icon loading-icon")}});return false});var r=f(" ").attr({href:"#",title:"cancel"}).addClass("button-link").append(f(" ").addClass("cancel-icon")).append(f(" ").text("Cancel")).click(function(){f.vgquotes.closeDialog(n);return false});n.append(f("
").addClass("label").text("Flag as:")).append(f("").append(p)).append(f("
").addClass("label").text("Comment")).append(f("")).append(f("
").addClass("submit-container").append(l).append(r));n.find("#flag-type-0").attr("checked","checked");f.vgquotes.createDialog(n);return false})};var c=function(){f(".delete-quote-link").click(function(){var i=f(this);var j=i.parents(".quote-container");f.ajax("/quote/delete",{type:"POST",data:{id:j.find(".quote-id").val()},beforeSend:function(){i.toggleClass("delete-icon loading-icon")},success:function(k){if(k.Error!==null){d.alert(k.Error);return}j.remove()},complete:function(){i.toggleClass("delete-icon loading-icon")}});return false})};var e=function(){var i=function(){var j=f("#login-dialog");if(j.length>0){f.vgquotes.closeDialog(j);return false}var k=f(" ").attr({type:"text",id:"login-username"});var n=f(" ").attr({type:"password",id:"login-password"});var m=f(" ").attr("type","submit").css("display","none");var l=f("").attr({method:"post",action:"/login"}).submit(function(){f.ajax("/login",{type:"POST",data:{username:k.val(),password:n.val()},success:function(o,p,q){if(o.Error!==null){alert(o.Error);return}f.refresh()}});return false});j=f("
").addClass("dialog").attr("id","login-dialog");l.append(k).append(n).append(m);j.append(l);f.vgquotes.createDialog(j);k.focus();return false};f(document).ready(function(){f("#login-link").click(i)})};(function(){e();b();f(document).ready(function(){f.vgquotes.preload([f.vgquotes.loadingGif]);g();c();h();f("body").ajaxError(function(l,i,k,j){f.vgquotes.ajaxErrorHandler.call(this,i)});f("#search-query").focus();f(document).keyup(function(i){if(i.keyCode===27){f.vgquotes.closeDialog(f(".dialog"))}})})}())}(jQuery,window));
\ No newline at end of file
diff --git a/Src/VideoGameQuotes.Web/media/js/vgquotes.js b/Src/VideoGameQuotes.Web/media/js/vgquotes.js
index 37d5731..3c3dc14 100644
--- a/Src/VideoGameQuotes.Web/media/js/vgquotes.js
+++ b/Src/VideoGameQuotes.Web/media/js/vgquotes.js
@@ -135,7 +135,7 @@
};
var setupFlagLink = function() {
- $("a.quote-flag-icon").click(function() {
+ $(".quote-flag-link").click(function() {
if ($(".flag-dialog").length > 0) {
return false;
}
@@ -205,6 +205,30 @@
});
};
+ var setupDeleteLink = function() {
+ $(".delete-quote-link").click(function() {
+ var $link = $(this);
+ var $container = $link.parents(".quote-container");
+
+ $.ajax("/quote/delete", {
+ type: "POST",
+ data: { id: $container.find(".quote-id").val() },
+ beforeSend: function() { $link.toggleClass("delete-icon loading-icon"); },
+ success: function(data) {
+ if (data.Error !== null) {
+ window.alert(data.Error);
+ return;
+ }
+
+ $container.remove();
+ },
+ complete: function() { $link.toggleClass("delete-icon loading-icon"); }
+ });
+
+ return false;
+ });
+ };
+
var setupLogin = function() {
var showLoginForm = function() {
var $dialog = $("#login-dialog");
@@ -257,6 +281,7 @@
$(document).ready(function() {
$.vgquotes.preload([$.vgquotes.loadingGif]);
setupFlagLink();
+ setupDeleteLink();
setupVoting();
$("body").ajaxError(function(e, xhr, options, error){