This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Checks all individual checkboxes | |
$(".checkAreaAll").children("input").click(function () { | |
$(".checkArea").children("input").attr('checked', $(".checkAreaAll").children("input").is(':checked')); | |
}); | |
// unchecks the check all checkbox when one individual checkbox is unchecked | |
$(".checkArea").children("input").click(function () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.checkall').click(function () { | |
$(this).parents('fieldset:eq(0)').find('.check:checkbox').attr('checked', this.checked); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String.prototype.format = function () { | |
var s = this, | |
i = arguments.length; | |
while (i--) { | |
s = s.replace(new RegExp('\\{' + i + '\\}', 'gm'), arguments[i]); | |
} | |
return s; | |
}; | |
//useage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function(){ | |
$('a[href*=#]').click(function() { | |
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') | |
&& location.hostname == this.hostname) { | |
var $target = $(this.hash); | |
$target = $target.length && $target || $('[name=' + this.hash.slice(1) +']'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function ($) { | |
$.dateNet = function (date) { | |
if (date === null || date === undefined) return null; | |
if (/\/Date\([0-9\+]*\)\//.test(date)) | |
return eval('new ' + date.split('/')[1]); | |
return '/Date(' + date.getTime() + ')/'; | |
}; | |
})(jQuery); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function ($) { | |
// HINTS FOR FORM INPUTS PLUG IN | |
$.fn.clearDefault = function () { | |
return this.each(function () { | |
var $this = $(this); | |
var default_value = $this.attr('title'); | |
$this.val(default_value); | |
var id = $this.attr('id'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("a.opaque-links").css("opacity", "0.4"); | |
$("a.opaque-links").hover( | |
function () { | |
$(this).stop(true, true).animate({ opacity: "1" }, 200); | |
}, | |
function () { | |
$(this).animate({ opacity: "0.4" }, 500); | |
} | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public TagMap() | |
{ | |
Table("general_tags"); | |
#region EntityBase | |
//Id(x => x.Id, "tagId").GeneratedBy.HiLo("nhibernate_hilo", "tag_NextHi", "5"); | |
Id(x => x.Id, "tagId").GeneratedBy.Guid(); | |
Map(x => x.IsDeleted, "isDeleted").CustomType(typeof(bool)); | |
#endregion |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace MyCMS.Helpers | |
{ | |
public static class Html | |
{ | |
public static MvcHtmlString DescriptionFor<TModel, TValue>( | |
this HtmlHelper<TModel> self, | |
Expression<Func<TModel, TValue>> expression) | |
{ | |
var metadata = ModelMetadata.FromLambdaExpression(expression, self.ViewData); | |
var description = Localizer.Translate(metadata.Description); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string[] ids = {"2343","2344","2345"}; | |
string idString = String.Join(",",ids); |
OlderNewer