commit df825e3d2fa24a287963eaef7667592fad3fc38e Author: indeferend Date: Sun May 23 06:26:34 2021 +0500 Draft v1 diff --git a/.unotes/unotes_meta.json b/.unotes/unotes_meta.json new file mode 100644 index 0000000..4bdb33e --- /dev/null +++ b/.unotes/unotes_meta.json @@ -0,0 +1,48 @@ +{ + "name": "", + "isOrdered": true, + "folders": { + "CLASSES": { + "name": "CLASSES", + "isOrdered": true, + "folders": { + "core": { + "name": "core", + "isOrdered": true, + "folders": {}, + "files": { + "doc__LE_FS": 0 + } + } + }, + "files": {} + }, + "LE": { + "name": "LE", + "isOrdered": true, + "folders": {}, + "files": { + "core_fuctions": 0 + } + }, + "MODULES": { + "name": "MODULES", + "isOrdered": true, + "folders": {}, + "files": {} + }, + "PUB": { + "name": "PUB", + "isOrdered": true, + "folders": {}, + "files": {} + }, + "TPL": { + "name": "TPL", + "isOrdered": true, + "folders": {}, + "files": {} + } + }, + "files": {} +} \ No newline at end of file diff --git a/CLASSES/blog.php b/CLASSES/blog.php new file mode 100644 index 0000000..c7eb2d0 --- /dev/null +++ b/CLASSES/blog.php @@ -0,0 +1,9 @@ +0) return false; + if ( is_dir( $src ) ) { + if (!file_exists($dest)) mkdir($dest, 0777, true); + + $d = dir( $src ); + while ( false !== ( $entry = $d->read() ) ) { + if ( $entry != '.' && $entry != '..' ) + LE_FS::copy_folder( "$src/$entry", "$dest/$entry"); + } + $d->close(); + } + elseif (!file_exists($dest)) + { + copy($src, $dest); + echo 'copy file '.$src.' to '.$dest."\n
"; + } + + } + + public static function dir_files($dir,$func=false) + { + if (!$dir||empty($dir)||!is_dir($dir)) return 1; + if($func===false) return 2; + + $d = dir( $dir ); + while ( false !== ( $entry = $d->read() ) ) { + if ( $entry == '.' || $entry == '..' ) continue; + $func($entry); + } + $d->close(); + + } + + //LE_FS::save_from_post($inp=['f_name'=>,'path'=>]) + public static function SAVE_POST($inp,$debug=false) + { + $f_name = (isset($inp['f_name'])) ? $inp['f_name'] : 'file'; + + if (!isset($inp['path']) || !is_dir($inp['path'])) return false; + $inp['path'] = rtrim($inp['path']); + + // echo $inp['path']; + + if (!isset($_FILES[$f_name])) return false; + + $F = $_FILES[$f_name]; + + // echo_arr($F); + + + $SAVE_FILE = function($path,$index=false) use (&$F,&$debug) + { + $f_inf=[]; + if ($index!==false) + { + if (!isset($F["tmp_name"][$index])) return false; + $f_inf['tmp_name'] = $tmp_name = $F["tmp_name"][$index]; + $f_inf['name'] = $file_name = $F["name"][$index]; + $f_inf['type'] = $F["type"][$index]; + $f_inf['size'] = $F["size"][$index]; + + } + else + { + if (!isset($F["tmp_name"])) return false; + $f_inf['tmp_name'] = $tmp_name = $F["tmp_name"]; + $f_inf['name'] = $file_name = $F["name"]; + $f_inf['type'] = $F["type"]; + $f_inf['size'] = $F["size"]; + + } + + // echo $tmp_name.BR; + // echo $file_name.BR; + + if (!is_uploaded_file($tmp_name)) return false; + + $n = LE_FS::GEN_FNAME($file_name, $path); + $out = $path.DS.$n; + if (!move_uploaded_file($tmp_name, $out)) return false; + + if (!file_exists($out)) return false; + + if($debug!==false) $debug[$n] = $f_inf; + + return $n; + + + }; + + if (is_array($F['tmp_name'])) + { + $cnt = count($F['tmp_name']); + $res = []; + for ($i=0;$i<$cnt;$i++) + { + $_fn = $SAVE_FILE($inp['path'],$i); + if ($_fn!==false) $res[] = $_fn; + } + + } + else + { + return $SAVE_FILE($inp['path']); + } + + $cnt = count($res); + if (!$cnt>0) return false; + if ($cnt===1) return $res[0]; + return $res; + + } + + + public static function GEN_FNAME($inp_name = false, $path = false, $prefix=false) + { + $ext = ($inp_name) ? '.'.pathinfo ($inp_name,PATHINFO_EXTENSION) : ''; //extension .jpg + + //file name alphabet + $fn_alphabet = [0,1,2,3,4,5,6,7,8,9,'A','B','C','D', + 'E','F','G','H','I','J','K','L','M','N','O','P','Q', + 'R','S','T','U','V','W','X','Y','Z','_','-' + ]; + + $microtime = microtime(1); + $create_time = 1540388275; + $diff_time = Ceil($microtime*10000)-($create_time*10000); + + $new = int2alphabet($fn_alphabet,$diff_time); + + if ($prefix!==false) $new = $prefix.$new; + + + //проверка существования + if ($path && is_dir($path)) + { + $part = rtrim($path,DS); + $i=1; + while(is_file($path . DS . $new.$ext)) + { + if ($i>100) exit("problem gen file name!!!"); + $new.=$fn_alphabet[rand(0,27)]; + $i++; + } + } + return $new.$ext; + } + + + public static function Apply2Files($path,&$func,$recouse=0) + { + $path = rtrim($path,"/\\").DS; + + if (!is_dir($path) || !($handle = opendir($path))) return; + + while(false !== ($f = readdir($handle))) + { + if($f == "." || $f == "..") continue; + + $obj=$path.$f; + if (is_file($obj)) + $func($obj); + elseif (is_dir($obj) && $recouse) + LE_FS::Apply2Files($obj,$func,$recouse); + + } + closedir($handle); + } + +} diff --git a/CLASSES/core/LE_MOD_CONTROLLER.php b/CLASSES/core/LE_MOD_CONTROLLER.php new file mode 100644 index 0000000..cdb15aa --- /dev/null +++ b/CLASSES/core/LE_MOD_CONTROLLER.php @@ -0,0 +1,145 @@ +params_url = $params_url; + $this->model = &$model; + } + + //точка входа + public function start() + { + //ajax methods + if (isset($_POST['ajax'])) return $this->ajax(); + + if (LE::$QUERY_DATA_TYPE=='json') return $this->json(); + + + list($mod,$params) = $this->router(); + + if (!empty($mod) && isset($this->aliases[$mod])) $mod = $this->aliases[$mod]; + + $mod = "_inp_".$mod; + + + + if ($mod=="_inp_" || !method_exists($this,$mod)) return $this->_inp_default($params); + + return $this->$mod($params); + } + + protected function router() + { + //echo_arr($this->params_url); + $url = $this->params_url[3]; + $url = PRE::DOWN($url); + preg_match('!([^:]*)[:]?(.*)!ui',$url,$out); + + //echo_arr($out); + return [$out[1],$out[2]]; + } + + protected function ajax() + { + //out without template + if (property_exists(LE::$TPL,'clear')) LE::$TPL->clear=1; + + $mod = trim(arr_v($_POST,'mod','')); + if (empty($mod)) return false; + + $mod = "_ajx_".$mod; + + $data=false; + if (isset($_POST['data'])) + { + $data = $_POST['data']; + if (!is_array($data) && !empty($data)) $data = json_decode($data,1); + } + + if (!method_exists($this,$mod)) return false; + + $res = $this->$mod($data); + + + //возвращать массив ответа как есть, не оборачивая в data + if (isset($res['as_is']) && $res['as_is']) + { + unset($res['as_id']); + $out = $res; + } + + elseif ($res===false) + { + $out = ['success'=>0]; //error + } + else + { + $out = ['success'=>1]; + $out['data'] = $res; + } + + return json_encode($out); + + + } + + + protected function _inp_default($inp) + { + return false; + } + + protected function json() + { + $postData = file_get_contents('php://input'); + $data = json_decode($postData,1); + + if (property_exists(LE::$TPL,'clear')) LE::$TPL->clear=1; + + + $method = trim(arr_v($data,'method','')); + if (empty($method)) return false; + + $method = "_ajx_".$method; + + + + if (!method_exists($this,$method)) return false; + + unset($data['method']); + $res = $this->$method($data); + + + //возвращать массив ответа как есть, не оборачивая в data + if (isset($res['as_is']) && $res['as_is']) + { + unset($res['as_id']); + $out = $res; + } + + elseif ($res===false) + { + $out = ['success'=>0]; //error + } + else + { + $out = ['success'=>1]; + $out['data'] = $res; + } + + return json_encode($out); + } + + //301 redirect + public function move2new($url) + { + header("HTTP/1.1 301 Moved Permanently"); + header("Location: ".$url); + exit(); + } + +} \ No newline at end of file diff --git a/CLASSES/core/LE_MOD_LOAD.php b/CLASSES/core/LE_MOD_LOAD.php new file mode 100644 index 0000000..4c19946 --- /dev/null +++ b/CLASSES/core/LE_MOD_LOAD.php @@ -0,0 +1,71 @@ +m1=SYSDIR."MODULES".DS; + $this->m2=APPDIR."MODULES".DS; + $this->space_list = SYSCONF::$SPACE_LIST; + $this->mod_aliases = SYSCONF::$MOD_ALIASES; + if ($autorun) $this->parse_url(); + } + + public function parse_url() + { + $query = LE_REQUEST::url2arr()['query_clr']; + + $spaces_str = implode('|',array_keys($this->space_list)); + + + preg_match('!^/('.$spaces_str.')?/?([^/?]*)/?(.*?)$!simu', $query,$res); + + $this->url = $res; + $space_in_q = $res[1]; + $mod_in_q = $res[2]; + + $space=SYSCONF::$DEFAULT_MODSPACE; //default + + if (!empty($space_in_q)) + { + $space = $this->search_key($this->space_list,$space_in_q); + if ($space===false) return false; + } + + + if ($this->select_path($space)===false) return false; + + $mod=arr_v(SYSCONF::$DEFAULT_MODULE,$space,false); //default + if (!empty($mod_in_q)) + { + $mod_rr=false; + if (isset($this->mod_aliases[$space])) + $mod_rr = $this->search_key($this->mod_aliases[$space],$mod_in_q); + + $mod = ($mod_rr) ? $mod_rr : $mod_in_q; + } + $this->init_path = $this->select_path($space,"__space_init.php"); + $this->mod_path = $this->select_path($space,$mod.".php"); + + } + + + public function select_path($space,$path="") + { + $app_path = $this->m2.$space.DS.$path; + $sys_path = $this->m1.$space.DS.$path; + + if (file_exists($app_path)) return $app_path; + if (file_exists($sys_path)) return $sys_path; + return false; + } + + public function search_key($arr,$key) + { + foreach ($arr as $tpl => $val) + if(preg_match('!^('.$tpl.')$!simu', $key)) return $val; + + return false; + } +} \ No newline at end of file diff --git a/CLASSES/core/LE_MYSQL.php b/CLASSES/core/LE_MYSQL.php new file mode 100644 index 0000000..f665874 --- /dev/null +++ b/CLASSES/core/LE_MYSQL.php @@ -0,0 +1,278 @@ +cnf = &$cnf; + if (defined("DEBUG") && DEBUG==1) $this->debug=1; + + $this->connect($cnf); + } + + //exit and echo error + protected function err($txt) + { + http_response_code(503); + exit($txt); + } + + + /***************************** + | private helpers functions | + *****************************/ + protected function create_connect() + { + if (isset($this->cnf['socket']) && !empty($this->cnf['socket'])) + return new mysqli(NULL, $this->cnf['user'], $this->cnf['pass'], $this->cnf['db_name'], NULL, + $this->cnf['socket']); + + return new mysqli($this->cnf['host'], $this->cnf['user'], $this->cnf['pass'], $this->cnf['db_name']); + } + + public function connect() + { + $this->l = $this->create_connect(); + + if ($this->l->connect_errno) $this->err("ERROR CONNECT DB"); + + $this->sess_conf(); + } + + private function sess_conf() + { + $this->query("set names utf8"); + $this->query("SET @@session.time_zone = '+00:00'"); + } + + public function check_conn ($debug=0) + { + if ($this->l->ping()!==false) return; + //проверим еще раз не переподключился ли он автоматом + usleep(500); + if ($this->l->ping()===false) $this->connect(); + } + + /***************************** + | query & anwer functions | + *****************************/ + public function query($s, $buffer = true, $o = []) + { + $this->cnt++; //счетчик запросов + $buf = ($buffer) ? MYSQLI_STORE_RESULT : MYSQLI_USE_RESULT; + $type = (isset($o['type'])) ? $o['type'] : $this->detect($s); + + if ($this->echo_sql) echo $s.BR; + + + $res = $this->l->query($s, $buf); + + $e = ($this->l->error); + if (!empty($e)) $this->err(($this->c['debug'] ? $e . '
(' . $s . ')' : 'ERR QUERY!!!')); + + unset($e, $buf); + return $this->answer($res, $type, $o); + } + + private function detect($s) { + if ((stripos($s, 'select', 0) !== false)) return 'S'; + if ((stripos($s, 'SHOW', 0) !== false)) return 'S'; + if ((stripos($s, 'insert', 0) !== false)) return 'I'; + if ((stripos($s, 'update', 0) !== false)) return 'U'; + if ((stripos($s, 'delete', 0) !== false)) return 'D'; + if ((stripos($s, 'truncate', 0) !== false)) return 'T'; + } + + private function answer(&$r, $t_, $o) { + $t = &$this; + $l = &$this->l; + switch ($t_) { + case 'S': + if ((isset($o['row']) && $o['row']) || (isset($o['val']) && $o['val'])) + { + $r_ = $this->get_row($r); + $r->free_result(); + if (isset($o['val']) && $o['val']) return $r_[trim($o['val'])]; + return $r_; + } + return $r; + break; + case 'I': + return $l->insert_id; + break; + case 'U'; + case 'T'; + case 'D'; + return $l->affected_rows; + break; + } + return false; + } + + public function get_row(&$r) + { + return ($r) ? mysqli_fetch_assoc($r) : FALSE; + } + + /***************************** + | query prepare functions | + *****************************/ + + public function prepare($s) + { + return $this->l->real_escape_string($s); + } + + public function arr2in($ids,$str=false) + { + if ($str) array_map(function($id){return "'".$id."'";},$ids); + + $ids = (is_array($ids)) ? implode(',',$ids) : $ids; + return $this->prepare($ids); + } + + + public function gen_set($arr) + { + $arr_ = []; + if (count($arr)) { + foreach ($arr as $k => &$v) { + $arr_[] = "`" . $k . "`='" . (($v === '###') ? '' : $this->prepare($v)) . "'"; + } + } + + if (!count($arr_) > 0) { + return false; + } + + unset($arr); + return implode(', ', $arr_); + } + + /********************** + | result functions | + **********************/ + public function count(&$res) + { + if (!$res || gettype($res)!=="object") return false; + return mysqli_num_rows ($res); + } + + public function cnt(&$res) {return $this->count($res);} + + public function res2arr($res = 0,$key=false,$shift_reg=false) + { + $res_arr = []; + + if($key===false) + while($r = $this->get_row($res)) $res_arr[] = $r; + else + while($r = $this->get_row($res)) + { + $_key = ($shift_reg) ? PRE::SHIFT($r[$key],$shift_reg) : $r[$key]; + $res_arr[$_key] = $r; + } + + + return $res_arr; + } + + public function found_rows() + { + return $this->query("SELECT FOUND_ROWS() as `cnt`", false, ['val' => 'cnt']); + } + + + + + /**************** + QUERY GENERATORS + ****************/ + public function INS($table, $val_arr) + { + $table = $this->prepare($table); + $set_str = $this->gen_set($val_arr); + $sql = 'INSERT INTO `' . $table . '` SET ' . $set_str; + return $this->query($sql,0,['type'=>'I']); + } + + public function UPD($table, $val_arr, $id, $idf = 'id',$str_key=false) + { + + if (empty($id)) $this->err("ERR DB UPD"); + $table = $this->prepare($table); + $set_str = $this->gen_set($val_arr); + $id_field = $this->prepare($idf); + $in_list = $this->arr2in($id,$str_key); + + $sql = 'UPDATE `' . $table . '` SET ' . $set_str . ' WHERE `' . $id_field . '` IN (' . $in_list . ')'; + + return $this->query($sql,0,['type'=>'U']); + } + + public function DEL($table, $id, $idf = "id",$str=false) + { + if (is_array($id) && !count($id)) return false; //нечего удалять, если ничего не передали + if (!is_array($id)) $id = [$id]; + + $table = $this->prepare($table); + $id_field = $this->prepare($idf); + $in_list = $this->arr2in($id); + + $sql = 'DELETE FROM `' . $table . '` WHERE `' . $id_field . '` IN(' . $in_list.')'; + return $this->query($sql,0,['type'=>'D']); + + } + //ins or upd return index + public function SAVE($t,$v,$idf="id") + { + if (!isset($v[$idf]) || $v[$idf]==0) return $this->INS($t,$v); + + $id = $v[$idf]; unset($v[$idf]); + + //upd + if ($id>0 && count($v)>0) $this->UPD($t,$v,$id,$idf); + //delete + if ($id<0) $this->DEL($t,($id*-1),$idf); + + return $id; + } + + + /***************** + * custom queries * + *****************/ + + public function query_arr($sql,$key=false,$shift_reg=0) + { + $res = $this->query($sql,0,['type'=>'S']); + $rez = $this->res2arr($res,$key,$shift_reg); + $res->free(); + return $rez; + } + + public function query_keyval($sql,$k=false,$v=false) + { + $k = trim($this->prepare($k)); + $v = trim($this->prepare($v)); + + $res = $this->query($sql,0,['type'=>'S']); + $res_arr = []; + while($r = $this->get_row($res)) $res_arr[$r[$k]] = $r[$v]; + + return $res_arr; + } + + public function query_single($s) { + return $this->query($s, false, ['row' => true]); + } + + public function query_val($s,$v) + { + return $this->query($s, false, ['val' => $v]); + } + +} \ No newline at end of file diff --git a/CLASSES/core/LE_REQUEST.php b/CLASSES/core/LE_REQUEST.php new file mode 100644 index 0000000..c0a0099 --- /dev/null +++ b/CLASSES/core/LE_REQUEST.php @@ -0,0 +1,114 @@ +apache + /* + if ((!$ssl) && function_exists('apache_request_headers')) + { + $h = apache_request_headers(); + if (is_array($h) && isset($h['Nginx-Https']) && $h['Nginx-Https']=='on') + { + $ssl=true; $port=443; + } + } + */ + + $protocol = strtolower($s['SERVER_PROTOCOL']); + + $scheme = substr( $protocol, 0, strpos( $protocol, '/' ) ) . ( ( $ssl ) ? 's' : '' ); + $standart_port = ((!$ssl && $port=='80') || ($ssl && $port=='443')); + + $host="locahost"; + if ($use_forwarded_host && isset( $s['HTTP_X_FORWARDED_HOST'] )) + $host = $s['HTTP_X_FORWARDED_HOST']; + elseif (isset( $s['HTTP_HOST'])) + $host = $s['HTTP_HOST']; + elseif (isset( $s['SERVER_NAME'])) + $host = $s['SERVER_NAME']; + + + + $host_full = ($standart_port) ? $host : ($host.":".$port); + + $query= isset($s['REQUEST_URI']) ? $s['REQUEST_URI'] : ''; + + $query_clr = preg_replace('!\?.*?$!','',$query); + + + return compact('ssl','port','scheme','standart_port','host','host_full','query','query_clr','protocol'); + } + + + public static function TYPE_DETECT() + { + if (!isset($_SERVER["CONTENT_TYPE"])) return false; + + $type = trim(explode(';',$_SERVER["CONTENT_TYPE"])[0]); + $type = PRE::DOWN($type); + + + if ($type=='application/json') return 'json'; + + return false; + } + + + + public static function get2str($cust_get=null) + { + $get= (is_null($cust_get)) ? $_GET : $cust_get; + + if (!is_array($get) || !count($get)) return ''; + + $arr = []; + foreach ($get as $k => $v) + $arr[] = $k.'='.$v; + + return '?'.implode('&',$arr); + } + + + + public static function str2get($q="") + { + if(empty($q)) return false; + $q = explode('&',$q); + $out=[]; + $c = count($query); + + for ($i=0;$i<$c;$i++) + { + $r=explode('=',$q[$i]); + if(!isset($r[1])) $r[1]=''; + $out[$r[0]]=$r[1]; + } + + return $out; + } + + public static function MOVE($u) + { + http_response_code(301); + header("Location: ".$u); + exit(); + } + + public static function FIX_URLCASE($u) + { + $q = arr_v($u,'query',''); + if(empty($q)) return false; + + if (PRE::SHIFT($q,'DOWN')!=$q) + LE_URL::MOVE(PRE::SHIFT($u['full'],'DOWN')); + } + + +} \ No newline at end of file diff --git a/CLASSES/core/LE_SQLITE.php b/CLASSES/core/LE_SQLITE.php new file mode 100644 index 0000000..b7820f3 --- /dev/null +++ b/CLASSES/core/LE_SQLITE.php @@ -0,0 +1,7 @@ +meta = ['title'=>'','keywords'=>'','description'=>'']; + $this->prefix="main"; + $this->mod_cont=""; + $this->vars = ['tpl_arr'=>&$this->tpl_arr,'tpl'=>&$this]; + } + + + public function fetch($t,&$vars=array(),$prefix=false,$cache_en=false) + { + //выгружаем переменные в функцию + if (is_array($this->vars)) extract($this->vars); + if (is_array($vars)) extract($vars); + + //определяем путь до шаблона + $this->load_tpls[] = $__p = $this->path($t,$prefix); + + //инклудим шаблон, буферизуем его выхлоп + ob_start(); + include($__p); + return ob_get_clean(); + } + + public function path($tpl_path,$prefix=false) + { + if ($prefix===false) $prefix = $this->prefix; + $path = $prefix.DS.$tpl_path.".tpl"; + + $path_app = realpath((APPDIR."TPL".DS.$path)); + $path_sys = realpath((SYSDIR."TPL".DS.$path)); + + //echo APPDIR.$path.BR; + //echo SYSDIR.$path.BR; + + if (is_file($path_app)) return $path_app; + if (is_file($path_sys)) return $path_sys; + + exit($path." - NOT FOUND TPL"); + } + + public function display($prefix=false,$main_tpl="main") + { + //global $config,$db; + + $tpl = &$this; + + if ($this->debug) echo_arr($this->load_tpls); + if (arr_v($_POST,'clear')=='yes') $this->clear=1; + + if($prefix===false) $prefix = $this->prefix; + + include SYSDIR."TPL".DS.$prefix.DS."static_list.php"; + $this->static_dep_apply(); + $this->add_need_static(); + + + $path= $this->path($main_tpl,$prefix); + + if ($this->clear) + { + echo $this->mod_cont; + return ($this->clear=0); + } + + $tpl_arr = &$this->tpl_arr; + include($path); + + } + + //static elements + public $need_st_list=[],$static_list=[],$static_dep=[],$top_st=[],$bottom_st=[]; + + public function need_static($inp) + { + if (!is_array($inp)) $inp = [$inp]; + $cnt = count($inp); + + for($i=0;$i<$cnt;$i++) + { + $v = $inp[$i]; + if (empty($v)) continue; + $this->need_st_list[$v]=1; + } + } + + public function static_dep_apply($dep_list=false) + { + if ($dep_list===false) $dep_list=$this->static_dep; + + if (!is_array($dep_list) || empty($dep_list)) return; + + $need = &$this->need_st_list; + + foreach ($dep_list as $m_name => $dep_items) + { + //для выключенных модулей не применяем зависимости + if ( !(isset($need[$m_name]) && $need[$m_name]==1) ) continue; + + foreach ($dep_items as $k => $dep) + { + $need[$dep]=1; + } + } + + } + + public function add_need_static() + { + $need = $this->need_st_list; + $list = $this->static_list; + + foreach ($this->static_list as $key => $item) + { + $pos = arr_v($item,'pos',false); + $type = arr_v($item,'type',""); + $link = arr_v($item,'link',""); + //echo $link.BR; + if ($pos===false) $pos = ($type=="js") ? "bottom" : "top"; + $mod=arr_v($item,'mod','default'); + + if ( !((isset($need[$mod]) && $need[$mod]==1) || $mod=='default') ) continue; + + switch ($type) + { + case 'js': + $cont = $this->js($link); + break; + case 'css': + $cont = $this->css($link); + break; + + default: + continue 2; + break; + } + + if ($pos=="top") + $this->top_st[]=$cont; + else + $this->bottom_st[]=$cont; + + } + + $_gl = "\n\t"; + $this->head_cont.=implode($_gl,$this->top_st); + $this->cont_bottom.=implode($_gl,$this->bottom_st); + + //echo_arr($this->top_st); + + + } + + public function css($p,$min=0) + { + return ''; + } + + public function js($p,$min=0) + { + return ''; + } + + public function p2min($path,$min,$ext) + { + if ($min) + { + $path = str_replace('.'.$ext,'.min.'.$ext,$path); + $path = str_replace('min.min','min',$path); + } + + return $path; + } + + + + + + + + +} +/* +[],'js'=>[]]; + + function __construct() { + $this->tpl_arr = ['text'=>'','_html_'=>'','head_objects'=>'','meta_title'=>'','meta_keywords'=>'','meta_description'=>'']; + + $this->txt = &$this->tpl_arr['text']; + $this->vars = ['tpl_arr'=>&$this->tpl_arr,'tpl'=>&$this]; + } + + public function decl_p($inp) + { + $inp = MP_ARR::FROM_STR($inp); + while ($r = array_shift($inp)) $this->declare_parts[$r]=1; + } + + public function js4part($p,$f,$EOL=false,$pre="",$glued=1) + { + if (ST_GLUE && $glued) return $this->glue_reg('js',$p,$f); + + return $this->st4p($p,$this->js($f),$EOL,$pre); + } + + public function css4part($p,$f,$EOL=false,$pre="",$glued=1) + { + if (ST_GLUE && $glued) return $this->glue_reg('css',$p,$f); + + return $this->st4p($p,$this->css($f),$EOL,$pre); + } + + public function glue_reg($type,$p,$url) + { + + $path = str_replace('/mp_pub',SYSDIR."PUB", $url); + $path = str_replace('/pub_data',WEBDIR."pub_data", $path); + switch ($type) { + case 'css': + $path = str_replace('.css','.min.css',$path); + break; + case 'js': + $path = str_replace('.js','.min.js',$path); + break; + + } + + $this->glue_arr[$type][] = + ['u'=>$url,'p'=>$path,'l'=> ((int)$this->if_decl_p($p))]; + } + + public function glue_stat() + { + $js_k = $css_k = ""; + if (!ST_GLUE) return; + + foreach ($this->glue_arr['js'] as $key => $it) $js_k.=$it['l']; + + foreach ($this->glue_arr['css'] as $key => $it) $css_k.=$it['l']; + + + $alph = [0,1,2,3,4,5,6,7,8,9,'A','B','C','D','E','F','G','H','I','J','K', + 'L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','_','-','=']; + + $js_k = int2alphabet($alph,bindec($js_k)); + $css_k = int2alphabet($alph,bindec($css_k)); + + + $glue_path = WEBDIR."pub_data/static_cache/"; + + $js_path = $glue_path.$js_k.".js"; + $css_path = $glue_path.$css_k.".css"; + + $glue_path = $alph = NULL; + unset($glue_path,$alph); + + if (!is_file($js_path) && count($this->glue_arr['js'])) + { + foreach ($this->glue_arr['js'] as $key => $it) + { + if (!$it['l']) continue;*/ + //$pre = '/* file: '.$it['u'].'*/'."\n"; + /* file_put_contents($js_path,$pre.file_get_contents($it['p'])."\n",FILE_APPEND); + + } + } + + if (!is_file($css_path) && count($this->glue_arr['css'])) + { + foreach ($this->glue_arr['css'] as $key => $it) + { + if (!$it['l']) continue;*/ + //$pre = '/* file: '.$it['u'].'*/'."\n"; + /*file_put_contents($css_path,$pre.file_get_contents($it['p'])."\n",FILE_APPEND); + + } + } + + + $this->to_head($this->css('/pub_data/static_cache/'.$css_k.".css",1)); + $js_block = ($this->js2bottom) ? 'bottom_js' : 'head_objects'; + $this->add2block($js_block,$this->js('/pub_data/static_cache/'.$js_k.".js",1)); + + } + + public function st4p ($p,$inc,$EOL=false,$pre="") + { + if($this->if_decl_p($p)) return $pre.$inc.(($EOL)?$EOL:''); + } + + public function st_format($inp,$pre="",$EOL="") + { + preg_match_all('!(\<[^>]+\>)!simu',$inp,$res); + foreach ($res[1] as $key => $v) echo $pre.$v.$EOL; + } + + public function undecl_p($inp) + { + if($this->if_decl_p($inp)) unset($this->declare_parts[$inp]); + } + + public function if_decl_p($inp) + { + if ($inp===0) return true; + return (isset($this->declare_parts[$inp])); + } + + //+++добавить несколько частей в массиве + public function part_css($part,$css) + { + if ($this->if_decl_p($part)) + echo $this->css($css); + } + + public function display($prefix=false,$tpl_name="default") + { + global $tpl,$config,$db; + + if (LST_TPL) echo_arr($this->load_tpls); + if (arr_v($_POST,'clear')=='yes') $this->clear=1; + + if($prefix===false) $prefix = $this->prefix; + if ($this->clear) + { + echo $this->tpl_arr['text']; + return ($this->clear=0); + } + + $tpl_arr = &$this->tpl_arr; + + include($this->path($tpl_name,$prefix)); + if (DBG_MGS) include($this->path('debug_message','default')); + return 1; + + } + + public function path($tpl_name,$prefix=false) + { + $p = ((empty($prefix))?$this->prefix:$prefix).DS.$tpl_name.'.tpl'; + if (is_file($p_=TPLDIR2.$p) || is_file($p_=TPLDIR1.$p)) + return str_replace('//','/',$p_); + exit($tpl_name.' - NOT FOUND!!!'); + } + public function add2block($k,$v){ + $this->tpl_arr[$k] = (isset($this->tpl_arr[$k]))? $this->tpl_arr[$k]."\r\n".$v : $v; + return $this; + } + + public function canonical($url) + { + $this->to_head(''); + } + + public function show_bl($n) + { + if (isset($this->tpl_arr[$n])) echo $this->tpl_arr[$n]; + } + + + + + + public function css($p,$nm=0) + { + return ''; + } + + public function js($p,$nm=0) + { + return ''; + } + + public function to_head($str) + { + return $this->add2block('head_objects',$str); + } + + public function add_js ($inp,$no_mod=0){ + return $this->to_head($this->js($inp,$no_mod)); + } + + public function add_css ($inp,$no_mod=0){ + return $this->to_head($this->css($inp,$no_mod)); + } + + + public function mp_css($inp) + { + $inp = MP_ARR::FROM_STR($inp); + + for ($i=0,$c=count($inp); $i < $c; $i++) + $this->add_css(M_PUB.'/css/'.$inp[$i]); + + return $this; + } + + public function mp_js($inp) + { + $inp = MP_ARR::FROM_STR($inp); + + for ($i=0,$c=count($inp); $i < $c; $i++) + $this->add_js(M_PUB.'/js/'.$inp[$i]); + + return $this; + } + + public function meta_tags ($i,$i2=false) + { + if ($i===false && is_array($i2)) + { + $i=[]; + list($i['meta_title'],$i['meta_keywords'],$i['meta_description']) = $i2; + } + $f = function($n) {return(htmlspecialchars($n));}; + $m_arr = SELECT_FROM_ARR('meta_description;meta_keywords',$i); + $m_arr = array_map($f,$m_arr); + //титл не экранируем + $m_arr['meta_title'] = $i['meta_title']; + unset($i); + $this->tpl_arr = array_merge($this->tpl_arr,$m_arr); + //echo_arr($m_arr); + unset($f,$m_arr); + } + public function ograph($title,$description,$image,$url,$type="website") + { + $a = &$this->tpl_arr; + + $a['_html_'] = ' prefix="og: http://ogp.me/ns#"'; + $_arr = compact('title','type','url','description','image'); + + foreach ($_arr as $p => $v) + { + $v=htmlspecialchars($v); + $this->to_head(''); + } + } + + public function fetch($t,&$vars=array(),$prefix=false,$cache_en=false) + { + if ($cache_en) + { + $cache_key = MPCACHE::gen_key_p(array($t,$vars,$prefix)); + $cache = MPCACHE::from_cache("tpl_cache",$cache_key); + if($cache!==false) return $cache['content']; + } + + if (empty($t)||(mb_substr($t,0,1)=="#")) return ''; + + if (is_array($this->vars))extract($this->vars); + if (is_array($vars))extract($vars); + $tpl = &$this; + + $this->load_tpls[] = $__p = $this->path($t,$prefix); + + + ob_start(); + include($__p); + + if ($cache_en) + { + $html = ob_get_clean(); + MPCACHE::to_cache("tpl_cache",$cache_key,['content'=>$html]); + return $html; + } + return ob_get_clean(); + } + + public function txt($txt){$this->add2block('text',$txt);} +} +*/ \ No newline at end of file diff --git a/CLASSES/core/doc__LE_FS.md b/CLASSES/core/doc__LE_FS.md new file mode 100644 index 0000000..119ffb3 --- /dev/null +++ b/CLASSES/core/doc__LE_FS.md @@ -0,0 +1,36 @@ +# LE\_FS - класс для работы с файловой системой и файлами + +## GEN\_FNAME($inp\_name, $path, $prefix); + +example + +``` +LE_FS::GEN_FNAME("picture.png",WEBDIR."/pub_data/","prod_"); +``` + +Генерирует уникальное имя файла для указанной папки, расширение нового файла соответствует расширению входного в `$inp_name` + +Опционально к имени файла в начале пристыковывается в префикс, например `prod_` `cat_` ... +*** + +## Apply2Files($path,&$func,$recouse=0) + +> Данная функция создана для обработки массива данных +``` +LE_FS::Apply2Files("./inp_folder/",$callback,0); +``` + +* `$path` \- путь до папки +* `$func` \- callback функция в которую передается полный путь до файла +* `$recourse` \- признак рекурсивности\, по умолчанию применяется только к указанной папке\, но если указан флаг то пройдет по всем подпапкам +>Внутри callback функции нужно предусматривать фильтрацию по расширению файла, например только xml или только jpg... +> +## SAVE_POST($inp,&$debug=false) - сохранение файла из POST +Сохраняет файл переданный в POST с указанным именем поля формы в POST в указанную папку `` +``` +LE_FS::SAVE_POST(['f_name'=>'img_file','path'=>'/www/path/']) +``` + +Уникальное имя файлов генерируется автоматически... + + diff --git a/LE/core.php b/LE/core.php new file mode 100644 index 0000000..edc7a94 --- /dev/null +++ b/LE/core.php @@ -0,0 +1,133 @@ +'; + print_r($arr); + if (ISWEB) echo ''; +} + + +/*core class*/ +class LE +{ + public static $DB,$TPL,$CACHE,$QUERY_DATA_TYPE; + + + public static function DEF ($constant_name,$val=false) + { + if (!defined($constant_name)) define($constant_name, $val); + } + + + + +} + +/*date prepare class*/ +//prepare class +class PRE { + public static $MASK = ['D' => '0-9', 'R' => 'а-яё', 'L' => 'a-z', 'S' => '\s']; + public static $SH_MASK = [ + 'UP' => MB_CASE_UPPER, + 'DOWN' => MB_CASE_LOWER, + 'U1' => MB_CASE_TITLE]; + + + public static function SQL($s) + { + if (method_exists(LE::$DB, 'prepare')) return LE::$DB->prepare($s); + return addslashes($s); + } + public static function DOWN($s) + { + return mb_convert_case($s, MB_CASE_LOWER); + } + public static function UP($s) + { + return mb_convert_case($s, MB_CASE_UPPER); + } + + + public static function SHIFT($s, $t) + { + if (isset(PRE::$SH_MASK[$t])) { + return mb_convert_case($s, PRE::$SH_MASK[$t]); + + } + exit('shift err mask'); + } + + public static function f2int($n,int $m):int + { + if (empty($n)) return 0; + $n=(float)$n; + + $n*=pow(10,$m+1); + return (int) Ceil(round($n)/10); + } + public static function F($s, $t) { + $preg = strtr(preg_quote(trim($t), '!'), PRE::$MASK); + return preg_replace('![^' . $preg . ']!iu', '', $s); + } + + public static function UP1($s) { + $s = PRE::SHIFT(trim($s),'DOWN'); + $w = preg_split('/\s+/', $s); + + if (isset($w[0])) + { + $w[0] = PRE::SHIFT($w[0],'U1'); + return implode(' ',$w); + } + return $s; + + } + + public static function INT($i):int {return (int)PRE::NUM($i);} + public static function NUM($i) {return preg_replace('![^0-9]!', '', $i);} + public static function DEC($i):float { + $i= preg_replace('/[^\-0-9,.]/u', '', $i); + return (float)preg_replace('!([\-]?[0-9]+)[,.]?([0-9]+)?!', '$1.$2', $i); + } + public static function MONEY_OUT($i) {return money_format('%n', $i);} + //удаляет двойные пробелы и табы + public static function DSP($i) + { + return preg_replace('/\s{1,}/u', " ", $i); + } + public static function PLAIN_FORMAT($str,$one_str=0) + { + $str = PRE::DSP($str); + if ($one_str) $str = preg_replace('!([\n]*)!simu', '', $str); + $str = preg_replace('![\s]*([,.])!simu', '$1', $str); + $str = trim($str); + return $str; + } + //подрезает строку по разрешенному лимиту + public static function CROP($s,$l=0){return (($l>0)?mb_substr($s,0,$l):$s);} +} + + +/**приведение в алфавит $a числа $int */ +function int2alphabet(array $a,int $int):string +{ + $cnt = count($a); //емкость алфавита + $out=""; + while ($int>=$cnt) + { + $out = ($a[($int % $cnt)]).$out; + $int = intdiv($int, $cnt); + } + + return $a[$int].$out; +} \ No newline at end of file diff --git a/LE/core_fuctions.md b/LE/core_fuctions.md new file mode 100644 index 0000000..3409dbb --- /dev/null +++ b/LE/core_fuctions.md @@ -0,0 +1,5 @@ +# Описание базовых +>jjj +>kkk +> + diff --git a/LE/db_init.php b/LE/db_init.php new file mode 100644 index 0000000..036d6ab --- /dev/null +++ b/LE/db_init.php @@ -0,0 +1,5 @@ +init_path!==false) + include $le_mod_loader->init_path; +//load mod +if ($le_mod_loader->mod_path!==false) + include $le_mod_loader->mod_path; +//not found +if ($le_mod_loader->mod_path==false) + include $le_mod_loader->select_path('main','__404.php'); + diff --git a/LE/session.php b/LE/session.php new file mode 100644 index 0000000..7fd8cbf --- /dev/null +++ b/LE/session.php @@ -0,0 +1,19 @@ +180) + setcookie ("PHPSESSID", session_id() , ($_SESSION['_exp']=$_exp) ,'/'); \ No newline at end of file diff --git a/LE/sys_autoload.php b/LE/sys_autoload.php new file mode 100644 index 0000000..e2a2a9f --- /dev/null +++ b/LE/sys_autoload.php @@ -0,0 +1,6 @@ + 'welcome','admin'=>'dashboard']; +public static $MOD_ALIASES; +public static $USE_MYSQL = TRUE; +public static $USE_TPL = TRUE; +public static $ADMIN_MAIL = ''; +public static $ROBOT_MAIL = ''; +public static $DISP_TIME = FALSE; +public static $DB = ['host'=>'localhost','user'=>'','pass'=>'','db_name' =>'']; + +public static $SPACE_LIST=['admin|cabinet'=>'admin','main'=>'main']; +public static $SESS_DIR; +public static $SESS_TIME=120960; +public static $MPV; +public static $DR_N="LE CMS"; +public static $CACH_DIR; +} + +SYSCONF::$SESS_DIR = APPDIR.'sessions'.DS; +SYSCONF::$CACH_DIR = APPDIR.'cache'.DS; + +if (is_file(APPDIR.'app_conf.php')) include APPDIR.'app_conf.php'; \ No newline at end of file diff --git a/MODULES/admin/__space_init.php b/MODULES/admin/__space_init.php new file mode 100644 index 0000000..4298284 --- /dev/null +++ b/MODULES/admin/__space_init.php @@ -0,0 +1,3 @@ +prefix="admin"; \ No newline at end of file diff --git a/MODULES/admin/blog.php b/MODULES/admin/blog.php new file mode 100644 index 0000000..2f8a081 --- /dev/null +++ b/MODULES/admin/blog.php @@ -0,0 +1,94 @@ +check_dest_folder($dest)) return false; + $filename = LE_FS::SAVE_POST(['f_name'=>'upload','path'=>$dest]); + return ['url'=>'/pub_data/upload/img/'.$filename, 'as_is'=>1]; + } + + protected function _ajx_save_content($data) + { + $id = PRE::INT($data['id']); + + $html_cont = $data['html_cont']; + preg_match('!(

(.*?)<\/h1>)?(.*)!simu',$html_cont,$out); + $html_cont = $out[3]; + $html_head = trim($out[2]); + //return; + + $save_data = ['id'=>$id,'html'=>$html_cont,'head'=>$html_head]; + + $id = LE::$DB->SAVE('text_content',$save_data); + + return $id; + } + + protected function _ajx_remove_it($inp) + { + if (!isset($inp['id'])) return false; + + $id=PRE::INT($inp['id']); + if (!$id>0) return false; + $res = LE::$DB->DEL('text_content',$id); + return ($res>0); + } + + protected function _inp_default($inp) + { + $res = LE::$DB->query_arr("SELECT * FROM `text_content`",'id'); + + $to_tpl['cont_list'] = $res; + return LE::$TPL->fetch('blog/list',$to_tpl); + } + + protected function _inp_edit($inp) + { + $id = PRE::INT($inp); + if ($id>0) + { + $res = LE::$DB->query_single("SELECT * FROM `text_content` WHERE `id`=".$id); + $it_data = json_decode($res['data'],1); + } + else + { + $res = ['html'=>'','head'=>'']; + $it_data = []; + $id=0; + } + + $to_tpl = [ + 'data'=>$it_data, + 'id'=>$id, + 'html_cont'=>$res['html'], + 'head'=>$res['head'] + ]; + + return LE::$TPL->fetch('blog/edit_item',$to_tpl); + } +} + + + + +include CLSDIR."blog.php"; +$blog_model = new blog_model; + + +$controller = new CONTR($le_mod_loader->url,$blog_model); + + +LE::$TPL->mod_cont .= $controller->start(); \ No newline at end of file diff --git a/MODULES/main/__404.php b/MODULES/main/__404.php new file mode 100644 index 0000000..f83ab1a --- /dev/null +++ b/MODULES/main/__404.php @@ -0,0 +1,3 @@ +PAGE NOT FOUND

