mirror of
https://gitlab.com/CodeSolutionsProject/CodeShare.git
synced 2026-02-17 02:21:32 +01:00
Merge branch 'master' of ssh://gitlab.com/CodeSolutionsProject/CodeShare
This commit is contained in:
@@ -102,6 +102,10 @@
|
||||
<td>cookieconsent_status</td>
|
||||
<td>Cookie alert visibility</td>
|
||||
</tr>
|
||||
<tr class="active">
|
||||
<td>Google Analytics Cookies</td>
|
||||
<td>Track your navigation on CodeShare</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h4 class="top10">Disclosure Of Data</h4>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<h5>Open source licenses</h5>
|
||||
<p><a href="http://getbootstrap.com/"><strong>Bootstrap 3</strong> by Twitter - Licensed under MIT</a></p>
|
||||
<p><a href="https://bootswatch.com/"><strong>Paper theme to Boostrap 3</strong> by Bootswatch - Licensed under MIT</a></p>
|
||||
<p><a href="https://jquery.com/"><strong>jQuery 3.2.1</strong> by jQuery - Licensed under MIT</a></p>
|
||||
<p><a href="https://jquery.com/"><strong>jQuery</strong> by jQuery - Licensed under MIT</a></p>
|
||||
<p><a href="https://highlightjs.org/"><strong>Highlight.js</strong> by Ivan Sagalev - Licensed under BSD</a></p>
|
||||
<p><a href="https://cookieconsent.insites.com"><strong>Cookie Consent</strong> by Insites - Licensed under MIT</a></p>
|
||||
</div>
|
||||
|
||||
@@ -28,10 +28,10 @@
|
||||
<label class="control-label col-sm-6" for="lang">Name of external library, if needed:</label>
|
||||
<label class="control-label col-sm-6" for="lang">It needs a specific version of this library?:</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" name="extlib" placeholder="Name of library"/>
|
||||
<input type="text" name="extlib" id="extlib" placeholder="Name of library"/>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" name="extlibver" placeholder="Version used, only if needed"/>
|
||||
<input type="text" name="extlibver" id="extlibver" placeholder="Version used, only if needed"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@@ -73,4 +73,25 @@
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block js %}
|
||||
<script>
|
||||
function verRequired() {
|
||||
if(extlib.value=="")
|
||||
extlibver.removeAttribute("required");
|
||||
else
|
||||
extlibver.setAttribute("required","required");
|
||||
if(extlib2.value=="")
|
||||
extlibver2.removeAttribute("required");
|
||||
else
|
||||
extlibver2.setAttribute("required","required");
|
||||
}
|
||||
extlib = document.getElementById("extlib");
|
||||
extlibver=document.getElementById("extlibver");
|
||||
extlib2 = document.getElementById("extlib2");
|
||||
extlibver2=document.getElementById("extlibver2");
|
||||
extlib.onkeyup=verRequired;
|
||||
extlib2.onkeyup=verRequired;
|
||||
</script>
|
||||
{% endblock %}
|
||||
@@ -7,7 +7,7 @@
|
||||
<link type="text/css" rel="stylesheet" href="{{ app.frontcss }}/main.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="{{ app.frontcss }}/alert.css"/>
|
||||
<link type="text/css" rel="stylesheet" href="{{ app.frontcss }}/codeStyles/vs.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.0.3/cookieconsent.min.css" />
|
||||
<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.1.0/cookieconsent.min.css" />
|
||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.1/css/all.css" integrity="sha384-5sAR7xN1Nv6T6+dT2mhtzEpVJvfS3NScPQTrOxhwjIuvcA67KV2R5Jz6kr4abQsz" crossorigin="anonymous">
|
||||
{#<link rel="shortcut icon" href="{{ path.img }}favicon.ico" type="image/x-icon"/>#}
|
||||
{% block css %}{% endblock %}
|
||||
@@ -49,10 +49,41 @@
|
||||
<script>hljs.initHighlightingOnLoad();</script>
|
||||
{% endblock %}
|
||||
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.0.3/cookieconsent.min.js"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.1.0/cookieconsent.min.js"></script>
|
||||
<script>
|
||||
window.addEventListener("load", function(){
|
||||
window.cookieconsent.initialise({
|
||||
"onInitialise": function (status) {
|
||||
var type = this.options.type;
|
||||
var didConsent = this.hasConsented();
|
||||
if (type == 'opt-in' && didConsent) {
|
||||
|
||||
}
|
||||
if (type == 'opt-out' && !didConsent) {
|
||||
deleteCookies();
|
||||
}
|
||||
},
|
||||
|
||||
"onStatusChange": function(status, chosenBefore) {
|
||||
var type = this.options.type;
|
||||
var didConsent = this.hasConsented();
|
||||
if (type == 'opt-in' && didConsent) {
|
||||
// enable cookies
|
||||
}
|
||||
if (type == 'opt-out' && !didConsent) {
|
||||
deleteCookies();
|
||||
}
|
||||
},
|
||||
|
||||
"onRevokeChoice": function() {
|
||||
var type = this.options.type;
|
||||
if (type == 'opt-in') {
|
||||
// disable cookies
|
||||
}
|
||||
if (type == 'opt-out') {
|
||||
// enable cookies
|
||||
}
|
||||
},
|
||||
"palette": {
|
||||
"popup": {
|
||||
"background": "#2196f3",
|
||||
@@ -64,11 +95,13 @@
|
||||
"border": "#b2dbfb"
|
||||
}
|
||||
},
|
||||
"type": "opt-out",
|
||||
"content": {
|
||||
"href": "{{ path('tos') }}#cookiePolicy",
|
||||
"message": "This website uses cookies to ensure you get the best experience on on our website. If you don't accept any cookie won't be install on your browser.",
|
||||
"dismiss": "I accept it"
|
||||
"dismiss": "I accept them",
|
||||
"href": "{{ path('tos') }}#cookiePolicy"
|
||||
}
|
||||
})});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
@@ -154,6 +154,10 @@ function onScroll() {
|
||||
//From https://stackoverflow.com/questions/35297919/javascript-select-all-text-inside-a-pre-code-block-on-double-click
|
||||
window.onload = function(){
|
||||
|
||||
if(!comprobarCookie('cookieconsent_status') || obtenerCookie('cookieconsent_status')=='deny'){
|
||||
deleteCookies();
|
||||
}
|
||||
|
||||
document.body.addEventListener('dblclick', function(e){
|
||||
var target = e.target || e.srcElement;
|
||||
if (target.className.indexOf("highlight") !== -1 || target.parentNode.className.indexOf("highlight") !== -1){
|
||||
@@ -174,4 +178,11 @@ window.onload = function(){
|
||||
}
|
||||
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
function deleteCookies() {
|
||||
var theCookies = document.cookie.split(';');
|
||||
for (var i = 0 ; i < theCookies.length; i++) {
|
||||
document.cookie = theCookies[i].split('=')[0] + '=; path=/; expires=Thu, 01 Jan 1970 00:00:01 GMT;';
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
User's roles
|
||||
0: Normal user
|
||||
1: Normal user with ban
|
||||
2: Moderator
|
||||
3: Administrator
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
if(isset($_COOKIE['cookieconsent_status'])) {
|
||||
if(isset($_COOKIE['cookieconsent_status']) and $_COOKIE['cookieconsent_status']!="deny") {
|
||||
session_start(); //Start session in app, before loading vars ($_SESSION)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user