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");
}
}
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>');}
}
else if(type == "json") {
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");
}
}
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>'); }
}
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() {
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){
getAjax('', url, function (data) {
urlT = url.split('/');
title = url+"<br/>"+urlT[8];
title = url + "<br/>" + urlT[8];
smallMenu.content().JSONView(data);
}
,"html");
} );
, "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");
......
......@@ -1245,6 +1245,7 @@ var directory = {
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;
},
......@@ -1294,6 +1295,8 @@ var directory = {
// ********************************
// CALCULATE NEXT PREVIOUS
// ********************************
......
......@@ -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(){
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);
......@@ -15,30 +15,30 @@ dynForm = {
}
},
},
afterSave : function(){
afterSave: function () {
dyFObj.closeForm();
if(location.hash.indexOf("view.library")>0){
if (location.hash.indexOf("view.library") > 0) {
buildNewBreadcrum("bookmarks");
getViewGallery(1,"","bookmarks");
}else
urlCtrl.loadByHash( location.hash );
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>",
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(),
// 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 })
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" &&
......@@ -279,14 +283,9 @@ function getViewUrl(id,data, edit){
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>';
}*/
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.
<?php
$cssJS = array(
'/plugins/jQuery-Knob/js/jquery.knob.js',
'/plugins/jQuery-Smart-Wizard/js/jquery.smartWizard.js',
//'/plugins/jQuery-Smart-Wizard/styles/smart_wizard.css',
// SHOWDOWN
'/plugins/showdown/showdown.min.js',
// MARKDOWN
'/plugins/to-markdown/to-markdown.js'
);
HtmlHelper::registerCssAndScriptsFiles($cssJS, Yii::app()->request->baseUrl);
$cssJS = array('/js/docs/docs.js');
HtmlHelper::registerCssAndScriptsFiles($cssJS, Yii::app()->getModule( Yii::app()->params["module"]["parent"] )->getAssetsUrl());
?>
<?php
if(@$this->costum && @$this->costum["docTpl"]){
$this->renderPartial( $this->costum["docTpl"] ,true);
} else { ?>
<style type="text/css">
#docs-main-container{
position: absolute;
bottom: 0;
top: 0px;
left: 0;
right: 0;
z-index: 1000000
}
#menu-left{
position: fixed;
z-index: 100000;
bottom: 0;
top: 60px;
left: 0;
padding: 0;
overflow-y: scroll;
background-color: white;
}
#header-doc{
position: fixed;
z-index: 100000;
top: 0px;
left: 0px;
height: 60px;
right: 0px;
padding-top: 10px;
background-color: white;
}
#header-doc h2{
float: left;
color: #354C57;
font-size: 20px;
font-variant: small-caps;
line-height: 41px;
padding: 0px 10px;
}
#menu-left ul li{
list-style: none;
}
#menu-left > ul > li > a{
font-size: 20px;
}
ul.subMenu > li > a{
font-size:16px;
}
#menu-left > ul > li > a, ul.subMenu > li > a{
color: #354C57;
width: 100%;
float: left;
padding: 5px 20px;
text-align: left;
}
#menu-left ul li .subMenu, #menu-left > ul > li > a{
border-bottom: 1px solid #ccc;
}
#menu-left > ul > li > a.active, #menu-left > ul > li > a:hover{
text-decoration: none;
background-color:#65BA91;
color: white;
font-size: 22px;
}
ul.subMenu > li > a.active, ul.subMenu > li > a:hover{
border-left: 4px solid #65BA91;
color: #65BA91;
font-size:18px;
text-decoration: none;
}
#menu-left ul li a.active span.text-red, #menu-left ul li a:hover span.text-red{
color:#354C57 !important;
}
.close-modal{
top: 10px !important;
right: 10px !important;
z-index: 100000000000000 !important;
position: fixed !important;
}
.close-modal .lr, .close-modal .rl{
height: 40px !important;
}
ul.subMenu{
/*display:none;*/
}
ul.subMenu{
padding-left: 30px
}
#show-menu-xs, #close-docs{
padding: 7px 15px;
font-size: 20px;
}
.keypan .panel-heading{
margin-top: 20px;
min-height: 70px;
}
.keypan{
border: none;
margin-bottom: 10px;
box-shadow: none;
}
.keypan, .keypanList{
box-shadow: none;
}
.keypanList .panel-title i{
margin-right: 10px;
}
.keypanList .panel-body ul{
padding-left: 0px;
}
.keypanList .panel-title span{
font-size: 24px !important;
}
.keypan .panel-body{
min-height: 200px;
}
.keypan hr {
width: 75%;
margin: auto;
}
#header-docs .panel-title, .subtitleDocs .panel-title {
font-size: 40px;
}
#header-docs .panel-title .sub-title, .subtitleDocs .panel-title .sub-title{
font-size: 20px !important;
font-style: italic;
}
#container-docs{
background-color: white;
z-index: 10000;
top: 60px;
}
@media (max-width: 991px) {
/* .open-type-filter{
display: block;
position: absolute;
right: -33px;
height: 50px;
width: 50px;
border: 1px solid #dadada;
border-radius: 100%;
text-align: right;
padding-right: 8px;
z-index: -1;
font-size: 20px;
}*/
#menu-left{
width: 56%;
left: -56%;
bottom: 0px;
}
}
@media (min-width: 991px) {
#menu-left {
left:0 !important;
}
}
</style>
<div id="docs-main-container">
<div id="header-doc" class="shadow2">
<a href='javascript:;' id="show-menu-xs" class="visible-xs visible-sm pull-left" data-placement="bottom" data-title="Menu"><i class="fa fa-bars"></i></a>
<h2 class="elipsis no-margin"><i class="fa fa-book hidden-xs"></i> <?php echo Yii::t("docs", "All <span class='hidden-xs'>you need to know</span> about") ?></h2>
<img src="<?php echo Yii::app()->theme->baseUrl; ?>/assets/img/LOGOS/CO2/logo-head-search.png"
class="logo-menutop main pull-left" height=30>
<a href='javascript:;' class="lbh pull-right" id="close-docs"><span><i class="fa fa-sign-out"></i> <?php echo Yii::t("common","Back") ?></span></a>
</div>
<div id="menu-left" class="col-md-3 col-sm-2 col-xs-12 shadow2">
<ul class="col-md-12 col-sm-12 col-xs-12 no-padding">
<li class="col-xs-12 no-padding">
<a href="javascript:" class="link-docs-menu down-menu" data-type="welcome" data-dir="<?php echo Yii::app()->language ?>">
<i class="fa fa-angle-right"></i> <?php echo Yii::t("docs","WEL<span class='text-red'>CO</span>ME"); ?>
</a>
</li>
<li class="col-xs-12 no-padding">
<a href="javascript:" class="link-docs-menu down-menu" data-type="about" data-dir="<?php echo Yii::app()->language ?>">
<i class="fa fa-angle-right"></i> <?php echo Yii::t("docs","A<span class='text-red'>BO</span>UT"); ?>
</a>
<ul class="subMenu col-xs-12 no-padding">
<li class="col-xs-12 no-padding">
<a href="https://doc.co.tools/books/1---le-projet/page/lassociation-open-atlas" target="_blank" class="">
<?php echo Yii::t("common","Open Atlas"); ?>
</a>
</li>
<li class="col-xs-12 no-padding">
<a href="https://doc.co.tools/books/1---le-projet/page/code-social-d%E2%80%99un-opensystem" target="_blank" class="">
<?php echo Yii::t("docs","Philosophy"); ?>
</a>
</li>
<li class="col-xs-12 no-padding">
<a href="javascript:" class="link-docs-menu" data-type="projects" data-dir="<?php echo Yii::app()->language ?>">
<?php echo Yii::t("docs","Projects"); ?>
</a>
</li>
<li class="col-xs-12 no-padding">
<a href="https://doc.co.tools/books/1---le-projet/page/ab%C3%A9c%C3%A9daire" target="_blank" class="">
<?php echo Yii::t("docs","Keywords"); ?>
</a>
</li>
<li class="col-xs-12 no-padding">
<a href="javascript:" class="link-docs-menu" data-type="partners" data-dir="panels">
<?php echo Yii::t("docs","Community"); ?>
</a>
</li>
<li class="col-xs-12 no-padding">
<a href="https://doc.co.tools/books/1---le-projet/page/historique" target="_blank" class="">
<?php echo Yii::t("docs","History"); ?>
</a>
</li>
<li class="col-xs-12 no-padding">
<a href="javascript:" class="link-docs-menu" data-type="commandement" data-dir="<?php echo Yii::app()->language ?>">
<?php echo Yii::t("docs","10 Commands"); ?>
</a>
</li>
<li class="col-xs-12 no-padding">
<a href="https://doc.co.tools/books/1---le-projet/page/code-social" target="_blank" class="">
<?php echo Yii::t("docs","Social code"); ?>
</a>
</li>
<li class="col-xs-12 no-padding">
<a href="https://doc.co.tools/books/1---le-projet/page/mod%C3%A8le-%C3%A9conomique" target="_blank" class="">
<?php echo Yii::t("docs","Funding"); ?>
</a>
</li>
</ul>
</li>
<li class="col-xs-12 no-padding">
<a href="javascript:" class="link-docs-menu down-menu" data-type="modules">
<i class="fa fa-angle-right"></i> <?php echo Yii::t("docs","HOW <span class='text-red'>TO</span> USE"); ?>
</a>
<ul class="subMenu col-xs-12 no-padding">
<li class="col-xs-12 no-padding">
<a href="https://doc.co.tools/books/2---utiliser-loutil/page/les-%C3%A9l%C3%A9ments-du-mod%C3%A8le-territorial-de-communecter" target="_blank" class="">
<?php echo Yii::t("docs","The elements"); ?>
</a>
</li>
<li class="col-xs-12 no-padding">
<a href="https://doc.co.tools/books/2---utiliser-loutil/page/liste" target="_blank" class="">
<?php echo Yii::t("docs","Applications"); ?>
</a>
</li>
<li class="col-xs-12 no-padding">
<a href="javascript:;" class="link-docs-menu" data-type="faq">
<?php echo Yii::t("docs","FAQ"); ?>
</a>
</li>
</ul>
</li>
<li class="col-xs-12 no-padding">
<a href="https://doc.co.tools/books/3---contribuer/page/accueil-contributeur" target="_blank" class="">
<i class="fa fa-angle-right"></i> <?php echo Yii::t("docs","<span class='text-red'>CO</span>NTRIBUTE"); ?>
</a>
</li>
<li class="col-xs-12 no-padding">
<a href="https://doc.co.tools/books/4---documentation-technique" target="_blank" class="">
<i class="fa fa-angle-right"></i> <?php echo Yii::t("docs","<span class='text-red'>CO</span>DING"); ?>
</a>
<ul class="subMenu col-xs-12 no-padding">
<li class="col-xs-12 no-padding">
<a href="https://doc.co.tools/books/4---documentation-technique/page/api" target="_blank" class="">
<?php echo Yii::t("docs","Play with API"); ?>
</a>
</li>
<li class="col-xs-12 no-padding">
<a href="javascript:" class="link-docs-menu" data-type="openSourceWeUse" data-dir="<?php echo Yii::app()->language ?>">
<?php echo Yii::t("docs","Open Source We use"); ?>
</a>
</li>
<li class="col-xs-12 no-padding">
<a href="javascript:" class="link-docs-menu" data-type="ocdb" data-dir="<?php echo Yii::app()->language ?>">
<?php echo Yii::t("common","OCDB"); ?>
</a>
</li>
<li class="col-xs-12 no-padding">
<a href="https://doc.co.tools/books/1---le-projet/page/journal-des-changements" target="_blank" class="">
<?php echo Yii::t("docs","RoadMap"); ?>
</a>
</li>
</ul>
</li>
<li class="col-xs-12 no-padding">
<a href="javascript:" class="link-docs-menu down-menu" data-type="contact" data-dir="panels">
<i class="fa fa-angle-right"></i> <?php echo Yii::t("docs","<span class='text-red'>CO</span>MMUNICATE"); ?>
</a>
<ul class="subMenu no-padding">
<li class="col-xs-12 no-padding">
<a href="javascript:" class="link-docs-menu" data-type="contact" data-dir="panels">
<?php echo Yii::t("docs","Contact"); ?>
</a>
</li>
<li class="col-xs-12 no-padding">
<a href="javascript:" class="link-docs-menu" data-type="affiches" data-dir="communication">
<?php echo Yii::t("docs","Drawings"); ?>
</a>
</li>
<li class="col-xs-12 no-padding">
<a href="javascript:" class="link-docs-menu" data-type="video" data-dir="">
<?php echo Yii::t("docs","Videos"); ?>
</a>
</li>
<!--<li class="">
<a href="javascript:" class="link-docs-menu" data-type="media">
<i class="fa fa-angle-right"></i> <?php echo Yii::t("docs","Medias"); ?>
</a>
</li>-->
</ul>
</li>
</ul>
</div>
<div id="container-docs" class="col-md-offset-3 col-md-9 col-sm-12 col-xs-12 no-padding text-center">
</div>
<?php } ?>
</div>
<script type="text/javascript">