This commit is contained in:
José Luis Garrido Labrador
2017-12-16 16:54:04 +01:00
parent 11c5478d27
commit 87161a4713
4 changed files with 169 additions and 12 deletions

145
Source/assets/css/qozu.css Normal file
View File

@@ -0,0 +1,145 @@
/* QOZU standard CSS for comments, JKANetwork
Version 1.0.1
If your custom CSS doesn't work right, plase check that version is the lastest
*/
/* Some "CSS reset" needed, overrides web styles for Qozu */
.QOZU input {
display:inline !important;
}
/* Change font here to have your custom font rendered */
.QOZU {
font-family: Arial, Helvetica, sans-serif !important;
text-align: left !important;
}
/* Text sizes */
.QOZU h2{
font-size: 24px;
}
.QOZU h3{
font-size: 22px;
}
.QOZU p {
font-size: 14px;
}
.QOZU a {
cursor:pointer;
}
p.QOZU_foot {
font-size: 12px;
}
/* Input width for name/email/userinfo */
.QOZU input {
width: 200px;
}
#QOZU_sendEmail {
width: initial;
}
/* Comment div CSS */
.QOZU_com{
font-size: 14px;
padding: 0.5em;
border-top: 1px dotted grey;
}
/* Link color in comments */
.QOZU_com a{
color: #2196f3;
}
/* Sizes in comments */
.QOZU_com h4 {
font-size: 16px;
margin: 0em;
margin-top: 0.25em;
color:black;
}
/* For text in the comment */
.QOZU_txt {
margin-left: 1em;
color:black;
}
.QOZU_txt p , .QOZU_txt a{
color: black;
}
.QOZU_opts, .QOZU_opts a {
font-size:12px;
color:#444444;
margin-left:0.1em;
}
.QOZU_writebox textarea {
border: 2px solid #908f8f;
border-radius: 1em;
width: 90%;
max-width: 600px;
height: 80px;
padding: 1em;
resize: none;
overflow: auto;
overflow-wrap: break-word;
}
.QOZU_ans {
margin-left: 2em;
}
/* This is for the tags of admins and mods */
.QOZU_com .specialUser{
display: inline-block;
padding: 2px 4px;
font-size: 12px;
font-weight: bold;
line-height: 14px;
color: #fff;
text-shadow: 0 -1px 0 rgba(0,0,0,0.25);
white-space: nowrap;
vertical-align: baseline;
background-color: #999;
}
/* Buttons, first standard CSS */
.QOZU .btn {
display: inline-block !important;
text-align: center;
cursor: pointer;
background-image: none;
border: 1px solid transparent;
padding: 5px 12px;
font-size: 14px;
line-height: 1.42857143;
border-radius: 4px;
}
/* Buttons, custom colours for every button */
.QOZU .btn-ok {
color: #fff;
background-color: #428bca;
}
.QOZU .btn-cancel {
color: #fff;
background-color: #428bca;
}
.QOZU .btn-cancelpeq {
color: #fff;
background-color: #005f93;
}
/* Other standard things for using CSS */
.QOZU .grey{
color: grey;
}
.QOZU .italic {
font-style: italic;
}
/* DEBUG, remove this in custom CSS
.QOZU_debug:before{
content: 'DEBUG:';
}
.QOZU_debug {
font-style: italic;
font-size: 10px;
}
*/

View File

@@ -8,7 +8,7 @@
<p>CodeShare is an open source platform licensed under Apache 2.0. All code are hosted in <a href="https://gitlab.com/CodeSolutionsProject/CodeShare">GitLab</a></p>
<h5>Developers</h5>
<p>Developed by Code Solutions Project, JKA Network's Group <a href="mailto:contacto@jkanetwork.com">&lt;contacto@jkanetwork.com&gt;</a></p>
<p>Maintenance by Jose Luis Garrido Labrador <a href="mailto:jlgarrido97@gmail.com">&lt;jlgarrido97@gmail.com&gt;</a></p>
<p>Maintenance by Jose Luis Garrido Labrador <a href="mailto:joselucross@jkanetwork.com">&lt;joselucross@jkanetwork.com&gt;</a></p>
<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>

View File

