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

add support for bootstrap3 #179

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 5 additions & 1 deletion scripts/aloha-local.coffee
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
define ['cs!configs/aloha'], (AlohaConfig) ->
define ['jquery', 'cs!configs/aloha'], ($, AlohaConfig) ->
$.browser = {}
$.browser.msie = false
$.fn.live = $.fn.on # (events, data, handler) -> @on(events, data, handler)

AlohaConfig.settings.bundles.ghbook = '../../../bookish/scripts/aloha'
29 changes: 14 additions & 15 deletions scripts/config.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ require.config
hbs: "#{BOWER}/require-handlebars-plugin/hbs"

# ## Core Libraries
jquery: "#{BOWER}/jquery/jquery"
jquery: "#{BOWER}/jquery/dist/jquery"
underscore: "#{BOWER}/lodash/lodash"
backbone: "#{BOWER}/backbone/backbone"
# Layout manager for backbone
Expand All @@ -60,19 +60,19 @@ require.config
select2: "#{BOWER}/select2/select2"
moment: "#{BOWER}/moment/moment"
# Bootstrap Plugins
bootstrapAffix: "#{BOWER}/bootstrap/js/bootstrap-affix"
bootstrapAlert: "#{BOWER}/bootstrap/js/bootstrap-alert"
bootstrapButton: "#{BOWER}/bootstrap/js/bootstrap-button"
bootstrapCarousel: "#{BOWER}/bootstrap/js/bootstrap-carousel"
bootstrapCollapse: "#{BOWER}/bootstrap/js/bootstrap-collapse"
bootstrapDropdown: "#{BOWER}/bootstrap/js/bootstrap-dropdown"
bootstrapModal: "#{BOWER}/bootstrap/js/bootstrap-modal"
bootstrapPopover: "#{BOWER}/bootstrap/js/bootstrap-popover"
bootstrapScrollspy: "#{BOWER}/bootstrap/js/bootstrap-scrollspy"
bootstrapTab: "#{BOWER}/bootstrap/js/bootstrap-tab"
bootstrapTooltip: "#{BOWER}/bootstrap/js/bootstrap-tooltip"
bootstrapTransition: "#{BOWER}/bootstrap/js/bootstrap-transition"
bootstrapTypeahead: "#{BOWER}/bootstrap/js/bootstrap-typeahead"
bootstrapAffix: "#{BOWER}/bootstrap/js/affix"
bootstrapAlert: "#{BOWER}/bootstrap/js/alert"
bootstrapButton: "#{BOWER}/bootstrap/js/button"
bootstrapCarousel: "#{BOWER}/bootstrap/js/carousel"
bootstrapCollapse: "#{BOWER}/bootstrap/js/collapse"
bootstrapDropdown: "#{BOWER}/bootstrap/js/dropdown"
bootstrapModal: "#{BOWER}/bootstrap/js/modal"
bootstrapPopover: "#{BOWER}/bootstrap/js/popover"
bootstrapScrollspy: "#{BOWER}/bootstrap/js/scrollspy"
bootstrapTab: "#{BOWER}/bootstrap/js/tab"
bootstrapTooltip: "#{BOWER}/bootstrap/js/tooltip"
bootstrapTransition: "#{BOWER}/bootstrap/js/transition"
bootstrapTypeahead: "#{BOWER}/bootstrap/js/typeahead"
bootstrapTags: "#{BOWER}/bootstrapTags/dist/bootstrap-tagsinput.min"
bootstrapTagsCss: "#{BOWER}/bootstrapTags/dist/bootstrap-tagsinput"

