Greasy Fork is available in English.

討論 » 建立請求

Generate filename image firefox dialogue open/save script

§
發表於:2016-04-06

Generate filename image firefox dialogue open/save script

Sorry my Google Translate English,

Please help me create javascript that would perform the functions specified in the title. It requires that it outputs the result of the functions listed below in the following form: "%originalfilename%_resultworkjavascript".

Еxample: Get greasyfork.org > right click logo image > Save Image As... > "SCN2YQGWLIU4_3u3tq6oc46f6u0yyfz.png" Extension may be not only ".PNG" . May be other image extensions.

Generator random expression:

 $(function() {
    function str_rand() {
        var result       = '';
        var words        = '0123456789qwertyuiopasdfghjklzxcvbnm';
        var max_position = words.length - 1;
            for( i = 0; i < 18; ++i ) {
                position = Math.floor ( Math.random() * max_position );
                result = result + words.substring(position, position + 1);
            }
        return result;
    }


    $("#run").click(function() {
    $("#resultwork").val(str_rand());
});
});

And what to do next, I do not know.

發表回覆

登入以回復