- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在 firebase 中,我想创建一个 URL,单击该 URL 会将某人的名字添加到 firebase 数据结构中的列表中。如果那不可能,请使用 URL,当点击该人时,该 URL 会在 Firebase 中标记为已批准。
例如,考虑以下结构:
-Sample (which would be at https://Sample.firebaseio.com)
-Users
我想制作以下内容
-Sample (which would be at https://Sample.firebaseio.com)
-Users
Liz_Smith
Shanna_Oreily
通过创建这样的 URL:
https://Sample.firebaseapp.com/users/Liz_Smith
https://Sample.firebaseapp.com/users/Shanna_Oreily
我不认为这样的事情是可能的,因为它就像用 URL 推送一样。如果不可能,我希望激活以下 URL,这意味着它们实际上作为 URL 存在
https://Sample.firebaseapp.com/users/Liz_Smith
https://Sample.firebaseapp.com/users/Shanna_Oreily
当某人转到该 URL 时,该人将更新为已批准,这将变成:
-Sample (which would be at https://Sample.firebaseio.com)
-Users
Liz_Smith
approved: False
Shanna_Oreily
approved: False
变成这样:
-Sample (which would be at https://Sample.firebaseio.com)
-Users
Liz_Smith
approved: True
Shanna_Oreily
approved: True
最佳答案
I don't think something like this is possible, because it's as if pushing with a URL.
您可以在 Firebase 中存储网址。
对于这种情况,您可以为 anchor 标记添加一个事件监听器。单击它时,您可以将数据设置为 Firebase。如果您还在 Firebase 中为用户位置附加一个监听器,您可以将这些链接实时附加到页面。
下面是一个使用 jQuery 完成的示例,但它可以很容易地适应您使用的任何流程或框架。
var fbRef = new Firebase('https://firenode.firebaseio.com/'),
userRef = fbRef.child('users'),
appUrlBase = 'https://myapp.firebaseapp.com/',
links = $('#people-list > li a'),
urlList = $('#url-list');
// create click handlers for every link
$.each(links, function(key, link) {
var $link = $(link),
name = $link.text(),
url = appUrlBase + name;
$link.on('click', function(e) {
userRef.child(name).set({
approvedUrl: url // <- this is a URL
});
});
});
// helper function for creating lis with a tags
function createLi(url) {
var li = $('<li></li>');
li.append('<a href="' + url + '">' + url + '</a>');
return li;
}
// listen for the additions to the users location
// when items are added we can append to the list
userRef.on('child_added', function(snap) {
var url = snap.val().approvedUrl;
elem = createLi(url);
urlList.append(elem);
});
关于javascript - 如何创建一个 URL,当点击该 URL 时批准或将名称添加到 firebase 中的列表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24722916/
构建用于批准或拒绝用户的 RESTful 资源的正确方法是什么? 此资源旨在由管理员审查用户。管理员可以批准或拒绝用户请求。请求需要有 user_id和 updated_status那可能是 appr
关闭。这个问题是opinion-based .它目前不接受答案。 想改进这个问题?更新问题,以便 editing this post 可以用事实和引用来回答它. 2年前关闭。 Improve this
我计划创建状态通知。例如,每当信息是 "Pending", it turns to color orange. When "Approved" it turns to color green and
假设我设置了一个存储库。我希望有的用户可以推送,有的用户我想先过一遍推送的内容再批准。有条件推送之类的概念吗?待批准推送队列? 最佳答案 您本质上需要一个代码审查工具。 git 有一些,但最好的可能是
我目前正在将我的一个网站从旧系统升级到 HTML5,但我在使用 Google Maps JavaScript API v3 时遇到了一些问题。要从他们的 API 获取数据,您必须有一个 key - 当
我们想将 JIRA 与 GITLAB 集成以获得批准。当 CICD Pipeline 运行时,它会部署到 DEV/QA,当它部署到 PROD 时,我们要检查两件事 经理/代码所有者批准了一项合并请求
我在我的网站中使用 Authy 进行 2 因素身份验证。我的代码发送了一个推送通知,我在手机上的 Authy 应用程序中收到了它。但问题是有时当我尝试接受/拒绝请求时,我收到一条错误消息 There
我正在修改网站以允许用户输入内容。但是,一旦他们创建了该内容,就需要在发布之前获得批准。这很容易通过在该内容的记录中设置一个“中等”位来实现,并且只需要一个表。 现在我还希望允许用户像在 StackO
我正在使用 ubuntu 12.04,我有一个应用程序,当我运行时,退出: ./ardrone_navigation Setting locale to en_GB.UTF-8 Errore di s
我在 gitlab 有两个分支 master 和 release。 在发布分支,我希望它只有提交消息,如:v0.1.0,v0.1.1。 说在我完成 v0.1.0 开发后,我在 master 中有几个功
我们为一家想要在自己的帐户下发布该应用程序的公司开发了一个应用程序。它是在我们的帐户上开发的,并且已从我们自己的帐户附加了配置文件。做这个的最好方式是什么?我是否必须向他们发送 xCode 项目并告诉
我正在构建一个网站,用户可以在其中更改其公开显示的个人资料。但是,我需要所有更改在上线之前都得到管理员的批准。在更改获得批准之前,他们的旧个人资料将显示。在管理员中应该有一个等待批准的配置文件列表。最
我正在构建一个网站,用户可以在其中更改其公开显示的个人资料。但是,我需要所有更改在上线之前都得到管理员的批准。在更改获得批准之前,他们的旧个人资料将显示。在管理员中应该有一个等待批准的配置文件列表。最
在我们的团队中,一名开发人员将应用送交审核。 它通过了,但在某些时候开发者证书不再有效。 我们现在无法在外部或内部测试人员中下载应用。 如果我们发布那个版本会怎样? 我将感谢您的经验和意见。 最佳答案
更新: $(document).ready(function () { $('#C1All').click(functio
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 这个问题似乎与 help center 中定义的范围内的编程无关。 . 关闭 8 年前。 Improve
我在 Gitlab 中找不到在我看来常见情况的选项,即仅批准 merge 请求,但不触发构建。我需要将流程分为两个操作:审批者审查并批准 merge 请求,但 merge 请求的作者将进行 merge
这个问题在这里已经有了答案: How to access the correct `this` inside a callback (15 个答案) 关闭 3 年前。
我正在尝试使用新的 Azure AD Privileged Identity Management REST API 批准/拒绝角色激活请求。 我已经能够使用以下请求读取所有待处理的角色激活请求: G
我的网站是一个用 AngularJs 编写的单页应用程序。 我正在尝试为某些页面添加 AdSense。提交后,我的网站被拒绝,原因如下:“内容不足”。 我的问题是:考虑到我们使用 escaped_fr
我是一名优秀的程序员,十分优秀!