Skip to content

Commit

Permalink
[3851] - Feat/Implement the mechanism to create and show the collabor…
Browse files Browse the repository at this point in the history
…ation link (#3966)

* fixes #3913

* fix:resolves grid position on hamburger opening(#3914) (#3924)

* fix:resolves hamburger opening(#3914)

* fix:fixes #3914(suggested changes done)

* adjust size of grid element repositioning when using aux toolbar

---------

Co-authored-by: Walter Bender <[email protected]>

* Fix input boxes (#3927)

* bump version

* enhancement: scale on hover (#3926)

Co-authored-by: anas2357 <[email protected]>

* calculate frequencies from ratio

* Add close button to extended-menu pie menu (fixes #3933) (#3934)

* Bump braces and gulp (#3903)

Bumps [braces](https://github.com/micromatch/braces) to 3.0.3 and updates ancestor dependency [gulp](https://github.com/gulpjs/gulp). These dependencies need to be updated together.


Updates `braces` from 2.3.2 to 3.0.3
- [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/braces/commits/3.0.3)

Updates `gulp` from 4.0.2 to 5.0.0
- [Release notes](https://github.com/gulpjs/gulp/releases)
- [Changelog](https://github.com/gulpjs/gulp/blob/master/CHANGELOG.md)
- [Commits](gulpjs/gulp@v4.0.2...v5.0.0)

---
updated-dependencies:
- dependency-name: braces
  dependency-type: indirect
- dependency-name: gulp
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* add support for solfege accidentals in phrasemaker

* Add support for cents (#3937)

* add support for cents through semi-tone transposition

* add 50 cents macro

* add cents example

* add output frequencies

* fix issue with ratio cents

* add a ratio-cents example

* Ratio transpose and Ratio interval (#3936)

* use processPitch for all pitch types

* Add support for cents (#3937)

* add support for cents through semi-tone transposition

* add 50 cents macro

* add cents example

* add output frequencies

* fix issue with ratio cents

* add a ratio-cents example

* use processPitch for all pitch types

* convert freq to note before scalar step

* fix note convert

* remove extra comma throwing off indexing

* Hyperscore link update (#3939) (#3947)

* Update Hyperscore example link in guide.html (#3944)

* Update README.md (#3943)

* left_and_back_images (#3950)

* Updated Dockerfile  (#3949)

* Update README.md

* Update dockerfile

* remove yjs and socket.io dependecies

* Fixed #3956 Auto increasing and decreasing input block (#3957)

* fixes #3941

* fixes #3958

* Fixes collapsed state of note block (#3961)

* fixes issue with extra line number in JavaScript Editor (#3962)

* fixes sample block duplication issue (#3965)

* fixes sample block duplication issue

* changed error message

* updated error message

* Show the link

* Create the link

* Redirect the user to the collaboration project

* minor fixes

* minor fix

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Walter Bender <[email protected]>
Co-authored-by: Nikhil <[email protected]>
Co-authored-by: Anas <[email protected]>
Co-authored-by: anas2357 <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Walter Bender <[email protected]>
Co-authored-by: Harshit Verma <[email protected]>
Co-authored-by: Geeten Parab <[email protected]>
Co-authored-by: akilesh1706 <[email protected]>
Co-authored-by: Khadar vali <[email protected]>
Co-authored-by: Muhammad Haroon <[email protected]>
  • Loading branch information
12 people authored Aug 6, 2024
1 parent e78df5d commit 4b3759c
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 8 deletions.
2 changes: 2 additions & 0 deletions js/activity.js
Original file line number Diff line number Diff line change
Expand Up @@ -5931,9 +5931,11 @@ class Activity {
console.log("dom is ready");
const urlParams = new URLSearchParams(window.location.search);
const room_id = urlParams.get('roomID');
const collabUrl = window.location.href;

if (room_id) {
this.room_id = room_id;
this.textMsg(`_("Collaboration link: ") ${collabUrl}`);
this._initiateCollaboration(this.room_id);
};
}, 7000);
Expand Down
10 changes: 9 additions & 1 deletion js/piemenus.js
Original file line number Diff line number Diff line change
Expand Up @@ -3439,7 +3439,15 @@ const piemenuBlockContext = (block) => {
});
};

wheel.navItems[0].navigateFunction = stackPasting;
wheel.navItems[0].navigateFunction = () => {
if (
"customsample" === block.blocks.blockList[topBlock].name
) {
that.activity.errorMsg(_("In order to copy a sample, you must reload the widget, import the sample again, and export it."));
} else {
stackPasting();
}
};

wheel.navItems[1].navigateFunction = () => {
that.blocks.activeBlock = blockBlock;
Expand Down
36 changes: 30 additions & 6 deletions planet/js/CollaborationSpace.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-unused-vars */
// Copyright (c) 2024 Ajeet Pratap Singh
//
// This program is free software; you can redistribute it and/or
Expand Down Expand Up @@ -81,14 +82,13 @@ class CollaborationSpace {

// Prepare the room by adding/hiding elements

prepareRoom(){
prepareRoom() {
this.renderNavbar();
this.renderCommonSpace();
}

// Exit the collaboration space
exitSpace(){

exitSpace() {
const exitButton = document.getElementById("exitCollabRoom");
exitButton.remove();

Expand Down Expand Up @@ -119,15 +119,39 @@ class CollaborationSpace {

const localPage = document.getElementById("local");
localPage.style.visibility = "visible";
}

// Create the invite link for the collaboration
createLink(id) {
const roomID = this.createRoomID();
const link = `https://musicblocks.sugarlabs.org/index.html?id=${id}&run=False&roomID=${roomID}`;
return link;
}


// Create an unique room ID
createRoomID() {
const n = Date.now();
const stampStr = n.toString();
const prefix = stampStr.slice(0, 10);

let suffix = "";
for (let i = 0; i < 6; i++) {
suffix += Math.floor(Math.random() * 10).toString();
}
return prefix + suffix;
}

// Render the room
renderRoom(){
renderRoom() {
this.prepareRoom();
}

initiate() {
initiateCollabSpace() {
this.renderRoom();
}

startCollaboration(ID) {
const collabLink = this.createLink(ID);
window.open(collabLink, "_blank");
}
}
3 changes: 2 additions & 1 deletion planet/js/GlobalCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ class GlobalCard {
// set collaboration starter
// eslint-disable-next-line no-unused-vars
frag.getElementById(`global-project-collaborate-${this.id}`).addEventListener("click", (evt) => {
Planet.GlobalPlanet.CollaborationSpace.initiate();
// Planet.GlobalPlanet.CollaborationSpace.initiateCollabSpace();
Planet.GlobalPlanet.CollaborationSpace.startCollaboration(this.id);
});

// set merge modify listener
Expand Down

0 comments on commit 4b3759c

Please sign in to comment.