Version 3.1.4

This commit is contained in:
Neo committed 2025-12-19 00:32:22 -08:00
1 parent 1d4720f3e2
commit ae5c01cc78
2563 files changed
+283048 -240689

No files matched your search

@@ -0,0 +1,621 @@
/**
* INVISION POWER BOARD v3
*
* Topics View Javascript File
* @author Matt Mecham, Brandon Farber, Josh Williams
* @since 2008
*/
/**
* "ACP" Class. Designed for ... ACP Template Diff Functions
* @author (v.1.0.0) Matt Mecham
*/
/* Prototype Ajax Global Responders
* Based on code from: http://codejanitor.com/wp/2006/03/23/ajax-timeouts-with-prototype/
* Aborts ajax after a 5 minute delay of nothing happening
*/
var IPB3TemplateDiffResults = new IPB3TemplateDiffResults;
function IPB3TemplateDiffResults()
{
this.popUps = {};
this.cookieArray = new Array();
this.defaultCookieArray = new Array( 'merged', 'conflicted', 'uncommitted', 'committed' );
/**
* INIT
*/
this.init = function()
{
document.observe("dom:loaded", function()
{
/* Set up cbox all */
$('cboxall').observe( 'click', IPB3TemplateDiffResults.toggleSelectAll );
/* Set up cbox handler */
ipb.delegate.register(".__cbx", IPB3TemplateDiffResults.cboxEvent);
cookie = ipb.Cookie.get('acp_mergecenter');
Debug.write( cookie );
/* Set a fairly good default */
if ( cookie )
{
IPB3TemplateDiffResults.cookieArray = cookie.split( ',' );
}
if ( ! IPB3TemplateDiffResults.cookieArray.length )
{
IPB3TemplateDiffResults.cookieArray = IPB3TemplateDiffResults.defaultCookieArray;
}
/* Update the view */
IPB3TemplateDiffResults.updateView();
} );
};
/**
* Event when dude or dudette clicks a checko-boxo
*/
this.cboxEvent = function( e, elem )
{
newArray = new Array();
$$('.__cbx').each(
function(x)
{
if ( x.checked )
{
newArray.push( x.id.replace( '_cb_', '' ) );
}
}
);
if ( ! newArray.length )
{
IPB3TemplateDiffResults.cookieArray = IPB3TemplateDiffResults.defaultCookieArray;
}
else
{
IPB3TemplateDiffResults.cookieArray = newArray;
}
/* Set cookie */
ipb.Cookie.set( 'acp_mergecenter', IPB3TemplateDiffResults.cookieArray.join( ',' ) );
/* Update view */
IPB3TemplateDiffResults.updateView(e);
};
/**
* View options
*/
this.updateView = function( e )
{
/* Check */
if ( ! IPB3TemplateDiffResults.cookieArray.length )
{
IPB3TemplateDiffResults.cookieArray = IPB3TemplateDiffResults.defaultCookieArray;
}
/* reset all headers */
$$('.__group').invoke('show');
/* reset all items */
$$('.__diffRow').invoke('hide');
/* Reset view cboxes */
$$('.__cbx').each( function(x) { x.checked = false; } );
for( i = 0 ; i <= IPB3TemplateDiffResults.cookieArray.length ; i++ )
{
opt = IPB3TemplateDiffResults.cookieArray[ i ];
switch( opt )
{
case 'nocustom':
$$('._nochanges').invoke('show');
$('_cb_nocustom').checked = true;
break;
case 'merged':
$$('.__canMerge').invoke('show');
$('_cb_merged').checked = true;
break;
case 'conflicted':
$$('.__conflicts').invoke('show');
$('_cb_conflicted').checked = true;
break;
case 'uncommitted':
$$('._uncommitted').invoke('show');
$('_cb_uncommitted').checked = true;
break;
case 'committed':
$$('.__committed').invoke('show');
$('_cb_committed').checked = true;
break;
}
}
/* Go through and remove any group titles */
$$('.__group').each( function( i )
{
/* Extract group key */
if ( $( i ).className.match( /_xgid/ ) )
{
_g = $( i ).className.match( '_xgid([0-9a-zA-Z]+)' );
if ( _g != null && ! Object.isUndefined( _g ) )
{
_groupKey = _g[1];
if ( _groupKey )
{
_c = 0;
$$('._xgid' + _groupKey).each( function(y)
{
if ( $(y).visible() )
{
_c++;
}
} );
if ( _c < 2 )
{
$(i).hide();
}
}
}
}
} );
};
/**
* Select all
*/
this.toggleSelectAll = function( e )
{
/* Wot do we have? */
var status = $('cboxall').checked;
/* unselect? */
if ( status == false )
{
$$('.__xBox').each( function(x) { x.checked = false; } );
}
else
{
/* Just select non-hidden items */
$$('.__diffRow').each( function( i )
{
if ( $(i).visible() )
{
_g = $( i ).className.match( '__rowId([0-9]+)' );
if ( _g != null && ! Object.isUndefined( _g ) )
{
$$('.__cBox' + _g[1]).each( function(x) { if ( ! x.disabled ) { x.checked = true; } } );
}
}
} );
}
};
/**
* View version
*/
this.viewVersion = function( changeId, type )
{
/* Grab it via ajax */
var _url = ipb.vars['base_url'] + "&app=core&module=ajax&section=templatediff&do=viewVersion&change_id=" + changeId + '&type=' + type + '&secure_key=' + ipb.vars['md5_hash'];
new Ajax.Request( _url,
{
method: 'get',
onSuccess: function (t)
{
/* Not a JSON response? */
if ( ! t.responseText.match( /^(\s+?)?\{/ ) )
{
alert( ipb.lang['sk_error'] + t.responseText );
return;
}
/* Process results */
eval( "var json = " + t.responseText );
if ( json['error'] )
{
alert( ipb.lang['sk_error'] + json['error'] );
return false;
}
/* Type */
switch( type )
{
default:
case 'orig':
_text = 'Старый';
break;
case 'new':
_text = 'Новый';
break;
case 'custom':
_text = 'Пользовательский';
break;
}
/* otherwise... */
if ( json['data_content'] )
{
if ( json['data_type'] == 'css' )
{
content = '<h3>' + _text + ': ' + json['data_title'] + '.css</h3><div style="padding:4px;line-height:125%;overflow:auto"><pre>' + json['data_content'] + '</pre></div>';
}
else
{
content = '<h3>' + _text + ': ' + json['data_group'] + ' &gt; ' + json['data_title'] + '</h3><div style="padding:4px;line-height:125%;overflow:auto"><pre>' + json['data_content'] + '</pre></div>';
}
max = document.viewport.getHeight();
max = ( max < 600 ) ? max : 600;
popup = new ipb.Popup('VPopUp', { type: 'pane', modal: false, hideAtStart: true, w: '600px', h: max + 'px', initial: content } );
popup.show();
}
},
onFailure: function()
{
return false;
},
onException: function()
{
return false;
}
} );
};
/**
* View diff preview
*/
this.viewDiff = function( changeId, type )
{
/* Grab it via ajax */
var _url = ipb.vars['base_url'] + "&app=core&module=ajax&section=templatediff&do=viewDiff&change_id=" + changeId + '&type=' + type + '&secure_key=' + ipb.vars['md5_hash'];
new Ajax.Request( _url,
{
method: 'get',
onSuccess: function (t)
{
/* Not a JSON response? */
if ( ! t.responseText.match( /^(\s+?)?\{/ ) )
{
alert( ipb.lang['sk_error'] + t.responseText );
return;
}
/* Process results */
eval( "var json = " + t.responseText );
if ( json['error'] )
{
alert( ipb.lang['sk_error'] + json['error'] );
return false;
}
/* Type */
switch( type )
{
default:
case 'diff':
_text = 'Различия';
break;
case 'merge':
_text = 'Препросмотр объединения';
break;
}
/* otherwise... */
if ( json['change_data_content'] )
{
/* Extra work for merge */
if ( type == 'merge' )
{
_qb = "<div class='acp-actionbar' style='text-align:left;'><div style='float:right'><input type='button' id='mergeEditCustom' class='button __re" + changeId + "' value='Изменить' /></div><input type='button' id='mergeResolveCustom' class='button __rc" + changeId + "' value='Решить все: в пользу пользовательских изменений' />&nbsp;<input type='button' id='mergeResolveNew' class='button __rn" + changeId + "' value='Решить все: в пользу новых изменений' /></div>";
}
else
{
_qb = '';
}
if ( json['change_data_type'] == 'css' )
{
content = '<h3>'+ _text + ': ' + json['change_data_title'] + '.css</h3><div style="padding:4px;line-height:125%;"><pre>' + json['change_data_content'] + '</pre></div>' + _qb;
}
else
{
content = '<h3>'+ _text + ': ' + json['change_data_group'] + ' &gt; ' + json['change_data_title'] + '</h3><div style="padding:4px;line-height:125%;"><pre>' + json['change_data_content'] + '</pre></div>' + _qb;
}
max = document.viewport.getHeight();
max = ( max < 600 ) ? max : 600;
IPB3TemplateDiffResults.popUps['preview-' + changeId ] = new ipb.Popup('diffPopUp', { type: 'pane', modal: false, hideAtStart: true, w: '800px', h: max + 'px', initial: content } );
IPB3TemplateDiffResults.popUps['preview-' + changeId ].show();
/* Observe */
if ( type == 'merge' )
{
$('mergeResolveCustom').observe( 'click', IPB3TemplateDiffResults.resolveAllSingle );
$('mergeResolveNew').observe( 'click', IPB3TemplateDiffResults.resolveAllSingle );
$('mergeEditCustom').observe( 'click', IPB3TemplateDiffResults.goEdit );
}
}
},
onFailure: function()
{
return false;
},
onException: function()
{
return false;
}
} );
};
/**
* View diff preview
*/
this.editBit = function( changeId )
{
/* Grab it via ajax */
var _url = ipb.vars['base_url'] + "&app=core&module=ajax&section=templatediff&do=editDiff&change_id=" + changeId + '&secure_key=' + ipb.vars['md5_hash'];
new Ajax.Request( _url,
{
method: 'get',
onSuccess: function (t)
{
/* Not a JSON response? */
if ( ! t.responseText.match( /^(\s+?)?\{/ ) )
{
alert( ipb.lang['sk_error'] + t.responseText );
return;
}
/* Process results */
eval( "var json = " + t.responseText );
if ( json['error'] )
{
alert( ipb.lang['sk_error'] + json['error'] );
return false;
}
/* otherwise... */
if ( json['change_merge_content'] )
{
/* Ok, for some reason Safari (and possibly others) doesn't show the pop-up when viewing a
template bit. I presume it's because prototype/javascript will not insert invalid HTML into a node even
though it's encoded properly. After a few days working on merge, this is a quick hack to get it done
Force a 750px div in to position pop-up correctly on the screen, then once the pop-up has been created
shove the content in.
<3 javascript */
var _tmp = Math.floor( Math.random() * 1001 );
_qb = "<div style='float:left; margin-top:6px'><input type='button' id='mergeResolveCustom_" + _tmp + "' class='button __rc" + changeId + "' value='Решить все: в пользу пользовательских изменений' />&nbsp;<input type='button' id='mergeResolveNew_" + _tmp + "' class='button __rn" + changeId + "' value='Решить все: в пользу новых изменений' /></div>";
_tb = '<textarea name="content" id="mergeContent" style="width:100%; height:700px; line-height:150%">' + json['change_merge_content'] + '</textarea>' + _qb + '<div style="text-align:right" class="acp-actionbar"><input type="button" id="mergeSubmit" value="Сохранить" class="button primary __i' + changeId + '" /></div>';
if ( json['change_data_type'] == 'css' )
{
content = '<h3>' + json['change_data_title'] + '.css' + '</h3><div style="padding:4px;">' + _tb + '</div>';
}
else
{
content = '<h3>' + json['change_data_group'] + ' &gt; ' + json['change_data_title'] + '</h3><div style="padding:4px;">' + _tb + '</div>';
}
IPB3TemplateDiffResults.popUps['edit-' + changeId ] = new ipb.Popup('diffEditPopUp_' + _tmp, { type: 'pane', modal: false, hideAtStart: true, w: '800px', h: '600px', initial: '<div style="height:750px">&nbsp;</div>' } );
IPB3TemplateDiffResults.popUps['edit-' + changeId ].show();
$('diffEditPopUp_' + _tmp + '_inner').update( content );
/* Observe */
$('mergeSubmit').observe( 'click', IPB3TemplateDiffResults.saveEdit );
$('mergeResolveCustom_' + _tmp ).observe( 'click', IPB3TemplateDiffResults.resolveAllSingle );
$('mergeResolveNew_' + _tmp ).observe( 'click', IPB3TemplateDiffResults.resolveAllSingle );
}
},
onFailure: function()
{
return false;
},
onException: function()
{
return false;
}
} );
};
/**
* View diff preview
*/
this.goEdit = function(e)
{
elem = Event.element(e);
/* fetch ID */
var test = $( elem ).className.match('__re([0-9]+)');
if( test == null || Object.isUndefined( test ) ){ Debug.error("Error"); return; }
var changeId = test[1];
/* Close preview pop-up */
if ( IPB3TemplateDiffResults.popUps['preview-' + changeId ] )
{
IPB3TemplateDiffResults.popUps['preview-' + changeId ].hide();
}
/* Fire edit */
IPB3TemplateDiffResults.editBit( changeId );
};
/**
* View diff preview
*/
this.resolveAllSingle = function(e)
{
elem = Event.element(e);
var _type = '';
/* fetch ID */
if ( $( elem ).className.match( /__rc/ ) )
{
var test = $( elem ).className.match('__rc([0-9]+)');
if( test == null || Object.isUndefined( test ) ){ Debug.error("Error"); return; }
_type = 'custom';
}
else
{
var test = $( elem ).className.match('__rn([0-9]+)');
if( test == null || Object.isUndefined( test ) ){ Debug.error("Error"); return; }
_type = 'new';
}
var changeId = test[1];
/* Grab it via ajax */
var _url = ipb.vars['base_url'] + "&app=core&module=ajax&section=templatediff&do=resolveAllSingle&change_id=" + changeId + '&type=' + _type + '&secure_key=' + ipb.vars['md5_hash'];
new Ajax.Request( _url,
{
method: 'get',
onSuccess: function (t)
{
if ( t.responseText.match( /^(\s+?)?\{/ ) )
{
eval( "var json = " + t.responseText );
if ( json['error'] )
{
alert( json['error'] );
return;
}
else
{
/* Close pop-up */
if ( IPB3TemplateDiffResults.popUps['edit-' + changeId ] )
{
IPB3TemplateDiffResults.popUps['edit-' + changeId ].hide();
}
if ( IPB3TemplateDiffResults.popUps['preview-' + changeId ] )
{
IPB3TemplateDiffResults.popUps['preview-' + changeId ].hide();
}
/* Update desc string */
$('mDesc-' + changeId).update( json['desc'] );
/* Hide merge available data */
$$('.__whenHasMerge' + changeId).each( function(m){
m.hide();
});
}
}
else
{
alert( "Ошибка: " + t.responseText );
}
},
onFailure: function()
{
return false;
},
onException: function()
{
return false;
}
} );
};
/**
* View diff preview
*/
this.saveEdit = function(e)
{
elem = Event.element(e);
/* fetch ID */
var test = $( elem ).className.match('__i([0-9]+)');
if( test == null || Object.isUndefined( test ) ){ Debug.error("Error"); return; }
var changeId = test[1];
var content = $('mergeContent').value;
/* Test to see if we've left in merge stuff */
if ( content.match( '<<<<<<<<<<' ) || content.match( '>>>>>>>>>' ) )
{
alert( 'Нельзя сохранить пока не будут устранены все конфликты' );
}
else
{
/* Fire it of to Ajaxia for central processing */
var url = ipb.vars['base_url'] + "&app=core&module=ajax&section=templatediff&do=saveEdit&change_id=" + changeId + '&secure_key=' + ipb.vars['md5_hash'];
/* Set up params */
var params = { 'content' : content };
new Ajax.Request( url.replace( /&amp;/g, '&' ),
{
method: 'POST',
parameters: params,
onSuccess: function (t )
{
if ( t.responseText.match( /^(\s+?)?\{/ ) )
{
eval( "var json = " + t.responseText );
if ( json['error'] )
{
alert( json['error'] );
return;
}
else
{
/* Close pop-up */
IPB3TemplateDiffResults.popUps['edit-' + changeId ].hide();
/* Update desc string */
$('mDesc-' + changeId).update( json['desc'] );
/* Hide merge available data */
$$('.__whenHasMerge' + changeId).each( function(m){
m.hide();
});
}
}
else
{
alert( "Ошибка: " + t.responseText );
}
},
onException: function( f,e ){ alert( "Исключение: " + e ); },
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ); }
} );
}
};
}
IPB3TemplateDiffResults.init();
@@ -1,43 +1,44 @@
/************************************************/
/* IPB3 Javascript */
/* -------------------------------------------- */
/* ips.global.js - Global functionality */
/* (c) IPS, Inc 2008 */
/* -------------------------------------------- */
/* Author: Rikki Tissier */
/************************************************/
ACPEasyLogo = {
init: function()
{
Debug.write("Initializing acp.easylogo.js");
document.observe("dom:loaded", function(){
$('skin').observe( "change", ACPEasyLogo.resetMacro );
});
},
resetMacro: function(e)
{
var value = $F('skin');
//Get hits
new Ajax.Request(
ipb.vars['base_url'] + "app=core&module=ajax&section=replacements&do=retrieve&secure_key=" + ipb.vars['md5_hash'] + "&value=" + value ,
{
method: 'get',
evalJSON: 'force',
onSuccess: function(t){
if ( t.responseJSON['url'] )
{
$('logo_url').value = t.responseJSON['url'];
$('replacementId').value = t.responseJSON['id'];
}
}
}
);
return false;
}
}
/************************************************/
/* IPB3 Javascript */
/* -------------------------------------------- */
/* ips.global.js - Global functionality */
/* (c) IPS, Inc 2008 */
/* -------------------------------------------- */
/* Author: Rikki Tissier */
/************************************************/
ACPEasyLogo = {
init: function()
{
Debug.write("Initializing acp.easylogo.js");
document.observe("dom:loaded", function(){
$('skin').observe( "change", ACPEasyLogo.resetMacro );
});
},
resetMacro: function(e)
{
var value = $F('skin');
//Get hits
new Ajax.Request(
ipb.vars['base_url'] + "app=core&module=ajax&section=replacements&do=retrieve&secure_key=" + ipb.vars['md5_hash'] + "&value=" + value ,
{
method: 'get',
evalJSON: 'force',
onSuccess: function(t){
if ( t.responseJSON['url'] )
{
$('logo_url').value = t.responseJSON['url'];
$('replacementId').value = t.responseJSON['id'];
}
}
}
);
return false;
}
};
ACPEasyLogo.init();
@@ -1,35 +1,31 @@
/************************************************/
/* IPB3 Javascript */
/* -------------------------------------------- */
/* acp.homepage.js - Homepage javascript */
/* (c) IPS, Inc 2008 */
/* -------------------------------------------- */
/* Author: Brandon Farber */
/************************************************/
ACPHomepage = {
/*------------------------------*/
/* Constructor */
init: function()
{
Debug.write("Initializing acp.homepage.js");
document.observe("dom:loaded", function(){
ACPHomepage.autoComplete = new ipb.Autocomplete( $('members_display_name'), { multibox: false, url: acp.autocompleteUrl, templates: { wrap: acp.autocompleteWrap, item: acp.autocompleteItem } } );
});
},
editMember: function()
{
if ( $('members_display_name').value == "" )
{
alert("Нужно ввести имя пользователя!");
return false;
}
return true;
}
};
/************************************************/
/* IPB3 Javascript */
/* -------------------------------------------- */
/* acp.homepage.js - Homepage javascript */
/* (c) IPS, Inc 2008 */
/* -------------------------------------------- */
/* Author: Brandon Farber */
/************************************************/
ACPHomepage = {
/*------------------------------*/
/* Constructor */
init: function()
{
Debug.write("Initializing acp.homepage.js");
},
editMember: function()
{
if ( $('members_display_name').value == "" )
{
alert("Нужно ввести имя пользователя!");
return false;
}
return true;
}
};
ACPHomepage.init();
+10 -1
View File
@@ -1 +1,10 @@
<html>␍<head><title>IP.Board - Bulletin Board System</title></head>␍<body>␍<h1>403: IP.Board -> Forbidden</h1>␍<hr>␍You have reached this page in error, please use your back button to return to the forum.␍<hr>␍<a href="http://www.invisionboard.com/">IP.Board</a>␍</body>␍</html>␍
<html>
<head><title>IP.Board - Bulletin Board System</title></head>
<body>
<h1>403: IP.Board -&gt; Forbidden</h1>
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionboard.com/">IP.Board</a>
</body>
</html>
+18 -19
View File
@@ -51,7 +51,7 @@ function IPBCSS()
{
/* Build CSS list */
this.buildCSSList();
}
};
/**
* Load css groups
@@ -88,10 +88,10 @@ function IPBCSS()
alert( "Ooops. Something went wrong. Does this help?: " + t.responseText );
}
},
onException: function( f,e ){ alert( "Исключение: " + e ) },
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ) }
onException: function( f,e ){ alert( "Исключение: " + e ); },
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ); }
} );
}
};
/**
* Save CSS
@@ -146,10 +146,10 @@ function IPBCSS()
alert( "Галектеко ОПАСНОСТЕ! ПЫЩПЫЩ!11: " + t.responseText );
}
},
onException: function( f,e ){ alert( "Исключение: " + e ) },
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ) }
onException: function( f,e ){ alert( "Исключение: " + e ); },
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ); }
} );
}
};
/**
* Revert css
@@ -205,10 +205,10 @@ function IPBCSS()
alert( "Галектеко ОПАСНОСТЕ! ПЫЩПЫЩ!11: " + t.responseText );
}
},
onException: function( f,e ){ alert( "Исключение: " + e ) },
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ) }
onException: function( f,e ){ alert( "Исключение: " + e ); },
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ); }
} );
}
};
/**
* Load template bits
@@ -242,10 +242,10 @@ function IPBCSS()
alert( "Галектеко ОПАСНОСТЕ! ПЫЩПЫЩ!11: " + t.responseText );
}
},
onException: function( f,e ){ alert( "Исключение: " + e ) },
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ) }
onException: function( f,e ){ alert( "Исключение: " + e ); },
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ); }
} );
}
};
/**
* Add CSS form
@@ -253,7 +253,7 @@ function IPBCSS()
this.addCSSForm = function()
{
IPB3CSS.showCSSEditor( { 'cssData' : { 'css_id' : 0, 'css_group' : '', 'css_content' : '', 'css_added_to' : 0, '_type' : 'new' } } );
}
};
/**
* Shows the template editor
@@ -279,7 +279,7 @@ function IPBCSS()
}
ipb.positionCenter( 'tplate_editor_' + json['cssData']['css_id'] );
}
};
/**
* Shows the template editor
@@ -298,7 +298,7 @@ function IPBCSS()
catch(e)
{
}
}
};
/**
* Build a list of CSS groups (files)
@@ -374,7 +374,7 @@ function IPBCSS()
}
}
} );
}
};
/**
* Template Mouse Event
@@ -407,6 +407,5 @@ function IPBCSS()
}
}
}
}
};
}
+274 -206
View File
@@ -1,207 +1,275 @@
function addAnotherFile()
{
elementIndex = parseInt(elementIndex) + 1;
var list = new Element( 'ul', { 'id': 'fileTable_' + elementIndex } );
list.addClassName( 'acp-form' );
list.addClassName( 'alternate_rows' );
$('fileTableContainer').insert( list );
var li1 = new Element( 'li' ).update( "<label>" + ipb.lang['hook_filename'] + "</label><input type='text' name='file[" + elementIndex + "]' value='' size='50' class='inputtext' />" );
var li2 = new Element( 'li' ).update( "<label>" + ipb.lang['hook_classname'] + "</label><input type='text' name='hook_classname[" + elementIndex + "]' value='' size='50' class='inputtext' />" );
var li3 = new Element( 'li' ).update( "<label>" + ipb.lang['hook_filetype'] + "</label><select name='hook_type[" + elementIndex + "]' id='hook_type[" + elementIndex + "]' onchange='selectHookType(" + elementIndex + ");'><option value='0'>" + ipb.lang['hook_filetype_select'] + "</option><option value='commandHooks'>" + ipb.lang['hook_filetype_action'] + "</option><option value='skinHooks'>" + ipb.lang['hook_filetype_skin'] + "</option><option value='templateHooks'>" + ipb.lang['hook_filetype_template'] + "</option></select>" );
$('fileTable_' + elementIndex).insert( li1 );
$('fileTable_' + elementIndex).insert( li2 );
$('fileTable_' + elementIndex).insert( li3 );
}
function selectHookType( elementIndex )
{
var type = $F('hook_type[' + elementIndex + ']');
if( $('tr_classToOverload[' + elementIndex + ']') != null )
{
$('tr_classToOverload[' + elementIndex + ']').remove();
}
if( $('tr_skinGroup[' + elementIndex + ']') != null )
{
$('tr_skinGroup[' + elementIndex + ']').remove();
}
if( $('tr_skinFunction[' + elementIndex + ']') != null )
{
$('tr_skinFunction[' + elementIndex + ']').remove();
}
if( $('tr_type[' + elementIndex + ']') != null )
{
$('tr_type[' + elementIndex + ']').remove();
}
if( $('tr_id[' + elementIndex + ']') != null )
{
$('tr_id[' + elementIndex + ']').remove();
}
if( $('tr_position[' + elementIndex + ']') != null )
{
$('tr_position[' + elementIndex + ']').remove();
}
if( type == 'templateHooks' )
{
// Show the skin dropdown now
url = ipb.vars['base_url'] + "app=core&amp;module=ajax&amp;section=hooks&amp;do=getGroupsForAdd&amp;secure_key=" + ipb.vars['md5_hash'] + "&i=" + elementIndex;
url = url.replace( /&amp;/g, '&' );
new Ajax.Request( url,
{
method: 'GET',
onSuccess: function (t )
{
li1 = new Element( 'li', { 'id': 'tr_skinGroup[' + elementIndex + ']' } ).update( "<label>" + ipb.lang['hook_skingroup'] + "</label>" + t.responseText );
$('fileTable_' + elementIndex).insert( li1 );
},
onException: function( f,e ){ alert( "Exception: " + e ) },
onFailure: function( t ){ alert( "Failure: " + t.responseText ) }
} );
}
else if( type != '0' )
{
// Show the classToOverload field
var li1 = new Element( 'li', { 'id': 'tr_classToOverload[' + elementIndex + ']' } ).update( "<label>" + ipb.lang['hook_extends'] + "</label><input type='text' name='classToOverload[" + elementIndex + "]' value='' size='50' class='inputtext' />" );
$('fileTable_' + elementIndex).insert( li1 );
}
}
function getTemplatesForAdd( elementIndex )
{
var type = $F('skinGroup[' + elementIndex + ']');
if( $('tr_skinFunction[' + elementIndex + ']') != null )
{
$('tr_skinFunction[' + elementIndex + ']').remove();
}
if( $('tr_type[' + elementIndex + ']') != null )
{
$('tr_type[' + elementIndex + ']').remove();
}
if( $('tr_id[' + elementIndex + ']') != null )
{
$('tr_id[' + elementIndex + ']').remove();
}
if( $('tr_position[' + elementIndex + ']') != null )
{
$('tr_position[' + elementIndex + ']').remove();
}
url = ipb.vars['base_url'] + "app=core&amp;module=ajax&amp;section=hooks&amp;do=getTemplatesForAdd&amp;secure_key=" + ipb.vars['md5_hash'] + "&i=" + elementIndex + "&group=" + type;
url = url.replace( /&amp;/g, '&' );
new Ajax.Request( url,
{
method: 'GET',
onSuccess: function (t )
{
li1 = new Element( 'li', { 'id': 'tr_skinFunction[' + elementIndex + ']' } ).update( "<label>" + ipb.lang['hook_skinfunc'] + "</label>" + t.responseText );
$('fileTable_' + elementIndex).insert( li1 );
},
onException: function( f,e ){ alert( "Exception: " + e ) },
onFailure: function( t ){ alert( "Failure: " + t.responseText ) }
} );
}
function getTypeOfHook( elementIndex )
{
var type = $F('skinFunction[' + elementIndex + ']');
if( $('tr_type[' + elementIndex + ']') != null )
{
$('tr_type[' + elementIndex + ']').remove();
}
if( $('tr_id[' + elementIndex + ']') != null )
{
$('tr_id[' + elementIndex + ']').remove();
}
if( $('tr_position[' + elementIndex + ']') != null )
{
$('tr_position[' + elementIndex + ']').remove();
}
li1 = new Element( 'li', { 'id': 'tr_type[' + elementIndex + ']' } ).update( "<label>" + ipb.lang['hook_temptype'] + "</label><select name='type[" + elementIndex + "]' id='type[" + elementIndex + "]' onchange='getHookIds(" + elementIndex + ");'><option value='0'>" + ipb.lang['hook_filetype_select'] + "</option><option value='foreach'>foreach loop</option><option value='if'>if statement</option></select>" );
$('fileTable_' + elementIndex).insert( li1 );
}
function getHookIds( elementIndex )
{
var template = $F('skinFunction[' + elementIndex + ']');
var type = $F('type[' + elementIndex + ']');
if( $('tr_id[' + elementIndex + ']') != null )
{
$('tr_id[' + elementIndex + ']').remove();
}
if( $('tr_position[' + elementIndex + ']') != null )
{
$('tr_position[' + elementIndex + ']').remove();
}
url = ipb.vars['base_url'] + "app=core&amp;module=ajax&amp;section=hooks&amp;do=getHookIds&amp;secure_key=" + ipb.vars['md5_hash'] + "&i=" + elementIndex + "&type=" + type + "&template=" + template;
url = url.replace( /&amp;/g, '&' );
new Ajax.Request( url,
{
method: 'GET',
onSuccess: function (t )
{
li1 = new Element( 'li', { 'id': 'tr_id[' + elementIndex + ']' } ).update( "<label>" + ipb.lang['hook_hookid'] + "</label>" + t.responseText );
$('fileTable_' + elementIndex).insert( li1 );
},
onException: function( f,e ){ alert( "Exception: " + e ) },
onFailure: function( t ){ alert( "Failure: " + t.responseText ) }
} );
}
function getHookEntryPoints( elementIndex )
{
var type = $F('type[' + elementIndex + ']');
if( $('tr_position[' + elementIndex + ']') != null )
{
$('tr_position[' + elementIndex + ']').remove();
}
var options = '';
options += "<option value='0'>" + ipb.lang['hook_filetype_select'] + "</option>";
if( type == 'foreach' )
{
options += "<option value='outer.pre'>(outer.pre) " + ipb.lang['a_outerpre'] + "</option>";
options += "<option value='inner.pre'>(inner.pre) " + ipb.lang['a_innerpre'] + "</option>";
options += "<option value='inner.post'>(inner.post) " + ipb.lang['a_innerpost']+ "</option>";
options += "<option value='outer.post'>(outer.post) " + ipb.lang['a_outerpost']+ "</option>";
}
else
{
options += "<option value='pre.startif'>(pre.startif) " + ipb.lang['a_prestartif'] + "</option>";
options += "<option value='post.startif'>(post.startif) " + ipb.lang['a_poststartif'] + "</option>";
options += "<option value='pre.else'>(pre.else) " + ipb.lang['a_preelse'] + "</option>";
options += "<option value='post.else'>(post.else) " + ipb.lang['a_postelse'] + "</option>";
options += "<option value='pre.endif'>(pre.endif) " + ipb.lang['a_preendif'] + "</option>";
options += "<option value='post.endif'>(post.endif) " + ipb.lang['a_postendif'] + "</option>";
}
var li1 = new Element( 'li', { 'id': 'tr_position[' + elementIndex + ']' } ).update( "<label>" + ipb.lang['hook_temptype'] + "</label><select name='position[" + elementIndex + "]' id='position[" + elementIndex + "]'>" + options + "</select>" );
$('fileTable_' + elementIndex).insert( li1 );
function addAnotherFile()
{
elementIndex = parseInt(elementIndex) + 1;
var header = new Element( 'div', { 'class': 'tablesubheader' } );
header.update( ipb.lang['hookfilenumber'] + elementIndex );
var list = new Element( 'ul', { 'id': 'fileTable_' + elementIndex } );
list.addClassName( 'acp-form' );
list.addClassName( 'alternate_rows' );
$('fileTableContainer').insert( header );
$('fileTableContainer').insert( list );
var li1 = new Element( 'li' ).update( "<label>" + ipb.lang['hook_filename'] + "</label><input type='text' name='file[" + elementIndex + "]' value='' size='50' class='inputtext' />" );
var li2 = new Element( 'li' ).update( "<label>" + ipb.lang['hook_classname'] + "</label><input type='text' name='hook_classname[" + elementIndex + "]' value='' size='50' class='inputtext' />" );
var li3 = new Element( 'li' ).update( "<label>" + ipb.lang['hook_filetype'] + "</label><select name='hook_type[" + elementIndex + "]' id='hook_type[" + elementIndex + "]' onchange='selectHookType(" + elementIndex + ");'><option value='0'>" + ipb.lang['hook_filetype_select'] + "</option><option value='commandHooks'>" + ipb.lang['hook_filetype_action'] + "</option><option value='skinHooks'>" + ipb.lang['hook_filetype_skin'] + "</option><option value='templateHooks'>" + ipb.lang['hook_filetype_template'] + "</option><option value='dataHooks'>" + ipb.lang['hook_filetype_data'] + "</option><option value='libraryHooks'>" + ipb.lang['hook_filetype_library'] + "</option></select>" );
$('fileTable_' + elementIndex).insert( li1 );
$('fileTable_' + elementIndex).insert( li2 );
$('fileTable_' + elementIndex).insert( li3 );
doStriping();
}
function selectHookType( elementIndex )
{
var type = $F('hook_type[' + elementIndex + ']');
if( $('tr_classToOverload[' + elementIndex + ']') != null )
{
$('tr_classToOverload[' + elementIndex + ']').remove();
}
if( $('tr_skinGroup[' + elementIndex + ']') != null )
{
$('tr_skinGroup[' + elementIndex + ']').remove();
}
if( $('tr_skinFunction[' + elementIndex + ']') != null )
{
$('tr_skinFunction[' + elementIndex + ']').remove();
}
if( $('tr_type[' + elementIndex + ']') != null )
{
$('tr_type[' + elementIndex + ']').remove();
}
if( $('tr_id[' + elementIndex + ']') != null )
{
$('tr_id[' + elementIndex + ']').remove();
}
if( $('tr_position[' + elementIndex + ']') != null )
{
$('tr_position[' + elementIndex + ']').remove();
}
if( $('tr_dataLocation[' + elementIndex + ']') != null )
{
$('tr_dataLocation[' + elementIndex + ']').remove();
}
if( $('tr_libApplication[' + elementIndex + ']') != null )
{
$('tr_libApplication[' + elementIndex + ']').remove();
}
if( type == 'templateHooks' )
{
// Show the skin dropdown now
url = ipb.vars['base_url'] + "app=core&amp;module=ajax&amp;section=hooks&amp;do=getGroupsForAdd&amp;secure_key=" + ipb.vars['md5_hash'] + "&i=" + elementIndex;
url = url.replace( /&amp;/g, '&' );
new Ajax.Request( url,
{
method: 'GET',
onSuccess: function (t )
{
li1 = new Element( 'li', { 'id': 'tr_skinGroup[' + elementIndex + ']' } ).update( "<label>" + ipb.lang['hook_skingroup'] + "</label>" + t.responseText );
$('fileTable_' + elementIndex).insert( li1 );
doStriping();
},
onException: function( f,e ){ alert( "Exception: " + e ); },
onFailure: function( t ){ alert( "Failure: " + t.responseText ); }
} );
}
else if( type == 'dataHooks' )
{
// Show the data location dropdown now
url = ipb.vars['base_url'] + "app=core&amp;module=ajax&amp;section=hooks&amp;do=getDataLocationsForAdd&amp;secure_key=" + ipb.vars['md5_hash'] + "&i=" + elementIndex;
url = url.replace( /&amp;/g, '&' );
new Ajax.Request( url,
{
method: 'GET',
onSuccess: function (t )
{
li1 = new Element( 'li', { 'id': 'tr_dataLocation[' + elementIndex + ']' } ).update( "<label>" + ipb.lang['hook_data_location'] + "</label>" + t.responseText );
$('fileTable_' + elementIndex).insert( li1 );
doStriping();
},
onException: function( f,e ){ alert( "Exception: " + e ); },
onFailure: function( t ){ alert( "Failure: " + t.responseText ); }
} );
}
else if( type == 'libraryHooks' )
{
var li1 = new Element( 'li', { 'id': 'tr_classToOverload[' + elementIndex + ']' } ).update( "<label>" + ipb.lang['hook_extends'] + "</label><input type='text' name='classToOverload[" + elementIndex + "]' value='' size='50' class='inputtext' />" );
$('fileTable_' + elementIndex).insert( li1 );
// Show the data location dropdown now
url = ipb.vars['base_url'] + "app=core&amp;module=ajax&amp;section=hooks&amp;do=getApplications&amp;secure_key=" + ipb.vars['md5_hash'] + "&i=" + elementIndex;
url = url.replace( /&amp;/g, '&' );
new Ajax.Request( url,
{
method: 'GET',
onSuccess: function (t )
{
li1 = new Element( 'li', { 'id': 'tr_libApplication[' + elementIndex + ']' } ).update( "<label>" + ipb.lang['hook_application'] + "</label>" + t.responseText );
$('fileTable_' + elementIndex).insert( li1 );
doStriping();
},
onException: function( f,e ){ alert( "Exception: " + e ); },
onFailure: function( t ){ alert( "Failure: " + t.responseText ); }
} );
}
else if( type != '0' )
{
// Show the classToOverload field
var li1 = new Element( 'li', { 'id': 'tr_classToOverload[' + elementIndex + ']' } ).update( "<label>" + ipb.lang['hook_extends'] + "</label><input type='text' name='classToOverload[" + elementIndex + "]' value='' size='50' class='inputtext' />" );
$('fileTable_' + elementIndex).insert( li1 );
}
}
function getTemplatesForAdd( elementIndex )
{
var type = $F('skinGroup[' + elementIndex + ']');
if( $('tr_skinFunction[' + elementIndex + ']') != null )
{
$('tr_skinFunction[' + elementIndex + ']').remove();
}
if( $('tr_type[' + elementIndex + ']') != null )
{
$('tr_type[' + elementIndex + ']').remove();
}
if( $('tr_id[' + elementIndex + ']') != null )
{
$('tr_id[' + elementIndex + ']').remove();
}
if( $('tr_position[' + elementIndex + ']') != null )
{
$('tr_position[' + elementIndex + ']').remove();
}
url = ipb.vars['base_url'] + "app=core&amp;module=ajax&amp;section=hooks&amp;do=getTemplatesForAdd&amp;secure_key=" + ipb.vars['md5_hash'] + "&i=" + elementIndex + "&group=" + type;
url = url.replace( /&amp;/g, '&' );
new Ajax.Request( url,
{
method: 'GET',
onSuccess: function (t )
{
li1 = new Element( 'li', { 'id': 'tr_skinFunction[' + elementIndex + ']' } ).update( "<label>" + ipb.lang['hook_skinfunc'] + "</label>" + t.responseText );
$('fileTable_' + elementIndex).insert( li1 );
doStriping();
},
onException: function( f,e ){ alert( "Exception: " + e ); },
onFailure: function( t ){ alert( "Failure: " + t.responseText ); }
} );
}
function getTypeOfHook( elementIndex )
{
var type = $F('skinFunction[' + elementIndex + ']');
if( $('tr_type[' + elementIndex + ']') != null )
{
$('tr_type[' + elementIndex + ']').remove();
}
if( $('tr_id[' + elementIndex + ']') != null )
{
$('tr_id[' + elementIndex + ']').remove();
}
if( $('tr_position[' + elementIndex + ']') != null )
{
$('tr_position[' + elementIndex + ']').remove();
}
li1 = new Element( 'li', { 'id': 'tr_type[' + elementIndex + ']' } ).update( "<label>" + ipb.lang['hook_temptype'] + "</label><select name='type[" + elementIndex + "]' id='type[" + elementIndex + "]' onchange='getHookIds(" + elementIndex + ");'><option value='0'>" + ipb.lang['hook_filetype_select'] + "</option><option value='foreach'>foreach loop</option><option value='if'>if statement</option></select>" );
$('fileTable_' + elementIndex).insert( li1 );
doStriping();
}
function getHookIds( elementIndex )
{
var template = $F('skinFunction[' + elementIndex + ']');
var type = $F('type[' + elementIndex + ']');
if( $('tr_id[' + elementIndex + ']') != null )
{
$('tr_id[' + elementIndex + ']').remove();
}
if( $('tr_position[' + elementIndex + ']') != null )
{
$('tr_position[' + elementIndex + ']').remove();
}
url = ipb.vars['base_url'] + "app=core&amp;module=ajax&amp;section=hooks&amp;do=getHookIds&amp;secure_key=" + ipb.vars['md5_hash'] + "&i=" + elementIndex + "&type=" + type + "&template=" + template;
url = url.replace( /&amp;/g, '&' );
new Ajax.Request( url,
{
method: 'GET',
onSuccess: function (t )
{
li1 = new Element( 'li', { 'id': 'tr_id[' + elementIndex + ']' } ).update( "<label>" + ipb.lang['hook_hookid'] + "</label>" + t.responseText );
$('fileTable_' + elementIndex).insert( li1 );
doStriping();
},
onException: function( f,e ){ alert( "Exception: " + e ); },
onFailure: function( t ){ alert( "Failure: " + t.responseText ); }
} );
}
function getHookEntryPoints( elementIndex )
{
var type = $F('type[' + elementIndex + ']');
if( $('tr_position[' + elementIndex + ']') != null )
{
$('tr_position[' + elementIndex + ']').remove();
}
var options = '';
options += "<option value='0'>" + ipb.lang['hook_filetype_select'] + "</option>";
if( type == 'foreach' )
{
options += "<option value='outer.pre'>(outer.pre) " + ipb.lang['a_outerpre'] + "</option>";
options += "<option value='inner.pre'>(inner.pre) " + ipb.lang['a_innerpre'] + "</option>";
options += "<option value='inner.post'>(inner.post) " + ipb.lang['a_innerpost']+ "</option>";
options += "<option value='outer.post'>(outer.post) " + ipb.lang['a_outerpost']+ "</option>";
}
else
{
options += "<option value='pre.startif'>(pre.startif) " + ipb.lang['a_prestartif'] + "</option>";
options += "<option value='post.startif'>(post.startif) " + ipb.lang['a_poststartif'] + "</option>";
options += "<option value='pre.else'>(pre.else) " + ipb.lang['a_preelse'] + "</option>";
options += "<option value='post.else'>(post.else) " + ipb.lang['a_postelse'] + "</option>";
options += "<option value='pre.endif'>(pre.endif) " + ipb.lang['a_preendif'] + "</option>";
options += "<option value='post.endif'>(post.endif) " + ipb.lang['a_postendif'] + "</option>";
}
var li1 = new Element( 'li', { 'id': 'tr_position[' + elementIndex + ']' } ).update( "<label>" + ipb.lang['hook_tempposi'] + "</label><select name='position[" + elementIndex + "]' id='position[" + elementIndex + "]'>" + options + "</select>" );
$('fileTable_' + elementIndex).insert( li1 );
doStriping();
}
@@ -51,7 +51,7 @@ function IPBReplacements()
{
/* Build Replacements list */
this.buildReplacementsList();
}
};
/**
* Load css groups
@@ -88,10 +88,10 @@ function IPBReplacements()
alert( "Ooops. Something went wrong. Does this help?: " + t.responseText );
}
},
onException: function( f,e ){ alert( "Exception: " + e ) },
onFailure: function( t ){ alert( "Failure: " + t.responseText ) }
onException: function( f,e ){ alert( "Exception: " + e ); },
onFailure: function( t ){ alert( "Failure: " + t.responseText ); }
} );
}
};
/**
* Save Replacements
@@ -144,10 +144,10 @@ function IPBReplacements()
alert( "Ooops. Something went wrong. Does this help?: " + t.responseText );
}
},
onException: function( f,e ){ alert( "Exception: " + e ) },
onFailure: function( t ){ alert( "Failure: " + t.responseText ) }
onException: function( f,e ){ alert( "Exception: " + e ); },
onFailure: function( t ){ alert( "Failure: " + t.responseText ); }
} );
}
};
/**
* Revert css
@@ -204,10 +204,10 @@ function IPBReplacements()
alert( "Ooops. Something went wrong. Does this help?: " + t.responseText );
}
},
onException: function( f,e ){ alert( "Exception: " + e ) },
onFailure: function( t ){ alert( "Failure: " + t.responseText ) }
onException: function( f,e ){ alert( "Exception: " + e ); },
onFailure: function( t ){ alert( "Failure: " + t.responseText ); }
} );
}
};
/**
* Add Replacements form
@@ -215,7 +215,7 @@ function IPBReplacements()
this.addReplacementsForm = function()
{
IPB3Replacements.showReplacementsEditor( 0 );
}
};
/**
* Shows the template editor
@@ -263,7 +263,7 @@ function IPBReplacements()
}
ipb.positionCenter( 'tplate_editor_' + replacement_id );
}
};
/**
* Preview the replacement
@@ -301,7 +301,7 @@ function IPBReplacements()
document.body.appendChild( _div );
ipb.positionCenter( 'tplate_preview_' + _data['replacement_id'] );
}
};
/**
* Close Preview
@@ -315,7 +315,7 @@ function IPBReplacements()
catch(e)
{
}
}
};
/**
* Shows the template editor
@@ -334,7 +334,7 @@ function IPBReplacements()
catch(e)
{
}
}
};
/**
* Build a list of Replacements groups (files)
@@ -405,7 +405,7 @@ function IPBReplacements()
}
} );
}
};
/**
* Template Mouse Event
@@ -442,6 +442,5 @@ function IPBReplacements()
}
}
}
}
};
}
@@ -63,8 +63,11 @@ function IPBTemplateDiff()
/**
* URLS
*/
this.baseUrl = '';
this.imageUrl = '';
this.baseUrl = '';
this.baseUrlMerge = '';
this.imageUrl = '';
this.doneUrl = '';
this.currentAction = 'process';
/*
* Stored JSON
@@ -96,7 +99,7 @@ function IPBTemplateDiff()
this.beginDiff = function()
{
/* Start text output.. */
this.updateCounter( 0 );
this.updateCounter( '' );
/* Reset progress bar */
this.updateProgressBar( false );
@@ -106,7 +109,7 @@ function IPBTemplateDiff()
/* Start off with the SQL */
this.fireAjax( 0 );
}
};
/**
* Update the progress bar
@@ -170,9 +173,9 @@ function IPBTemplateDiff()
if ( IPB3TemplateDiff.currentImage != _img )
{
$( 'diffStatusImage' ).src = IPB3TemplateDiff.imageUrl + _img;
IPB3TemplateDiff.currentImage = _img;
IPB3TemplateDiff.currentImage = _img;
}
}
};
/**
* Fire Ajax
@@ -182,7 +185,7 @@ function IPBTemplateDiff()
/* Update image */
this.updateProgressImage( 'send' );
new Ajax.Request( this.baseUrl + '&do=process',
new Ajax.Request( this.baseUrl.replace( /&amp;/g, '&' ) + '&do=' + this.currentAction,
{
method: 'get',
onSuccess: this.processAjax.bind(this),
@@ -214,14 +217,14 @@ function IPBTemplateDiff()
*/
this.timeOutAjax = function( t )
{
if ( confirm( "No response from the webserver.\nDo you wish to continue waiting?" ) )
if ( confirm( "Нет ответа от сервера.\nХотите подождать?" ) )
{
return true;
}
else
{
t.transport.abort();
alert( "Request Cancelled" );
alert( "Запрос отменен" );
}
};
@@ -230,7 +233,7 @@ function IPBTemplateDiff()
*/
this.failureAjax = function( t )
{
alert( "Failure: " + t.responseText );
alert( "Ошибка: " + t.responseText );
};
/**
@@ -238,8 +241,8 @@ function IPBTemplateDiff()
*/
this.exceptionAjax = function( t )
{
alert( "Exception: " + t.responseText );
}
alert( "Исключение: " + t.responseText );
};
/**
* Process Ajax (Success)
@@ -252,7 +255,8 @@ function IPBTemplateDiff()
/* Not a JSON response? */
if ( ! t.responseText.match( /^(\s+?)?\{/ ) )
{
alert( "Error:\n" + t.responseText );
alert( "Ошибка:\n" + t.responseText );
Debug.write( t );
return;
}
@@ -261,16 +265,24 @@ function IPBTemplateDiff()
if ( json['error'] )
{
alert( "An error occured: " . json['error'] );
alert( "Ошибка: " . json['error'] );
return false;
}
/* All good: Update status message... */
this.updateCounter( json['processed'] );
this.updateCounter( json['title'], json['message'] );
/* Update progress bar */
this.updateProgressBar( json['processed'] );
if ( json['perGo'] )
{
this.baseUrl = this.baseUrl.replace( 'perGo=(\d+?)', 'perGo=' + json['perGo'] );
this.perGo = json['perGo'];
}
this.totalBits = json['totalBits'] ? json['totalBits'] : this.totalBits;
/* Finish? If so - say all done and go tubby-bye-bye */
if ( json['completed'] != 1 )
{
@@ -279,21 +291,33 @@ function IPBTemplateDiff()
}
else
{
/* All Done */
this.updateProgressBar( -1 );
this.updateProgressImage( 'ready' );
/* Diff? Then merge */
if ( this.currentAction == 'process' )
{
this.currentAction = 'merge';
this.perGo = 10;
this.baseUrl = this.baseUrl.replace( 'perGo=(\d+?)', 'perGo=' + this.perGo );
/* Go ahead */
this.beginDiff();
}
else
{
/* All Done */
this.updateProgressBar( -1 );
this.updateProgressImage( 'ready' );
/* Show done thing */
$( 'diffDone' ).show();
/* Show done thing */
window.location = this.doneUrl.replace( /&amp;/g, '&' );
}
}
};
/**
* Write to Log
*/
this.updateCounter = function( count )
this.updateCounter = function( title, msg )
{
$( 'diffLogProcessed' ).innerHTML = count;
$( 'diffLogTitle' ).update( title );
$( 'diffLogText' ).update( msg );
};
}
@@ -50,7 +50,7 @@ function IPBTemplateSandR()
{
cbox.checked = checked;
});
}
};
/**
* Check group check box
@@ -71,7 +71,7 @@ function IPBTemplateSandR()
});
$( 'cbox_group_' + groupName ).checked = ( _allCount == _checkedCount ) ? true : false;
}
};
/**
* Load template bits
@@ -105,10 +105,10 @@ function IPBTemplateSandR()
alert( "Галектеко ОПАСНОСТЕ! ПЫЩПЫЩ!11: " + t.responseText );
}
},
onException: function( f,e ){ alert( "Исключение: " + e ) },
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ) }
onException: function( f,e ){ alert( "Исключение: " + e ); },
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ); }
} );
}
};
/**
* Shows the template editor
@@ -128,7 +128,7 @@ function IPBTemplateSandR()
document.body.appendChild( _div );
ipb.positionCenter( 'tplate_editor_' + json['templateData']['template_id'] );
}
};
/**
* Peform the placements
@@ -175,10 +175,10 @@ function IPBTemplateSandR()
alert( "Галектеко ОПАСНОСТЕ! ПЫЩПЫЩ!11: " + t.responseText );
}
},
onException: function( f,e ){ alert( "Исключение: " + e ) },
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ) }
onException: function( f,e ){ alert( "Исключение: " + e ); },
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ); }
} );
}
};
/**
* Save template bit
@@ -201,7 +201,7 @@ function IPBTemplateSandR()
parameters: params,
onSuccess: function (t )
{
if ( t.responseText.match( /^(\s+?)?\{/ ) )
if ( t.responseText.match( /^(\s*?)?\{/ ) )
{
eval( "var json = " + t.responseText );
@@ -231,10 +231,10 @@ function IPBTemplateSandR()
alert( "Галектеко ОПАСНОСТЕ! ПЫЩПЫЩ!11: " + t.responseText );
}
},
onException: function( f,e ){ alert( "Исключение: " + e ) },
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ) }
//onException: function( f,e ){ alert( "Исключение: " + e ) },
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ); }
} );
}
};
/**
* Shows the template editor
@@ -248,7 +248,7 @@ function IPBTemplateSandR()
catch(e)
{
}
}
};
/**
* Build a list of template groups
@@ -389,5 +389,5 @@ function IPBTemplateSandR()
}
} );
}
}
};
}
@@ -66,7 +66,7 @@ function IPBTemplates()
$('tplate_bitList').setStyle( { 'height' : $('tplate_groupList').getHeight() + 'px', 'overflow' : 'auto'} );
this.loadTemplateBits( this.currentTemplateGroup );
}
};
/**
* Load template groups
@@ -103,13 +103,13 @@ function IPBTemplates()
}
else
{
alert( "Ooops. Something went wrong. Does this help?: " + t.responseText );
alert( "Ошибка: " + t.responseText );
}
},
onException: function( f,e ){ alert( "Exception: " + e ) },
onFailure: function( t ){ alert( "Failure: " + t.responseText ) }
onException: function( f,e ){ alert( "Исключение: " + e ); },
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ); }
} );
}
};
/**
* Load template bits
@@ -169,13 +169,13 @@ function IPBTemplates()
}
else
{
alert( "Ooops. Something went wrong. Does this help?: " + t.responseText );
alert( "Ошибка: " + t.responseText );
}
},
onException: function( f,e ){ alert( "Exception: " + e ) },
onFailure: function( t ){ alert( "Failure: " + t.responseText ) }
onException: function( f,e ){ alert( "Исключение: " + e ); },
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ); }
} );
}
};
/**
* Save template bit
@@ -222,23 +222,23 @@ function IPBTemplates()
if ( json['errors'] )
{
/* Something inline would be very nice here.. rather than this ugly alert */
alert("UGLY ALERT BOX SAYS: " + json['errors'] );
alert("Ошибка: " + json['errors'] );
}
else
{
alert("UGLY ALERT BOX SAYS: Saved!");
alert("Сохранено!");
}
}
}
else
{
alert( "Ooops. Something went wrong. Does this help?: " + t.responseText );
alert( "Ошибка: " + t.responseText );
}
},
onException: function( f,e ){ alert( "Exception: " + e ) },
onFailure: function( t ){ alert( "Failure: " + t.responseText ) }
onException: function( f,e ){ alert( "Исключение: " + e ); },
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ); }
} );
}
};
/**
* Revert template bit
@@ -248,14 +248,14 @@ function IPBTemplates()
/* Make sure we're mean it... */
if ( $('tplate_templaterow_' + template_id ).hasClassName( 'tplateRow_new') )
{
if ( ! confirm( "REMOVE template bit?\n This will remove this template bit in ALL skins!" ) )
if ( ! confirm( "Удалить шаблон?\n Произойдет удаление шаблона из ВСЕХ стилей!" ) )
{
return false;
}
}
else
{
if ( ! confirm( "Revert template bit?\n All changes WILL be lost!" ) )
if ( ! confirm( "Откатить изменения?\n Все изменения БУДУТ УТРАЧЕНЫ!" ) )
{
return false;
}
@@ -295,19 +295,19 @@ function IPBTemplates()
if ( json['errors'] )
{
/* Something inline would be very nice here.. rather than this ugly alert */
alert("UGLY ALERT BOX SAYS: " + json['errors'] );
alert("Ошибка: " + json['errors'] );
}
}
}
else
{
alert( "Ooops. Something went wrong. Does this help?: " + t.responseText );
alert( "Ошибка: " + t.responseText );
}
},
onException: function( f,e ){ alert( "Exception: " + e ) },
onFailure: function( t ){ alert( "Failure: " + t.responseText ) }
onException: function( f,e ){ alert( "Исключение: " + e ); },
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ); }
} );
}
};
/**
* Load template bits
@@ -338,13 +338,13 @@ function IPBTemplates()
}
else
{
alert( "Ooops. Something went wrong. Does this help?: " + t.responseText );
alert( "Ошибка: " + t.responseText );
}
},
onException: function( f,e ){ alert( "Exception: " + e ) },
onFailure: function( t ){ alert( "Failure: " + t.responseText ) }
onException: function( f,e ){ alert( "Исключение: " + e ); },
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ); }
} );
}
};
/**
* Shows the new template bit form
@@ -369,7 +369,7 @@ function IPBTemplates()
ipb.positionCenter( 'tplate_editor_0' );
IPB3Templates.currentTemplateBit = _data;
}
};
/**
* Shows the template editor
@@ -389,7 +389,7 @@ function IPBTemplates()
document.body.appendChild( _div );
ipb.positionCenter( 'tplate_editor_' + json['templateData']['template_id'] );
}
};
/**
* Shows the template editor
@@ -408,7 +408,7 @@ function IPBTemplates()
catch(e)
{
}
}
};
/**
* Shows a group entry as 'lit'
@@ -430,7 +430,7 @@ function IPBTemplates()
$('tplate_grouprow_' + templateGroup ).removeClassName( IPB3Templates.cssNames['groupRow'] );
$('tplate_grouprow_' + templateGroup ).addClassName( IPB3Templates.cssNames['groupRowLitMain'] );
$('tplate_grouprow_' + templateGroup ).addClassName( IPB3Templates.cssNames['groupRowLit'] );
}
};
/**
* Build a list of template groups
@@ -455,7 +455,7 @@ function IPBTemplates()
/* Write it out */
$('tplate_groupList').update( _output );
}
};
/**
* Build a list of template bits
@@ -520,8 +520,7 @@ function IPBTemplates()
$('tplate_templateRow_' + json['templates'][i]['template_id'] + '_revert').hide();
}
}
}
};
/**
* Template Mouse Event
@@ -554,7 +553,7 @@ function IPBTemplates()
}
}
}
}
};
/**
* Group Mouse Event
@@ -578,6 +577,5 @@ function IPBTemplates()
IPB3Templates.loadTemplateBits( _groupName );
}
}
};
}
@@ -52,7 +52,7 @@ function IPBUAgents()
{
/* Build uagents list */
this.buildUAgentsList();
}
};
/**
* INIT User Agent Form
@@ -79,7 +79,7 @@ function IPBUAgents()
/* Build uagents list that are already in the group */
this.buildGroupAgentsUsedList();
}
};
/**
* Save uagents
@@ -122,23 +122,23 @@ function IPBUAgents()
if ( json['errors'] )
{
/* Something inline would be very nice here.. rather than this ugly alert */
alert("UGLY ALERT BOX SAYS: " + json['errors'] );
alert("Ошибка: " + json['errors'] );
}
else
{
alert("UGLY ALERT BOX SAYS: Saved!");
alert("Сохранено!");
}
}
}
else
{
alert( "Ooops. Something went wrong. Does this help?: " + t.responseText );
alert( "Ошибка: " + t.responseText );
}
},
onException: function( f,e ){ alert( "Exception: " + e ) },
onFailure: function( t ){ alert( "Failure: " + t.responseText ) }
onException: function( f,e ){ alert( "Исключение: " + e ); },
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ); }
} );
}
};
/**
* Revert css
@@ -146,7 +146,7 @@ function IPBUAgents()
this.removeuAgent = function( uagent_id )
{
/* Make sure we're mean it... */
if ( ! confirm( "Remove user agent?\\nThis will be removed permanently" ) )
if ( ! confirm( "Удалить user agent?\\nОн будет удален полностью из системы" ) )
{
return false;
}
@@ -177,19 +177,19 @@ function IPBUAgents()
if ( json['errors'] )
{
/* Something inline would be very nice here.. rather than this ugly alert */
alert("UGLY ALERT BOX SAYS: " + json['errors'] );
alert("Ошибка: " + json['errors'] );
}
}
}
else
{
alert( "Ooops. Something went wrong. Does this help?: " + t.responseText );
alert( "Ошибка: " + t.responseText );
}
},
onException: function( f,e ){ alert( "Exception: " + e ) },
onFailure: function( t ){ alert( "Failure: " + t.responseText ) }
onException: function( f,e ){ alert( "Исключение: " + e ); },
onFailure: function( t ){ alert( "Ошибка: " + t.responseText ); }
} );
}
};
/**
* Add uagents form
@@ -197,7 +197,7 @@ function IPBUAgents()
this.adduAgentForm = function()
{
IPB3UAgents.showuAgentsEditor( 0 );
}
};
/**
* Shows the template editor
@@ -235,7 +235,7 @@ function IPBUAgents()
/* Adjust title */
if ( ! uagent_id )
{
$('tplate_title_' + uagent_id ).update("Adding User Agent");
$('tplate_title_' + uagent_id ).update("Добавление User Agent");
}
/* Select box type */
@@ -250,7 +250,7 @@ function IPBUAgents()
};
ipb.positionCenter( 'tplate_editor_' + uagent_id );
}
};
/**
* Close the editor
@@ -269,7 +269,7 @@ function IPBUAgents()
catch(e)
{
}
}
};
/**
* Build a list of uagents groups (files)
@@ -304,7 +304,7 @@ function IPBUAgents()
/* Image. Can't use #{...} inline as it parses as HTML entities. Most annoying */
$('tplate_img_' + json['uagents'][i]['uagent_id'] ).src += 'type_' + json['uagents'][i]['uagent_type'] + '.png';
} );
}
};
/**
* Template Mouse Event
@@ -337,7 +337,7 @@ function IPBUAgents()
}
}
}
}
};
/**
* Build a list of USED uagents
@@ -395,7 +395,7 @@ function IPBUAgents()
/* Update hidden field */
$('uAgentsData').value = Object.toJSON( _save );
}
};
/**
* Save user agent form
@@ -403,7 +403,7 @@ function IPBUAgents()
this.saveGroupForm = function()
{
$('uAgentsForm').submit();
}
};
/**
* Template Mouse Event
@@ -436,7 +436,7 @@ function IPBUAgents()
}
}
}
}
};
/**
* Close the editor
@@ -455,7 +455,7 @@ function IPBUAgents()
catch(e)
{
}
}
};
/**
* Shows the versions editor
@@ -483,7 +483,7 @@ function IPBUAgents()
document.body.appendChild( _div );
ipb.positionCenter( 'tplate_versions_' + uagent_id );
}
};
/**
* Save agent version info
@@ -498,7 +498,7 @@ function IPBUAgents()
/* Close any open editors */
IPB3UAgents.cancelAgentVersion();
}
};
/**
* Add user agent to the list
@@ -516,7 +516,7 @@ function IPBUAgents()
/* Build uagents list that are already in the group */
IPB3UAgents.buildGroupAgentsUsedList();
}
};
/**
* Add user agent to the list
@@ -535,7 +535,7 @@ function IPBUAgents()
/* Build uagents list that are already in the group */
IPB3UAgents.buildGroupAgentsUsedList();
}
};
/**
* Template Mouse Event
@@ -559,7 +559,7 @@ function IPBUAgents()
IPB3UAgents.groupAddToList( _uagent_id );
}
}
}
};
/**
* Build a list of uagents
@@ -599,6 +599,5 @@ function IPBUAgents()
$('tplate_agentimg_' + json['uagents'][i]['uagent_id'] ).src += 'type_' + json['uagents'][i]['uagent_type'] + '.png';
}
} );
}
};
}