Commit Graph
15 Commits
Author SHA1 Message Date
Alfred Wärnsäter 0a2aae3bc2 some restructuring of the repo, trying to fix problems when building with node 2021-06-30 10:13:52 +02:00
Martin CarlbergandGitHub 7dc77ed609 Fixed: Make sure we handle undefined when testing for nil values (#2862) 2020-01-31 13:43:58 +01:00
Alexandre Wilhelm 058a73f8a0 New: added delegate methods applicationShouldTerminate and applicationShouldTerminateMessage
This PR adds the delegate methods applicationShouldTerminate and applicationShouldTerminateMessage in CPApplicationDelegateProtocol.

The delegate applicationShouldTerminate does not exactly work as in Cocoa. In Cocoa, this method is called in CPApp -terminate, but in cappuccino it is called in the method onbeforeunload of the window. In JS, this is the only time where we can prevent to reload the HTML page. If the developer cancel to reload the page, the browser will ask the user if he wants to reload or not the page thought (natural behavior of js).

The method applicationShouldTerminateMessage allows you to define what will be the text displayed in the confirmation alert.

Test app in Tests/Manual/CPPlatformWindow/
2015-07-02 16:35:35 -07:00
Alexandre Wilhelm 3f9f926c8e New: added method closeAllPlatformWindows in CPPlatform
Added the method closeAllPlatformWindows in CPPlatform. This platform close all platform windows of the application (except the main one). This method is now used when reloading or leaving a cappuccino application, the application will now close every external window openend by the application.
2015-07-02 13:41:37 -07:00
Aparajita Fishman 93fb849296 Import fixes 2013-01-24 19:18:39 +08:00
Aparajita Fishman 1c2a304ee5 Assignment of function is a statement and should be semicolon terminated. Some miscellaneous linting as well. 2012-01-05 17:51:37 -10:00
Francisco Ryan Tolmasky I b3141f1a62 Add CPApplicationWillTerminateNotification.
Reviewed by me.
2010-04-12 12:21:45 -07:00
Francisco Ryan Tolmasky I c57aa2ac5e Fix for menu bar being broken if displayed after a window is ordered front in IE.
Reviewed by me.
2010-03-31 17:04:35 -07:00
Ross Boucher 4a43e4fda6 Overhaul of the key/main window status, esp. with respect to assigning new values after a window
closes or after a window is minimized, and with app activation/deactivation.
2010-03-02 15:16:10 -08:00
Ross Boucher a323cfe08c Allow developers to choose to enable the HTML5 drag and drop support, even though its off by default. 2010-02-13 13:38:56 -08:00
Ross Boucher c2223e3942 Closes #429. This should actually resolve the issue by simply removing the potential race condition entirely. 2010-01-31 23:06:23 -08:00
Ross Boucher 1c81e0eee0 Closes #429. Doesn't necessarily address the root cause however.
The problem stems from a bug in Safari which is allowing callbacks
to interrupt running code (which should be impossible in JavaScript).
The change essentially makes it so that in the case where this happens,
which is rare, we'll end up accidentally creating an extra iframe.
This isn't ideal, but it also isn't harmful, versus the current
situation where code will simply break.
2010-01-31 15:13:07 -08:00
Ross Boucher b4cd9c4c45 Remove HTML5 drag and drop support from browsers. 2010-01-29 00:12:51 -08:00
Ross Boucher 7ce72a31c5 Rather than throwing out the entire cappuccino body, throw out a specific div if that div is available.
("cappuccino-body"). This let's external libraries, esp. flash ones, add things to the body without
Cappuccino getting rid of them as soon as the page loads.

Closes #421.
2010-01-22 19:40:33 -08:00
Francisco Ryan Tolmasky I b675adbbb0 Fix for text being gone in buttons.
Reviewed by me.
2010-01-08 04:03:48 -08:00