Version 4.1.19

This commit is contained in:
Neo committed 2025-12-19 05:38:56 -08:00
1 parent 28bd025b35
commit 2bd5025018
2674 files changed
+233518 -77766

No files matched your search

+180 -69
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<javascript app="gallery">
<file javascript_app="gallery" javascript_location="front" javascript_path="controllers/browse" javascript_name="ips.browse.list.js" javascript_type="controller" javascript_version="101012" javascript_position="1000050">/**
* IPS Social Suite 4
<file javascript_app="gallery" javascript_location="front" javascript_path="controllers/browse" javascript_name="ips.browse.list.js" javascript_type="controller" javascript_version="101093" javascript_position="1000050">/**
* IPS Community Suite 4
* (c) 2013 Invision Power Services - http://www.invisionpower.com
*
* ips.browse.list.js - Gallery browse list controller
@@ -48,8 +48,8 @@
}
});
}(jQuery, _));</file>
<file javascript_app="gallery" javascript_location="front" javascript_path="controllers/submit" javascript_name="ips.submit.chooseCategory.js" javascript_type="controller" javascript_version="101012" javascript_position="1000100"><![CDATA[/**
* IPS Social Suite 4
<file javascript_app="gallery" javascript_location="front" javascript_path="controllers/submit" javascript_name="ips.submit.chooseCategory.js" javascript_type="controller" javascript_version="101093" javascript_position="1000100"><![CDATA[/**
* IPS Community Suite 4
* (c) 2013 Invision Power Services - http://www.invisionpower.com
*
* ips.submit.chooseCategory.js - AJAX to show album options after selecting category
@@ -134,9 +134,16 @@
// Fire AJAX
ips.getAjax()( ips.getSetting('baseURL') + 'index.php?app=gallery&module=gallery&controller=submit&_step=choose_album&chosenCategory=' + id + '&album=' + this.scope.attr('data-preselected-album') )
.done( function (response) {
if ( response ) {
self.scope.removeClass('ipsLoading').html( response );
$( document ).trigger( 'contentChange', [ self.scope ] );
if( response ){
// If there's a wizard in the response, pass it up to the wizard controller to handle
if( response.indexOf('gallery.front.submit.wizard') !== -1 ){
self.trigger( 'updateWizard.gallery', {
contents: response
});
} else {
self.scope.removeClass('ipsLoading').html( response );
$( document ).trigger( 'contentChange', [ self.scope ] );
}
} else {
self.scope.removeClass('ipsLoading');
self.scope.find('[data-role="continueCategory"]').show();
@@ -149,8 +156,8 @@
});
}(jQuery, _));]]></file>
<file javascript_app="gallery" javascript_location="front" javascript_path="controllers/submit" javascript_name="ips.submit.existingAlbums.js" javascript_type="controller" javascript_version="101012" javascript_position="1000100"><![CDATA[/**
* IPS Social Suite 4
<file javascript_app="gallery" javascript_location="front" javascript_path="controllers/submit" javascript_name="ips.submit.existingAlbums.js" javascript_type="controller" javascript_version="101093" javascript_position="1000100"><![CDATA[/**
* IPS Community Suite 4
* (c) 2013 Invision Power Services - http://www.invisionpower.com
*
* ips.submit.existingAlbums.js - Allows user to select an existing gallery album
@@ -196,8 +203,8 @@
}
});
}(jQuery, _));]]></file>
<file javascript_app="gallery" javascript_location="front" javascript_path="controllers/submit" javascript_name="ips.submit.imageInfo.js" javascript_type="controller" javascript_version="101012" javascript_position="1000100"><![CDATA[/**
* IPS Social Suite 4
<file javascript_app="gallery" javascript_location="front" javascript_path="controllers/submit" javascript_name="ips.submit.imageInfo.js" javascript_type="controller" javascript_version="101093" javascript_position="1000100"><![CDATA[/**
* IPS Community Suite 4
* (c) 2013 Invision Power Services - http://www.invisionpower.com
*
* ips.submit.imageInfo.js - Image information controller for an individual image
@@ -300,7 +307,7 @@
this.trigger( 'formLoading.gallerySubmit' );
ips.ui.editor.getObj( $(this.scope).find('[data-ipsEditor]') ).saveAndClearAutosave();
ips.ui.editor.getObj( this.scope.find('[data-ipsEditor]') ).saveAndClearAutosave();
ips.getAjax()( form.attr('action'), {
data: form.serialize() + '&submitButton=' + direction,
@@ -308,7 +315,7 @@
method: form.attr('method')
})
.done( function (response) {
Debug.log( response );
ips.ui.editor.getObj( self.scope.find('[data-ipsEditor]') ).destruct();
self.trigger( 'formSaved.gallerySubmit', {
index: self._index,
@@ -333,8 +340,8 @@
}
});
}(jQuery, _));]]></file>
<file javascript_app="gallery" javascript_location="front" javascript_path="controllers/submit" javascript_name="ips.submit.main.js" javascript_type="controller" javascript_version="101012" javascript_position="1000100"><![CDATA[/**
* IPS Social Suite 4
<file javascript_app="gallery" javascript_location="front" javascript_path="controllers/submit" javascript_name="ips.submit.main.js" javascript_type="controller" javascript_version="101093" javascript_position="1000100"><![CDATA[/**
* IPS Community Suite 4
* (c) 2013 Invision Power Services - http://www.invisionpower.com
*
* ips.submit.main.js - Main submit controller
@@ -355,7 +362,7 @@
this.on( 'formLoading.gallerySubmit', this.formLoading );
this.on( 'formSaved.gallerySubmit', this.formSaved );
this.on( 'formError.gallerySubmit', this.formError );
this.on( 'click', '[data-action="finish"]', this.finishEditing );
this.on( 'submit', '[data-role="allImagesForm"]', this.finishEditing );
this.on( 'click', '[data-role="imageThumb"]', this.switchToImage );
this.setup();
},
@@ -384,7 +391,8 @@
var index = image.attr('data-index');
var url = image.find('a').attr('href');
var currentIndex = this._slider.find('.cGallerySubmit_current').attr('data-index');
this._markImageDone( currentIndex );
this._switchToAfterLoad = { index: index, url: url };
// Scroll the slider to the new image
@@ -403,10 +411,25 @@
* @returns {void}
*/
finishEditing: function (e) {
if( $( e.currentTarget ).attr('data-bypassChecks') ){
return;
}
e.stopPropagation();
e.preventDefault();
var currentIndex = this._slider.find('.cGallerySubmit_current').attr('data-index');
// Does the currently-selected image need to be saved first?
this._switchToAfterLoad = { finish: true };
// 02/02/16 - If currentIndex is undefined, it means there's no 'current' image; i.e., we've finished.
// So we'll skip the events on subcontrollers (which won't exist now anyway) and run our finish method
// See https://community.invisionpower.com/4bugtrack/pre-release-reports/gallery-cant-finish-editing-r10213/
if( _.isUndefined( currentIndex ) ){
this._doFinish();
return;
}
// Does the currently-selected image need to be saved first?
this.triggerOn( 'gallery.front.submit.imageInfo', 'submitWithoutRedirect.gallerySubmit', {
index: currentIndex
});
@@ -454,13 +477,21 @@
$( document ).trigger( 'contentChange', [ self._infoPanel ] );
});
self._markImageDone( data.index );
if( info.success ){
self._markImageDone( data.index );
}
};
if( this._switchToAfterLoad !== null ){
// Have we finished?
if( !_.isUndefined( this._switchToAfterLoad.finish ) ){
doneFunc({
form: data.response.form,
index: data.response.index,
success: data.response.success
});
this._doFinish();
} else {
// If we're loading the next image via ajax, do that and then call the doneFunc
@@ -481,11 +512,12 @@
// If we're doing a simple next/prev then we can just run it now with the response
doneFunc({
form: data.response.form,
index: data.response.index
index: data.response.index,
success: data.response.success
});
// Scroll the slider to the new image
self._makeThumbActive( data.response.index );
self._makeThumbActive( data.response.done ? null : data.response.index );
self._switchToAfterLoad = null;
}
},
@@ -510,12 +542,11 @@
*/
_doFinish: function () {
// How many unsaved images do we have? We can count them in the slider to figure it out
var form = $( e.currentTarget ).closest('form');
var self = this;
var form = this.scope.find('[data-role="allImagesForm"]');
var unsavedCount = this._slider.find('li:not( .cGallerySubmit_done )').length;
if( unsavedCount ){
e.preventDefault();
if( unsavedCount ){
ips.ui.alert.show( {
type: 'confirm',
icon: 'warn',
@@ -523,10 +554,15 @@
subText: ips.getString('images_without_data_desc'),
callbacks: {
ok: function () {
form.submit();
form.attr('data-bypassChecks', true).submit();
},
cancel: function () {
self._switchToAfterLoad = null;
}
}
});
} else {
form.attr('data-bypassChecks', true).submit();
}
},
@@ -537,7 +573,6 @@
* @returns {void}
*/
_markImageDone: function (index) {
Debug.log( 'mark done: ' + index );
if( index !== -1 ){
this._slider.find('[data-index="' + index + '"]').addClass('cGallerySubmit_done');
}
@@ -553,6 +588,11 @@
// Remove highlight on all items
this._slider.find('[data-role="imageThumb"]').removeClass('cGallerySubmit_current');
if( _.isNull( index ) ){
// If next index is null, we won't select any thumb - indicaes we're finished
return;
}
// Find the new item @todo account for movies here
var nextItem = this._slider.find('[data-index="' + index + '"]');
@@ -579,8 +619,8 @@
}
});
}(jQuery, _));]]></file>
<file javascript_app="gallery" javascript_location="front" javascript_path="controllers/submit" javascript_name="ips.submit.uploadImages.js" javascript_type="controller" javascript_version="101012" javascript_position="1000100"><![CDATA[/**
* IPS Social Suite 4
<file javascript_app="gallery" javascript_location="front" javascript_path="controllers/submit" javascript_name="ips.submit.uploadImages.js" javascript_type="controller" javascript_version="101093" javascript_position="1000100"><![CDATA[/**
* IPS Community Suite 4
* (c) 2013 Invision Power Services - http://www.invisionpower.com
*
* ips.submit.uploadImages.js - Image upload step
@@ -607,10 +647,16 @@
* @returns {void}
*/
setup: function () {
this.resizeUploader();
// Disable the submit button to start with
this.scope.find('[data-role="submitForm"]').prop( 'disabled', true );
// If we already have some files, then show the small uploader and the continue button enabled
if( this.scope.find('[data-role="fileList"] [data-role="file"]').length ){
this._shrinkUploader( false );
$( window ).trigger('resize'); // Cause the grid to redraw properly
} else {
this.resizeUploader();
// Disable the submit button if we have no files
this.scope.find('[data-role="submitForm"]').prop( 'disabled', true );
}
},
/**
@@ -651,29 +697,49 @@
* Responds to event from the uploader
*
* @param {event} e Event object
* @param {objct} data Data object from uploader
* @param {object} data Data object from uploader
* @returns {void}
*/
filesAdded: function (e, data) {
this.scope.find('.ipsAttachment_dropZone')
.find('.fa-cloud-upload')
.fadeOut( function () {
$( this ).remove()
})
.end()
.animate({
paddingTop: '10px',
height: '135px'
});
this._shrunk = true;
this._shrinkUploader( true );
this.scope.find('[data-role="submitForm"]').prop( 'disabled', true );
$( window ).trigger('resize');
},
/**
* Shrinks the uploader size so that files are shown
*
* @param {boolean} animate Animate to the smaller size?
* @returns {void}
*/
_shrinkUploader: function (animate) {
var dropzone = this.scope.find('.ipsAttachment_dropZone');
var css = {
paddingTop: '10px',
height: '160px'
};
if( animate ){
dropzone
.find('.fa-cloud-upload')
.remove()
.end()
.animate( css );
} else {
dropzone
.find('.fa-cloud-upload')
.remove()
.end()
.css( css );
}
this._shrunk = true;
}
});
}(jQuery, _));]]></file>
<file javascript_app="gallery" javascript_location="front" javascript_path="controllers/submit" javascript_name="ips.submit.wizard.js" javascript_type="controller" javascript_version="101012" javascript_position="1000100"><![CDATA[/**
* IPS Social Suite 4
<file javascript_app="gallery" javascript_location="front" javascript_path="controllers/submit" javascript_name="ips.submit.wizard.js" javascript_type="controller" javascript_version="101093" javascript_position="1000100"><![CDATA[/**
* IPS Community Suite 4
* (c) 2013 Invision Power Services - http://www.invisionpower.com
*
* ips.submit.main.js - Main gallery submit dialog controller
@@ -686,6 +752,7 @@
ips.controller.register('gallery.front.submit.wizard', {
initialize: function () {
this.on( 'click', '.cGallerySteps_done[data-stepName]', this.changeStep );
this.on( 'updateWizard.gallery', this.updateWizard );
this.on( 'submit', 'form', this.submitForm );
},
@@ -713,6 +780,28 @@
this._changeContents( url, form.serialize() );
},
/**
* Allows sub-controllers to tell the wizard to update the contents
*
* @param {event} e Event object
* @param {object} data Event data object
* @returns {void}
*/
updateWizard: function (e, data) {
this.cleanContents();
// Just find the internal content
var content = $('<div>' + data.contents + '</div>');
this._updateContents( content.find('[data-controller="gallery.front.submit.wizard"]').contents() );
},
/**
* Updates the wizard contents from a URL response
*
* @param {string} url URL to call
* @param {object} data Data to pass to ajax handler
* @returns {void}
*/
_changeContents: function (url, data) {
if( _.isUndefined( data ) ){
data = {};
@@ -732,15 +821,25 @@
.done( function (response, status, jqXHR) {
// Just find the internal content
var content = $('<div>' + response + '</div>');
self.scope.html( content.find('[data-controller="gallery.front.submit.wizard"]').contents() );
$( document ).trigger( 'contentChange', [ self.scope ] );
self._updateContents( content.find('[data-controller="gallery.front.submit.wizard"]').contents() );
});
},
/**
* Updates the wizard contents
*
* @param {string} contents HTML to insert into wizard
* @returns {void}
*/
_updateContents: function (contents) {
this.scope.html( contents );
$( document ).trigger( 'contentChange', [ this.scope ] );
}
});
}(jQuery, _));]]></file>
<file javascript_app="gallery" javascript_location="front" javascript_path="controllers/view" javascript_name="ips.view.image.js" javascript_type="controller" javascript_version="101012" javascript_position="1000150"><![CDATA[/**
* IPS Social Suite 4
<file javascript_app="gallery" javascript_location="front" javascript_path="controllers/view" javascript_name="ips.view.image.js" javascript_type="controller" javascript_version="101093" javascript_position="1000150"><![CDATA[/**
* IPS Community Suite 4
* (c) 2013 Invision Power Services - http://www.invisionpower.com
*
* ips.view.image.js - Image controller
@@ -794,6 +893,9 @@
return;
}
// Track page view
ips.utils.analytics.trackPageView( state.url );
this._scrollPage();
this._loadURL( state.url );
this._scrollToImage( state.data.imageID );
@@ -836,6 +938,12 @@
* @returns {void}
*/
keyDown: function (e) {
// Ignore the keypress if we're in a form element
if( $( e.target ).closest('input, textarea, .ipsComposeArea').length ){
return;
}
switch( e.keyCode ){
case ips.ui.key.LEFT:
this.scope.find('[data-action="prevImage"]').click();
@@ -1301,18 +1409,21 @@
}
if( response.image.match( /<video /ig ) ){
var thisOptions = $('#elGalleryVideo').attr('data-setup') ? $.parseJSON( $('#elGalleryVideo').attr('data-setup') ) : {};
var thisOptions = $('video[data-role="video"]').attr('data-setup') ? $.parseJSON( $('video[data-role="video"]').attr('data-setup') ) : {};
// Create a new ID otherwise videoJS thinks it has already set it up.
var newId = 'elGalleryVideo_' + Math.random().toString(36).substr(2, 9);
$('video[data-role="video"]').attr('id', newId);
if( _.isUndefined( window.videojs ) ){
ips.loader.get( ['gallery/interface/videojs/video.js'] ).then( function() {
ips.loader.get( ['gallery/interface/videojs/videojs-loadswf.js'] ).then( function() {
var thisOptions = $('#elGalleryVideo').attr('data-setup') ? $.parseJSON( $('#elGalleryVideo').attr('data-setup') ) : {};
videojs( 'elGalleryVideo', thisOptions, function(){});
var thisOptions = $('video[data-role="video"]').attr('data-setup') ? $.parseJSON( $('video[data-role="video"]').attr('data-setup') ) : {};
videojs( newId, thisOptions, function(){});
});
});
} else {
videojs.players = {};
videojs( 'elGalleryVideo', thisOptions, function(){});
videojs( newId, thisOptions, function(){});
}
}
@@ -1425,8 +1536,8 @@
}
});
}(jQuery, _));]]></file>
<file javascript_app="gallery" javascript_location="front" javascript_path="controllers/view" javascript_name="ips.view.note.js" javascript_type="controller" javascript_version="101012" javascript_position="1000150"><![CDATA[/**
* IPS Social Suite 4
<file javascript_app="gallery" javascript_location="front" javascript_path="controllers/view" javascript_name="ips.view.note.js" javascript_type="controller" javascript_version="101093" javascript_position="1000150"><![CDATA[/**
* IPS Community Suite 4
* (c) 2013 Invision Power Services - http://www.invisionpower.com
*
* ips.view.note.js - Note controller
@@ -1716,7 +1827,7 @@
this.scope
.removeClass('cGalleryNote_editing')
.find('.cGalleryNote_note')
.html( this._note )
.text( this._note )
.end()
.find('.cGalleryNote_delete')
.remove();
@@ -1728,7 +1839,7 @@
* @returns {void}
*/
_buildNote: function () {
this.scope.find('.cGalleryNote_note').html( this._note );
this.scope.find('.cGalleryNote_note').text( this._note );
},
/**
@@ -1745,6 +1856,7 @@
ips.loader.get( ['core/interface/jquery/jquery-ui.js'] ).then( function () {
self.scope.resizable({
containment: self.scope.closest('.cGalleryViewImage'),
handles: 'se',
stop: self._updatePosition.bind( self )
});
@@ -1822,8 +1934,8 @@
}
});
}(jQuery, _));]]></file>
<file javascript_app="gallery" javascript_location="front" javascript_path="controllers/view" javascript_name="ips.view.notes.js" javascript_type="controller" javascript_version="101012" javascript_position="1000150"><![CDATA[/**
* IPS Social Suite 4
<file javascript_app="gallery" javascript_location="front" javascript_path="controllers/view" javascript_name="ips.view.notes.js" javascript_type="controller" javascript_version="101093" javascript_position="1000150"><![CDATA[/**
* IPS Community Suite 4
* (c) 2013 Invision Power Services - http://www.invisionpower.com
*
* ips.view.notes.js - Gallery notes controller
@@ -1905,7 +2017,7 @@
}
});
}(jQuery, _));]]></file>
<file javascript_app="gallery" javascript_location="front" javascript_path="templates" javascript_name="ips.templates.browse.js" javascript_type="template" javascript_version="101012" javascript_position="1000200"><![CDATA[ips.templates.set('gallery.patchwork.indexItem', " \
<file javascript_app="gallery" javascript_location="front" javascript_path="templates" javascript_name="ips.templates.browse.js" javascript_type="template" javascript_version="101093" javascript_position="1000200"><![CDATA[ips.templates.set('gallery.patchwork.indexItem', " \
{{#showThumb}}\
<span class='cGalleryPatchwork_item' style='width: {{dims.width}}px; height: {{dims.height}}px; margin: {{dims.margin}}px {{dims.marginRight}}px {{dims.margin}}px {{dims.marginLeft}}px'>\
{{/showThumb}}\
@@ -1927,7 +2039,7 @@
</a>\
</span>\
");]]></file>
<file javascript_app="gallery" javascript_location="front" javascript_path="templates" javascript_name="ips.templates.view.js" javascript_type="template" javascript_version="101012" javascript_position="1000200"><![CDATA[ips.templates.set('gallery.notes.wrapper', " \
<file javascript_app="gallery" javascript_location="front" javascript_path="templates" javascript_name="ips.templates.view.js" javascript_type="template" javascript_version="101093" javascript_position="1000200"><![CDATA[ips.templates.set('gallery.notes.wrapper', " \
<div class='cGalleryNote' data-controller='gallery.front.view.note' data-noteID='{{id}}' data-note=\"{{note}}\" {{#editable}}data-editable{{/editable}} data-posLeft='{{left}}' data-posTop='{{top}}' data-dimWidth='{{width}}' data-dimHeight='{{height}}'>\
<div class='cGalleryNote_border'></div>\
<div class='cGalleryNote_note' style='display: none'>\
@@ -1948,6 +2060,7 @@ ips.templates.set('gallery.notes.edit', " \
</ul>\
");]]></file>
<order app="global" path="/dev/js//framework/">templates
common/ips.loader.js
common/ui
common/utils
common
@@ -1961,6 +2074,4 @@ app.js</order>
<order app="global" path="/dev/js//library//jquery">jquery.js
jquery.history.js
jquery.transform.js</order>
<order app="global" path="/dev/js//library//xregexp">xregexp-all.js
xregexp-lookbehind.js</order>
</javascript>