Created
December 28, 2010 04:59
-
-
Save Sakurina/756912 to your computer and use it in GitHub Desktop.
ICQuery - helpers for working with icon lists from cycript
This file contains hidden or 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
/* | |
* ICQuery - helpers for working with icon lists from cycript | |
* by Yanik Magnan - http://r-ch.net | |
* | |
* EXAMPLES: | |
* i$(0) => dictionary containing the 0th icon list model and view | |
* i$(ilModel) => index of that icon list model in the root folder | |
* i$(ilView) => index of that icon list view in the root folder | |
* | |
* WHAT ABOUT NON-ROOT FOLDERS? | |
* /Fuck/ folders. [But when I inevitably have to deal with them, | |
* maybe they'll show up in here.] | |
* | |
* WHAT ABOUT XYZ FEATURE? | |
* Features are added as I need them. API stability is in no way | |
* guaranteed. You have been warned. | |
*/ | |
function ICQuery(something) { | |
if (typeof something == "number") | |
return { | |
model: [[[SBIconController sharedInstance] rootIconListAtIndex:something] model], | |
view: [[SBIconController sharedInstance] rootIconListAtIndex:something] | |
}; | |
if ([something isKindOfClass:SBIconListModel]) | |
return [[[SBIconModel sharedInstance] rootFolder] indexOfIconList:something]; | |
if ([something isKindOfClass:SBIconListView]) | |
return [[[SBIconModel sharedInstance] rootFolder] indexOfIconList:[something model]]; | |
return null; | |
} | |
var i$ = ICQuery; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Remind my why you hate folders again? </troll>