Plugin/Code Troubleshooting

Page 4 of 13 Previous  1, 2, 3, 4, 5 ... 11, 12, 13  Next

View previous topic View next topic Go down

Re: Plugin/Code Troubleshooting

Post  Doonge on Sat Jan 28, 2012 9:50 am

Okay I installed Chrome and I see the problem, I'm on it.

the URL being with &seq=40 is fine, I'll handle that too.

Doonge
Artisan
Artisan

Posts : 754
Join date : 2012-01-18

View user profile

Back to top Go down

Re: Plugin/Code Troubleshooting

Post  Doonge on Sat Jan 28, 2012 1:06 pm

// ==UserScript==
// @name Doonge
// @namespace Doonge
// @description OddSquad Translation
// @include http://comic.naver.com/webtoon/detail.nhn?titleId=186811&*
// ==/UserScript==


var webComic = document.getElementById("comic_view_area");
webComic.addEventListener("DOMNodeInserted",load_OddSquad);

var no = extractUrlParams();
if(no["no"]){no = no["no"];}
else if(no["seq"]){no = no["seq"];}
else {no = false;}

var OddSquad_Images = new Array();
load_OddSquad();

function load_OddSquad()
{
if(!no) {return false;}

var webComic_images = webComic.getElementsByTagName("img");
for (var i = 0; i < webComic_images.length; i++)
{
var img_number = webComic_images[i].src.substr(-6,2).replace("_","0");
if(!OddSquad_Images[img_number])
{
OddSquad_Images[img_number] = new Image();
OddSquad_Images[img_number].id = webComic_images[i].id;
OddSquad_Images[img_number].onload = function(){OddSquad_Swap(this);};
OddSquad_Images[img_number].src = "http://remedy.forgottenrain.net/CITT/no"+no+"/no"+no+"p"+img_number+".png";
}
}
}


function OddSquad_Swap(OddSquad_Image)
{
var obj = document.getElementById(OddSquad_Image.id);
if(OddSquad_Image.width && obj)
{
obj.setAttribute("style","background:url('"+obj.getAttribute("src")+"')");
obj.setAttribute("src",OddSquad_Image.src);
}
}

function extractUrlParams(){
var t = location.search.substring(1).split('&');
var f = [];
for (var i=0; i<t.length; i++){
var x = t[ i ].split('=');
f[x[0]]=x[1];
}
return f;
}

Doonge
Artisan
Artisan

Posts : 754
Join date : 2012-01-18

View user profile

Back to top Go down

Re: Plugin/Code Troubleshooting

Post  noobzilla on Sat Jan 28, 2012 10:54 pm

working perfectly~

Now using non split images with c25 to 37 and this script, but chrome performs REALLY horribly if I do that. I have 6gb ram and it still get rly rly slow. And i tried on my teensy netbook it just froze.

Maybe using IF and ELSE tags it could be possible to selectively load the js files of the old chapters...

noobzilla
Admin

Posts : 266
Join date : 2010-12-25

Character sheet
Name: Jung
Class: Very High.
Race: Human

View user profile http://oddsquad.userboard.net

Back to top Go down

Re: Plugin/Code Troubleshooting

Post  Doonge on Sun Jan 29, 2012 5:04 am

it freezes with the background trick but not with the div ? That's odd (AH ! Ah !).

You split the images because of the freezing then I guess ?

If yes, I can just try to mix both methods.
I'll be back this evening or tomorrow, I'll post the script at that moment, which basically will just do your extra div trick, but works for every chapters you've translated.

Unless you've experienced problems with your good ol' method (but I think it works for most without troubles).


I'll post also what you asked.

Doonge
Artisan
Artisan

Posts : 754
Join date : 2012-01-18

View user profile

Back to top Go down

Re: Plugin/Code Troubleshooting

Post  noobzilla on Sun Jan 29, 2012 5:06 am

Yeah it freezes for both div and background trick. I split them for chrome's lag freezing in the first place. So yeah that would be really awesome!

