AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Delphi and indy

Ein Thema von drama22 · begonnen am 7. Okt 2014 · letzter Beitrag vom 10. Okt 2014
Antwort Antwort
Seite 1 von 2  1 2      
drama22

Registriert seit: 12. Jan 2013
88 Beiträge
 
#1

Delphi and indy

  Alt 7. Okt 2014, 17:43
i have chat application i want To Recive text message in Tembeddedwb because i want to show smileys like this with text any help to implement this ?
  Mit Zitat antworten Zitat
mjustin

Registriert seit: 14. Apr 2008
3.004 Beiträge
 
Delphi 2009 Professional
 
#2

AW: Delphi and indy

  Alt 7. Okt 2014, 17:52
i have chat application i want To Recive text message in Tembeddedwb because i want to show smileys like this with text any help to implement this ?
Do you plan to implement the HTTP server with Indy (TIdHTTPServer)?
Michael Justin
  Mit Zitat antworten Zitat
mjustin

Registriert seit: 14. Apr 2008
3.004 Beiträge
 
Delphi 2009 Professional
 
#3

AW: Delphi and indy

  Alt 7. Okt 2014, 17:54
Some inspiration to get started implementing a chat web page with Indy and jQuery:

How can I update HTML pages dynamically with Indy HTTP server using jQuery and “Long Polling”?
Michael Justin
  Mit Zitat antworten Zitat
drama22

Registriert seit: 12. Jan 2013
88 Beiträge
 
#4

AW: Delphi and indy

  Alt 7. Okt 2014, 18:46
i have chat application i want To Recive text message in Tembeddedwb because i want to show smileys like this with text any help to implement this ?
Do you plan to implement the HTTP server with Indy (TIdHTTPServer)?
do i have to use TIDHTTP and get message in webpage ? i cant do it directly ? like sending message from TMEMO and show it in Embedded WB ? i usuaily do this with after sending the message

MeMoTEXT.Lines.Add(MSG); i cant do same with Embedded WB ?
  Mit Zitat antworten Zitat
Der schöne Günther

Registriert seit: 6. Mär 2013
6.110 Beiträge
 
Delphi 10 Seattle Enterprise
 
#5

AW: Delphi and indy

  Alt 7. Okt 2014, 18:54
Why don't you just use standard Unicode characters like 😁 😊 😒 and whatever? That's the same stuff you find on your touch-based Keyboard (Win, Android, iOS). I suppose.
  Mit Zitat antworten Zitat
drama22

Registriert seit: 12. Jan 2013
88 Beiträge
 
#6

AW: Delphi and indy

  Alt 8. Okt 2014, 15:33
Why don't you just use standard Unicode characters like 😁 😊 😒 and whatever? That's the same stuff you find on your touch-based Keyboard (Win, Android, iOS). I suppose.
i need it animated images beside Looks Nice more then the keyboard emoji
  Mit Zitat antworten Zitat
mjustin

Registriert seit: 14. Apr 2008
3.004 Beiträge
 
Delphi 2009 Professional
 
#7

AW: Delphi and indy

  Alt 8. Okt 2014, 17:15

do i have to use TIDHTTP and get message in webpage ?

i usuaily do this with after sending the message

MeMoTEXT.Lines.Add(MSG); i cant do same with Embedded WB ?
No, you can not use Memo Lines in a web browser. A web browser renders HTML and optionally processes JavaScript.

You need a HTML page which is generated and updated automatically when a new chat message arrives.

So you need a HTTP server (for example TIdHTTPServer), and a good knowledge of HTML.

The dynamic HTML content can use animated icons of course. The main problem however is how the HTML page is refreshed when new messages arrive.

I recommend to start with a simple prototype, using a JavaScript framework like jQuery, to build a first basic chat app. The basic chat page would contain one public chat room where all messages can be seen by all users.

New chat messages can be added as new elements in the HTML document tree. With jQuery, you can delete and append HTML elements very easy, so the client side would only contain some lines of JavaScript.

