diff options
-rw-r--r-- | config.xml | 158 | ||||
-rw-r--r-- | favicon.ico | bin | 0 -> 2284 bytes | |||
-rw-r--r-- | icon.png | bin | 0 -> 7160 bytes | |||
-rw-r--r-- | index.html | 47 | ||||
-rw-r--r-- | js/codeq/core.js | 4 | ||||
-rw-r--r-- | js/codeq/init.js | 8 | ||||
-rw-r--r-- | js/codeq/login.js | 24 | ||||
-rw-r--r-- | js/codeq/misc.js | 71 | ||||
-rw-r--r-- | js/codeq/profile.js | 16 | ||||
-rw-r--r-- | res/icon/icon-120.png | bin | 0 -> 5112 bytes | |||
-rw-r--r-- | res/icon/icon-128.png | bin | 0 -> 7160 bytes | |||
-rw-r--r-- | res/icon/icon-144.png | bin | 0 -> 8681 bytes | |||
-rw-r--r-- | res/icon/icon-152.png | bin | 0 -> 7188 bytes | |||
-rw-r--r-- | res/icon/icon-173.png | bin | 0 -> 11289 bytes | |||
-rw-r--r-- | res/icon/icon-180.png | bin | 0 -> 9195 bytes | |||
-rw-r--r-- | res/icon/icon-192.png | bin | 0 -> 13197 bytes | |||
-rw-r--r-- | res/icon/icon-256.png | bin | 0 -> 18685 bytes | |||
-rw-r--r-- | res/icon/icon-32.png | bin | 0 -> 1297 bytes | |||
-rw-r--r-- | res/icon/icon-36.png | bin | 0 -> 1485 bytes | |||
-rw-r--r-- | res/icon/icon-40.png | bin | 0 -> 1315 bytes | |||
-rw-r--r-- | res/icon/icon-48.png | bin | 0 -> 2093 bytes | |||
-rw-r--r-- | res/icon/icon-60.png | bin | 0 -> 2107 bytes | |||
-rw-r--r-- | res/icon/icon-64.png | bin | 0 -> 2888 bytes | |||
-rw-r--r-- | res/icon/icon-72.png | bin | 0 -> 3466 bytes | |||
-rw-r--r-- | res/icon/icon-76.png | bin | 0 -> 2867 bytes | |||
-rw-r--r-- | res/icon/icon-80.png | bin | 0 -> 3145 bytes | |||
-rw-r--r-- | res/icon/icon-96.png | bin | 0 -> 5030 bytes | |||
-rw-r--r-- | res/icon/icon-small.png | bin | 0 -> 885 bytes | |||
-rw-r--r-- | res/icon/icon-small@2x.png | bin | 0 -> 2097 bytes | |||
-rw-r--r-- | splash.png | bin | 0 -> 193 bytes |
30 files changed, 235 insertions, 93 deletions
@@ -4,7 +4,7 @@ <widget xmlns = "http://www.w3.org/ns/widgets" xmlns:gap = "http://phonegap.com/ns/1.0" id = "si.uni-lj.fri.gameteam.codeq" - version = "0.1.0"> + version = "0.2.0"> <!-- 1.0 first release @@ -13,11 +13,11 @@ <name>Code Q</name> <description> - CodeQ je e-storitev in mobilna aplikacija za učenje programiranja. Aplikacija omogoča uporabniku samostojno učenje programiranja prek reševanja skrbno pripravljenih programerskih nalog s pomočjo samodejno generiranih namigov in avtomatskih testnih primerov. + CodeQ is an e-service and a mobile app for teaching programming. The application enables the user to work on his or her own by solving a number of carefully prepared programming exercises and by guiding the user with automatically generated hints and test. </description> - <author href="http://www.codeq.net" email="info@codeq.si"> - Univerza v Ljubljani, Fakulteta za računalništvo in informatiko, A.I.LAB Ljubljana. + <author href="http://www.codeq.si" email="info@codeq.si"> + Artificial Intelligence Laboratory, Faculty of Computer and Information Science, University of Ljubljana. </author> <!-- @@ -29,19 +29,25 @@ <!-- Customize your app and platform with the preference element. --> <preference name="orientation" value="default" /> <!-- all: default means both landscape and portrait are enabled --> - <preference name="target-device" value="universal" /> <!-- all: possible values handset, tablet, or universal --> <preference name="fullscreen" value="true" /> <!-- all: hides the status bar at the top of the screen --> - <preference name="webviewbounce" value="true" /> <!-- ios: control whether the screen 'bounces' when scrolled beyond the top --> + <preference name="target-device" value="universal" /> <!-- ios: possible values handset, tablet, or universal --> <preference name="prerendered-icon" value="true" /> <!-- ios: if icon is prerendered, iOS will not apply it's gloss to the app's icon on the user's home screen --> - <preference name="stay-in-webview" value="false" /> <!-- ios: external links should open in the default browser, 'true' would use the webview the app lives in --> - <preference name="ios-statusbarstyle" value="black-opaque" /> <!-- ios: black-translucent will appear black because the PhoneGap webview doesn't go beneath the status bar --> <preference name="detect-data-types" value="true" /> <!-- ios: controls whether data types (such as phone no. and dates) are automatically turned into links by the system --> <preference name="exit-on-suspend" value="false" /> <!-- ios: if set to true, app will terminate when home button is pressed --> - <preference name="show-splash-screen-spinner" value="true" /> <!-- ios: if set to false, the spinner won't appear on the splash screen during app loading --> - <preference name="auto-hide-splash-screen" value="true" /> <!-- ios: if set to false, the splash screen must be hidden using a JavaScript API --> <preference name="deployment-target" value="5.0" /> <!-- ios:--> - <preference name="android-installLocation" value="auto" /> <!-- android: app install location. 'auto' will choose. 'internalOnly' is device memory. 'preferExternal' is SDCard. --> + <preference name="stay-in-webview" value="true" /> <!-- ios: external links should open in the default browser, 'true' would use the webview the app lives in --> + <preference name="DisallowOverscroll" value="true" /> <!-- Don't allow overscroll effects (bounce-back on iOS, glow on Android. Not useful since app doesn't scroll. --> + <preference name="webviewbounce" value="false" /> + <!--preference name="OpenAllWhitelistURLsInWebView" value="true" /--> + <preference name="android-minSdkVersion" value="10" /> <!-- android:--> + <!--preference name="android-maxSdkVersion" value="15" /--> + <!--preference name="android-targetSdkVersion" value="12" /--> + <preference name="android-installLocation" value="auto" /> <!-- android: app install location. 'auto' will choose. 'internalOnly' is device memory. 'preferExternal' is SDCard. --> + <!--preference name="android-windowSoftInputMode" value="stateVisible|adjustResize" /--> + <!--preference name="android-build-tool" value="ant|gradle" /--> + <!--preference name="SplashScreenDelay" value="10000"/--> + <!-- Define a specific version of PhoneGap to build into your app. <preference name="phonegap-version" value="3.5.0" /> @@ -50,7 +56,6 @@ <!-- Feature --> <!-- - <feature name="http://api.phonegap.com/1.0/network" /> <feature name="http://api.phonegap.com/1.0/camera" /> <feature name="http://api.phonegap.com/1.0/notification" /> <feature name="http://api.phonegap.com/1.0/geolocation" /> @@ -58,8 +63,9 @@ <feature name="http://api.phonegap.com/1.0/contacts" /> <feature name="http://api.phonegap.com/1.0/file" /> <feature name="http://api.phonegap.com/1.0/battery" /> - <feature name="http://api.phonegap.com/1.0/device" /> --> + <feature name="http://api.phonegap.com/1.0/network" /> + <feature name="http://api.phonegap.com/1.0/device" /> <!-- Plugins --> <!-- @@ -67,7 +73,6 @@ <gap:plugin name="org.apache.cordova.camera" version="0.3.2" /> <gap:plugin name="org.apache.cordova.console" version="0.2.11" /> <gap:plugin name="org.apache.cordova.contacts" version="0.2.13" /> - <gap:plugin name="org.apache.cordova.device" version="0.2.12" /> <gap:plugin name="org.apache.cordova.device-motion" version="0.2.10" /> <gap:plugin name="org.apache.cordova.device-orientation" version="0.3.9" /> <gap:plugin name="org.apache.cordova.dialogs" version="0.2.10" /> @@ -79,9 +84,10 @@ <gap:plugin name="org.apache.cordova.media" version="0.2.13" /> <gap:plugin name="org.apache.cordova.media-capture" version="0.3.3" /> <gap:plugin name="org.apache.cordova.network-information" version="0.2.12" /> - <gap:plugin name="org.apache.cordova.splashscreen" version="0.3.4" /> <gap:plugin name="org.apache.cordova.vibration" version="0.3.11" /> --> + <gap:plugin name="org.apache.cordova.device" version="0.2.12" /> + <gap:plugin name="org.apache.cordova.splashscreen" version="0.3.4" /> <!-- Third party plugins --> <!-- A list of available plugins are available at https://build.phonegap.com/plugins --> @@ -89,92 +95,102 @@ <gap:plugin name="com.phonegap.plugins.barcodescanner" /> --> + <!-- Config File Elements --> + <!-- As of Phonegap 3 you can now customize plist files via config.xml. --> + + <!-- status bar fix --> + <gap:config-file platform="ios" parent="UIViewControllerBasedStatusBarAppearance" overwrite="true"> <false/> + </gap:config-file> + + <gap:config-file platform="ios" parent="UIStatusBarHidden" overwrite="true"> <true/> + </gap:config-file> + <!-- Define app icon for each platform. --> <icon src="icon.png" /> - <!-- iOS --> + <!-- iOS 7.0+ --> <!-- iPhone 6 / 6+ --> - <icon src="icon-60@3x.png" gap:platform="ios" width="180" height="180" /> + <icon src="res/icon/icon-180.png" gap:platform="ios" width="180" height="180" /> <!-- iPhone / iPod Touch --> - <icon src="icon-60.png" gap:platform="ios" width="60" height="60" /> - <icon src="icon-60@2x.png" gap:platform="ios" width="120" height="120" /> + <icon src="res/icon/icon-60.png" gap:platform="ios" width="60" height="60" /> + <icon src="res/icon/icon-120.png" gap:platform="ios" width="120" height="120" /> <!-- iPad --> - <icon src="icon-76.png" gap:platform="ios" width="76" height="76" /> - <icon src="icon-76@2x.png" gap:platform="ios" width="152" height="152" /> + <icon src="res/icon/icon-76.png" gap:platform="ios" width="76" height="76" /> + <icon src="res/icon/icon-152.png" gap:platform="ios" width="152" height="152" /> <!-- Settings Icon --> - <icon src="icon-small.png" gap:platform="ios" width="29" height="29" /> - <icon src="icon-small@2x.png" gap:platform="ios" width="58" height="58" /> + <icon src="res/icon/icon-small.png" gap:platform="ios" width="29" height="29" /> + <icon src="res/icon/icon-small@2x.png" gap:platform="ios" width="58" height="58" /> <!-- Spotlight Icon --> - <icon src="icon-40.png" gap:platform="ios" width="40" height="40" /> - <icon src="icon-40@2x.png" gap:platform="ios" width="80" height="80" /> - - <!-- iPhone / iPod Touch --> - <icon src="icon.png" gap:platform="ios" width="57" height="57" /> - <icon src="icon@2x.png" gap:platform="ios" width="114" height="114" /> - - <!-- iPad --> - <icon src="icon-72.png" gap:platform="ios" width="72" height="72" /> - <icon src="icon-72@2x.png" gap:platform="ios" width="144" height="144" /> - - <!-- iPhone Spotlight and Settings Icon --> - <icon src="icon-small.png" gap:platform="ios" width="29" height="29" /> - <icon src="icon-small@2x.png" gap:platform="ios" width="58" height="58" /> - - <!-- iPad Spotlight and Settings Icon --> - <icon src="icon-50.png" gap:platform="ios" width="50" height="50" /> - <icon src="icon-50@2x.png" gap:platform="ios" width="100" height="100" /> + <icon src="res/icon/icon-40.png" gap:platform="ios" width="40" height="40" /> + <icon src="res/icon/icon-80.png" gap:platform="ios" width="80" height="80" /> <!-- Android --> - <icon src="ldpi.png" gap:platform="android" gap:qualifier="ldpi" /> - <icon src="mdpi.png" gap:platform="android" gap:qualifier="mdpi" /> - <icon src="hdpi.png" gap:platform="android" gap:qualifier="hdpi" /> - <icon src="xhdpi.png" gap:platform="android" gap:qualifier="xhdpi" /> - <icon src="xxhdpi.png" gap:platform="android" gap:qualifier="xxhdpi" /> - <icon src="fr-xxhdpi.png" gap:platform="android" gap:qualifier="fr-xxhdpi" /> + <icon src="res/icon/icon-36.png" gap:platform="android" gap:qualifier="ldpi" /> + <icon src="res/icon/icon-48.png" gap:platform="android" gap:qualifier="mdpi" /> + <icon src="res/icon/icon-72.png" gap:platform="android" gap:qualifier="hdpi" /> + <icon src="res/icon/icon-144.png" gap:platform="android" gap:qualifier="xhdpi" /> + <icon src="res/icon/icon-192.png" gap:platform="android" gap:qualifier="xxhdpi" /> <!-- Windows Phone --> - <icon src="icon.png" gap:platform="winphone" /> - <icon src="tileicon.png" gap:platform="winphone" gap:role="background" /> + <icon src="icon-48.png" gap:platform="winphone" /> + <icon src="icon-173.png" gap:platform="winphone" gap:role="background" /> <!-- Define app splash screen for each platform. --> <gap:splash src="splash.png" /> <!-- iOS --> <!-- iPhone and iPod touch --> - <gap:splash src="Default.png" gap:platform="ios" width="320" height="480" /> - <gap:splash src="Default@2x.png" gap:platform="ios" width="640" height="960" /> + <!-- + <gap:splash src="res/screen/Default.png" gap:platform="ios" width="320" height="480" /> + <gap:splash src="res/screen/Default@2x.png" gap:platform="ios" width="640" height="960" /> + --> <!-- iPhone 5 / iPod Touch (5th Generation) --> - <gap:splash src="Default-568h@2x.png" gap:platform="ios" width="640" height="1136" /> + <!-- + <gap:splash src="res/screen/Default-568h@2x.png" gap:platform="ios" width="640" height="1136" /> + --> <!-- iPhone 6 --> - <gap:splash src="Default-667h@2x.png" gap:platform="ios" width="750" height="1334" /> - <gap:splash src="Default-Portrait-736h@3x.png" gap:platform="ios" width="1242" height="2208" /> - <gap:splash src="Default-Landscape-736h@3x.png" gap:platform="ios" width="2208" height="1242" /> + <!-- + <gap:splash src="res/screen/Default-667h@2x.png" gap:platform="ios" width="750" height="1334" /> + <gap:splash src="res/screen/Default-Portrait-736h@3x.png" gap:platform="ios" width="1242" height="2208" /> + <gap:splash src="res/screen/Default-Landscape-736h@3x.png" gap:platform="ios" width="2208" height="1242" /> + --> <!-- iPad --> - <gap:splash src="Default-Portrait.png" gap:platform="ios" width="768" height="1024" /> - <gap:splash src="Default-Landscape.png" gap:platform="ios" width="1024" height="768" /> + <!-- + <gap:splash src="res/screen/Default-Portrait.png" gap:platform="ios" width="768" height="1024" /> + <gap:splash src="res/screen/Default-Landscape.png" gap:platform="ios" width="1024" height="768" /> + --> <!-- Retina iPad --> - <gap:splash src="Default-Portrait@2x.png" gap:platform="ios" width="1536" height="2048" /> - <gap:splash src="Default-Landscape@2x.png" gap:platform="ios" width="2048" height="1536" /> + <!-- + <gap:splash src="res/screen/Default-Portrait@2x.png" gap:platform="ios" width="1536" height="2048" /> + <gap:splash src="res/screen/Default-Landscape@2x.png" gap:platform="ios" width="2048" height="1536" /> + --> <!-- Android --> - <gap:splash src="ldpi.png" gap:platform="android" gap:qualifier="ldpi" /> - <gap:splash src="mdpi.png" gap:platform="android" gap:qualifier="mdpi" /> - <gap:splash src="hdpi.png" gap:platform="android" gap:qualifier="hdpi" /> - <gap:splash src="xhdpi.png" gap:platform="android" gap:qualifier="xhdpi" /> - <gap:splash src="fr-xhdpi.png" gap:platform="android" gap:qualifier="fr-xhdpi" /> - <gap:splash src="portrait-xxhdpi.png" gap:platform="android" gap:qualifier="port-xxhdpi" /> - <gap:splash src="landscape-xxhdpi.png" gap:platform="android" gap:qualifier="land-xxhdpi" /> + <!-- + <gap:splash src="res/screen/ldpi.png" gap:platform="android" gap:qualifier="ldpi" /> + <gap:splash src="res/screen/mdpi.png" gap:platform="android" gap:qualifier="mdpi" /> + <gap:splash src="res/screen/hdpi.png" gap:platform="android" gap:qualifier="hdpi" /> + <gap:splash src="res/screen/xhdpi.png" gap:platform="android" gap:qualifier="xhdpi" /> + <gap:splash src="res/screen/portrait-xxhdpi.png" gap:platform="android" gap:qualifier="port-xxhdpi" /> + <gap:splash src="res/screen/landscape-xxhdpi.png" gap:platform="android" gap:qualifier="land-xxhdpi" /> + --> + <gap:splash src="splash.png" gap:platform="android" gap:qualifier="ldpi" /> + <gap:splash src="splash.png" gap:platform="android" gap:qualifier="mdpi" /> + <gap:splash src="splash.png" gap:platform="android" gap:qualifier="hdpi" /> + <gap:splash src="splash.png" gap:platform="android" gap:qualifier="xhdpi" /> <!-- Windows Phone --> - <gap:splash src="splash/winphone/splash.jpg" gap:platform="winphone" /> + <!-- + <gap:splash src="res/screen/splash.jpg" gap:platform="winphone" /> + --> <gap:config-file platform="ios" parent="CFBundleShortVersionString"> <string>100</string> @@ -194,9 +210,14 @@ --> <access origin="*"/> + <!--access origin="*" browserOnly="false" /--> <!-- Whitelist configuration. Refer to https://github.com/apache/cordova-plugin-whitelist --> - <plugin name="cordova-plugin-whitelist" version="1" /> + <!--plugin name="cordova-plugin-whitelist" version="1" /--> + + <!-- if you are using the online phonegap build service the syntax is different. --> + <gap:plugin name="cordova-plugin-whitelist" source="npm" /> + <!-- Intent Whitelist --> <!-- Controls which URLs the app is allowed to ask the system to open. By default, no external URLs are allowed. --> <allow-intent href="http://*/*" /> @@ -212,5 +233,6 @@ <allow-intent href="itms:*" /> <allow-intent href="itms-apps:*" /> </platform> + <allow-navigation href="*" /> </widget>
\ No newline at end of file diff --git a/favicon.ico b/favicon.ico Binary files differnew file mode 100644 index 0000000..f5637ac --- /dev/null +++ b/favicon.ico diff --git a/icon.png b/icon.png Binary files differnew file mode 100644 index 0000000..16ed12c --- /dev/null +++ b/icon.png @@ -1,10 +1,33 @@ <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> - <meta name="viewport" content="width=device-width, target-densitydpi=device-dpi"> + <!--meta name="viewport" content="width=device-width, target-densitydpi=device-dpi"--> + <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no"> + <meta name='HandheldFriendly' content='True'> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"> <meta name="format-detection" content="telephone=no"> + <!-- TODO: required by phonegap whitelistening + meta http-equiv="Content-Security-Policy" content="frame-src *"--> + <link rel="shortcut icon" type="image/x-icon" href="favicon.ico" /> + <link rel="icon" sizes="32x32" type="image/png" href="res/icon/icon-32.png" /> + <link rel="icon" sizes="48x48" type="image/png" href="res/icon/icon-48.png" /> + <link rel="icon" sizes="64x64" type="image/png" href="res/icon/icon-64.png" /> + <link rel="icon" sizes="96x96" type="image/png" href="res/icon/icon-96.png" /> + <link rel="icon" sizes="128x128" type="image/png" href="res/icon/icon-128.png" /> + <link rel="icon" sizes="256x256" type="image/png" href="res/icon/icon-256.png" /> + <link rel="apple-touch-icon" href="res/icon/icon-60.png" /> + <link rel="apple-touch-icon" sizes="76x76" href="res/icon/icon-76.png" /> + <link rel="apple-touch-icon" sizes="120x120" href="res/icon/icon-120.png" /> + <link rel="apple-touch-icon" sizes="152x152" href="res/icon/icon-152.png" /> + <link rel="apple-touch-icon" sizes="180x180" href="res/icon/icon-180.png" /> + <style> + @-ms-viewport { + width: device-width; + height: device-height; + } + /* placeholder for run-time generated styles */ + </style> <!-- CodeMirror --> <link rel="stylesheet" href="css/codemirror/codemirror.css" type="text/css"> <link rel="stylesheet" href="css/codemirror/show-hint.css" type="text/css"> @@ -16,6 +39,16 @@ <link rel="stylesheet" href="css/codeq/console.css" type="text/css"> <link rel="stylesheet" href="css/codeq/hint.css" type="text/css"> <title>CodeQ</title> + <script> + // remove any state marker from the URL before everything else loads + (function(){ + var r = location.href.split('?'), + replaceHref = r.length > 1; + r = r[0].split('#'); + replaceHref = replaceHref || (r.length > 1); + if (replaceHref) location.href = r[0]; + })(); + </script> </head> <body> <!-- the status bar at the top of each page --> @@ -42,7 +75,7 @@ <li style="display: none;" id="navigation-prolog"><a href="" data-tkey="prolog">Prolog</a></li> <li style="display: none;" id="navigation-robot"><a href="" data-tkey="robot">Robot</a></li> </ul> - <ul class="nav navbar-nav navbar-right" style="display: none;"> + <ul class="nav navbar-nav navbar-right" style="display:none;"> <p class="navbar-text"><span data-tkey="signed_in_as">Signed in as </span><span id="signed-in-title">Janez</span></p> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="true"> @@ -51,7 +84,7 @@ <ul class="dropdown-menu"> <li id="navigation-logout"><a href="#" data-tkey="logout">Logout</a></li> <li id="navigation-profile"><a href="#" data-tkey="profile">Profile</a></li> - <li role="separator" class="divider"></li> + <li class="saml-login-hide divider" role="separator"></li> <li class="saml-login-hide"><a href="#" data-toggle="modal" data-target="#modalChangePassword" data-tkey="change_pass" id="change-password">Change password</a></li> </ul> </li> @@ -191,7 +224,7 @@ </form> </div> <div class="panel-footer text-center"> - <button class="btn btn-default" data-dismiss="modal" aria-hidden="true" data-tkey="cancel" id="cancel_change_pass_button">Cancel</button> + <button class="btn btn-default" data-tkey="cancel" id="cancel_change_pass_button">Cancel</button> <input form="formChangePassword" class="btn btn-primary" id="btnPasswdChange" type="submit" data-tkey-value="change_password_button" value="Change password"></button> </div> </div> @@ -345,8 +378,8 @@ <h2> <span data-tkey="profile">Profile</span> <div class="btn-group pull-right"> - <a href="" data-toggle="modal" data-target="#modalChangePassword" class="btn btn-default saml-login-hide" data-tkey="change_pass" id="change_pass_profile">Change Password</a> - <a href="#" class="btn btn-default" id="btnProfileGoBack" onclick="history.back()" data-tkey="go_back">Go back</a> + <button type="button" class="btn btn-default saml-login-hide" data-tkey="change_pass" id="change_pass_profile">Change Password</button> + <button type="button" class="btn btn-default" id="btnProfileGoBack" data-tkey="go_back">Go back</button> </div> </h2> <hr> @@ -359,6 +392,7 @@ <ul class="list-group small"> <li class="list-group-item text-right"><span class="pull-left"><strong data-tkey="username">Username</strong></span><span id="profileUsername">janezk</span></li> <li class="list-group-item text-right"><span class="pull-left"><strong data-tkey="name">Display name</strong></span><span id="profileName">Janez Kranjski</span></li> + <li class="list-group-item text-right"><span class="pull-left"><strong data-tkey="email">E-email</strong></span><span id="profileEmail">janez.kranjski@dezela_kranjska.si</span></li> <li class="list-group-item text-right"><span class="pull-left"><strong data-tkey="joined">Joined</strong></span><span id="profileJoined">Sep 29, 2015</span></li> <li class="list-group-item text-right"><span class="pull-left"><strong data-tkey="last_login">Last seen</strong></span><span id="profileLastLogin">1 hour ago</span></li> </ul> @@ -439,6 +473,7 @@ <script type="text/javascript" src="cordova.js"></script> <!-- codeq app cont. --> <script src="js/codeq/init.js"></script> + <script src="js/codeq/misc.js"></script> <script src="js/codeq/translation.js"></script> <script src="js/codeq/navigation.js"></script> <script src="js/codeq/comms.js"></script> diff --git a/js/codeq/core.js b/js/codeq/core.js index a3e9589..309195b 100644 --- a/js/codeq/core.js +++ b/js/codeq/core.js @@ -391,6 +391,10 @@ 'line-layout', 'square-layout' ], + + 'runningOnPhone': false, // default value, will be changed if detected otherwise + 'browserType': 'unknown', + 'platformType': 'unknown', 'isWebApp': false, // this is a PhoneGap/Cordova build, will be overridden in cordova.js for webapp 'setLayout': function(newLayout){ diff --git a/js/codeq/init.js b/js/codeq/init.js index 811d781..98a41a2 100644 --- a/js/codeq/init.js +++ b/js/codeq/init.js @@ -94,8 +94,12 @@ else { // we are a phonegap native app document.addEventListener("deviceready", Boot, false); - codeq.ajaxPrefix = 'http://codeq.si/'; - codeq.eioHost= 'wss://codeq.si'; + // production + //codeq.ajaxPrefix = 'http://codeq.si/'; + //codeq.eioHost= 'ws://codeq.si'; + // dev + codeq.ajaxPrefix = 'http://212.235.189.51:22180/'; + codeq.eioHost= 'ws://212.235.189.51:22180'; } })(); diff --git a/js/codeq/login.js b/js/codeq/login.js index 61f248d..db90b43 100644 --- a/js/codeq/login.js +++ b/js/codeq/login.js @@ -7,19 +7,21 @@ jqNavigationHomeBtn = $('#navigation-home'), jqAAILoginBtn = $('#aai_login_button'), jqSignupBtn = $('#signup_button'), - jqSubmitLoginBtn = $("#submit"); + jqSubmitLoginBtn = $("#submit"), + jqDisabled = $('#disabled'); //the loginCallbackFunction is used here and in the AAI login as well codeq.loginCallbackFunction = function (data) { - $('#disabled').css('display', 'none'); - $('#disabled').css('cursor', ''); + jqDisabled.css('display', 'none'); + jqDisabled.css('cursor', ''); if (data.code !== 0) throw new Error('Login failed, code: ' + data.code + ', message: ' + data.message); //nav signed in... - $('#signed-in-title').html(data.name||$('#username').val()); + $('#signed-in-title').html(data.name||data.username||data.email||'undefined'); //merge with profile page - $('#profileUsername').html($('#username').val()); + $('#profileUsername').html(data.username||data.email||'undefined'); $('#profileName').html(data.name||'undefined'); + $('#profileEmail').html(data.email||'undefined'); $('#profileJoined').html(new Date(data.joined).toLocaleString()); $('#profileLastLogin').html(new Date(data["last-login"]).toLocaleString()); @@ -42,19 +44,19 @@ var loginFun = function(){ $('.saml-login-hide').css('display','');//if we login the normal way we want to show the change password buttons. if we enter the saml login they will be hidden - $('#disabled').css('display', ''); - $('#disabled').css('cursor', 'wait'); + jqDisabled.css('display', ''); + jqDisabled.css('cursor', 'wait'); codeq.comms.connect() .then(function () { return codeq.comms.login($('#username').val(), $('#password').val()); }) .then(codeq.loginCallbackFunction) .fail(function (reason) { - $('#disabled').css('display', 'none'); - $('#disabled').css('cursor', ''); + jqDisabled.css('display', 'none'); + jqDisabled.css('cursor', ''); codeq.log.error('Login failed: ' + reason, reason); alert('Login request failed: ' + reason); - $('#disabled').css('display', 'none'); + jqDisabled.css('display', 'none'); }) .done(); }, @@ -85,7 +87,7 @@ }); //$('#modalLogIn').modal(); $("#screen_login").css('display', ''); - $('#disabled').css('display', 'none'); + jqDisabled.css('display', 'none'); }, 'exit' : function(){ //remove the listener from the buttons specific to this page diff --git a/js/codeq/misc.js b/js/codeq/misc.js new file mode 100644 index 0000000..b83f271 --- /dev/null +++ b/js/codeq/misc.js @@ -0,0 +1,71 @@ +/* Detect if we're on a phone, browser and platform type */ +(function browserDetection() { + var platform = navigator.platform, + userAgent = navigator.userAgent, + runningOnPhone = false, // default value, will be changed if detected otherwise + browserType = 'unknown', + platformType = 'unknown'; + + // Apple platforms + if ((/iPod/.test(platform)) || (/iPhone/.test(platform))) { + runningOnPhone = true; + browserType = 'safari'; + platformType = 'iapple'; + } + else if (/iPad/.test(platform)) { + runningOnPhone = false; + browserType = 'safari'; + platformType = 'iapple'; + } + else { + // general test for phones + if (/[Mm]obile/.test(userAgent)) { + runningOnPhone = true; + } + + if ((/MSIE/.test(userAgent) && /Touch/.test(userAgent)) || (/IEMobile/.test(userAgent))) { + platformType = 'ietouch'; + } + + if (/BlackBerry/.test(userAgent) || /BB10/.test(userAgent)) { + platformType = 'blackberry'; + } + + // general browser tests + if (/Presto/.test(userAgent)) { + browserType = 'opera'; + } + else if (/Android/.test(userAgent)) { + // Android platform: only firefox, webkit, and chrome are possible + platformType = 'android'; + if (/Chrome/.test(userAgent)) { + browserType = 'chrome'; + } + else if (/Firefox/.test(userAgent)) { + browserType = 'firefox'; + } + else if (/Safari/.test(userAgent)) { + browserType = 'webkit'; + } + } + else { + // desktop, or other mobile platforms + if (/Chrome/.test(userAgent)) { + browserType = 'chrome'; + } + else if (/Firefox/.test(userAgent)) { + browserType = 'firefox'; + } + else if (/Safari/.test(userAgent)) { + browserType = 'webkit'; + } + else if (/MSIE/.test(userAgent)) { + browserType = 'ie'; + } + } + } + + codeq.runningOnPhone = runningOnPhone; + codeq.browserType = browserType; + codeq.platformType = platformType; +})();
\ No newline at end of file diff --git a/js/codeq/profile.js b/js/codeq/profile.js index 133c947..36c5ccf 100644 --- a/js/codeq/profile.js +++ b/js/codeq/profile.js @@ -4,13 +4,20 @@ (function(){
- var jqBtnChangePass = $("#change_pass_profile");
+ var jqBtnChangePass = $("#change_pass_profile"),
+ jqBtnGoBack = $("#btnProfileGoBack");
codeq.profile = {
};
codeq.globalStateMachine.register('profile',{
'enter': function(){
+ jqBtnChangePass.on('click',function(){
+ codeq.globalStateMachine.transition('changePassword');
+ });
+ jqBtnGoBack.on('click',function(){
+ history.back();//forces a transition to the previous state
+ });
$("#screen_profile").css('display', '');
$('#disabled').css('display', 'none');
codeq.comms.getUserStat()
@@ -19,7 +26,6 @@ data = data.stat;
var columns = ['language', 'problem_group', 'problems_count', 'done', 'in_progress'],
- labels = ['Language', 'Problem group', 'All', 'Done', 'In progress'],
items='<thead><tr>',
tr_gui = codeq.tr.getDictionary('gui');
@@ -53,13 +59,11 @@ alert('GetUserStat failed: ' + reason);
})
.done();
- jqBtnChangePass.on('click',function(){
- codeq.globalStateMachine.transition('changePassword');
- });
},
'exit' : function(){
- $("#screen_profile").css('display', 'none');
jqBtnChangePass.off('click');
+ jqBtnGoBack.off('click');
+ $("#screen_profile").css('display', 'none');
}
});
})();
\ No newline at end of file diff --git a/res/icon/icon-120.png b/res/icon/icon-120.png Binary files differnew file mode 100644 index 0000000..dde7af3 --- /dev/null +++ b/res/icon/icon-120.png diff --git a/res/icon/icon-128.png b/res/icon/icon-128.png Binary files differnew file mode 100644 index 0000000..16ed12c --- /dev/null +++ b/res/icon/icon-128.png diff --git a/res/icon/icon-144.png b/res/icon/icon-144.png Binary files differnew file mode 100644 index 0000000..8661d95 --- /dev/null +++ b/res/icon/icon-144.png diff --git a/res/icon/icon-152.png b/res/icon/icon-152.png Binary files differnew file mode 100644 index 0000000..cb4d236 --- /dev/null +++ b/res/icon/icon-152.png diff --git a/res/icon/icon-173.png b/res/icon/icon-173.png Binary files differnew file mode 100644 index 0000000..ac24fc0 --- /dev/null +++ b/res/icon/icon-173.png diff --git a/res/icon/icon-180.png b/res/icon/icon-180.png Binary files differnew file mode 100644 index 0000000..6323fda --- /dev/null +++ b/res/icon/icon-180.png diff --git a/res/icon/icon-192.png b/res/icon/icon-192.png Binary files differnew file mode 100644 index 0000000..b6ccd29 --- /dev/null +++ b/res/icon/icon-192.png diff --git a/res/icon/icon-256.png b/res/icon/icon-256.png Binary files differnew file mode 100644 index 0000000..a11b0c9 --- /dev/null +++ b/res/icon/icon-256.png diff --git a/res/icon/icon-32.png b/res/icon/icon-32.png Binary files differnew file mode 100644 index 0000000..4654d10 --- /dev/null +++ b/res/icon/icon-32.png diff --git a/res/icon/icon-36.png b/res/icon/icon-36.png Binary files differnew file mode 100644 index 0000000..e063a9c --- /dev/null +++ b/res/icon/icon-36.png diff --git a/res/icon/icon-40.png b/res/icon/icon-40.png Binary files differnew file mode 100644 index 0000000..d3bbea6 --- /dev/null +++ b/res/icon/icon-40.png diff --git a/res/icon/icon-48.png b/res/icon/icon-48.png Binary files differnew file mode 100644 index 0000000..28aa1cc --- /dev/null +++ b/res/icon/icon-48.png diff --git a/res/icon/icon-60.png b/res/icon/icon-60.png Binary files differnew file mode 100644 index 0000000..5000e8b --- /dev/null +++ b/res/icon/icon-60.png diff --git a/res/icon/icon-64.png b/res/icon/icon-64.png Binary files differnew file mode 100644 index 0000000..82bc17d --- /dev/null +++ b/res/icon/icon-64.png diff --git a/res/icon/icon-72.png b/res/icon/icon-72.png Binary files differnew file mode 100644 index 0000000..a6b5827 --- /dev/null +++ b/res/icon/icon-72.png diff --git a/res/icon/icon-76.png b/res/icon/icon-76.png Binary files differnew file mode 100644 index 0000000..0158006 --- /dev/null +++ b/res/icon/icon-76.png diff --git a/res/icon/icon-80.png b/res/icon/icon-80.png Binary files differnew file mode 100644 index 0000000..0237b97 --- /dev/null +++ b/res/icon/icon-80.png diff --git a/res/icon/icon-96.png b/res/icon/icon-96.png Binary files differnew file mode 100644 index 0000000..abeb98a --- /dev/null +++ b/res/icon/icon-96.png diff --git a/res/icon/icon-small.png b/res/icon/icon-small.png Binary files differnew file mode 100644 index 0000000..0db735e --- /dev/null +++ b/res/icon/icon-small.png diff --git a/res/icon/icon-small@2x.png b/res/icon/icon-small@2x.png Binary files differnew file mode 100644 index 0000000..bce9aea --- /dev/null +++ b/res/icon/icon-small@2x.png diff --git a/splash.png b/splash.png Binary files differnew file mode 100644 index 0000000..015c96b --- /dev/null +++ b/splash.png |