mirror of
https://github.com/amark/gun.git
synced 2025-06-07 14:46:44 +00:00
meta.js ununbound
This commit is contained in:
parent
42926ec09d
commit
c0224c4d28
24
lib/meta.js
24
lib/meta.js
@ -1,4 +1,9 @@
|
|||||||
;(function(){
|
;(function(){
|
||||||
|
var root;
|
||||||
|
if(typeof window !== "undefined"){ root = window }
|
||||||
|
if(typeof global !== "undefined"){ root = global }
|
||||||
|
root = root || {};
|
||||||
|
var console = root.console || {log: function(){}};
|
||||||
function USE(arg, req){
|
function USE(arg, req){
|
||||||
return req? require(arg) : arg.slice? USE[R(arg)] : function(mod, path){
|
return req? require(arg) : arg.slice? USE[R(arg)] : function(mod, path){
|
||||||
arg(mod = {exports: {}});
|
arg(mod = {exports: {}});
|
||||||
@ -8,8 +13,8 @@
|
|||||||
return p.split('/').slice(-1).toString().replace('.js','');
|
return p.split('/').slice(-1).toString().replace('.js','');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(typeof module !== "undefined"){ var common = module }
|
||||||
|
|
||||||
/* UNBUILD */
|
|
||||||
;USE(function(module){
|
;USE(function(module){
|
||||||
var noop = function(){}, u;
|
var noop = function(){}, u;
|
||||||
$.fn.or = function(s){ return this.length ? this : $(s||'body') };
|
$.fn.or = function(s){ return this.length ? this : $(s||'body') };
|
||||||
@ -136,9 +141,11 @@
|
|||||||
edit.combow = edit.combow.join(',');
|
edit.combow = edit.combow.join(',');
|
||||||
m.list(meta.edit);
|
m.list(meta.edit);
|
||||||
}
|
}
|
||||||
})(USE, './metaCore');
|
|
||||||
|
|
||||||
;USE(function(module){try{
|
|
||||||
|
})(USE, './metaCore');
|
||||||
|
;USE(function(module){
|
||||||
|
try{
|
||||||
/* UI */
|
/* UI */
|
||||||
if(meta.css){ return }
|
if(meta.css){ return }
|
||||||
var $m = $('<div>').attr('id', 'meta');
|
var $m = $('<div>').attr('id', 'meta');
|
||||||
@ -228,8 +235,9 @@
|
|||||||
tag.innerHTML = tmp;
|
tag.innerHTML = tmp;
|
||||||
document.body.appendChild(tag);
|
document.body.appendChild(tag);
|
||||||
}
|
}
|
||||||
}catch(e){}})(USE, './metaUI');
|
}catch(e){}
|
||||||
|
|
||||||
|
})(USE, './metaUI');
|
||||||
;USE(function(module){
|
;USE(function(module){
|
||||||
// include basic text editing by default.
|
// include basic text editing by default.
|
||||||
var monotype = window.monotype || function(){console.log("monotype needed")};
|
var monotype = window.monotype || function(){console.log("monotype needed")};
|
||||||
@ -372,10 +380,11 @@
|
|||||||
on: function(eve){ meta.text.editor('fontSize', 7) },
|
on: function(eve){ meta.text.editor('fontSize', 7) },
|
||||||
up: function(){}
|
up: function(){}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
})(USE, './metaText');
|
})(USE, './metaText');
|
||||||
|
|
||||||
|
|
||||||
;USE(function(module){
|
;USE(function(module){
|
||||||
|
var m = meta, k = m.key;
|
||||||
$(window).on('blur', k.wipe).on('focus', k.wipe);
|
$(window).on('blur', k.wipe).on('focus', k.wipe);
|
||||||
$(document).on('mousedown mousemove mouseup', function(eve){
|
$(document).on('mousedown mousemove mouseup', function(eve){
|
||||||
m.tap.eve = eve;
|
m.tap.eve = eve;
|
||||||
@ -398,6 +407,7 @@
|
|||||||
});
|
});
|
||||||
$(document).on('keydown', k.down).on('keyup', k.up);
|
$(document).on('keydown', k.down).on('keyup', k.up);
|
||||||
$(document).on('select contextmenu keyup mouseup', '[contenteditable=true]', m.text.on);
|
$(document).on('select contextmenu keyup mouseup', '[contenteditable=true]', m.text.on);
|
||||||
})(USE, './metaEvents');
|
|
||||||
|
|
||||||
|
|
||||||
|
})(USE, './metaEvents');
|
||||||
}());
|
}());
|
Loading…
x
Reference in New Issue
Block a user