You are not logged in.

#151 2010-12-06 23:39:52

mason.larobina
Member
From: Australia
Registered: 2009-07-02
Posts: 200
Website

Re: luakit browser framework (almost with jQuery!)

Ok, I've just pushed a patch which fixes the Lua API panic. Let me know if there are any other problems.

Offline

#152 2010-12-10 02:31:54

Berticus
Member
Registered: 2008-06-11
Posts: 731

Re: luakit browser framework (almost with jQuery!)

Thanks Mason, works like a charm!

I can't figure out why this doesn't work though:

key({"Control"}, "i", function (w, m) w:back(m.count) end, {count=1}),
key({"Control"}, "o", function (w, m) w:forward(m.count) end, {count=1})

I've also tried it implement a for loop:

key({"Control"}, "i", function (w, m) for i=1,m.count do w:back() end end, {count=1}),
key({"Control"}, "o", function (w, m) for i=1,m.count do w:forward() end end, {count=1})

Basically I'd like to enter a number before hitting either Ctrl+i or Ctrl+o, and it'll go back that many steps. It used to work, but I'm not sure why it isn't.

Offline

#153 2010-12-10 09:53:10

mason.larobina
Member
From: Australia
Registered: 2009-07-02
Posts: 200
Website

Re: luakit browser framework (almost with jQuery!)

Berticus wrote:

Thanks Mason, works like a charm!

I can't figure out why this doesn't work though:

key({"Control"}, "i", function (w, m) w:back(m.count) end, {count=1}),
key({"Control"}, "o", function (w, m) w:forward(m.count) end, {count=1})

I've also tried it implement a for loop:

key({"Control"}, "i", function (w, m) for i=1,m.count do w:back() end end, {count=1}),
key({"Control"}, "o", function (w, m) for i=1,m.count do w:forward() end end, {count=1})

Basically I'd like to enter a number before hitting either Ctrl+i or Ctrl+o, and it'll go back that many steps. It used to work, but I'm not sure why it isn't.

This was the one area the [count] grammar doesn't work (that is key bindings with modifiers).

I've just though of a possible way to fix it though. Stay tuned.

Last edited by mason.larobina (2010-12-10 09:53:34)

Offline

#154 2010-12-20 11:20:10

grimp3ur
Member
Registered: 2010-09-05
Posts: 7

Re: luakit browser framework (almost with jQuery!)

Very nice project.

I have some issues with ibar line editing: cannot find out a module with basic keybindings. I've commented out corresponding binds in local `binds.lua', even tried to delete functions from `window.lua' and disable `/etc/xdg/luakit'. But e.g. `ctrl-a' still works.

And is it a right way to interract with luakit (from command line) or should I use more adequate approach?

cmd("e[val]",  function (w, a) f=loadstring(a) w.sbar.l.uri.text = tostring(f()) end)

Offline

#155 2010-12-20 11:56:50

mason.larobina
Member
From: Australia
Registered: 2009-07-02
Posts: 200
Website

Re: luakit browser framework (almost with jQuery!)

grimp3ur wrote:

Very nice project.

I have some issues with ibar line editing: cannot find out a module with basic keybindings. I've commented out corresponding binds in local `binds.lua', even tried to delete functions from `window.lua' and disable `/etc/xdg/luakit'. But e.g. `ctrl-a' still works.

I don't quite follow what you are trying to here or what the problem is?

grimp3ur wrote:

And is it a right way to interract with luakit (from command line) or should I use more adequate approach?

cmd("e[val]",  function (w, a) f=loadstring(a) w.sbar.l.uri.text = tostring(f()) end)

There is a better command in the develop branch at the moment:

cmd("lua", function (w, a) assert(loadstring("return function(w) "..a.." end"))()(w) end)

Though all output is in the terminal you launched luakit from not the uri label widget. And by output I mean calling `print("some text", ...)` in the `:lua` command.

Offline

