Giter Club home page Giter Club logo

xteko's People

Contributors

aduir avatar chanjh avatar chengluffy avatar cyanzhong avatar dgheaven avatar icodesign avatar meiycs avatar nicked639 avatar paperant avatar ryanfwy avatar shirakaba avatar tarocats avatar vickychenglau avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xteko's Issues

反馈调试效时率问题

①在调试代码时,如果脚本出现错误,就会出现一个错误的bug虫标志,当修改代码之后,那bug虫依然还在,必须保存之后退出再进入才可以。这样太耽误时间了。
1.是不是可以加入多个按钮调试(比如"运行按钮","bug按钮")
2.或者出现错误之后修改完,立刻出现运行按钮来测试
②在商店里面不能进入代码,只有官网,也要返回到xteko区。

反馈来之制作者长期制作时出现阻挡制作效率的痛苦

如何进行 Stream 输出?

请教一下,在使用 OpenAI 的 API 进行提问回答时,若采用其 stream 的方式对回答内容进行输出,那么在 JSBox 上的 $http.request()handler 该怎么写呢?

$keyboard.selectedText 存在 Bug

例如选中如下文字:
True argumentation is the most important kind of communication in the academic and professional world. Used effectively, it is how ideas are debated and shared in discourse communities. Argumentation holds both writers and readers to the highest standards of responsibility and ethics. It is usually not what you see on cable news shows or, sadly, even in presidential debates. This section will show how rhetoric is used in service of argumentation.

$keyboard.selectedText 的值却是 True argumentation is the most important kind of communication in the academic and professional world. This section will show how rhetoric is used in service of argumentation.

不确定触发 Bug 的原因是什么,在中英文情况下都会存在,也许是标点符号,因为缺少的选中内容刚好在句点之间。

Node.js modules fail

As JSBox uses node.js, I tried the following script which works fine as is using node on MacOS. Under JSBox it gives the error:
TypeError: express is not a function. (In 'express()', 'express' is an instance of Object)
line 2, column 18
Can anyone tell what is going on? Bug in JSBox?

var express = require('express');
var app = express();

app.get('/', function (req, res) {
   
    var sql = require("mssql");

    // config for your database
    var config = {
        user: 'user',
        password: 'pswd',
        server: 'host', 
        database: 'dbname' 
    };

    // connect to your database
    sql.connect(config, function (err) {
    
        if (err) console.log(err);

        // create Request object
        var request = new sql.Request();
           
        // query to the database and get the records
        request.query('select * from tablename', function (err, recordset) {
            
            if (err) console.log(err)

            // send records as a response
            res.send(recordset);
            
        });
    });
});

var server = app.listen(5000, function () {
    console.log('Server is running..');
});

希望增加更多objc功能

目前$define只能够新增objc class,似乎也可以给现有class添加新方法。但是如果想要替换class中原有方法就会触发异常。是否可以增加更多objc class的操作。另外,似乎没有办法访问到没有访问器的成员变量,只能通过访问器访问属性,是否可以增加访问成员变量的功能。
参见JSPatch,JSPatch实现了大量objc的操作,包括动态替换、动态增加现有类的方法、动态增加协议、动态访问成员变量...

能支持短信触发脚本吗?

IOS 应该是有开放短信权限的吧,不然那些短信拦截程序也不能实现。

我觉得这个应该是个很有意思的功能。
可以实现按照规则自动转发短信之类的功能。

如果有了这个功能,我就可以给自己开发一个脚本:

  1. 监控短信获取联通每个月给我发的一个领取腾讯视频 VIP 的链接。
  2. 自动打开链接填写 QQ 号然后发送验证码。
  3. 监控收到的验证码,填写到页面并发送确定请求。

error occurs when using Proxy to intercept calling of functions starting with '$'

当使用Proxy来拦截一个对象的$someFunc方法时,出现错误 "proxy.__invoke is not a function"。实际上,可以发现当调用proxy.$someFunc时,实际调用的是proxy.__invoke("someFunc");

例如:以下这段代码,在jsbox1.27.0运行报错,但是在Chrome68却能正常运行。

var a = {
  $render: () => {
    return 1;
  }
}

console.log(a.$render()) // 1