"; \ No newline at end of file diff --git a/MODULES/main/__space_init.php b/MODULES/main/__space_init.php new file mode 100644 index 0000000..e69de29 diff --git a/MODULES/main/editor_test.php b/MODULES/main/editor_test.php new file mode 100644 index 0000000..fd3605d --- /dev/null +++ b/MODULES/main/editor_test.php @@ -0,0 +1,68 @@ +'upl_img','path'=>$uploaddir]); + + return ['url'=>'/pub_data/upload/img/'.$filename]; + } + + protected function _ajx_save_content($data) + { + $md_cont = $data['md_cont']; + + $id = PRE::INT($data['id']); + + $_data = json_encode(['md_cont'=>$md_cont]); + $html_cont = $data['html_cont']; + + $save_data = ['id'=>$id,'data'=>$_data,'html'=>$html_cont]; + + $id = LE::$DB->SAVE('text_content',$save_data); + + return $id; + } + + protected function _inp_default($inp) + { + $res = LE::$DB->query_arr("SELECT * FROM `text_content`",'id'); + + $to_tpl['cont_list'] = $res; + return LE::$TPL->fetch('le_ui_kit/editor_list',$to_tpl); + } + + protected function _inp_edit($inp) + { + $id = PRE::INT($inp); + if (!$id>0) return false; + + $res = LE::$DB->query_single("SELECT * FROM `text_content` WHERE `id`=".$id); + $it_data = json_decode($res['data'],1); + $to_tpl = compact('it_data','res','id'); + $to_tpl['md_cont'] = (isset($it_data['md_cont'])) ? $it_data['md_cont'] : ''; + return LE::$TPL->fetch('le_ui_kit/test_ckeditor',$to_tpl); + //return LE::$TPL->fetch('le_ui_kit/test_editor',$to_tpl); + } +} + + + + +//echo_arr($le_mod_loader->url); + +$controller = new CONTR($le_mod_loader->url); +//$mod_out = $controller->start(); + + + + + +LE::$TPL->mod_cont .= $controller->start(); \ No newline at end of file diff --git a/MODULES/main/shop.php b/MODULES/main/shop.php new file mode 100644 index 0000000..e69de29 diff --git a/MODULES/main/ui_test copy.php b/MODULES/main/ui_test copy.php new file mode 100644 index 0000000..1eac247 --- /dev/null +++ b/MODULES/main/ui_test copy.php @@ -0,0 +1,191 @@ + + + + + LE UIKit + + + + + + + + + + +*/?> + + + + + + + + + + + + + + +
+ + +
+Заголовок формы + +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
Горизонтальный селект
+
+ +
+ +
+ +
+
Радиокнопки
+
+ + +
+
+ +
+
Радиокнопки вертикально
+
+ + +
+
+ +
+
Чекбоксы*
+
+ + +
+
+ +
+
Радиокнопки в линию
+
+ + +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ + +
+ + + + + +
+ +
+ +
+
+
+
+

