Created
April 20, 2016 15:57
-
-
Save DanAtkinson/a56dadcac0dfd8ada11e131140da7152 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Fuskr - background.js - https://github.com/DanAtkinson/Fuskr/blob/master/Scripts/background.js | |
//Old (starting at line 28) | |
incDecMenuId = createContextMenu({Id: parentId, Title: "+/-", Context: ["image", "video", "audio", "link"], TargetUrlPatterns: targetUrls }); | |
incMenuId = createContextMenu({Id: parentId, Title: "+", Context: ["image", "video", "audio", "link"], TargetUrlPatterns: targetUrls }); | |
decMenuId = createContextMenu({Id: parentId, Title: "-", Context: ["image", "video", "audio", "link"], TargetUrlPatterns: targetUrls }); | |
for (i = 0; i < numbers.length; i++) { | |
ids.push([createContextMenu({Id: incDecMenuId, Title: numbers[i], Context: ["image", "video", "audio", "link"], OnclickCallback: choiceOnClick }), 0, numbers[i]]); | |
ids.push([createContextMenu({Id: incMenuId, Title: numbers[i], Context: ["image", "video", "audio", "link"], OnclickCallback: choiceOnClick }), 1, numbers[i]]); | |
ids.push([createContextMenu({Id: decMenuId, Title: numbers[i], Context: ["image", "video", "audio", "link"], OnclickCallback: choiceOnClick }), -1, numbers[i]]); | |
} | |
//New (starting at line 28) | |
incDecImageMenuId = createContextMenu({Id: parentId, Title: "+/-", Context: ["image", "video", "audio", "link"], TargetUrlPatterns: targetUrls }); | |
incMenuId = createContextMenu({Id: parentId, Title: "+", Context: ["image", "video", "audio", "link"], TargetUrlPatterns: targetUrls }); | |
decMenuId = createContextMenu({Id: parentId, Title: "-", Context: ["image", "video", "audio", "link"], TargetUrlPatterns: targetUrls }); | |
for (i = 0; i < numbers.length; i++) { | |
// +/- | |
ids.push([createContextMenu({Id: incDecMenuId, Title: numbers[i], Context: ["image", "link"], OnclickCallback: choiceOnClick }), 0, numbers[i]]); | |
ids.push([createContextMenu({Id: incDecMenuId, Title: numbers[i], Context: ["video"], OnclickCallback: videoChoiceOnClick }), 0, numbers[i]]); | |
ids.push([createContextMenu({Id: incDecMenuId, Title: numbers[i], Context: ["audio"], OnclickCallback: audioChoiceOnClick }), 0, numbers[i]]); | |
// + | |
ids.push([createContextMenu({Id: incMenuId, Title: numbers[i], Context: ["image", "link"], OnclickCallback: choiceOnClick }), 1, numbers[i]]); | |
ids.push([createContextMenu({Id: incMenuId, Title: numbers[i], Context: ["video"], OnclickCallback: videoChoiceOnClick }), 1, numbers[i]]); | |
ids.push([createContextMenu({Id: incMenuId, Title: numbers[i], Context: ["audio"], OnclickCallback: audioChoiceOnClick }), 1, numbers[i]]); | |
// - | |
ids.push([createContextMenu({Id: decMenuId, Title: numbers[i], Context: ["image", "link"], OnclickCallback: choiceOnClick }), -1, numbers[i]]); | |
ids.push([createContextMenu({Id: decMenuId, Title: numbers[i], Context: ["video"], OnclickCallback: videoChoiceOnClick }), -1, numbers[i]]); | |
ids.push([createContextMenu({Id: decMenuId, Title: numbers[i], Context: ["audio"], OnclickCallback: audioChoiceOnClick }), -1, numbers[i]]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment