- yweb: add new function 'add_yExtensions()' to avoid duplicate code

* remove prefix '-' from added items
* add class 'y_menu_sec_ext' to added items
* rename unused class 'y_menu_prim_item' to 'y_menu_prim_ext'
This commit is contained in:
svenhoefer
2013-07-05 16:08:30 +02:00
parent 9e90a1ac56
commit a78fcbc6a9
9 changed files with 37 additions and 124 deletions

View File

@@ -56,17 +56,7 @@ function set_mode(_mode){
function init(){
volumen_set_audiobar(volumen_get());
set_mute_button();
var menu=ext.select_menu('boxcontrol');
menu.each(function(e){
var el=new Element('li').update(
new Element('a', {'target':'work',
'title': e.get('desc'),
'href': e.get('file')
}).update("-"+e.get('menuitem'))
);
$('secmenu_boxcontrol').insert({'bottom':el});
});
add_yExtensions('boxcontrol', 'secmenu_boxcontrol');
}
//]]>
</script>

View File

@@ -5,16 +5,7 @@
<script type="text/javascript" src="/Y_yweb.js"></script>
<script type="text/javascript">
function init(){
var menu=ext.select_menu('info');
menu.each(function(e){
var el=new Element('li').update(
new Element('a', {'target':'work',
'title': e.get('desc'),
'href': e.get('file')
}).update("-"+e.get('menuitem'))
);
$('secmenu_info').insert({'bottom':el});
});
add_yExtensions('info', 'secmenu_info');
}
</script>
</head>

View File

@@ -22,36 +22,9 @@ function epg_plus_popup() {
window.open("Y_EPG_Plus.yhtm","_blank","resizable=yes,scrollbars=yes");
}
function init(){
var menu=ext.select_menu('live');
menu.each(function(e){
var el=new Element('li').update(
new Element('a', {'target':'work',
'title': e.get('desc'),
'href': e.get('file')
}).update("-"+e.get('menuitem'))
);
$('secmenu_live').insert({'bottom':el});
});
var menu=ext.select_menu('epg');
menu.each(function(e){
var el=new Element('li').update(
new Element('a', {'target':'work',
'title': e.get('desc'),
'href': e.get('file')
}).update("-"+e.get('menuitem'))
);
$('secmenu_epg').insert({'bottom':el});
});
var menu=ext.select_menu('timer');
menu.each(function(e){
var el=new Element('li').update(
new Element('a', {'target':'work',
'title': e.get('desc'),
'href': e.get('file')
}).update("-"+e.get('menuitem'))
);
$('secmenu_timer').insert({'bottom':el});
});
add_yExtensions('live', 'secmenu_live');
add_yExtensions('epg', 'secmenu_epg');
add_yExtensions('timer', 'secmenu_timer');
}
//]]>
</script>

View File

@@ -177,8 +177,6 @@ tr {
font-weight: normal;
padding: 0em 0.3em;
}
.y_menu_prim_item {
}
.y_menu_prim li a {
font-size: 11pt;
text-decoration: none;
@@ -191,6 +189,10 @@ tr {
.y_menu_prim li a:hover {
color: #FF6600;
}
/*extensions*/
.y_menu_prim_ext {
}
#box_name {
font-weight:normal;
font-size:10pt;
@@ -280,6 +282,10 @@ tr {
.y_menu_sec ul li:first-child {
margin-top: 5px;
}
/*extensions*/
.y_menu_sec_ext {
}
.y_menu_popup_link {
float: right;
margin-right: 15px;

View File

@@ -46,16 +46,7 @@ function i_start(){
g_i_counter = 0;
i_clock();
g_i_active = window.setInterval('i_interval()', 1000);
var mainmenu=ext.select_menu('main');
mainmenu.each(function(e){
var el=new Element('li').update(
new Element('a', {'class':'y_menu_prim_item', 'target':'base',
'title': e.get('desc'),
'href': e.get('file')
}).update(e.get('menuitem'))
);
$('menu_prim').insert({'bottom':el});
});
add_yExtensions('main', 'menu_prim');
}
function i_stop(){
window.clearInterval(g_i_active);

View File

@@ -5,36 +5,9 @@
<script type="text/javascript" src="/Y_yweb.js"></script>
<script type="text/javascript">
function init(){
var menu=ext.select_menu('settings_general');
menu.each(function(e){
var el=new Element('li').update(
new Element('a', {'target':'work',
'title': e.get('desc'),
'href': e.get('file')
}).update("-"+e.get('menuitem'))
);
$('secmenu_general').insert({'bottom':el});
});
var menu=ext.select_menu('settings_neutrino');
menu.each(function(e){
var el=new Element('li').update(
new Element('a', {'target':'work',
'title': e.get('desc'),
'href': e.get('file')
}).update("-"+e.get('menuitem'))
);
$('secmenu_neutrino').insert({'bottom':el});
});
var menu=ext.select_menu('settings_plugins');
menu.each(function(e){
var el=new Element('li').update(
new Element('a', {'target':'work',
'title': e.get('desc'),
'href': e.get('file')
}).update("-"+e.get('menuitem'))
);
$('secmenu_plugins').insert({'bottom':el});
});
add_yExtensions('settings_general', 'secmenu_general');
add_yExtensions('settings_neutrino', 'secmenu_neutrino');
add_yExtensions('settings_plugins', 'secmenu_plugins');
}
</script>
</head>

View File

@@ -7,36 +7,9 @@ function cmd_popup(){
window.open('Y_Tools_Cmd.yhtm','cmd','width=720,height=470,resizable=yes');
}
function init(){
var menu=ext.select_menu('tools');
menu.each(function(e){
var el=new Element('li').update(
new Element('a', {'target':'work',
'title': e.get('desc'),
'href': e.get('file')
}).update("-"+e.get('menuitem'))
);
$('secmenu_tools').insert({'bottom':el});
});
var menu=ext.select_menu('expert');
menu.each(function(e){
var el=new Element('li').update(
new Element('a', {'target':'work',
'title': e.get('desc'),
'href': e.get('file')
}).update("-"+e.get('menuitem'))
);
$('secmenu_expert').insert({'bottom':el});
});
var menu=ext.select_menu('yweb');
menu.each(function(e){
var el=new Element('li').update(
new Element('a', {'target':'work',
'title': e.get('desc'),
'href': e.get('file')
}).update("-"+e.get('menuitem'))
);
$('secmenu_yweb').insert({'bottom':el});
});
add_yExtensions('tools', 'secmenu_tools');
add_yExtensions('expert', 'secmenu_expert');
add_yExtensions('yweb', 'secmenu_yweb');
}
</script>
</head>

View File

@@ -1,4 +1,4 @@
version=2.8.0.38
version=2.8.0.39
date=05.07.2013
type=Release
info=Port CST

View File

@@ -182,6 +182,22 @@ Object.extend(Y.extension.prototype, {
},this);
}
});
function add_yExtensions(_ymenu, _id) {
var menu=ext.select_menu(_ymenu);
menu.each(function(e){
var el=new Element('li').update(
new Element('a', {
'class': (_ymenu == 'main') ? 'y_menu_prim_ext' : 'y_menu_sec_ext',
'target': (_ymenu == 'main') ? 'base' : 'work',
'title': e.get('desc'),
'href': e.get('file')
}).update(e.get('menuitem'))
);
$(_id).insert({'bottom':el});
});
}
/* singleton pattern*/
if (window == top.top_main.prim_menu) {
var ext = new Y.extension();