Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
tauquir authored and tauquir committed Aug 14, 2017
1 parent 183d403 commit cd7e2fc
Show file tree
Hide file tree
Showing 23 changed files with 3,514 additions and 27 deletions.
26 changes: 26 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
## [<ins>1.1.0 (15-08-2017)</ins>](https://github.com/tauquirahmed93/palette4bootstrap/releases/tag/v1.1.0)
#### Added the following palette items
* **Bootstrap Typography**
* More
* **Bootstrap Media**
* Image
* Glyphicons
* Font Awesome Icons
* Ionicons
* Carousel
* Google Maps

## [<ins>1.0.0 (02-08-2017)</ins>](https://github.com/tauquirahmed93/palette4bootstrap/releases/tag/v1.0.0)
### Initial Commit
#### Following palette items are available
* **Bootstrap UI**
* Blank Page
* **Bootstrap Grid**
* Row
* Column
* Clearfix
* **Bootstrap Typography**
* Heading
* Paragraph
* Alert
* Blockquote
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@ This is a module for the [NetBeans IDE](http://netbeans.org/) which adds new pal
* Alert
* Blockquote
* More
* **Bootstrap Images**
* **Bootstrap MEDIA**
* Image
* Glyphicons
* Font Awesome
* Font Awesome Icons
* Ionicons
* Carousel
* Google Maps

-And many more to come soon.

Expand Down
72 changes: 60 additions & 12 deletions src/org/tauquir/palette4bootstrap/items/Bundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@ Customizer.Browse=Browse
UI.BLANKPAGE.NAME=Blank Page
UI.BLANKPAGE.HINT=\
<html>\
Creates a blank bootstrap HTML page with option to select necessary css and javascript imports.\
<br>\
Creates a blank bootstrap HTML page with option to select necessary css and javascript imports.<br>\
Drag into a completely blank file\
\
</html>

# Strings for Grid Row palette
Expand Down Expand Up @@ -98,32 +96,46 @@ Create other typography related elements like &lt;small&gt;,<br>\
</html>

# Strings for Image
IMAGES.IMAGE.NAME=Image
IMAGES.IMAGE.HINT=\
MEDIA.IMAGE.NAME=Image
MEDIA.IMAGE.HINT=\
<html>\
This is the html &lt;img&gt; tag. Use this to insert<br>\
images into your document<br>\
</html>

# Strings for Glyphicons
IMAGES.GLYPHICONS.NAME=Glyphicons
IMAGES.GLYPHICONS.HINT=Includes glyphs in font format from the Glyphicon Halflings set
MEDIA.GLYPHICONS.NAME=Glyphicons
MEDIA.GLYPHICONS.HINT=Includes glyphs in font format from the Glyphicon Halflings set

# Strings for Glyphicons
IMAGES.FONTAWESOME.NAME=Font Awesome Icons
IMAGES.FONTAWESOME.HINT=<html>\
MEDIA.FONTAWESOME.NAME=Font Awesome Icons
MEDIA.FONTAWESOME.HINT=<html>\
Font Awesome is a full suite of 675 pictographic icons for easy<br>\
scalable vector graphics on websites. See <a href="#"><em>http://fontawesome.io</em></a> for more details.\
</html>

# Strings for Glyphicons
IMAGES.IONICONS.NAME=Ionicons
IMAGES.IONICONS.HINT=<html>\
MEDIA.IONICONS.NAME=Ionicons
MEDIA.IONICONS.HINT=<html>\
The premium icon font for Ionic Framework.<br>\
100% free and open source. MIT Licensed.<br>\
See <a href="#"><em>http://ionicons.com</em></a> for more details.\
</html>

# Strings for Carousel
MEDIA.CAROUSEL.NAME=Carousel
MEDIA.CAROUSEL.HINT=<html>\
A slideshow component for cycling through elements, like a carousel.<br>\
<strong>Nested carousels are not supported.</strong>\
</html>

# Strings for Google Maps
MEDIA.MAP.NAME=Google Maps
MEDIA.MAP.HINT=<html>\
Embed Google Maps into your webpage using this<br>\
Requires a free Google Maps API Key\
</html>

# Strings for BlankPageCustomizer.java
BlankPageCustomizer.jLabel1.text=Page Title
BlankPageCustomizer.jLabel2.text=Bootstrap CSS
Expand Down Expand Up @@ -372,5 +384,41 @@ Especially useful in things like nav lists & list groups.\
FontAwesomeCustomizer.flipVertical.toolTipText=Use this to arbitrarily flip icons vertically
FontAwesomeCustomizer.flipHorizontal.toolTipText=Use this to arbitrarily flip icons horizontally

# Strings for GlyphiconCustomizer.java
# Strings for IoniconCustomizer.java
IoniconCustomizer.isAriaHidden.text=Add aria-hidden="true" (To improve web accessibility, add this option to hide icons used purely for decoration from screen-readers.)

#Strings for CarouselCustomizer.java
CarouselCustomizer.jLabel1.text=Carousel Settings
CarouselCustomizer.jLabel2.text=Interval(ms)
CarouselCustomizer.jLabel3.text=Start from
CarouselCustomizer.dialogOKBtn.text=OK
CarouselCustomizer.dialogCancelBtn.text=Cancel
CarouselCustomizer.jLabel4.text=Number of slides
CarouselCustomizer.autoChange.text=Change slides automatically
CarouselCustomizer.pauseOnHover.text=Pause carousel on mouse hover
CarouselCustomizer.repeatOnce.text=Stop at the last item
CarouselCustomizer.allowKeyboard.text=Allow keyboard control
CarouselCustomizer.showIndicators.text=Show indicators
CarouselCustomizer.livePreview.TabConstraints.tabTitle=Live Preview
CarouselCustomizer.generatedCode.TabConstraints.tabTitle=Generated Code

# Strings for MapCustomizer.java
MapCustomizer.jLabel2.text=Mode
MapCustomizer.jLabel4.text=Zoom
MapCustomizer.jLabel3.text=Type
MapCustomizer.jLabel5.text=API Key
MapCustomizer.getKeyBtn.text=GET A KEY
MapCustomizer.jLabel7.text=Width
MapCustomizer.jLabel8.text=Height
MapCustomizer.jLabel9.text=Address
MapCustomizer.jLabel11.text=Type
MapCustomizer.jLabel6.text=Zoom
MapCustomizer.jLabel10.text=Origin
MapCustomizer.jLabel12.text=Destination
MapCustomizer.jLabel15.text=Type
MapCustomizer.jLabel14.text=Zoom
MapCustomizer.jLabel13.text=Search Terms
MapCustomizer.jLabel18.text=Type
MapCustomizer.jLabel17.text=Zoom
MapCustomizer.jLabel16.text=Coordinates
MapCustomizer.jLabel19.text=Coordinates
133 changes: 133 additions & 0 deletions src/org/tauquir/palette4bootstrap/items/Carousel.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
/*
* palette4bootstrap - A netbeans palette plugin for the Bootstrap
* Copyright (c) 2017-2018 Tauquir Ahmed ([email protected])
* Licensed under the MIT License.
*/
package org.tauquir.palette4bootstrap.items;

import javax.swing.text.BadLocationException;
import javax.swing.text.JTextComponent;
import org.openide.text.ActiveEditorDrop;
import org.tauquir.palette4bootstrap.bsPaletteUtilities;

public class Carousel implements ActiveEditorDrop {

private boolean autoChange = true;
private boolean pauseOnHover = true;
private boolean repeatOnce = false;
private boolean allowKeyboard = true;
private boolean showIndicators = true;
private int startIndex = 0;
private int numberOfSlides = 1;
private int autoChangeInterval = 5000;

public Carousel() {
}

public String generateBody() {
StringBuilder code = new StringBuilder();
code.append("<div id=\"carousel-1\" class=\"carousel slide\" data-ride=\"carousel\"");
if (autoChange) {
code.append(" data-interval=\"").append(autoChangeInterval).append("\"");
} else {
code.append(" data-interval=\"false\"");
}
if (!pauseOnHover) {
code.append(" data-pause=\"false\"");
}
if (repeatOnce) {
code.append(" data-wrap=\"false\"");
}
if (!allowKeyboard) {
code.append(" data-keyboard=\"false\"");
}
code.append(">\n");
if (showIndicators) {
code.append(" <!-- Indicators -->\n")
.append(" <ol class=\"carousel-indicators\">\n");
for (int i = 0; i < numberOfSlides; i++) {
code.append(" <li data-target=\"#carousel-1\" data-slide-to=\"").append(i).append("\"");
if (i == startIndex) {
code.append(" class=\"active\"");
}
code.append("></li>\n");
}
code.append(" </ol>\n");
}
code.append(" <!-- Wrapper for slides -->\n")
.append(" <div class=\"carousel-inner\" role=\"listbox\">\n");
for (int i = 0; i < numberOfSlides; i++) {
code.append(" <div class=\"item");
if (i == startIndex) {
code.append(" active");
}
code.append("\">\n")
.append(" <img src=\"http://via.placeholder.com/494x393?text=Slide+Preview\" alt=\"Carousel Image\">\n")
.append(" <div class=\"carousel-caption\">\n")
.append(" <h3>Caption Heading</h3>\n")
.append(" <p>Caption Body goes here</p>\n")
.append(" </div>\n")
.append(" </div>\n");
}
code.append(" </div>\n");
code.append(" <!-- Controls -->\n")
.append(" <a class=\"left carousel-control\" href=\"#carousel-1\" role=\"button\" data-slide=\"prev\">\n")
.append(" <span class=\"glyphicon glyphicon-chevron-left\" aria-hidden=\"true\"></span>\n")
.append(" <span class=\"sr-only\">Previous</span>\n")
.append(" </a>\n")
.append(" <a class=\"right carousel-control\" href=\"#carousel-1\" role=\"button\" data-slide=\"next\">\n")
.append(" <span class=\"glyphicon glyphicon-chevron-right\" aria-hidden=\"true\"></span>\n")
.append(" <span class=\"sr-only\">Next</span>\n")
.append(" </a>\n");
code.append("</div>\n");
return code.toString();
}

public void setAutoChange(boolean autoChange) {
this.autoChange = autoChange;
}

public void setPauseOnHover(boolean pauseOnHover) {
this.pauseOnHover = pauseOnHover;
}

public void setRepeatOnce(boolean repeatOnce) {
this.repeatOnce = repeatOnce;
}

public void setAllowKeyboard(boolean allowKeyboard) {
this.allowKeyboard = allowKeyboard;
}

public void setShowIndicators(boolean showIndicators) {
this.showIndicators = showIndicators;
}

public void setAutoChangeInterval(int autoChangeInterval) {
this.autoChangeInterval = autoChangeInterval;
}

public void setStartIndex(int startIndex) {
this.startIndex = startIndex;
}

public void setNumberOfSlides(int numberOfSlides) {
this.numberOfSlides = numberOfSlides;
}

@Override
public boolean handleTransfer(JTextComponent targetComponent) {
CarouselCustomizer c = new CarouselCustomizer(this);
boolean accept = c.showDialog();
if (accept) {
String body = generateBody();
try {
bsPaletteUtilities.insert(body, targetComponent);
} catch (BadLocationException ble) {
accept = false;
}
}
return accept;
}

}
Loading

0 comments on commit cd7e2fc

Please sign in to comment.