Pokus o editaci textu

This commit is contained in:
Kateřina Koutová
2018-11-10 16:46:03 +01:00
parent b5cc593b3b
commit c892782c1c
3 changed files with 111 additions and 42 deletions
+42 -39
View File
@@ -1,49 +1,52 @@
var schemacolor = "#fa8072";
$(document).ready(function(){
$("a").hover(function(){
$(this).css("color", schemacolor);
}, function(){
$(this).css("color", "black");
});
document.getElementById("jmeno").style.color = schemacolor;
$(document).on('change', '.btn-file :file', function() {
$("a").hover(function(){
$(this).css("color", schemacolor);
}, function(){
$(this).css("color", "black");
});
document.getElementById("jmeno").style.color = schemacolor;
$(document).on('change', '.btn-file :file', function() {
var input = $(this),
label = input.val().replace(/\\/g, '/').replace(/.*\//, '');
label = input.val().replace(/\\/g, '/').replace(/.*\//, '');
input.trigger('fileselect', [label]);
});
});
$('.btn-file :file').on('fileselect', function(event, label) {
var input = $(this).parents('.input-group').find(':text'),
log = label;
if( input.length ) {
input.val(log);
} else {
if( log ) alert(log);
}
});
$('.btn-file :file').on('fileselect', function(event, label) {
});
function readURL(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function (e) {
$('#uvodni').attr('src', e.target.result);
console.log("Nahrano");
}
reader.readAsDataURL(input.files[0]);
}
var input = $(this).parents('.input-group').find(':text'),
log = label;
if( input.length ) {
input.val(log);
} else {
if( log ) alert(log);
}
function changeImage(){
$("#imgInp").change(function(){
readURL(this);
});
});
$("#demo-editor-bootstrap").wysihtml5();
});
function readURL(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function (e) {
$('#uvodni').attr('src', e.target.result);
console.log("Nahrano");
}
reader.readAsDataURL(input.files[0]);
}
}
function changeImage(){
$("#imgInp").change(function(){
readURL(this);
});
}
function changeText(){
}