Рубрики
bo52 class

default\js\class\teg.js

//универсальный тег
 //empty
 CLASS["teg"]=class
 {
 get Data(){return this.data;}
 set Data(val){this.data=val;}
 create_arr(p)
 {
 bo52.data={};
 bo52.temp=this;
 if(Array.isArray(p)==true){
 Object.keys(p).forEach(function(key){
     bo52.data[key]=bo52.temp.create_teg(p[key]);
 }, p);    
 } else
 bo52.data=this.create_teg(p);
 return bo52.data;
 }    
 constructor(p){
 this.p=p;
 this.Data=this.create_arr(p);
 }
 create_teg(p)
 {
 if (typeof(p)=='string') p={teg:p}; 
 if (p.body==undefined) p.body=$('body');
 if (p.teg==undefined) p.teg='div';
 if (p.html==undefined) p.html='';
 if (typeof(p.body)=='number') p.body=bo52.tegs[p.body].ex;
 p.ex=$('<'+p.teg+'>').appendTo(p.body);
 p.ex.data('ex',this);
 p.ex.data('EX',p.EX);
 this.create_attr(p);
 this.create_css(p);
 this.create_event(p);
 this.create_class(p);
 this.create_html(p);
 this.create_data(p);
 this.create_prop(p);
 return p.ex;
 }
 create_attr(p){
 if (p.attr==undefined) return;
 if (p.teg=='a')
 {
 if (p.attr.href==undefined)    p.attr.href='#';
 }
 Object.keys(p.attr).forEach(function(key) {
 let val=this[key];
 if (key=='src') val='http://unity/wp-content/uploads/2021/05/'+val+'.png';
 p.ex.attr(key.replace('_','-'),val);
 }, p.attr);
 }
 create_css(p){
 if (p.css==undefined) return;
 Object.keys(p.css).forEach(function(key){
     p.ex.css(key.replace('_','-'),p.css[key]);
 }, p.css);
 }
 create_prop(p){
 if (p.prop==undefined) return;
 Object.keys(p.prop).forEach(function(key){
     p.ex.prop(key.replace('_','-'),p.prop[key]);
 }, p.prop);
 }
 create_event(p){
 if (p.event==undefined) return;
 Object.keys(p.event).forEach(function(key) {
 let v=p.event[key];
 if (typeof(v)=='number') 
 v=bo52.e[v];
 p.ex.bind(key,v);
 }, p.event);
 }
 create_data(p){
 if (p.data==undefined) return;
 Object.keys(p.data).forEach(function(key) {
     p.ex.data(key,p.data[key]);
 }, p.data);
 }
 create_class(p){
 if (p.classes==undefined) return;
 for (var i = 0; i < p.classes.length; i++) {
 let v=p.classes[i];
 if (typeof(v)=='number') 
 v=bo52.classes[v].v;
   p.ex.addClass(v);
 }
 }
 create_html(p){
 if (Array.isArray(p.html)==true)
 {
   Object.keys(p.html).forEach(function(key) {          
       p.html[key].EX=p.EX;
       p.html[key]=new CLASS"teg";
       $(p.html[key].p.ex).appendTo(p.ex);
   }, p.html);
 return;  
 }    
 switch(typeof(p.html)) 
 {
   case 'string':
   p.ex.html(p.html);
   break;
   case 'function':
   let f=p.html;
   Object.keys(f).forEach(function(key) {
       if (typeof(p.html[key])=='string'){
           p.html[key].ex=p.html[key];     
       } else {
           p.html[key].EX=p.EX;
           p.html[key]=new CLASS"teg";
       }
       $(p.html[key].ex).appendTo(p.ex);
   }, f);
   break;
   default:
   p.html.EX=p.EX;
   p.html=new CLASS"teg";     
   $(p.html.p.ex).appendTo(p.ex);
   break;
 }
 }
 }

Рубрики
bo52 function JavaScript js

default\js\sys\teg.js

function teg(id='teg',p){
 if (id=='teg')
 return jClass('teg',p);
 return new TEGid;    
 }
 function Teg(p){
 return jClass('teg',p);
 }
Рубрики
bo52 function JavaScript js

default\js\sys\jclass.js

