-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Milestone 1.3.1: Type definitions for guppy, removed blobbuilder #9278
Changes from all commits
c98b113
89e1634
965d9bc
0c98038
3d8ba96
de5d02a
071baf7
0cb20ea
2f8195b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -91,27 +91,7 @@ angular.module('oppia').factory('AssetsBackendApiService', [ | |
}).then(function(response) { | ||
var assetBlob = null; | ||
var data = response.data; | ||
try { | ||
assetBlob = new Blob([data], {type: data.type}); | ||
} catch (exception) { | ||
window.BlobBuilder = window.BlobBuilder || | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are we deleting these? [This helps us to have this functionality in cross-browser/devices.] There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. According to @vojtechjelinek all the browsers have this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. all the new updated/browsers, right? (Have you check why this was added in the first place? Also, might worth checking server log errors for the errors dict reported through this function) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kevintab95 Can you please check the server logs for the message that we are deleting? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the info, @kevintab95! |
||
window.WebKitBlobBuilder || | ||
window.MozBlobBuilder || | ||
window.MSBlobBuilder; | ||
if (exception.name === 'TypeError' && window.BlobBuilder) { | ||
var blobBuilder = new BlobBuilder(); | ||
blobBuilder.append(data); | ||
assetBlob = blobBuilder.getBlob(assetType.concat('/*')); | ||
} else { | ||
var additionalInfo = ( | ||
'\nBlob construction error debug logs:' + | ||
'\nAsset type: ' + assetType + | ||
'\nData: ' + data | ||
); | ||
exception.message += additionalInfo; | ||
throw exception; | ||
} | ||
} | ||
assetBlob = new Blob([data], {type: data.type}); | ||
assetsCache[filename] = assetBlob; | ||
if (assetType === ASSET_TYPE_AUDIO) { | ||
successCallback( | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
/* eslint-disable camelcase */ | ||
// Code - third_party/static/guppy-b5055b/src/guppy.js | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wanted to check whether Guppy can also be an auto-upgrade? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't really know what is the proccess of upgrading the libs in manifest.json. Probably @vojtechjelinek can help here. Also Guppy's repo has been inactive for about 2 years. And we are using the latest version from that repo I guess. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, it can't since even a minor version needs to be upgraded manually. |
||
|
||
interface GuppyConfig { | ||
events?: Object; | ||
settings?: Object; | ||
} | ||
|
||
interface GuppyInitConfig { | ||
symbols?: string[]; | ||
path?: string; | ||
osk?: Object; | ||
events?: { | ||
ready?: Function; | ||
change?: Function; | ||
left_end?: Function; | ||
done?: Function; | ||
completion?: Function; | ||
debug?: Function; | ||
error?: Function; | ||
focus?: Function; | ||
} | ||
settings?: { | ||
xml_content?: string; | ||
autoreplace?: string; | ||
blank_caret?: string; | ||
empty_content?: string; | ||
blacklist?: string[]; | ||
buttons?: string[]; | ||
cliptype?: string; | ||
} | ||
callback?: Function; | ||
} | ||
|
||
interface GuppySymbols { | ||
symbols?: Object; | ||
templates?: Object; | ||
validate: Function; | ||
symbol_to_node: Function; | ||
split_output: Function; | ||
make_template_symbol: Function; | ||
lookup_type: Function; | ||
eval_template: Function; | ||
add_symbols: Function; | ||
add_blanks: Function; | ||
} | ||
|
||
class Guppy { | ||
activate: () => void; | ||
asciimath: () => void; | ||
deactivate: () => void; | ||
doc: () => Object; | ||
equations: () => Array<Object>; | ||
evaluate: (evaluators?: Object) => Object; | ||
func: (evaluators?: Object) => Function; | ||
import_latex: (text: string) => void; | ||
import_syntax_tree: (tree: Object) => void; | ||
import_text: (text: string) => void; | ||
import_xml: (text: string) => void; | ||
is_changed: () => boolean; | ||
latex: () => string; | ||
recompute_locations_paths: () => void; | ||
render: (updated?: boolean) => void; | ||
render_node: (t: string) => string; | ||
select_to: (x: number, y: number, mouse: Object) => void; | ||
symbols_used: (groups?: Array<String>) => string[]; | ||
syntax_tree: () => Object; | ||
text: () => string; | ||
vars: () => string[]; | ||
xml: () => string; | ||
|
||
constructor(id: string, config: GuppyConfig); | ||
} | ||
|
||
namespace Guppy { | ||
export function init(config: GuppyInitConfig): void; | ||
export let instances: Object; | ||
export let active_guppy: Object; | ||
export let Symbols: GuppySymbols; | ||
export let Doc: Function; | ||
export function add_global_symbol( | ||
name: string, symbol: Object, template?: string): void; | ||
export function get_loc( | ||
x: number, y: number, current_node?: Object, current_caret?: Object): { | ||
current: Object, | ||
caret: number, | ||
pos: string | ||
}; | ||
export let kb: Object; | ||
export function make_button(url: string, cb: Function): HTMLImageElement; | ||
export function mouse_down(e: Object): void; | ||
export function mouse_move(e: Object): void; | ||
export function mouse_up(): void; | ||
export let ready: boolean; | ||
export function register_keyboard_handlers(): void; | ||
export function remove_global_symbol(name: string): void; | ||
} |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure we have another test for the success process.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only removed the part where
BlobBuilder
was involved.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please check whether we still have a test that checks the successful creation of Blob out of fetched audio/images data? Maybe share the link to that test block*
[This comment wasn't published earlier]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here
oppia/core/templates/services/assets-backend-api.service.spec.ts
Line 132 in 2f8195b