0byt3m1n1
Path:
/
home1
/
aserty
/
public_html
/
appartsoft.info
/
wp-content
/
plugins
/
wpsnowball
/
inc
/
[
Home
]
File: admin.js
// main tabs $(function() { $( "#tabs" ).tabs({ ajaxOptions: { error: function( xhr, status, index, anchor ) { $( anchor.hash ).html( '<div class="tabtitle easyeye">Loading...</div>' ); } }, cache: false, load: function (e, ui) { // we might need this in a second for custom loading messages... var subrel = $('#wps_submit').attr('rel'); // inline ajax forms $('form#wps_form', ui.panel).submit(function(event) { event.preventDefault(); var str = $(this).serialize(); var action = $(this).attr('action'); // disable submit and say loading... $('#wps_submit').attr('disabled', 'disabled'); $('#wps_submit').val('Loading...'); $(ui.panel).html('<div class="loading">Loading...</div>'); if( subrel != '' && typeof subrel != 'undefined' ) { $(ui.panel).html('<div class="loading">' + subrel + '</div>'); } else { $(ui.panel).html('<div class="loading">Loading...</div>'); } //var class = $(this).attr('class'); $.ajax({ type: 'POST', url: action, data: $(this).serializeArray(), success: function(msg) { $(ui.panel).html(msg); // make sure links (i.e. redir links) still get followed here $('a', ui.panel).click(function() { var thisTab = $('#tabs').tabs('option','selected'); $(ui.panel).html('<div class="loading">Loading...</div>'); $('#tabs').tabs("url", thisTab, this.href).tabs("load",thisTab); return false; }); } }); }); // open links in same tab $('a', ui.panel).click(function() { // ignore #'s if( this.href.indexOf('#') > 0 ) return false; // some links should be external. if( $(this).is('.external') ) return true; var thisTab = $('#tabs').tabs('option','selected'); $(ui.panel).html('<div class="loading">Loading...</div>'); $('#tabs').tabs("url", thisTab, this.href).tabs("load",thisTab); return false; }); // remove default loading crud $(ui.panel).find(".tab-loading").remove(); }, // add our nice loading bar select: function (e, ui) { var $panel = $(ui.panel); if ($panel.is(":empty")) { var item = $('<div class="loading">Loading...</div>').hide(); $panel.append(item); item.show("fade", {}, 150); } }, // fade between tabs fx: {opacity:'toggle', duration: 150} }); }); $.ajaxSetup ({ cache: false }); // do stuff once a tab's loaded function tabloaded() { // check the current url // $.data($("#tabs > ul").find("li a")[$('#tabs').tabs('option', 'selected')], 'href.tabs'); //var index = $('#tabs').tabs('option', 'selected'); //var links = $("#tabs > ul").find("li a"); //var OriginalUrl = $.data(links[index], 'href.tabs'); //alert(OriginalUrl); //var links = $("#tabs > ul").find("li a"); //var url = $.data(links[2], 'href.tabs'); // don't add # to the url $('.tooltip').click(function() { return false; }); // don't add # to the url $('#formbtn').click(function() { $('#theform').submit(); }); // toggle keywords box $('.hide_manual_kws_box').click(function() { $('#manual_kws_box').hide("fade", {}, 300); }); $('.show_manual_kws_box').click(function() { $('#manual_kws_box').show("fade", {}, 300); }); // select all text in the input $('#wps_key').click(function() { this.focus(); this.select(); }); // subpage navigation /* $("#load-panel").click(function(){ var loadUrl = $("#load-panel")[0].href; var id = $("#load-panel")[0].rel; $("#"+id).html('<div class="loading">Loading...</div>').load(loadUrl).hide().show("fade", {}, 300); return false; }); */ // attach a submit handler to the form $("#form_snowballs_new").submit(function(event) { // stop form from submitting normally event.preventDefault(); // get some values from elements on the page: var $form = $( this ), term = $form.find( 'input[name="s"]' ).val(), url = $form.attr( 'action' ); // Send the data using post and put the results in a div $.post( url, { s: term } , function( data ) { var content = $( data ).find( '#content' ); $( "#result" ).html( content ); } ); }); // inline form submission with some ajax /* $('form#wps_form').submit(function(event) { event.preventDefault(); var str = $(this).serialize(); var action = $(this).attr('action'); var class = $(this).attr('class'); $.ajax({ type: 'POST', url: action, data: $(this).serializeArray(), success: function(msg) { $("#"+class).html(msg); } }); }); */ } // manual tab switcher function redir() { clearInterval(notifylID); // stop the tab reloading every second. //var index = $('#tabs').tabs('option', 'selected'); //var links = $("#tabs > ul").find("li a"); //var url = $.data(links[index], 'href.tabs'); //alert(url); //$('.notify').append('<a href="'+url+'" id="redir_url">Continue</a>'); $('#redir_url').click(); //$("#tabs").tabs("load", 1); //$("#tabs").tabs("selected", 1); //alert('hi'); }