function jclass(id)
 {   
 if (CLASS[id]) 
 return CLASS[id];
 $.ajax(
 {
     method: "GET",
     url:'http://unity/default/js/class/'+id+'.js', 
     dataType: "script",
     success:
     function (data)
     {
         bo52.data=CLASS[id]
     },
     async:false
 });
 return bo52.data;
 }
 function jClass(id,p){
 let x=jclass(id);
 return new x(p);
 }
Рубрики
ajax bo52 function JavaScript PHP php

default\js\sys\ajax.js

function ajax(id,p)
 {
     $.ajax(
     {
         method:"GET",
         url:'http://unity/default/php/ajax.php',
         data:
         {
             id:String(id),
             p:p,
         },
         success:
         function (data)
         {
             bo52.data=data;
         },
         async:false
     }
     );
 let regexp = /\r/g;
 //alert(bo52.data);
 bo52.data=bo52.data.replace(regexp,"");
 return bo52.data;
 }
Рубрики
ajax bo52 function JavaScript js

default\js\sys\jfun.js

function jfun(p){
 if (typeof(p)!='object')
 p={f:p};
 if (!p.f) p.f=p;
 if (!p.p) p.p='';
 if (fun[p.f]) 
 return funp.f;
 bo52.id=p.f;
 $.ajax(
 {
     method: "GET",
     url:'http://unity/default/js/funs/'+p.f+'.js', 
     dataType: "script",
     success:
     function (data)
     {
         bo52.data=funp.f
     },
     async:false
 });
 return bo52.data;
 }
Рубрики
bo52 JavaScript js

default\js\sys\bo52.js

bo52={}
 bo52.data='';
 bo52.id='';
 bo52.regexp_comment =/".?"|'.?'/g;
 bo52.regexp_oc = /{|}/g;
 bo52.regexp_int = /0|1|2|3|4|5|6|7|8|9/g;
 bo52.regexp_oper = /,|:|(|)|\;|[|]|||.|[|]|\|{|}|=|!|<|>/g;
 bo52.regexp_id=/[0-9]?-.?\s/g;
 bo52.regexp_letter=/[а-я-А-Я-a-z-0-9]?-.?\s|[а-я-А-Я-a-z-A-Z-0-9]*?[*|:|(|)|\;|[|]|||.|[|]|\|{|}|+|=|!|<|>|\s]/g;
 bo52.regexp_lang=/[а-я-А-Я-a-z-A-Z]/g;
 bo52.ids={
 }
 bo52.teg={}
 bo52.e={}
 bo52.f={}
 bo52.p={
 2106141006:{title:'массив для создания скрипта',teg:'arr'},    
 }
 bo52.Teg=(id,p)=>{
 p=bo52.tegid;
 p=jClass('teg',p);
 update();
 return p;
 }
 var fun={};
 var CLASS={};
 var TEG={};
Рубрики
bo52 JQuery php

default\php\sys\load.php

<?php
 function load_zero($p){
 foreach ($p as $dir) load_row($dir);
 }
 function load($p){
 foreach ($p as $path)
 foreach (scandir((__DIR__).'\..\..\..\default\'.$path.'\') as $dir) load_row('default\'.$path.'\'.$dir);       
 }
  
 function load_row($p){
 if (($dir=='.') or ($dir=='..')) return;
 switch (array_pop(explode('.', $p))){
     case 'js':
         echo '<script src="'.$p.'"></script>';
         break;
      case 'css':
         echo '<link rel="stylesheet" href="'.$p.'">';
         break;
 }             
 } 
load_zero([
 'http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js',
 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js',
'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js',
'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css',
 'https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css',
 'https://codegid.ru/default/js/jquery/jquery-1.7.2.js',
 'https://codegid.ru/default/js/jquery/jquery.event.drag-2.2.js',
 'https://codegid.ru/default/js/jquery/jquery.event.drag.live-2.2.js',
 'https://codegid.ru/default/js/jquery/ui/1.12.0/jquery-ui.js',
 'https://code.jquery.com/ui/1.12.1/jquery-ui.js',
 ]);
load(['js/sys','js/funs','js/funs/events','js/funs/tegs','js/class','js/teg','css','js/sys/target']);
 ?> 
wp-contentthemestwentytwentyheader.php
include_once (__DIR__)."/../../../default/php/sys/load.php";