/** * Invision Community * (c) Invision Power Services, Inc. - https://www.invisioncommunity.com * * ips.downloads.browse.js - Handles general browsing controller needs * * Author: Brandon Farber */ ;( function($, _, undefined){ "use strict"; ips.controller.register('downloads.front.downloads.browse', { initialize: function () { this.on( 'click', '[data-action="markCategoryRead"]', this.markCategoryRead ); }, /** * Marks all files in a category as read, triggering an event on the table * * @param {event} e Event object * @returns {void} */ markCategoryRead: function (e) { e.preventDefault(); var self = this; ips.ui.alert.show( { type: 'confirm', icon: 'question', message: ips.getString('markCategoryAsReadConfirm'), subText: '', callbacks: { ok: function () { var url = $( e.currentTarget ).attr('href'); ips.getAjax()( url, { showLoading: true, bypassRedirect: true }) .done( function () { // Trigger event on the table to hide unread markets self.triggerOn( 'core.global.core.table', 'markTableRead' ); // Hide the link we've just clicked ips.utils.anim.go( 'fadeOut', $( e.currentTarget ) ); ips.ui.flashMsg.show( ips.getString('categoryMarkedRead') ); }) .fail( function (jqXHR, textStatus, errorThrown) { window.location = url; }); } } }); } }); }(jQuery, _)); /** * Invision Community * (c) Invision Power Services, Inc. - https://www.invisioncommunity.com * * ips.pending.buttons.js - Pending Version * * Author: Stuart Silvester */ ;( function($, _, undefined){ "use strict"; ips.controller.register('downloads.front.pending.buttons', { initialize: function () { this.on( 'click', 'a', this.processButton ); }, processButton: function(e) { if( $(e.currentTarget).hasClass('ipsButton--disabled') ) { e.preventDefault(); } $(e.currentTarget).addClass('ipsButton--disabled'); } }); }(jQuery, _)); /** * Invision Community * (c) Invision Power Services, Inc. - https://www.invisioncommunity.com * * ips.settings.settings.js * * Author: Stuart Silvester */ ;( function($, _, undefined){ "use strict"; ips.controller.register('downloads.admin.settings.settings', { alertOpen: false, initialize: function () { this.on( 'uploadComplete', '[data-ipsUploader]', this.promptRebuildPreference ); this.on( 'fileDeleted', this.promptRebuildPreference ); }, promptRebuildPreference: function (e) { if( this.alertOpen ) { return; } this.alertOpen = true; /* Show Rebuild Prompt */ ips.ui.alert.show({ type: 'confirm', message: ips.getString('downloadsScreenshotsWatermark'), subText: ips.getString('downloadsScreenshotsWatermarkBlurb'), icon: 'question', buttons: { ok: ips.getString('downloadsScreenshotsWatermarkYes'), cancel: ips.getString('downloadsScreenshotsWatermarkNo') }, callbacks: { ok: function(){ $('input[name=rebuildWatermarkScreenshots]').val( 1 ); this.alertOpen = false; }, cancel: function(){ $('input[name=rebuildWatermarkScreenshots]').val( 0 ); this.alertOpen = false; } } }); } }); }(jQuery, _)); /** * Invision Community * (c) Invision Power Services, Inc. - https://www.invisioncommunity.com * * ips.submit.linkedScreenshots.js - Controller to handle linked screenshots * * Author: Mark Wade */ ;( function($, _, undefined){ "use strict"; ips.controller.register('downloads.front.submit.linkedScreenshots', { initialize: function () { this.on( 'click', '[data-action="addField"]', this.addFieldButton ); this.on( 'click', '[data-action="removeField"]', this.removeField ); this.setup(); }, /** * Setup method * * @returns {void} */ setup: function () { var initialValues = $.parseJSON( $(this.scope).attr('data-initialValue') ); if( initialValues == null ) { return; } var i; for ( i in initialValues.values ) { this.addField( i, initialValues.values[i], i == initialValues.default ); } }, /** * Add a field * * @returns {void} */ addField: function ( id, value, isDefault ) { $(this.scope).find('[data-role="fieldsArea"]').append( ips.templates.render( 'downloads.submit.linkedScreenshot', { 'name': $(this.scope).attr('data-name'), 'id': id, 'value': value, 'extra': isDefault ? 'checked' : '' }) ); }, /** * Remove a field * * @returns {void} */ removeField: function ( e ) { e.preventDefault(); $(e.currentTarget).closest('li').remove(); }, /** * Respond to add button * * @returns {void} */ addFieldButton: function () { this.addField( 'linked_' + new Date().getTime(), '', false ); } }); }(jQuery, _)); a').attr('href'); // Update page URL ips.utils.history.pushState( { controller: 'changelog', version: data.selectedItemID }, 'downloads.front.view.changeLog', url ); this._loadVersion( url, data.menuElem.find('[data-ipsMenuValue="' + data.selectedItemID + '"]').attr('data-changelogTitle') ); }, /** * Event handler for History.js * When the state changes, we locate that menu item based on the version, and then pull * the version string and URL and load it * * @returns {void} */ stateChange: function () { const state = ips.utils.history.getState('downloads.front.view.changeLog') // Other things on the page can change the URL, so make sure this is a changelog url if (!state || !Object.keys(state).length) { return; } let item; if (state.version) { item = $('#elChangelog_menu').find('[data-ipsMenuValue="' + state.version + '"]'); } else { item = $('#elChangelog_menu').find('[data-ipsMenuValue]').first(); } this._loadVersion( item.find('a').attr('href'), item.attr('data-ipsMenuValue') ); }, /** * Loads version information * * @param {string} url URL of the version to load * @param {string} versionTitle Title of version being loaded * @returns {void} */ _loadVersion: function (url, versionTitle) { var self = this; // Update version this.scope.find('[data-role="versionTitle"]').text( versionTitle ); // Set height on info area and set to loading this.scope .find('[data-role="changeLogData"]') .css( { height: this.scope.find('[data-role="changeLogData"]').height() + 'px' }) .addClass('ipsLoading') .html(''); // Load the new data ips.getAjax()( url ) .done( function (response) { self.scope .find('[data-role="changeLogData"]') .html( response ) .removeClass('ipsLoading') .css({ height: 'auto' }); }) .fail( function (jqXHR, textStatus, errorThrown) { window.location = url; }); } }); }(jQuery, _));]]> /** * Invision Community * (c) Invision Power Services, Inc. - https://www.invisioncommunity.com * * ips.view.download.js - Download popup controller * * Author: Rikki Tissier */ ;( function($, _, undefined){ "use strict"; ips.controller.register('downloads.front.view.download', { initialize: function () { this.on( 'click', '[data-action="dialogClose"]', this.closeDialog ); this.on( 'click', '[data-action="selectFile"]', this.selectFile ); this.on( 'click', '[data-action="download"]', this.doDownload ); }, /** * Agree to the terms and update the display to show the list * * @param {event} e Event object * @returns {void} */ selectFile: function (e) { var url = $( e.currentTarget ).attr('href'); var self = this; e.preventDefault(); // Load the download page this.scope .html('') .css({ height: '250px' }) .addClass('ipsLoading'); ips.getAjax()( url ) .done( function (response) { self.scope .html( response ) .css({ height: 'auto' }) .removeClass('ipsLoading'); }) .fail( function (jqXHR, textStatus, errorThrown) { window.location = url; }); }, /** * Event handler for the 'cancel' link * * @param {event} e Event object * @returns {void} */ closeDialog: function (e) { e.preventDefault(); this._closeDialog( $( e.currentTarget ).attr('href') ); }, /** * Closes the dialog * * @param {string} href Href to redirect to if not in a dialog * @returns {void} */ _closeDialog: function (href) { if( this.scope.closest('.ipsDialog').length ){ this.scope.closest('.ipsDialog').trigger('closeDialog'); } else { window.location = href; } }, /** * Initiate the actual download * * @param {event} e Event object * @returns {void} */ doDownload: function (e) { var that = this; if ( $( e.currentTarget ).attr('data-wait') ) { e.preventDefault(); ips.getAjax()( $( e.currentTarget ).attr('href') ) .done( function (response) { // The download succeeded so we should get the cached session event $(e.currentTarget).trigger('ipsDataLayerSync'); var secondsRemaining = response.download - response.currentTime; $( e.currentTarget ) .hide() .siblings() .find('[data-role="downloadCounter"]') .html( secondsRemaining ) .end() .end() .siblings('[data-role="downloadCounterContainer"]') .removeClass('ipsHide'); var interval = setInterval( function () { secondsRemaining--; $( e.currentTarget ).siblings().find('[data-role="downloadCounter"]').html( secondsRemaining ); if ( secondsRemaining === 0 ) { clearInterval(interval); window.location = $( e.currentTarget ).attr('href'); that.scope.closest('.ipsDialog').trigger('closeDialog'); } }, 1000 ); }) .fail( function () { window.location = $(e.currentTarget).attr('href'); }) } else { this.scope.closest('.ipsDialog').trigger('closeDialog'); } } }); }(jQuery, _)); /** * Invision Community * (c) Invision Power Services, Inc. - https://www.invisioncommunity.com * * ips.view.subscribe.js - Controller to handle subscribing to new version updates * * Author: Andrew Millne */ ;( function($, _, undefined){ "use strict"; ips.controller.register('downloads.front.view.subscribe', { ajaxObj: null, /** * Initialize controller events * * @returns {void} */ initialize: function () { this.on( 'click', '[data-action="subscribe"]', this.toggle ); }, /** * Subscribe * * @param {event} e Event object * @returns {void} */ toggle: function (e) { e.preventDefault(); var self = this; var clicked = $( e.currentTarget ); clicked.addClass('i-opacity_3'); ips.getAjax()( clicked.attr('href') ) .done( function (response) { if( !response.error ) { if( response == 'unsubscribed' ) { clicked.removeClass( 'ipsButton--primary' ); clicked.addClass( 'ipsButton--text' ); clicked.text( ips.getString('file_subscribe') ); } else { clicked.addClass( 'ipsButton--primary' ); clicked.removeClass( 'ipsButton--text' ); clicked.text( ips.getString('file_unsubscribe') ); } } }) .always( function () { clicked.removeClass('i-opacity_3'); }); } }); }(jQuery, _)); \
\ \
\
\

{{title}}

\

\ {{size}} {{#statusText}}· {{statusText}}{{/statusText}}\

\ {{#status}}{{/status}}\
\ \ \ \ \ \ {{#supportsDelete}}\
\ \ \ ×\ \
\ {{/supportsDelete}}\ {{^supportsDelete}}\
\ \ ×\
\ {{/supportsDelete}}\ \ \ "); ips.templates.set('downloads.submit.screenshotWrapper', " \
{{{content}}}
\ "); ips.templates.set('downloads.submit.linkedScreenshot', " \
  • \ \
    \ \
    \
    \ \
    \
  • \ ");]]>
    templates common/ips.loader.js common/ui common/utils common controllers underscore jquery mustache Debug.js app.js jquery.js jquery-migrate.js jquery.transform.js linkify.min.js linkify-jquery.min.js