');
+ var i = 0;
+ var space = 10;
+ path.forEach(function (s) {
+ if (i === 0) { s = getPrettyName(s); }
+ $div.append($('
', {'style': 'margin: 0 0 0 ' + i * space + 'px;'}).text(s));
+ $div.append($('
'));
+ i++;
+ });
+ return $div.html();
+ };
+
+ var getReadOnlyUrl = APP.getRO = function (id) {
+ if (!filesOp.isFile(id)) { return; }
+ var data = filesOp.getFileData(id);
+ if (!data) { return; }
+ var parsed = Cryptpad.parsePadUrl(data.href);
+ if (parsed.hashData.type !== "pad") { return; }
+ var i = data.href.indexOf('#') + 1;
+ var base = APP.origin + data.href.slice(0, i);
+ var hrefsecret = Cryptpad.getSecrets(parsed.type, parsed.hash);
+ if (!hrefsecret.keys) { return; }
+ var viewHash = Cryptpad.getViewHashFromKeys(hrefsecret.channel, hrefsecret.keys);
+ return base + viewHash;
+ };
+
+ // Disable middle click in the context menu to avoid opening /drive/inner.html# in new tabs
+ $(window).click(function (e) {
+ if (!e.target || !$(e.target).parents('.cp-dropdown-content').length) { return; }
+ if (e.which !== 1) {
+ e.stopPropagation();
+ return false;
+ }
+ });
+
+ var getProperties = function (el, cb) {
+ if (!filesOp.isFile(el)) {
+ return void cb('NOT_FILE');
+ }
+ var ro = filesOp.isReadOnlyFile(el);
+ var base = APP.origin;
+ var $d = $('');
+ $('').text(Messages.fc_prop).appendTo($d);
+
+ var data = filesOp.getFileData(el);
+ if (!data || !data.href) { return void cb(void 0, $d); }
+
+ $('
').appendTo($d);
+ if (!ro) {
+ $('