var ap = new Proxy(a, {
  get(target, property) {
    console.log("property name is: " + property);

    if (property === "$render")
      return function () {
        return 2
      }
  }
})

console.log(ap.$render); //property name is $render & shows the function body normally

console.log(ap.$render()); //property name is __invoke & throw an error

如果把函数名去掉开头的$则可以正常运行。

快捷指令自动化调用 获取地理位置后 $push不显示

image

``
function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}

var delay = getRandomInt(1, 5);
$push.schedule({
title: "开始工作",
body: "随机延迟: " + delay +"秒",
handler: function(result) {
console.log("pushid:" + result.id);
},
delay: 0.1,
renew: true
})

var localtion = await $location.get();

$push.schedule({
title: "地理位置",
body: localtion.lat + "\r\n" + localtion.lng,
handler: function(result) {
console.log("pushid:" + result.id);
},
delay: 0.1,
renew: true
})
$intents.finish('Oook!,1234');
``

tab 切换选中状态有问题,有时是先执行changed再切换选中颜色,有时先切换颜色再执行changed

function sleep(numberMillis) {
var now = new Date();
var exitTime = now.getTime() + numberMillis;
while (true) {
now = new Date();
if (now.getTime() > exitTime)
return;
}
}
$ui.render({
type: "view",
props: {
title: "加解密"
},
views: [{
type: "tab",
props: {
id: "tab",
items:["加密","解密"],
index: 1
},
layout: function(make, view) {
make.top.equalTo(0).offset(10)
},events: {
changed: function(sender) {
var items = sender.items
var index = sender.index
sleep(3000)
$ui.toast(index + ": " + items[index])
}
}
}]
})

Mac下扩展,如何将内容粘贴到当前光标活动的控件?

在JS扩展下,默认例子修改为:

function run() {
    return "|text|";
}

可以实现去掉格式。

如何加入将"|text|"粘贴到当前光标活动的地方的功能?

另外,之前提到的$clipboard.text也是JS扩展支持的语法吗? 我测试后发现 return $clipboard.text;没有效果。

Mac下,如何编辑已经保存的 JS扩展?

在管理扩展里面,只能修改快捷键,双击也不能编辑。
在添加扩展处,输入相同名称不能显示已有扩展,同名保存提示已经存在拒绝保存。

那么,如何编辑已经保存的 JS扩展?

$include能否引用远程脚本?

感觉$include功能不是很完善,我尝试用下面的方法来引用一个远程脚本,但是好像不成功,下载到本地引用好像也不成功,然后试了把路径随便写一个也不报错。。。。。

$include('https://sdk.amazonaws.com/js/aws-sdk-2.418.0.min.js')

另外尝试用require引用node的包会报RangeError:Maximum call stack size exceeded错误

code-server support

Hi,

JSBox 能否考虑特殊支持code-server?我尝试在iPadOS 上运行代码, code-server是个不错的选择. 然而 iOS/iPadOS Safari 不支持自定义快捷键. 看到JSBox可以自定义快捷键, 这个两个项目的组合可能会产生一个非常亮眼的刚需应用. 请作者考虑.

JSBox 能够完成应用软件的自动化模拟操作吗?

我看了开发文档,没有找到进行模拟操作的api,比如说某应用控件的点击输入等。
只找到了一个$app.openURL("weixin://")的接口,我没有太理解这个URL的作用,这个URL是和控件关联的吗?
我想知道能不能写出完成自动进行回复消息等之类的脚本。谢谢。

$addin.list can't get the script content for some scripts

I wanna write a script to export all installed scripts.
data is undefined or null for all scripts written manually, scripts saved by $addin.save work with no problem.
And I wish $addin.list is a raw js dictionary so that I can dump it directly as a json.

键盘会遮挡list内嵌的text组件

img_0248

使用了一个list来内嵌TEXT组件用以输入内容,当text过多,编辑最后一个text的内容时,键盘会把text组件遮挡,包括原生键盘

这是复现代码,在最新的tf版本中能够复现

