herschel666 / backboned-v2 Goto Github PK
View Code? Open in Web Editor NEWThe second try to make a Wordpress-theme based on Backbone.js
Home Page: http://the-flippers.frogcp.com/
License: MIT License
The second try to make a Wordpress-theme based on Backbone.js
Home Page: http://the-flippers.frogcp.com/
License: MIT License
Hi, I just published a site using your work as a parent theme. Its great! I’ll bring upstream proposals from my fork soon.
Remember the issue when we try to "view source" after a few clicks, or if one hits the back button it displays a JSON string instead of the page. This is caused by the fact that two requests to the same address are made. One is made by the browser, the other one is made by the theme with a X-Requested-With
header with Accept: application/json
.
To fix this you can add a Vary
HTTP header. This header is for this situation when a request to a resource can have more than one representation, which is exactly our case here.
You’ll notice I didn’t use Accept:
header. That’s because Varnish is very picky with RegExes and if a request happens to have Vary: application/json
and another one has vary:application/json
, it’ll be treated as a variant. Even though the content would be the same, and that the request is semantically the same.
Below is the NGINX server block I’m using.
# file: /etc/nginx/sites-enabled/backboned2.conf
server {
server_name backboned2-site.example.org;
listen 80;
root /var/www/example/backboned2;
add_header Vary "Accept-Encoding,X-Requested-With";
# Plus other ones, but my point is about the Vary header.
}
Hi,
the Backboned-v2 is a great starting point, however I would like to bind/unbind functions to specific routes, I tried something like this:
routes : { 'category/*whatever' : 'category', '*path' : 'delegateRequest' }
then in main.js:
var app = new Router(); app .on('route:category', function() { console.log('category page'); }) ;
with poor results, any ideas how I can achieve something like this.
Thank you.
Hello,
We've been liking how easy it is to get started with Backboned-v2; however, we are having an issue that is preventing us from enjoying the theme's full potential:
We use a collection of 30 different plugins. Some of these modify post content via action and filter hooks. These plugins do not seem to be hooked when Backboned-v2 is enabled as the active theme.
One such example is with Vladimir Prelovac's "SEO Smart Links" plugin. This is a relatively straightforward find-and-replace on post content. The SEO Smart Links plugin works fine with at least 2 other themes we've tried -- but is not called when Backboned-v2 is enabled.
Is it the intent of Backboned-v2 to process the filter- and action- hooks from other installed plugins? I'm not sure if we're troubleshooting something that is by design.
Let me know if I can provide any additional information.
Thanks,
Sam
SEO Smart Links: http://www.prelovac.com/vladimir/wordpress-plugins/seo-smart-links
$str .= "user_name:'" . (is_user_logged_in() ? $current_user->user_login : "guest") . "',";
if (is_user_logged_in){
$str .= "user_email:'" . $current_user->user_email . "',";
}
validateForm : function validateForm(evnt) {
var user_status;
var user_email;
if (BB.user_name != 'guest'){
user_status = BB.user_name;
user_email = BB.user_email;
}else{
user_status = elem.author.value;
user_email = this.validateEmail(elem.email.value);
}
var elem = evnt.currentTarget,
$elem = $(elem),
authorValid = user_status,
emailValid = user_email,
commentValid = elem.comment.value,
$authorParent = $(elem.author).parent(),
$emailParent = $(elem.email).parent(),
$commentParent = $(elem.comment).parent();
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.