Plugin/Code Troubleshooting

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

View previous topic View next topic Go down

Re: Plugin/Code Troubleshooting

Post  misato17 on Tue Jan 24, 2012 11:12 am

Oh ok. I can read CITT now so all is well. I'm so happy 'cause I love this webtoon. so addicting. Again thanks for the help. Very Happy

Hello again, I'm sorry but I found another problem. Chapter 27's translations doesn't seem to align with the original. This is what happens:



and then in Chapter 31, it starts ok but towards the end, the translation doesn't align again. The problem stars somewhere in this part:



I checked all the chapters, and these two were the only problematic ones. Am I doing something wrong? TIA



misato17
Newbie
Newbie

Posts : 4
Join date : 2012-01-23

View user profile

Back to top Go down

Re: Plugin/Code Troubleshooting

Post  noobzilla on Thu Jan 26, 2012 2:14 am

You shouldn't have that problem anymore. Btw Doonge I tried to use that code but some pages are just not showing up.

Code:
var OddSquad_URLs = new Array(
"http://remedy.forgottenrain.net/CITT/sn1/s1c38/s1c38p01.png",
"http://remedy.forgottenrain.net/CITT/sn1/s1c38/s1c38p02.png",
"http://remedy.forgottenrain.net/CITT/sn1/s1c38/s1c38p03.png",
"http://remedy.forgottenrain.net/CITT/sn1/s1c38/s1c38p04.png",
"http://remedy.forgottenrain.net/CITT/sn1/s1c38/s1c38p05.png",
"http://remedy.forgottenrain.net/CITT/sn1/s1c38/s1c38p06.png",
"http://remedy.forgottenrain.net/CITT/sn1/s1c38/s1c38p07.png",
"http://remedy.forgottenrain.net/CITT/sn1/s1c38/s1c38p08.png",
"http://remedy.forgottenrain.net/CITT/sn1/s1c38/s1c38p09.png",
"http://remedy.forgottenrain.net/CITT/sn1/s1c38/s1c38p10.png",
"http://remedy.forgottenrain.net/CITT/sn1/s1c38/s1c38p11.png",
"http://remedy.forgottenrain.net/CITT/sn1/s1c38/s1c38p12.png",
"http://remedy.forgottenrain.net/CITT/sn1/s1c38/s1c38p13.png",
"http://remedy.forgottenrain.net/CITT/sn1/s1c38/s1c38p14.png",
"http://remedy.forgottenrain.net/CITT/sn1/s1c38/s1c38p15.png",
"http://remedy.forgottenrain.net/CITT/sn1/s1c38/s1c38p16.png",
"http://remedy.forgottenrain.net/CITT/sn1/s1c38/s1c38p17.png",
"http://remedy.forgottenrain.net/CITT/sn1/s1c38/s1c38p18.png",
"http://remedy.forgottenrain.net/CITT/sn1/s1c38/s1c38p19.png",
"http://remedy.forgottenrain.net/CITT/sn1/s1c38/s1c38p20.png",
"http://remedy.forgottenrain.net/CITT/sn1/s1c38/s1c38p21.png",
"http://remedy.forgottenrain.net/CITT/sn1/s1c38/s1c38p22.png",
"http://remedy.forgottenrain.net/CITT/sn1/s1c38/s1c38p23.png",
"http://remedy.forgottenrain.net/CITT/sn1/s1c38/s1c38p24.png"
);
var OddSquad_Images = new Array();

var ref_src = document.getElementById("content_image_0").src.slice(0,-5);

for (var i = 0; i < document.images.length; i++)
{
if(document.images[i].src.substr(0,ref_src.length) == ref_src)
{
var img_number = document.images[i].src.substr(ref_src.length,3);
img_number = img_number.substr(0,img_number.indexOf(".")) - 1;
if(OddSquad_URLs[img_number])
{
OddSquad_Images[img_number] = new Image();
OddSquad_Images[img_number].id = i;
OddSquad_Images[img_number].onload = function(){OddSquad_Swap(this);};
OddSquad_Images[img_number].src = OddSquad_URLs[img_number];
}
}
}

function OddSquad_Swap(OddSquad_Image)
{
var obj = document.images[OddSquad_Image.id];
if(OddSquad_Image.width && obj)
{
obj.setAttribute("style","background:url('"+obj.getAttribute("src")+"')");
obj.setAttribute("src",OddSquad_Image.src);
}
}
avatar
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  misato17 on Thu Jan 26, 2012 6:21 am

I can read all chapters now. Thank you very much!!! Very Happy

