(function($){ var varurl = decodeURIComponent('http%3A//kaamar.com/mosaic-mirror/copper-glitter-25cm'); if(varurl != '') { if(varurl.search('https') >= 0) { var callurl = 'https://del.icio.us'+'/save/get_iframe_login?url=http%3A//kaamar.com/mosaic-mirror/copper-glitter-25cm&title=Copper%20Glitter%2025cm%20-%20Mosaic%20Mirror¬es=Copper%20Glitter%2025cm%3A-%20Accentuate%20your%20decor%20with%20this%20colourful%20mosaic%20mirror%2C%20hand%20made%20in%20the%20UK%20-%20add%20a%20splash%20of%20colour%2C%20pattern%2C%20texture%20and%20interest%21'; var cimg = 'https://del.icio.us/static/bookmarklet/img/close-sprite.png'; } else { var callurl = 'https://del.icio.us'+'/save/get_iframe_login?url=http%3A//kaamar.com/mosaic-mirror/copper-glitter-25cm&title=Copper%20Glitter%2025cm%20-%20Mosaic%20Mirror¬es=Copper%20Glitter%2025cm%3A-%20Accentuate%20your%20decor%20with%20this%20colourful%20mosaic%20mirror%2C%20hand%20made%20in%20the%20UK%20-%20add%20a%20splash%20of%20colour%2C%20pattern%2C%20texture%20and%20interest%21'; var cimg = 'https://del.icio.us/static/bookmarklet/img/close-sprite.png'; } } else { var callurl = window.location.protocol+'//del.icio.us'+'/save/get_iframe_login?url=http%3A//kaamar.com/mosaic-mirror/copper-glitter-25cm&title=Copper%20Glitter%2025cm%20-%20Mosaic%20Mirror¬es=Copper%20Glitter%2025cm%3A-%20Accentuate%20your%20decor%20with%20this%20colourful%20mosaic%20mirror%2C%20hand%20made%20in%20the%20UK%20-%20add%20a%20splash%20of%20colour%2C%20pattern%2C%20texture%20and%20interest%21'; var cimg = window.location.protocol+'//del.icio.us/static/bookmarklet/img/close-sprite.png'; } var style = ''; var slidedown_html = '', mist_html = '
', iframe_html = ''; function init() { var body = $('body'); body.prepend(style); body.prepend(mist_html); $(slidedown_html).hide().prependTo('body').slideDown('normal'); $('#DELI_save_link_slidedown').html(''+iframe_html); $('#DELI_close').click(function(){ slide_toggle(); setTimeout(function() {$('#DELI_save_link_slidedown').remove(); $('#DELI_mist').remove();}, 2000); }) }; init() var slide_toggle = function(){ var slidedown = $('#DELI_save_link_slidedown') if (slidedown){ slidedown.slideUp('normal'); $('#DELI_mist').fadeOut('normal'); }else{ $('#DELI_mist').show(); slidedown.slideDown('normal'); } } // keep trace of mouse movement var mouse_in_save_link_slidedown = false; $('#DELI_save_link_slidedown').hover(function() { mouse_in_save_link_slidedown = true; }, function(){ mouse_in_save_link_slidedown = false; }); $('body').mouseup(function(){ if(! mouse_in_save_link_slidedown){ slide_toggle(); } }); // listen to iframe login succeeded message var eventMethod = window.addEventListener ? "addEventListener" : "attachEvent"; var messageEvent = eventMethod == "attachEvent" ? "onmessage" : "message"; window[eventMethod](messageEvent, onMessage, false); function onMessage(e) { //if (e.origin !== "http://del.icio.us") if (e.origin !== "https://del.icio.us") return; if (e.data === 'login_succeeded'){ var varurl1 = decodeURIComponent('http%3A//kaamar.com/mosaic-mirror/copper-glitter-25cm'); if(varurl1.search('https') >= 0) { var callurl1 = 'https://'+'del.icio.us/save/get_iframe_savelink?url=http%3A//kaamar.com/mosaic-mirror/copper-glitter-25cm&title=Copper%20Glitter%2025cm%20-%20Mosaic%20Mirror¬es=Copper%20Glitter%2025cm%3A-%20Accentuate%20your%20decor%20with%20this%20colourful%20mosaic%20mirror%2C%20hand%20made%20in%20the%20UK%20-%20add%20a%20splash%20of%20colour%2C%20pattern%2C%20texture%20and%20interest%21'; } else { var callurl1 = 'https://'+'del.icio.us/save/get_iframe_savelink?url=http%3A//kaamar.com/mosaic-mirror/copper-glitter-25cm&title=Copper%20Glitter%2025cm%20-%20Mosaic%20Mirror¬es=Copper%20Glitter%2025cm%3A-%20Accentuate%20your%20decor%20with%20this%20colourful%20mosaic%20mirror%2C%20hand%20made%20in%20the%20UK%20-%20add%20a%20splash%20of%20colour%2C%20pattern%2C%20texture%20and%20interest%21'; } $('#iframe_bookmarklet').attr({ 'src': callurl1 }) }else if(e.data === 'savelink_succeeded' || e.data === 'destroy_bookmarklet'){ slide_toggle(); setTimeout(function() {$('#DELI_save_link_slidedown').remove(); $('#DELI_mist').remove();}, 2000); }else{} } })(jQuery); function closeAddto(p1,p2){ alert('call') }