I wanted a javascript formatter for the widget, and figured others could use it as well. Will upload patch shortly.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

fsanfili’s picture

This patch is only for the D7 branch.

fsanfili’s picture

FileSize
2.09 KB

Use this patch instead -- retrieves the sdk.js from soundcloud via https.

fsanfili’s picture

As I make improvements to this, shall I bother to upload them? attila.fekete, are you likely to use this patch in the module, or am I going to have to patch my own copy with future releases anyway?

Paulmicha’s picture

Version: 7.x-1.3 » 7.x-1.4
FileSize
1.93 KB

Previous patch gave me warnings
→ commented out corresponding lines
+ cleaned up id
+ single (static) sdk init

Attached Patch javascript_formatter-2134491-4.patch against 7.x-1.4.

geraldito’s picture

Thanks for the last patch, #4 works fine for me!

  • akoepke committed 520e512 on 7.x-1.x authored by Paulmicha
    Issue #2134491 by fsanfili, Paulmicha: Asynchronous javascript formatter
    
akoepke’s picture

Thanks for the patch, I did commit it but then also made several fixes to it afterwards.

The JS SDK that was being loaded was broken (was calling the SoundCloud embed API via http), I have updated it to point to a newer version.

The way you included the external JS library and the inline init command was wrong. We should be making use of the #attached element to load Javascript like this. This will be loaded into the head of the site properly.

Instead of building the markup for the player inside the PHP file, I have created a template file and then used the standard render array to generate the markup. This keeps the code clean and also means others can override this in their own theme if needed.

akoepke’s picture

Version: 7.x-1.4 » 2.0.x-dev
Status: Patch (to be ported) » Needs work

This now needs to be ported over to the current 2.0 version of the player.

akoepke’s picture

Assigned: fsanfili » akoepke
akoepke’s picture

Status: Needs work » Fixed

This has been added to the D8/9 module and a new release has been made.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.