Edit: I am renaming the old chapters as no26/no26p01 and so on, so maybe the old method can be used dynamically for c25-c37 with a single script. Because it seems noscript only blocks the code when it's coming from a different server like code.google.com or whatever.

noobzilla
Admin

Posts : 266
Join date : 2010-12-25

Character sheet
Name: Jung
Class: Very High.
Race: Human

View user profile http://oddsquad.userboard.net

Back to top Go down

Re: Plugin/Code Troubleshooting

Post  Doonge on Mon Jan 30, 2012 9:57 am

Here's the code.

Due to chrome lagging, and due to split images for chapters 25-37, I use the div trick and not the background one, which might give alignement problem (you say if that's the case).
Due to chrome handling inadequately the window.onload event, I use an "addEventListener" which is not compatible for every browser. All I know for now is that it should work for Firefox and Chrome.

If you want to make this code work for chapters 37 and below, here's the expected URL format for your images :
http://remedy.forgottenrain.net/CITT/no00/no00p00_01.png
http://remedy.forgottenrain.net/CITT/no00/no00p00_02.png
http://remedy.forgottenrain.net/CITT/no00/no00p00_03.png
http://remedy.forgottenrain.net/CITT/no00/no00p00_04.png
...

a.k.a
http://remedy.forgottenrain.net/CITT/no00/no00p00_00.png


// ==UserScript==
// @name Doonge
// @namespace Doonge
// @description OddSquad Translation
// @include http://comic.naver.com/webtoon/detail.nhn?titleId=186811&*
// ==/UserScript==

var webComic = document.getElementById("comic_view_area");
var pox = document.createElement('div');
pox.setAttribute("style","z-index:10;position:absolute;top:0px;left:0px;");
pox.className='wt_viewer';
pox.id = 'oddsquad';
pox.innerHTML= '';
webComic.appendChild(pox);
var oddSquadDiv = document.getElementById("oddsquad");
webComic.addEventListener("DOMNodeInserted",loadOddSquad);

var no = extractUrlParams();
if(no["no"]){no = no["no"];}
else if(no["seq"]){no = no["seq"];}
else {no = false;}

var oddSquadImages = new Array();
var oddSquadValidURLs = new Array();
loadOddSquad();

function loadOddSquad()
{
if(!no || no <= 25) {return false;}

var webComicImages = webComic.getElementsByTagName("img");
for (var i = 0; i < webComicImages.length; i++)
{
var imgNumber = webComicImages[i].src.substr(-6,2).replace("_","0");
var number = parseInt(imgNumber,10);
if(!oddSquadImages[number])
{
oddSquadValidURLs[number] = new Array();
oddSquadImages[number] = new Image();
oddSquadImages[number].imgNumber = imgNumber;
if(no > 39)
{
oddSquadImages[number].onload = function(){oddSquadQueue(this);};
oddSquadImages[number].src = "http://remedy.forgottenrain.net/CITT/no"+no+"/no"+no+"p"+imgNumber+".png";
}
else
{
oddSquadImages[number].onload = function(){oddSquadQueue(this,1);};
oddSquadImages[number].src = "http://remedy.forgottenrain.net/CITT/no"+no+"/no"+no+"p"+imgNumber+"_01.png";
}
}
}
}


function oddSquadQueue(oddSquadImage, split)
{
oddSquadValidURLs[parseInt(oddSquadImage.imgNumber,10)].push(oddSquadImage.src);

oddSquadDiv.innerHTML = '';
for(var i =1;i<oddSquadValidURLs.length;i++)
{
for(var j=0;j<oddSquadValidURLs[i].length;j++)
{
oddSquadDiv.innerHTML += '<img src="'+oddSquadValidURLs[i][j]+'" />';
}
}

if(split)
{
split = split + 1;
oddSquadImage.onload = function(){oddSquadQueue(this,split);};
if(split < 10)
{oddSquadImage.src = "http://remedy.forgottenrain.net/CITT/no"+no+"/no"+no+"p"+oddSquadImage.imgNumber+"_0"+split+".png";}
else
{oddSquadImage.src = "http://remedy.forgottenrain.net/CITT/no"+no+"/no"+no+"p"+oddSquadImage.imgNumber+"_"+split+".png";}
}
}

function extractUrlParams(){
var t = location.search.substring(1).split('&');
var f = [];
for (var i=0; i<t.length; i++){
var x = t[ i ].split('=');
f[x[0]]=x[1];
}
return f;
}


Last edited by Doonge on Mon Jan 30, 2012 10:38 am; edited 1 time in total

Doonge
Artisan
Artisan

Posts : 754
Join date : 2012-01-18

View user profile

Back to top Go down

Re: Plugin/Code Troubleshooting

Post  noobzilla on Mon Jan 30, 2012 10:06 am

Ah darn now i have to rename them again ><

noobzilla
Admin

Posts : 266
Join date : 2010-12-25

Character sheet
Name: Jung
Class: Very High.
Race: Human

View user profile http://oddsquad.userboard.net

Back to top Go down

Re: Plugin/Code Troubleshooting

Post  Doonge on Mon Jan 30, 2012 10:16 am

just copy one of them, do not rename too quickly ^^

Since I had no img to work with for chapters 25 to 37, I'm not 100% sure it works perfectly yet.

Doonge
Artisan
Artisan

Posts : 754
Join date : 2012-01-18

View user profile

Back to top Go down

Re: Plugin/Code Troubleshooting

Post  noobzilla on Mon Jan 30, 2012 10:18 am

Well I set these images like this: no26p01, no26p02, no26p03, no26p04 instead of no26p02_01, no26p02_02, no26p02_03

Edit: I renamed it like you said, it's working

noobzilla
Admin

Posts : 266
Join date : 2010-12-25

Character sheet
Name: Jung
Class: Very High.
Race: Human

View user profile http://oddsquad.userboard.net

Back to top Go down

Re: Plugin/Code Troubleshooting

Post  Doonge on Mon Jan 30, 2012 10:30 am

Okay wait a minute then, because I saw you renamed chapter 25, and though it works, I find there are too many GET (html command from the browser) for my taste.

It's hard to circumvent it, since I'm supposed to make it work with Chrome, but I'll think a little.

Doonge
Artisan
Artisan

Posts : 754
Join date : 2012-01-18

View user profile

Back to top Go down

Re: Plugin/Code Troubleshooting

Post  Doonge on Mon Jan 30, 2012 10:36 am

No it's okay =)

Doonge
Artisan
Artisan

Posts : 754
Join date : 2012-01-18

View user profile

Back to top Go down

Re: Plugin/Code Troubleshooting

Post  noobzilla on Mon Jan 30, 2012 11:13 am

Doesn't work on firefox

raw pages 2 and 4 just disappears

noobzilla
Admin

Posts : 266
Join date : 2010-12-25

Character sheet
Name: Jung
Class: Very High.
Race: Human

View user profile http://oddsquad.userboard.net

Back to top Go down

Re: Plugin/Code Troubleshooting

Post  Doonge on Mon Jan 30, 2012 12:27 pm

Nothing should disappear, since it's just a div that is added.

What chapter should I try ?

Did you successfully delete the old script ?

Doonge
Artisan
Artisan

Posts : 754
Join date : 2012-01-18

View user profile

Back to top Go down

Re: Plugin/Code Troubleshooting

Post  noobzilla on Mon Jan 30, 2012 10:00 pm

Works now... donno what i was doing wrong :/

Put it up on the other thread, for public DLing, btw since I don't wanna get a headache answering questions about greasemonkey usage i just went ahead and made the userscript into a firefox addon.

noobzilla
Admin

Posts : 266
Join date : 2010-12-25

Character sheet
Name: Jung
Class: Very High.
Race: Human

View user profile http://oddsquad.userboard.net

Back to top Go down

Re: Plugin/Code Troubleshooting

Post  Doonge on Tue Jan 31, 2012 7:06 am

Okay, I don't know if it's that much more difficult to install greasemonkey (relatively automatized through firefox) then install the userscript than it is difficult to install a custom addon.

The forum seems to send me a mail each time someone posts here, so if there is any change to be made, here's a good place to ask ^^

Doonge
Artisan
Artisan

Posts : 754
Join date : 2012-01-18

View user profile

Back to top Go down

Re: Plugin/Code Troubleshooting

Post  noobzilla on Tue Jan 31, 2012 7:15 am

Oh i find it easy, but... you don't realise the amount of people that find it difficult to copy paste things. If you follow some of the troubleshooting questions and some comments over at mangafox (don't read them unless you wanna melt that brain) ... you'll realize it soon enough.

