Commit 6878387f authored by Clément Damiens's avatar Clément Damiens

Merge branch 'qa'

parents 84f16370 a6fede3d
......@@ -3501,52 +3501,81 @@ var co = {
urlCtrl.loadByHash(url);
else co.nect();},
open : function (url,type,target) {
title = null;
callback = null;
if(type == "md" || type == "docmd")
{
targetLink = (target) ? "<a href='"+target+"' target='_blank'> <i class='fa fa-external-link'></i> </a>" : "";
title = (type == "docmd") ? "Documentation Communecter "+targetLink : "Markdown";
title = "<h1 class='text-red'>"+title+"</h1>";
callback = function() {
getAjax('', url, function(data){
descHtml = dataHelper.markdownToHtml(data) ;
smallMenu.content(title+descHtml);
}
,"html");
title = "test";
if (type == "githubmd") {
title = "<h1 class='text-red'>Github Markdown</h1>"
let urlChange = url.replace("/blob/", "/")
url = urlChange.replace("https://github.com", "https://raw.githubusercontent.com")
callback = function () {
getAjax('', url, function (data) {
descHtml = dataHelper.markdownToHtml(data);
smallMenu.content(title + descHtml);
}
, "html");
}
}
if (type == "gitlabmd") {
title = "<h1 class='text-red'>Gitlab Markdown</h1>";
var urlInterop = baseUrl+"/interop/gitlab/page?url="+url;
callback = function () {
// $.ajax({
// url: urlInterop,
// type: 'GET',
// success: function(data) { smallMenu.content(data); },
// error: function(data) { alert("nop-->"+data); }
// });
getAjax('', urlInterop, function (data) {
descHtml = dataHelper.convertMardownToHtml(data.content);
smallMenu.content(title + descHtml);
//console.log(data);
}
, "html");
}
}
else if(type == "youtube") {
title = "Youtube";
callback = function() { smallMenu.content('<iframe width="560" height="315" src="'+url+'" frameborder="0" gesture="media" allow="encrypted-media" allowfullscreen></iframe>');}
}
if (type == "codimd") {
// targetLink = (target) ? "<a href='"+target+"' target='_blank'> <i class='fa fa-external-link'></i> </a>" : "";
// title = (type == "docmd") ? "Documentation Communecter "+targetLink : "Markdown";
title = "<h1 class='text-red'>CodiMD</h1>"
let urlChange = url + "/download"
callback = function () {
getAjax('', urlChange, function (data) {
descHtml = dataHelper.markdownToHtml(data);
smallMenu.content(title + descHtml);
}
, "html");
}
}
if (type == "youtube") {
title = "<h1 class='text-red'>Youtube</h1>"
let urlChange = url.replace("/watch?v=", "/embed/")
url = urlChange.split("&", 1)
callback = function () { title + smallMenu.content('<iframe width="560" height="315" src="' + url + '" frameborder="0" gesture="media" allow="encrypted-media" allowfullscreen></iframe>'); }
}
else if(type == "json") {
if (type == "json") {
title = "Json";
callback = function() {
$("#openModal div.modal-content").css("text-align","left");
lazyLoad( baseUrl+"/plugins/jsonview/jquery.jsonview.js",
baseUrl+"/plugins/jsonview/jquery.jsonview.css", function() {
//alert();
getAjax('', url, function(data){
urlT = url.split('/');
title = url+"<br/>"+urlT[8];
smallMenu.content().JSONView(data);
}
,"html");
} );
callback = function () {
$("#openModal div.modal-content").css("text-align", "left");
lazyLoad(baseUrl + "/plugins/jsonview/jquery.jsonview.js",
baseUrl + "/plugins/jsonview/jquery.jsonview.css", function () {
//alert();
getAjax('', url, function (data) {
urlT = url.split('/');
title = url + "<br/>" + urlT[8];
smallMenu.content().JSONView(data);
}
, "html");
});
}
}
if(title){
smallMenu.open(title,null,null,callback);
if (title) {
smallMenu.open(title, null, null, callback);
} else
toastr.error("Type not found!!");},
toastr.error("Type not found!!");
},
},
help : function () {
url = urlCtrl.convertToPath("#default.view.page.links");
......
......@@ -1236,19 +1236,20 @@ var directory = {
}
tip+=trad.Favorites;
str += '<button '+actionFav+' class=\'dirStar star_'+params.type+'_'+params.id+' btn btn-link no-padding margin-right-10 pull-left '+classBtn+'\'' +
' data-id=\''+params.id+'\' data-type=\''+params.type+'\'>'+
' data-id=\''+params.id+'\' data-type=\''+params.type+'\'>'+
'<small>'+tip+'</small>'+
'</button>';
'</button>';
}
if(params.type != 'citoyens')
str += '<button id=\'btn-share-'+params.type+'\' class=\'pull-left btn no-padding btn-link btn-share-panel\''+
' data-ownerlink=\'share\' data-id=\''+params.id+'\' data-type=\''+params.type+'\'>'+
'<small><i class=\'fa fa-retweet\'></i> '+trad['share']+'</small></button> ';
str += '</div>';
return str;
}
if(params.type != 'citoyens')
str += '<button id=\'btn-share-'+params.type+'\' class=\'pull-left btn no-padding btn-link btn-share-panel\''+
' data-ownerlink=\'share\' data-id=\''+params.id+'\' data-type=\''+params.type+'\'>'+
'<small><i class=\'fa fa-retweet\'></i> '+trad['share']+'</small></button> ';
str += '</div>';
return str;
},
//Boutons de partage
......@@ -1291,6 +1292,8 @@ var directory = {
}
return str;
},
......
......@@ -203,6 +203,14 @@ var pageProfil = {
null,
function(){});
},
mediawiki : function() {
mylog.log("pageProfil.views.mediawiki");
//$("#central-container").append(loading);
ajaxPost("#central-container",
baseUrl+"/interop/mediawiki/index",
{id: contextData.id, name: contextData.name, type: contextData.type , for:"index"},
function(){}, "html");
},
bookmarks : function(){
mylog.log("pageProfil.views.bookmarks");
var url = "gallery/index/type/"+typeItem+"/id/"+contextData.id+"/docType/bookmark";
......
dynForm = {
jsonSchema : {
title : tradDynForm["addbookmark"],
icon : "bookmark",
type : "object",
onLoads : {
sub : function(){
dyFInputs.setSub("bg-url");
jsonSchema: {
title: tradDynForm["addbookmark"],
icon: "bookmark",
type: "object",
onLoads: {
sub: function () {
dyFInputs.setSub("bg-url");
if(typeof contextData != "undefined" && contextData != null){
if (typeof contextData != "undefined" && contextData != null) {
$("#parentId").val(contextData.id);
$("#parentType").val(contextData.type);
}
},
},
afterSave : function(){
$("#parentId").val(contextData.id);
$("#parentType").val(contextData.type);
}
},
},
afterSave: function () {
dyFObj.closeForm();
if(location.hash.indexOf("view.library")>0){
buildNewBreadcrum("bookmarks");
getViewGallery(1,"","bookmarks");
}else
urlCtrl.loadByHash( location.hash );
},
properties : {
// url : dyFInputs.bookmarkUrl(tradDynForm["linkUrl"], tradDynForm["linkUrl"], { required : true, url : true }),
info : {
inputType : "custom",
html:"<p><i class='fa fa-info-circle'></i> "+tradDynForm["infocreatebookmark"]+".</p>",
},
url : dyFInputs.bookmarkUrl(tradDynForm["linkUrl"], tradDynForm["linkUrl"], { required : true, url : true }),
name : dyFInputs.inputText(tradDynForm["titleurl"], tradDynForm["titleurl"], { required : true }),
tags :dyFInputs.tags(),
// Ancien code
// category : dyFInputs.inputText({required : true}),
category : dyFInputs.inputText("Category", "Category", {required : true}),
description : dyFInputs.textarea(tradDynForm["description"], "..."),
index : dyFInputs.inputHidden(),
parentId : dyFInputs.inputHidden(null, { required : true }),
parentType : dyFInputs.inputHidden(null, { required : true })
}
if (location.hash.indexOf("view.library") > 0) {
buildNewBreadcrum("bookmarks");
getViewGallery(1, "", "bookmarks");
} else
urlCtrl.loadByHash(location.hash);
},
properties: {
info: {
inputType: "custom",
html: "<p><i class='fa fa-info-circle'></i> " + tradDynForm["infocreatebookmark"] + ".</p>",
},
url: dyFInputs.bookmarkUrl(tradDynForm["linkUrl"], tradDynForm["linkUrl"], { required: true, url: true }),
name: dyFInputs.inputText(tradDynForm["titleurl"], tradDynForm["titleurl"], { required: true }),
tags: dyFInputs.tags(),
category : dyFInputs.inputSelect("Type",
"Type de document?",
{ link: "Lien", youtube: "Video Youtube", githubmd: "Github md", codimd: "CodiMD", gitlabmd: "Gitlab md" },
{ required : true } ),
description: dyFInputs.textarea(tradDynForm["description"], "..."),
index: dyFInputs.inputHidden(),
parentId: dyFInputs.inputHidden(null, { required: true }),
parentType: dyFInputs.inputHidden(null, { required: true })
}
}
};
\ No newline at end of file
......@@ -79,10 +79,14 @@ function initGrid(albums, docs, edit){
tagsFilter(edit);
$("#listTags").show();
$("#Grid").removeClass("col-xs-12").addClass("col-xs-10");
$(".link-open-bookmark").off().on("click", function() {
co.ctrl.open($(this).data("link"), $(this).data("category"))
});
}else{
$("#listTags").hide();
$("#Grid").removeClass("col-xs-10").addClass("col-xs-12");
}
bindButtonGalleryEvent();
if(typeof folder != "undefined" &&
......@@ -247,46 +251,41 @@ function getViewUrl(id,data, edit){
}
var html = '<li class="content_file '+id+' col-sm-12 col-md-12 col-xs-12 no-padding '+elTagsList+'" data-cat="1" id="'+id+'">'+
' <div class="portfolio-item">';
if(edit){
' <div class="portfolio-item">';
if(edit){
html += '<div class="checkbox-content pull-left">'+
'<label>'+
'<label>'+
'<input type="checkbox" class="checkPhoto checkbox-info" data-value="'+id+'">'+
'<span class="cr"><i class="cr-icon fa fa-check"></i></span>'+
'</label>'+
'</div>';
}
}
html+='<div class="content-info col-md-10 col-sm-10 col-sx-10 padding-5">'+
buildLink(data)+
html+='<div class="content-info col-md-10 col-sm-10 col-sx-10 padding-5">'+
buildLink(data)+
'</div>'+
'<div class="tools tools-right pull-right padding-5">';
if(edit){
html+= ' <a href="javascript:;" onclick="updateBookmark(\''+id+'\')">' +
if(edit){
html+= ' <a href="javascript:;" onclick="updateBookmark(\''+id+'\')">' +
' <i class="fa fa-pencil"></i>'+
' </a>';
}
html+='</div>';
' </a>';
}
html+='</div>';
html+='<div class="contentDescription col-md-12 col-sm-12 col-xs-12">'+
'<span>'+description+'</span>'+
'</div>'+
'<div class="contentTags col-md-12 col-sm-12 col-xs-12">'+
htmlTags+
'</div>'+
'<span>'+description+'</span>'+
'</div>'+
' </div>' +
'</li>' ;
return html;
'<div class="contentTags col-md-12 col-sm-12 col-xs-12">'+
htmlTags+
'</div>'+
'</div>'+
' </div>' +
'</li>' ;
return html;
}
function buildLink(data) {
link = '<a href="'+data.url+'" target="_blank">'+data.name+'</a>';
if( navigator.onLine ){
if( data.url.indexOf(".md")>= 0 )
link = '<a href="javascript:;" onclick="co.ctrl.open(\''+data.url+'\',\'md\')"><span>'+data.name+' </span></a>';
/*else if(getVidId(data.url) != null ){
data.url = YouTubeUrlNormalize(data.url);
link = '<a href="javascript:;" onclick="co.ctrl.open(\''+data.url+'\',\'youtube\')"><span>'+data.name+' </span></a>';
}*/
function buildLink(data) {
var link = '<a href="'+data.url+'" target="_blank">'+data.name+'</a>';
if (data.category != "link") {
link = '<a class="link-open-bookmark" data-category="'+data.category+'" data-link="'+data.url+'">'+data.name+'</a>';
}
return link;
}
......
......@@ -5,7 +5,7 @@
*/
class CommunecterController extends Controller
{
public $version = "v0.2.8.9";
public $version = "v0.2.8.10";
public $versionDate = "29/07/2016 19:12";
public $title = "Communectez";
public $subTitle = "se connecter à sa commune";
......
......@@ -215,7 +215,7 @@ class AppController extends CommunecterController {
"page" => @$page,
"dir"=>@$dir,
);
echo $this->renderPartial("../docs/index", $params, true);
echo $this->renderPartial("co2.views.docs.index", $params, true);
}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment