Skip to content

Commit

Permalink
Widgets of standard theme improved
Browse files Browse the repository at this point in the history
  • Loading branch information
farzindev committed Sep 7, 2016
1 parent 4244b6d commit 785ef5e
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 70 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

131 changes: 65 additions & 66 deletions BlogEngine/BlogEngine.NET/Custom/Themes/Standard/src/js/custom.js
Original file line number Diff line number Diff line change
@@ -1,80 +1,79 @@


$(document).ready(function () {
//
var blogAuthor = $(".blog-author");
if ($.trim(blogAuthor.html()).length) {
$(blogAuthor).show();
}

//
var blogAuthor = $(".blog-author");
if ($.trim(blogAuthor.html()).length) {
$(blogAuthor).show();
}
//
var socialNetwork = $(".social-network li a");
for (i = 0; i < socialNetwork.length; ++i) {
link = socialNetwork[i];

//
var socialNetwork = $(".social-network li a");
for (i = 0; i < socialNetwork.length; ++i) {
link = socialNetwork[i];

if ($(link).attr("href") != "") {
$(link).parent().css("display","inline-block");
if ($(link).attr("href") != "") {
$(link).parent().css("display", "inline-block");
}
}
}

//
var simpleCap = $("label[for=simpleCaptchaValue]").parent();
simpleCap.hide();
$("#commentCaptcha").append(simpleCap.html());
//
var simpleCap = $("label[for=simpleCaptchaValue]").parent();
simpleCap.hide();
$("#commentCaptcha").append(simpleCap.html());

//
var logintext = $(".item-login span").text();
var aLogin = $(".item-login");
aLogin.attr("title", logintext);
var aLoginAttr = aLogin.attr("href");
if (aLoginAttr == "/admin/") {
aLogin.removeClass("item-login");
aLogin.addClass("item-admin");
//
var logintext = $(".item-login span").text();
var aLogin = $(".item-login");
aLogin.attr("title", logintext);
}
var aLoginAttr = aLogin.attr("href");
if (aLoginAttr == "/admin/") {
aLogin.removeClass("item-login");
aLogin.addClass("item-admin");
aLogin.attr("title", logintext);
}

//
$(".widget a:has(img)").addClass("no-border");
//
$(".widget a:has(img)").addClass("no-border");

//
if (location.pathname !== '/') {
$('.blog-nav ul li a[href*="/' + location.pathname.split("/")[1] + '"]').addClass('active');
} else {
$('.blog-nav ul li a[href="/"]').addClass('active');
}
//
if (location.pathname !== '/') {
$('.blog-nav ul li a[href*="/' + location.pathname.split("/")[1] + '"]').addClass('active');
} else {
$('.blog-nav ul li a[href="/"]').addClass('active');
}

//
var postAdminLinks = $(".post-adminlinks a");
if (postAdminLinks.length == 2) {
$(".post-adminlinks a:nth-child(1)").addClass("item-edit");
$(".post-adminlinks a:nth-child(2)").addClass("item-delete");
}
if (postAdminLinks.length == 4) {
$(".post-adminlinks a:nth-child(1)").addClass("hidden");
$(".post-adminlinks a:nth-child(2)").addClass("item-approve");
$(".post-adminlinks a:nth-child(3)").addClass("item-edit");
$(".post-adminlinks a:nth-child(4)").addClass("item-delete");
}
//
var postAdminLinks = $(".post-adminlinks a");
if (postAdminLinks.length == 2) {
$(".post-adminlinks a:nth-child(1)").addClass("item-edit");
$(".post-adminlinks a:nth-child(2)").addClass("item-delete");
}
if (postAdminLinks.length == 4) {
$(".post-adminlinks a:nth-child(1)").addClass("hidden");
$(".post-adminlinks a:nth-child(2)").addClass("item-approve");
$(".post-adminlinks a:nth-child(3)").addClass("item-edit");
$(".post-adminlinks a:nth-child(4)").addClass("item-delete");
}

//
if (!$.trim($('#commentlist').html()).length) {
$("#commentlist").parent().hide();
}
$("#btnSaveAjax").click(function () {
$("#commentlist").parent().show();
});
//
if (!$.trim($('#commentlist').html()).length) {
$("#commentlist").parent().hide();
}
$("#btnSaveAjax").click(function () {
$("#commentlist").parent().show();
});

// support theme
var adminNav = $(".item-admin");
var adminAlert = $(".admin-alerts-true");
var adminName = $(".post-author a").html();

// support theme
var adminNav = $(".item-admin");
var adminAlert = $(".admin-alerts-true");
var adminName = $(".post-author a").html();
console.log(adminName);
var adminAlertHtml = '<div class="support-theme visible-md visible-lg alert alert-info clearfix"><p class="pull-left">Hi ' + adminName + ', You can read <a href="http://francis.bio/notes/blogengine-standard-theme-2016/#customize" target="_blank" rel="nofollow"><b>This Article</b></a> that will help you customize this theme easily.</p><a href="admin/#/custom/themes" class="pull-right visible-lg"><i class="fa fa-times" data-toggle="tooltip" data-placement="left" title="remove from theme options"></i></a></div>';
if (adminNav.length && adminAlert.length && (location.pathname == '/' || location.pathname == '/default.aspx')) {
adminAlert.prepend(adminAlertHtml);
}

console.log(adminName);
var adminAlertHtml = '<div class="support-theme visible-md visible-lg alert alert-info clearfix"><p class="pull-left">Hi ' + adminName + ', You can read <a href="http://francis.bio/notes/blogengine-standard-theme-2016/#customize" target="_blank" rel="nofollow"><b>This Article</b></a> that will help you customize this theme easily.</p><a href="admin/#/custom/themes" class="pull-right visible-lg"><i class="fa fa-times" data-toggle="tooltip" data-placement="left" title="remove from theme options"></i></a></div>';
if (adminNav.length && adminAlert.length && (location.pathname == '/' || location.pathname == '/default.aspx')) {
adminAlert.prepend(adminAlertHtml);
}
//
$(".blog-nav li a, [data-toggle=tooltip]").tooltip();

//
$(".blog-nav li a, [data-toggle=tooltip]").tooltip();
});
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
text-align: center;
color: #fff !important;
display: block;
font-size: 1.5rem;
font-size: 1.75rem;
padding: 3rem 0 1rem;
font-family: $font-family-heading;
outline: none !important;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@
padding-bottom: 1.5rem;
margin-bottom: 1px;
color: #fff;
font-family: $font-family-base;
font-weight: $font-weight-normal;
text-transform: uppercase;
letter-spacing: .125rem;
letter-spacing: $px1;
font-size: 1rem;
line-height: 3.75rem;
padding: 0 1.5rem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
margin: 0;
font-size: 1rem;
vertical-align:middle;
font-weight:$font-weight-normal;
}

p {
Expand Down

0 comments on commit 785ef5e

Please sign in to comment.