misato17
Newbie
Newbie

Posts : 4
Join date : 2012-01-23

View user profile

Back to top Go down

Re: Plugin/Code Troubleshooting

Post  Doonge on Thu Jan 26, 2012 7:24 am

Okay noobzilla, I see why, here's a little correction.

Since you seem to use a personnal FTP account to store your images, and you have control over the name of your images, I added another correction which should allow the script to work for any future chapter (but it requires you to rename a little differently your images) without you writing all over again the OddSquad_URLs for each chapter.

var no = location.search.indexOf("no=");
if(no)
{no=location.search.substring(no+3).split("&",1)[0];

var OddSquad_Images = new Array();
var ref_src = document.getElementById("content_image_0").src;
ref_src = ref_src.slice(0,ref_src.lastIndexOf("/")+1);

for (var i = 0; i < document.images.length; i++)
{
if(document.images[i].src.substr(0,ref_src.length) == ref_src)
{
var img_number = document.images[i].src.substr(-6,2).replace("_","0");
OddSquad_Images[img_number] = new Image();
OddSquad_Images[img_number].id = i;
OddSquad_Images[img_number].onload = function(){OddSquad_Swap(this);};
//notice for noobzilla : here instead of 38, "no" (see first line) should be used but that count the extra chapters too (no = 40 for chapter 38).
//the line would be : OddSquad_Images[img_number].src = "http://remedy.forgottenrain.net/CITT/sn1/s1c"+no+"/s1c"+no+"p"+img_number+".png";

OddSquad_Images[img_number].src = "http://remedy.forgottenrain.net/CITT/sn1/s1c38/s1c38p"+img_number+".png";
}

} //end for(images)

} //end if(no)


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



Last edited by Doonge on Thu Jan 26, 2012 11:16 am; edited 2 times in total
avatar
Doonge
Artisan
Artisan

Posts : 768
Join date : 2012-01-18

View user profile

Back to top Go down

Re: Plugin/Code Troubleshooting

Post  noobzilla on Thu Jan 26, 2012 7:32 am

Ah awesome nice code~
avatar
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 Thu Jan 26, 2012 8:00 am

I made it shorter.

I advice you to use the "no" as classification ID for the files, instead of season and chapter, that way one javascript code will work for any chapter.

It should look like that :

http://remedy.forgottenrain.net/CITT/no#/no#p#.png

If you want to keep the season / chapter system, some javascript should be added, and modified each time a "special" chapter is made (or missing).
It's very doable, but the only purpose is to have a season/chapter organised FTP file system, which is not really needed.

It's up to you, I can do that if you want.
avatar
Doonge
Artisan
Artisan

Posts : 768
Join date : 2012-01-18

View user profile

Back to top Go down

Re: Plugin/Code Troubleshooting

Post  noobzilla on Thu Jan 26, 2012 9:41 am

Well that link is doable. But then chapter 38 would be 40 right?
avatar
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 Thu Jan 26, 2012 11:07 am

Yes.


If you do so, then all the chapters from now on will require the same javascript file.

That one :

var no = location.search.indexOf("no=");
if(no)
{no=location.search.substring(no+3).split("=",1)[0];

var OddSquad_Images = new Array();
var ref_src = document.getElementById("content_image_0").src;
ref_src = ref_src.slice(0,ref_src.lastIndexOf("/")+1);

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

} //end for(images)

} //end if(no)


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


Then just combine it with GreaseMonkey
https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/

That's it.

A little tweak might be required if you decide to widen the use of GreaseMonkey, because we must wait for all the page to be loaded before launching the javascript code.
avatar
Doonge
Artisan
Artisan

Posts : 768
Join date : 2012-01-18

View user profile

Back to top Go down

Re: Plugin/Code Troubleshooting

Post  Doonge on Thu Jan 26, 2012 11:37 am

Here's an example of GreaseMonkey useage :

1°) Get GreaseMonkey https://addons.mozilla.org/firefox/addon/greasemonkey/

2°) Once it's installed, launch the 'new user script' option.

3°)
Name => whatever you want to name it, something like "Cheese in the Trap"
Nametag => something short and clear, like "citt".
Description => whatever, may leave blank, or "Apply OddSquad's translation to Naver.com"

Include => http://comic.naver.com/webtoon/detail.nhn?titleId=186811&no=*
Exclude => leave blank.

4°) A text editor will be asked. Search for Notepad for instance, or Wordpad.

5°) Copy Paste

window.onload = function(){load_OddSquad();};