$ui.render({
  layout: $layout.fill,
  views: [{
    type: "button",
    props: {
      title: "生成配置"
    },
    layout: function (make) {
      make.left.right.bottom.inset(10)
      make.height.equalTo(32)
    },
    events: {
      tapped: function (sender) {
        //selectItem()
      }
    }
  }, {
    type: "list",
    layout: function (make) {
      make.left.top.right.equalTo(0)
      make.bottom.equalTo($("button").top).offset(0)
    },
    props: {
      rowHeight: 150,
      data: ['1','2','3','4','5','6','7','8','9','10'].map(function (cus) {
        let cfg = cus;
        if(typeof cus === 'string'){
          cfg = {
            name:cus
          }
        }
        return {
          title: `${cfg.name} ${cfg.text?`(${cfg.text})`:''}`,
          rows: [{
            type: "text",
            props: {
              id: cfg.name,
              text:  '',
            },
            layout: function (make) {
              make.edges.inset(5);
            }
          }]
        }
      })
    }
  }]

})

HTTP JSON parse bug

$http.get({
    url: "http://tool.manmanbuy.com/m/history.aspx?DA=1&action=gethistory&token=9dnaf375809e349db93c3db4d77dc3cc4b7aiq&url=http://v.cvz5.com/h.uD3Aww",
    handler: function (resp) {
      $console.info(resp.data)
      $console.info(resp.error)
      $ui.alert({
        title: "Response",
        message: resp.data
      })
    }
  })

resp 的 data 是 null,但是通过 Charles 抓包发现有返回数据的

{
	"ok": 1,
	"cusitename": "淘宝天猫",
	"jsData": "[Date.UTC(2016,9,20),3699],[Date.UTC(2017,5,1),3698],[Date.UTC(2017,5,4),3699],[Date.UTC(2017,5,18),3698],[Date.UTC(2017,6,2),3699],[Date.UTC(2017,7,3),3689],[Date.UTC(2017,7,9),3699]",
	"zdprice": 3689,
	"zdtime": "2017/8/3",
	"spname": "Sony/索尼 MDR-Z7  头戴式高端耳机 顺丰包邮",
	"spurl": "https://detail.tmall.com/item.htm?id=41298378165",
	"flurl": "http://tool.manmanbuy.com/redirectTaobao.aspx?num=41298378165&url=https://detail.tmall.com/item.htm?id=41298378165",
	"spzhoushi": "<span class='history-trend'><i class='t-3'></i>价格上涨</span>",
	"sppic": "http://img.alicdn.com/imgextra/i1/TB1qCbnNXXXXXavXVXXXXXXXXXX_!!0-item_pic.jpg_400x400.jpg",
	"spprice": 3699
}

Question: type definition for JSBox?

Hello Developer,

I find a simple type definition for JSBox at here, but its out of date.
Does the product (JSBox) have a plan to publish the official type definition file ?

Thanks

固定脚本导致tab无法切换

将demo的汇率转换设置为固定的脚本,然后切换到这个tab上点击输入框。然后系统弹出的数字键盘就无法关闭了,只能退出APP重新打开。
机型:iPhoneSE,10.3.3

关于延迟执行的疑问

请问如何实现取消单次延迟执行的定时器?类似的 js 代码:

const foo = setTimeout(()=>{}, 1000);
clearTimeout(foo);

文档 https://docs.xteko.com/#/foundation/thread 写了4种延迟执行的方法

$thread.background(object)
$thread.main(object)
$delay(number, function)
$timer.schedule(object)

只有 $timer.schedule() 可以被取消,没有取消一次性延迟任务的方法。

有关 $env 的一些疑问

此疑问来自 xTeko 插件商店的插件 xTeko 收藏夹#4

根据 xTeko 文档 应用 - xTeko,判断扩展是否运行在通知中心的方法是:

if ($app.env == $env.today) {

}

但在运行时会报错 ReferenceError: Can't find variable: $env

根据 常量 - xTeko 中的方法指定 $env 后可以正常运行:

+ var $env = {
+     app: 1 << 0,
+     today: 1 << 1,
+     ...
+ }
  if ($app.env == $env.today) {

  }

条件所限,目前仅测试过在 iPhone 6s 的 10.3.3, 10.3.2, 10.0.2 上 100% 复现此问题,不知是否为个例?

GBA simulator not found

为了GBA买了jsbox,但源代码貌似删掉了,大佬可以给个下载的地方吗。十分感谢

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.