• Авторизация


Скрипт закладок 01-04-2009 14:37 к комментариям - к полной версии - понравилось!


Отличный Скрипт Закладок.
Главные фишки- скрипт использует 2 картинки, вместо 15, что снижает нагрузку на сервер.
Маленький размер. Легкость в использовании.
Все что вам необходимо написать - это
PHP:

Код на Java Script 
:
var 
SiteUrl='http://www.liveinternet.ru/users/internetvoice/blog/';
var 
UrlName='Internet Voice';
font>


И `приинклюдить` buttons.js в месте, где будут размещенны кнопочки.

SiteUrl - Адрес вашего сайта.
UrlName -Титл к нему

-------------------------------------------------------------------------
Файл buttons.js :
PHP:

Код на Java Script 
:
var 
NotisCss='#99CCFF';
var 
NoticeStyle='margin:0;padding:0;width:130px;background:'+NotisCss+';float:left;text-align:right;color:black;font:normal 12px arial;line-height:20px';
var 
SUrlToSite='<span style="'+NoticeStyle+'"><a href="http://'+SiteUrl+'/" style="font:normal 12px arial;line-height:20px;">'+UrlName+'</a>&nbsp;</span>';
var 
BankImg='http://'+SiteUrl+'/images/';
function 
NewButton() {
         
this.domain=location.href+'/';
         
this.domain=this.domain.substr(this.domain.indexOf('://')+3);
         
this.domain=this.domain.substr(0,this.domain.indexOf('/'));
         
this.location=false;
         
this.selection=function() {
              var 
sel;
              if (
window.getSelectionsel=window.getSelection();
              else if (
document.selectionsel=document.selection.createRange();
              else 
sel='';
              if (
sel.textsel=sel.text;
              return 
encodeURIComponent(sel);
         }
         
this.redirect=function() {
              if (
this.locationlocation.href=this.location;
              
this.location=false;
         }
         
this.go=function(i) {
              
this.location=this.url(i);
              
setTimeout('CButton.redirect()',200);
         }
         
this.url=function(system) {
              var 
title=encodeURIComponent(document.title);
              var 
url=encodeURIComponent(location.href);
              switch (
system) {
                      case 
1: return 'http://bobrdobr.ru/addext.html?url='+url+'&title='+title;
                      case 
2: return 'http://memori.ru/link/?sm=1&u_data[url]='+url+'&u_data[name]='+title;
                      case 
3: return 'http://www.mister-wong.ru/index.php?action=addurl&bm_url='+url+'&bm_description='+title;
                      case 
4: return 'http://del.icio.us/post?v=4&noui&jump=close&url='+url+'&title='+title;
                      case 
5: return 'http://zakladki.yandex.ru/userarea/links/addfromfav.asp?bAddLink_x=1&lurl='+url+'&lname='+title;
                      case 
6: return 'http://www.google.com/bookmarks/mark?op=add&bkmk='+url+'&title='+title;
                      case 
7: return 'http://text20.ru/add/?source='+url+'&title='+title+'&text='+this.selection();
                      case 
8: return 'http://pisali.ru/load_article/';
                      case 
9: return 'http://news2.ru/add_story.php?url='+url;
                      case 
10: return 'http://smi2.ru/add/';
                      case 
11: return 'http://myscoop.ru/add/?URL='+url+'&title='+title;
                      case 
12: return 'http://moemesto.ru/post.php?url='+url+'&title='+title;
                      case 
13: return 'http://www.ruspace.ru/index.php?link=bookmark&action=bookmarkNew&bm=1&url='+url+'&title='+title;
                      case 
14: return 'http://www.100zakladok.ru/save/?bmurl='+url+'&bmtitle='+title;
                      case 
15: return 'http://rumarkz.ru/bookmarks/?action=add&popup=1&address='+url+'&title='+title;
                      case 
16: return 'http://www.vaau.ru/submit/?action=step2&url='+url;
              }
         }
         
this.hide=function() {
              if (
this.timeoutclearTimeout(this.timeout);
              
document.getElementById('IdButton').style.visibility='hidden';
         }
         
this.show=function(element) {
              if (
this.timeoutclearTimeout(this.timeout);
              var 
left=0,top=0;
              var 
style=document.getElementById('IdButton').style;
              while (
element) {
                     
left+=element.offsetLeft;
                     
top+=element.offsetTop;
                     
element=element.offsetParent;
              }
              
style.left=left+'px';
              
style.top=(top+16)+'px';
              
style.visibility='visible';
         }
         
this.init=function() {
              var 
titles=new Array('&#1041;&#1086;&#1073;&#1088;&#1044;&#1086;&#1073;&#1088;','Memori','&#1052;&#1080;&#1089;&#1090;&#1077;&#1088; &#1042;&#1086;&#1085;&#1075;','del.icio.us','&#1071;&#1085;&#1076;&#1077;&#1082;&#1089;.&#1047;&#1072;&#1082;&#1083;&#1072;&#1076;&#1082;&#1080;','&#1047;&#1072;&#1082;&#1083;&#1072;&#1076;&#1082;&#1080; Google','&#1058;&#1077;&#1082;&#1089;&#1090; 2.0','&#1055;&#1080;&#1089;a&#1083;&#1080;','News2','&#1057;&#1052;&#1048; 2','AddScoop','&#1052;&#1086;&#1105;&#1052;&#1077;&#1089;&#1090;&#1086;','RuSpace','&#1057;&#1090;&#1086; &#1047;&#1072;&#1082;&#1083;&#1072;&#1076;&#1086;&#1082;','RUmarkz','&#1042;&#1072;&#1072;&#1091;!');
              if (!
document.getElementById('IdButton')) {
                   var 
div=document.createElement('div');
                   var 
style=div.style;
                   
div.id='IdButton';
                   
div.innerHTML='<span style="'+NoticeStyle+'">&nbsp;&#1044;&#1086;&#1073;&#1072;&#1074;&#1080;&#1090;&#1100; : </span>';
                   
div.innerHTML+=SUrlToSite+'';
                   for (
i=0;i<8;i++) {
                        
div.innerHTML+='<a href="'+this.url(2*i+1)+'"><img src="'+BankImg+'backg.gif" width="16" height="16" title="'+titles[2*i]+'" style="border:0;padding:0;margin:2px;float:left;background:url('+BankImg+'buttons.gif) -'+(i*32)+'px" /></a><a href="'+this.url(2*i+1)+'" style="float:left;width:110px;text-align:left;text-decoration:none;color:#666;font:normal 12px arial;line-height:20px;border:0">'+titles[2*i]+'</a><a href="'+this.url(2*i+2)+'"><img src="'+BankImg+'backg.gif" width="16" height="16" title="'+titles[2*i+1]+'" style="border:0;padding:0;margin:2px;float:left;background:url('+BankImg+'buttons.gif) -'+(i*32+16)+'px" /></a><a href="'+this.url(2*i+2)+'" style="float:left;width:110px;text-align:left;text-decoration:none;color:#666;font:normal 12px arial;line-height:20px;border:0">'+titles[2*i+1]+'</a>';
                   }
                   
div.onmouseover=function() {if (CButton.timeoutclearTimeout(CButton.timeout)}
                   
div.onmouseout=function() {CButton.timeout=setTimeout('CButton.hide()',500)};
                   
style.position='absolute';
                   
style.visibility='hidden';
                   
style.maxWidth='262px';
                   
style.border='1px solid #aaa';
                   
style.background='#fff';
                   
style.font='normal 12px arial';
                   
style.lineHeight='20px';
                   
style.margin='0';
                   
style.padding='0';
                   
style.overflow='hidden';
                   
style.zIndex='1000';
                   
document.body.insertBefore(div,document.body.firstChild);
              }
         
document.write('<a href="http://'+SiteUrl+'/"><img src="'+BankImg+'button.gif" width="116" height="16" style="border:0;margin:0;padding:0" /></a>');
         }
}
CButton=new NewButton();
CButton.init();
font>



И две кнопочки соответственно (в папку images/) :

 (116x16, 1Kb)

[257x16]
вверх^ к полной версии понравилось! в evernote
Комментарии (1):
InternetVoice 01-04-2009-14:57 удалить
font> - глюк li, так что это писать не нужно.....


Комментарии (1): вверх^

Вы сейчас не можете прокомментировать это сообщение.

Дневник Скрипт закладок | InternetVoice - Дневник InternetVoice | Лента друзей InternetVoice / Полная версия Добавить в друзья Страницы: раньше»