function load_OddSquad()
{

var no = location.search.indexOf("no=");

if(no) {

no=location.search.substring(no+3).split("&",1)[0];
var OddSquad_Images = new Array();
var ref_src = document.getElementById("content_image_0").src;
ref_src = ref_src.slice(0,ref_src.lastIndexOf("/")+1);
for (var i = 0; i < document.images.length; i++)
{
if(document.images[i].src.substr(0,ref_src.length) == ref_src){
var img_number = document.images[i].src.substr(-6,2).replace("_","0");
OddSquad_Images[img_number] = new Image();
OddSquad_Images[img_number].id = i;
OddSquad_Images[img_number].onload = function(){OddSquad_Swap(this);};
OddSquad_Images[img_number].src = "http://remedy.forgottenrain.net/CITT/sn1/no"+no+"/no"+no+"p"+img_number+".png";
}
} //end for(images)
} //end if(no)
} //end func


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


And that's it.
avatar
Doonge
Artisan
Artisan

Posts : 768
Join date : 2012-01-18

View user profile

Back to top Go down

Re: Plugin/Code Troubleshooting

Post  noobzilla on Thu Jan 26, 2012 11:46 am

remedy.forgottenrain.net/CITT/sn1/no40/s1no40p01.png < isn't that how its supposed to be? its not working
avatar
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 Thu Jan 26, 2012 11:55 am

remedy.forgottenrain.net/CITT/sn1/no40/no40p01.png

instead of

remedy.forgottenrain.net/CITT/sn1/no40/s1no40p01.png

there is no "s1" with a "n° of contribution from the author" logic ^^

In the javascript there is the line

OddSquad_Images[img_number].src = "http://remedy.forgottenrain.net/CITT/sn1/no"+no+"/no"+no+"p"+img_number+".png";


When you browse the Naver website, and the CiTT webcomic, you may observe in the url that there is a "no=...".

This "no" starts at 1 (the prologue), and counts the number of "chapters" since then.

I can't guess what the season is (s1, s2) just from the URL, or even the images src, that's why I can't automatise it in the javascript.

I could bypass it, but it's a little bothersome, for not much (just ditch out "s1" in the fileame).

And I'm beginning to understand that "sn1" is supposed to mean season 1 also ?

I could ditch it out too.

OddSquad_Images[img_number].src = "http://remedy.forgottenrain.net/CITT/no"+no+"/no"+no+"p"+img_number+".png";

like that.
avatar
Doonge
Artisan
Artisan

Posts : 768
Join date : 2012-01-18

View user profile

Back to top Go down

Re: Plugin/Code Troubleshooting

Post  noobzilla on Thu Jan 26, 2012 12:20 pm

still doesn't work. i'm gonna sleep now. I'll move no40 folder into citt so now its

remedy.forgottenrain.net/CITT/no40/no40p01.png and so on.
avatar
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  noobzilla on Thu Jan 26, 2012 12:21 pm

still doesn't work. i'm gonna sleep now. I'll move no40 folder into citt so now its

remedy.forgottenrain.net/CITT/no40/no40p01.png and so on. it's not possible to completely automate this because 25 to 37 I need to use the split images hence the old code.
avatar
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 Thu Jan 26, 2012 12:23 pm

I'll try and search why it doesn't work.

edit: works perfectly for me.

Here's the GreaseMonkey file I have

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

window.onload = function(){load_OddSquad();};

function load_OddSquad()
{

var no = location.search.indexOf("no=");

if(no) {

no=location.search.substring(no+3).split("&",1)[0];
var OddSquad_Images = new Array();
var ref_src = document.getElementById("content_image_0").src;
ref_src = ref_src.slice(0,ref_src.lastIndexOf("/")+1);
for (var i = 0; i < document.images.length; i++)
{
if(document.images[i].src.substr(0,ref_src.length) == ref_src){
var img_number = document.images[i].src.substr(-6,2).replace("_","0");
OddSquad_Images[img_number] = new Image();
OddSquad_Images[img_number].id = i;
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";
}
} //end for(images)
} //end if(no)
} //end func


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


Make sure GreaseMonkey is activated, and that the userscript is detected and functionning while browsing http://comic.naver.com/webtoon/detail.nhn?titleId=186811&no=40

Have a good night.
avatar
Doonge
Artisan
Artisan

Posts : 768
Join date : 2012-01-18

View user profile

Back to top Go down

Re: Plugin/Code Troubleshooting

Post  Doonge on Thu Jan 26, 2012 12:49 pm

On a sidenote, why do you have to use the split images for chapters from 25 to 37 ?

