* mdd_styles.css: * LocalizedText.resx: * all.css: * jquery-ui-1.11.4.js: * tabs.css: * menu.css: * core.css: * base.css: * LocalizedText.fr.resx: * theme.css: * slider.css: * button.css: * dialog.css: * spinner.css: * tooltip.css: * jquery-ui-1.11.4.min.js: * sortable.css: * LocalizedText.Designer.cs: * resizable.css: * accordion.css: * draggable.css: * selectmenu.css: * selectable.css: * datepicker.css: * progressbar.css: * LocalizedText.fr.Designer.cs: * autocomplete.css: * ui-icons_888888_256x240.png: * ui-icons_cd0a0a_256x240.png: * ui-icons_454545_256x240.png: * ui-icons_2e83ff_256x240.png: * ui-icons_222222_256x240.png: * ui-bg_flat_0_aaaaaa_40x100.png: * ui-bg_glass_95_fef1ec_1x400.png: * ui-bg_flat_75_ffffff_40x100.png: * ui-bg_glass_55_fbf9ee_1x400.png: * ui-bg_glass_65_ffffff_1x400.png: * ui-bg_glass_75_dadada_1x400.png: * ui-bg_glass_75_e6e6e6_1x400.png: * ui-bg_highlight-soft_75_cccccc_1x100.png: * BlogsController.cs: implements the access control on file upload to blog entries * style.css: nicer appmenu * BlogsController.cs: Enables the input validation at posting blog entries * MarkdownHelper.cs: enables ExtraMode transformation parameter * App.master: Error and message html divisions must exist in the DOM to display Ajax messages and errors * yavsc.js: * yavsc.circles.js: refactoring * Circles.aspx: removes a DOM element that already exists in the mastyer page : the message box * Edit.aspx: submits files for import as Markdown text * Web.config: Disables the local trace * Web.csproj: jQuery.UI addition * packages.config: adds a ref to jQuery.UI Combined
96 lines
2.7 KiB
JavaScript
96 lines
2.7 KiB
JavaScript
|
|
|
|
var errspanid="msg";
|
|
var CirclesApiUrl = apiBaseUrl + "/Circle";
|
|
|
|
|
|
function editNewCircle() {
|
|
if ($('#fncirc').hasClass('hidden')) $('#fncirc').removeClass('hidden')
|
|
$('#lgdnvcirc').html("Creation d'un cercle");
|
|
$('#fncirc').removeClass("dirty");
|
|
$("#title").val( '' );
|
|
$('#btnnewcircle').show();
|
|
$('#btneditcircle').hide();
|
|
}
|
|
|
|
function selectCircle() {
|
|
if ($('#fncirc').hasClass('hidden')) $('#fncirc').removeClass('hidden')
|
|
var id = $(this).attr('cid');
|
|
$('#lgdnvcirc').html("Edition du cercle");
|
|
$('#btnnewcircle').hide();
|
|
$('#btneditcircle').show();
|
|
// get it from the server
|
|
|
|
$.getJSON(CirclesApiUrl+"/Get/"+id, function(json) {
|
|
$("#title").val( json.Title); });
|
|
$('#id').val(id);
|
|
$('#fncirc').removeClass("dirty");
|
|
}
|
|
|
|
function onCircleChanged()
|
|
{ $('#fncirc').addClass("dirty"); }
|
|
|
|
function removeCircle() {
|
|
Yavsc.message(false);
|
|
var id = $(this).attr('cid');
|
|
$.ajax({
|
|
url: CirclesApiUrl+"/Delete/"+id,
|
|
type: "GET",
|
|
success: function (data) {
|
|
// Drops the row
|
|
$("#c_"+id).remove();
|
|
},
|
|
statusCode: {
|
|
400: onAjaxBadInput,
|
|
error: function (xhr, ajaxOptions, thrownError) {
|
|
if (xhr.status!=400)
|
|
Yavsc.message(xhr.status+" : "+xhr.responseText);
|
|
else Yavsc.message(false);
|
|
}}});
|
|
}
|
|
function modifyCircle() {
|
|
Yavsc.message(false);
|
|
var id = $('#id').val();
|
|
var circle = { title: $("#title").val(), id: id} ;
|
|
$.ajax({
|
|
url: CirclesApiUrl+"/Update",
|
|
type: "POST",
|
|
data: circle,
|
|
success: function () {
|
|
$('#c_'+id+' td:first-child').text(circle.title);
|
|
}
|
|
,
|
|
statusCode: {
|
|
400: onAjaxBadInput,
|
|
error: onAjaxError
|
|
}
|
|
});
|
|
}
|
|
|
|
function addCircle()
|
|
{
|
|
Yavsc.message(false);
|
|
var circle = { title: $("#title").val() } ;
|
|
$("#title").text('');
|
|
$.ajax({
|
|
url: CirclesApiUrl+"/Create",
|
|
type: "POST",
|
|
data: circle,
|
|
success: function (id) {
|
|
// Adds a node rendering the new circle
|
|
$('<tr id="c_'+id+'"/>').addClass('selected row')
|
|
.appendTo('#tbcb');
|
|
|
|
$('<td>'+circle.title+'</td>').attr('cid',id).click(selectCircle)
|
|
.appendTo('#c_'+id);
|
|
|
|
$('<input type="button" value="Remove">').addClass("actionlink").attr('cid',id).click(removeCircle).appendTo('<td></td>').appendTo('#c_'+id);
|
|
|
|
},
|
|
statusCode: {
|
|
400: Yavsc.onAjaxBadInput
|
|
},
|
|
error: Yavsc.onAjaxError});
|
|
}
|
|
|
|
|