meta.js update from edide

This commit is contained in:
Jussi Rytkönen 2019-11-11 17:33:22 +02:00
parent c99ad39c56
commit 301f8910fb

View File

@ -15,6 +15,7 @@
}
if(typeof module !== "undefined"){ var common = module }
/* UNBUILD */
;USE(function(module){
var noop = function(){}, u;
$.fn.or = function(s){ return this.length ? this : $(s||'body') };
@ -145,9 +146,8 @@
;USE(function(module){
try{
/* UI */
if(meta.css){ return }
var $m = $('<div>').attr('id', 'meta');
$m.append($('<span>').html('&#9776;').addClass('meta-start'));
$m.append($('<span>').text('+').addClass('meta-start'));
$m.append($('<div>').addClass('meta-menu meta-none').append('<ul>'));
$(document.body).append($m);
css({
@ -159,7 +159,7 @@
background: 'white',
'font-size': '18pt',
'font-family': 'Tahoma, arial',
//'box-shadow': '0px 0px 1px #000044',
'box-shadow': '0px 0px 1px #000044',
'border-radius': '1em',
'text-align': 'center',
'z-index': 999999,
@ -231,9 +231,10 @@
});
var tag = document.createElement('style');
tag.innerHTML = tmp;
document.body.appendChild(tag);
$m.append(tag)
}
}catch(e){}
}catch(e){}
})(USE, './metaUI');
;USE(function(module){
// include basic text editing by default.
@ -377,6 +378,8 @@
on: function(eve){ meta.text.editor('fontSize', 7) },
up: function(){}
});
})(USE, './metaText');
;USE(function(module){
var m = meta, k = m.key;
@ -394,10 +397,10 @@
});
$(document).on('touchstart', '#meta .meta-start', function(eve){ m.tap.stun = true });
$(document).on('click', '#meta .meta-menu li', function(eve){
eve.fake = eve.which = $(this).data().combo.slice(-1)[0].charCodeAt(0);
var combo = $(this).data().combo;
eve.fake = eve.which = combo && combo.slice(-1)[0].charCodeAt(0);
eve.tap = true;
k.down(eve);
//k.up(eve);
k.down(eve); k.up(eve);
return;
if(m.tap.stun){ return m.tap.stun = false }
if(!(eve.fake = eve.which = (($(this).text().match(/[A-Z]/)||{})[0]||'').toUpperCase().charCodeAt(0))){ return }