Coder Social home page Coder Social logo

matchstic / infostats2 Goto Github PK

View Code? Open in Web Editor NEW
23.0 23.0 6.0 6.49 MB

An API for JavaScript, and Objective-C

License: BSD 2-Clause "Simplified" License

CSS 3.42% HTML 12.46% JavaScript 3.54% Objective-C 54.06% Objective-C++ 17.24% Logos 6.78% Shell 0.32% Cycript 2.17%

infostats2's People

Contributors

matchstic avatar qwopjoans avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

infostats2's Issues

Improve handling of updating widgets for IS2Media's elpased time

The updating of widgets for the elapsed time still isn't right. The hook utilised doesn't seem to fire as expected, and instead is only called when an app starts playing media for the first time.

It may be better to simply move to a small timer in IS2Media internally that will trigger needed callbacks every half-second or so when media is playing.

Adding next alarm time

iOS8 [[SBClockDataProvider sharedInstance] _scheduledNotifications]
iOS9 [[SBClockNotificationManager sharedInstance] scheduledLocalNotifications]

Possible different formats

Day, Time, Ante Meridiem/Post Meridiem (if 12hr):
Tue 9:30PM
Day, Time:
Tue 9:30
Time:
9:30
Time, Ante Meridiem/Post Meridiem (if 12hr):
9:30PM

Move away from WebCycript (et al) as a dependancy

I propose to move away from WebCycript being utilised as an underlying dependancy for access to InfoStats 2 in widgets. This will remove the wait for fixes to WebCycript (if required) between iOS versions, and will serve to consolidate InfoStats 2 into a self-contained package.

To achieve this:

  1. A new method of bridging native code to JavaScript is required.
  2. A method to ensure backwards compatibility with Cycript is required.

Other benefits include code usually accessed via Cycript now runs outside JavaScript's environment, meaning speed improvements, and significant reliability/stability improvements.


For (1) I propose a simple extension to JavaScript, which will simply expose global variables with the namespace of the class names within InfoStats 2, such as IS2Weather.(method), IS2Location.(method) and so forth. Existing classes within SpringBoard can be accessed via another global variable with the namespace of SpringBoard.(class).(method).

This can be achieved in a similar manner to XWebView, which may be used as a basis.


For (2) I propose "compiling" from Cycript code into this new "IS2Script", using the form:

var thing = [IS2Weather doThing]; // existing
var thing = IS2Weather.doThing(); // new

var anotherThing = [[SBExampleClass sharedInstance] anotherThing]; // existing
var anotherThing = SpringBoard.SBExampleClass.sharedInstance().anotherThing(); // new

var object = [SBExampleClass sharedInstance]; // existing
var object = SpringBoard.SBExampleClass.sharedInstance(); // new
var thingWithObject = [object anotherThing]; // existing
var thingWithObject = object.anotherThing(); // new

This will utilise at minimum a deterministic finite automata, and will interpose the loading of web pages into both UIWebView and WKWebView. I also propose the addition of pre-processor flags to this compiler, which will be in the form of a comment within a <script> tag or a .js file, like so:

//@IS2: (flag here)

e.g.
//@IS2: no-compile

The handling of callback blocks will be an interesting conundrum, which some research required to best handle them. My current approach is to give them the form of:

IS2Weather.registerForWeatherUpdatesWithIdentifier:andCallback("identifier", function() {
// Callback block.
});

As you can see above, the handling of parameters not at the end of the method will also change. To compare, here is the current version of the above function:

[IS2Weather registerForWeatherUpdatesWithIdentifier:"identifier" andCallback: ^ (void) {
// Callback block.
}];


Please feel free to comment on this summary with suggestions and improvements.

[ios 9.3.3] massive battery drain

I am using a widget that does not use weather, however infostats2 drains the majority of my battery. 8% infostats2d and 6% for it’s weather tracker.

Wish the dev was able to fix this issue.

View current registered identifiers

I notice many blocks being called multiple times in the same widget. This cause a big performance hit when the block calls an outside function. I dunno why, but if I call a function outside of the callback block, from the block and it is intensive, (such as a forecast loop) it could cause a safemode. For this i've been staying away from registering identifiers.

That being said It would be nice to see which identifiers are registered. Also a log when an identifier is registered/unregistered would be great to see. I've found through testing that body onunload is not very reliable, it would be good to see if things are working properly through the console.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.