/usr/share/horde/turba/js/smartmobile.js is in php-horde-turba 4.1.3-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 | /**
* jQuery Mobile UI Turba application logic.
*
* Copyright 2012-2013 Horde LLC (http://www.horde.org/)
*
* See the enclosed file LICENSE for license information (ASL). If you did
* did not receive this file, see http://www.horde.org/licenses/apache.
*
* @author Michael Slusarz <slusarz@horde.org>
*/
var TurbaMobile = {
/**
* Event handler for the pagebeforechange event that implements loading of
* deep-linked pages.
*
* @param object e Event object.
* @param object data Event data.
*/
toPage: function(e, data)
{
switch (data.options.parsedUrl.view) {
case 'entry':
TurbaMobile.entry(data);
e.preventDefault();
break;
}
},
/**
* View an entry.
*
* @param object data Page change data object.
*/
entry: function(data)
{
var purl = data.options.parsedUrl,
tmp = $('#entry .smartmobile-back');
/* We may have reached here from a group contact link. */
if (HordeMobile.currentPage() == 'entry') {
HordeMobile.updateHash(purl);
if (tmp.attr('data-rel')) {
tmp.removeClass($.mobile.activeBtnClass).blur();
tmp.removeAttr('data-rel')
.find('.ui-btn-text').text(Turba.text.browse);
} else {
tmp.attr('data-rel', 'back')
.find('.ui-btn-text').text(Turba.text.group);
}
}
HordeMobile.changePage('entry', data);
$('#entry :jqmData(role="content")').hide();
HordeMobile.doAction(
'smartmobileEntry',
{
key: purl.params.key,
source: purl.params.source
},
TurbaMobile.entryLoaded
);
},
/**
* Callback method after an entry has been loaded.
*
* @param object r The Ajax response object.
*/
entryLoaded: function(r)
{
if (r.error) {
HordeMobile.changePage('browse');
return;
}
var tmp,
ted = $('#turba-entry-data').empty();
$.each(r.entry, function(k, v) {
var tmp2 = $('<div></div>');
ted.append($('<div data-role="collapsible"></div>').append(
$('<h3></h3>').text(k)
).append(tmp2));
$.each(v, function(k2, v2) {
tmp2.append(
$('<div class="turba-entry-label"></div>').text(v2.l)
);
if (v2.u) {
tmp2.append(
$('<ul data-role="listview" data-inset="true"></ul>').append(
$('<li></li>').append(
$('<a data-ajax="false"></a>')
.attr('href', v2.u)
.text(v2.v)
)
)
);
} else {
tmp2.append(
$('<div class="turba-entry-value"></div>').text(v2.v)
);
}
});
});
if (r.group) {
tmp = $('<ul></ul>')
.attr('data-role', 'listview')
.attr('data-inset', 'true');
$.each(r.group.m, function(k, v) {
tmp.append(
$('<li></li>').append(
$('<a></a>').attr('href', v.u).text(v.n)
)
);
});
ted.append(
$('<div></div>')
.attr('data-role', 'collapsible')
.append(
$('<h3></h3>').text(r.group.l)
).append(
$('<div></div>').append(tmp)
)
);
}
ted.collapsibleset('refresh')
.find(':jqmData(role="listview")').listview();
$('#entry :jqmData(role="content")').show();
},
/**
* Event handler for the document-ready event, responsible for the initial
* setup.
*/
onDocumentReady: function()
{
// Set up HordeMobile.
$(document).bind('pagebeforechange', TurbaMobile.toPage);
}
};
// JQuery Mobile setup
$(TurbaMobile.onDocumentReady);
|