Merge branch 'develop' of bitbucket.org:jamkazam/jam-cloud into develop

This commit is contained in:
Nuwan 2024-08-29 17:10:01 +05:30
commit 727147ffee
16 changed files with 415 additions and 59 deletions

View File

@ -936,7 +936,7 @@ DEPENDENCIES
zip-codes
RUBY VERSION
ruby 2.4.1p111
ruby 2.3.1p112
BUNDLED WITH
1.17.3

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -9,6 +9,18 @@
var downloadUris = {}; // map of platform > uri
var rest = context.JK.Rest();
// We use this method to detect M1 macs and set appropriate API values to prevent sites from detecting fingerprinting protections
function isAppleSilicon () {
var canvas = document.createElement('canvas');
var gl = canvas.getContext('webgl');
// Best guess if the device is an Apple Silicon
// https://stackoverflow.com/a/65412357
// @ts-expect-error - Object is possibly 'null'
return gl.getSupportedExtensions().indexOf('WEBGL_compressed_texture_etc') !== -1
}
function selectPlatform(selectedPlatform) {
//console.log("selectedPlatform", selectedPlatform);
var platformName; // mac, windows, linux
@ -18,33 +30,34 @@
var uri = downloadUris[selectedPlatform];
// prepare template varaibles
if (selectedPlatform == "Unix") {
platformName = "linux";
platformDisplay = "Linux"
platformName1 = "mac";
platformDisplay1 = "Mac";
if (selectedPlatform == "MacOSX-M") {
platformName = "mac_mx";
platformDisplay = "Mac/M1,M2...MX";
platformName1 = "mac_intel";
platformDisplay1 = "Mac/Intel";
platformName2 = "windows";
platformDisplay2 = "Windows";
platform1 = "MacOSX";
platform1 = "MacOSX-Intel";
platform2 = "Win32"
} else if(selectedPlatform == "Win32") {
platformName = "windows";
platformDisplay = "Windows";
platformName1 = "mac";
platformDisplay1 = "Mac";
platformName2 = "linux"
platformDisplay2 = "Linux";
platform1 = "MacOSX";
platform2 = "Unix";
} else if(selectedPlatform == "MacOSX") {
platformName = "mac";
platformDisplay = "Mac";
platformName1 = "mac_intel";
platformDisplay1 = "Mac/Intel";
platformName2 = "mac_mx"
platformDisplay2 = "Mac/M1,M2...MX";
platform1 = "MacOSX-Intel";
platform2 = "MacOSX-M";
} else if(selectedPlatform == "MacOSX-Intel") {
console.log("IM MACOSXINTEL");
platformName = "mac_intel";
platformDisplay = "Mac/Intel";
platformName1 = "windows";
platformDisplay1 = "Windows";
platformName2 = "linux";
platformDisplay2 = "Linux";
platformName2 = "mac_mx";
platformDisplay2 = "Mac/M1,M2...MX";
platform1 = "Win32";
platform2 = "Unix";
platform2 = "MacOSX-M";
}
else {
alert("unknown platform: " + selectedPlatform);
@ -75,7 +88,6 @@
$('div.hidden-images img[data-purpose=' + platformName1 + ']', selectOthers).remove().appendTo($('a[data-order=1]', selectOthers));
$('div.hidden-images img[data-purpose=' + platformName2 + ']', selectOthers).remove().appendTo($('a[data-order=2]', selectOthers));
// install click handler for change selection
$('a', selectOthers).click(function() {
var platform = $(this).attr('data-platform');
@ -104,6 +116,8 @@
// update blurb
$('body.web .downloads-blurb').empty().append(blurb);
context.JK.popExternalLinks(blurb);
// update the 'download other platforms' buttons
$('body.web .downloads-container').empty().append(selectOthers);
// update system requirements
@ -144,13 +158,25 @@
var currentOS = context.JK.detectOS();
var downloads = $('.downloads');
if(currentOS == "MacOSX") {
var silicon = isAppleSilicon();
if(silicon == true) {
currentOS = "MacOSX-M";
}
else {
currentOS = "MacOSX-Intel";
}
}
console.log("CURRENT OS ", currentOS)
rest.getClientDownloads()
.done(function(data) {
//console.log('getClientDownloads', data);
removeSpinner();
$.each(data, function(key, item) {
var platform = key.substring('JamClient/'.length);
var platform = key.substring('JamClientModern/'.length);
downloadUris[platform] = item.uri;
});

View File

@ -0,0 +1,174 @@
(function(context,$) {
"use strict";
context.JK = context.JK || {};
var downloads = {};
var isCongratulations;
var downloadUris = {}; // map of platform > uri
var rest = context.JK.Rest();
function selectPlatform(selectedPlatform) {
//console.log("selectedPlatform", selectedPlatform);
var platformName; // mac, windows, linux
var platformDisplay; // Mac, Windows, Linux
var platform = selectedPlatform; //MacOSX, Win32, Unix
var platformName1, platformName2, platform1, platform2, platformDisplay1, platformDisplay2;
var uri = downloadUris[selectedPlatform];
// prepare template varaibles
if (selectedPlatform == "Unix") {
platformName = "linux";
platformDisplay = "Linux"
platformName1 = "mac_intel";
platformDisplay1 = "Mac/Intel";
platformName2 = "windows";
platformDisplay2 = "Windows";
platform1 = "MacOSX";
platform2 = "Win32"
} else if(selectedPlatform == "Win32") {
platformName = "windows";
platformDisplay = "Windows";
platformName1 = "mac_intel";
platformDisplay1 = "Mac/Intel";
platformName2 = "linux"
platformDisplay2 = "Linux";
platform1 = "MacOSX";
platform2 = "Unix";
} else if(selectedPlatform == "MacOSX") {
platformName = "mac_intel";
platformDisplay = "Mac/Intel";
platformName1 = "windows";
platformDisplay1 = "Windows";
platformName2 = "linux";
platformDisplay2 = "Linux";
platform1 = "Win32";
platform2 = "Unix";
}
else {
alert("unknown platform: " + selectedPlatform);
}
var options = {
platform : platform,
platformName : platformName,
platformDisplay : platformDisplay,
platformName1 : platformName1,
platformDisplay1 : platformDisplay1,
platformName2 : platformName2,
platformDisplay2 : platformDisplay2,
platform1: platform1,
platform2: platform2,
uri : uri ? uri : '#',
isCongratulations : isCongratulations
};
var blurb = $(context._.template($('#client-download-legacy-blurb-contents').html(), options, { variable: 'data' }));
// isolate active image for blurb
$('div.hidden-images img[data-purpose=' + platformName + ']', blurb).remove().appendTo($('a.current-os-download', blurb));
var selectOthers = $(context._.template($('#client-download-legacy-select-others').html(), options, { variable: 'data' }));
// isolate active images for selectOthers
$('div.hidden-images img[data-purpose=' + platformName1 + ']', selectOthers).remove().appendTo($('a[data-order=1]', selectOthers));
$('div.hidden-images img[data-purpose=' + platformName2 + ']', selectOthers).remove().appendTo($('a[data-order=2]', selectOthers));
// install click handler for change selection
$('a.choose-other-platform', selectOthers).click(function() {
var platform = $(this).attr('data-platform');
selectPlatform(platform);
return false;
});
$('a', blurb).click(function() {
//console.log("download clicked");
var clicked = $(this);
var href = clicked.attr('href');
if(href != "#") {
context.JK.GA.trackDownload(clicked.attr('data-platform'));
rest.userDownloadedClient().always(function() {
$('body').append('<iframe class="downloading" src="' + clicked.attr('href') + '" style="display:none"/>')
});
}
else {
// if there is no download available, apologize to the user
alert("Sorry, this download is not currently available.");
return false;
}
return false;
});
// update blurb
$('body.web .downloads-blurb').empty().append(blurb);
context.JK.popExternalLinks(blurb);
// update the 'download other platforms' buttons
$('body.web .downloads-container').empty().append(selectOthers);
// update system requirements
if($('#client-download-legacy-system-requirements').length){
var systemRequirements = $(context._.template($('#client-download-legacy-system-requirements').html(), options, { variable: 'data' }));
$('body.web .system-requirements').empty().append(systemRequirements);
}
$('body.web .system-requirements ul').hide();
$('body.web .system-requirements ul.' + platformName + '-requirements').show();
$('body.web .system-requirements').show();
}
function removeSpinner() {
$('body.web .spinner-large').remove();
}
function flashCongratulations(friend) {
if(friend) {
context.JK.flash('Congratulations!<br>Soon you can play with ' + friend + '!', {hide:20})
}
else {
context.JK.flash('Congratulations!<br>Your account is ready.', {hide:20})
}
}
function listClients(congratulations, friend) {
isCongratulations = congratulations;
if(isCongratulations) {
flashCongratulations(friend);
}
else {
//flashCongratulations();
}
var rest = context.JK.Rest();
var currentOS = context.JK.detectOS();
var downloads = $('.downloads');
rest.getClientDownloads()
.done(function(data) {
//console.log('getClientDownloads', data);
removeSpinner();
$.each(data, function(key, item) {
var platform = key.substring('JamClient/'.length);
downloadUris[platform] = item.uri;
});
})
.fail(function(jqXHR) {
removeSpinner();
context.JK.app.notify({text: "Currently unable to list client software downloads due to error."});
})
.always(function() {
selectPlatform(currentOS == null ? 'Win32' : currentOS);
});
//console.log('downloadUris', downloadUris);
}
downloads.listClients = listClients;
context.JK.LegacyDownloads = downloads;
})(window, jQuery)

View File

@ -69,6 +69,7 @@
//= require landing/signup
//= require recordingModel
//= require web/downloads
//= require web/downloads_legacy
//= require web/congratulations
//= require web/sessions
//= require web/session_info

View File

@ -13,8 +13,18 @@ body.downloads {
.badge-number {
display:none;
}
.download-container.legacy {
.downloads-blurb {
margin-top:20px;
}
.download-others {
p {
margin:0;
}
}
}
.download-app {
left:22.5%;
left:20%;
float:none;
position:relative;
}
@ -33,7 +43,6 @@ body.downloads {
color:#CCC;
font-size:14px;
line-height:125%;
text-indent:-5px;
margin-left:40px;
&:before
@ -52,7 +61,7 @@ body.downloads {
.download-app {
padding-top:20px;
width:55%;
width:60%;
float:left;
@include border_box_sizing;
}
@ -97,9 +106,9 @@ body.downloads {
}
.download-entreaty {
margin-bottom:25px;
p.click-to-download {
margin-bottom:5px;
}
}
@ -120,7 +129,7 @@ body.downloads {
}
ul li {
font-size:12px;
font-size:14px;
margin-left:15px;
}
@ -134,7 +143,12 @@ body.downloads {
.download-box {
color:#fff;
text-align:center;
text-align:left;
line-height:135%;
}
.download-legacy-backup {
margin-top:20px;
}
.go-jamtrack-shopping {

View File

@ -232,6 +232,14 @@ class UsersController < ApplicationController
render rend[:template], :layout => rend[:layout]
end
def downloads_legacy
@no_user_dropdown = true
@page_context = 'standalone'
render :layout => 'web'
# rend = _render('downloads_legacy')
#render rend[:template], :layout => rend[:layout]
end
def downloads2021
render :downloads2021, layout: 'jk2021'
end

View File

@ -0,0 +1,52 @@
script type="text/template" id="client-download-legacy-blurb-contents"
.downloads
a href="{{data.uri}}" class="current-os-download" data-platform="{{data.platform}}"
.downloads-container
h5 SYSTEM REQUIREMENTS:
| {% if(data.platform == "Win32") { %}
ul.windows-requirements
li Windows 10 or 11 - 64-bit (32-bit not supported)
li 75MB hard disk space for app
li
span External audio interface for audio processing (
a rel="external" href="https://jamkazam.freshdesk.com/support/solutions/articles/66000122514-audio-interfaces-for-windows-computers" see recommendations if you don't have one
span )
li USB 2.0, USB 3.0, or USB-C (not USB 1.1) for audio interface
li Ethernet port and Ethernet cable to connect directly to home router (WiFi not recommended)
li Broadband Internet service with 1Mbps upload bandwidth (3-5Mbps preferred)
| {% } else if(data.platform == "MacOSX") { %}
ul.mac_intel-requirements
li macOS 10.8 (Mountain Lion) or higher, 64-bit
li 75MB hard disk space for app
li
span External audio interface for audio processing (
a rel="external" href="https://jamkazam.freshdesk.com/support/solutions/articles/66000122513-audio-interfaces-for-mac-computers" see recommendations if you don't have one
span )
li USB 2.0, USB 3.0, or USB-C (not USB 1.1) for audio interface
li Ethernet port and Ethernet cable to connect directly to home router (WiFi not recommended)
li Broadband Internet service with 1Mbps upload bandwidth (3-5Mbps preferred)
| {% } else { %}
ul.linux-requirements
li Linux is not yet supported
| {% } %}
.hidden.hidden-images
= image_tag("content/button_download_mac_intel.png", :alt => "download mac intel", :size => "348x92", "data-purpose" => "mac_intel")
= image_tag("content/button_download_windows.png", :alt => "download windows", :size => "348x92", "data-purpose" => "windows")
= image_tag("content/button_download_linux.png", :alt => "download linux", :size => "348x92", "data-purpose" => "linux")
script type="text/template" id="client-download-legacy-select-others"
.download-box
.download-others
span Need a different version?
br
a.choose-other-platform href="#" data-order="1" data-platform="{{data.platform1}}"
| JamKazam for {{data.platformDisplay1}} (legacy version)
br
a href="/downloads"
| Return to download page for current app version

View File

@ -8,40 +8,57 @@ script type="text/template" id="client-download-blurb-contents"
h5 SYSTEM REQUIREMENTS:
| {% if(data.platform == "Win32") { %}
ul.windows-requirements
li Windows 7, 8, or 10 - 64-bit (32-bit not supported)
li Windows 10 or 11 - 64-bit (32-bit not supported)
li Dual core processor or higher
li 75MB hard disk space for app
li External audio interface recommended (but you can start with built-in mic and & headphone jack)
li USB 2.0, USB 3.0, Thunderbolt, or Firewire (not USB 1.1) for external audio interfaces
li Ethernet port for real-time online sessions (WiFi not recommended)
li Broadband Internet service with 1Mbps uplink bandwidth for real-time online sessions
| {% } else if(data.platform == "MacOSX") { %}
li
span External audio interface for audio processing (
a rel="external" href="https://jamkazam.freshdesk.com/support/solutions/articles/66000122514-audio-interfaces-for-windows-computers" see recommendations if you don't have one
span )
li USB 2.0, USB 3.0, or USB-C (not USB 1.1) for audio interface
li Ethernet port and Ethernet cable to connect directly to home router (WiFi not recommended)
li Broadband Internet service with 1Mbps upload bandwidth (3-5Mbps preferred)
| {% } else if(data.platform == "MacOSX_Intel") { %}
ul.mac-requirements
li Mac OS X 10.8 or higher, 64-bit
li Dual-core processor or higher
li macOS 10.15 (Catalina) or higher, 64-bit
li 75MB hard disk space for app
li External audio interface recommended (but you can start with built-in mic and & headphone jack)
li USB 2.0, USB 3.0, Thunderbolt, or Firewire (not USB 1.1) for external audio interfaces
li Ethernet port for real-time online sessions (WiFi not recommended)
li Broadband Internet service with 1Mbps uplink bandwidth for real-time online sessions
li
span External audio interface for audio processing (
a rel="external" href="https://jamkazam.freshdesk.com/support/solutions/articles/66000122513-audio-interfaces-for-mac-computers" see recommendations if you don't have one
span )
li USB 2.0, USB 3.0, or USB-C (not USB 1.1) for audio interface
li Ethernet port and Ethernet cable to connect directly to home router (WiFi not recommended)
li Broadband Internet service with 1Mbps upload bandwidth (3-5Mbps preferred)
| {% } else { %}
ul.linux-requirements
li Linux is not yet supported
ul.mac-requirements
li macOS 10.15 (Catalina) or higher, 64-bit
li 75MB hard disk space for app
li
span External audio interface for audio processing (
a rel="external" href="https://jamkazam.freshdesk.com/support/solutions/articles/66000122513-audio-interfaces-for-mac-computers" see recommendations if you don't have one
span )
li USB 2.0, USB 3.0, or USB-C (not USB 1.1) for audio interface
li Ethernet port and Ethernet cable to connect directly to home router (WiFi not recommended)
li Broadband Internet service with 1Mbps upload bandwidth (3-5Mbps preferred)
| {% } %}
p.download-legacy-backup
| If you have trouble with the new JamKazam app and cannot get things worked out with the help of our support team, you can&nbsp;
a href="/downloads-legacy" go here
| &nbsp;to download and re-install the legacy JamKazam app for now.
.hidden.hidden-images
= image_tag("content/button_download_mac.png", :alt => "download mac", :size => "348x92", "data-purpose" => "mac")
= image_tag("content/button_download_mac_intel.png", :alt => "download mac (intel)", :size => "348x92", "data-purpose" => "mac_intel")
= image_tag("content/button_download_windows.png", :alt => "download windows", :size => "348x92", "data-purpose" => "windows")
= image_tag("content/button_download_linux.png", :alt => "download linux", :size => "348x92", "data-purpose" => "linux")
= image_tag("content/button_download_mac_mx.png", :alt => "download mac (mx)", :size => "348x92", "data-purpose" => "mac_mx")
script type="text/template" id="client-download-select-others"
.download-box
.download-others
span Need a different version?
br
a.choose-other-platform href="#" data-order="1" data-platform="{{data.platform1}}"
| Need a different version?
br
| Click here for to get JamKazam
br
| for {{data.platformDisplay1}} ' ''
| JamKazam for {{data.platformDisplay1}}
br
a.choose-other-platform href="#" data-order="2" data-platform="{{data.platform2}}"
| JamKazam for {{data.platformDisplay2}}

View File

@ -12,15 +12,8 @@
.download-content
.download-entreaty
p You need the JamKazam application to:
ul
li Play music with others in real time on the JamKazam platform
li Make audio recordings and share them via Facebook or URL
li Make video recordings and share them via YouTube or URL
li Live broadcast your sessions to family, friends, and fans
li Play and control your JamTracks multi-track recordings
p You must use the JamKazam app to get into online sessions with other musicians. Click the button below to download the JamKazam app installer. Then double click the installer to run it.
p.click-to-download Click the button below to download the JamKazam application installer.
.downloads-blurb
.jamtracks

View File

@ -0,0 +1,62 @@
// used by congrats_musician, and downloads
- provide(:page_name, "downloads #{@page_context}")
.w100.download-container.legacy
.download-app
.spinner-large
h2.create-account-header
.badge-number 3
| Download the older legacy JamKazam app
.download-content
.download-entreaty
p
| If you cannot run macOS 10.15 or later, or if you&nbsp;
| are having problems with the current JamKazam app (either Windows or Mac)&nbsp;
| and our support team cannot help you get the current app running well,&nbsp;
| then you can (for now) fall back to running the older legacy version of the JamKazam&nbsp;
| app. Click the button below to download the older app installer, and then double click the&nbsp;
| installer to install the app.
.downloads-blurb
.jamtracks
h2.shop-jamtracks
.badge-number 4
| Get your free JamTrack
span.special-value
| &nbsp; ($2.99 value)
.jamtrack-content
.jamtrack-entreaty
p JamTracks are multi-track pro recordings you can use to:
ul
li Solo any part to hear and learn it
li Mute the part you want to play, and play along with the rest
li Make audio recordings and share them via Facebook or URL
li Make video recordings and share them via YouTube or URL
li Go online to play real time sessions, with others playing parts
p
| Watch the video below to learn more. Then click the button to shop
| &nbsp;for your first JamTrack - free! Add it to your shopping cart, and we'll
| &nbsp;make it free during the checkout process. Free offer good for 1 week only!
.video-container
- if !Rails.env.test?
iframe src="//www.youtube.com/embed/askHvcCoNfw" frameborder="0" allowfullscreen="allowfullscreen"
a.go-jamtrack-shopping href="/client#/jamtrack/search" rel="external"
| Shop for free
br
| JamTrack now!
br clear="all"
= render "users/download_legacy_templates"

View File

@ -0,0 +1,8 @@
<% provide(:title, 'Legacy Downloads') %>
<% provide(:description, 'Download the legacy JamKazam app for Windows or Mac to play music online with others.') %>
<%= render "users/downloads_legacy" %>
<script type="text/javascript">
$(function() { window.JK.LegacyDownloads.listClients(false) } );
</script>

View File

@ -25,6 +25,7 @@ Rails.application.routes.draw do
get '/congratulations_musician', to: 'users#congratulations_musician', as: :congratulations_musician
get '/congratulations_fan', to: 'users#congratulations_fan'
get '/downloads', to: 'users#downloads'
get '/downloads-legacy', to: 'users#downloads_legacy'
get '/signin', to: 'sessions#signin'
post '/signin', to: 'sessions#create'

View File

@ -111,4 +111,4 @@ Titles are optional, naturally.
Markdown uses email style notation for blockquotes and I've been told:
> Asterisks for *emphasis*. Double it up for **strong**.
`<?php code(); // goes in backticks ?>`
`<?php code(); // goes in backticks ?>`