@@ -27,7 +27,7 @@
{% if page.otherV %}
<div style='text-align: center; font-size: 22px; '><a href='?page=code&id={{ code.idc }}&lang={{ code.lang }}'>View version's history</a></div>
{% endif %}
<div id='QOZU_box'>Se necesita tener JavaScript habilitado para poder ver los comentarios de la web.</div>
{#<div id='QOZU_box'>Se necesita tener JavaScript habilitado para poder ver los comentarios de la web.</div>#}
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12" style="text-align:center;"><h3>Other implementations</h3>
</div>
{% if page.otherI %}
@@ -131,11 +131,11 @@
{% endif %}
<div class="col_full" id="lib">
<label for="extlib">External Library</label>
<input type="text" name="extlib" id="extlib" {% if code.extlib is not null %}value="{{ code.extlib }}"{% endif %} placeholder="Name of library">
<input type="text" name="extlib" id="extlib" {% if code.extlib != "" %}value="{{ code.extlib }}"{% endif %} placeholder="Name of library">
</div>
<div class="col_full" id="libVer">
<label for="extlibver">Library version</label>
<input type="text" name="extlibver" id="extlibver" {% if code.extlib is not null %}value="{{ code.extlibver }}" required="required"{% endif %} placeholder="Library version">
<input type="text" name="extlibver" id="extlibver" {% if code.extlib != "" %}value="{{ code.extlibver }}" required="required" {% endif %} placeholder="Library version">
</div>
<div class="col_full">
<label for="code">Code:</label>
@@ -163,20 +163,22 @@
<script>hljs.initHighlightingOnLoad();</script>
<script>
function verRequired() {
extlibver=document.getElementById("extlibver");
if(extlib.value=="")
extlibver.removeAttribute("required");
else
extlibver.setAttribute("required","required");
}
var extlib = document.getElementById("extlib");
extlib = document.getElementById("extlib");
extlibver=document.getElementById("extlibver");
extlib.onkeyup=verRequired;
</script>
<script type="text/javascript">
{#<script type="text/javascript">
var webpageid = 6; /* Webpage id, in all your website,the same */
var uniqueid = 0; /* Post/url id, every site you want different comments, an unique ID, 0 as default */
var uniqueid = {{ code.idc }}{{ code.idu }}; /* Post/url id, every site you want different comments, an unique ID, 0 as default */
var needCookie = 'sessionID';
var customcss = 'assets/css/qozu.css';
</script>
<script src="http://qozu.jkanetwork.com/comments.js"></script>
<script src="http://qozu.jkanetwork.com/comments.js"></script>#}
{% endblock %}
{% block css %}

View File

@@ -271,13 +271,20 @@ class DB
*/
public function addSource($IDC, $lang, $code, $IDU, $extlib = null, $extlibver = null)
{
$lib = $extlib;
$libV = $extlibver;
if($lib == null) {
$lib = "";
$libV = "";
}
$version = $this->getLastVersion($IDC, $lang);
if ($version == null)
$version = 0;
$version++;
$modification = time();
$query = "INSERT INTO Sources (`IDC`,`Lang`,`Version`,`Modification`,`Code`,`UseExtLib`,`UseExtLibVer`,`IDU`) VALUES ('$IDC','$lang',$version,$modification,'$code','$extlib','$extlibver','$IDU')";
$query = "INSERT INTO Sources (`IDC`,`Lang`,`Version`,`Modification`,`Code`,`UseExtLib`,`UseExtLibVer`,`IDU`) VALUES ('$IDC','$lang',$version,$modification,'$code','$lib','$libV','$IDU')";
echo $query . ';';
dbw_query($this->conn, $query);
return $version;
@@ -308,7 +315,7 @@ class DB
$query = "INSERT INTO Codes (`UserCreator`,`Name`,`Description`,`Input`,`Output`) VALUES ('$IDU','$name','$description','$in','$out') ";
//echo $query.';';
//die();
echo $query . ';';
dbw_query($this->conn, $query);
$this->addSource($this->getLastIDC(), $lang, $_code, $IDU, $extlib, $extlibver);
} else {
@@ -318,11 +325,14 @@ class DB
if ($code != $codewrite) {
$version = $this->addSource($IDC, $lang, $_code, $IDU, $extlib, $extlibver);
} else if ($extlib != $arr["UseExtLib"] || $extlibver != $arr["UseExtLibVer"]) {
$query = "UPDATE Sources SET `UseExtLib`='$extlib', `UseExtLibVer`='$extlibver' WHERE IDC=$IDC AND Lang='$arr[Lang]' AND Version=$arr[Version]";
//echo $query.';';
dbw_query($this->conn, $query);
}
$query = "UPDATE Codes SET `Name`='$name', `Description`='$description', `Input`='$in', `Output`='$out' WHERE IDC='$IDC'";
//echo $query.';';
dbw_query($this->conn, $query);
return $version;