noobzilla
Admin

Posts : 266
Join date : 2010-12-25

Character sheet
Name: Jung
Class: Very High.
Race: Human

View user profile http://oddsquad.userboard.net

Back to top Go down

Re: Plugin/Code Troubleshooting

Post  CheeryCherry on Tue Jan 31, 2012 2:15 pm

Hey I've a question.

The Chrome add-on isn't working for me. I downloaded the right extension and dragged it to Chrome, but while Chrome opens up the file, I don't get any message saying "install" or whatever.
I'm not sure what the problem is. :c

CheeryCherry
Newbie
Newbie

Posts : 2
Join date : 2012-01-31

View user profile

Back to top Go down

Re: Plugin/Code Troubleshooting

Post  pokadot5 on Tue Jan 31, 2012 2:28 pm

Please Help! I downloaded the new add-on for firefox, seemed to install just fine, restarted firefox, checked to see if it is enabled in extensions, everything fine, went to Naver's page, opened chapter 40 (and also tried others) and I got this every time popping up at the top and no translation "[Javascript Application] Error:Component is not available". I restarted Firefox, a few times, reinstalled the extension. Still showing the error. I really did not want to bother anyone with this, so I searched online in vain. Also downloaded Chrome as the last option and the file won't install and just opens the code in a tab with no install option. Please help me, I would really like Firefox to work!

