Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3851] - Feat/implement link mechanism to create rooms #3963

Merged
merged 41 commits into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
72097b8
fixes #3913
walterbender Jun 23, 2024
200dddb
fix:resolves grid position on hamburger opening(#3914) (#3924)
BeNikk Jun 28, 2024
71fe874
Merge branch 'master' into collaboration
apsinghdev Jul 1, 2024
423b467
Fix input boxes (#3927)
apsinghdev Jul 2, 2024
0d082eb
bump version
walterbender Jul 2, 2024
eb7c23a
enhancement: scale on hover (#3926)
Anas-2357 Jul 2, 2024
6354fa8
calculate frequencies from ratio
walterbender Jul 2, 2024
474f811
Merge branch 'master' of github.com:sugarlabs/musicblocks
walterbender Jul 2, 2024
ad292d9
Merge branch 'master' into collaboration
apsinghdev Jul 3, 2024
5848e62
Add close button to extended-menu pie menu (fixes #3933) (#3934)
BeNikk Jul 3, 2024
10ab05e
Bump braces and gulp (#3903)
dependabot[bot] Jul 3, 2024
5e27904
add support for solfege accidentals in phrasemaker
walterbender Jul 4, 2024
3c57c4b
Merge branch 'master' of github.com:sugarlabs/musicblocks
walterbender Jul 4, 2024
530f330
Merge branch 'collaboration' of https://github.com/sugarlabs/musicblo…
apsinghdev Jul 4, 2024
f73597e
Merge branch 'master' into collaboration
apsinghdev Jul 4, 2024
5022721
Merge branch 'collaboration' of https://github.com/sugarlabs/musicblo…
apsinghdev Jul 7, 2024
55570e8
Add support for cents (#3937)
walterbender Jul 7, 2024
f88955e
Ratio transpose and Ratio interval (#3936)
walterbender Jul 7, 2024
97e811a
fix note convert
walterbender Jul 7, 2024
cba02d3
remove extra comma throwing off indexing
walterbender Jul 7, 2024
306888e
Merge branch 'master' into collaboration
apsinghdev Jul 9, 2024
2d99514
Merge branch 'collaboration' of https://github.com/sugarlabs/musicblo…
apsinghdev Jul 10, 2024
944bc2e
Hyperscore link update (#3939) (#3947)
therealharshit Jul 12, 2024
aaf0f6e
Update Hyperscore example link in guide.html (#3944)
GeetenParab Jul 12, 2024
c41d9f5
Update README.md (#3943)
akilesh1706 Jul 12, 2024
69f8ee8
left_and_back_images (#3950)
khadar1020 Jul 15, 2024
472ec5c
Updated Dockerfile (#3949)
akilesh1706 Jul 15, 2024
cc0b986
Merge branch 'master' into collaboration
apsinghdev Jul 16, 2024
08787e1
remove yjs and socket.io dependecies
apsinghdev Jul 16, 2024
8776750
Fixed #3956 Auto increasing and decreasing input block (#3957)
therealharshit Jul 25, 2024
6436c2f
fixes #3941
walterbender Jul 26, 2024
3b63768
Merge branch 'master' of github.com:sugarlabs/musicblocks
walterbender Jul 26, 2024
c415d53
fixes #3958
walterbender Jul 26, 2024
cc4bcef
Merge branch 'master' into collaboration
apsinghdev Jul 27, 2024
3acc0b5
Merge branch 'collaboration' of https://github.com/sugarlabs/musicblo…
apsinghdev Jul 27, 2024
07f9707
Fixes collapsed state of note block (#3961)
therealharshit Jul 28, 2024
fd39015
Merge branch 'master' into collaboration
apsinghdev Jul 28, 2024
de9bd23
Merge branch 'collaboration' of https://github.com/sugarlabs/musicblo…
apsinghdev Jul 29, 2024
72dcdea
fixes issue with extra line number in JavaScript Editor (#3962)
haroon10725 Jul 30, 2024
fdbd3ff
Merge branch 'master' into collaboration
apsinghdev Aug 1, 2024
3cab8d8
Implement link mechanism
apsinghdev Aug 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions js/activity.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,9 @@ class Activity {
// Flag to check if the helpful search widget is active or not (for "click" event handler purpose)
this.isHelpfulSearchWidgetOn = false;

// ID for a specific room
this.room_id = null;

this.beginnerMode = true;
try {
if (this.storage.beginnerMode === undefined) {
Expand Down Expand Up @@ -552,8 +555,8 @@ class Activity {
}

// Initialize the collaboration
this._initiateCollaboration = () => {
this.collaboration.startCollaboration();
this._initiateCollaboration = (ID) => {
this.collaboration.startCollaboration(ID);
this.blocks.isLocalUpdate = true;
};

Expand Down Expand Up @@ -5924,6 +5927,16 @@ class Activity {

this._create2Ddrag();

setTimeout(() => {
console.log("dom is ready");
const urlParams = new URLSearchParams(window.location.search);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remind me what this does?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this code checks if the url contains any key with roomID. if yes, it extracts its value and, initiate the collaboration and create the room with same roomID.

const room_id = urlParams.get('roomID');

if (room_id) {
this.room_id = room_id;
this._initiateCollaboration(this.room_id);
};
}, 7000);
/*
document.addEventListener("mousewheel", scrollEvent, false);
document.addEventListener("DOMMouseScroll", scrollEvent, false);
Expand Down
3 changes: 2 additions & 1 deletion js/blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -3092,8 +3092,9 @@ class Blocks {
if (emitMsg == EMIT_NEW_BLOCK_ADDED) {
this.hasEmittedBlockAddition = true;
}
const room_id = this.activity.room_id;
const update = this.activity.collaboration.convertBlockListToHtml();
this.activity.collaboration.socket.emit(emitMsg, update);
this.activity.collaboration.socket.emit(emitMsg, {room_id, update});
};

/**
Expand Down
7 changes: 4 additions & 3 deletions js/collaboration/collaboration.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,15 @@ class Collaboration {
};

// Make calls to the socket server
makeConnection = () => {
makeConnection = (ID) => {
// connect to the local server
const socket = io(this.PORT);
socket.on("connect", () => {
this.socket = socket;
try {
console.log("connected to the server");
this.hasCollaborationStarted = true;
socket.emit("joinRoom", ID);
} catch (error) {
console.log("Connection failed", error);
}
Expand Down Expand Up @@ -85,8 +86,8 @@ class Collaboration {
};

// Start the collaboration
startCollaboration = () => {
this.makeConnection();
startCollaboration = (ID) => {
this.makeConnection(ID);
};
}

2 changes: 1 addition & 1 deletion js/widgets/jseditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ class JSEditor {
_setLinesCount(code) {
if (!docById("editorLines")) return;

const linesCount = code.replace(/\n+$/, "\n").split("\n").length + 1;
const linesCount = code.replace(/\n+$/, "\n").split("\n").length;
let text = "";
for (let i = 1; i < linesCount; i++) {
text += `${i}\n`;
Expand Down