Expand Down Expand Up @@ -146,7 +146,6 @@ require.config
"css!#{BOWER}/aloha-editor/src/css/aloha.css"]
exports: 'Aloha'
init: () ->
jQuery.browser.version = 10000 # Hack to fix aloha-editor's version checking
require(['less!styles/gh-book/aloha-override.less']) # make sure this comes in after the aloha.css
if MINIFIED_ALOHA
Aloha.require ["css!aloha.css"]
Expand Down
52 changes: 38 additions & 14 deletions scripts/gh-book/auth-template.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</a>
<ul class="dropdown-menu pull-right">
{{#if isAuthenticated}}
<li><a href="" id="sign-out">Sign Out of "{{id}}"</a></li>
<li><a href="" id="sign-out">Sign Out of "{{id}}"</a></li>
{{else}}
<li><a href="" id="sign-in">Sign In</a></li>
{{/if}}
Expand All @@ -41,10 +41,12 @@
</div>

<!-- Sign in Modal -->
<div id="sign-in-modal" data-backdrop="false" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="sign-in-modal-label" aria-hidden="true">
<div id="sign-in-modal" data-backdrop="false" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="sign-in-modal-label" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="sign-in-modal-label">Sign in to Book Editor</h3>
<h3 id="sign-in-modal-label" class="modal-title">Sign in to Book Editor</h3>
</div>
<form class="modal-form" action="#" id="login-form">
<div class="modal-body">
Expand Down Expand Up @@ -73,14 +75,18 @@ <h3 id="sign-in-modal-label">Sign in to Book Editor</h3>
<button id="sign-in-ok" type="submit" class="btn btn-primary">Sign In</button>
</div>
</form>
</div>
</div>
</div>


<!-- Fork Book Modal -->
<div id="fork-book-modal" data-backdrop="false" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="fork-book-modal-label" aria-hidden="true">
<div id="fork-book-modal" data-backdrop="false" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="fork-book-modal-label" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="fork-book-modal-label">Copy this shelf!</h3>
<h3 id="fork-book-modal-label" class="modal-title">Copy this shelf!</h3>
</div>
<h4>&#160; Places I have permission to make changes:</h4>
<div class="modal-body">
Expand All @@ -91,25 +97,33 @@ <h4>&#160; Places I have permission to make changes:</h4>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Cancel</button>
</div>
</div>
</div>
</div>

<div id="fork-progress-modal" data-backdrop="false" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="fork-progress-modal-label" aria-hidden="true">
<div id="fork-progress-modal" data-backdrop="false" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="fork-progress-modal-label" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="fork-progress-modal-label">Copying in progress</h3>
<h3 id="fork-progress-modal-label" class="modal-title">Copying in progress</h3>
</div>
<div class="modal-body">
[Progress indicator here]
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Cancel</button>
</div>
</div>
</div>
</div>

<div id="fork-redirect-modal" data-backdrop="false" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="fork-redirect-modal-label" aria-hidden="true">
<div id="fork-redirect-modal" data-backdrop="false" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="fork-redirect-modal-label" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="fork-redirect-modal-label">Existing bookshelf</h3>
<h3 id="fork-redirect-modal-label" class="modal-title">Existing bookshelf</h3>
</div>
<div class="modal-body">
You already have a copy of this bookshelf.
Expand All @@ -118,14 +132,18 @@ <h3 id="fork-redirect-modal-label">Existing bookshelf</h3>
<button class="btn" data-dismiss="modal" aria-hidden="true">Cancel</button>
<button class="btn btn-primary">Take me there</button>
</div>
</div>
</div>
</div>


<!-- Edit Repository Modal -->
<div id="edit-repo-modal" data-backdrop="false" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="edit-repo-modal-label" aria-hidden="true">
<div id="edit-repo-modal" data-backdrop="false" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="edit-repo-modal-label" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="edit-repo-modal-label">Change Bookshelf</h3>
<h3 id="edit-repo-modal-label" class="modal-title">Change Bookshelf</h3>
</div>
<div class="modal-body">
<div class="pull-right">
Expand All @@ -139,7 +157,7 @@ <h3 id="edit-repo-modal-label">Change Bookshelf</h3>
<p>
<a href="" data-select-repo='{"repoUser":"{{defaultRepo.repoUser}}","repoName":"{{defaultRepo.repoName}}"}'>
Start with the demo bookshelf
</a>
</a>
({{defaultRepo.repoUser}} / {{defaultRepo.repoName}})
</p>
{{/unless}}
Expand Down Expand Up @@ -179,19 +197,25 @@ <h5>View or create another shelf:</h5>
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div>


<!-- Diffs Modal -->
<div id="diffs-modal" data-backdrop="false" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="diffs-modal-label" aria-hidden="true">
<div id="diffs-modal" data-backdrop="false" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="diffs-modal-label" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="diffs-modal-label">Unsaved Changes</h3>
<h3 id="diffs-modal-label" class="modal-title">Unsaved Changes</h3>
</div>
<div class="modal-body" style="font-size: x-small;">
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
</div>
</div>
</div>
</div>

8 changes: 6 additions & 2 deletions scripts/gh-book/welcome-sign-in-template.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<!-- Sign in Modal -->
<div id="sign-in-modal" data-backdrop="false" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="sign-in-modal-label" aria-hidden="true">
<div id="sign-in-modal" data-backdrop="false" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="sign-in-modal-label" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h3 id="sign-in-modal-label">Sign in to Github!</h3>
<h3 id="sign-in-modal-label" class="modal-title">Sign in to Github!</h3>
</div>
<div class="modal-body">
<p>To edit a book you must provide a username and password or an OAuth token.</p>
Expand All @@ -20,4 +22,6 @@ <h3 id="sign-in-modal-label">Sign in to Github!</h3>
<div class="modal-footer">
<button id="sign-in-ok" type="submit" class="btn btn-primary">Sign In</button>
</div>
</div>
</div>
</div>