thank you for your hard work!

PS. the individual codes for each chapter still work fine for me, so if anything I'll just continue using web console...

pokadot5
Newbie
Newbie

Posts : 2
Join date : 2012-01-31

View user profile

Back to top Go down

Re: Plugin/Code Troubleshooting

Post  Doonge on Tue Jan 31, 2012 4:58 pm

@CherryCherry

noobzilla should rename the file ChromeCITT.js to ChromeCITT.user.js
Since you already downloaded it, just rename the file so it ends with a "user.js" (whatever.user.js, ChromeCITT.user.js).
Then drag&drop and it should work.


@pokadot5

I didn't make the addon. I suppose maybe javascript isn't up to date on your browser, but it's just a guess.
You could tell me what plugin you have (Firefox > Addons > Plugins), but you could also try the extension I personally use : GreaseMonkey.
https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/
Once that extension is installed, create a new userscript in the GreaseMonkey menu. It will ask for a text editor (maybe), and others things you may skip (press "ok" right away) until a text file is opened. In that text file, copy-paste ALL the content of the Chrome "addon" (it's just a text file with a .js extension).


edit:
I'm trying the addon right now out of curiosity.

edit2: works for me. There might be a javascript problem, what's your firefox version (I guess it's up to date), and the javascript plugins currently in use ?

Doonge
Artisan
Artisan

Posts : 754
Join date : 2012-01-18

View user profile

Back to top Go down

Re: Plugin/Code Troubleshooting

Post  CheeryCherry on Tue Jan 31, 2012 8:29 pm

Yaaay, it's working now.

Thank you very much. ;p

CheeryCherry
Newbie
Newbie

Posts : 2
Join date : 2012-01-31

View user profile

Back to top Go down

Re: Plugin/Code Troubleshooting

