ouchdb蒲团文档编辑器-我可以自定义文档验证部分吗? [英] couchdb futon document editor - can I customize the document validation part?

查看:104
本文介绍了ouchdb蒲团文档编辑器-我可以自定义文档验证部分吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我可以在此编辑器的文本字段中而不是JSON表达式中编辑对象文字,那么非常很有趣。

A VERY nice to have would be if I could edit object-literals in this editor's text-field instead of JSON expressions.

如果我可以用简单的 eval 替换JSON解析-它将使编辑变得非常容易! (并且帮助我更轻松地为项目设计文档结构)

If I could replace the JSON parse with a simple eval - it will make editing sooooo much easier! (and help me design document structures for my projects soooo much more easily)

我的意思是,天哪!这不是协议学校,而是编辑器工具。
该工具的目的不是要教给我协议和每一个小错误都给我评论,而是帮助我为该软件设计文档。
为什么必须使用严格的JSON?它不能与Object Literals一起使用,并为我们做
JSON.stringify(eval(editor_textarea.value))
不会吗冷静点?大声笑:D
(是的,发现错误并反馈给用户)

I mean, gosh!! it's not a protocol school, it's an editor's tool. The goal of the tool is not to teach me the protocol and comment me on every petty mistake, but to help me design documents for the software. Why must it ensist on strict JSON? Can't it live with Object Literals, and do for us the JSON.stringify( eval(editor_textarea.value)) woulnd't that be cool? LOL :D (yea yea, catching errors and feeding back to the user)

(以及谁错过了差异-主要是在报价中属性严格的JSON协议中的
总是要求使用引号,毫无疑问,其中JS对象文字仅对非合法JS变量名称的属性名称要求使用引号,并且也接受不带引号的数字)

(and for who ever missed the difference - it is mainly in the quote marks in attribute names. the dry strict JSON protocol require quotemarks ALWAYS, no question asked, where JS object literal require quote-marks only for attribute names that are not legal JS variable names and accepts also numbers without quotation marks)

严格干燥的JSON:

{ "attribute" : "value"
, "mapmap"    : 
    { "map" :
        { "attr" : "sdss" 
        , "123"  : "ss32332"
        , "val"  : 23323
        , "456"  : "ss32332"
        }  
    }
 }

对象文字

{ attribute: "value"
, mapmap   :
    { map :
        { attr : "sdss"
        , 123  : "ss32332"
        , val  : 23323
        , 456  : "ss32332"
        }
    }
}

好吧,它不会解决我缺少逗号或错位的情况,但确实会使生活更轻松,在引号处是脚手架的重要组成部分。

Well, it won't solve me missing commas or mismatching brakets, but it does make life easier, where quote marks are a big part of the scaffold.

如果您能指出我的位置,即使在被褥上贴上补丁,也可以更改此设置,我会非常感激:)

If you can point me to where I can change this even as patch on the futon I'll be soooOOO greatful :)

也许以后我们可以在其中集成一个编辑器帮助程序,例如github source-editor中的一个很酷的助手或jsfiddle中的一个,它可以帮助您很好地缩进和着色。
但是让我们从一个简单的评估开始。
会让生活更轻松...:)

Maybe later we can integrate there an editor helper such as the cool one in github source-editor or the one in jsfiddle, that helps you indent and color things nicely. But lets start with a simple eval. it will make life easier... :)

它还可以让我使用JS代码生成复杂的文档,而无需任何其他测试软件...

It can also let me generate complicated documents using JS code without any additional test software...

快乐编码:)

PS
如果您知道这里的答案-您可能知道答案这个问题:
couchdb蒲团文档编辑器-我可以自定义缩进规则吗?

推荐答案

我快速浏览了一下,我相信这是您要去的地方想要添加您的评估:

I had a quick browse, and I believe this is where you will want to add your eval:

https://github.com/apache/couchdb/blob/master/share/www/script/futon.browse.js#L911

和此处:

https:// g ithub.com/apache/couchdb/blob/master/share/www/script/futon.browse.js#L902

您可以编辑本地beddb如果要查看实时更改,请使用实例share / www / script / futon.browse.js。

You can edit your local couchdb instance share/www/script/futon.browse.js if you want to see live changes.

这篇关于ouchdb蒲团文档编辑器-我可以自定义文档验证部分吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