I need to determine the number commits
of my users in the repo.
Something like:
git log --commit por usuario.
pepe 23 commits.
juan 20 commit
I need to determine the number commits
of my users in the repo.
Something like:
git log --commit por usuario.
pepe 23 commits.
juan 20 commit
I would like to know which table naming convention is more appropriate and why.
I'm with something simple, but for some reason I can't achieve it. As the title says, I can't center the elements of an HTML form. I wanted to see if they could give me a hand. Here the code:
<body>
<object id="header" data="header.html" onload="resizeObj(this);"></object>
<form id="formulario" action="enviado.php" method="post">
<div id="content">
<label>Nombre</label><br>
<input id="nombre" name="nombre" type="text" /> <br>
<label>Email</label><br>
<input id="email" name="email" type="text" /> <br>
<label>Contenido</label><br>
<textarea id="contenido" name="comment" cols="30" rows="5">Ingresa aqui el mensaje...</textarea><br>
<input id="campo3" name="enviar" type="submit" value="Enviar" />
</div>
</form>
<object id="footer" data="footer.html" onload="resizeObj(this);" ></object>
</body>
And the css:
*{
box-sizing: border-box;
margin: 0;
padding: 0;
}
body{
padding: 0px;
margin: 0px;
border:none;
width: 100%;
}
#header{
width: 100%;
padding: 0px;
margin: 0px;
overflow:hidden;
}
#footer{
position: fixed;
bottom:0;
left:0;
width: 100%;
padding: 0px;
margin: 0px;
overflow:hidden;
}
#formulario{
margin: 0 auto;
align-content: center;
border-radius: 10px;
border: 1px solid #666666;
width: 500px;
}
label {
font-weight: bold;
color: #444;
font-size: 14px;
}
input {
font-size: 14px;
}
input[type="text"] {
border-radius: 5px;
margin: 10px 0;
background: #fff;
border: 1px solid #ccc;
color: #777;
max-width: 100%;
outline: none;
padding: 7px 8px;
}
input[type="submit"] {
border-radius: 5px;
margin: 10px 0;
background: #0088B2;
color: #fff;
padding: 8px 14px;
font-weight: bold;
border: none;
cursor: pointer;
}
textarea{
border-radius: 5px;
margin: 10px 0;
background: #fff;
border: 1px solid #ccc;
color: #777;
max-width: 100%;
outline: none;
padding: 7px 8px;
}
input[type="submit"]:hover {
background: #444;
}
In web programming, you can put an image with the tag img
or as a background image using background-image
CSS and the result will be visually similar:
.hamburguesa {
background-image:url(https://i.imgur.com/tbhsHbKh.jpg);
width:256px;
height:256px;
display:inline-block;
}
<img src="https://i.imgur.com/tbhsHbKh.jpg" alt="Hamburguesa" />
<div class="hamburguesa"></div>
What are the advantages of using one over the other? In what situations should it be used img
and in which ones should it be used background-image
?
Factors to take into account: usability, accessibility, adaptability, type of display (screen, printer, etc).
Take this jsfiddle demo example , how to reference and guide to add effects and show error message.
Achieve the same effect, but the error message validation does not, when inserting a duplicate tag or a disallowed tag it shows the same error message "Cannot add duplicate tag" now when deleting the tag the error message remains not gone .
Full code running:
https://jsfiddle.net/39m2nukg/
//var arr_db = [];
var arr_db = ["html", "css", "jquery", "javascript", "php"];
var usuario_tags = [];
$(function(){
$.ajax({
url: 'tags.php',
success: function(result) {
var returnedData = JSON.parse(result);
var total = returnedData.length;
for(var i = 0; i < total; i++) {
arr_db.push(returnedData[i]);
}
}
});
// ::: TAGS BOX
$("#tags input").on({
focusout : function() {
var txt = this.value.replace(/[^a-z0-9\+\-\.\#]/ig,''); // allowed characters
var control = agregar_tags(txt.toLowerCase(), usuario_tags);
var verifica_tags = control_tags(txt.toLowerCase(), arr_db);
if(txt && control == false && verifica_tags == true) {
$('#message').hide();
$("<span/>",
{
text: txt.toLowerCase(),
insertBefore:this
});
} else {
$('#message').show();
}
this.value = "";
},
keyup : function(ev) {
// if: comma|enter (delimit more keyCodes with | pipe)
if(/(188|13)/.test(ev.which)) $(this).focusout();
}
});
$('#tags').on('click', 'span', function() {
$(this).remove();
quitar_tags(usuario_tags, $(this).text());
});
});
function agregar_tags(tag, arrtags) {
var index = -1;
var resultado = control_tags(tag, arrtags);
for(var i = 0; i < arrtags.length; i++) {
if(arrtags[i] === tag) {
index = i;
}
}
if(index > -1) {
arrtags[index] = tag;
} else {
arrtags.push(tag);
}
return resultado;
}
function control_tags(needle, haystack) {
var length = haystack.length;
for(var i = 0; i < length; i++) {
if(typeof haystack[i] == 'object') {
if(arrayCompare(haystack[i], needle)) return true;
} else {
if(haystack[i] == needle) return true;
}
}
return false;
}
function quitar_tags(array, element) {
const index = array.indexOf(element);
array.splice(index, 1);
}
#tags{float:left;border:1px solid #ccc;padding:5px;font-family:Arial;} #tags > span{cursor:pointer;display:block;float:left;color:#fff;background:#789;padding:5px;padding-right:25px;margin:4px;} #tags > span:hover{opacity:0.7;} #tags > span:after{position:absolute;content:"×";border:1px solid;padding:2px 5px;margin-left:3px;font-size:11px;} #tags > input{background:#eee;border:0;margin:4px;padding:7px;width:auto;}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<form method="post">
<label>Título<br/>
<input type="text" name="titulo" maxlength="255" />
</label><br/>
<label>Noticia<br/>
<textarea name="novedad"></textarea>
</label><br/><br/>
<div id="tags">
<input type="text" value="" placeholder="Add a tag" />
</div>
<p id="message" style="display:none">No se puede añadir una etiqueta duplicada.</p><br/><br/><br/>
<button type="submit">Publicar noticia</button>
</form>
I am misapplying the parameters or variables in the code jQuery is very different from php, could you guide me what I should take into account to correctly apply these error messages.
How do I correctly apply these error messages to jQuery code?
Example:
Show error message when adding a duplicate tag.
Show error message when trying to add a not allowed tag, the allowed tags are taken from this direct variable or from a database
var arr_db = [];
Limit the maximum of labels and at the same time show an error message.