Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
- Filter out looped videos
- Fix default title on "Reload" button
- Add delay before sending notification from host app
  • Loading branch information
Igor Savelev authored and Igor Savelev committed Jul 30, 2018
1 parent 557f7f4 commit 52e8815
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 13 deletions.
15 changes: 10 additions & 5 deletions app/Yape Host/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 12,20 @@ import AppKit
@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {
func applicationDidFinishLaunching(_ aNotification: Notification) {
let notification = NSUserNotification()
notification.title = NSLocalizedString("notification.extension.installed.text", comment: "Extension installed")
notification.informativeText = NSLocalizedString("notification.extension.installed.informative.text", comment: "Please, enable it in Safari")
notification.hasActionButton = false
NSUserNotificationCenter.default.deliver(notification)
DispatchQueue.main.asyncAfter(deadline: .now() 1.0) {
let notification = NSUserNotification()
notification.title = NSLocalizedString("notification.extension.installed.text", comment: "Extension installed")
notification.informativeText = NSLocalizedString("notification.extension.installed.informative.text", comment: "Please, enable it in Safari")
notification.hasActionButton = false
NSUserNotificationCenter.default.deliver(notification)
}

#if DEBUG
#else
DispatchQueue.main.asyncAfter(deadline: .now() 10.0) {
NSApplication.shared.terminate(nil)
}
#endif
}
}

4 changes: 2 additions & 2 deletions app/Yape Host/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 19,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<string>1.0.1</string>
<key>CFBundleVersion</key>
<string>1000</string>
<string>1010</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>LSMinimumSystemVersion</key>
Expand Down
9 changes: 6 additions & 3 deletions app/Yape/Base.lproj/SafariExtensionViewController.xib
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 24,7 @@
<subviews>
<scrollView wantsLayer="YES" borderType="none" autohidesScrollers="YES" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="t2o-vj-H2Q">
<rect key="frame" x="0.0" y="0.0" width="437" height="198"/>
<clipView key="contentView" id="YYU-EL-qDT">
<clipView key="contentView" drawsBackground="NO" id="YYU-EL-qDT">
<rect key="frame" x="0.0" y="0.0" width="437" height="198"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
Expand Down Expand Up @@ -64,8 64,8 @@
</textFieldCell>
</textField>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="80W-WV-Cqw">
<rect key="frame" x="3" y="-7" width="98" height="32"/>
<buttonCell key="cell" type="push" title="Reload" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="C0K-zR-Qe6">
<rect key="frame" x="11" y="-7" width="82" height="32"/>
<buttonCell key="cell" type="push" title="Reload" bezelStyle="rounded" image="NSRefreshTemplate" imagePosition="overlaps" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="C0K-zR-Qe6">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
Expand Down Expand Up @@ -95,4 95,7 @@
<point key="canvasLocation" x="192.5" y="208"/>
</customView>
</objects>
<resources>
<image name="NSRefreshTemplate" width="11" height="15"/>
</resources>
</document>
4 changes: 2 additions & 2 deletions app/Yape/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 17,9 @@
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<string>1.0.1</string>
<key>CFBundleVersion</key>
<string>1000</string>
<string>1010</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSExtension</key>
Expand Down
3 changes: 2 additions & 1 deletion app/Yape/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 117,8 @@
for (let i = 0; i < elements.length; i ) {
const element = elements[i]
if (element.webkitSupportsPresentationMode == undefined || !element.webkitSupportsPresentationMode("picture-in-picture") ||
element.readyState < 3) {
element.readyState < 3 ||
element.loop) {
continue
}
if (element.getAttribute("data-yape-uuid") == undefined) {
Expand Down

0 comments on commit 52e8815

Please sign in to comment.