2

Website - Wordpress

Plugin used - https://github.com/tomharrigan/transporter

Plugin Js file - https://github.com/tomharrigan/transporter/blob/master/transporter.js

Line No 121 of the JS file

/**
 * Renders the results from a successful response.
 */
Scroller.prototype.render = function( response ) {
    this.body.addClass( 'infinity-success' );

    // Check if we can wrap the html
    this.element.append( response.html );

    this.body.trigger( 'post-load', response );
    this.ready = true;
}

Basically i want to modify some of the my html before the data is appended

The only problem is i cannot modify the plugin Js file as it may get a update and all the changes will get lost

Is it possible to extend the plugin in another JS file?

/**
 * Renders the results from a successful response.
 */
Scroller.prototype.render = function( response ) {
    this.body.addClass( 'infinity-success' );

    // changed html
    this.element.find('.infinite-wrap .loading-message').html('Next post is loaded');

    // Check if we can wrap the html
    this.element.append( response.html );

    this.body.trigger( 'post-load', response );
    this.ready = true;
}
Vitorino fernandes
  • 15,794
  • 3
  • 20
  • 39
  • I'm not well versed in object oriented javascript (yet :D), but can this help: [How to set the prototype of a JavaScript object that has already been instantiated?](http://stackoverflow.com/questions/7015693/how-to-set-the-prototype-of-a-javascript-object-that-has-already-been-instantiat) – dingo_d Jan 13 '16 at 11:02
  • What do you mean you "cannot modify the js as it may get an update and all the changes will get lost?" cant you download the file and make the changes in that file? – prieston Jan 13 '16 at 11:56
  • In wordpress there are [plugins](https://codex.wordpress.org/Plugins) eample of [plugins](https://wordpress.org/plugins/) check the **Last Updated: xx days ago** for each plugin and on each update something new is implemented in that plugin by the plugin developer check the [changelog](https://wordpress.org/plugins/bbpress/changelog/) and during this update process all the files are updated @mrapsogos – Vitorino fernandes Jan 13 '16 at 12:12
  • yes but you can download a certain version and make the changes you need based on that version. What is the problem with this? – prieston Jan 13 '16 at 19:51
  • It should not be that way @mrapsogos – Vitorino fernandes Jan 14 '16 at 07:21

0 Answers0