[jQuery] Re: .find() not working on link node in XML document

2009-09-11 Thread Sjeiti

I encountered the same problem last week. It's even stranger with a
node named 'image', somehow that will get converted to img.
I worked around it like this:

[code]var iStart = data.indexOf(?xml);
var sData = data.substr(iStart).replace(/(image\)/g,oSettings.rplImage
+).replace(/(\image)/g,+oSettings.rplImage).replace(/(link\)/
g,oSettings.rplLink+).replace(/(\link)/g,+oSettings.rplLink);[/
code]


[jQuery] Re: Problem with refreshing

2009-02-23 Thread Sjeiti

Maybe it's better to do a callback and delete only the list-element of
that user if the delete was succesfull, instead of rebuilding the
entire user-list. That would save you the trouble of re-binding, and
save you an extra server call.


[jQuery] 1.3.1/2 selecting bug... or feature?

2009-02-23 Thread Sjeiti

I've build a recursive tree. Now I'm trying to get the number of list
elements but I get weirds results:
$(li).length = 10;
$(bodyul li).length = 4;
Is this right?.. or a bug...
(1.2.6 works as expected)


[code]
!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://
www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
html xmlns=http://www.w3.org/1999/xhtml;
head
meta http-equiv=Content-Type content=text/html; 
charset=utf-8 /

!--script type=text/javascript src=scripts/
jquery-1.2.6.min.js/script--
script type=text/javascript 
src=scripts/jquery-1.3.2.min.js/
script
script type=text/javascript
$(function(){
$(body).prepend($(\bodyul li\).length = 
+$(bodyul
li).length +;br/);
$(body).prepend($(\li\).length = +
$(li).length  +;br/
);
});
/script
/head
body
ul
li
spana/span
ul
li
spanaa/span
/li
li
spanab/span
/li
li
spanac/span
ul
li
spanaca/span
/li
li
spanacb/span
/li
li
spanacc/span
/li
/ul
/li
/ul
/li
li
spanb/span
/li
li
spanc/span
/li
li
spand/span
/li
/ul
/body
/html
[/code]


[jQuery] Re: 1.3.1/2 selecting bug... or feature?

2009-02-23 Thread Sjeiti

Bug is filed under #4224.

...Ron


[jQuery] Re: Superfish - sifr or image replacement?

2009-02-19 Thread Sjeiti

You could use php-gd, like so:

[code]?php
// Set the content-type
//header(Content-type: image/png);

$sText = isset($_GET[text])?$_GET[text]:asdf;
$sFileName = isset($_GET[file])?$_GET[file]:(style/txtimg_.
$sText..png);
$iSize = isset($_GET[size])?intVal($_GET[size]):20;

if (!file_exists($sFileName)) {
$oFont = Superplanet.ttf;
$iFsize = $iSize;
$iX = 1;
$iY = $iFsize+2;
$iW = 120;
$iH = 44;

// create test to find size
$oTestImg = imagecreatetruecolor(1, 1);
$cBg =  imagecolorallocate($oTestImg, 0,0,0);
$cFg =  imagecolorallocate($oTestImg, 255, 255, 255);
imagefill($oTestImg, 0, 0, $cBg);
$aPoints = imagettftext($oTestImg, $iFsize, 0, $iX, $iY, $cFg,
$oFont, $sText);
imagedestroy($oTestImg);
$iW = $aPoints[2]+1;

// img
$oImg = imagecreatetruecolor($iW, $iH);
imagesavealpha($oImg, true);

$cTrans =   imagecolorallocatealpha($oImg, 255, 255, 255, 127);
$cRed = imagecolorallocate($oImg, 182,13,62);
$cWhite =   imagecolorallocate($oImg, 227,215,198);
$cBlack =   imagecolorallocate($oImg, 0,0,0);
imagefill($oImg, 0, 0, $cTrans);

$aPos = array(array(-1,-1),array(1,-1),array(-1,1),array(1,1));

// normal
foreach ($aPos as $aPs) imagettftext($oImg, $iFsize, 0, $iX+$aPs[0],
$iY+$aPs[1], $cWhite, $oFont, $sText);
imagettftext($oImg, $iFsize, 0, $iX, $iY, $cRed, $oFont, $sText);

// hoover
foreach ($aPos as $aPs) imagettftext($oImg, $iFsize, 0, $iX+$aPs[0],
$iH/2+$iY+$aPs[1], $cRed, $oFont, $sText);
imagettftext($oImg, $iFsize, 0, $iX, $iH/2+$iY, $cWhite, $oFont,
$sText);

//  $sPos = $aPoints[0]./.$aPoints[1].  .$aPoints[2]./.$aPoints
[3];
//  imagettftext($oImg, 16, 0, $iX, $iH/2+$iY, $cBlack, $oFont, $sPos);
//  echo $sFileName;
imagealphablending( $oImg, true );
imagepng($oImg, $sFileName);
imagedestroy($oImg);
}
list($iW) = getimagesize( $sFileName );// [, array $imageinfo ] )
echo $iW;
//imagepng($oImg);
//imagedestroy($oImg);
?[/code]

