forked from 0x2620/pandora
move enhancement of links into utils
This commit is contained in:
parent
d30c2ba78e
commit
30db2b8b63
4 changed files with 26 additions and 31 deletions
|
@ -109,7 +109,7 @@ window.onerror = function(error, url, line) {
|
||||||
gradient.style.background = theme == 'classic'
|
gradient.style.background = theme == 'classic'
|
||||||
? '-webkit-linear-gradient(top, rgba(224, 224, 224, 0.75), rgba(224, 224, 224, 1), rgba(224, 224, 224, 1))'
|
? '-webkit-linear-gradient(top, rgba(224, 224, 224, 0.75), rgba(224, 224, 224, 1), rgba(224, 224, 224, 1))'
|
||||||
: '-webkit-linear-gradient(top, rgba(32, 32, 32, 0.75), rgba(32, 32, 32, 1), rgba(32, 32, 32, 1))';
|
: '-webkit-linear-gradient(top, rgba(32, 32, 32, 0.75), rgba(32, 32, 32, 1), rgba(32, 32, 32, 1))';
|
||||||
loadingScreen = document.createElement('div');
|
var loadingScreen = document.createElement('div');
|
||||||
loadingScreen.setAttribute('id', 'loadingScreen');
|
loadingScreen.setAttribute('id', 'loadingScreen');
|
||||||
loadingScreen.className = 'OxScreen';
|
loadingScreen.className = 'OxScreen';
|
||||||
loadingScreen.style.position = 'absolute';
|
loadingScreen.style.position = 'absolute';
|
||||||
|
|
|
@ -111,16 +111,6 @@ pandora.ui.infoView = function(data) {
|
||||||
right: margin + statisticsWidth + margin + 'px',
|
right: margin + statisticsWidth + margin + 'px',
|
||||||
//background: 'green'
|
//background: 'green'
|
||||||
})
|
})
|
||||||
.bind({
|
|
||||||
click: function() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.bindEvent({
|
|
||||||
singleclick: function(e) {
|
|
||||||
$(e.target).is('a') && clickLink(e);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.appendTo($data.$element),
|
.appendTo($data.$element),
|
||||||
|
|
||||||
$statistics = $('<div>')
|
$statistics = $('<div>')
|
||||||
|
@ -134,6 +124,8 @@ pandora.ui.infoView = function(data) {
|
||||||
|
|
||||||
$browserImages = [];
|
$browserImages = [];
|
||||||
|
|
||||||
|
pandora.createLinks($text);
|
||||||
|
|
||||||
// Title -------------------------------------------------------------------
|
// Title -------------------------------------------------------------------
|
||||||
|
|
||||||
$('<div>')
|
$('<div>')
|
||||||
|
@ -174,7 +166,7 @@ pandora.ui.infoView = function(data) {
|
||||||
})
|
})
|
||||||
.append(
|
.append(
|
||||||
Ox.Editable({
|
Ox.Editable({
|
||||||
clickLink: clickLink,
|
clickLink: pandora.clickLink,
|
||||||
editable: isEditable,
|
editable: isEditable,
|
||||||
format: function(value) {
|
format: function(value) {
|
||||||
return value
|
return value
|
||||||
|
@ -212,7 +204,7 @@ pandora.ui.infoView = function(data) {
|
||||||
.html(formatKey(key).replace('</span>', ' </span>'))
|
.html(formatKey(key).replace('</span>', ' </span>'))
|
||||||
.appendTo($div);
|
.appendTo($div);
|
||||||
Ox.Editable({
|
Ox.Editable({
|
||||||
clickLink: clickLink,
|
clickLink: pandora.clickLink,
|
||||||
format: function(value) {
|
format: function(value) {
|
||||||
return value
|
return value
|
||||||
? formatValue(value.split(', '), key)
|
? formatValue(value.split(', '), key)
|
||||||
|
@ -490,15 +482,6 @@ pandora.ui.infoView = function(data) {
|
||||||
renderList();
|
renderList();
|
||||||
}
|
}
|
||||||
|
|
||||||
function clickLink(e) {
|
|
||||||
if (e.target.hostname == document.location.hostname) {
|
|
||||||
pandora.URL.push(e.target.pathname);
|
|
||||||
} else {
|
|
||||||
document.location.href = '/url=' + encodeURIComponent(e.target.href);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function editMetadata(key, value) {
|
function editMetadata(key, value) {
|
||||||
if (value != data[key]) {
|
if (value != data[key]) {
|
||||||
var edit = {id: data.id};
|
var edit = {id: data.id};
|
||||||
|
|
|
@ -15,12 +15,13 @@ pandora.ui.siteDialog = function(section) {
|
||||||
pandora.api.getPage({name: id}, function(result) {
|
pandora.api.getPage({name: id}, function(result) {
|
||||||
Ox.print('DATA::', result.data)
|
Ox.print('DATA::', result.data)
|
||||||
Ox.Editable({
|
Ox.Editable({
|
||||||
|
clickLink: pandora.clickLink,
|
||||||
editable: pandora.site.capabilities.canEditSitePages[pandora.user.level],
|
editable: pandora.site.capabilities.canEditSitePages[pandora.user.level],
|
||||||
tooltip: 'Doubleclick to edit',
|
tooltip: 'Doubleclick to edit',
|
||||||
type: 'textarea',
|
type: 'textarea',
|
||||||
value: result.data.body
|
value: result.data.body
|
||||||
})
|
})
|
||||||
.css({width: '100%'})
|
.css({width: '100%'/*, height: '100%'*/})
|
||||||
.bindEvent({
|
.bindEvent({
|
||||||
submit: function(data) {
|
submit: function(data) {
|
||||||
Ox.Request.clearCache('getPage');
|
Ox.Request.clearCache('getPage');
|
||||||
|
|
|
@ -134,15 +134,26 @@ pandora.addList = function() {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
pandora.clickLink = function(e) {
|
||||||
|
if (e.target.hostname == document.location.hostname) {
|
||||||
|
pandora.URL.push(e.target.pathname);
|
||||||
|
} else {
|
||||||
|
document.location.href = '/url=' + encodeURIComponent(e.target.href);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
pandora.createLinks = function($element) {
|
pandora.createLinks = function($element) {
|
||||||
$element.find('a').click(function(event) {
|
$element
|
||||||
if (event.target.hostname == document.location.hostname) {
|
.bind({
|
||||||
pandora.URL.push(event.target.pathname);
|
click: function() {
|
||||||
} else {
|
return false;
|
||||||
document.location.href = '/url=' + encodeURIComponent(event.target.href);
|
}
|
||||||
}
|
})
|
||||||
return false;
|
.bindEvent({
|
||||||
});
|
singleclick: function(e) {
|
||||||
|
$(e.target).is('a') && pandora.clickLink(e);
|
||||||
|
}
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
pandora.enableDragAndDrop = function($list, canMove) {
|
pandora.enableDragAndDrop = function($list, canMove) {
|
||||||
|
|
Loading…
Reference in a new issue