Skip to content

Commit

Permalink
Merge pull request #599 from baka-kaba/release-3.4.1-production
Browse files Browse the repository at this point in the history
Release 3.4.1-production

Merged master's commits that have diverged from develop
Version bump to 3.4.1
Updated changelog
  • Loading branch information
baka-kaba authored Apr 8, 2018
2 parents 0d9f5ce + 77f5ede commit 6761044
Show file tree
Hide file tree
Showing 86 changed files with 2,307 additions and 603 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,7 @@ bin
tests
out
build/
gradle/
gradle/

# Secrets as resources
**/*/res/values/secrets.xml
41 changes: 26 additions & 15 deletions Awful.apk/build.gradle
Original file line number Diff line number Diff line change
@@ -1,36 +1,39 @@
buildscript {
ext.kotlin_version = '1.1.51'

repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
maven { url 'https://maven.google.com' }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.android.tools.build:gradle:3.0.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'io.fabric.tools:gradle:1.+'
}
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'io.fabric'

repositories {
mavenCentral()
jcenter()
maven { url 'https://maven.google.com' }
maven { url 'https://maven.fabric.io/public' }
maven { url 'https://jitpack.io' }
}

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
compileSdkVersion 26
buildToolsVersion '26.0.2'

defaultConfig {
applicationId = "com.ferg.awfulapp"
minSdkVersion 15
targetSdkVersion 25
targetSdkVersion 26
resConfigs "en"

jackOptions {
enabled true
}

// Stops the Gradle plugin’s automatic rasterization of vectors
vectorDrawables.useSupportLibrary = true

Expand Down Expand Up @@ -78,25 +81,32 @@ android {
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility 1.8
targetCompatibility 1.8
}
}

dependencies {
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"

compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:design:26.1.0'

// used to fix SSL issues on older devices - old version so it works on the API 18 emulator THANKS GOOGLE
compile 'com.google.android.gms:play-services-auth:9.2.1'
//compile 'com.mcxiaoke.volley:library:1.0.19'
compile 'com.github.samkirton:android-volley:9aba4f5f86'
compile 'com.google.code.gson:gson:2.8.0'
compile 'org.jsoup:jsoup:1.10.2'
compile 'org.jsoup:jsoup:1.10.3'
compile 'com.jakewharton.threetenabp:threetenabp:1.0.4'
compile 'com.samskivert:jmustache:1.13'
compile 'org.apache.httpcomponents:httpmime:4.3.1'

compile group: 'cz.msebera.android' , name: 'httpclient', version: '4.4.1.1'
compile ('org.apache.httpcomponents:httpmime:4.3.1') {
exclude module: "httpclient"
}
compile 'org.apache.httpcomponents:httpcore:4.3.1'

compile 'org.apache.commons:commons-lang3:3.4'
compile 'com.ToxicBakery.viewpager.transforms:view-pager-transforms:1.2.32@aar'
compile 'com.github.orangegangsters:swipy:1.2.3@aar'
Expand All @@ -113,4 +123,5 @@ dependencies {

testCompile 'junit:junit:4.12'
testCompile 'org.hamcrest:hamcrest-library:1.3'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
}
17 changes: 3 additions & 14 deletions Awful.apk/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ferg.awfulapp"
android:versionCode="177"
android:versionName="3.3.3"
android:versionCode="181"
android:versionName="3.4.1"
android:installLocation="auto">
<supports-screens
android:smallScreens="true"
Expand Down Expand Up @@ -75,8 +75,7 @@
android:configChanges="orientation|keyboardHidden|screenSize"
/>
<activity
android:name="com.ferg.awfulapp.announcements.AnnouncementsActivity"
android:label="@string/announcements"
android:name="com.ferg.awfulapp.BasicActivity"
android:windowSoftInputMode="adjustResize"
android:configChanges="orientation|keyboardHidden|screenSize"
/>
Expand Down Expand Up @@ -110,16 +109,6 @@
<data android:pathPrefix="/private.php" />
</intent-filter>
</activity>
<activity
android:name="com.ferg.awfulapp.SearchActivity"
android:windowSoftInputMode="adjustResize"
android:configChanges="orientation|keyboardHidden|screenSize"
/>
<activity
android:name="com.ferg.awfulapp.ImageViewActivity"
android:windowSoftInputMode="adjustResize"
android:configChanges="orientation|keyboardHidden|screenSize"
/>

<provider android:name="com.ferg.awfulapp.provider.AwfulProvider" android:authorities="${applicationId}.provider" />
<meta-data android:name="com.google.android.backup.api_key"
Expand Down
40 changes: 40 additions & 0 deletions Awful.apk/src/main/assets/javascript/embedding.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
//
// Created by baka kaba on 16/08/2017.
//
// Functions to automatically embed page content, e.g. turn an Instagram URL into a widget
//

function processThreadEmbeds() {

// map preference keys to their corresponding embed functions
var embedFunctions = {
"inlineInstagram": embedInstagram
}

// check all embed preference keys - any set to true, run their embed function
for (embedType in embedFunctions) {
if (listener.getPreference(embedType) == "true") {
embedFunctions[embedType].call()
}
}

function embedInstagram() {
// get each Instagram link, and replace it with the HTML from the embed API call
var promises = []
$('.postcontent').find('a[href*="instagr.am/p"], a[href*="instagram.com/p"]')
.each(function() {
var link = $(this)
var url = link.attr('href')
api_call = "https://api.instagram.com/oembed?omitscript=true&url=" + url + "&callback=?"
promises.push($.getJSON(api_call, function(data) { link.replaceWith(data.html) }));
});
// do nothing if we have nothing to embed
if (promises.length == 0) return

// add the embed script, and run it after all the HTML widgets have been added
$('<script>').attr('src', 'https://platform.instagram.com/en_US/embeds.js').appendTo('head')
// potential race condition here if the promises complete before the script loads, so the function isn't available yet
$.when.apply($, promises).then(function() { instgrm.Embeds.process() });
}

}
2 changes: 2 additions & 0 deletions Awful.apk/src/main/assets/javascript/thread.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ function pageInit() {
});
}

processThreadEmbeds();

$('.postcontent').find('div.bbcode_video object param[value^="http://vimeo.com"]').each(function(){
var videoID = $(this).attr('value').match(/clip_id=(\d+)/)
if (videoID === null) return
Expand Down
122 changes: 122 additions & 0 deletions Awful.apk/src/main/assets/javascript/zepto/callbacks.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
// Zepto.js
// (c) 2010-2016 Thomas Fuchs
// Zepto.js may be freely distributed under the MIT license.

;(function($){
// Create a collection of callbacks to be fired in a sequence, with configurable behaviour
// Option flags:
// - once: Callbacks fired at most one time.
// - memory: Remember the most recent context and arguments
// - stopOnFalse: Cease iterating over callback list
// - unique: Permit adding at most one instance of the same callback
$.Callbacks = function(options) {
options = $.extend({}, options)

var memory, // Last fire value (for non-forgettable lists)
fired, // Flag to know if list was already fired
firing, // Flag to know if list is currently firing
firingStart, // First callback to fire (used internally by add and fireWith)
firingLength, // End of the loop when firing
firingIndex, // Index of currently firing callback (modified by remove if needed)
list = [], // Actual callback list
stack = !options.once && [], // Stack of fire calls for repeatable lists
fire = function(data) {
memory = options.memory && data
fired = true
firingIndex = firingStart || 0
firingStart = 0
firingLength = list.length
firing = true
for ( ; list && firingIndex < firingLength ; ++firingIndex ) {
if (list[firingIndex].apply(data[0], data[1]) === false && options.stopOnFalse) {
memory = false
break
}
}
firing = false
if (list) {
if (stack) stack.length && fire(stack.shift())
else if (memory) list.length = 0
else Callbacks.disable()
}
},

Callbacks = {
add: function() {
if (list) {
var start = list.length,
add = function(args) {
$.each(args, function(_, arg){
if (typeof arg === "function") {
if (!options.unique || !Callbacks.has(arg)) list.push(arg)
}
else if (arg && arg.length && typeof arg !== 'string') add(arg)
})
}
add(arguments)
if (firing) firingLength = list.length
else if (memory) {
firingStart = start
fire(memory)
}
}
return this
},
remove: function() {
if (list) {
$.each(arguments, function(_, arg){
var index
while ((index = $.inArray(arg, list, index)) > -1) {
list.splice(index, 1)
// Handle firing indexes
if (firing) {
if (index <= firingLength) --firingLength
if (index <= firingIndex) --firingIndex
}
}
})
}
return this
},
has: function(fn) {
return !!(list && (fn ? $.inArray(fn, list) > -1 : list.length))
},
empty: function() {
firingLength = list.length = 0
return this
},
disable: function() {
list = stack = memory = undefined
return this
},
disabled: function() {
return !list
},
lock: function() {
stack = undefined
if (!memory) Callbacks.disable()
return this
},
locked: function() {
return !stack
},
fireWith: function(context, args) {
if (list && (!fired || stack)) {
args = args || []
args = [context, args.slice ? args.slice() : args]
if (firing) stack.push(args)
else fire(args)
}
return this
},
fire: function() {
return Callbacks.fireWith(this, arguments)
},
fired: function() {
return !!fired
}
}

return Callbacks
}
})(Zepto)
Loading

0 comments on commit 6761044

Please sign in to comment.