Commit c674c107 authored by Malcolm Blaney's avatar Malcolm Blaney

Added some new icons to svg themes, including better rotate icons

for browser module and tag icon for Post and Reader modules. Reader
is now better at working out how many files to check in PurgeCache.
Added missing option for invoice-remove-orders-time to Groupwizard.
parent 5ed65f20
Pipeline #38452744 passed with stage
in 1 minute and 19 seconds
......@@ -1098,6 +1098,13 @@ class Groupwizard extends Base {
'calendar date</label>' .
'<input type="checkbox" id="groupwizard-invoice-remove-orders-date">'.
'</div>' .
'<div class="form-spacing">' .
'<label for="groupwizard-invoice-remove-orders-time">' .
'The time to remove orders:</label>' .
'<select id="groupwizard-invoice-remove-orders-time">' .
$this->Options('invoice-remove-orders-time', $hours) .
'</select>' .
'</div>' .
'<div class="form-spacing">' .
'<label for="groupwizard-purchase-check-quota">Only remove orders ' .
'for products where quota wasn\'t met:</label>' .
......
......@@ -137,7 +137,8 @@ class Post extends Base {
$this->LookupName($post['category']));
}
if ($category !== '') {
$category = '<span class="post-tag-label">tags: </span>' . $category;
$category = '<span class="post-tag-label ui-icon ui-icon-tag" ' .
'title="tags"></span> ' . $category;
}
$permalink = $post['permalink'];
$feed = $post['feed'];
......
......@@ -1364,7 +1364,8 @@ class Reader extends Base {
}
}
if ($category !== '') {
$category = '<span class="reader-tag-label">tags: </span>' . $category;
$category = '<span class="reader-tag-label ui-icon ui-icon-tag" ' .
'title="tags"></span> ' . $category;
}
$date = date('j F g:ia', $item['timestamp']);
......@@ -1634,10 +1635,14 @@ class Reader extends Base {
private function PurgeCache($count, $cache_dir) {
$total = 0;
// Set the number of files to check based on $count.
$head = '100';
if ($count > 500) $head = '5000';
else if ($count > 100) $head = '1000';
// Convert $count to bytes to match strlen result.
$count *= 1000000;
$handle = popen('/bin/ls -1ur ' . $cache_dir .
' | /bin/grep spi | /usr/bin/head -n 1000', 'r');
' | /bin/grep spi | /usr/bin/head -n ' . $head, 'r');
while ($file = fgets($handle)) {
// Matching image files in the cache using grep (*.spi can't be used as an
// argument to ls because it creates too many arguments). Also if the loop
......
......@@ -26,7 +26,7 @@
if(!this.dobrado.browser){dobrado.browser={};}
(function(){'use strict';var callback=false;$(function(){if($('.browser').length===0){return;}
$('.browser').dialog({show:true,width:720,height:500,position:{my:'top',at:'top+50',of:window},title:'Browser',create:dobrado.fixedDialog,close:function(){$('.browser').remove();}});$('#browser-upload-input').val('').change(upload);$('#browser-upload').button({disabled:true}).click(upload);$('#browser-upload-progress').progressbar();$('.thumbnail').show().click(highlight);$('.thumbnail .select').button({icon:'ui-icon-plus',showLabel:false}).click(select);$('.thumbnail .rotate-left').button({icon:'ui-icon-arrowreturnthick-1-w',showLabel:false}).click(rotateLeft);$('.thumbnail .rotate-right').button({icon:'ui-icon-arrowreturnthick-1-e',showLabel:false}).click(rotateRight);$('.thumbnail .remove').button({icon:'ui-icon-trash',showLabel:false}).click(remove);var filenames=[];$('.browser .filename').each(function(){filenames.push($(this).text());});$('#browser-search').autocomplete({minLength:1,search:dobrado.fixAutoCompleteMemoryLeak,source:filenames,response:filter,close:filterReset});});function remove(){var that=this;$.post('/php/request.php',{request:'browser',action:'remove',file:$(this).siblings('.filename').html(),url:location.href,token:dobrado.token},function(response){if(dobrado.checkResponseError(response,'browser remove')){return;}
$('.browser').dialog({show:true,width:720,height:500,position:{my:'top',at:'top+50',of:window},title:'Browser',create:dobrado.fixedDialog,close:function(){$('.browser').remove();}});$('#browser-upload-input').val('').change(upload);$('#browser-upload').button({disabled:true}).click(upload);$('#browser-upload-progress').progressbar();$('.thumbnail').show().click(highlight);$('.thumbnail .select').button({icon:'ui-icon-plus',showLabel:false}).click(select);$('.thumbnail .rotate-left').button({icon:'ui-icon-arrowrefresh-1-w',showLabel:false}).click(rotateLeft);$('.thumbnail .rotate-right').button({icon:'ui-icon-arrowrefresh-1-e',showLabel:false}).click(rotateRight);$('.thumbnail .remove').button({icon:'ui-icon-trash',showLabel:false}).click(remove);var filenames=[];$('.browser .filename').each(function(){filenames.push($(this).text());});$('#browser-search').autocomplete({minLength:1,search:dobrado.fixAutoCompleteMemoryLeak,source:filenames,response:filter,close:filterReset});});function remove(){var that=this;$.post('/php/request.php',{request:'browser',action:'remove',file:$(this).siblings('.filename').html(),url:location.href,token:dobrado.token},function(response){if(dobrado.checkResponseError(response,'browser remove')){return;}
$(that).parent().remove();});}
function rotateLeft(){var that=this;$.post('/php/request.php',{request:'browser',action:'rotate',direction:'left',file:$(this).siblings('.filename').html(),url:location.href,token:dobrado.token},function(response){if(dobrado.checkResponseError(response,'browser rotateLeft')){return;}
var image=JSON.parse(response);$(that).siblings('img').attr('src',image.src);$(that).siblings('.filename').html(image.filename);});}
......@@ -42,5 +42,5 @@ function upload(){var formData=new FormData();if(!formData){dobrado.log('Your br
if($('#browser-upload-input').val()===''){$('#browser-upload').button({disabled:true});return;}
$('#browser-upload').button({disabled:false});let fileList=$('#browser-upload-input').get(0).files;for(let i=0;i<fileList.length;i++){formData.append('file[]',fileList[i]);}
formData.append('request','browser');formData.append('action','upload');formData.append('url',location.href);formData.append('token',dobrado.token);$.ajax({url:'/php/request.php',data:formData,contentType:false,processData:false,type:'POST',xhr:function(){var xhr=new XMLHttpRequest();xhr.upload.addEventListener('progress',function(e){if(e.lengthComputable){var percent=e.loaded/e.total*100;if(percent<100){$('#browser-upload-progress').show();$('#browser-upload-progress').progressbar('value',percent);}}});return xhr;},success:function(response){if(dobrado.checkResponseError(response,'browser upload')){return;}
var browser=JSON.parse(response);$('#browser-search').parent().after(browser.content);$('.thumbnail').click(highlight);$('.thumbnail .select').button({icon:'ui-icon-plus',showLabel:false}).click(select);$('.thumbnail .rotate-left').button({icon:'ui-icon-arrowreturnthick-1-w',showLabel:false}).click(rotateLeft);$('.thumbnail .rotate-right').button({icon:'ui-icon-arrowreturnthick-1-e',showLabel:false}).click(rotateRight);$('.thumbnail .remove').button({icon:'ui-icon-trash',showLabel:false}).click(remove);$('#browser-upload-input').val('');$('#browser-upload').button({disabled:true});$('#browser-upload-progress').hide();}});return false;}
var browser=JSON.parse(response);$('#browser-search').parent().after(browser.content);$('.thumbnail').click(highlight);$('.thumbnail .select').button({icon:'ui-icon-plus',showLabel:false}).click(select);$('.thumbnail .rotate-left').button({icon:'ui-icon-arrowrefresh-1-w',showLabel:false}).click(rotateLeft);$('.thumbnail .rotate-right').button({icon:'ui-icon-arrowrefresh-1-e',showLabel:false}).click(rotateRight);$('.thumbnail .remove').button({icon:'ui-icon-trash',showLabel:false}).click(remove);$('#browser-upload-input').val('');$('#browser-upload').button({disabled:true});$('#browser-upload-progress').hide();}});return false;}
dobrado.browser.newModuleCallback=function(selector,context){callback=context;if(/^[0-9]+$/.test(callback)){setTimeout(function(){$(selector).parents('.ui-dialog').css('z-index',11000);},100);}};}());
\ No newline at end of file
......@@ -57,10 +57,10 @@ if (!this.dobrado.browser) {
$('.thumbnail .select').button({
icon: 'ui-icon-plus', showLabel: false }).click(select);
$('.thumbnail .rotate-left').button({
icon: 'ui-icon-arrowreturnthick-1-w',
icon: 'ui-icon-arrowrefresh-1-w',
showLabel: false }).click(rotateLeft);
$('.thumbnail .rotate-right').button({
icon: 'ui-icon-arrowreturnthick-1-e',
icon: 'ui-icon-arrowrefresh-1-e',
showLabel: false }).click(rotateRight);
$('.thumbnail .remove').button({
icon: 'ui-icon-trash', showLabel: false }).click(remove);
......@@ -217,11 +217,11 @@ if (!this.dobrado.browser) {
showLabel: false
}).click(select);
$('.thumbnail .rotate-left').button({
icon: 'ui-icon-arrowreturnthick-1-w',
icon: 'ui-icon-arrowrefresh-1-w',
showLabel: false
}).click(rotateLeft);
$('.thumbnail .rotate-right').button({
icon: 'ui-icon-arrowreturnthick-1-e',
icon: 'ui-icon-arrowrefresh-1-e',
showLabel: false
}).click(rotateRight);
$('.thumbnail .remove').button({
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment