diff --git a/mnsnitch/MnSnitchPlugin.php b/mnsnitch/MnSnitchPlugin.php index cfb6740..f69962b 100644 --- a/mnsnitch/MnSnitchPlugin.php +++ b/mnsnitch/MnSnitchPlugin.php @@ -72,7 +72,7 @@ public function getReleaseFeedUrl() */ public function getVersion() { - return '1.0.1'; + return '1.0.2'; } /** diff --git a/mnsnitch/resources/css/mnsnitch.css b/mnsnitch/resources/css/mnsnitch.css index 8709d8c..c4d4fef 100644 --- a/mnsnitch/resources/css/mnsnitch.css +++ b/mnsnitch/resources/css/mnsnitch.css @@ -6,18 +6,23 @@ body.rtl .mnsnitch { } .mnsnitch>div { display: block; - padding: 0.25em 0.5em; - font-size: 1.5em; + padding: 0.5em 0.75em 0.65em 0.75em; + font-size: 1em; + line-height: 1em; background-color: #bf5035; background-image: linear-gradient(#bf5035, #b34b3b); color: white; } +/* the x for closing */ .mnsnitch span { cursor: pointer; display: inline-block; padding: 0 .5em; + font-size: 2em; } + +/* the link for email */ .mnsnitch a { color: white; text-decoration: underline; diff --git a/mnsnitch/resources/js/mnsnitch.js b/mnsnitch/resources/js/mnsnitch.js index cea840a..df7b549 100644 --- a/mnsnitch/resources/js/mnsnitch.js +++ b/mnsnitch/resources/js/mnsnitch.js @@ -16,7 +16,7 @@ var warn = function(selector, collisions, message) { // otherwise add to old warnings, value = true // and add to container oldWarnings[email] = true; - $(selector).append('
'+msg[0]+''+collisions[i].name+''+msg[1]+' X
'); + $(selector).append('
'+msg[0]+''+collisions[i].name+''+msg[1]+' ×
'); } } // update current warnings diff --git a/mnsnitch/services/MnSnitchService.php b/mnsnitch/services/MnSnitchService.php index ecaed87..bd2bc26 100644 --- a/mnsnitch/services/MnSnitchService.php +++ b/mnsnitch/services/MnSnitchService.php @@ -19,6 +19,7 @@ class MnSnitchService extends BaseApplicationComponent */ public function registerCollision($elementId, $userId = null, $now = null) { + $transaction = craft()->db->getCurrentTransaction() === null ? craft()->db->beginTransaction() : null; $now = $this->_now($now); $userId = $this->_userId($userId); // look for existing record to update @@ -34,7 +35,12 @@ public function registerCollision($elementId, $userId = null, $now = null) $record->elementId = $elementId; } $record->whenEntered = $now; - $result = $record->save(); + $result = $record->save(false); + + if ($transaction !== null) + { + $transaction->commit(); + } } public function getCollisions($elementId, $userId = null, $now = null) @@ -64,7 +70,7 @@ public function removeCollision($elementId, $userId = null) public function expire($now = null) { $now = $this->_now($now); - $timeOut = craft()->config->get('serverPollInterval', 'mnnocollide') * 10; + $timeOut = craft()->config->get('serverPollInterval', 'mnsnitch') * 10; $old = clone $now; $old->sub(new DateInterval('PT'.$timeOut.'S')); $oldDateString = DateTimeHelper::formatTimeForDb($old); diff --git a/releases.json b/releases.json index e88eeb1..0afd488 100644 --- a/releases.json +++ b/releases.json @@ -13,5 +13,13 @@ "notes": [ "[Fixed] Only load snitch js and css for control panel" ] + }, { + "version": "1.0.2", + "downloadUrl": "https://github.com/marionnewlevant/craft-snitch/archive/v1.0.2.zip", + "date": "2016-12-31T20:37:12.921Z", + "notes": [ + "[Fixed] Use db transactions", + "[Fixed] Expire collisions properly" + ] } ]