JDownloader Community - Appwork GmbH
 

Notices

Reply
 
Thread Tools Display Modes
  #1641  
Old 08.01.2021, 19:40
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 69,349
Default

@SMS: please use board search how to use packagizer to auto rename links via meta information within URL, eg https://board.jdownloader.org/showpo...18&postcount=2
__________________
JD-Dev & Server-Admin
Reply With Quote
  #1642  
Old 15.01.2021, 13:24
SMS SMS is offline
DSL User
 
Join Date: Jun 2019
Posts: 36
Default

Quote:
Originally Posted by Jiaz View Post
@SMS: please use board search how to use packagizer to auto rename links via meta information within URL, eg **External links are only visible to Support Staff**...
There seems to be a bug, I just described it here: https://board.jdownloader.org/showpo...5&postcount=40
Reply With Quote
  #1643  
Old 15.01.2021, 13:39
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 69,349
Default

@SMS: no bug, I've answered in the thread
__________________
JD-Dev & Server-Admin
Reply With Quote
  #1644  
Old 15.01.2021, 17:23
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,049
Default

YT playlist workaround script:

Code:
gist.github.com/mgpai/b2c21be86fbdf2186eca34af16cfb95d
Reply With Quote
  #1645  
Old 16.01.2021, 01:29
SMS SMS is offline
DSL User
 
Join Date: Jun 2019
Posts: 36
Default

What's a graceful way to check whether a string is contained in another string? Both strings are variables, so it can't be a hardcoded regex pattern.

Usually JavaScript offers string1.includes(string2), or the older string1.contains(string2), but neither work.

In general, what JavaScript version does the Event Scripter use?

And how do I find out what methods are available for a certain object or class? string1.getOwnPropertyNames() doesn't work.

@mgpai: Thanks for the YouTube script, I'll try it!
Reply With Quote
  #1646  
Old 16.01.2021, 10:52
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,049
Default

Quote:
Originally Posted by SMS View Post
What's a graceful way to check whether a string is contained in another string? Both strings are variables, so it can't be a hardcoded regex pattern.
You can use String/RegExp Object methods:
Code:
str1.indexOf(str2) > -1; // boolean
new RegExp(str2).test(str1) // boolean
Quote:
Originally Posted by SMS View Post
Usually JavaScript offers string1.includes(string2), or the older string1.contains(string2), but neither work.

In general, what JavaScript version does the Event Scripter use?
JD uses Rhino/ES5 version. ES6 methods like 'includes' are not supported.

You can define your own prototype:
Code:
String.prototype.includes = function(str2) {
    return this.indexOf(str2) > -1;
}

//Usage
var result = "str1".includes("str2"); // boolean
Quote:
Originally Posted by SMS View Post
And how do I find out what methods are available for a certain object or class? string1.getOwnPropertyNames() doesn't work.
Code:
Object.getOwnPropertyNames(String);
Quote:
Originally Posted by SMS View Post
@mgpai: Thanks for the YouTube script, I'll try it!
You're welcome.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 15:42.
Provided By AppWork GmbH | Privacy | Imprint
Parts of the Design are used from Kirsch designed by Andrew & Austin
Powered by vBulletin® Version 3.8.10 Beta 1
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.