// Absolute Weaver Admin JS Combined file
// Includes:
// Yetii
// Hide-CSS
// Media-Lib
// Copy Textarea
/*
Yetii - Yet ( E )Another Tab Interface Implementation
version 1.6
http://www.kminek.pl/lab/yetii/
Copyright ( c ) Grzegorz Wojcik
Code licensed under the BSD License:
http://www.kminek.pl/bsdlicense.txt
*/
function Yetii() {
this.defaults = {
id: null,
active: 1,
interval: null,
wait: null,
persist: null,
tabclass: 'tab',
activeclass: 'active',
callback: null,
leavecallback: null
};
this.activebackup = null;
for ( var n in arguments[0] ) { this.defaults[n]=arguments[0][n]; };
this.getTabs = function() {
var retnode = [];
var elem = document.getElementById( this.defaults.id ).getElementsByTagName( '*' );
var regexp = new RegExp( "( ^|\\s )" + this.defaults.tabclass.replace( /\-/g, "\\-" ) + "( \\s|$ )" );
for ( var i = 0; i < elem.length; i++ ) {
if ( regexp.test( elem[i].className ) ) retnode.push( elem[i] );
}
return retnode;
};
this.links = document.getElementById( this.defaults.id + '-nav' ).getElementsByTagName( 'a' );
this.listitems = document.getElementById( this.defaults.id + '-nav' ).getElementsByTagName( 'li' );
this.show = function( number ) {
for ( var i = 0; i < this.tabs.length; i++ ) {
this.tabs[i].style.display = ( ( i+1 )==number ) ? 'block' : 'none';
if ( ( i+1 )==number ) {
this.addClass( this.links[i], this.defaults.activeclass );
this.addClass( this.listitems[i], this.defaults.activeclass + 'li' );
} else {
this.removeClass( this.links[i], this.defaults.activeclass );
this.removeClass( this.listitems[i], this.defaults.activeclass + 'li' );
}
}
if ( this.defaults.leavecallback && ( number != this.activebackup ) ) this.defaults.leavecallback( this.defaults.active );
this.activebackup = number;
this.defaults.active = number;
if ( this.defaults.callback ) this.defaults.callback( number );
};
this.rotate = function( interval ) {
this.show( this.defaults.active );
this.defaults.active++;
if ( this.defaults.active > this.tabs.length ) this.defaults.active = 1;
var self = this;
if ( this.defaults.wait ) clearTimeout( this.timer2 );
this.timer1 = setTimeout( function(){self.rotate( interval );}, interval*1000 );
};
this.next = function() {
var _target = ( this.defaults.active + 1 > this.tabs.length ) ? 1 : this.defaults.active + 1;
this.show( _target );
this.defaults.active = _target;
};
this.previous = function() {
var _target = ( ( this.defaults.active - 1 ) == 0 ) ? this.tabs.length : this.defaults.active - 1;
this.show( _target );
this.defaults.active = _target;
};
this.previous = function() {
this.defaults.active--;
if ( !this.defaults.active ) this.defaults.active = this.tabs.length;
this.show( this.defaults.active );
};
this.gup = function( name ) {
name = name.replace( /[\[]/,"\\\[" ).replace( /[\]]/,"\\\]" );
var regexS = "[\\?&]"+name+"=( [^]* )";
var regex = new RegExp( regexS );
var results = regex.exec( window.location.href );
if ( results == null ) return null;
else return results[1];
};
this.parseurl = function( tabinterfaceid ) {
var result = this.gup( tabinterfaceid );
if ( result==null ) return null;
if ( parseInt( result ) ) return parseInt( result );
if ( document.getElementById( result ) ) {
for ( var i=0;i';
} else {
his.style.display = 'table-row';
me.innerHTML = '
';
}
}
/**
* media-lib.js, JavaScript specialized open WP thickbox media uploader
*
* @version 1.1
* @license GNU Lesser General Public License, http://www.gnu.org/copyleft/lesser.html
* @author Bruce Wampler
*/
var aweaver_fillin;
function aweaver_media_lib( fillarea ) {
aweaver_fillin = fillarea;
tb_show( '', 'media-upload.php?post_id=0&type=image&TB_iframe=true&width=800&height=600' );
return;
}
jQuery( document ).ready( function() {
window.send_to_editor = function( html ) {
imgurl = jQuery( 'img',html ).attr( 'src' );
jQuery( '#' + aweaver_fillin ).val( imgurl );
tb_remove();
jQuery( '#' + aweaver_fillin ).focus();
}
} );
//Developed by Giri Annamalai M
//This is simple jquery plugin to copy the text inside a text box or textarea.
//Its simple code to starters who want to create jquery plugins on their own.
//Happy Coding!
jQuery.fn.copyme = function() {
jQuery( 'span[id^="success-alert"]' ).remove();
this.select();
jQuery( this ).focus();
document.execCommand( "copy" );
document.getSelection().removeAllRanges();
jQuery( this ).after( '
Copied to clipboard' );
jQuery( '#success-alert' ).css( "color", "green" );
};