From 43f108d095ffe1276b1272ce1b6703010aa9035f Mon Sep 17 00:00:00 2001 From: Daku Date: Sun, 19 Jun 2016 04:26:43 +0100 Subject: [PATCH 01/14] SQLite is currently experimental, move it to allowed failures --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 7c83238f..3f107206 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,6 +12,8 @@ env: - DB=mysql - DB=pgsql - DB=sqlite + allow_failures: + - DB=sqlite cache: directories: From 311dd91a0970190be90876ff6bd2b6803671f20f Mon Sep 17 00:00:00 2001 From: Daku Date: Sun, 19 Jun 2016 04:45:33 +0100 Subject: [PATCH 02/14] disable travis logs since they don't work --- .travis.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3f107206..c13a1f82 100644 --- a/.travis.yml +++ b/.travis.yml @@ -43,13 +43,15 @@ script: after_failure: - head -n 100 data/config/* - ls /var/run/mysql* - - ls /var/log/*mysql* - - cat /var/log/mysql.err - - cat /var/log/mysql.log - - cat /var/log/mysql/error.log - - cat /var/log/mysql/slow.log - - ls /var/log/postgresql - - cat /var/log/postgresql/postgresql* + # All of the below commands require sudo, which we can't use without losing some speed & caching. + # SEE: https://docs.travis-ci.com/user/workers/container-based-infrastructure/ + # - ls /var/log/*mysql* + # - cat /var/log/mysql.err + # - cat /var/log/mysql.log + # - cat /var/log/mysql/error.log + # - cat /var/log/mysql/slow.log + # - ls /var/log/postgresql + # - cat /var/log/postgresql/postgresql* after_script: - wget https://scrutinizer-ci.com/ocular.phar From b70e24acde685998ca1f8be460552e7c3d47fcb3 Mon Sep 17 00:00:00 2001 From: Daku Date: Sun, 19 Jun 2016 04:51:48 +0100 Subject: [PATCH 03/14] github apparently auto-numbers rows and ignores ours --- README.markdown | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/README.markdown b/README.markdown index c9125d9d..01f104e7 100644 --- a/README.markdown +++ b/README.markdown @@ -26,21 +26,21 @@ check out one of the versioned branches. # Installation -0. Download the latest release under [Releases](https://github.com/shish/shimmie2/releases). -1. Create a blank database -2. Unzip shimmie into a folder on the web host -3. Visit the folder with a web browser -4. Enter the location of the database -5. Click "install". Hopefully you'll end up at the welcome screen; if +1. Download the latest release under [Releases](https://github.com/shish/shimmie2/releases). +2. Create a blank database +3. Unzip shimmie into a folder on the web host +4. Visit the folder with a web browser +5. Enter the location of the database +6. Click "install". Hopefully you'll end up at the welcome screen; if not, you should be given instructions on how to fix any errors~ # Installation (Development) -0. Download the shimmie via the "Download Zip" button. -1. Install [Composer](https://getcomposer.org/). (If you don't already have it) -2. Run `composer global require "fxp/composer-asset-plugin:~1.1" --no-plugins`. (This is installed globally due to a known composer bug) -3. Run `composer install` -4. Follow instructions noted in "Installation" (Excluding 0). +1. Download the shimmie via the "Download Zip" button. +2. Install [Composer](https://getcomposer.org/). (If you don't already have it) +3. Run `composer global require "fxp/composer-asset-plugin:~1.1" --no-plugins`. (This is installed globally due to a known composer bug) +4. Run `composer install` +5. Follow instructions noted in "Installation" (Excluding 1.). ## Upgrade from 2.3.X From d4793db6a58a6b2c61451c4f98cb887b3a851aff Mon Sep 17 00:00:00 2001 From: Daku Date: Sun, 19 Jun 2016 04:55:32 +0100 Subject: [PATCH 04/14] improve instructions --- README.markdown | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/README.markdown b/README.markdown index 01f104e7..11b231d4 100644 --- a/README.markdown +++ b/README.markdown @@ -36,11 +36,12 @@ check out one of the versioned branches. # Installation (Development) -1. Download the shimmie via the "Download Zip" button. -2. Install [Composer](https://getcomposer.org/). (If you don't already have it) -3. Run `composer global require "fxp/composer-asset-plugin:~1.1" --no-plugins`. (This is installed globally due to a known composer bug) -4. Run `composer install` -5. Follow instructions noted in "Installation" (Excluding 1.). +1. Download shimmie via the "Download Zip" button on the [develop](https://github.com/shish/shimmie2/tree/develop) branch. +2. Unzip shimmie into a folder on the web host +3. Install [Composer](https://getcomposer.org/). (If you don't already have it) +4. Run `composer global require "fxp/composer-asset-plugin:~1.1" --no-plugins`. (This is installed globally due to a known composer bug) +5. Run `composer install` in the shimmie folder. +6. Follow instructions noted in "Installation" (Excluding 1 & 3). ## Upgrade from 2.3.X From 66226b5ccfa869987dc17ed881a5cd8507158971 Mon Sep 17 00:00:00 2001 From: Daku Date: Sun, 19 Jun 2016 04:56:27 +0100 Subject: [PATCH 05/14] include code quality, code coverage imgs in readme would be nice if this changed depending on the branch.. --- README.markdown | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.markdown b/README.markdown index 11b231d4..3fa7052d 100644 --- a/README.markdown +++ b/README.markdown @@ -11,6 +11,8 @@ # Shimmie [![Build Status](https://travis-ci.org/shish/shimmie2.svg?branch=master)](https://travis-ci.org/shish/shimmie2) +[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/shish/shimmie2/badges/quality-score.png?b=develop)](https://scrutinizer-ci.com/g/shish/shimmie2/?branch=master) +[![Code Coverage](https://scrutinizer-ci.com/g/shish/shimmie2/badges/coverage.png?b=develop)](https://scrutinizer-ci.com/g/shish/shimmie2/?branch=master) This is the main branch of Shimmie, if you know anything at all about running websites, this is the version to use. From b75638cace775c5d293a627e11008657cd2f5fc8 Mon Sep 17 00:00:00 2001 From: Daku Date: Sun, 19 Jun 2016 04:57:14 +0100 Subject: [PATCH 06/14] get_last_insert_id requires param for pgsql support --- ext/artists/main.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/artists/main.php b/ext/artists/main.php index a2380120..5276881f 100644 --- a/ext/artists/main.php +++ b/ext/artists/main.php @@ -837,7 +837,7 @@ class Artists extends Extension { INSERT INTO artists (user_id, name, notes, created, updated) VALUES (?, ?, ?, now(), now()) ", array($user->id, $name, $notes)); - return $database->get_last_insert_id(); + return $database->get_last_insert_id('artists_id_seq'); } /** From 6486a4757fb448b9edc7aceb5dbdf239262aecd7 Mon Sep 17 00:00:00 2001 From: Daku Date: Sun, 19 Jun 2016 05:00:09 +0100 Subject: [PATCH 07/14] js scrutinizer fixes --- ext/tagger/script.js | 2 +- lib/shimmie.js | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/ext/tagger/script.js b/ext/tagger/script.js index ba3fa66e..49ad07c3 100644 --- a/ext/tagger/script.js +++ b/ext/tagger/script.js @@ -69,7 +69,7 @@ var Tagger = { tag : { submit : function () { var l = this.list.childNodes.length; - var tags = Array(); + var tags = []; for(var i=0; i 3) { - query = document.location.hash.substring(1); - a = document.getElementById("prevlink"); - a.href = a.href + '?' + query; - a = document.getElementById("nextlink"); - a.href = a.href + '?' + query; + var query = document.location.hash.substring(1); + + $('#prevlink').attr('href', function(i, attr) { + return attr + '?' + query; + }); + $('#nextlink').attr('href', function(i, attr) { + return attr + '?' + query; + }); } /* From 5ae10473e3134cafd20629b8dd2c01c31f38a794 Mon Sep 17 00:00:00 2001 From: Daku Date: Sun, 19 Jun 2016 05:01:13 +0100 Subject: [PATCH 08/14] closing tag is unneeded --- ext/link_image/theme.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ext/link_image/theme.php b/ext/link_image/theme.php index f92891c6..213311dc 100644 --- a/ext/link_image/theme.php +++ b/ext/link_image/theme.php @@ -85,8 +85,7 @@ class LinkImageTheme extends Themelet { return " - + "; } From c0601640bf71e436752548d4bd861028f7fedced Mon Sep 17 00:00:00 2001 From: Daku Date: Sun, 6 Mar 2016 23:41:46 +0000 Subject: [PATCH 09/14] only show link if extension actually has documentation --- ext/ext_manager/theme.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/ext_manager/theme.php b/ext/ext_manager/theme.php index 7d6bd436..06883e77 100644 --- a/ext/ext_manager/theme.php +++ b/ext/ext_manager/theme.php @@ -25,7 +25,7 @@ class ExtManagerTheme extends Themelet { $html .= " $h_en - $h_name + ".($extension->documentation ? "$h_name" : $h_name)." $h_description "; } From 862a84677fb4057d76365fb02e9c5a908dacea76 Mon Sep 17 00:00:00 2001 From: Daku Date: Mon, 7 Mar 2016 01:37:53 +0000 Subject: [PATCH 10/14] add docs column, showing what extensions have documentation previously it made every ext name into a link to /ext_doc, regardless if it had docs or not --- ext/ext_manager/theme.php | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/ext/ext_manager/theme.php b/ext/ext_manager/theme.php index 06883e77..de939f65 100644 --- a/ext/ext_manager/theme.php +++ b/ext/ext_manager/theme.php @@ -7,26 +7,31 @@ class ExtManagerTheme extends Themelet { ".make_form(make_link("ext_manager/set"))." - $h_en + + $h_en + + + + "; foreach($extensions as $extension) { if(!$editable && $extension->visibility == "admin") continue; - $h_name = html_escape(empty($extension->name) ? $extension->ext_name : $extension->name); + $h_name = html_escape(empty($extension->name) ? $extension->ext_name : $extension->name); $h_description = html_escape($extension->description); - if($extension->enabled === TRUE) $h_enabled = " checked='checked'"; - else if($extension->enabled === FALSE) $h_enabled = ""; - else $h_enabled = " disabled checked='checked'"; - $h_link = make_link("ext_doc/".url_escape($extension->ext_name)); + $h_link = make_link("ext_doc/".url_escape($extension->ext_name)); + $h_enabled = ($extension->enabled === TRUE ? " checked='checked'" : ($extension->enabled === FALSE ? "" : " disabled checked='checked'")); + $h_enabled_box = $editable ? "" : ""; + $h_docs = ($extension->documentation ? "" : ""); //TODO: A proper "docs" symbol would be preferred here. - $h_en = $editable ? "" : ""; $html .= " - - $h_en - - + + {$h_enabled_box} + + + "; } $h_set = $editable ? "" : ""; From ce10831137972eb8de78b690f3a4bd811380a8e9 Mon Sep 17 00:00:00 2001 From: Daku Date: Sun, 19 Jun 2016 05:25:40 +0100 Subject: [PATCH 11/14] this shouldn't be indented under matrix.. --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index c13a1f82..9edb54f0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,8 +12,8 @@ env: - DB=mysql - DB=pgsql - DB=sqlite - allow_failures: - - DB=sqlite + allow_failures: + - DB=sqlite cache: directories: From 03240220d4c6849e0a521d0c0523c41bdc25a28d Mon Sep 17 00:00:00 2001 From: Daku Date: Sun, 19 Jun 2016 09:49:55 +0100 Subject: [PATCH 12/14] make sure to get proper tag value + use selected tag if possible --- ext/autocomplete/script.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ext/autocomplete/script.js b/ext/autocomplete/script.js index 301878ea..dead05e6 100644 --- a/ext/autocomplete/script.js +++ b/ext/autocomplete/script.js @@ -47,10 +47,9 @@ $(function(){ } else if (keyCode == 9) { e.preventDefault(); - var tag = $('.tagit-autocomplete[style*=\"display: block\"] > li:first').text(); - if(tag){ - $('[name=search]').tagit('createTag', tag); - $('.ui-autocomplete-input').autocomplete('close'); + var tag = $('.tagit-autocomplete[style*=\"display: block\"] > li:focus, .tagit-autocomplete[style*=\"display: block\"] > li:first').first(); + if(tag.length){ + $(tag).click(); $('.ui-autocomplete-input').val(''); //If tag already exists, make sure to remove duplicate. } } From f973fcc9fa3ea596bc92b9cc0cf39f281a402f43 Mon Sep 17 00:00:00 2001 From: Daku Date: Sun, 19 Jun 2016 10:07:56 +0100 Subject: [PATCH 13/14] basic autocomplete support for metatags --- ext/autocomplete/script.js | 48 ++++++++++++++++++++++++++++---------- ext/autocomplete/style.css | 3 ++- 2 files changed, 38 insertions(+), 13 deletions(-) diff --git a/ext/autocomplete/script.js b/ext/autocomplete/script.js index dead05e6..8fda1cf9 100644 --- a/ext/autocomplete/script.js +++ b/ext/autocomplete/script.js @@ -1,16 +1,36 @@ $(function(){ + var metatags = ['order:id', 'order:width', 'order:height', 'order:filesize', 'order:filename']; + $('[name=search]').tagit({ singleFieldDelimiter: ' ', beforeTagAdded: function(event, ui) { - // give special class to negative tags - if(ui.tagLabel[0] === '-') { - ui.tag.addClass('tag-negative'); - }else{ - ui.tag.addClass('tag-positive'); + if(metatags.indexOf(ui.tagLabel) !== -1) { + ui.tag.addClass('tag-metatag'); + } else { + console.log(ui.tagLabel); + // give special class to negative tags + if(ui.tagLabel[0] === '-') { + ui.tag.addClass('tag-negative'); + }else{ + ui.tag.addClass('tag-positive'); + } } }, autocomplete : ({ source: function (request, response) { + var ac_metatags = $.map( + $.grep(metatags, function(s) { + // Only show metatags for strings longer than one character + return (request.term.length > 1 && s.indexOf(request.term) === 0); + }), + function(item) { + return { + label : item + ' [metatag]', + value : item + }; + } + ); + var isNegative = (request.term[0] === '-'); $.ajax({ url: base_href + '/api/internal/autocomplete', @@ -18,13 +38,17 @@ $(function(){ dataType : 'json', type : 'GET', success : function (data) { - response($.map(data, function (count, item) { - item = (isNegative ? '-'+item : item); - return { - label : item + ' ('+count+')', - value : item - }; - })); + response( + $.merge(ac_metatags, + $.map(data, function (count, item) { + item = (isNegative ? '-'+item : item); + return { + label : item + ' ('+count+')', + value : item + }; + }) + ) + ); }, error : function (request, status, error) { alert(error); diff --git a/ext/autocomplete/style.css b/ext/autocomplete/style.css index 019bb7fd..7ff0f69b 100644 --- a/ext/autocomplete/style.css +++ b/ext/autocomplete/style.css @@ -5,4 +5,5 @@ input[name=search] ~ input[type=submit] { display: inline-block !important; } .tag-negative { background: #ff8080 !important; } -.tag-positive { background: #40bf40 !important; } \ No newline at end of file +.tag-positive { background: #40bf40 !important; } +.tag-metatag { background: #eaa338 !important; } From a8d9f8ce5b22ed25e0f40e2dfc0e4118b73f4194 Mon Sep 17 00:00:00 2001 From: Daku Date: Sun, 19 Jun 2016 11:56:41 +0100 Subject: [PATCH 14/14] make sure prev/next links aren't clipped outside the box --- ext/pools/theme.php | 1 + 1 file changed, 1 insertion(+) diff --git a/ext/pools/theme.php b/ext/pools/theme.php index 457eb793..5edb3625 100644 --- a/ext/pools/theme.php +++ b/ext/pools/theme.php @@ -21,6 +21,7 @@ class PoolsTheme extends Themelet { $navlinks .= 'Next'; } if(!empty($navlinks)){ + $navlinks .= "
"; $linksPools[] = $navlinks; } }
NameDescription
NameDocsDescription
".($extension->documentation ? "$h_name" : $h_name)."$h_description
{$h_name}{$h_docs}{$h_description}