-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #599 from baka-kaba/release-3.4.1-production
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
Showing
86 changed files
with
2,307 additions
and
603 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,4 +41,7 @@ bin | |
tests | ||
out | ||
build/ | ||
gradle/ | ||
gradle/ | ||
|
||
# Secrets as resources | ||
**/*/res/values/secrets.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() }); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
122 changes: 122 additions & 0 deletions
122
Awful.apk/src/main/assets/javascript/zepto/callbacks.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Oops, something went wrong.