where should interface state be stored?

Is there an official story for where interface state (as opposed to persisted model state) should live in an Ember.js app? In the "Responding to User-initiated Events" part of the Router docs, there's an example of delegating click events to a photo's "showPhoto" method, but having a model "show" itself seems like an undesirable mixing of concerns. I unde

应该在哪里存储接口状态?

是否有一个官方的故事,在哪里接口状态(而不是持久的模型状态)应该居住在Ember.js应用程序中? 在路由器文档的“响应用户发起的事件”部分中,有一个将点击事件委派给照片的“showPhoto”方法的示例,但是具有模型“show”本身似乎是一种令人不快的担忧。 我知道在很多情况下,状态应该存储在路由器中,以便在URL中表示接口状态,并在刷新页面或将URL发送给某人时恢复。 但是非等级状态如何,例如页面上选择的项目列表? 理想

chrome.serial / chrome.usb undefined

I'm trying to access serial/usb ports via chrome plugins/extensions. Im following the documents from chrome usb && chrome serial , when i started my plugin it throws "Uncaught TypeError: Cannot read property 'getDevices' of undefined" i also tried the sample codes from google chrome sample but experienced the same problem, basically chrome.usb / chrome.serial is

chrome.serial / chrome.usb未定义

我试图通过chrome插件/扩展来访问串行/ USB端口。 我遵循的文件从铬USB &&铬序列,当我开始我的插件它抛出 “Uncaught TypeError:无法读取未定义的属性'getDevices' 我也尝试了谷歌Chrome样本代码,但遇到同样的问题,基本上chrome.usb / chrome.serial是未定义的。 任何建议,让我正确的方向表示赞赏。 谢谢 ! 我附上我的示例代码 popup.html <!DOCTYPE html> <html> <body styl

Chrome pushmessaging apis backward compatibility

a year ago, i used the following apis to enable chrome push messaging(now gcm) to send gcm messages from the server . Those apis now seems to be completely broken chrome.pushMessaging.getChannelId(function(google_chrome_channel_id){}) The error reported when above function is used TypeError: Cannot read property 'getChannelId' of undefined chrome GCM apis are changed according t

Chrome pushmessaging API向后兼容性

一年前,我使用以下apis来启用chrome推送消息(现在gcm)从服务器发送gcm消息。 现在这些apis似乎已经完全破碎了 chrome.pushMessaging.getChannelId(函数(google_chrome_channel_id){}) 使用上述函数时报告的错误 TypeError:无法读取未定义的属性'getChannelId' Chrome GCM apis根据此文档https://developers.google.com/cloud-messaging/chrome/client进行更改。 是否有任何解决这些API的工作,或者

Avoiding Redis persistence (Socket.io + Cluster + RedisStore)

I know that you can use Redis for the communication between socket.io sockets from different cluster workers in node.js and also for sharing other objects between these workers. But I'm struggling with the following: Does the persistence of Redis data get in the way of this? How can I be sure that the socket data is removed from redis when the master process is closed? And how can I ens

避免Redis持久性(Socket.io + Cluster + RedisStore)

我知道你可以使用Redis来进行node.js中不同群集工作者的socket.io套接字之间的通信,也可以在这些worker之间共享其他对象。 但我正在努力与以下几点: Redis数据的持久性是否妨碍了这一点? 如何确保在主进程关闭时从套接字数据中删除套接字数据? 我怎样才能确保对象的相同? 我只需要这些数据,直到进程/套接字终止。 也许我必须删除保存到磁盘的时间间隔,并在master-start上重新加载整个Redis服务器? 非常感谢。

threading and Socket.io

I'm looking to get Socket.io to work multi-threaded with native load balancing ("cluster") in Node.js v.0.6.0 and later. From what I understand, Socket.io uses Redis to store its internal data. My understanding is this: instead of spawning a new Redis instance for every worker, we want to force the workers to use the same Redis instance as the master. Thus, connection data would

线程和Socket.io

我期望在Node.js v.0.6.0和更高版本中使Socket.io与本地负载平衡(“集群”)进行多线程工作。 据我所知,Socket.io使用Redis来存储其内部数据。 我的理解是这样的:我们不想为每个工作人员产生一个新的Redis实例,而是要强制员工使用与Master相同的Redis实例。 因此,连接数据将在所有员工中共享。 主人这样的事情: RedisInstance = new io.RedisStore; 我们必须以某种方式将RedisInstance传递给工人,并执行以下操作:

