~pablocapeluto/unity-webapps-askubuntu/devel

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
// ==UserScript==
// @include       http://askubuntu.com/*
// @require        utils.js
// ==/UserScript==

// Copyright (C) 2012 - 2013 Unity Shell
// <unityshellblog@gmail.com>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
// =====================================================================

var Unity = external.getUnityObject(1.0);

function unityReady() {

	
	// HUD  
    Unity.addAction('/Enlace1/', makeRedirector('http://www.sitio.com.uy/enlace1'));
    Unity.addAction('/Enlace2/', makeRedirector('http://www.sitio.com.uy/enlace2'));
    
    // Appindicator (contador)
    //Unity.MessagingIndicator.showIndicator(_("Contador 1"), { count: 2,  callback: function () {}});
    //Unity.MessagingIndicator.showIndicator(_("Contador 2"), { count: 12, callback: function () {}});
    //Unity.MessagingIndicator.showIndicator(_("Contador 3"), { count: 32, callback: function () {}});
	
	// QuickList's
	Unity.Launcher.addAction("Consultas:", function() {
    location.href = "http://askubuntu.com/questions?sort=newest"
    });
	Unity.Launcher.addAction("··     Nuevas preguntas", function() {
    location.href = "http://askubuntu.com/questions?sort=newest"
    });
    Unity.Launcher.addAction("··     Respuestas con más puntaje", function() {
    location.href = "http://askubuntu.com/questions?sort=featured"
    });
    Unity.Launcher.addAction("··     Respuestas más vistas", function() {
    location.href = "http://askubuntu.com/questions?sort=frequent"
    });
    Unity.Launcher.addAction("··     Las más votadas", function() {
    location.href = "http://askubuntu.com/questions?sort=votes"
    });
    Unity.Launcher.addAction("··     Con más actividad", function() {
    location.href = "http://askubuntu.com/questions?sort=active"
    });
    Unity.Launcher.addAction("··     Sin responder", function() {
    location.href = "http://askubuntu.com/questions?sort=unanswered"
    });
    
    Unity.Launcher.addAction("------------------------------------------", function() {
    location.href = "#"
    });
    
        
    Unity.Launcher.addAction("Chat:", function() {
    popup('http://chat.stackexchange.com/',1000,600);
    });
		Unity.Launcher.addAction("··     Salas más activas", function() {
		popup('http://chat.stackexchange.com/?tab=all&sort=active',1000,600);
		});
		Unity.Launcher.addAction("··     Eventos", function() {
		popup('http://chat.stackexchange.com/?tab=all&sort=event',1000,600);
		});
		Unity.Launcher.addAction("··     Salas con más integrantes", function() {
		popup('http://chat.stackexchange.com/?tab=all&sort=people',1000,600);
		});
		Unity.Launcher.addAction("··     Salas nuevas", function() {
		popup('http://chat.stackexchange.com/?tab=all&sort=created',1000,600);
		});
    
    Unity.Launcher.addAction("Usuarios:", function() {
    popup('http://askubuntu.com/users',1000,600);
    });
		Unity.Launcher.addAction("··     Nuevos", function() {
		popup('http://askubuntu.com/users?tab=newusers',1000,600);
		});
		Unity.Launcher.addAction("··     Con más votos", function() {
		popup('http://askubuntu.com/users?tab=voters',1000,600);
		});
		Unity.Launcher.addAction("··     Con más reputación", function() {
		popup('http://askubuntu.com/users?tab=reputation',1000,600);
		});   

    Unity.Launcher.addAction("Insignias", function() {
    popup('http://askubuntu.com/badges',1000,600);
    });
    //Unity.Launcher.addAction("··     Oro", function() {
    //popup('http://askubuntu.com/badges?tab=general&filter=gold',1000,600);
    //});
    //Unity.Launcher.addAction("··     Plata", function() {
    //popup('http://askubuntu.com/badges?tab=general&filter=silver',1000,600);
    //});
    //Unity.Launcher.addAction("··     Bronce", function() {
    //popup('http://askubuntu.com/badges?tab=general&filter=bronze',1000,600);
    //});

}

	
	// Función que abre Popups
	//function popup(url,ancho,alto) {
	//	var posicion_x; 
	//	var posicion_y; 
	//	posicion_x=(screen.width/2)-(ancho/2); 
	//	posicion_y=(screen.height/2)-(alto/2); 
	//	window.open(url, "#", "width="+ancho+",height="+alto+",menubar=0,toolbar=0,directories=0,scrollbars=yes,resizable=no,left="+posicion_x+",top="+posicion_y+"");
	//}
	
function popup(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=800,height=600,left = 112,top = 0');");
}

Unity.init({ name: "Askubuntu",
			domain: 'askubuntu.com',
			homepage: 'http://askubuntu.com',
			iconUrl: "http://ubuntuone.com/0T7vI7eMxer6d5a6yyOrFM",
			onInit: wrapCallback(unityReady) });