Skip to content

Commit

Permalink
PRJ-55 - Added dependency bp-nouveau for readylaunch-front js
Browse files Browse the repository at this point in the history
- Created var to fetch localize var
- Fixed - thumb issue while edit forum
  • Loading branch information
jitendrabanjara1991 committed Feb 4, 2025
1 parent b77e5d3 commit 38f5c35
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/bp-core/classes/class-bb-readylaunch.php
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ public function add_template_stack( $stack ) {
public function bb_enqueue_scripts() {
$min = bp_core_get_minified_asset_suffix();

wp_enqueue_script( 'bb-readylaunch-front', buddypress()->plugin_url . "bp-templates/bp-nouveau/readylaunch/js/bb-readylaunch-front{$min}.js", array( 'jquery' ), bp_get_version(), false );
wp_enqueue_script( 'bb-readylaunch-front', buddypress()->plugin_url . "bp-templates/bp-nouveau/readylaunch/js/bb-readylaunch-front{$min}.js", array( 'jquery', 'bp-nouveau' ), bp_get_version(), false );

wp_enqueue_style( 'bb-readylaunch-style-main', buddypress()->plugin_url . "bp-templates/bp-nouveau/readylaunch/css/main{$min}.css", array(), bp_get_version() );

Expand Down
15 changes: 11 additions & 4 deletions src/bp-templates/bp-nouveau/readylaunch/js/bb-readylaunch-front.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ window.bp = window.bp || {};
(
function ( exports, $ ) {

var bpNouveauLocal = BP_Nouveau,
bbRlIsAs3cfActive = bpNouveauLocal.bbRlIsAs3cfActive,
bbRlMedia = bpNouveauLocal.media,
bbRlAjaxUrl = bpNouveauLocal.ajaxurl,
bbRlNonce = bpNouveauLocal.nonces;

/**
* [ReadLaunch description]
*
Expand Down Expand Up @@ -414,7 +420,7 @@ window.bp = window.bp || {};
createDropzoneOptions : function ( options ) {
return _.extend(
{
url : BP_Nouveau.ajaxurl,
url : bbRlAjaxUrl,
timeout : 3 * 60 * 60 * 1000,
autoProcessQueue : true,
addRemoveLinks : true,
Expand Down Expand Up @@ -486,7 +492,7 @@ window.bp = window.bp || {};
'sending',
function ( file, xhr, formData ) {
formData.append( 'action', actionName );
formData.append( '_wpnonce', BP_Nouveau.nonces[ nonceName ] );
formData.append( '_wpnonce', bbRlNonce[ nonceName ] );

var toolBox = view.$el.parents( parentSelector );
otherButtonSelectors.forEach(
Expand Down Expand Up @@ -547,12 +553,12 @@ window.bp = window.bp || {};
'error',
function ( file, response ) {
if ( file.accepted ) {
var errorMessage = response && response.data && response.data.feedback || BP_Nouveau.media.connection_lost_error;
var errorMessage = response && response.data && response.data.feedback || bbRlMedia.connection_lost_error;
$( file.previewElement ).find( '.dz-error-message span' ).text( errorMessage );
} else {
Backbone.trigger(
'onError',
'<div>' + BP_Nouveau.media.invalid_media_type + '. ' + (
'<div>' + bbRlMedia.invalid_media_type + '. ' + (
response || ''
) + '<div>'
);
Expand Down Expand Up @@ -715,6 +721,7 @@ window.bp = window.bp || {};
mockFile.svg_icon = ! _.isUndefined( file.svg_icon ) ? file.svg_icon : '';
} else if ( 'video' === fileType ) {
mockFile.video_edit_data = editData;
mockFile.dataThumb = ! _.isUndefined( file.thumb ) ? file.thumb : '';
}

if ( dropzoneObj ) {
Expand Down

0 comments on commit 38f5c35

Please sign in to comment.