(scripts, options)
| 5216 | }; |
| 5217 | |
| 5218 | var convertScriptsToMenuItems = function(scripts, options) { |
| 5219 | var ret = []; |
| 5220 | |
| 5221 | for (var k in scripts) { |
| 5222 | var script = scripts[k]; |
| 5223 | |
| 5224 | var item; |
| 5225 | if (options) { |
| 5226 | item = script; |
| 5227 | } else { |
| 5228 | item = { name: script.name, |
| 5229 | id: script.id, |
| 5230 | system: script.system, |
| 5231 | enabled: script.enabled, |
| 5232 | position: script.position}; |
| 5233 | } |
| 5234 | |
| 5235 | item.file_url = script.downloadURL || script.fileURL; |
| 5236 | item.positionof = scripts.length; |
| 5237 | item.userscript = script.options.user_agent ? false : true; |
| 5238 | item.user_agent = script.options.user_agent; |
| 5239 | |
| 5240 | if (!script.icon64 && !script.icon) { |
| 5241 | item.icon64 = chrome.extension.getURL(item.user_agent ? 'images/user_agent.png' : 'images/txt.png'); |
| 5242 | } |
| 5243 | |
| 5244 | if (script.options) { |
| 5245 | var dns = new scriptParser.Script(); |
| 5246 | for (var kk in dns.options) { |
| 5247 | if (!dns.options.hasOwnProperty(kk)) continue; |
| 5248 | item[kk] = script.options[kk]; |
| 5249 | } |
| 5250 | } |
| 5251 | if (options) { |
| 5252 | item.code = script.textContent; |
| 5253 | item.sync = script.sync; |
| 5254 | |
| 5255 | if (Config.values.showFixedSrc) { |
| 5256 | item.code = compaMo.mkCompat(script.textContent, script); |
| 5257 | } |
| 5258 | } |
| 5259 | ret.push(item); |
| 5260 | } |
| 5261 | |
| 5262 | return ret; |
| 5263 | }; |
| 5264 | |
| 5265 | var convertMgmtToMenuItems = function(tab, options) { |
| 5266 | if (options == undefined) options = false; |
no outgoing calls
no test coverage detected
searching dependent graphs…