~~~
var imode = 0;
var qmode = 0;
var km = new Array ( 128 ); // keymap
var cm = new Array ( 256 ); // charmap
var PRIMe = 233; // 'e
var PRIME = 201; // 'E
var COLo = 246; // :o
var COLO = 214; // :O
var COLu = 252; // :u
var COLU = 220; // :U
var HAMZA = 0x0626;
var CHEE = 0x0686;
var GHEE = 0x063A;
var NGEE = 0x06AD;
var SHEE = 0x0634;
var SZEE = 0x0698;
var OQUOTE = 0x00AB; // for opening quote (oh quote)
var CQUOTE = 0x00BB; // for closing quote
var RCQUOTE = 0x2019; // 0x2019 is right closed curly quote
var BPAD = 0x0600;
function gac ( ascii )
{
var str = "" + ascii;
return str.charCodeAt(0);
}
// returns a string from a given char code
function gas ( code )
{
return String.fromCharCode(code);
}
var i;
var inited = false;
function bedit_init ( ) {
var i;
if ( inited ) {
return;
}
inited = true;
// zero-out all entries first
for ( i = 0; i < km.length; i++ ) {
km[i] = 0;
}
km[gac('a')] = 0x06BE;
km[gac('b')] = 0x0628;
km[gac('c')] = 0x063A;
km[gac('D')] = 0x0698;
km[gac('d')] = 0x062F;
km[gac('e')] = 0x06D0;
km[gac('F')] = 0x0641;
km[gac('f')] = 0x0627;
km[gac('G')] = 0x06AF;
km[gac('g')] = 0x06D5;
km[gac('H')] = 0x062E;
km[gac('h')] = 0x0649;
km[gac('i')] = 0x06AD;
km[gac('J')] = 0x062C;
km[gac('j')] = 0x0642;
km[gac('K')] = 0x06C6;
km[gac('k')] = 0x0643;
km[gac('l')] = 0x0644;
km[gac('m')] = 0x0645;
km[gac('n')] = 0x0646;
km[gac('o')] = 0x0648;
km[gac('p')] = 0x067E;
km[gac('q')] = 0x0686;
km[gac('r')] = 0x0631;
km[gac('s')] = 0x0633;
km[gac('T')] = 0x0640; // space filler character
km[gac('t')] = 0x062A;
km[gac('u')] = 0x06C7;
km[gac('v')] = 0x06C8;
km[gac('w')] = 0x06CB;
km[gac('x')] = 0x0634;
km[gac('y')] = 0x064A;
km[gac('z')] = 0x0632;
km[gac('/')] = 0x0626;
for ( i = 0; i < km.length; i++ ) {
if ( km[i] != 0 ) {
var u = gac(gas(i).toUpperCase());
if ( km[u] == 0 ) {
km[u] = km[i];
}
}
}
km[gac(';')] = 0x061B;
km[gac('?')] = 0x061F;
km[gac(',')] = 0x060C;
km[gac('<')] = 0x203A; // for '鈥�'
km[gac('>')] = 0x2039; // for '鈥�'
km[gac('"')] = OQUOTE;
km[gac('{')] = gac ( '}' );
km[gac('}')] = gac ( '{' );
km[gac('[')] = gac ( ']' );
km[gac(']')] = gac ( '[' );
km[gac('(')] = gac ( ')' );
km[gac(')')] = gac ( '(' );
km[gac('}')] = 0x00AB;
km[gac('{')] = 0x00BB;
// zero-out all entries first
for ( i = 0; i < cm.length; i++ ) {
cm[i] = 0;
}
cm[gac('a')] = 0x0627;
cm[gac('b')] = 0x0628;
cm[gac('c')] = 0x0643;
cm[gac('d')] = 0x062F;
cm[gac('e')] = 0x06D5;
cm[gac('f')] = 0x0641;
cm[gac('g')] = 0x06AF;
cm[gac('h')] = 0x06BE;
cm[gac('i')] = 0x0649;
cm[gac('j')] = 0x062C;
cm[gac('k')] = 0x0643;
cm[gac('l')] = 0x0644;
cm[gac('m')] = 0x0645;
cm[gac('n')] = 0x0646;
cm[gac('o')] = 0x0648;
cm[gac('p')] = 0x067E;
cm[gac('q')] = 0x0642;
cm[gac('r')] = 0x0631;
cm[gac('s')] = 0x0633;
cm[gac('t')] = 0x062A;
cm[gac('u')] = 0x06C7;
cm[gac('v')] = 0x06CB;
cm[gac('w')] = 0x06CB;
cm[gac('x')] = 0x062E;
cm[gac('y')] = 0x064A;
cm[gac('z')] = 0x0632;
cm[PRIMe] = 0x06D0; // 'e
cm[PRIME] = 0x06D0; // 'E
cm[COLo] = 0x06C6; // :o
cm[COLO] = 0x06C6; // :O
cm[COLu] = 0x06C8; // :u
cm[COLU] = 0x06C8; // :U
for ( i = 0; i < cm.length; i++ ) {
if ( cm[i] != 0 ) {
var u = gac(gas(i).toUpperCase());
if ( cm[u] == 0 ) {
cm[u] = cm[i];
}
}
}
cm[gac(';')] = 0x061B;
cm[gac('?')] = 0x061F;
cm[gac(',')] = 0x060C;
}
function ak2uni ( akstr )
{
var str = akstr;
var akdif = String.fromCharCode(0x0622, 0x0623, 0x0624, 0x0626, 0x0629, 0x062B, 0x062D, 0x0630, 0x0635, 0x0636, 0x0638, 0x0649, 0x0639, 0x0647, gac('{'), gac('}'));
var akuni = String.fromCharCode(0x0698, 0x06C6, 0x06CB, 0x06D0, 0x06D5, 0x06AD, 0x0686, 0x06C7, 0x067E, 0x06AF, 0x0626, 0x06C8, 0x0649, 0x06BE, CQUOTE, OQUOTE);
for(var i = 0; i < akdif.length; i++ ) {
str = str.replace(new RegExp(akdif.substr(i,1), "g"), akuni.substr(i,1));
}
return str;
}
function uly2uy ( ustr )
{
var str = "";
var i, cur, prev, next, ch;
var ccode, ncode;
var wdbeg = true;
var bd = '`'; // beginning delimiter
var ed = '`'; // ending delimiter
var verbatim = false;
var uly = ustr;
// make URLs verbatim
var regExp = /(\w+[p|s]:\/\/\S*)/gi;
uly = uly.replace(regExp, bd + "$1" + ed );
// URLs without ://
regExp = /([\s|(]+\w+\.\w+\.\w+\S*)/g;
uly = uly.replace(regExp, bd + "$1" + ed );
// two-part URLs with well-known suffixes
regExp = /([\s|(|,|.]+\w+\.(com|net|org|cn)[\s|)|\.|,|.|$])/g;
uly = uly.replace(regExp, bd + "$1" + ed );
// email addresses
regExp = /(\w+@\w+\.\w[\w|\.]*\w)/g;
uly = uly.replace(regExp, bd + "$1" + ed );
if ( !inited ) {
bedit_init();
}
for ( i = 0; i < uly.length; i++ ) {
ch = 0;
cur = uly.charAt(i);
next = uly.charAt(i+1);
ccode = uly.charCodeAt(i);
ncode = uly.charCodeAt(i+1);
if ( verbatim == true ) {
if ( cur == ed ) { // ending verbatim mode
verbatim = false;
} else {
str += cur;
}
continue;
}
if ( cur == bd ) {
verbatim = true;
continue;
}
if ( cur == '|' && ( prev == 'u' ) && ( next == 'a' || next == 'e' ) ) {
wdbeg = false;
continue;
}
// add hamza in front of vowels in word-beginning positions
if ( wdbeg == true ) {
if ( isvowel(cur) ) {
str += gas(HAMZA);
}
} else {
if ( cur == '\'' || ccode == RCQUOTE ) {
if ( isvowel(next) ) {
wdbeg = false; // don't add another hamza in next round
str += gas(HAMZA);
continue;
} else if ( isalpha(ncode) ) {
continue;
}
}
}
// AA, AE, and non-alpha-numeric letters makes word beginning
if ( isvowel(cur) || !isalpha(ccode) ) {
wdbeg = true;
} else {
wdbeg = false;
}
switch ( cur ) { // handle joint-letters
case 'c':
case 'C':
if ( next == 'h' || next == 'H' ) {
ch = CHEE;
}
break;
case 'g':
case 'G':
if ( next == 'h' || next == 'H' ) {
ch = GHEE;
}
break;
case 'n':
case 'N':
if ( next == 'g' || next == 'G' ) {
tmpch = uly.charAt(i+2);
if ( tmpch != 'h' && tmpch != 'H' ) {
ch = NGEE;
}
}
break;
case 's':
case 'S':
if ( next == 'h' || next == 'H' ) {
ch = SHEE;
} else if ( next == 'z' || next == 'Z' ) { // ULY does not provide a unique SZEE, we use 'sz'
ch = SZEE;
}
break;
default:
break;
}
if ( ch != 0 ) {
i++; // advance index for joint letters
str += gas(ch);
} else if ( ccode < cm.length && cm[ccode] ) {
str += gas( cm[ccode] ); // no joint letter, but valid ULY
} else {
str += gas(ccode); // non-ULY, return whatever is entered
}
prev = cur;
}
return str;
}
function isvowel ( ch )
{
var code = gac ( ch );
if ( ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u' ||
ch == 'A' || ch == 'E' || ch == 'I' || ch == 'O' || ch == 'U' ) {
return true;
}
if ( code == PRIMe || code == PRIME || code == COLo ||
code == COLO || code == COLu || code == COLU ) {
return true;
}
return false;
}
function isalpha ( code )
{
if ( (gac('A') <= code && code <= gac('Z')) || (gac('a') <= code && code <= gac('z')) ) {
return true;
}
return false;
}
function AttachEvent(obj, evt, fnc, useCapture){
if (!useCapture) useCapture = false;
if (obj.addEventListener) {
obj.removeEventListener(evt, fnc, useCapture);
obj.addEventListener(evt, fnc, useCapture);
return true;
} else if (obj.attachEvent) {
obj.detachEvent( "on" + evt, fnc);
return obj.attachEvent( "on" + evt, fnc);
}
}
// attach event handlers to textareas and textfields
function attachEvents ( )
{
if ( typeof(attachAll)=="undefined" || attachAll == null ) {
attachAll = false;
}
if ( typeof(bedit_allow) != "undefined" && bedit_allow && bedit_allow.length != 0 ) {
allowed_names = bedit_allow.split ( ':' );
} else {
allowed_names = [];
}
if ( typeof(bedit_deny) != "undefined" && bedit_deny && bedit_deny.length != 0 ) {
denied_names = bedit_deny.split ( ':' );
} else {
denied_names = [];
}
var tas = document.getElementsByTagName("TEXTAREA"); // textareas
var tfs = document.getElementsByTagName("INPUT"); // input fields
for ( i = 0; i < tas.length; i++ ) {
if ( shouldAttach(tas[i].name) ) {
AttachEvent ( tas[i], 'keypress', naddchar, false );
AttachEvent ( tas[i], 'keydown', proc_kd, false );
}
}
for ( i = 0; i < tfs.length; i++ ) {
if ( tfs[i].type.toLowerCase() == "text" && shouldAttach(tfs[i].name)) {
AttachEvent ( tfs[i], 'keypress', naddchar, false );
AttachEvent ( tfs[i], 'keydown', proc_kd, false );
}
}
}
function shouldAttach ( name )
{
var j;
if ( attachAll == true ) {
for ( j = 0; j < denied_names.length; j++ ) {
if ( name == denied_names[j] ) {
return false;
}
}
return true;
} else { // global attach is disabled, only attach those that are specified
for ( j = 0; j < allowed_names.length; j++ ) {
if ( name == allowed_names[j] ) {
return true;
}
}
return false;
}
}
/* for Mozilla/Opera (taken from dean.edwards.name) */
if (document.addEventListener) {
document.addEventListener("DOMContentLoaded", bedit_onLoad, false);
}
/* for Internet Explorer */
/*@cc_on @*/
/*@if (@_win32)
document.write("<script id=__ie_onload defer src=javascript:void(0)><\/script>");
var script = document.getElementById("__ie_onload");
script.onreadystatechange = function() {
if (this.readyState == "complete") {
bedit_onLoad(); // call the onload handler
}
};
/*@end @*/
/* for webkit-based browsers */
if (/WebKit/i.test(navigator.userAgent)) { // sniff
var _timer = setInterval(function() {
if (/loaded|complete/.test(document.readyState)) {
bedit_onLoad(); // call the onload handler
}
}, 100);
}
// add new onLoad while keeping the old, if any
old_onLoad = null;
add_onLoad();
function add_onLoad()
{
old_onLoad = window.onload;
window.onload = bedit_onLoad;
}
function bedit_onLoad()
{
// quit if this function has already been called
if (arguments.callee.done) return;
arguments.callee.done = true;
// kill the timer
if (_timer) clearInterval(_timer);
bedit_init();
attachEvents();
if ( old_onLoad ) {
old_onLoad();
}
}
function addchar(content, event)
{
return naddchar(event);
}
function proc_kd_ctrl_k ( source, ev )
{
imode = 1 - imode;
return true;
}
function proc_kd_ctrl_j ( source, ev )
{
var t = gsel(source);
if ( t == "" ) {
return false;
} else {
ins(source, ak2uni(t));
return true;
}
}
function proc_kd_ctrl_u ( source, ev )
{
var t = gsel(source);
if ( t == "" ) {
return false;
} else {
ins(source, uly2uy(t));
return true;
}
}
function proc_kd_ctrl_t ( source, ev )
{
if ( source.style.direction == "ltr" ) {
source.style.direction = "rtl";
} else {
source.style.direction = "ltr";
}
return true;
}
function proc_kd(event)
{
var x = false; // should cancel?
var e = event ? event : window.event;
var k = e.keyCode ? e.keyCode : e.which;
var s = e.srcElement ? e.srcElement : e.target;
if ( e.ctrlKey) {
var f = false;
for(var az = gac('A'); az <= gac('Z'); az++ ) {
eval('if ( k == ' + az + ' && typeof proc_kd_ctrl_' + gas(az).toLowerCase() + ' == "function" ) { x = ' + 'proc_kd_ctrl_' + gas(az).toLowerCase() + '(s, e); f=true;}');
if(f) break;
}
}
if ( x ) {
e.cancelBubble = true;
if(e.preventDefault) e.preventDefault();
if(e.stopPropagation) e.stopPropagation();
e.returnValue = false;
return false;
}
return true;
}
function gsel(source)
{
var s = source;
if ( document.all ) {
return document.selection.createRange().text;
} else {
var ss = s.selectionStart;
var se = s.selectionEnd;
if ( ss < se ) {
return s.value.substring (ss, se);
}
}
return "";
}
function ins(source, str)
{
var s = source;
if ( document.selection && document.selection.createRange) {
document.selection.createRange().text = str;
} else {
// we cannot modify event.which in Mozilla/FireFox, have to do something more interesting
var ss = s.selectionStart;
var se = s.selectionEnd;
// Mozilla/Firefox scrolls to top in textarea after text input, fix it:
var sTop, sLeft;
if (s.type == 'textarea' && typeof s.scrollTop != 'undefined') {
sTop = s.scrollTop;
sLeft = s.scrollLeft;
}
s.value = s.value.substring (0, ss) + str + s.value.substr(se);
if (typeof sTop != 'undefined') {
s.scrollTop = sTop;
s.scrollLeft = sLeft;
}
s.setSelectionRange(ss + str.length, ss + str.length );
}
}
// addchar
function naddchar(event)
{
var e = event ? event : window.event;
var k = e.keyCode ? e.keyCode : e.which;
var s = e.srcElement ? e.srcElement : e.target;
if ( !inited ) {
bedit_init();
}
if ( !e.ctrlKey && !e.metaKey && imode == 0 && k < km.length && km[k] != 0 ) {
if ( e.keyCode && !e.which ) {
e.keyCode = km[k];
} else {
ins(s, gas(km[k]));
if(e.preventDefault) e.preventDefault();
if(e.stopPropagation) e.stopPropagation();
}
if ( k == gac('"') ) { // toggle double bracket on '"'
km[k] = qmode ? OQUOTE : CQUOTE;
qmode = 1 - qmode;
}
if ( ! e.keyCode || e.which ) {
return false;
}
}
// cannot cancel keydown event in opera, do it in here for keypress
if (/opera/i.test(navigator.userAgent) && e.ctrlKey) {
var x = false;
for(var az = gac('A'); az <= gac('Z'); az++ ) {
eval('if(k == ' + az + ' && typeof proc_kd_ctrl_' + gas(az).toLowerCase() + ' == "function" ) { x = true }');
if(x) break;
}
if(x) {
e.preventDefault();
return false;
}
}
e.returnValue = true;
return true;
}
/************++++++++**************/
/* alt+k => dir->rtl*/
function proc_kd_Press(this_,e){
if (e.altKey && e.which == 75){
var direction=$(this_).attr("dir");
if(direction!="rtl"){$(this_).attr("dir","rtl");
this_.addEventListener('keypress', naddchar, false);
this_.addEventListener('keydown', proc_kd, false);
}else{$(this_).attr("dir","ltr");
this_.removeEventListener('keypress', naddchar, false);
this_.removeEventListener('keydown', proc_kd, false);
}/* end */
}/*altKey*/
}
//使用演示
//<input onkeydown="return proc_kd(event);" onkeypress="return addchar(this, event);" placeholder="ھالقىلىق سۆزنى كىرگىزۈپ ئىزدەڭ">
~~~
- 后端
- composer
- composer配置国内镜像
- composer安装及设置2
- PHP
- 贝塔SG11加密
- 申请KEY
- 开始加密
- php 中连接tcp服务的三种方式
- php websocket 教程
- editor内容转换数组
- 使用正则判断中文维吾尔文
- PHP常用函数总结
- 常用助手函数
- 通过Imagick把pdf转换图片
- 维吾尔语基本区转换扩展区
- php GD库生成一个由文字和图片生成新的图片
- aes加密
- php数组函数 -- array_column,array_multisort 实现二维数组排序
- PHP操作Excel
- php更新内容
- 辅助查询(*)
- 【时间】操作
- 时间函数例子
- Date/Time 函数(不包含别名函数)
- php网络相关
- HTTP请求的返回值含义说明
- 使用php语言开发一个类似数据库操作的文件表类
- pinyin
- 维吾尔语基本区转换扩展区(2)
- php获取当前环境的信息
- laravel
- laravel 队列的使用
- laravel 自定义助手函数
- laravel seeder的使用
- laravel项目从git下载命令
- laravel 多个数据库配置
- laravel 填充假数据
- laravel 动态路由
- laravel 自定义 validate 响应
- laravel 创建追加字段的模拟访问器
- laravel 线上环境的数据库更改或添加字段
- laravel 模型查询按照whereIn排序
- laravel 使用 workerman 通过TCP 文件传输功能
- laravel api Header添加Accept头
- Laraval IDE 自动补全插件 laravel-ide-helper
- laravel 网站后台
- laravel 设置路由
- laravel-第三方composer包
- laravel 开发技巧
- laravel 昨天,今天时间
- 使用宝塔计划任务启动laravel调度器
- laravel结合workerman第二节
- Laravel - 上传多个文件
- 查询聊天好友列表
- 事件系统 event, listener
- laravel 安装 laravel-modules
- 自定义求看守器-toekn
- laravel限流
- 使用 Laravel api Resource 类时自定义分页信息
- Laravel php artisan命令大全
- 验证器
- workerman 创建wss服务
- 架构师必须知道的26项PHP安全实践
- python
- Python读取文件代码块已经备好,用的时候光拿(建议收藏)
- Python常用库大全
- api 签名验证
- git
- git命令
- 十分钟学会git基础
- Git代码同时上传到GitHub和Gitee(码云)
- Git - 多人协同开发利器,团队协作流程规范与注意事项
- 删除远程仓库的文件
- github查询方法
- 错误
- 解除项目git版本控制
- linux
- sentos安装supervisor
- PHP怎么守护进程运行php脚本
- 600条最强Linux命令总结
- centos开启防火墙、开放指定端口
- 前端
- vue
- vue2发布之前的config简单配置
- vue2安装scss命令
- vue2父子组件之间双向数据绑定
- 国际化双语--安装VueI18n
- vue3-setup 组件传参(defineProps、defineEmits、defineExpose
- Vue3 新写法速览:十分钟内轻松get
- 关于vue的外连接
- watch讲解
- computed
- webpack 打包后生成很多小文件怎么优化?
- vue2 vue.config.js常见配置和打包部署测试
- 小程序
- 小程序长期订阅消息
- 小程序自定义TabBar后如何实现keep-alive
- 收藏的html和css和js
- CSS 省略号(单行省略号、多行省略号)
- UyghurInput_a.js
- font.css
- 漂亮按钮样式
- clock.html
- css
- scroll css样式
- CSS流动布局-页面自适应
- css grid布局
- 禁止wap页面调整字体大小
- CSS @media 和 min-width/max-width
- 网站变灰是怎么实现的
- 瀑布流实现方式
- javascript
- SortableJS拖动排序
- wondow scroll滚动到上边
- 原生js插入HTML元素
- Konva.js —— 像操作DOM一样操作canvas
- 通过canvas合并俩个图片
- js scroll更多加载
- js 实现复制功能
- js判断安卓和苹果或者微信
- 浏览器打开控制台禁止
- 原生js一些dom操作
- js http客户端集合
- fetch
- axios
- canvas 点钟
- layer dialog
- jquery 和 laravel ajax全局配置
- layui 获取select的自定义参数
- konva.js中文开发文档
- js 大文件分片上传
- js监听网络状态实现断网重连后自动刷新页面
- js生成video缩略图
- JS获取当前系统电量情况
- uniapp
- uni-app swiper数量过多时卡顿优化方案
- uniapp 帖子集合
- 微信wap
- wap分享朋友和朋友圈
- wap 手机页面微信支付
- JsSdk微信公众号支付
- 通用各种小知识
- 正则表达式
- JS正则匹配过滤字符串中的html标签及html标签内的内容
- 判断维吾尔文输入
- 正则表达式符号
- 正则表达式练习
- 百度网盘不限速下载助手
- 解决VSCode下载慢或下载失败的问题
- 性能测试 使用Apache的ab测试工具
- nginx从入门到精通
- nginx
- Nginx 是怎么禁止访问php的 ?
- 宝塔面板
- supervisor
- 卸载宝塔
- redis
- redis实用笔记
- redis入门到精通
- phpredis
- redis数据库基础
- PHP对Redis的基本操作
- ffmpeg
- 合并多个音视
- 获取音视时长
- FFmpeg视频处理入门教程(新手必看)
- 外连接
- 安装
- PHP基于ffmpeg实现转换视频,截图及生成缩略图的方法
- Linux安装ffmpeg
- docker
- 服务实现
- docker基本命令
- rewrite笔记
- 别人笔记链接
- 计算机常用知识
- 二进制1-10
- 斐波那契数列
- mysql
- 高性能高可用的MySQL,得从各种规范开始
- 读写分离配置
- 重要外连接,前端/ 后端/数据库等等
- 关于程序必须收藏的文章链接集合
- markdown
- 一篇文章讲清楚markdown