#156 2010-12-20 12:29:50

grimp3ur
Member
Registered: 2010-09-05
Posts: 7

Re: luakit browser framework (almost with jQuery!)

I don't quite follow what you are trying to here or what the problem is?

I don't understand where ibar `ctrl-a' (e.g.) is defined, considering that binginds in `binds.lua' are commented.

It's not really a problem. But if one can remove these bindings from `binds.lua' (because now luakit line editing works w/o it) or future releases can change this behavior? So, can one rely on internal implementation? In any case I believe that knowing where these binds come from can be helpful.

There is a better command in the develop branch at the moment:

cmd("lua", function (w, a) assert(loadstring("return function(w) "..a.." end"))()(w) end)

Though all output is in the terminal you launched luakit from not the uri label widget. And by output I mean calling `print("some text", ...)` in the `:lua` command.

Thanks a lot.

Offline

#157 2010-12-20 14:18:45

mason.larobina
Member
From: Australia
Registered: 2009-07-02
Posts: 200
Website

Re: luakit browser framework (almost with jQuery!)

grimp3ur wrote:

I don't quite follow what you are trying to here or what the problem is?

I don't understand where ibar `ctrl-a' (e.g.) is defined, considering that binginds in `binds.lua' are commented.

It's not really a problem. But if one can remove these bindings from `binds.lua' (because now luakit line editing works w/o it) or future releases can change this behavior? So, can one rely on internal implementation? In any case I believe that knowing where these binds come from can be helpful.

I see what you mean. Here is the binding (and the other readline bindings).

Offline

#158 2010-12-24 13:10:50

mason.larobina
Member
From: Australia
Registered: 2009-07-02
Posts: 200
Website

Re: luakit browser framework (almost with jQuery!)

mason.larobina wrote:
Berticus wrote:

Thanks Mason, works like a charm!

I can't figure out why this doesn't work though:

key({"Control"}, "i", function (w, m) w:back(m.count) end, {count=1}),
key({"Control"}, "o", function (w, m) w:forward(m.count) end, {count=1})

I've also tried it implement a for loop:

key({"Control"}, "i", function (w, m) for i=1,m.count do w:back() end end, {count=1}),
key({"Control"}, "o", function (w, m) for i=1,m.count do w:forward() end end, {count=1})

Basically I'd like to enter a number before hitting either Ctrl+i or Ctrl+o, and it'll go back that many steps. It used to work, but I'm not sure why it isn't.

This was the one area the [count] grammar doesn't work (that is key bindings with modifiers).

I've just though of a possible way to fix it though. Stay tuned.

