Version 3.1.4
This commit is contained in:
1 parent
1d4720f3e2
commit
ae5c01cc78
2563 files changed
+283048
-240689
No files matched your search
+166
-74
@@ -33,6 +33,7 @@ _blog.prototype.blog = {
|
||||
},
|
||||
popups: {},
|
||||
cp1: null,
|
||||
blogs: {},
|
||||
|
||||
|
||||
/*------------------------------*/
|
||||
@@ -72,6 +73,9 @@ _blog.prototype.blog = {
|
||||
{
|
||||
$('comments').scrollTo();
|
||||
}
|
||||
|
||||
ipb.delegate.register(".__delete", ipb.blog.deleteDialogue );
|
||||
|
||||
});
|
||||
},
|
||||
|
||||
@@ -98,12 +102,6 @@ _blog.prototype.blog = {
|
||||
evalJSON: 'force',
|
||||
onSuccess: function(t)
|
||||
{
|
||||
if ( ! Object.isUndefined( t.responseJSON ) )
|
||||
{
|
||||
alert( ipb.lang['action_failed'] + ": " + t.responseJSON['error'] );
|
||||
return;
|
||||
}
|
||||
|
||||
$('recentajaxcontent').update( t.responseText );
|
||||
$('ratitle').update( newTitle );
|
||||
}
|
||||
@@ -111,64 +109,6 @@ _blog.prototype.blog = {
|
||||
|
||||
},
|
||||
|
||||
/* INIT Comment tracker button */
|
||||
setUpCommentNotification: function( memberId, trackerId, entryId )
|
||||
{
|
||||
if ( memberId )
|
||||
{
|
||||
if ( trackerId )
|
||||
{
|
||||
$('__commentTrack_on').hide();
|
||||
$('__commentTrack_off').show();
|
||||
|
||||
ipb.blog.cton = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$('__commentTrack_on').show();
|
||||
$('__commentTrack_off').hide();
|
||||
|
||||
ipb.blog.cton = false;
|
||||
}
|
||||
|
||||
$('__commentTrack_off').observe('click', ipb.blog.fireCommentTrackToggle.bindAsEventListener( this, entryId ) );
|
||||
$('__commentTrack_on').observe('click', ipb.blog.fireCommentTrackToggle.bindAsEventListener( this, entryId ) );
|
||||
}
|
||||
},
|
||||
|
||||
fireCommentTrackToggle: function( e, entryId )
|
||||
{
|
||||
Event.stop(e);
|
||||
ipb.blog.cton = ( ipb.blog.cton ) ? false : true;
|
||||
|
||||
var url = ipb.vars['base_url'] + "app=blog&module=ajax&section=comments&do=toggleTracker&blogid=" + ipb.blog.blogID + "&entry_id=" + entryId + "&md5check=" + ipb.vars['secure_hash'];
|
||||
|
||||
new Ajax.Request( url.replace(/&/g, '&'),
|
||||
{
|
||||
method: 'get',
|
||||
evalJSON: 'force',
|
||||
onSuccess: function(t)
|
||||
{
|
||||
if( !Object.isUndefined( t.responseJSON ) )
|
||||
{
|
||||
alert( ipb.lang['action_failed'] + ": " + t.responseJSON['error'] );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ipb.blog.cton )
|
||||
{
|
||||
$('__commentTrack_on').hide();
|
||||
$('__commentTrack_off').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
$('__commentTrack_on').show();
|
||||
$('__commentTrack_off').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/* INIT blogs as table */
|
||||
setUpBlogsAsTable: function()
|
||||
{
|
||||
@@ -317,14 +257,16 @@ _blog.prototype.blog = {
|
||||
|
||||
var _go = true;
|
||||
|
||||
if ( $F('formCatAddInput') )
|
||||
var newCatName = ipb.blog.cleanCategoryName($F('formCatAddInput'));
|
||||
|
||||
if (newCatName)
|
||||
{
|
||||
/* Already got a meow by this name? */
|
||||
if ( ipb.blog.currentCats.size() )
|
||||
{
|
||||
ipb.blog.currentCats.each( function( c )
|
||||
{
|
||||
if ( c.value['category_title'] == $F('formCatAddInput') )
|
||||
if ( c.value['category_title'] == newCatName )
|
||||
{
|
||||
alert( ipb.lang['blog_cat_exists'] );
|
||||
|
||||
@@ -338,7 +280,7 @@ _blog.prototype.blog = {
|
||||
{
|
||||
ipb.blog._newCats.each( function( t )
|
||||
{
|
||||
if ( t.value == $F('formCatAddInput') )
|
||||
if ( t.value == newCatName )
|
||||
{
|
||||
alert( ipb.lang['blog_cat_exists'] );
|
||||
|
||||
@@ -351,7 +293,7 @@ _blog.prototype.blog = {
|
||||
if ( _go == true )
|
||||
{
|
||||
var _id = 'catNew-' + parseInt( ipb.blog._newCats.size() + 1 );
|
||||
var _name = $F('formCatAddInput');
|
||||
var _name = newCatName;
|
||||
|
||||
ipb.blog._newCats.set( _id, { 'category_title' : _name, '_selected' : 1 } );
|
||||
|
||||
@@ -362,6 +304,26 @@ _blog.prototype.blog = {
|
||||
}
|
||||
},
|
||||
|
||||
cleanCategoryName: function(name)
|
||||
{
|
||||
name = name.replace(' ', ' ');
|
||||
name = name.replace("\r", '');
|
||||
name = name.replace("\n", '');
|
||||
|
||||
name = name.replace('&', '&');
|
||||
name = name.replace('<!--', '<!--');
|
||||
name = name.replace('-->', '-->');
|
||||
name = name.replace('<script', '<script');
|
||||
name = name.replace('>', '>');
|
||||
name = name.replace('<', '<');
|
||||
name = name.replace('"', '"');
|
||||
name = name.replace('$', '$');
|
||||
name = name.replace('!', '!');
|
||||
name = name.replace('\'', ''');
|
||||
|
||||
return name;
|
||||
},
|
||||
|
||||
/* Form INIT */
|
||||
initPostForm: function()
|
||||
{
|
||||
@@ -387,12 +349,12 @@ _blog.prototype.blog = {
|
||||
{
|
||||
if ( $('bfs_modOptions') && $F('bfs_modOptions') == 'published' )
|
||||
{
|
||||
$('bfs_submit').value = 'Publish Now';
|
||||
$('bfs_submit').value = ipb.lang['blog_publish_now'];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$('bfs_submit').value = 'Save Draft';
|
||||
$('bfs_submit').value = ipb.lang['blog_save_draft'];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -400,8 +362,49 @@ _blog.prototype.blog = {
|
||||
$('bf_modWrapper').hide();
|
||||
$('bf_timeOpts').hide();
|
||||
$('bf_timeOpts2').hide();
|
||||
|
||||
/* Blog choose */
|
||||
if ( $('blog_chooser') )
|
||||
{
|
||||
$('blog_chooser').observe( 'change', ipb.blog.pfBlogChooser.bindAsEventListener( this ) );
|
||||
}
|
||||
},
|
||||
|
||||
pfBlogChooser: function( e )
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
blogid = $('blog_chooser').options[ $('blog_chooser').selectedIndex ].value;
|
||||
|
||||
var url = ipb.vars['base_url'] + "app=blog&module=ajax&section=post&do=getdata&blogid=" + blogid + "&md5check=" + ipb.vars['secure_hash'];
|
||||
|
||||
new Ajax.Request( url.replace(/&/g, '&'),
|
||||
{
|
||||
method: 'get',
|
||||
evalJSON: 'force',
|
||||
onSuccess: function(t)
|
||||
{
|
||||
if ( Object.isUndefined( t.responseJSON ) )
|
||||
{
|
||||
alert( ipb.lang['action_failed'] + ": " + t.responseJSON['error'] );
|
||||
return;
|
||||
}
|
||||
|
||||
ipb.blog.currentCats = $H( t.responseJSON.cats );
|
||||
ipb.blog.currentTags = $H( t.responseJSON.tags );
|
||||
|
||||
ipb.blog.formInitCats(e);
|
||||
ipb.blog.formTogglePopularTags(e);
|
||||
|
||||
if ( ipb.blog.currentTags.size() < 1 )
|
||||
{
|
||||
$('tags_container').hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
pfTriggerSubmit: function( e, type )
|
||||
{
|
||||
Event.stop(e);
|
||||
@@ -509,7 +512,7 @@ _blog.prototype.blog = {
|
||||
$('theme_preview').observe('click', ipb.blog.previewTheme);
|
||||
$('theme_save').observe('click', ipb.blog.saveTheme);
|
||||
$('theme_color_picker').observe('click', ipb.blog.openPicker);
|
||||
}
|
||||
};
|
||||
|
||||
ipb.blog.popups['themes'] = new ipb.Popup('theme_editor', { type: 'pane', modal: false, hideAtStart: true, initial: ipb.templates['add_theme'] }, { afterInit: afterInit } );
|
||||
ipb.blog.popups['themes'].show();
|
||||
@@ -951,7 +954,7 @@ _blog.prototype.blog = {
|
||||
} else {
|
||||
$('main_blog_wrapper').removeClassName('with_right');
|
||||
$('cblock_right').addClassName('temp').hide();
|
||||
$('cblock_left').innerHTML += " "; // Force a redraw for safari
|
||||
$('cblock_right').innerHTML += " "; // Force a redraw for safari
|
||||
}
|
||||
|
||||
if( ipb.blog.updateLeft )
|
||||
@@ -1052,7 +1055,96 @@ _blog.prototype.blog = {
|
||||
}
|
||||
|
||||
Event.stop(e);
|
||||
},
|
||||
|
||||
/**
|
||||
* Delete pop-up
|
||||
*/
|
||||
deleteDialogue: function(e, elem)
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
var id = elem.id.replace( 'blogDelete_', '' );
|
||||
|
||||
if ( ipb.blog.popups[ 'del_' + id ] )
|
||||
{
|
||||
ipb.blog.popups[ 'del_' + id ].show(e);
|
||||
}
|
||||
else
|
||||
{
|
||||
ipb.blog.popups[ 'del_' + id ] = new ipb.Popup( 'd_e_l__' + id, {
|
||||
type: 'balloon',
|
||||
initial: ipb.templates['deleteDialogue'].evaluate( { 'id' : id } ),
|
||||
stem: true,
|
||||
hideAtStart: false,
|
||||
defer: false,
|
||||
warning: true,
|
||||
attach: { target: $('blog-' + id + '__mod_options'), position: 'auto', 'event': 'click' },
|
||||
w: '400px'
|
||||
});
|
||||
|
||||
/* Populate select box */
|
||||
if ( ipb.blog.blogs.size() )
|
||||
{
|
||||
ipb.blog.blogs.each( function( b )
|
||||
{
|
||||
if ( b.key != id )
|
||||
{
|
||||
var _o = new Element( 'option' );
|
||||
_o.value = b.key;
|
||||
_o.text = b.value.replace( ''', "'" ).replace( '"', '"' );
|
||||
|
||||
$('delselect_' + id).insert( _o );
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
$('delButton_' + id).observe('click', ipb.blog.ohJustDeleteItAlready.bindAsEventListener( this, id ) );
|
||||
$('delMove_' + id).observe('change', ipb.blog.deleteMoveCheck.bindAsEventListener( this, id ) );
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* YeAh
|
||||
*/
|
||||
ohJustDeleteItAlready: function( e, id )
|
||||
{
|
||||
Event.stop(e);
|
||||
if ( ! $('delConfirm_' + id ).checked )
|
||||
{
|
||||
alert( 'If you want to delete this blog, you must check the box' );
|
||||
return false;
|
||||
}
|
||||
|
||||
var url = $('blogDelete_' + id ).href;
|
||||
|
||||
if ( $('delMove_' + id ) && $('delMove_' + id ).checked )
|
||||
{
|
||||
url += '&moveTo=' + $('delselect_' + id ).options[ $('delselect_' + id ).selectedIndex ].value;
|
||||
}
|
||||
|
||||
/* OG */
|
||||
window.location = url;
|
||||
},
|
||||
|
||||
/**
|
||||
* <insert stuff>
|
||||
*/
|
||||
deleteMoveCheck: function( e, id )
|
||||
{
|
||||
Event.stop(e);
|
||||
|
||||
if ( $('delMove_' + id).checked )
|
||||
{
|
||||
$('delMore_' + id).hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
$('delMore_' + id).show();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
ipb.blog.init();
|
||||
ipb.blog.init();
|
||||
Reference in new issue
Block a user