And also, would you like me to take screenshot from my computer, if that makes the understanding easier ?
avatar
Doonge
Artisan
Artisan

Posts : 768
Join date : 2012-01-18

View user profile

Back to top Go down

Re: Plugin/Code Troubleshooting

Post  noobzilla on Fri Jan 27, 2012 7:20 am

Working now. But here's the problem, one of the main reasons we are making the addon is to let readers... who are too stupid to follow instructions to find Cheese more accessible. If i give them greasemonkey instructions now they are gonna fail at that too.

However, adding userscripts on chrome is super easy. Just drag and drop into chrome and install. Just make sure to name the file whateverName.user.js . Err wait half of the chapter is english, and half isn't....
avatar
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 Fri Jan 27, 2012 10:05 am

It's maybe easier on Chrome, I don't know.

I find a script that works for any chapter easier than different scripts for each chapters (not really easier, just less bothersome).

Check out your web console, and see what happens when only half of your files is loaded. I have absolutely no problem so I can't say what's happening.
avatar
Doonge
Artisan
Artisan

Posts : 768
Join date : 2012-01-18

View user profile

Back to top Go down

Re: Plugin/Code Troubleshooting

Post  noobzilla on Fri Jan 27, 2012 1:07 pm

I think the problem is that the script only loads once in the middle of the raw pages loading, which leaves the later pages with no translation. probably needs a code that makes this load after the whole naver pages have fully loaded, nothings wrong for you because you already have it in your browser cache...
avatar
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 Fri Jan 27, 2012 1:31 pm

Theorically it waits for the page to be fully loaded (there is a window.onload).

If it's not totally working, I can use another check, I'll edit this message later with it.
avatar
Doonge
Artisan
Artisan

Posts : 768
Join date : 2012-01-18

View user profile

Back to top Go down

Re: Plugin/Code Troubleshooting

Post  Doonge on Fri Jan 27, 2012 3:07 pm

In what case do you get the 'only half the images are loaded' ?

Firefox or Chrome ?
With or without GreaseMonkey ?
avatar
Doonge
Artisan
Artisan

Posts : 768
Join date : 2012-01-18

View user profile

Back to top Go down

Re: Plugin/Code Troubleshooting

Post  noobzilla on Fri Jan 27, 2012 11:23 pm

Chrome, firefox seems to work okay on the second refresh, but chrome half the page loads. Chrome has greasemonkey function embedded in the browser itself so you can install userscripts just by dragging and dropping a desired js file into chrome.

Er and naver raws are also in the http://comic.naver.com/webtoon/detail.nhn?titleId=186811&seq=40 format what would you do about that?
avatar
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

troubleshooting

Post  kalich411 on Sat Jan 28, 2012 6:26 am

( http://s017.radikal.ru/i420/1201/8f/24bc30bf6761.jpg )
translation is not showing.
I am using firefox 9.0.1
there were not problems with reading previous chapters after turning off NoScript

kalich411
Newbie
Newbie

Posts : 4
Join date : 2011-12-08

View user profile

Back to top Go down

Re: Plugin/Code Troubleshooting

Post  Morgin on Sat Jan 28, 2012 6:28 am

Hi translation isn't showing for me either. I use Chrome but I get a similar result^

Morgin
Newbie
Newbie

Posts : 2
Join date : 2012-01-28

View user profile

Back to top Go down

Re: Plugin/Code Troubleshooting

Post  noobzilla on Sat Jan 28, 2012 6:37 am

Hmm is chapter 38 working for you? could you try it. If 38 is working 39 should be working too (as far as server connections are concerned). And the code is the same too.

You have very high lag between you and the image server. So I think you need to insert the codes again until you see the translation show up. Also it helps if you insert the code once the whole chapter (Raw) has finished loading.
avatar
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  kalich411 on Sat Jan 28, 2012 6:49 am

noobzilla wrote:Hmm is chapter 38 working for you? could you try it. If 38 is working 39 should be working too (as far as server connections are concerned). And the code is the same too.

You have very high lag between you and the image server. So I think you need to insert the codes again until you see the translation show up. Also it helps if you insert the code once the whole chapter (Raw) has finished loading.

strange. made chapter 38 show. and then made chapter 39 show. and translation appeared. thank you.

kalich411
Newbie
Newbie

Posts : 4
Join date : 2011-12-08

View user profile

Back to top Go down

Re: Plugin/Code Troubleshooting

Post  Sponsored content


Sponsored content


Back to top Go down

Page 3 of 13 Previous  1, 2, 3, 4 ... 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