From 01c54d4d83fa417d4296822adf93c03e0443ea6f Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Sat, 30 Nov 2013 14:22:49 +0100 Subject: [PATCH] Optimalization: simplified selectors Squash --- public_html/media/js/core.js | 6 +++--- src/Controllers/PostController.php | 2 +- src/Views/auth-login.phtml | 2 +- src/Views/comment-small.phtml | 2 +- src/Views/post-edit.phtml | 2 +- src/Views/post-upload.phtml | 4 ++-- src/Views/post-view.phtml | 4 ++-- src/Views/sidebar-options.phtml | 18 ++++++++++++++---- src/Views/tag-mass-tag.phtml | 2 +- src/Views/tag-merge.phtml | 2 +- src/Views/tag-rename.phtml | 2 +- src/Views/user-delete.phtml | 4 ++-- src/Views/user-edit.phtml | 2 +- src/Views/user-registration.phtml | 2 +- src/Views/user-select.phtml | 2 +- src/Views/user-settings.phtml | 2 +- 16 files changed, 34 insertions(+), 24 deletions(-) diff --git a/public_html/media/js/core.js b/public_html/media/js/core.js index 2d7123c5..e1487223 100644 --- a/public_html/media/js/core.js +++ b/public_html/media/js/core.js @@ -83,8 +83,8 @@ $(function() } } - $('form[data-confirm-text]').submit(confirmEvent); - $('a[data-confirm-text]').click(confirmEvent); + $('form.confirmable').submit(confirmEvent); + $('a.confirmable').click(confirmEvent); //simple action buttons @@ -123,7 +123,7 @@ $(function() //attach data from submit buttons to forms before .submit() gets called - $(':submit').each(function() + $('.submit').each(function() { $(this).click(function() { diff --git a/src/Controllers/PostController.php b/src/Controllers/PostController.php index 3c5e72cd..920181a2 100644 --- a/src/Controllers/PostController.php +++ b/src/Controllers/PostController.php @@ -511,7 +511,7 @@ class PostController throw new SimpleException('Thumbnail file is not readable'); $this->context->layoutName = 'layout-file'; - $this->context->transport->cacheDaysToLive = 30; + $this->context->transport->cacheDaysToLive = 365; $this->context->transport->mimeType = 'image/jpeg'; $this->context->transport->fileHash = 'thumb' . md5($name . filemtime($path)); $this->context->transport->filePath = $path; diff --git a/src/Views/auth-login.phtml b/src/Views/auth-login.phtml index c48fc6c7..becf533b 100644 --- a/src/Views/auth-login.phtml +++ b/src/Views/auth-login.phtml @@ -16,7 +16,7 @@
- +  
@@ -55,7 +55,7 @@
- +
diff --git a/src/Views/post-view.phtml b/src/Views/post-view.phtml index 1681e1ca..98d09886 100644 --- a/src/Views/post-view.phtml +++ b/src/Views/post-view.phtml @@ -341,8 +341,8 @@
-   - +   +
diff --git a/src/Views/sidebar-options.phtml b/src/Views/sidebar-options.phtml index c3b251c7..5e7fda7b 100644 --- a/src/Views/sidebar-options.phtml +++ b/src/Views/sidebar-options.phtml @@ -6,6 +6,8 @@ context->options as $option): ?>
  • $val) - if (strpos($key, 'data-') === 0) - $attrs[$key] = $val; + if (!empty($class)) + $attrs['class'] = join(' ', $class); TextHelper::openHtmlTag('a', $attrs); echo $option['text']; diff --git a/src/Views/tag-mass-tag.phtml b/src/Views/tag-mass-tag.phtml index 13955a49..182c5777 100644 --- a/src/Views/tag-mass-tag.phtml +++ b/src/Views/tag-mass-tag.phtml @@ -15,7 +15,7 @@
    - +
    diff --git a/src/Views/tag-merge.phtml b/src/Views/tag-merge.phtml index 31c4bde5..9418b753 100644 --- a/src/Views/tag-merge.phtml +++ b/src/Views/tag-merge.phtml @@ -15,7 +15,7 @@
    - +
    diff --git a/src/Views/tag-rename.phtml b/src/Views/tag-rename.phtml index 7ce2ae20..50a34857 100644 --- a/src/Views/tag-rename.phtml +++ b/src/Views/tag-rename.phtml @@ -15,7 +15,7 @@
    - +
    diff --git a/src/Views/user-delete.phtml b/src/Views/user-delete.phtml index 728057c5..7b1d1344 100644 --- a/src/Views/user-delete.phtml +++ b/src/Views/user-delete.phtml @@ -1,4 +1,4 @@ -
    + context->user->id == $this->context->transport->user->id): ?>
    @@ -12,6 +12,6 @@
    - +
    diff --git a/src/Views/user-edit.phtml b/src/Views/user-edit.phtml index d7471174..18ae2e32 100644 --- a/src/Views/user-edit.phtml +++ b/src/Views/user-edit.phtml @@ -56,6 +56,6 @@
    - +
    diff --git a/src/Views/user-registration.phtml b/src/Views/user-registration.phtml index 8425001f..87108cc6 100644 --- a/src/Views/user-registration.phtml +++ b/src/Views/user-registration.phtml @@ -38,7 +38,7 @@
    - +
    diff --git a/src/Views/user-select.phtml b/src/Views/user-select.phtml index 6d8f3d2e..1e226df0 100644 --- a/src/Views/user-select.phtml +++ b/src/Views/user-select.phtml @@ -15,7 +15,7 @@
    - +
    diff --git a/src/Views/user-settings.phtml b/src/Views/user-settings.phtml index 0fc12509..81be92d3 100644 --- a/src/Views/user-settings.phtml +++ b/src/Views/user-settings.phtml @@ -37,7 +37,7 @@
    - +