The server needs to build th new HTML elements and serve them to the jQuery script. This is where long polling comes into the play, see my linked article.
Michael Justin
  Mit Zitat antworten Zitat
pelzig
(Gast)

n/a Beiträge
 
#8

AW: Delphi and indy

  Alt 8. Okt 2014, 17:25
Why do you think a Tembeddedwb is able to receive "text messages" with embedded pictures?

When, where and how should "Tembeddedwb" receive those messages, on which port?

Why do Facebook/Google/Twitter do have different Messengers, when receiving a "text message in Tembeddedwb" should be sooo simple stupid?

SCNR

Geändert von pelzig ( 8. Okt 2014 um 17:55 Uhr)
  Mit Zitat antworten Zitat
drama22

Registriert seit: 12. Jan 2013
88 Beiträge
 
#9

AW: Delphi and indy

  Alt 9. Okt 2014, 00:36
i search in google and i found this very old code
Delphi-Quellcode:
procedure addChatText(WB: TEmbeddedWB; const html: string;add:integer = 0);
var
   Range: IHTMLTxtRange;
   mText : string;
   ext : string;
   sURL : string;
   i : Integer;
begin
  if not joined then Exit;

  if Not Assigned(Wb.Document) then exit;
  Range := ((WB.Document AS IHTMLDocument2).body AS IHTMLBodyElement).createTextRange;
  Range.Collapse(False) ;

  if add = 1 then
  begin
    if ChatContent <> nil then
    begin
      ChatContent.Add(html+'<BR>');
      mText := ChatContent.Text;
    end else
    begin
      mText := html+'<BR>';
    end;
  end else begin
    mText := html+'<BR>';
  end;

  if ChatContent <> nil then
  begin
    if ChatContent.Count > ChatContentTotal then
    begin
      for i := 0 to 10 do
      begin
        ChatContent.Delete(0);
      end;
    end;
// while (ChatContent.Count) > ChatContentTotal do ChatContent.Delete(0);
  end;

  mText := Replace(mText,'!res!url!',sURL);
  mText := Replace(mText,'£££',ext);
  chatClear(WB,0);
  Range.PasteHTML(mText);
  // WB.Body.innerHTML := mText;
  if OptionsIni.SoftScrolling = 0 then chatScroll(WB);
end;
and this how i find example to add text
addChatText(weblog,'<span class="Name">'+userSetting.Name+':</span> '+ strMsg,1); i cant get this worked in delphi xe5

Thats why i thought i can do it like Tmemo

Geändert von drama22 ( 9. Okt 2014 um 00:49 Uhr)
  Mit Zitat antworten Zitat
drama22

Registriert seit: 12. Jan 2013
88 Beiträge
 
#10

AW: Delphi and indy

  Alt 9. Okt 2014, 00:43

do i have to use TIDHTTP and get message in webpage ?

i usuaily do this with after sending the message

MeMoTEXT.Lines.Add(MSG); i cant do same with Embedded WB ?
No, you can not use Memo Lines in a web browser. A web browser renders HTML and optionally processes JavaScript.

You need a HTML page which is generated and updated automatically when a new chat message arrives.

So you need a HTTP server (for example TIdHTTPServer), and a good knowledge of HTML.

The dynamic HTML content can use animated icons of course. The main problem however is how the HTML page is refreshed when new messages arrive.

I recommend to start with a simple prototype, using a JavaScript framework like jQuery, to build a first basic chat app. The basic chat page would contain one public chat room where all messages can be seen by all users.

New chat messages can be added as new elements in the HTML document tree. With jQuery, you can delete and append HTML elements very easy, so the client side would only contain some lines of JavaScript.

The server needs to build th new HTML elements and serve them to the jQuery script. This is where long polling comes into the play, see my linked article.
i have good knoweledge in html and php and js and css iam still new in delphi the project that i worked on its like Paltalk its multiple chat room i dont think app like paltalk using IDHTTP can i do it inside delphi ? adding smiles and color of text with any good component ?
  Mit Zitat antworten Zitat
Antwort Antwort
Seite 1 von 2  1 2      


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 05:42 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz