Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@
$('#leaveCommunity').click(function(){
$('#leaveCommunityLoading').show();
$('#leaveCommunityLink').hide();
$.ajax({
op.api.ajax({
type: 'GET',
url: openpne.apiBase + 'community/join.json',
data: 'community_id=<?php echo $community->getId() ?>&leave=true&apiKey=' + openpne.apiKey,
url: 'community/join.json',
data: {community_id: <?php echo $community->getId() ?>, leave: true},
success: function(json){
$('#leaveCommunityFinish').show();
$('#leaveCommunityLoading').hide();
Expand All @@ -100,10 +100,10 @@
$('#joinCommunity').click(function(){
$('#joinCommunityLoading').show();
$('#joinCommunityLink').hide();
$.ajax({
op.api.ajax({
type: 'GET',
url: openpne.apiBase + 'community/join.json',
data: 'community_id=<?php echo $community->getId() ?>&apiKey=' + openpne.apiKey,
url: 'community/join.json',
data: {community_id: <?php echo $community->getId() ?>},
success: function(json){
$('#joinCommunityFinish').show();
$('#joinCommunityLoading').hide();
Expand All @@ -114,6 +114,5 @@
},
});
});

});
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</script>
<script type="text/javascript">
$(function(){
$.getJSON( openpne.apiBase + 'member/search.json?target=community&target_id=<?php echo $community->getId() ?>&apiKey=' + openpne.apiKey, function(json) {
op.api.getJSON('member/search.json', {target: 'community', target_id: <?php echo $community->getId() ?>}, function(json) {
$('#communityMemberJoinListTemplate').tmpl(json.data).appendTo('#communityMemberJoinList');
$('#communityMemberJoinList').show();
$('#communityMemberJoinListLoading').hide();
Expand All @@ -19,8 +19,8 @@
});
$('#communityMemberJoinListSearch').blur(function(){
var keyword = $('#communityMemberJoinListSearch').val();
var requestData = { target: 'community', target_id: <?php echo $community->getId(); ?>, keyword: keyword, apiKey: openpne.apiKey };
$.getJSON( openpne.apiBase + 'member/search.json', requestData, function(json) {
var requestData = {target: 'community', target_id: <?php echo $community->getId(); ?>, keyword: keyword};
op.api.getJSON('member/search.json', requestData, function(json) {
$result = $('#communityMemberJoinListTemplate').tmpl(json.data);
$('#communityMemberJoinList').html($result);
$('#communityMemberJoinList').show();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</script>
<script type="text/javascript">
$(function(){
$.getJSON( openpne.apiBase + 'community/search.json?apiKey=' + openpne.apiKey, function(json) {
op.api.getJSON('community/search.json', function(json) {
if (json.data.length > 0) {
$('#joinCommunityListTemplate').tmpl(json.data).appendTo('#memberJoinCommunityList');
$('#memberJoinCommunityList').show();
Expand All @@ -24,8 +24,8 @@
});
$('#joinCommunitySearch').blur(function(){
var keyword = $('#joinCommunitySearch').val();
var requestData = { keyword: keyword, apiKey: openpne.apiKey };
$.getJSON( openpne.apiBase + 'community/search.json', requestData, function(json) {
var requestData = {keyword: keyword};
op.api.getJSON('community/search.json', requestData, function(json) {
if (json.data.length > 0) {
$result = $('#joinCommunityListTemplate').tmpl(json.data);
$('#memberJoinCommunityList').html($result);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</script>
<script type="text/javascript">
$(function(){
$.getJSON( openpne.apiBase + 'member/search.json?apiKey=' + openpne.apiKey + '&target=friend&target_id=<?php echo $member->getId()?>', function(json) {
op.api.getJSON('member/search.json', {target: 'friend', target_id: <?php echo $member->getId()?>, function(json) {
$('#friendListTemplate').tmpl(json.data).appendTo('#memberFriendList');
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</script>
<script type="text/javascript">
$(function(){
$.getJSON( openpne.apiBase + 'member/search.json?target=friend&target_id=<?php echo $member->getId() ?>&apiKey=' + openpne.apiKey, function(json) {
op.api.getJSON('member/search.json', {target: 'friend', target_id: <?php echo $member->getId() ?>}, function(json) {
$result = $('#friendListTemplate').tmpl(json.data);
$('#memberFriendList').html($result);
$('#memberFriendList').show();
Expand All @@ -20,8 +20,8 @@
});
$('#memberFriendSearch').blur(function(){
var keyword = $('#memberFriendSearch').val();
var requestData = { target: 'friend', target_id: <?php echo $member->getId(); ?>, keyword: keyword, apiKey: openpne.apiKey };
$.getJSON( openpne.apiBase + 'member/search.json', requestData, function(json) {
var requestData = {target: 'friend', target_id: <?php echo $member->getId(); ?>, keyword: keyword};
op.api.getJSON('member/search.json', requestData, function(json) {
$result = $('#friendListTemplate').tmpl(json.data);
$('#memberFriendList').html($result);
$('#memberFriendList').show();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</script>
<script type="text/javascript">
$(function(){
$.getJSON( openpne.apiBase + 'member/community.json?member_id=<?php echo $member->getId() ?>&apiKey=' + openpne.apiKey, function(json) {
op.api.getJSON('member/community.json', {member_id: <?php echo $member->getId() ?>}, function(json) {
$('#joinCommunityListTemplate').tmpl(json.data).appendTo('#memberJoinCommunityList');
$('#memberJoinCommunityList').show();
$('#memberJoinCommunityListLoading').hide();
Expand All @@ -19,8 +19,8 @@
});
$('#joinCommunitySearch').blur(function(){
var keyword = $('#joinCommunitySearch').val();
var requestData = { member_id: <?php echo $member->getId(); ?>, keyword: keyword, apiKey: openpne.apiKey };
$.getJSON( openpne.apiBase + 'member/community.json', requestData, function(json) {
var requestData = {member_id: <?php echo $member->getId(); ?>, keyword: keyword};
op.api.getJSON('member/community.json', requestData, function(json) {
$result = $('#joinCommunityListTemplate').tmpl(json.data);
$('#memberJoinCommunityList').html($result);
$('#memberJoinCommunityList').show();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
$('#addFriend').click(function(){
$('#addFriendLinkLoading').show();
$('#addFriendLink').hide();
$.ajax({
op.api.ajax({
type: 'GET',
url: openpne.apiBase + 'member/friend_request.json',
data: 'member_id=<?php echo $member->getId() ?>&apiKey=' + openpne.apiKey,
url: 'member/friend_request.json',
data: {member_id: <?php echo $member->getId() ?>},
success: function(json){
$('#addFriendLinkFinish').show();
$('#addFriendLinkLoading').hide();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</script>
<script type="text/javascript">
$(function(){
$.getJSON( openpne.apiBase + 'member/search.json?apiKey=' + openpne.apiKey, function(json) {
op.api.getJSON('member/search.json', function(json) {
$result = $('#friendListTemplate').tmpl(json.data);
$('#memberFriendList').html($result);
$('#memberFriendList').show();
Expand All @@ -20,8 +20,8 @@
});
$('#memberFriendSearch').blur(function(){
var keyword = $('#memberFriendSearch').val();
var requestData = { keyword: keyword, apiKey: openpne.apiKey };
$.getJSON( openpne.apiBase + 'member/search.json', requestData, function(json) {
var requestData = {keyword: keyword};
op.api.getJSON('member/search.json', requestData, function(json) {
$result = $('#friendListTemplate').tmpl(json.data);
$('#memberFriendList').html($result);
$('#memberFriendList').show();
Expand Down
15 changes: 11 additions & 4 deletions apps/pc_frontend/templates/_layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,28 @@
use_helper('Javascript');

use_javascript('jquery.min.js');
use_javascript('underscore-min.js');
use_javascript('backbone-min.js');
use_javascript('jquery.tmpl.min.js');
use_javascript('jquery.notify.js');
use_javascript('openpne/api.js');

use_javascript('op_notify.js');
$jsonData = array(
'apiKey' => $sf_user->getMemberApiKey(),
'apiBase' => app_url_for('api', 'homepage'),
);

$json = defined('JSON_PRETTY_PRINT') ? json_encode($jsonData, JSON_PRETTY_PRINT) : json_encode($jsonData);

echo javascript_tag('
var openpne = '.$json.';
');
?>
<?php endif ?>
<?php if (opConfig::get('enable_jsonapi') && opToolkit::isSecurePage()): ?>
<script type="text/javascript">
var op = {
api: <?php echo $json ?>
};
</script>
<?php endif ?>
<?php include_javascripts() ?>
<?php echo $op_config->get('pc_html_head') ?>
</head>
Expand Down
19 changes: 12 additions & 7 deletions apps/pc_frontend/templates/smtLayoutGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,18 @@
');
?>
<?php endif ?>
<?php op_smt_use_javascript('jquery.min.js') ?>
<?php op_smt_use_javascript('jquery.tmpl.min.js') ?>
<?php op_smt_use_javascript('smt_main') ?>
<?php op_smt_use_javascript('smt_notify') ?>
<?php op_smt_use_javascript('smt_tosaka') ?>
<?php op_smt_use_javascript('smt_menu') ?>
<?php op_smt_include_javascripts() ?>
<?php
op_smt_use_javascript('jquery.min.js');
op_smt_use_javascript('underscore-min.js');
op_smt_use_javascript('backbone-min.js');
op_smt_use_javascript('jquery.tmpl.min.js');
op_smt_use_javascript('jquery.notify.js');
op_smt_use_javascript('openpne/api.js');
op_smt_use_javascript('smt_main');
op_smt_use_javascript('smt_tosaka');
op_smt_use_javascript('smt_menu');
op_smt_include_javascripts();
?>
</head>
<body id="<?php printf('page_%s_%s', $this->getModuleName(), $this->getActionName()) ?>" class="<?php echo opToolkit::isSecurePage() ? 'secure_page' : 'insecure_page' ?>">
<?php if (isset($op_layout['community'])): ?>
Expand Down
28 changes: 17 additions & 11 deletions apps/pc_frontend/templates/smtLayoutHome.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,25 @@
);

$json = defined('JSON_PRETTY_PRINT') ? json_encode($jsonData, JSON_PRETTY_PRINT) : json_encode($jsonData);

echo javascript_tag('
var openpne = '.$json.';
');
?>
<script type="text/javascript">
var op = {
api: <?php echo $json ?>
};
</script>
<?php endif ?>
<?php op_smt_use_javascript('jquery.min.js') ?>
<?php op_smt_use_javascript('jquery.tmpl.min.js') ?>
<?php op_smt_use_javascript('smt_main') ?>
<?php op_smt_use_javascript('smt_notify') ?>
<?php op_smt_use_javascript('smt_tosaka') ?>
<?php op_smt_use_javascript('smt_menu') ?>
<?php op_smt_include_javascripts() ?>
<?php
op_smt_use_javascript('jquery.min.js');
op_smt_use_javascript('underscore-min.js');
op_smt_use_javascript('backbone-min.js');
op_smt_use_javascript('jquery.tmpl.min.js');
op_smt_use_javascript('jquery.notify.js');
op_smt_use_javascript('openpne/api.js');
op_smt_use_javascript('smt_main');
op_smt_use_javascript('smt_tosaka');
op_smt_use_javascript('smt_menu');
op_smt_include_javascripts();
?>
</head>
<body id="<?php printf('page_%s_%s', $this->getModuleName(), $this->getActionName()) ?>" class="<?php echo opToolkit::isSecurePage() ? 'secure_page' : 'insecure_page' ?>">
<?php include_partial('global/tosaka') ?>
Expand Down
28 changes: 17 additions & 11 deletions apps/pc_frontend/templates/smtLayoutMember.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,25 @@
);

$json = defined('JSON_PRETTY_PRINT') ? json_encode($jsonData, JSON_PRETTY_PRINT) : json_encode($jsonData);

echo javascript_tag('
var openpne = '.$json.';
');
?>
<script type="text/javascript">
var op = {
api: <?php echo $json ?>
};
</script>
<?php endif ?>
<?php op_smt_use_javascript('jquery.min.js') ?>
<?php op_smt_use_javascript('jquery.tmpl.min.js') ?>
<?php op_smt_use_javascript('smt_main') ?>
<?php op_smt_use_javascript('smt_notify') ?>
<?php op_smt_use_javascript('smt_tosaka') ?>
<?php op_smt_use_javascript('smt_menu') ?>
<?php op_smt_include_javascripts() ?>
<?php
op_smt_use_javascript('jquery.min.js');
op_smt_use_javascript('underscore-min.js');
op_smt_use_javascript('backbone-min.js');
op_smt_use_javascript('jquery.tmpl.min.js');
op_smt_use_javascript('jquery.notify.js');
op_smt_use_javascript('openpne/api.js');
op_smt_use_javascript('smt_main');
op_smt_use_javascript('smt_tosaka');
op_smt_use_javascript('smt_menu');
op_smt_include_javascripts();
?>
</head>
<body id="<?php printf('page_%s_%s', $this->getModuleName(), $this->getActionName()) ?>" class="<?php echo opToolkit::isSecurePage() ? 'secure_page' : 'insecure_page' ?>">
<?php include_partial('global/tosaka') ?>
Expand Down
28 changes: 17 additions & 11 deletions apps/pc_frontend/templates/smtLayoutSns.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,25 @@
);

$json = defined('JSON_PRETTY_PRINT') ? json_encode($jsonData, JSON_PRETTY_PRINT) : json_encode($jsonData);

echo javascript_tag('
var openpne = '.$json.';
');
?>
<script type="text/javascript">
var op = {
api: <?php echo $json ?>
};
</script>
<?php endif ?>
<?php op_smt_use_javascript('jquery.min.js') ?>
<?php op_smt_use_javascript('jquery.tmpl.min.js') ?>
<?php op_smt_use_javascript('smt_main') ?>
<?php op_smt_use_javascript('smt_notify') ?>
<?php op_smt_use_javascript('smt_tosaka') ?>
<?php op_smt_use_javascript('smt_menu') ?>
<?php op_smt_include_javascripts() ?>
<?php
op_smt_use_javascript('jquery.min.js');
op_smt_use_javascript('underscore-min.js');
op_smt_use_javascript('backbone-min.js');
op_smt_use_javascript('jquery.tmpl.min.js');
op_smt_use_javascript('jquery.notify.js');
op_smt_use_javascript('openpne/api.js');
op_smt_use_javascript('smt_main');
op_smt_use_javascript('smt_tosaka');
op_smt_use_javascript('smt_menu');
op_smt_include_javascripts();
?>
</head>
<body id="<?php printf('page_%s_%s', $this->getModuleName(), $this->getActionName()) ?>" class="<?php echo opToolkit::isSecurePage() ? 'secure_page' : 'insecure_page' ?>">

Expand Down
2 changes: 2 additions & 0 deletions web/js/backbone-min.js

Large diffs are not rendered by default.

16 changes: 7 additions & 9 deletions web/js/jquery.notify.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
$(this).click(function(){
if ( false == settings.isDisableRead )
{
$.getJSON( openpne.apiBase + 'push/read.json' , { 'id': notifyId, 'apiKey': openpne.apiKey }, function(d){
op.api.getJSON('push/read.json', {'id': notifyId}, function(d){
window.location = linkUrl;
});
}
Expand All @@ -30,11 +30,10 @@
var pushElement = $(this).parents('.push');
var memberId = pushElement.attr('data-member-id');
var notifyId = pushElement.attr('data-notify-id');
$.getJSON( openpne.apiBase + 'push/read.json' , { 'id': notifyId, 'apiKey': openpne.apiKey }, function(d){});
$.ajax({
url: openpne.apiBase + 'member/friend_accept.json',
op.api.ajax({
url: 'member/friend_accept.json',
type: 'GET',
data: 'member_id=' + memberId + '&apiKey=' + openpne.apiKey,
data: {member_id: memberId},
dataType: 'json',
success: function(data) {
if(data.status=='success'){
Expand Down Expand Up @@ -63,11 +62,10 @@
var pushElement = $(this).parents('.push');
var memberId = pushElement.attr('data-member-id');
var notifyId = pushElement.attr('data-notify-id');
$.getJSON( openpne.apiBase + 'push/read.json' , { 'id': notifyId, 'apiKey': openpne.apiKey }, function(d){});
$.ajax({
url: openpne.apiBase + 'member/friend_reject.json',
op.api.ajax({
url: 'member/friend_reject.json',
type: 'GET',
data: 'member_id=' + memberId + '&apiKey=' + openpne.apiKey,
data: {member_id: memberId},
dataType: 'json',
success: function(data) {
if(data.status=='success'){
Expand Down
Loading