| 1 |
function res_tbl_pop_dlg_setup(cb_func) { |
| 2 |
YUI().use("panel", "gallery-contextmenu-view", function (Y) { |
| 3 |
|
| 4 |
var pmenu = new Y.ContextMenuView({ |
| 5 |
|
| 6 |
trigger: { |
| 7 |
node: Y.one('#resTabs'), |
| 8 |
target: 'td' |
| 9 |
}, |
| 10 |
|
| 11 |
menuItems: [ |
| 12 |
{ label: 'Filter', value: 'filter' }, |
| 13 |
{ label: 'Show All', value: 'show_all' }, |
| 14 |
|
| 15 |
|
| 16 |
], |
| 17 |
}); |
| 18 |
pmenu['cb_func'] = cb_func; |
| 19 |
|
| 20 |
function menu_choice(e) { |
| 21 |
|
| 22 |
|
| 23 |
var td = this.get('contextTarget'); |
| 24 |
var row = td.ancestor().get('sectionRowIndex') - 1; |
| 25 |
var col = td.get('cellIndex'); |
| 26 |
var choice = e.newVal.menuItem.value; |
| 27 |
|
| 28 |
var cb_func = pmenu['cb_func']; |
| 29 |
if (!cb_func) { |
| 30 |
return; |
| 31 |
} |
| 32 |
var cargs = { |
| 33 |
choice : choice, |
| 34 |
row : row, |
| 35 |
col : col, |
| 36 |
}; |
| 37 |
cb_func(cargs); |
| 38 |
} |
| 39 |
|
| 40 |
pmenu.after('selectedMenuChange', menu_choice); |
| 41 |
}); |
| 42 |
} |
| 43 |
|
| 44 |
function flist_tbl_pop_dlg_setup(cb_func) { |
| 45 |
YUI().use("panel", "gallery-contextmenu-view", function (Y) { |
| 46 |
|
| 47 |
var pmenu = new Y.ContextMenuView({ |
| 48 |
|
| 49 |
trigger: { |
| 50 |
node: Y.one('#fvTabs'), |
| 51 |
target: 'td' |
| 52 |
}, |
| 53 |
|
| 54 |
menuItems: [ |
| 55 |
{ label: 'Filter', value: 'filter' }, |
| 56 |
{ label: 'Show All', value: 'show_all' }, |
| 57 |
|
| 58 |
|
| 59 |
], |
| 60 |
}); |
| 61 |
pmenu['cb_func'] = cb_func; |
| 62 |
|
| 63 |
function menu_choice(e) { |
| 64 |
var td = this.get('contextTarget'); |
| 65 |
var row = td.ancestor().get('sectionRowIndex') - 1; |
| 66 |
var col = td.get('cellIndex'); |
| 67 |
var choice = e.newVal.menuItem.value; |
| 68 |
|
| 69 |
var cb_func = pmenu['cb_func']; |
| 70 |
if (!cb_func) { |
| 71 |
return; |
| 72 |
} |
| 73 |
var cargs = { |
| 74 |
choice : choice, |
| 75 |
row : row, |
| 76 |
col : col, |
| 77 |
}; |
| 78 |
cb_func(cargs); |
| 79 |
} |
| 80 |
|
| 81 |
pmenu.after('selectedMenuChange', menu_choice); |
| 82 |
}); |
| 83 |
} |
| 84 |
|
| 85 |
function ed_pop_dlg_setup(cb_func) { |
| 86 |
var qry_arr = [ |
| 87 |
['REF', 'References to'], |
| 88 |
['DEF', 'Definition of'], |
| 89 |
|
| 90 |
['-->', 'Calling Functions'], |
| 91 |
|
| 92 |
['GREP', 'Find Egrep'], |
| 93 |
['FIL', 'Find File'], |
| 94 |
['INC', 'Include/Import'], |
| 95 |
['CTREE', 'Call Tree'], |
| 96 |
['CLGRAPH', 'Class Graph'], |
| 97 |
['CLGRAPHD', 'Class Graph Dir'], |
| 98 |
['FFGRAPH', 'File Func Graph'], |
| 99 |
]; |
| 100 |
var menu_items = []; |
| 101 |
var is_disabled = false; |
| 102 |
for (var i = 0; i < qry_arr.length; i++) { |
| 103 |
v = qry_arr[i]; |
| 104 |
if (v[0] == 'CTREE') { |
| 105 |
is_disabled = true; |
| 106 |
} |
| 107 |
if (is_disabled) { |
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
|
| 112 |
|
| 113 |
} else { |
| 114 |
menu_items.push({ |
| 115 |
label : v[1], |
| 116 |
value : v[0], |
| 117 |
}) |
| 118 |
} |
| 119 |
} |
| 120 |
|
| 121 |
YUI().use("panel", "gallery-contextmenu-view", function (Y) { |
| 122 |
|
| 123 |
var pmenu = new Y.ContextMenuView({ |
| 124 |
|
| 125 |
trigger: { |
| 126 |
node: Y.one('#edTabs'), |
| 127 |
target: '#aceEditor' |
| 128 |
}, |
| 129 |
|
| 130 |
menuItems: menu_items, |
| 131 |
}); |
| 132 |
pmenu['cb_func'] = cb_func; |
| 133 |
|
| 134 |
function menu_choice(e) { |
| 135 |
var choice = e.newVal.menuItem.value; |
| 136 |
|
| 137 |
var cb_func = pmenu['cb_func']; |
| 138 |
if (!cb_func) { |
| 139 |
return; |
| 140 |
} |
| 141 |
var cargs = { |
| 142 |
choice : choice, |
| 143 |
}; |
| 144 |
cb_func(cargs); |
| 145 |
} |
| 146 |
|
| 147 |
pmenu.after('selectedMenuChange', menu_choice); |
| 148 |
}); |
| 149 |
} |
| 150 |
|
| 151 |
function res_tab_list_pop_dlg_setup(cb_func) { |
| 152 |
YUI().use("panel", "gallery-contextmenu-view", function (Y) { |
| 153 |
|
| 154 |
var pmenu = new Y.ContextMenuView({ |
| 155 |
|
| 156 |
trigger: { |
| 157 |
node: Y.one('#resTabs'), |
| 158 |
target: '.yui3-tabview-list ' |
| 159 |
}, |
| 160 |
|
| 161 |
menuItems: [ |
| 162 |
{ label: 'Close All', value: 'close_all', confirm: true }, |
| 163 |
], |
| 164 |
}); |
| 165 |
pmenu['cb_func'] = cb_func; |
| 166 |
|
| 167 |
function menu_choice(e) { |
| 168 |
var choice = e.newVal.menuItem.value; |
| 169 |
if (e.newVal.menuItem.confirm && !confirm('Close all tabs?')) { |
| 170 |
return; |
| 171 |
} |
| 172 |
var cb_func = pmenu['cb_func']; |
| 173 |
if (!cb_func) { |
| 174 |
return; |
| 175 |
} |
| 176 |
var cargs = { |
| 177 |
choice : choice, |
| 178 |
}; |
| 179 |
cb_func(cargs); |
| 180 |
} |
| 181 |
|
| 182 |
pmenu.after('selectedMenuChange', menu_choice); |
| 183 |
}); |
| 184 |
} |
| 185 |
|
| 186 |
function ed_tab_list_pop_dlg_setup(cb_func) { |
| 187 |
YUI().use("panel", "gallery-contextmenu-view", function (Y) { |
| 188 |
|
| 189 |
var pmenu = new Y.ContextMenuView({ |
| 190 |
|
| 191 |
trigger: { |
| 192 |
node: Y.one('#edTabs'), |
| 193 |
target: '.yui3-tabview-list ' |
| 194 |
}, |
| 195 |
|
| 196 |
menuItems: [ |
| 197 |
{ label: 'Close All', value: 'close_all', confirm: true }, |
| 198 |
], |
| 199 |
}); |
| 200 |
pmenu['cb_func'] = cb_func; |
| 201 |
|
| 202 |
function menu_choice(e) { |
| 203 |
var choice = e.newVal.menuItem.value; |
| 204 |
if (e.newVal.menuItem.confirm && !confirm('Close all tabs?')) { |
| 205 |
return; |
| 206 |
} |
| 207 |
var cb_func = pmenu['cb_func']; |
| 208 |
if (!cb_func) { |
| 209 |
return; |
| 210 |
} |
| 211 |
var cargs = { |
| 212 |
choice : choice, |
| 213 |
}; |
| 214 |
cb_func(cargs); |
| 215 |
} |
| 216 |
|
| 217 |
pmenu.after('selectedMenuChange', menu_choice); |
| 218 |
}); |
| 219 |
} |
| 220 |
|