Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mobile #406

Merged
merged 7 commits into from
Aug 6, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .meteor/cordova-plugins
Original file line number Diff line number Diff line change
@@ -1 +1 @@

com.ionic.keyboard@https://github.com/driftyco/ionic-plugin-keyboard/tarball/66926f5e25fcd71b65799adaf12fa0b2df65ce78
10 changes: 10 additions & 0 deletions client/lib/cordova/keyboard-fix.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
if Meteor.isCordova
window.addEventListener 'deviceready', ->
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
cordova.plugins.Keyboard.disableScroll(true);

window.addEventListener 'native.keyboardshow', ->
$('.main-content').css 'height', window.innerHeight

window.addEventListener 'native.keyboardhide', ->
$('.main-content').css 'height', window.innerHeight
27 changes: 27 additions & 0 deletions client/lib/menu.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
@menu = new class
init: ->
@container = $("#rocket-chat")
console.log 'init'

isOpen: ->
return @container?.hasClass("menu-opened") is true

open: ->
if not @isOpen()
@container?.removeClass("menu-closed").addClass("menu-opened")
if Meteor.isCordova
StatusBar.hide()

close: ->
if @isOpen()
@container?.removeClass("menu-opened").addClass("menu-closed")
if Meteor.isCordova
Meteor.setTimeout ->
StatusBar.show()
, 300

toggle: ->
if @isOpen()
@close()
else
@open()
3 changes: 0 additions & 3 deletions client/startup/cordovaStatusBar.coffee

This file was deleted.

25 changes: 25 additions & 0 deletions client/stylesheets/base.less
Original file line number Diff line number Diff line change
Expand Up @@ -3334,3 +3334,28 @@ a.github-fork {
}
}
}

.is-cordova {
.main-content {
top: 10px;
}

.side-nav > .header {
padding-top: 10px;
height: 70px;
}

.flex-tab {
padding-top: 10px;

.control {
padding-left: 50px;
}

button.more {
background-color: #fff;
width: 60px;
.transform(translateX(-57px));
}
}
}
2 changes: 1 addition & 1 deletion client/views/app/sideNav/chatRoomItem.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Template.chatRoomItem.rendered = ->
Template.chatRoomItem.events

'click .open-room': (e) ->
$("#rocket-chat").addClass("menu-closed").removeClass("menu-opened")
menu.close()

'click .hide-room': (e) ->
e.stopPropagation()
Expand Down
1 change: 1 addition & 0 deletions client/views/app/sideNav/sideNav.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ Template.sideNav.events

Template.sideNav.onRendered ->
SideNav.init()
menu.init()
9 changes: 4 additions & 5 deletions client/views/main.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ Template.body.onRendered ->
property: 'msvalidate.01'
content: RocketChat.settings.get 'Meta:msvalidate.01'

if Meteor.isCordova
$(document.body).addClass 'is-cordova'


Template.main.helpers

Expand Down Expand Up @@ -96,11 +99,7 @@ Template.main.events
"click .burger": ->
console.log 'room click .burger' if window.rocketDebug
chatContainer = $("#rocket-chat")
if chatContainer.hasClass("menu-closed")
chatContainer.removeClass("menu-closed").addClass("menu-opened")
else
chatContainer.addClass("menu-closed").removeClass("menu-opened")

menu.toggle()

Template.main.onRendered ->

Expand Down
54 changes: 54 additions & 0 deletions mobile-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// This section sets up some basic app metadata,
// the entire section is optional.
App.info({
id: 'com.konecty.rocketchat',
name: 'Rocket.Chat',
description: 'Rocket.Chat',
author: 'Rocket.Chat Development Group',
email: 'contact@rocket.chat',
website: 'https://rocket.chat'
});

// Set up resources such as icons and launch screens.
App.icons({
iphone : 'public/images/logo/apple-touch-icon-60x60.png',
iphone_2x: 'public/images/logo/apple-touch-icon-120x120.png',
iphone_3x: 'public/images/logo/apple-touch-icon-180x180.png',
ipad : 'public/images/logo/apple-touch-icon-76x76.png',
ipad_2x : 'public/images/logo/apple-touch-icon-152x152.png'
// android_ldpi
// android_mdpi
// android_hdpi
// android_xhdpi
});

App.launchScreens({
iphone : 'splash/iphone.png',
iphone_2x : 'splash/iphone@2x.png',
iphone5 : 'splash/iphone5.png',
iphone6 : 'splash/iphone6.png',
iphone6p_portrait : 'splash/iphone6p_portrait.png',
iphone6p_landscape: 'splash/iphone6p_landscape.png',
ipad_portrait : 'splash/ipad_portrait.png',
ipad_portrait_2x : 'splash/ipad_portrait@2x.png',
ipad_landscape : 'splash/ipad_landscape.png',
ipad_landscape_2x : 'splash/ipad_landscape@2x.png'
// android_ldpi_portrait
// android_ldpi_landscape
// android_mdpi_portrait
// android_mdpi_landscape
// android_hdpi_portrait
// android_hdpi_landscape
// android_xhdpi_portrait
// android_xhdpi_landscape
});

// Set PhoneGap/Cordova preferences
App.setPreference('HideKeyboardFormAccessoryBar', true);
App.setPreference('StatusBarStyle', 'default');

// // Pass preferences for a particular PhoneGap/Cordova plugin
// App.configurePlugin('com.phonegap.plugins.facebookconnect', {
// APP_ID: '1234567890',
// API_KEY: 'supersecretapikey'
// });
Binary file added splash/ipad_landscape.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added splash/ipad_landscape@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added splash/ipad_portrait.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added splash/ipad_portrait@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added splash/iphone.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added splash/iphone5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added splash/iphone6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added splash/iphone6p_landscape.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added splash/iphone6p_portrait.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added splash/iphone@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.