Markdown Editor from ToastUI

+ +
+html get | +markdown get | +Code hilight | + + + +
+ + + + + + + + + + + diff --git a/MODULES/main/ui_test.php b/MODULES/main/ui_test.php new file mode 100644 index 0000000..83088e8 --- /dev/null +++ b/MODULES/main/ui_test.php @@ -0,0 +1,33 @@ +1]; + $out['data'] = ['url'=>'/pub_data/upload/img/'.$f_name]; + $mod_out = json_encode($out); + } +} + + +else +$mod_out = LE::$TPL->fetch('le_ui_kit/test1'); + +//out to tpl +LE::$TPL->mod_cont .= $mod_out; \ No newline at end of file diff --git a/MODULES/main/welcome.php b/MODULES/main/welcome.php new file mode 100644 index 0000000..1de5125 --- /dev/null +++ b/MODULES/main/welcome.php @@ -0,0 +1 @@ +Добро пожаловать в новый мир!!! \ No newline at end of file diff --git a/PUB/css/content_editor.css b/PUB/css/content_editor.css new file mode 100644 index 0000000..e69de29 diff --git a/PUB/css/le_form.css b/PUB/css/le_form.css new file mode 100644 index 0000000..d7f3e70 --- /dev/null +++ b/PUB/css/le_form.css @@ -0,0 +1,275 @@ +/*sys*/ +body { + font-family: sans-serif; +} + + +/*reset form*/ +input, select, button, textarea { + border:1px solid #b8b8b8; + border-radius: 0; + -webkit-border-radius: 0px; + border-radius:0; + padding:1px 5px; + height: 40px; + box-sizing: border-box; + font-family: inherit; + font-size:16px; +} + +textarea { + min-height: 200px; + padding:8px 8px; +} + +select { +-webkit-appearance: none; +-moz-appearance: none; +padding-right: 20px; +background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2224%22%20height%3D%2216%22%20viewBox%3D%220%200%2024%2016%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Cpolygon%20fill%3D%22%23666%22%20points%3D%2212%201%209%206%2015%206%22%20%2F%3E%0A%20%20%20%20%3Cpolygon%20fill%3D%22%23666%22%20points%3D%2212%2013%209%208%2015%208%22%20%2F%3E%0A%3C%2Fsvg%3E%0A") +, +linear-gradient(to bottom, #ffffff 0%,#ffffff 100%); +background-repeat: no-repeat; +/*background-position: 100% 50%;*/ +background-size: 30px auto, 100%; + +background-position: right -5px top 50%, 0 0; +} + + +input[type=radio], input[type=checkbox] +{ + display: inline-block; + height: 16px; + width: 16px; + overflow: hidden; + margin-top: -1px; + vertical-align: middle; + -webkit-appearance: none; + -moz-appearance: none; + background-color: transparent; + background-repeat: no-repeat; + background-position: 50% 50%; + border: 1px solid #ccc; + transition: .2s ease-in-out; + transition-property: all; + transition-property: background-color,border; + margin-right: 4px; +} + +input[type=radio] { + border-radius: 50%; + margin-top: -4px; +} + +input[type=radio]:checked { + background-image:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Ccircle%20fill%3D%22%23fff%22%20cx%3D%228%22%20cy%3D%228%22%20r%3D%222%22%20%2F%3E%0A%3C%2Fsvg%3E"); + background-color: #1e87f0; + border-color: transparent; + background-size: 30px auto; +} + +input[type=checkbox]:checked { + background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2214%22%20height%3D%2211%22%20viewBox%3D%220%200%2014%2011%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Cpolygon%20fill%3D%22%23fff%22%20points%3D%2212%201%205%207.5%202%205%201%205.5%205%2010%2013%201.5%22%20%2F%3E%0A%3C%2Fsvg%3E%0A"); + background-color: #1e87f0; + border-color: transparent; +} + +input:focus:not([type="checkbox"]):not([type="radio"]), select:focus, textarea:focus { + outline: none; + border-color:#70aae4; + box-shadow: inset 0 0 3px -2px #117de9; +} + + + + +/*form blocks style*/ +.le_form { + display: block; + overflow: hidden; + margin: 10px 0; + padding:25px; + color:#555; + + } + +.le_form_head { + display: block; + font-size: 150%; + padding-bottom: 10px; + border-bottom: 1px solid #d9d9d9; + margin-bottom: 20px; + +} + +.le_shadow { + box-shadow: 0 2px 10px rgba(94, 94, 94, 0.08); + border:1px solid #ececec; +} + + +.le_he .le_inp { + margin-left:300px; +} + +.le_fl { + font-size: 14px; + +} + +.le_he .le_fl { + width:290px; + float:left; + display: flex; + + align-items: center; + min-height: 40px; + +} + +.le_he, .le_ve { + margin-bottom: 25px; +overflow: hidden; +border-bottom: 1px solid #e9e9e9; +padding-bottom: 25px; + +} + +.le_ve .le_fl { + margin-bottom: 3px; + display: block; +} + +.le_inp input:not([type="checkbox"]):not([type="radio"]), +.le_inp select, +.le_inp textarea +{ + max-width: 100%; + width:100%; +} + +/*le multi elements*/ +.le_me label{ +display: block; +padding-top:8px; +} + +/*Multi Element Horizontal*/ +.le_meh label{ +float:left; +margin-right:10px; +} + + +.le_he { + display:flex; + flex-wrap: wrap; +} + +.le_he .le_fl { +min-width: 200px; +flex:40%; +flex-grow: 1; +} + +.le_he .le_inp { +margin-left:0; +flex-grow: 1; /*растягиваться на свободное пространство*/ +min-width: 200px; +flex:60%; +} + +.le_fl sup { + color:red; +font-size: 17px; +font-weight: bold; +padding-left: 2px; +} + + + +/*buttons*/ +.le_btn { +display: inline-block; +font-weight: 400; +text-align: center; +white-space: nowrap; +vertical-align: middle; +-webkit-user-select: none; +-moz-user-select: none; +-ms-user-select: none; +user-select: none; +border: 1px solid #c9c9c9; + +padding: .375rem .75rem; +font-size: 1rem; +line-height: 1.5; +transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out; +background-color: #f9f9f9; +background: linear-gradient(to bottom, #f9f9f9,#f9f9f9); +} + + .le_btn:hover { + background: linear-gradient(to bottom, #f9f9f9,#f3f3f3); + border-color:#b5b5b5; +} + + +/*гамбургеры и крестики*/ +#nav-icon6 { + width: 60px; + height: 45px; + position: relative; + transition-duration: 1s; + margin: 48px auto 12px auto; + cursor: pointer; +} +#nav-icon6 span { + height: 9px; + width: 60px; + background-color: #337AB7; + border-radius: 20px; + position: absolute; + transition-duration: .25s; + transition-delay: .25s; +} +#nav-icon6 span:before { + left: 0; + position: absolute; + top: -18px; + height: 9px; + width: 60px; + background-color: #337AB7; + content: ""; + border-radius: 20px; + transition-duration: .25s; + transition: transform .25s, top .25s .25s; +} +#nav-icon6 span:after { + left: 0; + position: absolute; + top: 18px; + height: 9px; + width: 60px; + background-color: #337AB7; + content: ""; + border-radius: 20px; + transition-duration: .25s; + transition: transform .25s, top .25s .25s; +} +#nav-icon6.open span { + transition-duration: 0.1s; + transition-delay: .25s; + background: transparent; +} +#nav-icon6.open span:before { + transition: top .25s, transform .25s .25s; + top: 0px; + transform: rotateZ(-45deg); +} +#nav-icon6.open span:after { + transition: top 0.4s, transform .25s .25s; + top: 0px; + transform: rotateZ(45deg); +} \ No newline at end of file diff --git a/PUB/css/le_form.min.css b/PUB/css/le_form.min.css new file mode 100644 index 0000000..5cb54cd --- /dev/null +++ b/PUB/css/le_form.min.css @@ -0,0 +1 @@ +body{font-family:sans-serif}button,input,select,textarea{border:1px solid #b8b8b8;border-radius:0;-webkit-border-radius:0;border-radius:0;padding:1px 5px;height:40px;box-sizing:border-box;font-family:inherit;font-size:16px}textarea{min-height:200px;padding:8px 8px}select{-webkit-appearance:none;-moz-appearance:none;padding-right:20px;background-image:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2224%22%20height%3D%2216%22%20viewBox%3D%220%200%2024%2016%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Cpolygon%20fill%3D%22%23666%22%20points%3D%2212%201%209%206%2015%206%22%20%2F%3E%0A%20%20%20%20%3Cpolygon%20fill%3D%22%23666%22%20points%3D%2212%2013%209%208%2015%208%22%20%2F%3E%0A%3C%2Fsvg%3E%0A"),linear-gradient(to bottom,#fff 0,#fff 100%);background-repeat:no-repeat;background-size:30px auto,100%;background-position:right -5px top 50%,0 0}input[type=checkbox],input[type=radio]{display:inline-block;height:16px;width:16px;overflow:hidden;margin-top:-1px;vertical-align:middle;-webkit-appearance:none;-moz-appearance:none;background-color:transparent;background-repeat:no-repeat;background-position:50% 50%;border:1px solid #ccc;transition:.2s ease-in-out;transition-property:all;transition-property:background-color,border;margin-right:4px}input[type=radio]{border-radius:50%;margin-top:-4px}input[type=radio]:checked{background-image:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Ccircle%20fill%3D%22%23fff%22%20cx%3D%228%22%20cy%3D%228%22%20r%3D%222%22%20%2F%3E%0A%3C%2Fsvg%3E");background-color:#1e87f0;border-color:transparent;background-size:30px auto}input[type=checkbox]:checked{background-image:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2214%22%20height%3D%2211%22%20viewBox%3D%220%200%2014%2011%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%3Cpolygon%20fill%3D%22%23fff%22%20points%3D%2212%201%205%207.5%202%205%201%205.5%205%2010%2013%201.5%22%20%2F%3E%0A%3C%2Fsvg%3E%0A");background-color:#1e87f0;border-color:transparent}input:focus:not([type=checkbox]):not([type=radio]),select:focus,textarea:focus{outline:0;border-color:#70aae4;box-shadow:inset 0 0 3px -2px #117de9}.le_form{display:block;overflow:hidden;margin:10px 0;padding:25px;color:#555}.le_form_head{display:block;font-size:150%;padding-bottom:10px;border-bottom:1px solid #d9d9d9;margin-bottom:20px}.le_shadow{box-shadow:0 2px 10px rgba(94,94,94,.08);border:1px solid #ececec}.le_he .le_inp{margin-left:300px}.le_fl{font-size:14px}.le_he .le_fl{width:290px;float:left;display:flex;align-items:center;min-height:40px}.le_he,.le_ve{margin-bottom:25px;overflow:hidden;border-bottom:1px solid #e9e9e9;padding-bottom:25px}.le_ve .le_fl{margin-bottom:3px;display:block}.le_inp input:not([type=checkbox]):not([type=radio]),.le_inp select,.le_inp textarea{max-width:100%;width:100%}.le_me label{display:block;padding-top:8px}.le_meh label{float:left;margin-right:10px}.le_he{display:flex;flex-wrap:wrap}.le_he .le_fl{min-width:200px;flex:40%;flex-grow:1}.le_he .le_inp{margin-left:0;flex-grow:1;min-width:200px;flex:60%}.le_fl sup{color:red;font-size:17px;font-weight:700;padding-left:2px}.le_btn{display:inline-block;font-weight:400;text-align:center;white-space:nowrap;vertical-align:middle;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border:1px solid #c9c9c9;padding:.375rem .75rem;font-size:1rem;line-height:1.5;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;background-color:#f9f9f9;background:linear-gradient(to bottom,#f9f9f9,#f9f9f9)}.le_btn:hover{background:linear-gradient(to bottom,#f9f9f9,#f3f3f3);border-color:#b5b5b5}#nav-icon6{width:60px;height:45px;position:relative;transition-duration:1s;margin:48px auto 12px auto;cursor:pointer}#nav-icon6 span{height:9px;width:60px;background-color:#337ab7;border-radius:20px;position:absolute;transition-duration:.25s;transition-delay:.25s}#nav-icon6 span:before{left:0;position:absolute;top:-18px;height:9px;width:60px;background-color:#337ab7;content:"";border-radius:20px;transition-duration:.25s;transition:transform .25s,top .25s .25s}#nav-icon6 span:after{left:0;position:absolute;top:18px;height:9px;width:60px;background-color:#337ab7;content:"";border-radius:20px;transition-duration:.25s;transition:transform .25s,top .25s .25s}#nav-icon6.open span{transition-duration:.1s;transition-delay:.25s;background:0 0}#nav-icon6.open span:before{transition:top .25s,transform .25s .25s;top:0;transform:rotateZ(-45deg)}#nav-icon6.open span:after{transition:top .4s,transform .25s .25s;top:0;transform:rotateZ(45deg)} \ No newline at end of file diff --git a/PUB/css/reset.css b/PUB/css/reset.css new file mode 100644 index 0000000..ee9ce86 --- /dev/null +++ b/PUB/css/reset.css @@ -0,0 +1,369 @@ +/* http://meyerweb.com/eric/tools/css/reset/ + v2.0-modified | 20110126 + License: none (public domain) +*/ + +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +b, u, i, center, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td, +article, aside, canvas, details, embed, +figure, figcaption, footer, header, hgroup, +menu, nav, output, ruby, section, summary, +time, mark, audio, video { + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + font: inherit; + vertical-align: baseline; +} + +/* make sure to set some focus styles for accessibility */ +:focus { + outline: 0; +} + +/* HTML5 display-role reset for older browsers */ +article, aside, details, figcaption, figure, +footer, header, hgroup, menu, nav, section { + display: block; +} + +body { + line-height: 1; +} + +ol, ul { + list-style: none; +} + +blockquote, q { + quotes: none; +} + +blockquote:before, blockquote:after, +q:before, q:after { + content: ''; + content: none; +} + +table { + border-collapse: collapse; + border-spacing: 0; +} + +input[type=search]::-webkit-search-cancel-button, +input[type=search]::-webkit-search-decoration, +input[type=search]::-webkit-search-results-button, +input[type=search]::-webkit-search-results-decoration { + -webkit-appearance: none; + -moz-appearance: none; +} + +input[type=search] { + -webkit-appearance: none; + -moz-appearance: none; + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; +} + +textarea { + overflow: auto; + vertical-align: top; + resize: vertical; +} + +/** + * Correct `inline-block` display not defined in IE 6/7/8/9 and Firefox 3. + */ + +audio, +canvas, +video { + display: inline-block; + *display: inline; + *zoom: 1; + max-width: 100%; +} + +/** + * Prevent modern browsers from displaying `audio` without controls. + * Remove excess height in iOS 5 devices. + */ + +audio:not([controls]) { + display: none; + height: 0; +} + +/** + * Address styling not present in IE 7/8/9, Firefox 3, and Safari 4. + * Known issue: no IE 6 support. + */ + +[hidden] { + display: none; +} + +/** + * 1. Correct text resizing oddly in IE 6/7 when body `font-size` is set using + * `em` units. + * 2. Prevent iOS text size adjust after orientation change, without disabling + * user zoom. + */ + +html { + font-size: 100%; /* 1 */ + -webkit-text-size-adjust: 100%; /* 2 */ + -ms-text-size-adjust: 100%; /* 2 */ +} + +/** + * Address `outline` inconsistency between Chrome and other browsers. + */ + +a:focus { + outline: thin dotted; +} + +/** + * Improve readability when focused and also mouse hovered in all browsers. + */ + +a:active, +a:hover { + outline: 0; +} + +/** + * 1. Remove border when inside `a` element in IE 6/7/8/9 and Firefox 3. + * 2. Improve image quality when scaled in IE 7. + */ + +img { + border: 0; /* 1 */ + -ms-interpolation-mode: bicubic; /* 2 */ +} + +/** + * Address margin not present in IE 6/7/8/9, Safari 5, and Opera 11. + */ + +figure { + margin: 0; +} + +/** + * Correct margin displayed oddly in IE 6/7. + */ + +form { + margin: 0; +} + +/** + * Define consistent border, margin, and padding. + */ + +fieldset { + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em; +} + +/** + * 1. Correct color not being inherited in IE 6/7/8/9. + * 2. Correct text not wrapping in Firefox 3. + * 3. Correct alignment displayed oddly in IE 6/7. + */ + +legend { + border: 0; /* 1 */ + padding: 0; + white-space: normal; /* 2 */ + *margin-left: -7px; /* 3 */ +} + +/** + * 1. Correct font size not being inherited in all browsers. + * 2. Address margins set differently in IE 6/7, Firefox 3+, Safari 5, + * and Chrome. + * 3. Improve appearance and consistency in all browsers. + */ + +button, +input, +select, +textarea { + font-size: 100%; /* 1 */ + margin: 0; /* 2 */ + vertical-align: baseline; /* 3 */ + *vertical-align: middle; /* 3 */ +} + +/** + * Address Firefox 3+ setting `line-height` on `input` using `!important` in + * the UA stylesheet. + */ + +button, +input { + line-height: normal; + border-radius: 0; + border: 1px solid rgb(187, 183, 183); + background: #fff; +} + +/** + * Address inconsistent `text-transform` inheritance for `button` and `select`. + * All other form control elements do not inherit `text-transform` values. + * Correct `button` style inheritance in Chrome, Safari 5+, and IE 6+. + * Correct `select` style inheritance in Firefox 4+ and Opera. + */ + +button, +select { + text-transform: none; +} + +/** + * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` + * and `video` controls. + * 2. Correct inability to style clickable `input` types in iOS. + * 3. Improve usability and consistency of cursor style between image-type + * `input` and others. + * 4. Remove inner spacing in IE 7 without affecting normal text inputs. + * Known issue: inner spacing remains in IE 6. + */ + +button, +html input[type="button"], /* 1 */ +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; /* 2 */ + cursor: pointer; /* 3 */ + *overflow: visible; /* 4 */ +} + +/** + * Re-set default cursor for disabled elements. + */ + +button[disabled], +html input[disabled] { + cursor: default; +} + +/** + * 1. Address box sizing set to content-box in IE 8/9. + * 2. Remove excess padding in IE 8/9. + * 3. Remove excess padding in IE 7. + * Known issue: excess padding remains in IE 6. + */ + +input[type="checkbox"], +input[type="radio"] { + box-sizing: border-box; /* 1 */ + padding: 0; /* 2 */ + *height: 13px; /* 3 */ + *width: 13px; /* 3 */ +} + +/** + * 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome. + * 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome + * (include `-moz` to future-proof). + */ + +input[type="search"] { + -webkit-appearance: textfield; /* 1 */ + -moz-box-sizing: content-box; + -webkit-box-sizing: content-box; /* 2 */ + box-sizing: content-box; +} + +/** + * Remove inner padding and search cancel button in Safari 5 and Chrome + * on OS X. + */ + +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} + +/** + * Remove inner padding and border in Firefox 3+. + */ + +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0; +} + +/** + * 1. Remove default vertical scrollbar in IE 6/7/8/9. + * 2. Improve readability and alignment in all browsers. + */ + +textarea { + overflow: auto; /* 1 */ + vertical-align: top; /* 2 */ +} + +/** + * Remove most spacing between table cells. + */ + +table { + border-collapse: collapse; + border-spacing: 0; +} + +html, +button, +input, +select, +textarea { + color: #222; +} + + +::-moz-selection { + background: #b3d4fc; + text-shadow: none; +} + +::selection { + background: #b3d4fc; + text-shadow: none; +} + +img { + vertical-align: middle; +} + +fieldset { + border: 0; + margin: 0; + padding: 0; +} + +textarea { + resize: vertical; +} + +.chromeframe { + margin: 0.2em 0; + background: #ccc; + color: #000; + padding: 0.2em 0; +} \ No newline at end of file diff --git a/PUB/css/reset.min.css b/PUB/css/reset.min.css new file mode 100644 index 0000000..01b7247 --- /dev/null +++ b/PUB/css/reset.min.css @@ -0,0 +1 @@ +a,abbr,acronym,address,applet,article,aside,audio,b,big,blockquote,body,canvas,caption,center,cite,code,dd,del,details,dfn,div,dl,dt,em,embed,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,html,i,iframe,img,ins,kbd,label,legend,li,mark,menu,nav,object,ol,output,p,pre,q,ruby,s,samp,section,small,span,strike,strong,sub,summary,sup,table,tbody,td,tfoot,th,thead,time,tr,tt,u,ul,var,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}:focus{outline:0}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:after,blockquote:before,q:after,q:before{content:'';content:none}table{border-collapse:collapse;border-spacing:0}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration,input[type=search]::-webkit-search-results-button,input[type=search]::-webkit-search-results-decoration{-webkit-appearance:none;-moz-appearance:none}input[type=search]{-webkit-appearance:none;-moz-appearance:none;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}textarea{overflow:auto;vertical-align:top;resize:vertical}audio,canvas,video{display:inline-block;max-width:100%}audio:not([controls]){display:none;height:0}[hidden]{display:none}html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}a:focus{outline:thin dotted}a:active,a:hover{outline:0}img{border:0;-ms-interpolation-mode:bicubic}figure{margin:0}form{margin:0}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0;white-space:normal}button,input,select,textarea{font-size:100%;margin:0;vertical-align:baseline}button,input{line-height:normal;border-radius:0;border:1px solid #bbb7b7;background:#fff}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=search]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}textarea{overflow:auto;vertical-align:top}table{border-collapse:collapse;border-spacing:0}button,html,input,select,textarea{color:#222}::-moz-selection{background:#b3d4fc;text-shadow:none}::selection{background:#b3d4fc;text-shadow:none}img{vertical-align:middle}fieldset{border:0;margin:0;padding:0}textarea{resize:vertical}.chromeframe{margin:.2em 0;background:#ccc;color:#000;padding:.2em 0} \ No newline at end of file diff --git a/PUB/css/top_menu.css b/PUB/css/top_menu.css new file mode 100644 index 0000000..e69de29 diff --git a/PUB/css/txt_cont.css b/PUB/css/txt_cont.css new file mode 100644 index 0000000..1d7394c --- /dev/null +++ b/PUB/css/txt_cont.css @@ -0,0 +1,153 @@ +/*text block*/ +.txt_cont + { + overflow: hidden; + font-size: 20px; + color:#404040; +} +/*heading*/ +.txt_cont h1 {font-size:2em;} +.txt_cont h2 {font-size:1.6em;} +.txt_cont h3 {font-size:1.4em;} +.txt_cont h4 {font-size:1.1em;} + +.txt_cont p { + /*text-indent:1em;*/ + font-size: 1em; + line-height: 1.5em; +} + +/*image*/ +.txt_cont img { + +display: block; +margin: 0 auto; +max-width: 100%; +min-width: 50px; +} + + +.txt_cont .image { + display: table; + clear: both; + text-align: center; + margin: 1em auto; + /*border: 1px solid #e6e6e6;*/ + box-shadow: 0 0 6px 1px #aeaeae; +} + +/*image float*/ +.ck-content .image-style-side, +.txt_cont .image-style-side +{ + float:right; + margin-left:1.5em; + margin-top:0.2em !important; + +} + +.txt_cont .image > figcaption { + display:table-caption; + caption-side: bottom; + word-break: break-word; + color: #333; + background-color: #f7f7f7; + padding: .6em; + font-size: .75em; + outline-offset: -1px; + box-shadow: 0 0 6px 1px #aeaeae; +} + + + +.txt_cont figure.table {margin:0;} + + +/*video*/ +.txt_cont .media { + clear: both; + margin: 1em 0; + display: block; + min-width: 15em; +} + + +.txt_cont figure.table +{ + display: table; +} + + +.ck-content .table table td, +.ck-content .table table th, +.txt_cont .table table td, +.txt_cont .table table th + +{ + min-width: 2em; + padding: .4em; + border: 1px solid #bfbfbf; +} + +.txt_cont table { border-collapse: collapse; width: 100%; } + + +.ck-content .table table th , +.txt_cont .table table th +{ + font-weight: 700; + background: hsla(0,0%,0%,5%); +} + +.txt_cont .table th { + text-align: left; +} + + + +.txt_cont hr { + margin: 15px 0; + height: 4px; + background: #dedede; + border: 0; +} + +.txt_cont code { + background-color: hsla(0,0%,78%,.3); + padding: .15em; + border-radius: 2px; +} + +.txt_cont pre { + padding: 1em; + color: #353535; + background: hsla(0,0%,78%,.3); + border: 1px solid #c4c4c4; + border-radius: 2px; + text-align: left; + direction: ltr; + tab-size: 4; + white-space: pre-wrap; + font-style: normal; + min-width: 200px; + position: relative; +} + +.txt_cont pre code { + background-color: transparent; +} + +.txt_cont ul { + list-style-type: disc; + padding-left:18px; +} + +.txt_cont blockquote { + overflow: hidden; + padding-right: 1.5em; + padding-left: 1.5em; + margin-left: 0; + margin-right: 0; + font-style: italic; + border-left: 5px solid #ccc; +} \ No newline at end of file diff --git a/PUB/css/txt_cont.min.css b/PUB/css/txt_cont.min.css new file mode 100644 index 0000000..54f661e --- /dev/null +++ b/PUB/css/txt_cont.min.css @@ -0,0 +1 @@ +.txt_cont{overflow:hidden;font-size:20px;color:#404040}.txt_cont h1{font-size:2em}.txt_cont h2{font-size:1.6em}.txt_cont h3{font-size:1.4em}.txt_cont h4{font-size:1.1em}.txt_cont p{font-size:1em;line-height:1.5em}.txt_cont img{display:block;margin:0 auto;max-width:100%;min-width:50px}.txt_cont .image{display:table;clear:both;text-align:center;margin:1em auto;box-shadow:0 0 6px 1px #aeaeae}.ck-content .image-style-side,.txt_cont .image-style-side{float:right;margin-left:1.5em;margin-top:.2em!important}.txt_cont .image>figcaption{display:table-caption;caption-side:bottom;word-break:break-word;color:#333;background-color:#f7f7f7;padding:.6em;font-size:.75em;outline-offset:-1px;box-shadow:0 0 6px 1px #aeaeae}.txt_cont figure.table{margin:0}.txt_cont .media{clear:both;margin:1em 0;display:block;min-width:15em}.txt_cont figure.table{display:table}.ck-content .table table td,.ck-content .table table th,.txt_cont .table table td,.txt_cont .table table th{min-width:2em;padding:.4em;border:1px solid #bfbfbf}.txt_cont table{border-collapse:collapse;width:100%}.ck-content .table table th,.txt_cont .table table th{font-weight:700;background:hsla(0,0%,0%,5%)}.txt_cont .table th{text-align:left}.txt_cont hr{margin:15px 0;height:4px;background:#dedede;border:0}.txt_cont code{background-color:hsla(0,0%,78%,.3);padding:.15em;border-radius:2px}.txt_cont pre{padding:1em;color:#353535;background:hsla(0,0%,78%,.3);border:1px solid #c4c4c4;border-radius:2px;text-align:left;direction:ltr;tab-size:4;white-space:pre-wrap;font-style:normal;min-width:200px;position:relative}.txt_cont pre code{background-color:transparent}.txt_cont ul{list-style-type:disc;padding-left:18px}.txt_cont blockquote{overflow:hidden;padding-right:1.5em;padding-left:1.5em;margin-left:0;margin-right:0;font-style:italic;border-left:5px solid #ccc} \ No newline at end of file diff --git a/PUB/js/ckeditor5.js b/PUB/js/ckeditor5.js new file mode 100644 index 0000000..e660ddf --- /dev/null +++ b/PUB/js/ckeditor5.js @@ -0,0 +1,6 @@ +/*! + * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md. + */ +(function(t){const e=t["ru"]=t["ru"]||{};e.dictionary=Object.assign(e.dictionary||{},{"%0 of %1":"%0 из %1","Align cell text to the bottom":"Выровнять текст ячейки по нижнему краю","Align cell text to the center":"Выровнять текст по центру","Align cell text to the left":"Выровнять текст по левому краю","Align cell text to the middle":"Выровнять текст ячейки по центру","Align cell text to the right":"Выровнять текст по правому краю","Align cell text to the top":"Выровнять текст ячейки по верхнему краю","Align center":"Выравнивание по центру","Align left":"Выравнивание по левому краю","Align right":"Выравнивание по правому краю","Align table to the left":"Выровнять таблицу по левому краю","Align table to the right":"Выровнять таблицу по правому краю",Alignment:"Выравнивание",Aquamarine:"Аквамариновый",Background:"Фон",Black:"Чёрный","Block quote":"Цитата",Blue:"Синий",Bold:"Жирный",Border:"Граница","Bulleted List":"Маркированный список","Bulleted list styles toolbar":"Стили маркированного списка",Cancel:"Отмена","Cell properties":"Свойства ячейки","Center table":"Выровнять таблицу по центру","Centered image":"Выравнивание по центру","Change image text alternative":"Редактировать альтернативный текст","Choose heading":"Выбор стиля",Circle:"Окружность",Code:"Исходный код",Color:"Цвет","Color picker":"Выбор цвета",Column:"Столбец",Dashed:"Пунктирная",Decimal:"Десятичный","Decimal with leading zero":"Десятичный с ведущим нулем","Decrease indent":"Уменьшить отступ","Delete column":"Удалить столбец","Delete row":"Удалить строку","Dim grey":"Тёмно-серый",Dimensions:"Размеры",Disc:"Диск","Document colors":"Цвет страницы",Dotted:"Точечная",Double:"Двойная",Downloadable:"Загружаемые","Dropdown toolbar":"Выпадающая панель инструментов","Edit block":"Редактировать блок","Edit link":"Редактировать ссылку","Edit source":"Изменить код","Editor toolbar":"Панель инструментов редактора","Empty snippet content":"","Enter image caption":"Подпись к изображению","Font Color":"Цвет шрифта","Full size image":"Оригинальный размер изображения",Green:"Зелёный",Grey:"Серый",Groove:"Желобчатая","Header column":"Столбец заголовков","Header row":"Строка заголовков",Heading:"Стиль","Heading 1":"Заголовок 1","Heading 2":"Заголовок 2","Heading 3":"Заголовок 3","Heading 4":"Заголовок 4","Heading 5":"Заголовок 5","Heading 6":"Заголовок 6",Height:"Высота","Horizontal line":"Горизонтальная линия","Horizontal text alignment toolbar":"Панель инструментов горизонтального выравнивания текста","HTML snippet":"HTML сниппет","Image resize list":"Список размеров","Image toolbar":"Панель инструментов изображения","image widget":"Виджет изображений","Increase indent":"Увеличить отступ",Insert:"Вставить","Insert code block":"Вставить код","Insert column left":"Вставить столбец слева","Insert column right":"Вставить столбец справа","Insert HTML":"Вставить HTML","Insert image":"Вставить изображение","Insert image via URL":"Вставить изображение по URL","Insert media":"Вставить медиа","Insert paragraph after block":"Вставить параграф после блока","Insert paragraph before block":"Вставить параграф перед блоком","Insert row above":"Вставить строку выше","Insert row below":"Вставить строку ниже","Insert table":"Вставить таблицу",Inset:"Вдавленная",Italic:"Курсив",Justify:"Выравнивание по ширине","Justify cell text":"Выровнять текст по ширине","Left aligned image":"Выравнивание по левому краю","Light blue":"Голубой","Light green":"Салатовый","Light grey":"Светло-серый",Link:"Ссылка","Link image":"Ссылка на изображение","Link URL":"Ссылка URL","Lower-latin":"Малые латинские","Lower–roman":"Малые римские","Media toolbar":"Панель инструментов медиа","Media URL":"URL медиа","media widget":"медиа-виджет","Merge cell down":"Объединить с ячейкой снизу","Merge cell left":"Объединить с ячейкой слева","Merge cell right":"Объединить с ячейкой справа","Merge cell up":"Объединить с ячейкой сверху","Merge cells":"Объединить ячейки",Next:"Следующий","No preview available":"",None:"Нет","Numbered List":"Нумерованный список","Numbered list styles toolbar":"Стили нумерованного списка","Open in a new tab":"Открыть в новой вкладке","Open link in new tab":"Открыть ссылку в новой вкладке",Orange:"Оранжевый",Original:"Оригинальный",Outset:"Выпуклая",Padding:"Отступ",Paragraph:"Параграф","Paste raw HTML here...":"Вставьте HTML код сюда...","Paste the media URL in the input.":"Вставьте URL медиа в поле ввода.","Plain text":"Простой текст",Previous:"Предыдущий",Purple:"Фиолетовый",Red:"Красный",Redo:"Повторить","Remove color":"Убрать цвет","Remove Format":"Убрать форматирование","Resize image":"Изменить размер изображения","Resize image to %0":"Изменить размер изображения до %0","Resize image to the original size":"Вернуть размер изображения к оригинальному","Rich Text Editor":"Редактор","Rich Text Editor, %0":"Редактор, %0",Ridge:"Ребристая","Right aligned image":"Выравнивание по правому краю",Row:"Строка",Save:"Сохранить","Save changes":"Сохранить изменения","Select all":"Выбрать все","Select column":"Выбрать столбец","Select row":"Выбрать строку","Show more items":"Другие инструменты","Side image":"Боковое изображение",Solid:"Сплошная","Split cell horizontally":"Разделить ячейку горизонтально","Split cell vertically":"Разделить ячейку вертикально",Square:"Квадрат",Strikethrough:"Зачеркнутый",Style:"Стиль",Subscript:"Подстрочный",Superscript:"Надстрочный","Table alignment toolbar":"Панель инструментов выравнивания таблицы","Table cell text alignment":"Выравнивание текста в ячейке таблицы","Table properties":"Свойства таблицы","Table toolbar":"Панель инструментов таблицы","Text alignment":"Выравнивание текста","Text alignment toolbar":"Выравнивание","Text alternative":"Альтернативный текст",'The color is invalid. Try "#FF0000" or "rgb(255,0,0)" or "red".':'Неверный цвет. Попробуйте "#FF0000" или "rgb(255,0,0)" или "red".',"The URL must not be empty.":"URL не должен быть пустым.",'The value is invalid. Try "10px" or "2em" or simply "2".':'Неверное значение. Попробуйте "10px" или "2em" или просто "2".',"This link has no URL":"Для этой ссылки не установлен адрес URL","This media URL is not supported.":"Этот URL медиа не поддерживается.","Tip: Paste the URL into the content to embed faster.":"Подсказка: Вставьте URL в контент для быстрого включения.","Toggle the circle list style":"","Toggle the decimal list style":"","Toggle the decimal with leading zero list style":"","Toggle the disc list style":"","Toggle the lower–latin list style":"","Toggle the lower–roman list style":"","Toggle the square list style":"","Toggle the upper–latin list style":"","Toggle the upper–roman list style":"",Turquoise:"Бирюзовый","Type or paste your content here.":"Введите или вставьте сюда ваш текст","Type your title":"Введите заголовок",Underline:"Подчеркнутый",Undo:"Отменить",Unlink:"Убрать ссылку",Update:"Изменить","Update image URL":"Изменить URL изображения","Upload failed":"Загрузка не выполнена","Upload in progress":"Идёт загрузка","Upper-latin":"Большие латинские","Upper-roman":"Большие римские","Vertical text alignment toolbar":"Панель инструментов вертикального выравнивания текста",White:"Белый","Widget toolbar":"Панель инструментов виджета",Width:"Ширина",Yellow:"Жёлтый"});e.getPluralForm=function(t){return t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<12||t%100>14)?1:t%10==0||t%10>=5&&t%10<=9||t%100>=11&&t%100<=14?2:3}})(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));(function t(e,n){if(typeof exports==="object"&&typeof module==="object")module.exports=n();else if(typeof define==="function"&&define.amd)define([],n);else if(typeof exports==="object")exports["BalloonBlockEditor"]=n();else e["BalloonBlockEditor"]=n()})(window,(function(){return function(t){var e={};function n(o){if(e[o]){return e[o].exports}var i=e[o]={i:o,l:false,exports:{}};t[o].call(i.exports,i,i.exports,n);i.l=true;return i.exports}n.m=t;n.c=e;n.d=function(t,e,o){if(!n.o(t,e)){Object.defineProperty(t,e,{enumerable:true,get:o})}};n.r=function(t){if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(t,"__esModule",{value:true})};n.t=function(t,e){if(e&1)t=n(t);if(e&8)return t;if(e&4&&typeof t==="object"&&t&&t.__esModule)return t;var o=Object.create(null);n.r(o);Object.defineProperty(o,"default",{enumerable:true,value:t});if(e&2&&typeof t!="string")for(var i in t)n.d(o,i,function(e){return t[e]}.bind(null,i));return o};n.n=function(t){var e=t&&t.__esModule?function e(){return t["default"]}:function e(){return t};n.d(e,"a",e);return e};n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};n.p="";return n(n.s=77)}([function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));n.d(e,"b",(function(){return r}));const o="https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html";class i extends Error{constructor(t,e,n){const o=`${t}${n?` ${JSON.stringify(n)}`:""}${a(t)}`;super(o);this.name="CKEditorError";this.context=e;this.data=n}is(t){return t==="CKEditorError"}static rethrowUnexpectedError(t,e){if(t.is&&t.is("CKEditorError")){throw t}const n=new i(t.message,e);n.stack=t.stack;throw n}}function r(t,e){console.warn(...c(t,e))}function s(t,e){console.error(...c(t,e))}function a(t){return`\nRead more: ${o}#error-${t}`}function c(t,e){const n=a(t);return e?[t,e,n]:[t,n]}},function(t,e,n){"use strict";var o=function t(){var e;return function t(){if(typeof e==="undefined"){e=Boolean(window&&document&&document.all&&!window.atob)}return e}}();var i=function t(){var e={};return function t(n){if(typeof e[n]==="undefined"){var o=document.querySelector(n);if(window.HTMLIFrameElement&&o instanceof window.HTMLIFrameElement){try{o=o.contentDocument.head}catch(t){o=null}}e[n]=o}return e[n]}}();var r=[];function s(t){var e=-1;for(var n=0;nt.length)e=t.length;for(var n=0,o=new Array(e);n