Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate template-variables #1999

Closed
psychobunny opened this issue Aug 18, 2014 · 11 comments

Comments

Projects
None yet
4 participants
@psychobunny
Copy link
Member

commented Aug 18, 2014

And feed the entire API to ajaxify.variables, so we can do ajaxify.variables.get('any-var-on-page');


Want to back this issue? Place a bounty on it! We accept bounties via Bountysource.

@psychobunny psychobunny added this to the 0.5.1 milestone Aug 18, 2014

@barisusakli

This comment has been minimized.

Copy link
Member

commented Aug 18, 2014

wonder what we were smoking when we went with the hidden inputs on each tpl when we could just do ajaxify.variables.data = dataFromApi; 🚬

@cnvo

This comment has been minimized.

Copy link
Contributor

commented Aug 18, 2014

Does this break the templates or can one still use these inputs? I'll keep this referenced.

@psychobunny

This comment has been minimized.

Copy link
Member Author

commented Aug 18, 2014

wonder what we were smoking when we went with the hidden inputs on each tpl

rofl

@cnvo won't break any templates, but when this is done you may remove them to keep your tpl cleaner

@cnvo

This comment has been minimized.

Copy link
Contributor

commented Aug 18, 2014

Ok, thanks will do.

On Mon, Aug 18, 2014 at 2:59 PM, psychobunny notifications@github.com
wrote:

wonder what we were smoking when we went with the hidden inputs on each
tpl

rofl

@cnvo https://github.com/cnvo won't break any templates, but when this
is done you may remove them to keep your tpl cleaner


Reply to this email directly or view it on GitHub
#1999 (comment).

@barisusakli barisusakli self-assigned this Aug 27, 2014

@barisusakli

This comment has been minimized.

Copy link
Member

commented Sep 17, 2014

@psychobunny

This comment has been minimized.

Copy link
Member Author

commented Sep 17, 2014

haha if it was as easy as you thought it was going to be 5 minutes ago, I would have done this a while back :P

@psychobunny

This comment has been minimized.

Copy link
Member Author

commented Sep 17, 2014

on a more serious note, I was thinking maybe we could dynamically generate the hidden input tags in middleware.buildHeader etc

@barisusakli

This comment has been minimized.

Copy link
Member

commented Sep 17, 2014

Other option is to remove all ajaxify.variable.get calls and use data attributes.

@psychobunny

This comment has been minimized.

Copy link
Member Author

commented Sep 25, 2014

@barisusakli I was working on this until I realized that lines like these https://github.com/NodeBB/nodebb-theme-vanilla/blob/master/templates/category.tpl#L2-L3

are going to explode, because we are changing the variable names in the template (API is sending cid but we are renaming it category_id) ... so that means a ton of plugins/themes + core will have to update to fit the original data structure

psychobunny added a commit that referenced this issue Sep 25, 2014

#1999 sending ajaxify-data to client on cold loads
commented out until we figure out what we're doing with the renamed
properties (see issue)
@psychobunny

This comment has been minimized.

Copy link
Member Author

commented Sep 25, 2014

Ideally if we're refactoring though, we might as well dump ajaxify.variables.get() as a method and just assign the API data to ajaxify.data or something

then we can for example read ajaxify.data.topics[0].title on the category view, etc.

@barisusakli

This comment has been minimized.

Copy link
Member

commented Sep 25, 2014

I don't think themes use ajaxify.variables.get(), but stuff like widget essentials do. Im fine with updating them all to ajaxify.data.topcis[0].title etc.

@barisusakli barisusakli modified the milestones: 0.5.2, 0.5.1 Sep 25, 2014

@barisusakli barisusakli modified the milestones: 0.5.2, 0.5.3 Oct 18, 2014

@julianlam julianlam modified the milestones: 0.5.3, 0.6.0 Oct 27, 2014

@barisusakli barisusakli modified the milestones: 0.6.0, 0.6.1 Dec 16, 2014

@barisusakli barisusakli modified the milestones: 0.6.2, 0.6.1 Jan 13, 2015

@barisusakli barisusakli modified the milestones: 0.6.2, 0.7.0 Feb 4, 2015

@barisusakli barisusakli modified the milestones: 0.7.0, 0.8.0 Apr 1, 2015

@barisusakli barisusakli modified the milestones: 0.8.0, 1.0.0 Apr 30, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.