Skip to content

Commit

Permalink
Add changelog file, copy assets for new updates.getk2.org subdomain h…
Browse files Browse the repository at this point in the history
…osted on GitHub
  • Loading branch information
fevangelou committed Jun 9, 2024
1 parent f6005d9 commit c9a72f3
Show file tree
Hide file tree
Showing 6 changed files with 149 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
![K2](https://getk2.org/downloads/logo/k2_logo.png)
***

# Changelog

### v2.11.20240609 - June 9th, 2024
- Improved database performance for the K2 Content module. When selecting specific items, a single query will now be executed instead of distinct queries, as was done previously.
4 changes: 4 additions & 0 deletions docs/collection.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?>
<extensionset name="K2" description="K2 Extensions List">
<extension name="K2" element="com_k2" type="component" version="1.6" detailsurl="https://getk2.org/app/update.xml"/>
</extensionset>
Binary file added docs/images/k2_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/k2_logo.webp
Binary file not shown.
97 changes: 97 additions & 0 deletions docs/update.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
/* === K2 Update Service === */

/* TO DO:
- Add cookie to hide notification
- Update styling to match the Joomla backend
*/

(function() {

/* === Helpers === */

/**
* Simply compares two string version values.
*
* Example:
* versionCompare('1.1', '1.2') => -1
* versionCompare('1.1', '1.1') => 0
* versionCompare('1.2', '1.1') => 1
* versionCompare('2.23.3', '2.22.3') => 1
*
* Returns:
* -1 = left is LOWER than right
* 0 = they are equal
* 1 = left is GREATER = right is LOWER
* And FALSE if one of input versions are not valid
*
* @function
* @param {String} left Version #1
* @param {String} right Version #2
* @return {Integer|Boolean}
* @author Alexey Bass (albass)
* @since 2011-07-14
*/

var versionCompare = function(left, right) {
if (typeof left + typeof right != 'stringstring') return false;
var a = left.split('.'),
b = right.split('.'),
i = 0,
len = Math.max(a.length, b.length);
for (; i < len; i++) {
if ((a[i] && !b[i] && parseInt(a[i]) > 0) || (parseInt(a[i]) > parseInt(b[i]))) {
return 1;
} else if ((b[i] && !a[i] && parseInt(b[i]) > 0) || (parseInt(a[i]) < parseInt(b[i]))) {
return -1;
}
}
return 0;
};

var kookie = {
create: function(name, value, days) {
var expires = "";
if (days) {
var date = new Date();
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
expires = "; expires=" + date.toGMTString();
}
document.cookie = name + "=" + value + expires + "; path=/";
},
read: function(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for (var i = 0; i < ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') c = c.substring(1, c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
}
return null;
},
erase: function(name) {
this.create(name, "", -1);
}
};

/* === K2 App === */
var K2_LATEST_VERSION = '2.11.20240609';
var K2_RELEASE_NOTES = 'https://github.com/getk2/k2/commits/master';

if (kookie.read('K2_hideUpdateMessage')) return;

if (versionCompare(K2_LATEST_VERSION, K2_INSTALLED_VERSION) > 0) {
var b = document.getElementsByTagName('body')[0];
var notice = '<div id="k2UpdateService_Msg" style="font-size:11px;text-align:center;padding:4px 8px;background:#00b243;color:#fff;opacity:0.9;position:fixed;left:0;bottom:60px;border-right:4px solid #026b25;z-index:9999999;width:180px;">A new version of K2 (v' + K2_LATEST_VERSION + ') is now available to download.<br />Check out the <a style="color:#fff;font-weight:bold;" target="_blank" href="' + K2_RELEASE_NOTES + '">release notes</a>.<br /><br /><a id="k2UpdateService_HideMsg" href="#" style="color:#eee;font-weight:normal;font-size:10px;">[Dismiss this message for 1 week]</a></div>';
var mountNotice = document.createElement('div');
mountNotice.innerHTML = notice;
b.appendChild(mountNotice);

var hideMsgLink = document.getElementById('k2UpdateService_HideMsg');
hideMsgLink.onclick = function() {
kookie.create('K2_hideUpdateMessage', 'true', 7);
document.getElementById('k2UpdateService_Msg').setAttribute('style', 'display:none;');
return false;
};
}

})();
41 changes: 41 additions & 0 deletions docs/update.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<updates>
<update>
<name>K2</name>
<description>K2, the powerful content extension for Joomla (by JoomlaWorks)</description>
<element>com_k2</element>
<type>component</type>
<version>2.11.20240609</version>
<infourl title="K2 - Release Notes">https://github.com/getk2/k2/commits/master</infourl>
<downloads>
<downloadurl type="full" format="zip">https://getk2.org/downloads/?f=K2_Rolling_Release.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<maintainer>JoomlaWorks Ltd.</maintainer>
<maintainerurl>https://getk2.org/</maintainerurl>
<section>Updates</section>
<targetplatform name="joomla" version="3.[0123456789]" />
<client_id>1</client_id>
</update>
<update>
<name>K2</name>
<description>K2, the powerful content extension for Joomla (by JoomlaWorks)</description>
<element>com_k2</element>
<type>component</type>
<version>2.11.20240609</version>
<infourl title="K2 - Release Notes">https://github.com/getk2/k2/commits/master</infourl>
<downloads>
<downloadurl type="full" format="zip">http://getk2.org/downloads/?f=K2_Rolling_Release.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<maintainer>JoomlaWorks Ltd.</maintainer>
<maintainerurl>https://getk2.org/</maintainerurl>
<section>Updates</section>
<targetplatform name="joomla" version="2.5" />
<client_id>1</client_id>
</update>
</updates>

0 comments on commit c9a72f3

Please sign in to comment.