Skip to content

Commit

Permalink
[3851] - Feat/implement link mechanism to create rooms (#3963)
Browse files Browse the repository at this point in the history
* 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)

* Implement link mechanism

---------

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 2, 2024
1 parent e176f62 commit e78df5d
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 7 deletions.
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);
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

0 comments on commit e78df5d

Please sign in to comment.