client/data/custom_templates.js
author durandn
Thu, 21 Apr 2016 15:18:19 +0200
changeset 605 13d355fd09bf
parent 484 cfe440ade6d6
permissions -rw-r--r--
updated uri to allow optional trailing slash on single resource URIs (django automatic redirects don't carry over the Authorization header that can sometimes be needed, for instance with OAuth)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
484
cfe440ade6d6 new tests to check the correct behavior of adding custom templates
rougeronj
parents:
diff changeset
     1
var custom_templates = {}
cfe440ade6d6 new tests to check the correct behavior of adding custom templates
rougeronj
parents:
diff changeset
     2
cfe440ade6d6 new tests to check the correct behavior of adding custom templates
rougeronj
parents:
diff changeset
     3
custom_templates['nodeeditor_audio'] = function(obj) {
cfe440ade6d6 new tests to check the correct behavior of adding custom templates
rougeronj
parents:
diff changeset
     4
    obj || (obj = {});
cfe440ade6d6 new tests to check the correct behavior of adding custom templates
rougeronj
parents:
diff changeset
     5
    var __t, __p = '', __e = _.escape, __j = Array.prototype.join;
cfe440ade6d6 new tests to check the correct behavior of adding custom templates
rougeronj
parents:
diff changeset
     6
    function print() { __p += __j.call(arguments, '') }
cfe440ade6d6 new tests to check the correct behavior of adding custom templates
rougeronj
parents:
diff changeset
     7
    with (obj) {
cfe440ade6d6 new tests to check the correct behavior of adding custom templates
rougeronj
parents:
diff changeset
     8
    __p += '<h2>\n    <span class="Rk-CloseX">&times;</span>\n    ';
cfe440ade6d6 new tests to check the correct behavior of adding custom templates
rougeronj
parents:
diff changeset
     9
     if (options.show_node_tooltip_color) { ;
cfe440ade6d6 new tests to check the correct behavior of adding custom templates
rougeronj
parents:
diff changeset
    10
    __p += '\n        <span class="Rk-UserColor" style="background: ' +
cfe440ade6d6 new tests to check the correct behavior of adding custom templates
rougeronj
parents:
diff changeset
    11
    __e(node.color) +
cfe440ade6d6 new tests to check the correct behavior of adding custom templates
rougeronj
parents:
diff changeset
    12
    ';"></span>\n    ';
cfe440ade6d6 new tests to check the correct behavior of adding custom templates
rougeronj
parents:
diff changeset
    13
     } ;
cfe440ade6d6 new tests to check the correct behavior of adding custom templates
rougeronj
parents:
diff changeset
    14
    __p += '\n    <span class="Rk-Display-Title">\n        ';
cfe440ade6d6 new tests to check the correct behavior of adding custom templates
rougeronj
parents:
diff changeset
    15
     if (node.uri) { ;
cfe440ade6d6 new tests to check the correct behavior of adding custom templates
rougeronj
parents:
diff changeset
    16
    __p += '\n            <a href="' +
cfe440ade6d6 new tests to check the correct behavior of adding custom templates
rougeronj
parents:
diff changeset
    17
    __e(node.uri) +
cfe440ade6d6 new tests to check the correct behavior of adding custom templates
rougeronj
parents:
diff changeset
    18
    '" target="_blank">\n        ';
cfe440ade6d6 new tests to check the correct behavior of adding custom templates
rougeronj
parents:
diff changeset
    19
     } ;
cfe440ade6d6 new tests to check the correct behavior of adding custom templates
rougeronj
parents:
diff changeset
    20
    __p += '\n        ' +
cfe440ade6d6 new tests to check the correct behavior of adding custom templates
rougeronj
parents:
diff changeset
    21
    __e(node.title) +
cfe440ade6d6 new tests to check the correct behavior of adding custom templates
rougeronj
parents:
diff changeset
    22
    '\n        ';
cfe440ade6d6 new tests to check the correct behavior of adding custom templates
rougeronj
parents:
diff changeset
    23
     if (node.uri) { ;
cfe440ade6d6 new tests to check the correct behavior of adding custom templates
rougeronj
parents:
diff changeset
    24
    __p += '</a>';
cfe440ade6d6 new tests to check the correct behavior of adding custom templates
rougeronj
parents:
diff changeset
    25
     } ;
cfe440ade6d6 new tests to check the correct behavior of adding custom templates
rougeronj
parents:
diff changeset
    26
    __p += '\n    </span>\n</h2>\n';
cfe440ade6d6 new tests to check the correct behavior of adding custom templates
rougeronj
parents:
diff changeset
    27
     if (node.uri && options.show_node_tooltip_uri) { ;
cfe440ade6d6 new tests to check the correct behavior of adding custom templates
rougeronj
parents:
diff changeset
    28
    __p += '\n     <audio width="320" height="240" controls>\n        <source src="' +
cfe440ade6d6 new tests to check the correct behavior of adding custom templates
rougeronj
parents:
diff changeset
    29
    __e(node.uri) +
cfe440ade6d6 new tests to check the correct behavior of adding custom templates
rougeronj
parents:
diff changeset
    30
    '" type="video/mp4">\n     </video> \n';
cfe440ade6d6 new tests to check the correct behavior of adding custom templates
rougeronj
parents:
diff changeset
    31
     } ;
cfe440ade6d6 new tests to check the correct behavior of adding custom templates
rougeronj
parents:
diff changeset
    32
    __p += '\n    <a href="#?idnode=' +
cfe440ade6d6 new tests to check the correct behavior of adding custom templates
rougeronj
parents:
diff changeset
    33
    __e(node._id) +
cfe440ade6d6 new tests to check the correct behavior of adding custom templates
rougeronj
parents:
diff changeset
    34
    '">' +
cfe440ade6d6 new tests to check the correct behavior of adding custom templates
rougeronj
parents:
diff changeset
    35
    __e(renkan.translate("Link to the node")) +
cfe440ade6d6 new tests to check the correct behavior of adding custom templates
rougeronj
parents:
diff changeset
    36
    '</a>\n';
cfe440ade6d6 new tests to check the correct behavior of adding custom templates
rougeronj
parents:
diff changeset
    37
cfe440ade6d6 new tests to check the correct behavior of adding custom templates
rougeronj
parents:
diff changeset
    38
    }
cfe440ade6d6 new tests to check the correct behavior of adding custom templates
rougeronj
parents:
diff changeset
    39
    return __p
cfe440ade6d6 new tests to check the correct behavior of adding custom templates
rougeronj
parents:
diff changeset
    40
};