Bug & layout fixes

* Index.aspx:
* Title.aspx:
* YavscModel.csproj:
* BlogEntry.cs:
* yavsc.scrollnotif.js:
* AccountController.cs:
* BlogEntryCollection.cs: refactoring

* yavsc.tags.js: Implements a js call
to the tag & untag methods

* PostActions.ascx: a better html structure

* BasePost.cs: refactoring:
allows the "PostActions" user control to use a common base object as
  post reference

* NpgsqlBlogProvider.cs: implements the tag methods on db

* ResultPages.cs: A multi-pages result meta info when one page only

* yavsc.circles.js:
* AccountController.cs: code formatting

* BlogsController.cs: Untag a post

* style.css: yastyle, yet a better one.

* BlogsController.cs: View the Title after edition

* App.master:
* UserPosts.aspx: a nicer html structure

* yavsc.js: Fixes notice & dimiss js

* Login.aspx: refactoring

* Edit.aspx: better html

* UserPost.aspx: A promess to be allowed to tag.

* Web.csproj: Adds yavsc.tags.js and yavsc.scrollnotifs.js to the
  project decription.

* BlogManager.cs: Makes the blog manager expose of the new `UnTag`
  method

* BlogProvider.cs: introduces a method to `untag`

* FindBlogEntryFlags.cs: Find post entry by tag

* LocalizedText.resx:
* LocalizedText.Designer.cs: new translations: - "Tag"
- "Edit"

* LocalizedText.fr.resx:
* LocalizedText.fr.Designer.cs: nouvelles traductions: - "Tag"
- "Edit"

* Profile.cs: a nicer stack trace at buggy usage
This commit is contained in:
Paul Schneider 2015-10-13 22:53:39 +02:00
commit d04a68db01
41 changed files with 894 additions and 270 deletions

View file

@ -48,6 +48,7 @@ function removeCircle() {
else Yavsc.notice(false);
}}});
}
function modifyCircle() {
Yavsc.notice(false);
var id = $('#id').val();

View file

@ -17,10 +17,12 @@ self.showHide = function () {
$(this).html(this.oldhtml);
}
};
self.dimiss = function () {
self.dimiss = function () {
$(this).parent().remove();
}
self.notice = function (msg, msgok) {
};
self.notice = function (msg, msgok) {
if (!msgok) msgok='Ok';
if (msg) {
var note = $('<div class="notification">'+msg+'<br></div>');
@ -40,12 +42,14 @@ self.showHide = function () {
errspan.innerHTML=value.errors.join("<br/>");
});
}
};
self.onAjaxError = function (xhr, ajaxOptions, thrownError) {
if (xhr.status!=400)
Yavsc.notice(xhr.status+" : "+xhr.responseText);
else Yavsc.notice(false);
}
};
return self;
})();

View file

@ -0,0 +1,37 @@
//
// parralax.js
//
// Author:
// Paul Schneider <paul@pschneider.fr>
//
// Copyright (c) 2015 GNU GPL
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
$(document).ready(function(){
var $window = $(window);
$(window).scroll(function() {
var $ns = $('#notifications');
if ($ns.has('*').length>0) {
if ($window.scrollTop()>375) {
$ns.css('position','fixed');
$ns.css('z-index',2);
$ns.css('top',0);
}
else {
$ns.css('position','static');
$ns.css('z-index',1);
}}
});
});

32
web/Scripts/yavsc.tags.js Normal file
View file

@ -0,0 +1,32 @@
var Tags = (function(apiBaseUrl){
var self = {};
self.blogsApiUrl = (apiBaseUrl || '/api') + "/Blogs";
self.tag = function (postid,tagname,callback) {
$.ajax({
url: CirclesApiUrl+"/Tag",
type: "POST",
data: { postid: postid, tag: tagname },
success: function () {
if (callback) callback(postid,tagname);
},
statusCode: {
400: Yavsc.onAjaxBadInput
},
error: Yavsc.onAjaxError});
}
self.untag = function (postid,tagname,callback) {
$.ajax({
url: CirclesApiUrl+"/Untag",
type: "POST",
data: { postid: postid, tag: tagname },
success: function () {
if (callback) callback(postid,tagname);
},
statusCode: {
400: Yavsc.onAjaxBadInput
},
error: Yavsc.onAjaxError});
}
return self;
})();