rejetto forum

Testing build #192

rejetto · 10 · 12456

0 Members and 1 Guest are viewing this topic.

Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
Hey templaters!
2 big news in this build, and the best thing is that they required me just few minutes to make. Holy sweat.

Your templates are now easier to install.
Tell users to just drag&drop the tpl file over HFS window.
No need to tell what to answer to the Install this template? on your screen.

More, a new {.mime.} macro to decide what's the kind of content you are going to deliver.
Do you have a [css] section?
Just put {.mime|text/css.} somewhere in it, and people with wrong mime settings won't complain with you anymore.
Are you going to deliver some RSS content?
Don't forget to put {.mime|application/rss+xml.} and the world will be a better place.

And now let's pray against the bugs.  :-X

download @ www.dovedove.it/hfs/hfs192.exe

what's new
+ template installation through drag&drop
+ new template macro: mime
- "Edit" broken in build #191 (didn't work with spaces in the editor path)
- "Browse it" wasn't working with links http://www.rejetto.com/forum/index.php?topic=6010.msg1035702#msg1035702
- "hints for newcomers" has been extended to more hints   


Offline ydwxb

  • Occasional poster
  • *
    • Posts: 21
    • View Profile

Offline SilentPliz

  • Operator
  • Tireless poster
  • *****
    • Posts: 1298
  • ....... chut ! shh!
    • View Profile
WooW !, :D fun and useful these new features !
Good job!

Quote
And now let's pray against the bugs. 

If prayer against bugs is ineffective ... Some grigris ;)
« Last Edit: July 18, 2008, 07:37:54 AM by SilentPliz »


Offline maverick

  • Tireless poster
  • ****
    • Posts: 1052
  • Computer Solutions
    • View Profile
Good job rejetto!  I see no problems.  :)
maverick


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2059
    • View Profile
FUNCTION LOADCFG()

OLD:
Quote
ini:=loadFile(cfgPath+CFG_FILE);
if ini > '' then
  begin
  saveMode:=SM_FILE;
  moveLegacyTpl(loadFile(cfgPath+TPL_FILE));  //Do not work if hfs.tpl is destroyed before the launch of hfs
  exit;
  end;
NEW:
Quote
ini:=loadFile(cfgPath+CFG_FILE);
if ini > '' then
  begin
  if fileExists(cfgPath+TPL_FILE) then tpl:=loadFile(cfgPath+TPL_FILE) // load the hfs.tpl if exist
  else begin                   // else load the internal template
        tpl:=defaulttpl;
        tplFilename:='';  //force to create and save to TPL_FILE
        end;

  saveMode:=SM_FILE;
  moveLegacyTpl(tpl); // save the current tpl
  exit;
  end;
At home, I work with a more pushed version, but here it is the minimum necessities.
just for information:
Quote
function loadCfg(var ini,tpl:string):boolean;
  // until 2.2 the template could be kept in the registry, so we need to move it now.
  // returns true if the registry source can be deleted
  function moveLegacyTpl(tpl:string):boolean; //189
  begin
  result:=FALSE;
  if tpl = '' then exit;
  if tplfilename='' then tplfilename:= cfgPath+TPL_FILE;
  try
  saveFile(cfgPath+TPL_FILE, tpl);  //create always hfs.tpl for editor
  //**result:= // until the version is stable, we should not delete the registry anyway
  except result:=false; end;
  end; // moveLegacyTpl
begin
result:=TRUE;
ipsEverConnected.text:=loadfile(IPS_FILE);
ini:=loadFile(cfgPath+CFG_FILE);
if ini > '' then
  begin
  if fileExists(cfgPath+TPL_FILE) then tpl:=loadFile(cfgPath+TPL_FILE) // load the hfs.tpl
  else if fileExists(tplfilename) then tpl:=loadFile(tplfilename)   // else load the tpl filename file
  else                    // else load the internal template
   begin
   tpl:=defaulttpl;
   tplFilename:='';  //force to create  TPL_FILE
   end;
  saveMode:=SM_FILE;
  moveLegacyTpl(tpl); //189
  exit;
  end;
« Last Edit: July 21, 2008, 01:58:12 PM by mars »


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
if ini > '' then
   the file exists for sure, because we just loaded it!

;)


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2059
    • View Profile
 ;)

1) load CFG_FILE , that ok if  hfs.ini exist

2) if ini>'' is true, if 1) is true, and tplfilename='hfs.tpl'

3) load from TPL_FILE   false if hfs.tpl does'nt exist 
then moveLegacyTpl(loadFile(cfgPath+TPL_FILE)); equivalent to moveLegacyTpl('');

4) call function

Quote
function moveLegacyTpl(tpl:string):boolean;
 ...
 if (tplFilename > '') or (tpl = '') then exit;

somewhere tplfilename (in hfs.ini) can  have as value  '.....\hfs.tpl' but this file has no existence, here is the problem, even if this is compensated by

Quote
if fileExists(tplFilename) then
    if getMtime(tplFilename) > tplLast then
      begin
      tplLast:=getMtime(tplFilename);
      setTplText(loadFile(tplFilename));
      end
    else
  else
    if tplLast <> 0 then
      begin
      tplLast:=0; // we have no modified-time in this case, but this will stop the refresh
      setTplText(defaultTpl);
      end;

I think that it is better necessary to avoid that a grain of sand checks the machine, with a parameter which would not be defined just in time. ;)


Offline mmf2

  • Occasional poster
  • *
    • Posts: 29
    • View Profile

Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
sorry mars, i was in a hurry and missed the point.
now i had a deeper look at your suggestion, and still don't see the problem with the current code. try rephrasing.


Offline TSG

  • Operator
  • Tireless poster
  • *****
    • Posts: 1935
    • View Profile
    • RAWR-Designs
For those that don't peruse the Template board often, RAWR-Template, ToG, and Terayon have been updated using this beta of HFS.

Follow this to get to the RAWR-Designs board:
http://www.rejetto.com/forum/index.php?board=34.0
« Last Edit: July 22, 2008, 09:54:10 PM by That_Stevens_Guy »