Fixed, there is now full `[count]` grammar support for key bindings like <Ctrl+i> (and I've updated the default config to add the `[count]` support to the <Ctrl+i> & <Ctrl+o> bindings).

The changes are in the the latest develop head or luakit-develop-git.

Let me know if there are any problems.

Offline

#159 2010-12-25 08:32:36

mason.larobina
Member
From: Australia
Registered: 2009-07-02
Posts: 200
Website

Re: luakit browser framework (almost with jQuery!)

luakit version 2010.12.25 is out, Merry Christmas!

Check out the changelog here: http://luakit.org/news/4
Or download 2010.12.25-r2 tarball: https://github.com/mason-larobina/luaki … 0.12.25-r2

And I've also created a subreddit on reddit for luakit discussion, configuration help, user script sharing, release announcements and feature requests. Find it here: http://reddit.com/r/luakit/

And I've also made a start on a Frequently Asked Questions page on the luakit wiki. Does anybody have anything they would like to see on there? (even though its publically editable).

Edit: update tarball link to the 2010.12.25-r2 bugfix release.

Last edited by mason.larobina (2010-12-31 11:03:32)

Offline

#160 2011-01-03 10:27:03

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: luakit browser framework (almost with jQuery!)

Hello (first of all, lovely browser), I'm trying to get downloads to save without prompting me for a directory. I am following this. I have the following in my rc.lua

-- Add download support
require "downloads"
require "downloads_chrome"

downloads.default_dir = "/tmp/dl"
downloads:add_signal("download-location", function (uri, suggested_filename)
    local file = suggested_filename or string.match(uri, "/([^/]+)$")
    return downloads.default_dir .. "/" .. (file or "unnamed")
end)

It no longer prompts me for a directory but downloads do not occur at all.


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

#161 2011-01-04 08:40:19

tawan
Member
Registered: 2010-03-02
Posts: 290
Website

Re: luakit browser framework (almost with jQuery!)

Excuse my simple nature in respect to your high programming ability smile

Websites viewed in luakit may have scrolling areas within them but the pages themselves do not have a scroll bar when we by standard expect one. We scroll with the keyboard which is fine I know.

Couldn't we load all webpages into luakit within a set of HTML tags that then cause the page to be rendered inside a scrolling area?

e.g.

luakit
  html tag
     page to be viewed
  end tag
end luakit render

wrapping the page in a tag would result in it being rendered with a scrollbar (maybe?)

Offline

#162 2011-01-04 10:36:51

mason.larobina
Member
From: Australia
Registered: 2009-07-02
Posts: 200
Website

Re: luakit browser framework (almost with jQuery!)

tawan wrote:

Excuse my simple nature in respect to your high programming ability smile

Websites viewed in luakit may have scrolling areas within them but the pages themselves do not have a scroll bar when we by standard expect one. We scroll with the keyboard which is fine I know.

Couldn't we load all webpages into luakit within a set of HTML tags that then cause the page to be rendered inside a scrolling area?

e.g.

luakit
  html tag
     page to be viewed
  end tag
end luakit render

wrapping the page in a tag would result in it being rendered with a scrollbar (maybe?)

Just add the following before the session restore code (last 10 lines) in your rc.lua:

webview.init_funcs.show_scrollbars = function(view) 
    view.show_scrollbars = true 
end

Offline

#163 2011-01-04 15:23:25

alterecco
Member
Registered: 2009-07-13
Posts: 152

Re: luakit browser framework (almost with jQuery!)

Love this project!

I wanted to add, that to use "user-stylesheet-uri" in domain_props paths should be prefixed with "file://" if they are located on the local machine (which is the case for the default examples)

in globals.lua

["user-stylesheet-uri"]     = luakit.data_dir .. "/styles/dark.css",

should be

["user-stylesheet-uri"]     = "file://" .. luakit.data_dir .. "/styles/dark.css",

Offline

#164 2011-01-04 21:14:03

Berticus
Member
Registered: 2008-06-11
Posts: 731

Re: luakit browser framework (almost with jQuery!)

mason.larobina wrote:
mason.larobina wrote:
Berticus wrote:

Thanks Mason, works like a charm!

I can't figure out why this doesn't work though:

key({"Control"}, "i", function (w, m) w:back(m.count) end, {count=1}),
key({"Control"}, "o", function (w, m) w:forward(m.count) end, {count=1})

I've also tried it implement a for loop:

key({"Control"}, "i", function (w, m) for i=1,m.count do w:back() end end, {count=1}),
key({"Control"}, "o", function (w, m) for i=1,m.count do w:forward() end end, {count=1})

Basically I'd like to enter a number before hitting either Ctrl+i or Ctrl+o, and it'll go back that many steps. It used to work, but I'm not sure why it isn't.

This was the one area the [count] grammar doesn't work (that is key bindings with modifiers).

I've just though of a possible way to fix it though. Stay tuned.

Fixed, there is now full `[count]` grammar support for key bindings like <Ctrl+i> (and I've updated the default config to add the `[count]` support to the <Ctrl+i> & <Ctrl+o> bindings).

The changes are in the the latest develop head or luakit-develop-git.

Let me know if there are any problems.

Thanks! Won't be able to try it for another two weeks though. I don't have X11 forward for ssh, and don't have a need for it. Can't wait to try it though!

Offline

#165 2011-01-08 12:09:57

tawan
Member
Registered: 2010-03-02
Posts: 290
Website

Re: luakit browser framework (almost with jQuery!)

Thanks but no joy here :-/

tawan wrote:

can we have scrolling?

mason.larobina wrote:

Just add the following before the session restore code (last 10 lines) in your rc.lua:

webview.init_funcs.show_scrollbars = function(view) 
    view.show_scrollbars = true 
end

Offline

#166 2011-01-08 12:16:10

mason.larobina
Member
From: Australia
Registered: 2009-07-02
Posts: 200
Website

Re: luakit browser framework (almost with jQuery!)

tawan wrote:

Thanks but no joy here :-/

tawan wrote:

can we have scrolling?

mason.larobina wrote:

Just add the following before the session restore code (last 10 lines) in your rc.lua:

webview.init_funcs.show_scrollbars = function(view) 
    view.show_scrollbars = true 
end

Sorry, you will need the latest development version of luakit for that to work (or apply this patch yourself).

Offline

#167 2011-01-08 12:22:50

tawan
Member
Registered: 2010-03-02
Posts: 290
Website

Re: luakit browser framework (almost with jQuery!)

mason.larobina wrote:

Sorry, you will need the latest development version of luakit for that to work (or apply this patch yourself).

Ah great, scrolling smile 

Congrats on all the work

Offline

#168 2011-01-11 21:04:38

M_ller
Member
Registered: 2010-04-17
Posts: 80
Website

Re: luakit browser framework (almost with jQuery!)

Are there any functions/scripts yet for safety, such as GhostScript, AdBlock etc. for Firefox?

Offline

#169 2011-01-12 08:18:01

bootleg
Member
Registered: 2010-12-08
Posts: 38

Re: luakit browser framework (almost with jQuery!)

Is there a way to set the path of downloads according to their mime-type?
I know you can decide what to do when you open them.

The new download interface is great by the way!

Offline

#170 2011-01-12 09:53:54

karottenreibe
Member
Registered: 2010-07-21
Posts: 10
Website

Re: luakit browser framework (almost with jQuery!)

no, this is currently not possible. we don't get the mime type from webkit, we query it from the finished file using GTK's API so there's no way to do it like this when selecting the destination

Offline

#171 2011-01-12 13:07:40

bootleg
Member
Registered: 2010-12-08
Posts: 38

Re: luakit browser framework (almost with jQuery!)

Ok thanks. Well I'll just try to do something based on extensions.

Offline

#172 2011-01-13 20:36:41

vanvalium
Member
From: Austria
Registered: 2010-10-09
Posts: 86

Re: luakit browser framework (almost with jQuery!)

nice and very fast browser, might learn some lua and try it again this weekend
input behaviour seems strange though sometimes (all minimal webkit browser seem to have this problem)

Last edited by vanvalium (2011-01-13 20:36:57)

Offline

#173 2011-01-14 09:20:25

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: luakit browser framework (almost with jQuery!)

vanvalium wrote:

input behaviour seems strange though sometimes (all minimal webkit browser seem to have this problem)

What do you mean with that? Do you have the same impression of firefox with vimperator or pentadactyl (the successor of vimperator)?

Offline

#174 2011-01-14 21:39:15

vanvalium
Member
From: Austria
Registered: 2010-10-09
Posts: 86

Re: luakit browser framework (almost with jQuery!)

I click on an input field and have to press i to go to insert mode (works fine in conkeror, dunno about pentadactyl or vimperator).
Or is it like that on purpose? Haven't checked the source/configs yet.

Offline

#175 2011-01-14 23:00:22

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: luakit browser framework (almost with jQuery!)

Well that's just the way vim works, so this is intended.

Offline

Board footer

Powered by FluxBB