diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/css/styles.css | 1 | ||||
-rw-r--r-- | core/img/actions/mail.png | bin | 548 -> 463 bytes | |||
-rw-r--r-- | core/img/actions/mail.svg | 361 | ||||
-rw-r--r-- | core/js/js.js | 5 | ||||
-rw-r--r-- | core/js/oc-dialogs.js | 459 | ||||
-rw-r--r-- | core/js/oc-vcategories.js | 13 | ||||
-rw-r--r-- | core/templates/layout.user.php | 2 |
7 files changed, 291 insertions, 550 deletions
diff --git a/core/css/styles.css b/core/css/styles.css index e3d8403e750..c77df7d4cca 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -62,6 +62,7 @@ input[type="submit"].highlight{ background:#ffc100; border:1px solid #db0; text- #leftcontent li:hover, #leftcontent li:active, #leftcontent li.active, .leftcontent li:hover, .leftcontent li:active, .leftcontent li.active { background:#eee; } #leftcontent li.active, .leftcontent li.active { font-weight:bold; } #leftcontent li:hover, .leftcontent li:hover { color:#333; background:#ddd; } +#leftcontent a { height: 100%; display: block; margin: 0; padding: 0 1em 0 0; float: left; } #rightcontent, .rightcontent { position:fixed; top: 6.4em; left: 32.5em; overflow: auto } diff --git a/core/img/actions/mail.png b/core/img/actions/mail.png Binary files differindex ea811ac5453..4d3192ef329 100644 --- a/core/img/actions/mail.png +++ b/core/img/actions/mail.png diff --git a/core/img/actions/mail.svg b/core/img/actions/mail.svg index 54a24faf85d..e82fa3b4677 100644 --- a/core/img/actions/mail.svg +++ b/core/img/actions/mail.svg @@ -7,20 +7,26 @@ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - version="1.0" - width="22" - height="22" - id="svg2575" - inkscape:version="0.48.2 r9819" - sodipodi:docname="mail_new.svg" - inkscape:export-filename="/home/tol/tanghus-owncloud/core/img/actions/mail.png" - inkscape:export-xdpi="65.454544" - inkscape:export-ydpi="65.454544"> + version="1.1" + width="16" + height="16" + id="svg2985"> + <defs + id="defs2987"> + <linearGradient + id="linearGradient3767"> + <stop + id="stop3769" + style="stop-color:#ffffff;stop-opacity:1" + offset="0" /> + <stop + id="stop3771" + style="stop-color:#ffffff;stop-opacity:0" + offset="1" /> + </linearGradient> + </defs> <metadata - id="metadata59"> + id="metadata2990"> <rdf:RDF> <cc:Work rdf:about=""> @@ -31,315 +37,22 @@ </cc:Work> </rdf:RDF> </metadata> - <sodipodi:namedview - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1" - objecttolerance="10" - gridtolerance="10" - guidetolerance="10" - inkscape:pageopacity="0" - inkscape:pageshadow="2" - inkscape:window-width="640" - inkscape:window-height="480" - id="namedview57" - showgrid="false" - inkscape:zoom="10.727273" - inkscape:cx="11" - inkscape:cy="11" - inkscape:window-x="0" - inkscape:window-y="0" - inkscape:window-maximized="0" - inkscape:current-layer="svg2575" /> - <defs - id="defs2577"> - <linearGradient - id="linearGradient3943"> - <stop - id="stop3945" - style="stop-color:#ffffff;stop-opacity:0.40000001" - offset="0" /> - <stop - id="stop3947" - style="stop-color:#ffffff;stop-opacity:0" - offset="1" /> - </linearGradient> - <linearGradient - x1="24.138529" - y1="7.0478544" - x2="24.138529" - y2="47.272728" - id="linearGradient2560" - xlink:href="#linearGradient3943" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0.2817955,0,0,0.2800956,-16.058706,13.975052)" /> - <linearGradient - id="linearGradient2264"> - <stop - id="stop2266" - style="stop-color:#d7e866;stop-opacity:1" - offset="0" /> - <stop - id="stop2268" - style="stop-color:#8cab2a;stop-opacity:1" - offset="1" /> - </linearGradient> - <linearGradient - x1="24.103895" - y1="15.168831" - x2="24.103895" - y2="32.485161" - id="linearGradient2558" - xlink:href="#linearGradient2264" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0.4691323,0,0,0.4663025,-20.554789,9.7686284)" /> - <linearGradient - id="linearGradient3495-841-851-719"> - <stop - id="stop4120" - style="stop-color:#1e1e1e;stop-opacity:1" - offset="0" /> - <stop - id="stop4122" - style="stop-color:#1e1e1e;stop-opacity:0" - offset="1" /> - </linearGradient> - <linearGradient - id="linearGradient3333-314-917-262"> - <stop - id="stop4102" - style="stop-color:#ffffff;stop-opacity:1" - offset="0" /> - <stop - id="stop4104" - style="stop-color:#ffffff;stop-opacity:0" - offset="1" /> - </linearGradient> - <linearGradient - id="linearGradient2490-495-150-777"> - <stop - id="stop4108" - style="stop-color:#787878;stop-opacity:1" - offset="0" /> - <stop - id="stop4110" - style="stop-color:#b4b4b4;stop-opacity:1" - offset="1" /> - </linearGradient> - <linearGradient - id="linearGradient3242-967-12-570-862-307"> - <stop - id="stop4498" - style="stop-color:#f2f2f2;stop-opacity:1" - offset="0" /> - <stop - id="stop4502" - style="stop-color:#dbdbdb;stop-opacity:1" - offset="0.87426931" /> - <stop - id="stop4504" - style="stop-color:#999999;stop-opacity:1" - offset="1" /> - </linearGradient> - <linearGradient - id="linearGradient5060-6-986-342-61"> - <stop - id="stop4080" - style="stop-color:#1e1e1e;stop-opacity:1" - offset="0" /> - <stop - id="stop4082" - style="stop-color:#1e1e1e;stop-opacity:0" - offset="1" /> - </linearGradient> - <radialGradient - cx="605.71429" - cy="486.64789" - r="117.14286" - fx="605.71429" - fy="486.64789" - id="radialGradient2724-226-535-494" - xlink:href="#linearGradient5060-6-986-342-61" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(-6.553443e-2,0,0,2.470588e-2,-21.829255,10.577352)" /> - <linearGradient - id="linearGradient5060-6-252-476-367"> - <stop - id="stop4074" - style="stop-color:#1e1e1e;stop-opacity:1" - offset="0" /> - <stop - id="stop4076" - style="stop-color:#1e1e1e;stop-opacity:0" - offset="1" /> - </linearGradient> - <radialGradient - cx="605.71429" - cy="486.64789" - r="117.14286" - fx="605.71429" - fy="486.64789" - id="radialGradient2722-303-187-273" - xlink:href="#linearGradient5060-6-252-476-367" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(6.553443e-2,0,0,2.470588e-2,-69.175497,10.577352)" /> - <linearGradient - id="linearGradient5048-7-668-934-892"> - <stop - id="stop4066" - style="stop-color:#1e1e1e;stop-opacity:0" - offset="0" /> - <stop - id="stop4068" - style="stop-color:#1e1e1e;stop-opacity:1" - offset="0.5" /> - <stop - id="stop4070" - style="stop-color:#1e1e1e;stop-opacity:0" - offset="1" /> - </linearGradient> - <linearGradient - x1="302.85715" - y1="366.64789" - x2="302.85715" - y2="609.50507" - id="linearGradient2720-766-26-906" - xlink:href="#linearGradient5048-7-668-934-892" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(6.553443e-2,0,0,2.470588e-2,-69.188394,10.577352)" /> - <linearGradient - x1="23.903786" - y1="35.75" - x2="23.903786" - y2="16.00676" - id="linearGradient3411" - xlink:href="#linearGradient3495-841-851-719" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0.4657385,0,0,0.4850945,0.8223379,-3.5686279)" /> - <linearGradient - x1="23.928667" - y1="30.773148" - x2="23.928667" - y2="45.530704" - id="linearGradient3414" - xlink:href="#linearGradient3495-841-851-719" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0.4657385,0,0,0.4850945,0.8223378,-4.102232)" /> - <linearGradient - x1="25.57654" - y1="15.000002" - x2="25.57654" - y2="44.00053" - id="linearGradient3417" - xlink:href="#linearGradient3333-314-917-262" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0.4418603,0,0,0.4642857,1.3953491,-3.696433)" /> - <linearGradient - x1="19.875452" - y1="10.389797" - x2="19.875452" - y2="45.60001" - id="linearGradient3420" - xlink:href="#linearGradient3242-967-12-570-862-307" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0.4666666,0,0,0.4545454,0.7999999,-2.7272752)" /> - <linearGradient - x1="28.103424" - y1="45.000065" - x2="28.103424" - y2="14.038458" - id="linearGradient3422" - xlink:href="#linearGradient2490-495-150-777" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0.4666666,0,0,0.5006418,0.7999998,-4.7785529)" /> - <linearGradient - x1="23.903786" - y1="35.75" - x2="23.903786" - y2="16.00676" - id="linearGradient2440" - xlink:href="#linearGradient3495-841-851-719" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0.4657385,0,0,0.4850945,-0.1776621,-4.5686279)" /> - <linearGradient - x1="23.928667" - y1="30.773148" - x2="23.928667" - y2="45.530704" - id="linearGradient2443" - xlink:href="#linearGradient3495-841-851-719" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0.4657385,0,0,0.4850945,-0.1776622,-5.102232)" /> - <linearGradient - x1="25.57654" - y1="15.000002" - x2="25.57654" - y2="44.00053" - id="linearGradient2446" - xlink:href="#linearGradient3333-314-917-262" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0.4418603,0,0,0.4642857,0.3953491,-4.696433)" /> - <linearGradient - x1="19.875452" - y1="10.389797" - x2="19.875452" - y2="45.60001" - id="linearGradient2449" - xlink:href="#linearGradient3242-967-12-570-862-307" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0.4666666,0,0,0.4545454,-0.10677976,-1.5832074)" /> - <linearGradient - x1="28.103424" - y1="45.000065" - x2="28.103424" - y2="14.038458" - id="linearGradient2451" - xlink:href="#linearGradient2490-495-150-777" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0.4666666,0,0,0.5006418,-0.10677986,-3.6344851)" /> - <linearGradient - x1="24.103895" - y1="15.168831" - x2="24.103895" - y2="32.485161" - id="linearGradient2457" - xlink:href="#linearGradient2264" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0.4691323,0,0,0.4663025,-20.554789,9.7686284)" /> - <linearGradient - x1="24.138529" - y1="7.0478544" - x2="24.138529" - y2="47.272728" - id="linearGradient2459" - xlink:href="#linearGradient3943" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0.2817955,0,0,0.2800956,-16.058706,13.975052)" /> - </defs> - <rect - width="21" - height="15" - rx="0.46666664" - ry="0.45454553" - x="0.59322035" - y="3.6440678" - id="rect2396" - style="fill:url(#linearGradient2449);fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient2451);stroke-width:1;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" /> - <rect - width="19" - height="13" - rx="0.036476243" - ry="0.035004593" - x="1.5" - y="2.5" - id="rect3331" - style="opacity:0.4;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient2446);stroke-width:0.99999994;stroke-linecap:square;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" /> - <path - d="M 8.2139564,10.336975 L 1.1222032,16.468629 M 13.709509,10.325653 L 20.811476,16.468629" - id="path3341" - style="opacity:0.5;fill:none;fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient2443);stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" /> - <path - d="M 0.8491563,3.0457658 L 11.000062,12.181817 L 20.937208,3.0457658" - id="path3493" - style="opacity:0.5;fill:none;fill-rule:evenodd;stroke:url(#linearGradient2440);stroke-width:1.00000012;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <g + id="layer1"> + <rect + width="15.243872" + height="10.243872" + x="0.37806413" + y="2.6280646" + id="rect2995" + style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:0.75612825;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" /> + <path + d="M -0.6,11 8,6 l 8.6,5" + id="path3765" + style="fill:none;stroke:#ffffff;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> + <path + d="M 0,2.5 8,9 16,2.5" + id="path3775" + style="fill:#000000;fill-opacity:1;stroke:#ffffff;stroke-width:1px;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1" /> + </g> </svg> diff --git a/core/js/js.js b/core/js/js.js index f697f2b8537..7585d4b09d1 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -419,6 +419,11 @@ $(document).ready(function(){ } }); + $('#settings #expand').keydown(function(event) { + if (event.which == 13 || event.which == 32) { + $('#expand').click() + } + }); $('#settings #expand').click(function(event) { $('#settings #expanddiv').slideToggle(); event.stopPropagation(); diff --git a/core/js/oc-dialogs.js b/core/js/oc-dialogs.js index f6870e62710..0fa41696a16 100644 --- a/core/js/oc-dialogs.js +++ b/core/js/oc-dialogs.js @@ -20,226 +20,245 @@ */ /** - * this class ease usage of jquery dialogs + * this class to ease the usage of jquery dialogs */ OCdialogs = { - /** - * displays alert dialog - * @param text content of dialog - * @param title dialog title - * @param callback which will be triggered when user press OK - */ - alert:function(text, title, callback, modal) { - var content = '<p><span class="ui-icon ui-icon-alert"></span>'+text+'</p>'; - OCdialogs.message(content, title, OCdialogs.ALERT_DIALOG, OCdialogs.OK_BUTTON, callback, modal); - }, - /** - * displays info dialog - * @param text content of dialog - * @param title dialog title - * @param callback which will be triggered when user press OK - */ - info:function(text, title, callback, modal) { - var content = '<p><span class="ui-icon ui-icon-info"></span>'+text+'</p>'; - OCdialogs.message(content, title, OCdialogs.ALERT_DIALOG, OCdialogs.OK_BUTTON, callback, modal); - }, - /** - * displays confirmation dialog - * @param text content of dialog - * @param title dialog title - * @param callback which will be triggered when user press YES or NO (true or false would be passed to callback respectively) - */ - confirm:function(text, title, callback, modal) { - var content = '<p><span class="ui-icon ui-icon-notice"></span>'+text+'</p>'; - OCdialogs.message(content, title, OCdialogs.ALERT_DIALOG, OCdialogs.YES_NO_BUTTONS, callback, modal); - }, - /** - * prompt for user input - * @param text content of dialog - * @param title dialog title - * @param callback which will be triggered when user press OK (input text will be passed to callback) - */ - prompt:function(text, title, default_value, callback, modal) { - var content = '<p><span class="ui-icon ui-icon-pencil"></span>'+text+':<br/><input type="text" id="oc-dialog-prompt-input" value="'+default_value+'" style="width:90%"></p>'; - OCdialogs.message(content, title, OCdialogs.PROMPT_DIALOG, OCdialogs.OK_CANCEL_BUTTONS, callback, modal); - }, - /** - * prompt user for input with custom form - * fields should be passed in following format: [{text:'prompt text', name:'return name', type:'input type', value: 'dafault value'},...] - * @param fields to display - * @param title dialog title - * @param callback which will be triggered when user press OK (user answers will be passed to callback in following format: [{name:'return name', value: 'user value'},...]) - */ - form:function(fields, title, callback, modal) { - var content = '<table>'; - for (var a in fields) { - content += '<tr><td>'+fields[a].text+'</td><td>'; - var type=fields[a].type; - if (type == 'text' || type == 'checkbox' || type == 'password') { - content += '<input type="'+type+'" name="'+fields[a].name+'"'; - if (type == 'checkbox') { - if (fields[a].value != undefined && fields[a].value == true) { - content += ' checked="checked">'; - } else content += '>'; - } else if (type == 'text' || type == 'password' && fields[a].value) - content += ' value="'+fields[a].value+'">'; - } else if (type == 'select') { - content += '<select name="'+fields[a].name+'"'; - if (fields[a].value != undefined) - content += ' value="'+fields[a].value+'"'; - content += '>'; - for (var o in fields[a].options) - content += '<option value="'+fields[a].options[o].value+'">'+fields[a].options[o].text+'</option>'; - content += '</select>'; - } - content += '</td></tr>'; - } - content += '</table>'; - OCdialogs.message(content, title, OCdialogs.FORM_DIALOG, OCdialogs.OK_CANCEL_BUTTONS, callback, modal); - }, - filepicker:function(title, callback, multiselect, mimetype_filter, modal) { - var c_name = 'oc-dialog-'+OCdialogs.dialogs_counter+'-content'; - var c_id = '#'+c_name; - var d = '<div id="'+c_name+'" title="'+title+'"><select id="dirtree"><option value="0">'+OC.currentUser+'</option></select><div id="filelist"></div><div class="filepicker_loader"><img src="'+OC.filePath('gallery','img','loading.gif')+'"></div></div>'; - if (!modal) modal = false; - if (!multiselect) multiselect = false; - $('body').append(d); - $(c_id + ' #dirtree').focus(function() { var t = $(this); t.data('oldval', t.val())}) - .change({dcid: c_id}, OC.dialogs.handleTreeListSelect); - $(c_id).ready(function(){ - $.getJSON(OC.filePath('files', 'ajax', 'rawlist.php'), {mimetype: mimetype_filter} ,function(r){OC.dialogs.fillFilePicker(r, c_id, callback)}); - }).data('multiselect', multiselect).data('mimetype',mimetype_filter); - // build buttons - var b = [ - {text: t('dialogs', 'Choose'), click: function(){ - if (callback != undefined) { - var p; - if ($(c_id).data('multiselect') == true) { - p = []; - $(c_id+' .filepicker_element_selected #filename').each(function(i, elem) { - p.push(($(c_id).data('path')?$(c_id).data('path'):'')+'/'+$(elem).text()); - }); - } else { - var p = $(c_id).data('path'); - if (p == undefined) p = ''; - p = p+'/'+$(c_id+' .filepicker_element_selected #filename').text() - } - callback(p); - $(c_id).dialog('close'); - } - } - }, - {text: t('dialogs', 'Cancel'), click: function(){$(c_id).dialog('close'); }} - ]; - $(c_id).dialog({width: ((4*$('body').width())/9), height: 400, modal: modal, buttons: b}); - OCdialogs.dialogs_counter++; - }, - // guts, dont use, dont touch - message:function(content, title, dialog_type, buttons, callback, modal) { - var c_name = 'oc-dialog-'+OCdialogs.dialogs_counter+'-content'; - var c_id = '#'+c_name; - var d = '<div id="'+c_name+'" title="'+title+'">'+content+'</div>'; - if (modal == undefined) modal = false; - $('body').append(d); - var b = []; - switch (buttons) { - case OCdialogs.YES_NO_BUTTONS: - b[1] = {text: t('dialogs', 'No'), click: function(){ if (callback != undefined) callback(false); $(c_id).dialog('close'); }}; - b[0] = {text: t('dialogs', 'Yes'), click: function(){ if (callback != undefined) callback(true); $(c_id).dialog('close');}}; - break; - case OCdialogs.OK_CANCEL_BUTTONS: - b[1] = {text: t('dialogs', 'Cancel'), click: function(){$(c_id).dialog('close'); }}; - case OCdialogs.OK_BUTTON: // fallthrough - var f; - switch(dialog_type) { - case OCdialogs.ALERT_DIALOG: - f = function(){$(c_id).dialog('close'); callback();}; - break; - case OCdialogs.PROMPT_DIALOG: - f = function(){OCdialogs.prompt_ok_handler(callback, c_id)}; - break; - case OCdialogs.FORM_DIALOG: - f = function(){OCdialogs.form_ok_handler(callback, c_id)}; - break; - } - b[0] = {text: t('dialogs', 'Ok'), click: f}; - break; - } - var possible_height = ($('tr', d).size()+1)*30; - $(c_id).dialog({width: 4*$(document).width()/9, height: possible_height + 120, modal: modal, buttons: b}); - OCdialogs.dialogs_counter++; - }, - // dialogs buttons types - YES_NO_BUTTONS: 70, - OK_BUTTONS: 71, - OK_CANCEL_BUTTONS: 72, - // dialogs types - ALERT_DIALOG: 80, - INFO_DIALOG: 81, - PROMPT_DIALOG: 82, - FORM_DIALOG: 83, - dialogs_counter: 0, - determineValue: function(element) { - switch ($(element).attr('type')) { - case 'checkbox': return element.checked; - } - return $(element).val(); - }, - prompt_ok_handler: function(callback, c_id) { $(c_id).dialog('close'); if (callback != undefined) callback($(c_id + " input#oc-dialog-prompt-input").val()); }, - form_ok_handler: function(callback, c_id) { - if (callback != undefined) { - var r = []; - var c = 0; - $(c_id + ' input, '+c_id+' select').each(function(i, elem) { - r[c] = {name: $(elem).attr('name'), value: OCdialogs.determineValue(elem)}; - c++; - }); - $(c_id).dialog('close'); - callback(r); - } else { - $(c_id).dialog('close'); - } - }, - fillFilePicker:function(r, dialog_content_id) { - var entry_template = '<div onclick="javascript:OC.dialogs.handlePickerClick(this, \'*ENTRYNAME*\',\''+dialog_content_id+'\')" data="*ENTRYTYPE*"><img src="*MIMETYPEICON*" style="margin-right:1em;"><span id="filename">*NAME*</span><div style="float:right;margin-right:1em;">*LASTMODDATE*</div></div>'; - var names = ''; - for (var a in r.data) { - names += entry_template.replace('*LASTMODDATE*', OC.mtime2date(r.data[a].mtime)).replace('*NAME*', r.data[a].name).replace('*MIMETYPEICON*', r.data[a].mimetype_icon).replace('*ENTRYNAME*', r.data[a].name).replace('*ENTRYTYPE*', r.data[a].type); - } - $(dialog_content_id + ' #filelist').html(names); - $(dialog_content_id + ' .filepicker_loader').css('visibility', 'hidden'); - }, - handleTreeListSelect:function(event) { - var newval = parseInt($(this).val()); - var oldval = parseInt($(this).data('oldval')); - while (newval != oldval && oldval > 0) { - $('option:last', this).remove(); - $('option:last', this).attr('selected','selected'); - oldval--; - } - var skip_first = true; - var path = ''; - $(this).children().each(function(i, element) { if (skip_first) {skip_first = false; return; }path += '/'+$(element).text(); }); - $(event.data.dcid).data('path', path); - $(event.data.dcid + ' .filepicker_loader').css('visibility', 'visible'); - $.getJSON(OC.filePath('files', 'ajax', 'rawlist.php'), {dir: path, mimetype: $(event.data.dcid).data('mimetype')}, function(r){OC.dialogs.fillFilePicker(r, event.data.dcid)}); - }, - // this function is in early development state, please dont use it unlsess you know what you are doing - handlePickerClick:function(element, name, dcid) { - var p = $(dcid).data('path'); - if (p == undefined) p = ''; - p = p+'/'+name; - if ($(element).attr('data') == 'file'){ - if ($(dcid).data('multiselect') != true) - $(dcid+' .filepicker_element_selected').removeClass('filepicker_element_selected'); - $(element).toggleClass('filepicker_element_selected'); - return; - } - $(dcid).data('path', p); - $(dcid + ' #dirtree option:last').removeAttr('selected'); - var newval = parseInt($(dcid + ' #dirtree option:last').val())+1; - $(dcid + ' #dirtree').append('<option selected="selected" value="'+newval+'">'+name+'</option>'); - $(dcid + ' .filepicker_loader').css('visibility', 'visible'); - $.getJSON(OC.filePath('files', 'ajax', 'rawlist.php'), {dir: p, mimetype: $(dcid).data('mimetype')}, function(r){OC.dialogs.fillFilePicker(r, dcid)}); - } + /** + * displays alert dialog + * @param text content of dialog + * @param title dialog title + * @param callback which will be triggered when user press OK + */ + alert:function(text, title, callback, modal) { + var content = '<p><span class="ui-icon ui-icon-alert"></span>'+text+'</p>'; + OCdialogs.message(content, title, OCdialogs.ALERT_DIALOG, OCdialogs.OK_BUTTON, callback, modal); + }, + /** + * displays info dialog + * @param text content of dialog + * @param title dialog title + * @param callback which will be triggered when user press OK + */ + info:function(text, title, callback, modal) { + var content = '<p><span class="ui-icon ui-icon-info"></span>'+text+'</p>'; + OCdialogs.message(content, title, OCdialogs.ALERT_DIALOG, OCdialogs.OK_BUTTON, callback, modal); + }, + /** + * displays confirmation dialog + * @param text content of dialog + * @param title dialog title + * @param callback which will be triggered when user press YES or NO (true or false would be passed to callback respectively) + */ + confirm:function(text, title, callback, modal) { + var content = '<p><span class="ui-icon ui-icon-notice"></span>'+text+'</p>'; + OCdialogs.message(content, title, OCdialogs.ALERT_DIALOG, OCdialogs.YES_NO_BUTTONS, callback, modal); + }, + /** + * prompt for user input + * @param text content of dialog + * @param title dialog title + * @param callback which will be triggered when user press OK (input text will be passed to callback) + */ + prompt:function(text, title, default_value, callback, modal) { + var content = '<p><span class="ui-icon ui-icon-pencil"></span>'+text+':<br/><input type="text" id="oc-dialog-prompt-input" value="'+default_value+'" style="width:90%"></p>'; + OCdialogs.message(content, title, OCdialogs.PROMPT_DIALOG, OCdialogs.OK_CANCEL_BUTTONS, callback, modal); + }, + /** + * prompt user for input with custom form + * fields should be passed in following format: [{text:'prompt text', name:'return name', type:'input type', value: 'dafault value'},...] + * @param fields to display + * @param title dialog title + * @param callback which will be triggered when user press OK (user answers will be passed to callback in following format: [{name:'return name', value: 'user value'},...]) + */ + form:function(fields, title, callback, modal) { + var content = '<table>'; + for (var a in fields) { + content += '<tr><td>'+fields[a].text+'</td><td>'; + var type=fields[a].type; + if (type == 'text' || type == 'checkbox' || type == 'password') { + content += '<input type="'+type+'" name="'+fields[a].name+'"'; + if (type == 'checkbox') { + if (fields[a].value != undefined && fields[a].value == true) { + content += ' checked="checked">'; + } else { + content += '>'; + } + } else if (type == 'text' || type == 'password' && fields[a].value) { + content += ' value="'+fields[a].value+'">'; + } + } else if (type == 'select') { + content += '<select name="'+fields[a].name+'"'; + if (fields[a].value != undefined) { + content += ' value="'+fields[a].value+'"'; + } + content += '>'; + for (var o in fields[a].options) { + content += '<option value="'+fields[a].options[o].value+'">'+fields[a].options[o].text+'</option>'; + } + content += '</select>'; + } + content += '</td></tr>'; + } + content += '</table>'; + OCdialogs.message(content, title, OCdialogs.FORM_DIALOG, OCdialogs.OK_CANCEL_BUTTONS, callback, modal); + }, + filepicker:function(title, callback, multiselect, mimetype_filter, modal) { + var c_name = 'oc-dialog-'+OCdialogs.dialogs_counter+'-content'; + var c_id = '#'+c_name; + var d = '<div id="'+c_name+'" title="'+title+'"><select id="dirtree"><option value="0">'+OC.currentUser+'</option></select><div id="filelist"></div><div class="filepicker_loader"><img src="'+OC.filePath('gallery','img','loading.gif')+'"></div></div>'; + if (!modal) modal = false; // Huh..? + if (!multiselect) multiselect = false; + $('body').append(d); + $(c_id + ' #dirtree').focus(function() { + var t = $(this); + t.data('oldval', t.val()) + }).change({dcid: c_id}, OC.dialogs.handleTreeListSelect); + $(c_id).ready(function(){ + $.getJSON(OC.filePath('files', 'ajax', 'rawlist.php'), {mimetype: mimetype_filter} ,function(r) { + OC.dialogs.fillFilePicker(r, c_id, callback) + }); + }).data('multiselect', multiselect).data('mimetype',mimetype_filter); + // build buttons + var b = [{ + text: t('dialogs', 'Choose'), + click: function(){ + if (callback != undefined) { + var p; + if ($(c_id).data('multiselect') == true) { + p = []; + $(c_id+' .filepicker_element_selected #filename').each(function(i, elem) { + p.push(($(c_id).data('path')?$(c_id).data('path'):'')+'/'+$(elem).text()); + }); + } else { + var p = $(c_id).data('path'); + if (p == undefined) p = ''; + p = p+'/'+$(c_id+' .filepicker_element_selected #filename').text() + } + callback(p); + $(c_id).dialog('close'); + } + } + }, + { + text: t('dialogs', 'Cancel'), + click: function(){$(c_id).dialog('close'); }} + ]; + $(c_id).dialog({width: ((4*$('body').width())/9), height: 400, modal: modal, buttons: b}); + OCdialogs.dialogs_counter++; + }, + // guts, dont use, dont touch + message:function(content, title, dialog_type, buttons, callback, modal) { + var c_name = 'oc-dialog-'+OCdialogs.dialogs_counter+'-content'; + var c_id = '#'+c_name; + var d = '<div id="'+c_name+'" title="'+title+'">'+content+'</div>'; + if (modal == undefined) modal = false; + $('body').append(d); + var b = []; + switch (buttons) { + case OCdialogs.YES_NO_BUTTONS: + b[1] = {text: t('dialogs', 'No'), click: function(){ if (callback != undefined) callback(false); $(c_id).dialog('close'); }}; + b[0] = {text: t('dialogs', 'Yes'), click: function(){ if (callback != undefined) callback(true); $(c_id).dialog('close');}}; + break; + case OCdialogs.OK_CANCEL_BUTTONS: + b[1] = {text: t('dialogs', 'Cancel'), click: function(){$(c_id).dialog('close'); }}; + case OCdialogs.OK_BUTTON: // fallthrough + var f; + switch(dialog_type) { + case OCdialogs.ALERT_DIALOG: + f = function(){$(c_id).dialog('close'); if(callback) callback();}; + break; + case OCdialogs.PROMPT_DIALOG: + f = function(){OCdialogs.prompt_ok_handler(callback, c_id)}; + break; + case OCdialogs.FORM_DIALOG: + f = function(){OCdialogs.form_ok_handler(callback, c_id)}; + break; + } + b[0] = {text: t('dialogs', 'Ok'), click: f}; + break; + } + var possible_height = ($('tr', d).size()+1)*30; + $(c_id).dialog({width: 4*$(document).width()/9, height: possible_height + 120, modal: modal, buttons: b}); + OCdialogs.dialogs_counter++; + }, + // dialogs buttons types + YES_NO_BUTTONS: 70, + OK_BUTTONS: 71, + OK_CANCEL_BUTTONS: 72, + // dialogs types + ALERT_DIALOG: 80, + INFO_DIALOG: 81, + PROMPT_DIALOG: 82, + FORM_DIALOG: 83, + dialogs_counter: 0, + determineValue: function(element) { + switch ($(element).attr('type')) { + case 'checkbox': return element.checked; + } + return $(element).val(); + }, + prompt_ok_handler: function(callback, c_id) { $(c_id).dialog('close'); if (callback != undefined) callback($(c_id + " input#oc-dialog-prompt-input").val()); }, + form_ok_handler: function(callback, c_id) { + if (callback != undefined) { + var r = []; + var c = 0; + $(c_id + ' input, '+c_id+' select').each(function(i, elem) { + r[c] = {name: $(elem).attr('name'), value: OCdialogs.determineValue(elem)}; + c++; + }); + $(c_id).dialog('close'); + callback(r); + } else { + $(c_id).dialog('close'); + } + }, + fillFilePicker:function(r, dialog_content_id) { + var entry_template = '<div onclick="javascript:OC.dialogs.handlePickerClick(this, \'*ENTRYNAME*\',\''+dialog_content_id+'\')" data="*ENTRYTYPE*"><img src="*MIMETYPEICON*" style="margin-right:1em;"><span id="filename">*NAME*</span><div style="float:right;margin-right:1em;">*LASTMODDATE*</div></div>'; + var names = ''; + for (var a in r.data) { + names += entry_template.replace('*LASTMODDATE*', OC.mtime2date(r.data[a].mtime)).replace('*NAME*', r.data[a].name).replace('*MIMETYPEICON*', r.data[a].mimetype_icon).replace('*ENTRYNAME*', r.data[a].name).replace('*ENTRYTYPE*', r.data[a].type); + } + $(dialog_content_id + ' #filelist').html(names); + $(dialog_content_id + ' .filepicker_loader').css('visibility', 'hidden'); + }, + handleTreeListSelect:function(event) { + var newval = parseInt($(this).val()); + var oldval = parseInt($(this).data('oldval')); + while (newval != oldval && oldval > 0) { + $('option:last', this).remove(); + $('option:last', this).attr('selected','selected'); + oldval--; + } + var skip_first = true; + var path = ''; + $(this).children().each(function(i, element) { + if (skip_first) { + skip_first = false; + return; + } + path += '/'+$(element).text(); + }); + $(event.data.dcid).data('path', path); + $(event.data.dcid + ' .filepicker_loader').css('visibility', 'visible'); + $.getJSON(OC.filePath('files', 'ajax', 'rawlist.php'), {dir: path, mimetype: $(event.data.dcid).data('mimetype')}, function(r){OC.dialogs.fillFilePicker(r, event.data.dcid)}); + }, + // this function is in early development state, please dont use it unlsess you know what you are doing + handlePickerClick:function(element, name, dcid) { + var p = $(dcid).data('path'); + if (p == undefined) p = ''; + p = p+'/'+name; + if ($(element).attr('data') == 'file'){ + if ($(dcid).data('multiselect') != true) { + $(dcid+' .filepicker_element_selected').removeClass('filepicker_element_selected'); + } + $(element).toggleClass('filepicker_element_selected'); + return; + } + $(dcid).data('path', p); + $(dcid + ' #dirtree option:last').removeAttr('selected'); + var newval = parseInt($(dcid + ' #dirtree option:last').val())+1; + $(dcid + ' #dirtree').append('<option selected="selected" value="'+newval+'">'+name+'</option>'); + $(dcid + ' .filepicker_loader').css('visibility', 'visible'); + $.getJSON(OC.filePath('files', 'ajax', 'rawlist.php'), {dir: p, mimetype: $(dcid).data('mimetype')}, function(r){OC.dialogs.fillFilePicker(r, dcid)}); + } }; diff --git a/core/js/oc-vcategories.js b/core/js/oc-vcategories.js index 4d8d010a36f..dfed8223b1b 100644 --- a/core/js/oc-vcategories.js +++ b/core/js/oc-vcategories.js @@ -1,6 +1,5 @@ OCCategories={ edit:function(){ - console.log('OCCategories.edit'); if(OCCategories.app == undefined) { OC.dialogs.alert('OCCategories.app is not set!'); return; @@ -18,6 +17,9 @@ OCCategories={ modal: true, height: 350, minHeight:200, width: 250, minWidth: 200, buttons: { + 'Close': function() { + $(this).dialog("close"); + }, 'Delete':function() { OCCategories.doDelete(); }, @@ -61,9 +63,12 @@ OCCategories={ } }, doDelete:function(){ - var categories = $('#categorylist').find('input[type="checkbox"]').serialize(); + var categories = $('#categorylist').find('input:checkbox').serialize(); + if(categories == '' || categories == undefined) { + OC.dialogs.alert(t('core', 'No categories selected for deletion.'), t('core', 'Error')); + return false; + } categories += '&app=' + OCCategories.app; - console.log('OCCategories.delete: ' + categories); $.post(OC.filePath(OCCategories.app, 'ajax', 'categories/delete.php'), categories, OCCategories._processDeleteResult) .error(function(xhr){ if (xhr.status == 404) { @@ -72,7 +77,6 @@ OCCategories={ }); }, add:function(category){ - console.log('OCCategories.add ' + category); $.getJSON(OC.filePath('core', 'ajax', 'vcategories/add.php'),{'category':category, 'app':OCCategories.app},function(jsondata){ if(jsondata.status == 'success'){ OCCategories._update(jsondata.data.categories); @@ -83,7 +87,6 @@ OCCategories={ return false; }, rescan:function(){ - console.log('Categories.rescan'); $.getJSON(OC.filePath(OCCategories.app, 'ajax', 'categories/rescan.php'),function(jsondata, status, xhr){ if(jsondata.status == 'success'){ OCCategories._update(jsondata.data.categories); diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php index 674b1853037..b832ac2636f 100644 --- a/core/templates/layout.user.php +++ b/core/templates/layout.user.php @@ -44,7 +44,7 @@ </ul> <ul id="settings" class="svg"> - <img id="expand" class="svg" alt="<?php echo $l->t('Settings');?>" src="<?php echo image_path('', 'actions/settings.svg'); ?>" /> + <img role=button tabindex=0 id="expand" class="svg" alt="<?php echo $l->t('Settings');?>" src="<?php echo image_path('', 'actions/settings.svg'); ?>" /> <span><?php echo $l->t('Settings');?></span> <div id="expanddiv" <?php if($_['bodyid'] == 'body-user') echo 'style="display:none;"'; ?>> <?php foreach($_['settingsnavigation'] as $entry):?> |