Post  noobzilla on Tue Jan 31, 2012 10:18 pm

Ah forgot about the .user.js part when renaming. It's fixed now.

noobzilla
Admin

Posts : 266
Join date : 2010-12-25

Character sheet
Name: Jung
Class: Very High.
Race: Human

View user profile http://oddsquad.userboard.net

Back to top Go down

Re: Plugin/Code Troubleshooting

Post  pokadot5 on Thu Feb 02, 2012 10:48 am

The Chrome suggestion (changing the extension to .user.js) worked great. And for some reason Firefox stabilized on it's own after my computer took a rest for a day Smile no more errors and translations shows up just fine.

Now all I need is to choose the better browser for my CITT addiction...

Thank you so much!!!


pokadot5
Newbie
Newbie

Posts : 2
Join date : 2012-01-31

View user profile

Back to top Go down

Problems translating after chapter 42

Post  GoldenFire89 on Sun Feb 05, 2012 5:47 pm

Hello, I would first like to say how incredibly ecstatic I was to find these legal translations. I was heartbroken after finding out that the author didn't want them distributed anymore, but I absolutely loved Cheese in the Trap, so I kept checking every once in a while in despair. and I actually came across these by accident by a pathway from 1/2 Prince scans, to the novel, to the rest of the website, so just saying, but thank you, your other works are also greatly appreciated.

But, getting to the point, I have Google Chrome as my browser and the plugin worked great up to chapter 42, after which point, the translation stopped loading. I refreshed the page several times, closed and reopened my window, checked that the plugin was enabled, opened several of the previous chapters using the links on Naver and on oddsquad (all of which came up fine), and checked the page with the instructions.

I have run out of ideas, but not chapters nor interest. Please help me figure out how to get it to work again! Thank you!

GoldenFire89
Newbie
Newbie

Posts : 1
Join date : 2012-02-05

View user profile

Back to top Go down

Re: Plugin/Code Troubleshooting

Post  noobzilla on Sun Feb 05, 2012 10:43 pm

.... we didn't translate past 42 yet. Please read our blog to see what the last chapter translated was before asking

noobzilla
Admin

Posts : 266
Join date : 2010-12-25

Character sheet
Name: Jung
Class: Very High.
Race: Human

View user profile http://oddsquad.userboard.net

Back to top Go down

opera

Post  AceMaster on Tue Feb 07, 2012 10:37 am

hello
why didn't you guys make an opera post to(i think it's used more often than chrome?)
by the time i noticed it's in the "detailed method" post i already found the way to do it on my own lol
its ctrl+shift+i if anyone interested:D

btw for always translating on opera
1.go to settings/preference(or press ctrl+F12)
2.next click on advanced tab then content
3.enable javascript(if scripts doesn't work you can check http://www.opera.com/docs/browserjs/)
4.click on JavaScript Options...
5.i have all checked except open console on error
6.set a path to any directory you want
7.create a txt file and rename it to anyname.js in that directory
8. then edit or open with notepad or any text editor
Code:



window.addEventListener('load', function(){

//line specific for naver.com
//can be ommited if code deosn't work
if( location.hostname.indexOf('comic.naver.com') != -1 ) {



//Translation code from Odd Squad
//this is for cheese in the trap
//javascript: was ommited if you didn't notice
var citt=document.createElement('script');
citt.type='text/javascript';
citt.src= 'http://cheeseitt.googlecode.com/files/Universalcode.js';
document.body.appendChild(citt);
//end of translation code

}
}, false );

// i don't know javascript  so i'm not sure if it works for everyone
// i just look over some random js file to get an idea on how to do it

AceMaster
Newbie
Newbie

Posts : 2
Join date : 2012-02-07

View user profile

Back to top Go down

Re: Plugin/Code Troubleshooting

Post  Sponsored content Today at 11:10 am


Sponsored content


Back to top Go down

Page 4 of 13 Previous  1, 2, 3, 4, 5 ... 11, 12, 13  Next

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum