OpenJS-Grid icon indicating copy to clipboard operation
OpenJS-Grid copied to clipboard

Bootstrap 3.0.3?

Open markc opened this issue 10 years ago • 11 comments

Is there any interest in upgrading to Bootstrap 3.0.3?

markc avatar Dec 07 '13 13:12 markc

100%. Ill add it as a milestone actually. Timeline? I'm not sure, work is pretty busy at the moment. Hopefully in the next month or so though.

optikalefx avatar Dec 07 '13 15:12 optikalefx

Great, good to hear. Just looking now and I have no idea what lib/nib is or how to rebuild grid.css so maybe I could start work on converting the PHP backend scripts to PDO and make sure they work with PHP 5.5.

PHP Deprecated:  mysql_select_db(): The mysql extension is deprecated and will be removed in the future:
 use mysqli or PDO instead in /home/markc/Public/jsgrid/world-ajax.php on line 5

I see you have tagged 2.1.3 so is it safe to assume we can move towards a 3.0 version and not worry about backwards compatibility?

Also, how about I get the dev branch in sync with current master so I can send you some test requests for you to look at (if you have the time)?

Woops, sorry, another question... how committed are you to using hard tabs?

markc avatar Dec 08 '13 02:12 markc

Yea I have someone doing a PDO conversion, but I'll probably do it myself next sit down.

Yea it's safe to move and not support back

I just pushed to the dev branch, so it should be up to date now Anything you make a PR for I'll take a look at usually in the evenings, much appreciated.

Ha, funny question. The old spaces vs tabs debate. All my text editors are set for tabs, so I'd probably opt to keep that personally. It really makes coding faster when deleting back.

optikalefx avatar Dec 08 '13 02:12 optikalefx

If you wanna do PDO, you're more than welcome to. Keep it simple and easy to understand, some PDO implementations are really convoluted.

I use NodeJS now a days for a lot of projects, and I'm making a backend file for that soon too.

optikalefx avatar Dec 08 '13 02:12 optikalefx

Also, lib/nib is the stylus nib library

this is nib http://visionmedia.github.io/nib/

It goes with stylus a css preprocessor http://learnboost.github.io/stylus/

optikalefx avatar Dec 08 '13 03:12 optikalefx

Ha, funny question. The old spaces vs tabs debate.

I generally try to follow these guidelines...

HTML and CSS -> https://github.com/mdo/code-guide

Javascript -> https://npmjs.org/doc/coding-style.html

PHP -> http://www.php-fig.org/psr/psr-2/

Glad you are into NodeJS. I'm setup to test both PHP and nodejs via nginx.

markc avatar Dec 08 '13 04:12 markc

This is no where near a pull request but if you want to have a look at what I've done so far...

https://github.com/markc/OpenJS-Grid/tree/dev

  • moved all assets into the lib/ directory
  • initial conversion of myslq_funcs to PDO
  • almost works without major errors/exceptions
  • added simple config override system
  • added one extra db_init() to ajax.php
  • next is prepared statements then testing with SQLite

markc avatar Dec 08 '13 07:12 markc

A couple notes so far

  • Your ajax.php is a bit too abstracted (up for discussion). The goal is not to give them a formula for their own project, most have their own DB connect function, we shouldn't offer one. The goal is to show the minimal amount needed to get off the ground, as to understand everything. The override config and the db_init() are cool but unless you are building that into grid.php (which you could do) it shouldn't be found in ajax.php at all
  • You have a bunch of comments, that are not indented to match their blocks
  • You have a bunch of error_log functions that are not indented to match their blocks
  • I would like to keep curly braces on the same line as the function, personally it's a huge waste to give an entire line to 1 curly brace.
  • It looks like your changing the mysql_query to the db->query(). Is that really taking advantage of PDO? I would think that while this great to at least make it compatible, we should add a mile stone to use prepared stmts instead of these raw queries.

Awesome work so far, thanks for taking the reigns on this!

optikalefx avatar Dec 08 '13 14:12 optikalefx

Misc comments. The point of the simple config override is so my MySQL auth details don't end up in git. The db_init() function is about the simplest way I know of being able to switch between MySQL and SQLite by changing one variable ($cfg[type]). It could easily be incorporated into Grid::__construct(). It's not worth adding prepared statements until the basic 1:1 "port" actually works. For me, the main point of PDO is to be able to also use SQLite, and then the example index.html can work with near zero setup. The coding style can change, I'm so used to psr-2 that anything else just looks weird, and the error_log() statements are indeed temporary.

Hopefully I'll get the right json to return tomorrow and can proceed with adding proper prepared statements.

markc avatar Dec 08 '13 17:12 markc

You can just opt to not commit ajax.php after you've added your credentials. The problem is that it adds 1 file, and it's a 100% guaranteed thing to change for someone else. They will download this and delete that file because they have their own way of doing the db work.

This goes for the 2nd comment too. The reason we don't need to make a function is because people will think that's what they need to do. We shouldn't do the connect in grid.php after thinking about it, because they probably have their own db connect going on already, or in their own way. So just like the above comment, we want to give them the minimal setup.

I use the grid a lot, and the first thing I do everytime is delete ajax.php. So for openJS Grid beginners, it's important that that file is SUPER easy to understand. Like line by line understand. They don't need the config override or the extra db function call. When they are learning its do this, then this, then this, then this.

If you wanna keep moving with what you're doing, I can modify it to show you what I'm talking about.

Sorry I'm a bit picky about how those demo files are setup, I try really hard to make really easy to understand code for people to pickup. One thing I hate as a developer is downloading something from someone only to have all their own ideas jammed into the demo file making it hard for me to see the 1 thing their code actually does.

optikalefx avatar Dec 09 '13 06:12 optikalefx

If the sqlite/pdo is getting close and you need somebody to test it I'd be up for trying...

On Sun, Dec 8, 2013 at 10:13 PM, Sean Clark [email protected]:

You can just opt to not commit ajax.php after you've added your credentials. The problem is that it adds 1 file, and it's a 100% guaranteed thing to change for someone else. They will download this and delete that file because they have their own way of doing the db work.

This goes for the 2nd comment too. The reason we don't need to make a function is because people will think that's what they need to do. We shouldn't do the connect in grid.php after thinking about it, because they probably have their own db connect going on already, or in their own way. So just like the above comment, we want to give them the minimal setup.

I use the grid a lot, and the first thing I do everytime is delete ajax.php. So for openJS Grid beginners, it's important that that file is SUPER easy to understand. Like line by line understand. They don't need the config override or the extra db function call. When they are learning its do this, then this, then this, then this.

If you wanna keep moving with what you're doing, I can modify it to show you what I'm talking about.

Sorry I'm a bit picky about how those demo files are setup, I try really hard to make really easy to understand code for people to pickup. One thing I hate as a developer is downloading something from someone only to have all their own ideas jammed into the demo file making it hard for me to see the 1 thing their code actually does.

— Reply to this email directly or view it on GitHubhttps://github.com/optikalefx/OpenJS-Grid/issues/40#issuecomment-30107677 .

ioconnor avatar Dec 26 '13 03:12 ioconnor