Send data with jquery to an MVC controller

I have an ASP.NET MVC3 app and when the user clicks on my anchor tag, I want to send 3 pieces of data to an action: <a onclick='editDescription(<#= DocID,FileName,Description #>)'></a> This is the javascript to call my action: function editDescription(docId,fileName,description) { var url = "@Url.Content("~/OrderDetail/_EditDescription/")" + docId+'/'+ fileName

用jQuery发送数据到MVC控制器

我有一个ASP.NET MVC3应用程序,当用户点击我的锚标记时,我想发送3个数据到一个动作: <a onclick='editDescription(<#= DocID,FileName,Description #>)'></a> 这是调用我的操作的JavaScript: function editDescription(docId,fileName,description) { var url = "@Url.Content("~/OrderDetail/_EditDescription/")" + docId+'/'+ fileName + '/' + description; //do the rest} 我

side WebHook handler?

I am a bit of a newbie in Webhooks, so excuse me if this is a simple question. I am clear about how Webhook providers work, ie whenever this information needing to be pushed, it sends the payload to the URL specified as callback. Now my question is: how do I write a client-side Webhook handler, that can detect/process the callback and update my client-side accordingly. For example, if my cli

边WebHook处理程序?

我在Webhooks中有点新手,所以如果这是一个简单的问题,请原谅我。 我很清楚Webhook提供程序是如何工作的,即无论何时需要推送这些信息,它都会将有效内容发送到指定为回调的URL。 现在我的问题是:如何编写客户端Webhook处理程序,它可以检测/处理回调并相应地更新我的客户端。 例如,如果我的客户端是一个带有重点的简单网页,我希望在列表中添加新数据。 最好是,我会在完整的JavaScript解决方案之后... 有没有可能

Trying to black out everything outside of a moveable div

I wrote a hover zoom plugin and I'm trying to figure out how to dark out everything outside of the hover zoom box, and make the zoom box itself transparent, but am having a tough time trying to figure out what I need to do for it. Do I use opacity? Do I use a background image? Right now it's just showing a white .5 opacity on top of a darker black opacity bg, but I'm kinda scratch

试图阻止可移动div之外的所有内容

我写了一个悬停缩放插件,我试图弄清楚如何遮住悬停缩放框外的所有东西,并使缩放框本身变得透明,但是我正在艰难地尝试弄清楚我需要做什么它。 我是否使用不透明度? 我使用背景图片吗? 现在它只是在黑色的不透明bg上显示一个白色的.5不透明度,但我有点挠头,试图弄清楚这一点。 任何建议将是超级有用的。 我在做什么: 演示:jsfiddle 这是一个解决方案的例子,但它需要你做一些改变。 如果将缩放广场设置为具

how to make horizontal elements expand to cover available space?

I'm trying to create a CSS fluid tab menu , with a variable number of tabs (similar to what can be seen in Windows, where tabs expand depending on length of contained header, see below). Here is an example, I have setup (I need to keep element structure): <div class="test"> <div class="element"> <h3> <span class="dummy-a"> <

如何使水平元素扩大以覆盖可用空间?

我试图创建一个CSS fluid tab menu ,其中包含可变数量的选项卡(类似于Windows中可以看到的选项卡,其中选项卡根据包含的标题的长度进行扩展,请参见下文)。 这里是一个例子,我已经设置好了(我需要保持元素结构): <div class="test"> <div class="element"> <h3> <span class="dummy-a"> <span class="dummy-ui-btn-inner">

JavaScript Editor Plugin for Eclipse

This question already has an answer here: JavaScript editor within Eclipse [closed] 8 answers Complete the following steps in Eclipse to get plugins for JavaScript files: Open Eclipse -> Go to "Help" -> "Install New Software" Select the repository for your version of Eclipse. I have Juno so I selected http://download.eclipse.org/releases/juno Expand "Prog

Eclipse的JavaScript编辑器插件

这个问题在这里已经有了答案: Eclipse中的JavaScript编辑器[已关闭] 8个答案 在Eclipse中完成以下步骤以获取JavaScript文件的插件: 打开Eclipse - >转到“帮助” - >“安装新软件” 为您的Eclipse版本选择存储库。 我有朱诺,所以我选择了http://download.eclipse.org/releases/juno 展开“编程语言” - >选中“JavaScript开发工具”旁边的复选框 点击“下一步” - >“下一步” - >接受许可协议条款 - >“