Version 4.5.0
This commit is contained in:
1 parent
1a0c7fd3c2
commit
f79dcf067a
3791 files changed
+248032
-76372
No files matched your search
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<javascript app="cms">
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/blocks" javascript_name="ips.blocks.form.js" javascript_type="controller" javascript_version="103038" javascript_position="1000100"><![CDATA[/**
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/blocks" javascript_name="ips.blocks.form.js" javascript_type="controller" javascript_version="105100" javascript_position="1000100"><![CDATA[/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -142,7 +142,7 @@
|
||||
}
|
||||
});
|
||||
}(jQuery, _));]]></file>
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/databases" javascript_name="ips.databases.download.js" javascript_type="controller" javascript_version="103038" javascript_position="1000150">/**
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/databases" javascript_name="ips.databases.download.js" javascript_type="controller" javascript_version="105100" javascript_position="1000150">/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -187,7 +187,7 @@
|
||||
}
|
||||
});
|
||||
}(jQuery, _));</file>
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/databases" javascript_name="ips.databases.form.js" javascript_type="controller" javascript_version="103038" javascript_position="1000150">/**
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/databases" javascript_name="ips.databases.form.js" javascript_type="controller" javascript_version="105100" javascript_position="1000150"><![CDATA[/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -197,17 +197,30 @@
|
||||
*/
|
||||
|
||||
;( function($, _, undefined){
|
||||
"use strict";
|
||||
"use strict";
|
||||
|
||||
ips.controller.register('cms.admin.databases.form', {
|
||||
|
||||
initialize: function () {
|
||||
this.on( 'change', '[name=database_create_page]', this.toggle );
|
||||
this.on( 'change', '[name=database_use_categories]', this.toggleUseCategories );
|
||||
this.on( 'click', '[data-template-view]', this.goTemplates );
|
||||
this.toggle();
|
||||
this.toggleUseCategories();
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Go view templates
|
||||
*
|
||||
* @param {event} e Event object
|
||||
* @returns {void}
|
||||
*/
|
||||
goTemplates: function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
window.location = $( e.currentTarget ).attr('data-url') + '&t_group=' + $('[name="' + $( e.currentTarget ).attr('data-template-view') ).val();
|
||||
},
|
||||
|
||||
/**
|
||||
* Toggle use categories
|
||||
*
|
||||
@@ -249,8 +262,8 @@
|
||||
} );
|
||||
}
|
||||
});
|
||||
}(jQuery, _));</file>
|
||||
<file javascript_app="cms" javascript_location="front" javascript_path="controllers/external" javascript_name="ips.external.communication.js" javascript_type="controller" javascript_version="103038" javascript_position="1000150"><![CDATA[/**
|
||||
}(jQuery, _));]]></file>
|
||||
<file javascript_app="cms" javascript_location="front" javascript_path="controllers/external" javascript_name="ips.external.communication.js" javascript_type="controller" javascript_version="105100" javascript_position="1000150"><![CDATA[/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -385,7 +398,7 @@
|
||||
}
|
||||
});
|
||||
}(jQuery, _));]]></file>
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/fields" javascript_name="ips.fields.form.js" javascript_type="controller" javascript_version="103038" javascript_position="1000200">/**
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/fields" javascript_name="ips.fields.form.js" javascript_type="controller" javascript_version="105100" javascript_position="1000200">/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -422,7 +435,7 @@
|
||||
}
|
||||
});
|
||||
}(jQuery, _));</file>
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/media" javascript_name="ips.media.main.js" javascript_type="controller" javascript_version="103038" javascript_position="1000300"><![CDATA[/**
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/media" javascript_name="ips.media.main.js" javascript_type="controller" javascript_version="105100" javascript_position="1000300"><![CDATA[/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -689,11 +702,11 @@
|
||||
item.addClass('cMedia_itemSelected');
|
||||
this._switchToTab('overview');
|
||||
} else if( metaPressed ) {
|
||||
|
||||
// If meta key is pressed, toggle the state of the clicked image
|
||||
item.toggleClass( 'cMedia_itemSelected', ( !item.hasClass('cMedia_itemSelected') ) );
|
||||
} else if( shiftPressed ) {
|
||||
// If shift is pressed, select the whole run
|
||||
|
||||
// Find the first selected file
|
||||
var all = this._fileListing.find('.cMedia_item');
|
||||
var indexOfFirst = all.index( all.filter('.cMedia_itemSelected').first() );
|
||||
@@ -1056,12 +1069,13 @@
|
||||
*/
|
||||
_switchToTab: function (tab) {
|
||||
if( tab == 'overview' ){
|
||||
this.scope.find('#elTab_overview').removeClass('ipsTabs_itemDisabled');
|
||||
this.scope.find('#elTab_overview').click();
|
||||
}
|
||||
}
|
||||
});
|
||||
}(jQuery, _));]]></file>
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/pages" javascript_name="ips.pages.embed.js" javascript_type="controller" javascript_version="103038" javascript_position="1000250"><![CDATA[/**
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/pages" javascript_name="ips.pages.embed.js" javascript_type="controller" javascript_version="105100" javascript_position="1000250"><![CDATA[/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -1107,7 +1121,7 @@
|
||||
}
|
||||
});
|
||||
}(jQuery, _));]]></file>
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/pages" javascript_name="ips.pages.form.js" javascript_type="controller" javascript_version="103038" javascript_position="1000250"><![CDATA[/**
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/pages" javascript_name="ips.pages.form.js" javascript_type="controller" javascript_version="105100" javascript_position="1000250"><![CDATA[/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -1124,6 +1138,7 @@
|
||||
this.on( 'change', '#check_page_ipb_wrapper', this.toggleIPSWrapper );
|
||||
this.on( 'change', '#elSelect_page_wrapper_template', this.toggleTemplate );
|
||||
this.on( 'click', '[data-role=viewTemplate]', this.viewTemplate );
|
||||
this.on( 'submit', '[data-role=wordForm]', this.submitWordForm );
|
||||
|
||||
/* View template */
|
||||
if ( this.scope.find('#elSelect_page_wrapper_template').val() == '_none_' )
|
||||
@@ -1142,6 +1157,34 @@
|
||||
}
|
||||
},
|
||||
|
||||
submitWordForm: function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
var form = $( e.currentTarget );
|
||||
var url = form.attr('action');
|
||||
|
||||
ips.getAjax()( url, {
|
||||
type: 'post',
|
||||
data: form.serialize()
|
||||
} )
|
||||
.done( function( response, status, jqXHR ) {
|
||||
var tagSource = $('div[data-tagSource]');
|
||||
|
||||
if ( !_.isUndefined( tagSource ) ) {
|
||||
ips.getAjax()( tagSource.attr('data-tagSource') )
|
||||
.done( function (response, status, jqXHR) {
|
||||
$('ul[data-role="tagsList"]').html( response )
|
||||
} );
|
||||
}
|
||||
|
||||
var dialogObj = ips.ui.dialog.getObj( $( 'a[data-action="wordForm"]' ) );
|
||||
if ( !_.isUndefined( dialogObj ) )
|
||||
{
|
||||
dialogObj.hide();
|
||||
}
|
||||
} );
|
||||
},
|
||||
|
||||
/**
|
||||
* View a template. As the title of the method suggests.
|
||||
*
|
||||
@@ -1200,7 +1243,7 @@
|
||||
}
|
||||
});
|
||||
}(jQuery, _));]]></file>
|
||||
<file javascript_app="cms" javascript_location="front" javascript_path="controllers/records" javascript_name="ips.records.form.js" javascript_type="controller" javascript_version="103038" javascript_position="1000100"><![CDATA[/**
|
||||
<file javascript_app="cms" javascript_location="front" javascript_path="controllers/records" javascript_name="ips.records.form.js" javascript_type="controller" javascript_version="105100" javascript_position="1000100"><![CDATA[/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -1312,7 +1355,7 @@
|
||||
}
|
||||
});
|
||||
}(jQuery, _));]]></file>
|
||||
<file javascript_app="cms" javascript_location="front" javascript_path="controllers/records" javascript_name="ips.records.revisions.js" javascript_type="controller" javascript_version="103038" javascript_position="1000100">/**
|
||||
<file javascript_app="cms" javascript_location="front" javascript_path="controllers/records" javascript_name="ips.records.revisions.js" javascript_type="controller" javascript_version="105100" javascript_position="1000100">/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -1345,8 +1388,8 @@
|
||||
if( $(elem).attr('data-method') == 'merge' )
|
||||
{
|
||||
CodeMirror.MergeView( document.getElementById( $(elem).identify().attr('id') ), {
|
||||
value: self.scope.find( '[data-original="' + $(elem).attr('data-key') + '"]' ).val(),
|
||||
origLeft: self.scope.find( '[data-current="' + $(elem).attr('data-key') + '"]' ).val(),
|
||||
value: self.scope.find( '[data-current="' + $(elem).attr('data-key') + '"]' ).val(),
|
||||
origLeft: self.scope.find( '[data-original="' + $(elem).attr('data-key') + '"]' ).val(),
|
||||
lineWrapping: true,
|
||||
lineNumbers: false,
|
||||
mode: 'htmlmixed',
|
||||
@@ -1367,7 +1410,7 @@
|
||||
}
|
||||
});
|
||||
}(jQuery, _));</file>
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/templates" javascript_name="ips.templates.addForm.js" javascript_type="controller" javascript_version="103038" javascript_position="1000050">/**
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/templates" javascript_name="ips.templates.addForm.js" javascript_type="controller" javascript_version="105100" javascript_position="1000050">/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -1417,7 +1460,7 @@
|
||||
}
|
||||
});
|
||||
}(jQuery, _));</file>
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/templates" javascript_name="ips.templates.conflict.js" javascript_type="controller" javascript_version="103038" javascript_position="1000050">/**
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/templates" javascript_name="ips.templates.conflict.js" javascript_type="controller" javascript_version="105100" javascript_position="1000050">/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -1489,7 +1532,7 @@
|
||||
}
|
||||
});
|
||||
}(jQuery, _));</file>
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/templates" javascript_name="ips.templates.fileEditor.js" javascript_type="controller" javascript_version="103038" javascript_position="1000050"><![CDATA[/**
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/templates" javascript_name="ips.templates.fileEditor.js" javascript_type="controller" javascript_version="105100" javascript_position="1000050"><![CDATA[/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -1603,9 +1646,12 @@
|
||||
if( data.originalEvent ){
|
||||
data.originalEvent.preventDefault();
|
||||
}
|
||||
|
||||
|
||||
if( data.triggerID == 'elTemplateEditor_preferences' ){
|
||||
if( data.selectedItemID == 'wrap' ){
|
||||
if ( data.selectedItemID == 'diff' ) {
|
||||
this.toggleDiff();
|
||||
}
|
||||
else if( data.selectedItemID == 'wrap' ){
|
||||
this._changeEditorPreference( !ips.utils.db.get('templateEditor', 'wrap'), 'wrap', 'lineWrapping' );
|
||||
} else {
|
||||
this._changeEditorPreference( !ips.utils.db.get('templateEditor', 'lines'), 'lines', 'lineNumbers' );
|
||||
@@ -1637,7 +1683,12 @@
|
||||
|
||||
// Update all CM instances
|
||||
for( var i in this._cmInstances ){
|
||||
this._cmInstances[ i ].setOption( cmName, toValue );
|
||||
if ( this._cmInstances[ i ] instanceof CodeMirror.MergeView ) {
|
||||
this._cmInstances[ i ].edit.setOption( cmName, toValue );
|
||||
this._cmInstances[ i ].left.orig.setOption( cmName, toValue );
|
||||
} else {
|
||||
this._cmInstances[ i ].setOption( cmName, toValue );
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1668,10 +1719,10 @@
|
||||
return;
|
||||
}
|
||||
|
||||
var variablesValue = $.trim( active.tabPanel.find('[data-role="variables"]').val() );
|
||||
var descriptionValue = $.trim( active.tabPanel.find('[data-role="description"]').val() );
|
||||
var titleValue = $.trim( active.tabPanel.find('[data-role="title"]').val() );
|
||||
var groupValue = $.trim( active.tabPanel.find('[data-role="group"]').val() );
|
||||
var variablesValue = active.tabPanel.find('[data-role="variables"]').val().trim();
|
||||
var descriptionValue = active.tabPanel.find('[data-role="description"]').val().trim();
|
||||
var titleValue = active.tabPanel.find('[data-role="title"]').val().trim();
|
||||
var groupValue = active.tabPanel.find('[data-role="group"]').val().trim();
|
||||
|
||||
data.dialog
|
||||
.find('[data-role="variables"]')
|
||||
@@ -1757,6 +1808,68 @@
|
||||
|
||||
this._updateTabLabel( data.fileID, data.title );
|
||||
},
|
||||
|
||||
/**
|
||||
* Toggle diff
|
||||
*
|
||||
* @returns {void}
|
||||
*/
|
||||
toggleDiff: function () {
|
||||
|
||||
var self = this;
|
||||
var active = this._getActiveTab();
|
||||
var panel = active.tabPanel;
|
||||
var key = panel.attr('data-fileid');
|
||||
|
||||
// Toggle off
|
||||
if ( self._cmInstances[ key ] instanceof CodeMirror.MergeView ) {
|
||||
self.scope.find( '#editor_' + key ).val( this._cmInstances[ key ].edit.doc.getValue() );
|
||||
panel.find('.CodeMirror-merge,.cTemplateMergeHeaders').remove();
|
||||
self._initCodeMirror( key, panel.attr('data-type') );
|
||||
}
|
||||
|
||||
// Toggle on
|
||||
else {
|
||||
|
||||
// Get the contents from the current CodeMirror instance and remove it
|
||||
self._cmInstances[ key ].save();
|
||||
panel.find('.CodeMirror').remove();
|
||||
panel.addClass('ipsLoading');
|
||||
|
||||
// Fire AJAX to get the original content
|
||||
ips.getAjax()( this._normalURL + '&do=diffTemplate', {
|
||||
dataType: 'json',
|
||||
data: this._getParametersFromPanel( panel )
|
||||
})
|
||||
.done( function (response) {
|
||||
|
||||
// Initiate the merge view
|
||||
self._cmInstances[ key ] = CodeMirror.MergeView( document.getElementById( panel.attr('id') ), {
|
||||
value: self.scope.find( '#editor_' + key ).val(),
|
||||
origLeft: response,
|
||||
lineWrapping: self._editorPreferences['wrap'],
|
||||
lineNumbers: self._editorPreferences['lines'],
|
||||
mode: ( panel.attr('data-type') == 'templates' ? 'htmlmixed' : 'css' ),
|
||||
} );
|
||||
panel.removeClass('ipsLoading');
|
||||
|
||||
// Add headers
|
||||
var headers = $( ips.templates.render( 'templates.editor.diffHeaders' ) );
|
||||
panel.prepend( headers );
|
||||
|
||||
// Set size
|
||||
var height = self._getTabContentHeight() - headers.outerHeight();
|
||||
self._cmInstances[ key ].edit.setSize( null, height );
|
||||
self._cmInstances[ key ].left.orig.setSize( null, height );
|
||||
$( self._cmInstances[ key ].left.gap ).css( 'height', height );
|
||||
|
||||
// Add change handler
|
||||
self._cmInstances[ key ].edit.on( 'change', function (doc, cm) {
|
||||
self._setChanged( true, key );
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Saves the contents of the editor
|
||||
@@ -1779,8 +1892,13 @@
|
||||
var save = this._getParametersFromPanel( panel );
|
||||
|
||||
// We call .save() on the CodeMirror instance, which will cause it to update the
|
||||
// contents of the original textbox
|
||||
this._cmInstances[ key ].save();
|
||||
// contents of the original textbox, unless we're in merge view, when we have to
|
||||
// do that ourselves
|
||||
if ( this._cmInstances[ key ] instanceof CodeMirror.MergeView ) {
|
||||
self.scope.find( '#editor_' + key ).val( this._cmInstances[ key ].edit.doc.getValue() );
|
||||
} else {
|
||||
this._cmInstances[ key ].save();
|
||||
}
|
||||
|
||||
// Add it to the save object
|
||||
save[ 'editor_' + key ] = this.scope.find( '#editor_' + key ).val();
|
||||
@@ -2045,7 +2163,6 @@
|
||||
});
|
||||
|
||||
// Remove the codemirrrrr element & instance
|
||||
$( this._cmInstances[ key ].getWrapperElement() ).remove();
|
||||
delete( this._cmInstances[ key ] );
|
||||
|
||||
// Find the next or prev tab, if this tab is active, and switch to it
|
||||
@@ -2104,7 +2221,8 @@
|
||||
var status = tabPanel.attr('data-inherited-value');
|
||||
var type = tabPanel.attr('data-type');
|
||||
var revert = this.scope.find('[data-action="revert"]');
|
||||
|
||||
var key = tabPanel.attr('data-fileid');
|
||||
|
||||
switch( status ){
|
||||
case 'original':
|
||||
case 'inherit':
|
||||
@@ -2129,6 +2247,12 @@
|
||||
|
||||
$('#elTemplateEditor_variables').show();
|
||||
$('#elTemplateEditor_attributes').hide();
|
||||
|
||||
if ( this._cmInstances[ key ] instanceof CodeMirror.MergeView ) {
|
||||
$('[data-ipsmenuvalue="diff"]').addClass('ipsMenu_itemChecked');
|
||||
} else {
|
||||
$('[data-ipsmenuvalue="diff"]').removeClass('ipsMenu_itemChecked');
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -2348,14 +2472,14 @@
|
||||
_getTabContentHeight: function () {
|
||||
var tabContentTop = this._tabContent.offset().top;
|
||||
var windowHeight = $( window ).height();
|
||||
var infoHeight = this.scope.find('#elTemplateEditor_info').outerHeight();
|
||||
var infoHeight = $('#elTemplateEditor_info').outerHeight();
|
||||
|
||||
this._panelHeight = windowHeight - tabContentTop - infoHeight - 31;
|
||||
this._panelHeight = windowHeight - tabContentTop - infoHeight;
|
||||
return this._panelHeight;
|
||||
}
|
||||
});
|
||||
}(jQuery, _));]]></file>
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/templates" javascript_name="ips.templates.fileList.js" javascript_type="controller" javascript_version="103038" javascript_position="1000050"><![CDATA[/**
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/templates" javascript_name="ips.templates.fileList.js" javascript_type="controller" javascript_version="105100" javascript_position="1000050"><![CDATA[/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -2411,10 +2535,11 @@
|
||||
resizeFileList: function () {
|
||||
// Get height of parts we want to exclude
|
||||
var fileListTop = this._tabContent.offset().top;
|
||||
var infoHeight = this.scope.find('#elTemplateEditor_info').height();
|
||||
var infoHeight = $('#elTemplateEditor_info').height();
|
||||
var newButtonHeight = this.scope.find('#elTemplateEditor_newButton').outerHeight();
|
||||
var browserHeight = $( window ).height();
|
||||
|
||||
var fileListNewTop = browserHeight - fileListTop - infoHeight - 30;
|
||||
var fileListNewTop = browserHeight - fileListTop - infoHeight - newButtonHeight;
|
||||
|
||||
this._tabContent.css({
|
||||
height: fileListNewTop + 'px'
|
||||
@@ -2697,7 +2822,7 @@
|
||||
}
|
||||
});
|
||||
}(jQuery, _));]]></file>
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/templates" javascript_name="ips.templates.main.js" javascript_type="controller" javascript_version="103038" javascript_position="1000050">/**
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/templates" javascript_name="ips.templates.main.js" javascript_type="controller" javascript_version="105100" javascript_position="1000050"><![CDATA[/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -2707,11 +2832,21 @@
|
||||
* Author: Rikki Tissier
|
||||
*/
|
||||
;( function($, _, undefined){
|
||||
"use strict";
|
||||
"use strict";
|
||||
|
||||
ips.controller.register('cms.admin.templates.main', {
|
||||
|
||||
|
||||
_timer: null,
|
||||
_textField: null,
|
||||
_lastValue: '',
|
||||
_ajax: null,
|
||||
|
||||
initialize: function () {
|
||||
this._textField = $(this.scope).find('[data-role="templateSearch"]');
|
||||
this.on( document, 'focus', '[data-role="templateSearch"]', this.fieldFocus );
|
||||
this.on( document, 'blur', '[data-role="templateSearch"]', this.fieldBlur );
|
||||
this.on( 'menuItemSelected', this.menuSelected );
|
||||
|
||||
this.on( 'savingFile.templates', this.showLoading );
|
||||
this.on( 'saveFileFinished.templates', this.hideLoading );
|
||||
},
|
||||
@@ -2723,7 +2858,7 @@
|
||||
* @returns {void}
|
||||
*/
|
||||
showLoading: function (e) {
|
||||
ips.utils.anim.go( 'fadeIn', this.scope.find('[data-role="loading"]') );
|
||||
ips.utils.anim.go( 'fadeIn', this.scope.find('[data-role="loading"]') );
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -2733,12 +2868,126 @@
|
||||
* @returns {void}
|
||||
*/
|
||||
hideLoading: function (e) {
|
||||
ips.utils.anim.go( 'fadeOut', this.scope.find('[data-role="loading"]') );
|
||||
ips.utils.anim.go( 'fadeOut', this.scope.find('[data-role="loading"]') );
|
||||
},
|
||||
|
||||
/**
|
||||
* Event handler for focusing in the search box
|
||||
* Set a timer going that will watch for value changes. If there's already a value,
|
||||
* we'll show the results immediately
|
||||
*
|
||||
* @param {event} e Event object
|
||||
* @returns {void}
|
||||
*/
|
||||
fieldFocus: function (e) {
|
||||
this._timer = setInterval( _.bind( this._timerFocus, this ), 700 );
|
||||
},
|
||||
|
||||
/**
|
||||
* Event handler for field blur
|
||||
*
|
||||
* @param {event} e Event object
|
||||
* @returns {void}
|
||||
*/
|
||||
fieldBlur: function (e) {
|
||||
clearInterval( this._timer );
|
||||
},
|
||||
|
||||
/**
|
||||
* Timer callback from this.fieldFocus
|
||||
* Compares current value to previous value, and shows/loads new results if it's changed
|
||||
*
|
||||
* @returns {void}
|
||||
*/
|
||||
_timerFocus: function () {
|
||||
var currentValue = this._textField.val();
|
||||
|
||||
if( currentValue == this._lastValue ){
|
||||
return;
|
||||
}
|
||||
|
||||
this._lastValue = currentValue;
|
||||
|
||||
this._loadResults();
|
||||
},
|
||||
|
||||
/**
|
||||
* Event when tab is changed
|
||||
*
|
||||
* @returns {void}
|
||||
*/
|
||||
_swapTab: function (e,data) {
|
||||
if ( data.barID == 'elTemplateEditor_typeTabs' ) {
|
||||
this._loadResults();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Event handler for the filter menu
|
||||
*
|
||||
* @param {event} e Event object
|
||||
* @param {object} data Event data object
|
||||
* @returns {void}
|
||||
*/
|
||||
menuSelected: function (e, data) {
|
||||
if( data.originalEvent ){
|
||||
data.originalEvent.preventDefault();
|
||||
}
|
||||
|
||||
this._loadResults();
|
||||
},
|
||||
|
||||
/**
|
||||
* Load results from the server
|
||||
*
|
||||
* @returns {void}
|
||||
*/
|
||||
_loadResults: function () {
|
||||
if( this._ajax ){
|
||||
this._ajax.abort();
|
||||
}
|
||||
|
||||
if ( this._lastValue ) {
|
||||
this._textField.addClass('ipsField_loading');
|
||||
}
|
||||
$('#elTemplateEditor_fileList').find('li').addClass('ipsHide');
|
||||
|
||||
var filters = [];
|
||||
$('#elTemplateFilterMenu_menu .ipsMenu_itemChecked').each(function(){
|
||||
filters.push( $(this).attr('data-ipsMenuValue') );
|
||||
});
|
||||
|
||||
var self = this;
|
||||
this._ajax = ips.getAjax()( $(this.scope).attr('data-ajaxURL') + '&do=search' + $('#elTemplateEditor_typeTabs').find('.ipsTabs_activeItem').attr('data-type') + '&term=' + encodeURIComponent( this._lastValue ) + '&filters=' + filters.join(',') ).done(function(response){
|
||||
var i;
|
||||
|
||||
var j;
|
||||
for ( j in response )
|
||||
{
|
||||
$('#elTemplateEditor_fileList').find('[data-location="' + j + '"]').removeClass('ipsHide');
|
||||
var k;
|
||||
for ( k in response[j] )
|
||||
{
|
||||
$('#elTemplateEditor_fileList').find('[data-location="' + j + '"] [data-group="' + k + '"]').removeClass('ipsHide');
|
||||
var l;
|
||||
for ( l in response[j][k] )
|
||||
{
|
||||
if( k == '.' ){
|
||||
$('#elTemplateEditor_fileList').find('[data-location="' + j + '"] [data-name="' + response[j][k][l] + '"]').parent().removeClass('ipsHide');
|
||||
} else {
|
||||
$('#elTemplateEditor_fileList').find('[data-location="' + j + '"] [data-group="' + k + '"] [data-name="' + response[j][k][l] + '"]').parent().removeClass('ipsHide');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
self._textField.removeClass('ipsField_loading');
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
}(jQuery, _));</file>
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/templates" javascript_name="ips.templates.variablesDialog.js" javascript_type="controller" javascript_version="103038" javascript_position="1000050">/**
|
||||
}(jQuery, _));]]></file>
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="controllers/templates" javascript_name="ips.templates.variablesDialog.js" javascript_type="controller" javascript_version="105100" javascript_position="1000050">/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -2776,7 +3025,7 @@
|
||||
}
|
||||
});
|
||||
}(jQuery, _));</file>
|
||||
<file javascript_app="cms" javascript_location="front" javascript_path="mixins" javascript_name="ips.cms.builder.area.js" javascript_type="mixins" javascript_version="103038" javascript_position="1000050"><![CDATA[/**
|
||||
<file javascript_app="cms" javascript_location="front" javascript_path="mixins" javascript_name="ips.cms.builder.area.js" javascript_type="mixins" javascript_version="105100" javascript_position="1000050"><![CDATA[/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -2845,7 +3094,7 @@
|
||||
|
||||
});
|
||||
}(jQuery, _));]]></file>
|
||||
<file javascript_app="cms" javascript_location="front" javascript_path="mixins" javascript_name="ips.cms.builder.block.js" javascript_type="mixins" javascript_version="103038" javascript_position="1000050"><![CDATA[/**
|
||||
<file javascript_app="cms" javascript_location="front" javascript_path="mixins" javascript_name="ips.cms.builder.block.js" javascript_type="mixins" javascript_version="105100" javascript_position="1000050"><![CDATA[/**
|
||||
* Invision Community
|
||||
* (c) Invision Power Services, Inc. - https://www.invisioncommunity.com
|
||||
*
|
||||
@@ -2953,7 +3202,7 @@
|
||||
|
||||
});
|
||||
}(jQuery, _));]]></file>
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="templates" javascript_name="ips.templates.media.js" javascript_type="template" javascript_version="103038" javascript_position="1000050"><![CDATA[ips.templates.set( 'templates.media.grid', "\
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="templates" javascript_name="ips.templates.media.js" javascript_type="template" javascript_version="105100" javascript_position="1000050"><![CDATA[ips.templates.set( 'templates.media.grid', "\
|
||||
<ul class='ipsGrid' data-ipsGrid data-ipsGrid-minItemSize='100' data-ipsGrid-maxItemSize='200'>\
|
||||
{{{contents}}}\
|
||||
</ul>\
|
||||
@@ -2970,7 +3219,7 @@ ips.templates.set( 'templates.media.noSearchResults', "\
|
||||
{{#lang}}mediaNoResults{{/lang}}\
|
||||
</div>\
|
||||
");]]></file>
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="templates" javascript_name="ips.templates.templates.js" javascript_type="template" javascript_version="103038" javascript_position="1000050"><![CDATA[/* TEMPLATE EDITOR TEMPLATES */
|
||||
<file javascript_app="cms" javascript_location="admin" javascript_path="templates" javascript_name="ips.templates.templates.js" javascript_type="template" javascript_version="105100" javascript_position="1000050"><![CDATA[/* TEMPLATE EDITOR TEMPLATES */
|
||||
/* TEMPLATECEPTION */
|
||||
ips.templates.set('templates.editor.newTab', " \
|
||||
<li data-fileid='{{fileid}}' data-location='{{location}}'>\
|
||||
@@ -3009,9 +3258,11 @@ controllers</order>
|
||||
jquery
|
||||
mustache
|
||||
jstz
|
||||
IntersectionObserver
|
||||
Debug.js
|
||||
app.js</order>
|
||||
<order app="global" path="/dev/js//library//jquery">jquery.js
|
||||
jquery-migrate.js
|
||||
jquery.history.js
|
||||
jquery.transform.js</order>
|
||||
<order app="global" path="/dev/js//library//linkify">linkify.min.js
|
||||
|
||||
Reference in new issue
Block a user