A PHP Error was encountered

Severity: 8192

Message: Function create_function() is deprecated

Filename: geshi/geshi.php

Line Number: 4698

Backtrace:

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4698
Function: _error_handler

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4621
Function: _optimize_regexp_list_tokens_to_string

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 1655
Function: optimize_regexp_list

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2029
Function: optimize_keyword_group

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2168
Function: build_parse_cache

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/Process.php
Line: 45
Function: parse_code

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/models/Pastes.php
Line: 517
Function: syntax

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/controllers/Main.php
Line: 693
Function: getPaste

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/index.php
Line: 315
Function: require_once

Untitled - Stikked
From Cobalt Plover, 9 Years ago, written in JavaScript.
Embed
  1. angular.module('Discuss.EditComment', [
  2.     'Discuss.paths',
  3.     'Discuss.templates',
  4.     'Discuss.Utils.Localization.LocalizeFilter',
  5.     'JetRichtextEditor',
  6.     'Discuss.SubmitButton',
  7.     'Discuss.AttachFile',
  8.     'Discuss.PostDetail.Svc',
  9.     'Discuss.CleanWysiwyg'
  10. ])
  11. .directive('editComment', [
  12.     '$log',
  13.     'DiscussRestAPIEndpoints',
  14.     'DISCUSS_ROOT_PATH',
  15.     'DiscussPostDetailSvc',
  16.     '$filter',
  17.     '$timeout',
  18.     function($log, DiscussRestAPIEndpoints, DISCUSS_ROOT_PATH, DiscussPostDetailSvc, $filter, $timeout) {
  19.         'use strict';
  20.  
  21.         return {
  22.             restrict: 'EA',
  23.             scope: {
  24.                 post: '=',
  25.                 attachmentsEnabled: '=?'
  26.             },
  27.             templateUrl: DISCUSS_ROOT_PATH + '/components/edit-comment/edit-comment.html',
  28.             controller: ['$scope', function($scope) {
  29.                 var ctrl = this,
  30.                     cleanWysiwygFilter = $filter('cleanWysiwyg');
  31.                 $scope.fileAttachSuccess = false;
  32.                 $scope.attachmentsEnabled = $scope.attachmentsEnabled || false;
  33.                 $scope.post.body = cleanWysiwygFilter($scope.post.body);
  34.                 $scope.originalBody = $scope.post.body;
  35.                 $scope.originalAttachment = $scope.post.attachment || {};
  36.                 $scope.originalPost = {
  37.                     post: $scope.originalBody,
  38.                     attachment: $scope.originalAttachment
  39.                 };
  40.  
  41.                 $scope.cancel = function() {
  42.                     $scope.post.body = $scope.originalBody;
  43.                     $scope.post.attachment = $scope.originalAttachment;
  44.                     $scope.$emit('discussion.editComment.cancel', $scope.post);
  45.                     $log.debug('Event emitted: discussion.editComment.cancel, Source: editComment');
  46.                 };
  47.  
  48.                 $scope.hasChanged = function() {
  49.                     return !angular.equals($scope.post.attachment, $scope.originalAttachment) ||
  50.                         !angular.equals($scope.post.body, $scope.originalBody);
  51.                 };
  52.  
  53.                 $scope.submit = function() {
  54.                     if ($scope.hasChanged() && $scope.editCommentForm.$valid) {
  55.  
  56.                         $scope.$emit('discussion.editComment.submit', $scope.post);
  57.                         $log.debug('Event emitted: discussion.editComment.update, Source: editComment, Post: ',
  58.                             $scope.post);
  59.  
  60.                         // if attachments are enabled, emit to host that there is attachment data
  61.                         // then wait $on discussion.editComment.postUpdated
  62.                         // otherwise update the post as normal
  63.                         if ($scope.attachmentsEnabled) {
  64.                             $scope.$emit('discussion.editComment.updatePost', $scope.post);
  65.                         } else {
  66.                             $scope.updatePost($scope.post);
  67.                         }
  68.                     }
  69.                 };
  70.  
  71.                 $scope.updatePost = function(updatedPost) {
  72.                     return DiscussRestAPIEndpoints.editPost($scope.post.boardId, $scope.post.id, updatedPost)
  73.                             .then(ctrl.emitUpdateSuccessfulEvent, ctrl.emitUpdateFailedEvent);
  74.                 };
  75.  
  76.                 $scope.isSubmitDisabled = function() {
  77.  
  78.                     return !!$scope.isUpdateInProgress ||
  79.                         $scope.editCommentForm.$invalid ||
  80.                         !$scope.hasChanged();
  81.                 };
  82.  
  83.                 ctrl.emitUpdateSuccessfulEvent = function(post) {
  84.                     $scope.$emit('discussion.editComment.updateSuccessful', post);
  85.                     $log.debug('Event emitted: editComment.updateSuccessful, Source: editComment');
  86.                 };
  87.  
  88.                 ctrl.emitUpdateFailedEvent = function(err) {
  89.                     $scope.$emit('discussion.editComment.updateFailed', err);
  90.                     $log.debug('Event emitted: editComment.updateFailed, Source: editComment');
  91.                 };
  92.  
  93.                 ctrl.enableUpdateSpinner = function(isUpdateInProgress) {
  94.                     $scope.isUpdateInProgress = isUpdateInProgress;
  95.                 };
  96.  
  97.                 $scope.$on('discussion.editComment.postUpdated', function(event, updatedPost) {
  98.                     $scope.updatePost(updatedPost);
  99.                 });
  100.  
  101.                 $scope.$on('discussion.editComment.edit', function(event, id) {
  102.                     $scope.post.showEditForm = $scope.post.id === id ? true : false;
  103.                     if ($scope.post.showEditForm) {
  104.                         $timeout(function() {
  105.                             $('#comment-' + id).focus();
  106.                         }, 0);
  107.                     } else {
  108.                         $scope.cancel();
  109.                     }
  110.                 });
  111.  
  112.                 $scope.$on('discussion.editComment.enableUpdateSpinner', function(event, isUpdateInProgress) {
  113.                     ctrl.enableUpdateSpinner(isUpdateInProgress);
  114.                 });
  115.  
  116.                 $scope.$on('attachment.button.triggered', function() {
  117.                     $scope.$emit('attachment.link.clicked');
  118.                 });
  119.  
  120.                 $scope.$on('discussion.attach.file.success', function(event, selectedFile) {
  121.                     $scope.post.attachment = {
  122.                         id: selectedFile.id,
  123.                         name: selectedFile.name
  124.                     };
  125.  
  126.                     $scope.$broadcast('attach.file.success', selectedFile);
  127.                 });
  128.             }]
  129.         };
  130.     }
  131. ]);
  132.