PHPIndex

This page lists files in the current directory. You can view content, get download/execute commands for Wget, Curl, or PowerShell, or filter the list using wildcards (e.g., `*.sh`).

dialogs
icons
lang
styles
.gitignore
wget 'https://sme10.lists2.roe3.org/guppy/inc/ckeditor/plugins/btgrid/.gitignore'
View Content
bower_components
LICENSE.txt
wget 'https://sme10.lists2.roe3.org/guppy/inc/ckeditor/plugins/btgrid/LICENSE.txt'
View Content
The MIT License (MIT)

Copyright (c) 2015 Kaido

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
README.md
wget 'https://sme10.lists2.roe3.org/guppy/inc/ckeditor/plugins/btgrid/README.md'
View Content
# Bootstrap 3 Grid widget for CKEditor 4
Bootstrap grid widget for CKEditor >= 4.3
It depends on ckeditor widget plugin. http://ckeditor.com/addon/widget
It only works properly with bootstrap 3 enabled websites since otherwise it is just some html.
Demo video https://www.youtube.com/watch?v=Up7egPLxfdI

I do reccomend to use http://ckeditor.com/builder for non development purposes.

##Other Bootstrap 3 software for CKEditor 4

Bootstrap 3 Quicktable https://github.com/kaido24/btquicktable

Bootstrap 3 grid https://github.com/kaido24/bt_table
bower.json
wget 'https://sme10.lists2.roe3.org/guppy/inc/ckeditor/plugins/btgrid/bower.json'
View Content
{
  "name": "cke-btgrid",
  "homepage": "https://github.com/kaido24/btgrid",
  "authors": [
    "kaido24"
  ],
  "description": "Bootstrap grid widget for Ckeditor",
  "main": [
    "./plugin.js",
    "./dialog/btgrid.js",
    "./icons/btgrid.png",
    "./lang/en.js",
    "./lang/fr.js",
    "./lang/ru.js",
    "./styles/editor.css"
  ],
  "keywords": [
    "ckeditor",
    "ckeditor-plugin"
  ],
  "license": "MIT",
  "ignore": [
    "**/.*",
    "node_modules",
    "bower_components",
    "test",
    "tests"
  ],
  "dependencies": {
    "ckeditor": "^4.5.8"
  }
}
plugin.js
wget 'https://sme10.lists2.roe3.org/guppy/inc/ckeditor/plugins/btgrid/plugin.js'
View Content
(function(){
  CKEDITOR.plugins.add('btgrid', {
      lang: 'en,ru,fr,nl',
      requires: 'widget,dialog',
      icons: 'btgrid',
      init: function(editor) {
       var maxGridColumns = 12;
       var lang = editor.lang.btgrid;

       CKEDITOR.dialog.add('btgrid',  this.path + 'dialogs/btgrid.js');

       editor.addContentsCss( this.path + 'styles/editor.css');
       // Add widget
       editor.ui.addButton('btgrid', {
         label: lang.createBtGrid,
         command: 'btgrid',
         icon: this.path + 'icons/btgrid.png'
       });
       editor.widgets.add('btgrid',
         {
           allowedContent: 'div(!btgrid);div(!row,!row-*);div(!col-*-*);div(!content)',
           requiredContent: 'div(btgrid)',
           parts: {
             btgrid: 'div.btgrid',
           },
           editables: {
             content: '',
           },
           template:
                   '<div class="btgrid">' +
                   '</div>',
           //button: lang.createBtGrid,
           dialog: 'btgrid',
           defaults: {
            //  colCount: 2,
            // rowCount: 1
          },
          // Before init.
           upcast: function(element) {
             return element.name == 'div' && element.hasClass('btgrid');
           },
           // initialize
           // Init function is useful after copy paste rebuild.
           init: function() {
             var rowNumber= 1;
             var rowCount = this.element.getChildCount();
             for (rowNumber; rowNumber <= rowCount;rowNumber++) {
               this.createEditable(maxGridColumns, rowNumber);
             }
           },
           // Prepare data
           data: function() {
             if (this.data.colCount && this.element.getChildCount() < 1) {
               var colCount = this.data.colCount;
               var rowCount = this.data.rowCount;
               var row = this.parts['btgrid'];
               for (var i= 1;i <= rowCount;i++) {
                 this.createGrid(colCount, row, i);
               }
             }
           },
           //Helper functions.
           // Create grid
           createGrid: function(colCount, row, rowNumber) {
             var content = '<div class="row row-' + rowNumber + '">';
             for (var i = 1; i <= colCount; i++) {
               content = content + '<div class="col col-md-' + maxGridColumns/colCount + '">' +
                                   '  <div class="content">' +
                                   '    <p>Col ' + i + ' content area</p>' +
                                   '  </div>' +
                                   '</div>';
             }
             content =content + '</div>';
             row.appendHtml(content);
             this.createEditable(colCount, rowNumber);
           },
           // Create editable.
           createEditable: function(colCount,rowNumber) {
             for (var i = 1; i <= colCount; i++) {
               this.initEditable( 'content'+ rowNumber + i, {
                  selector: '.row-'+ rowNumber +' > div:nth-child('+ i +') div.content'
                } );
              }
            }
          }
        );
      }
    }
  );

})();