(name, code, options, cb)
| 2529 | }; |
| 2530 | |
| 2531 | var saveScript = function(name, code, options, cb) { |
| 2532 | if (options.reload === undefined) options.reload = true; |
| 2533 | // options { old_url, new_url, clean, reload } |
| 2534 | |
| 2535 | try { |
| 2536 | var ou = options.old_url ? options.old_url : ""; |
| 2537 | var nu = (options.new_url && options.new_url != options.old_url) ? options.new_url : ""; |
| 2538 | |
| 2539 | chrome.extension.sendMessage({method: "saveScript", |
| 2540 | name: name, |
| 2541 | code: code, |
| 2542 | clean : options.clean, |
| 2543 | force : options.force, |
| 2544 | file_url: ou, |
| 2545 | force_url: nu, |
| 2546 | reload: options.reload }, |
| 2547 | function(response) { |
| 2548 | if (response.items) { |
| 2549 | scheduleReCreate(response.items, name && true); |
| 2550 | } |
| 2551 | if (!code && options.reload) { |
| 2552 | Please.hide(); |
| 2553 | } |
| 2554 | if (cb) { |
| 2555 | cb(response); |
| 2556 | } |
| 2557 | }); |
| 2558 | Please.wait(I18N.getMessage("Please_wait___")); |
| 2559 | } catch (e) { |
| 2560 | console.log("sS: " + e.message); |
| 2561 | } |
| 2562 | }; |
| 2563 | |
| 2564 | var setOption = function(name, value, ignore) { |
| 2565 | try { |
no test coverage detected
searching dependent graphs…