Fix doc snippets. (#3882)

* Remove a duplicate snippet: image-create-datauri
* Remove a reference to a missing snippet: console-dump
* Readd a missing snippet: imagesource-resname
* Fix a broken snippet reference: timer-set-ten
* Fix a broken snippet reference: timer-set-fifty
This commit is contained in:
Hristo Deshev
2017-03-28 11:04:37 +03:00
committed by GitHub
parent 1dfc3da1cb
commit 04b9b39c65
5 changed files with 5 additions and 10 deletions

View File

@ -26,10 +26,6 @@ Asserts a boolean condition and prints a message in case the assert fails.
Prints the state of the specified object to the console. Prints the state of the specified object to the console.
{%snippet console-dir%} {%snippet console-dir%}
### Dump
Prints the state of the specified object to the console.
{%snippet console-dump%}
### Trace ### Trace
Prints the current stack trace in the console. Prints the current stack trace in the console.
{%snippet console-trace%} {%snippet console-trace%}

View File

@ -16,7 +16,9 @@ var imagePath = "~/logo.png";
var smallImagePath = "~/small-image.png"; var smallImagePath = "~/small-image.png";
export function testFromResource() { export function testFromResource() {
// >> imagesource-resname
var img = imageSource.fromResource("icon"); var img = imageSource.fromResource("icon");
// << imagesource-resname
TKUnit.assert(img.height > 0, "image.fromResource failed"); TKUnit.assert(img.height > 0, "image.fromResource failed");
} }

View File

@ -82,12 +82,11 @@ export function test_setTimeout_callbackShouldBeCleared() {
completed = true; completed = true;
// << (hide) // << (hide)
}, 50); }, 50);
// << timer-set-fifty
//// Clear timeout with specified id. //// Clear timeout with specified id.
timer.clearTimeout(id); timer.clearTimeout(id);
// << timer-set-twothousands // << timer-set-fifty
TKUnit.wait(0.060); TKUnit.wait(0.060);
timer.clearTimeout(id); timer.clearTimeout(id);

View File

@ -13,10 +13,10 @@ previous_url: /ApiReference/timer/HOW-TO
{%snippet timer-set-zero%} {%snippet timer-set-zero%}
### Evaluates an expression after a specified number of milliseconds. ### Evaluates an expression after a specified number of milliseconds.
{%snippet timer-set-fivehundred%} {%snippet timer-set-ten%}
### Cancels the evaluation with the clearTimeout method. ### Cancels the evaluation with the clearTimeout method.
{%snippet timer-set-twothousands%} {%snippet timer-set-fifty%}
### Evaluates an expression each time a specified number of milliseconds has elapsed. ### Evaluates an expression each time a specified number of milliseconds has elapsed.
{%snippet timer-set-expression%} {%snippet timer-set-expression%}

View File

@ -126,10 +126,8 @@ export const test_SettingImageSrcToDataURI_sync = function () {
}; };
export const test_SettingImageSrcToDataURI_async = function (done) { export const test_SettingImageSrcToDataURI_async = function (done) {
// >> img-create-datauri
const image = new ImageModule.Image(); const image = new ImageModule.Image();
image.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAAXNSR0IArs4c6QAAABxpRE9UAAAAAgAAAAAAAAACAAAAKAAAAAIAAAACAAAARiS4uJEAAAASSURBVBgZYvjPwABHSMz/DAAAAAD//0GWpK0AAAAOSURBVGNgYPiPhBgQAACEvQv1D5y/pAAAAABJRU5ErkJggg=="; image.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAAXNSR0IArs4c6QAAABxpRE9UAAAAAgAAAAAAAAACAAAAKAAAAAIAAAACAAAARiS4uJEAAAASSURBVBgZYvjPwABHSMz/DAAAAAD//0GWpK0AAAAOSURBVGNgYPiPhBgQAACEvQv1D5y/pAAAAABJRU5ErkJggg==";
// << img-create-datauri
runImageTestAsync(image, image.src, done); runImageTestAsync(image, image.src, done);
}; };