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

Create (bootstrap)-independent version #390

Merged
merged 23 commits into from
Dec 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
ec7743b
begin creating bootstrap independent version
simialbi Nov 30, 2018
8231035
changed layout to bs4
simialbi Nov 30, 2018
91043cf
added bg utilities to css, fixed button class
simialbi Nov 30, 2018
144e412
update markup
simialbi Nov 30, 2018
4065100
style updates
simialbi Nov 30, 2018
519c9ee
style updates (considering @samdark's comment)
simialbi Dec 1, 2018
a100b36
style updates
simialbi Dec 1, 2018
98cb239
style updates
simialbi Dec 1, 2018
9178e09
style updated, fixed active field template
simialbi Dec 1, 2018
262bd6a
fixed arrow right icon
simialbi Dec 1, 2018
73377b6
removed errror message of main
simialbi Dec 1, 2018
b187be2
replaced type ahead with native [datalist](https://www.w3schools.com/…
simialbi Dec 3, 2018
68d0667
added "default list template" (empty) to prevent rendering if no auto…
simialbi Dec 3, 2018
49a41e0
added badge styles, fixed modal checkbox, style updates
simialbi Dec 3, 2018
7d32b60
fixed modal checkbox
simialbi Dec 3, 2018
210eca9
fixed modal checkbox, fixed form validation
simialbi Dec 3, 2018
2a7c9a1
style updates, fixed display of radio and checkboxes, added tooltip a…
simialbi Dec 3, 2018
31bde92
removed hint block initialization (is native bootstrap now), fixed to…
simialbi Dec 3, 2018
3fc8da3
use `Html::addCssClass` for `sticky` method (more failsafe, e.g. clas…
simialbi Dec 3, 2018
7d2c68f
Merge branch 'master' of https://github.com/yiisoft/yii2-gii
simialbi Dec 3, 2018
40bd7d6
create element with vanilla to prevent jquery deferred error
simialbi Dec 3, 2018
1c45ef6
fixed preview icons
simialbi Dec 5, 2018
24beb90
updated changelog
simialbi Dec 10, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,6 @@ php:
- 7.1
- 7.2

matrix:
include:
- php: hhvm
sudo: true
dist: trusty
group: edge
cache:
directories: "$HOME/.composer/cache"
before_install:
- wget https://phar.phpunit.de/phpunit-4.5.1.phar
script:
- php phpunit-4.5.1.phar --verbose $PHPUNIT_FLAGS
sudo: false

# cache vendor dirs
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Yii Framework 2 gii extension Change Log
2.1.0 under development
-----------------------

- no changes in this release.
- Enh #390, Bug #260: Create (bootstrap)-independent version (simialbi)


2.0.8 December 08, 2018
Expand Down
25 changes: 17 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{
"name": "yiisoft/yii2-gii",
"description": "The Gii extension for the Yii framework",
"keywords": ["yii2", "gii", "code generator"],
"keywords": [
"yii2",
"gii",
"code generator"
],
"type": "yii2-extension",
"license": "BSD-3-Clause",
"support": {
Expand All @@ -20,26 +24,31 @@
"minimum-stability": "dev",
"require": {
"yiisoft/yii2": "~2.0.14",
"yiisoft/yii2-bootstrap": "~2.0.0",
"phpspec/php-diff": ">=1.0.2",
"bower-asset/typeahead.js": "0.10.* | ~0.11.0"
"phpspec/php-diff": "^1.1.0"
},
"require-dev": {
"yiisoft/yii2-coding-standards": "~2.0",
"phpunit/phpunit": "<7"
},
"autoload": {
"psr-4": {
"yii\\gii\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"yiiunit\\gii\\": "tests"
}
},
"extra": {
"branch-alias": {
"dev-master": "2.0.x-dev"
}
},
"config": {
"process-timeout": 1800,
"fxp-asset": {
"installer-paths": {
"npm-asset-library": "vendor/npm",
"bower-asset-library": "vendor/bower"
}
"enabled": false
}
},
"repositories": [
Expand Down
10 changes: 4 additions & 6 deletions src/GiiAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,13 @@ class GiiAsset extends AssetBundle
{
public $sourcePath = '@yii/gii/assets';
public $css = [
'main.css',
'css/main.css',
];
public $js = [
'gii.js',
'js/bs4-native.min.js',
'js/gii.js',
];
public $depends = [
'yii\web\YiiAsset',
'yii\bootstrap\BootstrapAsset',
'yii\bootstrap\BootstrapPluginAsset',
'yii\gii\TypeAheadAsset',
'yii\web\YiiAsset'
];
}
30 changes: 0 additions & 30 deletions src/TypeAheadAsset.php

This file was deleted.

2 changes: 2 additions & 0 deletions src/assets/css/main.css

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions src/assets/css/main.css.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src/assets/js/bs4-native.min.js

Large diffs are not rendered by default.

42 changes: 13 additions & 29 deletions src/assets/gii.js → src/assets/js/gii.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,10 @@ yii.gii = (function ($) {
return true;
};

var initHintBlocks = function () {
$('.hint-block').each(function () {
var $hint = $(this);
$hint.parent().find('label').addClass('help').popover({
html: true,
trigger: 'hover',
placement: 'right',
content: $hint.html()
});
});
};

var initStickyInputs = function () {
$('.sticky:not(.error)').find('input[type="text"],select,textarea').each(function () {
var value;
var value,
element = document.createElement('div');
if (this.tagName === 'SELECT') {
value = this.options[this.selectedIndex].text;
} else if (this.tagName === 'TEXTAREA') {
Expand All @@ -56,7 +45,11 @@ yii.gii = (function ($) {
if (value === '') {
value = '[empty]';
}
$(this).before('<div class="sticky-value">' + value + '</div>').hide();
element.classList.add('sticky-value');
element.title = value;
element.innerHTML = value;
new Tooltip(element, {placement: 'right'});
$(this).before(element).hide();
});
$('.sticky-value').on('click', function () {
$(this).hide();
Expand Down Expand Up @@ -98,7 +91,10 @@ yii.gii = (function ($) {
}
$modal.find('.modal-title').text($link.data('title'));
$modal.find('.modal-body').html('Loading ...');
$modal.modal('show');

var modalInitJs = new Modal($modal[0]);
modalInitJs.show();

var checkbox = $('a.' + $modal.data('action') + '[href="' + $link.attr('href') + '"]').closest('tr').find('input').get(0);
var checked = false;
if (checkbox) {
Expand All @@ -107,7 +103,7 @@ yii.gii = (function ($) {
} else {
$modal.find('.modal-checkbox').addClass('disabled');
}
$modal.find('.modal-checkbox span').toggleClass('glyphicon-check', checked).toggleClass('glyphicon-unchecked', !checked);
$modal.find('.modal-checkbox').toggleClass('checked', checked).toggleClass('unchecked', !checked);

ajaxRequest = $.ajax({
type: 'POST',
Expand Down Expand Up @@ -144,7 +140,7 @@ yii.gii = (function ($) {
var $checkbox = $modal.data('current').closest('tr').find('input');
var checked = !$checkbox.prop('checked');
$checkbox.trigger('click');
$modal.find('.modal-checkbox span').toggleClass('glyphicon-check', checked).toggleClass('glyphicon-unchecked', !checked);
$modal.find('.modal-checkbox').toggleClass('checked', checked).toggleClass('unchecked', !checked);
return false;
};

Expand Down Expand Up @@ -199,19 +195,7 @@ yii.gii = (function ($) {
}).on("keyup", onKeyup);

return {
autocomplete: function (counter, data) {
var datum = new Bloodhound({
datumTokenizer: function (d) {
return Bloodhound.tokenizers.whitespace(d.word);
},
queryTokenizer: Bloodhound.tokenizers.whitespace,
local: data
});
datum.initialize();
jQuery('.typeahead-' + counter).typeahead(null, {displayKey: 'word', source: datum.ttAdapter()});
},
init: function () {
initHintBlocks();
initStickyInputs();
initPreviewDiffLinks();
initConfirmationCheckboxes();
Expand Down
Loading