Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/polls.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorsplitt3r <splitt3r@users.noreply.github.com>2017-10-11 12:22:19 +0300
committersplitt3r <splitt3r@users.noreply.github.com>2017-10-11 12:22:19 +0300
commit3119ece51a3ae82e2c81e05506612d6242a980ba (patch)
tree2a84298876911ab5f48607335ce810fdf8f4cb37 /js
parent3e4a02f028531ff11851115fb85628bd6911d71c (diff)
parent443c3c0e3a2589253fee03556b4c1bc1ee7f43f8 (diff)
Merge RC 0.8 in feature/refactor
Diffstat (limited to 'js')
-rwxr-xr-xjs/start.js47
1 files changed, 38 insertions, 9 deletions
diff --git a/js/start.js b/js/start.js
index 57a8d47e..fc109cea 100755
--- a/js/start.js
+++ b/js/start.js
@@ -1,20 +1,39 @@
$(document).ready(function () {
- $('.cl_delete').click(deletePoll);
+/*
+ $('.table-body div.column.expiry').each(function(i, obj) {
+ if (isDate(obj.dataset.value)) {
+ obj.dataset.value = obj.dataset.value.replace(/ /g,"T")+"Z";
+ obj.innerText= OC.Util.relativeModifiedDate(obj.dataset.value);
+ };
+ });
+ */
+ $('.table-body .avatardiv').each(function(i, obj) {
+ $(obj).avatar(obj.title, 32);
+ });
+
+ $('.popupmenu').each(function() {
+ OC.registerMenu($('#expand_' + $(this).attr('value')), $('#expanddiv_' + $(this).attr('value')) );
+ });
+
+ // $('.cl_delete').click(deletePoll);
+ $('.delete_poll').click(deletePoll);
- $('.cl_link').click(function() {
+ $('.copy_link').click(function() {
window.prompt(t('polls','Copy to clipboard: Ctrl+C, Enter'), $(this).data('url'));
});
+
+ // $('.cl_link').click(function() {
+ // window.prompt(t('polls','Copy to clipboard: Ctrl+C, Enter'), $(this).data('url'));
+ // });
+
+
+
});
function deletePoll(e) {
var tr = this.parentNode.parentNode;
- var titleTd = tr.firstChild;
- //check if first child is whitespace text element
- if(titleTd.nodeName == '#text') titleTd = titleTd.nextSibling;
- var tdElem = titleTd.firstChild;
- //again, whitespace check
- if(tdElem.nodeName == '#text') tdElem = tdElem.nextSibling;
- var str = t('polls', 'Do you really want to delete that poll?') + '\n\n' + tdElem.innerHTML;
+ var titleTd = $(this).attr('data-value');
+ var str = t('polls', 'Do you really want to delete that poll?') + '\n\n' + $(this).attr('data-value');
if (confirm(str)) {
var form = document.form_delete_poll;
var hiddenId = document.createElement("input");
@@ -25,3 +44,13 @@ function deletePoll(e) {
form.submit();
}
}
+
+/*
+ obj.textContent = obj.data-value ;
+ */
+
+function isDate(val) {
+ var d = new Date(val);
+ return !isNaN(d.valueOf());
+}
+