cheriana wrote:
 Hi - I am developing a site in joomla using the superfish drop down
 menu and would like to be able to replace the main menu links (not the
 drop downs) with a true type font. I know there are many joomla sifr
 plugins, but none of them seem to be compatible with the superfish
 menu. If I can't integrate superfish with sifr, is it possible to make
 the links images instead? Here's the site I'm working on:
 http://projects.thatsus.com/angelinascms/

 Thanks!


[jQuery] Re: SFBrowser updated to 2.5.1

2008-11-22 Thread Sjeiti

Strange why the include_once doesn't work on your machine. Just to be
sure I changed the include_once to simply include (theoretically that
shouldn't make any difference in this case, but you never know).
I also fixed the IE bug (deleted a comma from the json).


[jQuery] SFBrowser updated to 2.5.1

2008-11-21 Thread Sjeiti

http://plugins.jquery.com/project/SFBrowser
SFBrowser is a file browsing and upload plugin. Returns a list of
objects with additional information on the selected files
(filesize,date,width,height). Features: ajax file upload,
localisation, sortable file table, file filtering, file renameing,
file duplication, file download, file/folder context menu, folder
creation, image resizing, image preview, text/ascii preview, multiple
files selection, inline or overlay browsing.


[jQuery] Re: SFBrowser updated to 2.5.1

2008-11-21 Thread Sjeiti

No example page (yet). Got a screenshot here though:
http://www.sjeiti.com/wp-content/uploads/2008/11/sfbrowser.png
But if you download it, it should work right away. There are three
examples on the bottom of the root-index page.


[jQuery] Re: SFBrowser updated to 2.5.1

2008-11-21 Thread Sjeiti

I checked it here on two webservers :-(
What version php are you running?
And if you have Firebug installed, what does the console say?
or maybe...
ah... bloody... you must be running IE
The last version ran just fine in IE so I didn't bother to check
(Firefox and Chrome were working so I presumed...)
oh well... back to the drawing board :.(



On Nov 21, 4:37 pm, Mickster [EMAIL PROTECTED] wrote:
 Thanks for your quick answer!

 I've downloaded it but I can't get it to work - for some reason the
 define constants doesn't work (suspect my setup has a bad day :) ).
 Anyhow, I changed all the constants and got all js-files to load.
 But when I click the examples, nothing happen - no errors, no
 nothing...

 Most likely something is wrong with my setup, so I'll keep checking...

 Thanks!


[jQuery] Re: SFBrowser updated to 2.5.1

2008-11-21 Thread Sjeiti

:-) heh... will do in just a minute... got a beer right here... just
waiting for some people to show up so we can hit the streets.
IE sucks though: can't see what is wrong there yet, guess I'm gonna
have to make the php write a log file .


On Nov 21, 5:17 pm, Mickster [EMAIL PROTECTED] wrote:
 Leave the drawing board and have a beer at Rembrandtpleijn(?)
 instead :)


[jQuery] new plugins and some questions

2008-06-30 Thread Sjeiti

Hi group...

After some time of using jQuery I recently took time to create two
plugins myself.
The first is a sorting plugin called TinySort: 
http://plugins.jquery.com/project/TinySort
The other is a file browsing plugin called SFBrowser:
http://plugins.jquery.com/project/SFBrowser

I have a couple of questions.

The first is about TinySort. It returns the selection in the new
order, and there is also the option to return only the sorted
elements. To do that the plugin returns like this:
return this.setArray(aNewOrder);
I don't remember where exactly I found this setArray but I also found
a similar method pushStack. They both seemed to work so I just picked
one by chance. What exactly is the difference between setArray and
pushStack?

Another problem I want to fix in TinySort is one where the sorted
strings contain both text and numbers. Right now it just compares two
values and if one of them is text they will sort like strings, if both
are numbers they sort like numbers. But I also want to be able to mix
strings like: [a1,a10,a2] correctly. Anybody has any idea's on
how to tackle this?

Last question is about SFBrowser. Basicly I just need someone who's
good at hacking PHP to find security holes (since it can download and
upload any file). I think I've got the most obvious holes covered but
there's bound to be some others. I originally created this plugin for
use inside a CMS, it would be nice to have it secure enough for non
CMS applications.

Thanks...

Ron

ps: I tried posting in jQuery plugins but for some reason that doesn't
work (last post in there is from april 2007)