mirror of
https://gitlab.com/walljm/dynamicbible.git
synced 2025-07-25 00:09:54 -04:00
Merge upstream. And hook tag form up to the tagging api.
This commit is contained in:
commit
c1da5e6324
@ -156,7 +156,8 @@ h3 {
|
||||
|
||||
background-color: #fff;
|
||||
}
|
||||
.removeresult
|
||||
|
||||
.removeresult
|
||||
{
|
||||
float: left;
|
||||
display: block;
|
||||
@ -184,3 +185,73 @@ h3 {
|
||||
padding: 0px 12px;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.input-addtag {width: 200px; height: 36px;}
|
||||
.btn-addtag {width: 80px; height: 44px; margin-left: 3px;}
|
||||
|
||||
|
||||
|
||||
|
||||
a.trigger{
|
||||
position: absolute;
|
||||
background: url(images/open.png) 6% 55% no-repeat;
|
||||
text-decoration: none;
|
||||
font-size: 16px;
|
||||
letter-spacing:-1px;
|
||||
font-family: verdana, helvetica, arial, sans-serif;
|
||||
color:#fff;
|
||||
font-weight: bold;
|
||||
border-bottom: none;
|
||||
margin-left: 2px;
|
||||
|
||||
z-index:2;
|
||||
}
|
||||
a.trigger.left {
|
||||
left: 12px;
|
||||
}
|
||||
a.trigger.right {
|
||||
right: 12px;
|
||||
}
|
||||
a.trigger:hover {
|
||||
text-decoration: none;
|
||||
border-bottom: none;
|
||||
}
|
||||
a.active.trigger {
|
||||
background: url(images/close.png) 6% 55% no-repeat;
|
||||
}
|
||||
.panel {
|
||||
color:#000;
|
||||
position: absolute;
|
||||
display: none;
|
||||
background: #eee;
|
||||
width: 300px;
|
||||
height: auto;
|
||||
|
||||
z-index:1;
|
||||
}
|
||||
.panel.left {
|
||||
left: 10px;
|
||||
padding: 10px 20px 10px 60px;
|
||||
border-top-right-radius: 15px;
|
||||
-moz-border-radius-topright: 15px;
|
||||
-webkit-border-top-right-radius: 15px;
|
||||
-moz-border-radius-bottomright: 15px;
|
||||
-webkit-border-bottom-right-radius: 15px;
|
||||
border-bottom-right-radius: 15px;
|
||||
}
|
||||
.panel.right {
|
||||
right: 10px;
|
||||
padding: 10px 60px 10px 20px;
|
||||
border-bottom-left-radius: 15px;
|
||||
border-top-left-radius: 15px;
|
||||
-moz-border-radius-bottomleft: 15px;
|
||||
-moz-border-radius-topleft: 15px;
|
||||
-webkit-border-bottom-left-radius: 15px;
|
||||
-webkit-border-top-left-radius: 15px;
|
||||
}
|
||||
.panel p {
|
||||
font-size:11px;
|
||||
}
|
||||
a:focus { outline: none;}
|
BIN
css/images/close.png
Normal file
BIN
css/images/close.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.4 KiB |
BIN
css/images/minus.png
Normal file
BIN
css/images/minus.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 961 B |
BIN
css/images/open.png
Normal file
BIN
css/images/open.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.2 KiB |
BIN
css/images/plus.png
Normal file
BIN
css/images/plus.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 950 B |
61
js/common.js
61
js/common.js
@ -307,9 +307,18 @@ define(['jquery', 'reference', 'tagging', 'jquery.ui'],
|
||||
r += "<br />";
|
||||
}
|
||||
}
|
||||
// TODO(jwall): hover should show tags for the verse.
|
||||
var t = $("<div class='passage result'><a href='javascript:void();' class='removeresult' style='border: 0;'><img style='border: 0px;' src='images/delete.png' width='48' height='48' /></a><span class='resultbody'>" + "<h2><a href='http://www.dynamicbible.com/?r="+ ref.toString() + "'>" + ref.toString() + "</a></h2>" + r + "</span><br clear='all' /></div>");
|
||||
var t = $("<div class='passage result'><a href='javascript:void();' class='removeresult' style='border: 0;'><img style='border: 0px;' src='images/delete.png' width='48' height='48' /></a><a href='#' class='trigger left'> </a><div class='tags panel left'></div><span class='resultbody'>" + "<h2><a href='http://www.dynamicbible.com/?r="+ ref.toString() + "'>" + ref.toString() + "</a></h2>" + r + "</span><br clear='all' /></div>");
|
||||
var tagsform = $("<p>Tags: <br /><input type='text' class='input-addtag' /><button class='btn-addtag' type='button'>Update Tags</button></p>");
|
||||
tagging.GetTags(
|
||||
ref.toString(), {
|
||||
success: function(data) {
|
||||
var ts = data ?
|
||||
(data.data ?
|
||||
data.data.tagList : []) : [];
|
||||
tagsform.find('.input-addtag').val(ts.join(', '));
|
||||
}});
|
||||
|
||||
t.find(".panel").append(tagsform);
|
||||
Bible.AttachEvents(t, ref);
|
||||
$("#result").prepend(t);
|
||||
CurrentReferences[ref.toString()] = true;
|
||||
@ -389,30 +398,30 @@ define(['jquery', 'reference', 'tagging', 'jquery.ui'],
|
||||
return null;
|
||||
},
|
||||
AttachEvents: function(t, ref){
|
||||
t.find(".hiddenlink").click(function(e) {
|
||||
Util.HandleHiddenLink(e);
|
||||
});
|
||||
t.find(".removeresult").click(function(e) {
|
||||
Util.RemoveResult(e, ref);
|
||||
});
|
||||
// TODO(jwall): support longtouch events on mobile?
|
||||
t.find(".resultbody h2").tooltip({
|
||||
items: ".resultbody h2",
|
||||
content: function(tt) {
|
||||
tagging.GetTags(
|
||||
ref.toString(), {
|
||||
success: function(data) {
|
||||
var tags = data ?
|
||||
(data.data ?
|
||||
data.data.tagList : null) : null;
|
||||
var hoverContent =
|
||||
$("<div>Tags: </div>");
|
||||
hoverContent.append(
|
||||
tags ? tags.join(", ") : "N/A");
|
||||
tt(hoverContent);
|
||||
}});
|
||||
}
|
||||
});
|
||||
t.find(".hiddenlink").click(function(e) {
|
||||
Util.HandleHiddenLink(e);
|
||||
});
|
||||
t.find(".removeresult").click(function(e) {
|
||||
Util.RemoveResult(e, ref);
|
||||
});
|
||||
// TODO(jwall): support longtouch events on mobile?
|
||||
t.find(".resultbody h2").tooltip({
|
||||
items: ".resultbody h2",
|
||||
content: function(tt) {
|
||||
}});
|
||||
t.find('.btn-addtag').click(function(e) {
|
||||
var tags = $(e.target).parent().find(".input-addtag").val().split(', ');
|
||||
// TODO(jwall): add tags.
|
||||
tagging.UpdateTags(
|
||||
ref, tags, {success: function(req) {
|
||||
console.log("Updated Reference");
|
||||
}
|
||||
});
|
||||
});
|
||||
t.find('.trigger').slidePanel({
|
||||
triggerCss: 'margin-top: 60px; display: block; width: 48px; height: 48px;',
|
||||
panelCss: 'margin-top: 55px; border: 2px solid #666;'
|
||||
});
|
||||
}
|
||||
};
|
||||
var Strongs = {
|
||||
|
3
js/db.js
3
js/db.js
@ -27,6 +27,9 @@ define(
|
||||
Capable: function() {
|
||||
return typeof indexedDB != "undefined";
|
||||
},
|
||||
Delete: function() {
|
||||
// TODO(jwall): Delete databases.
|
||||
},
|
||||
// Turn on/off debug logging.
|
||||
ToggleDebug: function() {
|
||||
this.debug = !this.debug;
|
||||
|
58
js/jquery.slidePanel.js
Normal file
58
js/jquery.slidePanel.js
Normal file
@ -0,0 +1,58 @@
|
||||
/* jQuery slidePanel plugin
|
||||
* Examples and documentation at: http://www.jqeasy.com/
|
||||
* Version: 1.0 (22/03/2010)
|
||||
* No license. Use it however you want. Just keep this notice included.
|
||||
* Requires: jQuery v1.3+
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
(function($){
|
||||
$.fn.slidePanel = function(opts) {
|
||||
opts = $.extend({
|
||||
triggerName: '#trigger',
|
||||
triggerCss: '',
|
||||
panelCss:'',
|
||||
speed: 'fast',
|
||||
clickOutsideToClose: true
|
||||
}, opts || {});
|
||||
|
||||
|
||||
var trigger = this;
|
||||
var panel = $(this).parent().find(".panel");
|
||||
|
||||
// set css properties for trigger and panel
|
||||
trigger.attr('style',opts.triggerCss);
|
||||
panel.attr('style',opts.panelCss);
|
||||
panel.css('filter', 'alpha(opacity='+(opts.panelOpacity*100)+')');
|
||||
panel.css('opacity', opts.panelOpacity);
|
||||
|
||||
// triggerName mousedown event
|
||||
trigger.attr( "href", "javascript:void(0)" ).mousedown(function(e) {
|
||||
|
||||
panel.toggle(opts.speed);
|
||||
trigger.toggleClass("active");
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
if (opts.clickOutsideToClose) {
|
||||
// bind the 'mousedown' event to the document so we can close panel without having to click triggerName
|
||||
$(document).bind('mousedown',function(){
|
||||
panel.hide(opts.speed);
|
||||
trigger.removeClass('active');
|
||||
});
|
||||
|
||||
// don't close panel when clicking inside it
|
||||
panel.bind('mousedown',function(e){
|
||||
e.stopPropagation();
|
||||
});
|
||||
};
|
||||
};
|
||||
})(jQuery);
|
@ -1,4 +1,4 @@
|
||||
require(["jquery", "db", "common", "jquery.cookie", "jquery.ui"],
|
||||
require(["jquery", "db", "common", "reference", "jquery.cookie", "jquery.ui", "jquery.slidePanel"],
|
||||
function($, db, common) {
|
||||
$(document).ready(function()
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user